main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor; // = true
  5. !(function () {
  6. 'use strict';
  7. function t(t, i) {
  8. return typeof t === i;
  9. }
  10. function i(t, i) {
  11. return t instanceof i;
  12. }
  13. function n(t) {
  14. return t && t.nodeType;
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0;
  18. }
  19. function o(t, i, n) {
  20. return (
  21. g.each(t, function (t, e) {
  22. n = i.call(e, n, t, e);
  23. }),
  24. n
  25. );
  26. }
  27. function r(t, i, n) {
  28. var e, o, r;
  29. if (t === i) return !0;
  30. if (!t || !i || t.constructor !== i.constructor) return !1;
  31. for (e = 0, o = n.length; o > e; e += 1) {
  32. if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1;
  33. if (t[r] !== i[r]) return !1;
  34. }
  35. return !0;
  36. }
  37. function s(t, i, n, e) {
  38. (this.left = E(t)),
  39. (this.top = E(i)),
  40. (this.width = E(n)),
  41. (this.height = E(e)),
  42. (this.right = this.left + this.width),
  43. (this.bottom = this.top + this.height);
  44. }
  45. function h(t, i, n, e) {
  46. (this.visible = t || 0),
  47. (this.viewport = i || 0),
  48. (this.possible = n || 0),
  49. (this.rects = (e && T({}, e)) || null);
  50. }
  51. function l(t, i) {
  52. (this.els = t), (this.viewport = i);
  53. }
  54. function c(t, i, n) {
  55. var e;
  56. return (
  57. g.inArray(n, q) >= 0 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  58. e ? e[n] : 0
  59. );
  60. }
  61. function u(t, i) {
  62. return t.val - i.val;
  63. }
  64. function a(t, i) {
  65. return i.val - t.val;
  66. }
  67. function f(t) {
  68. var i = s.ofContent(t, !0),
  69. n = s.ofViewport(t, !0),
  70. e = i.width - n.width,
  71. o = i.height - n.height;
  72. (this.content = i),
  73. (this.viewport = n),
  74. (this.width = 0 >= e ? null : n.left / e),
  75. (this.height = 0 >= o ? null : n.top / o),
  76. (this.left = n.left),
  77. (this.top = n.top),
  78. (this.right = i.right - n.right),
  79. (this.bottom = i.bottom - n.bottom);
  80. }
  81. function p(t) {
  82. this.el = t || window;
  83. }
  84. function d(t, i) {
  85. (this.context = t), (this.viewport = i), this.init();
  86. }
  87. function v(t, i, n, e) {
  88. (this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init();
  89. }
  90. function w(t) {
  91. t && t !== window && t !== document
  92. ? ((this.context = t), (this.$autoTarget = g(t)))
  93. : (this.context = window),
  94. this.init();
  95. }
  96. var g = jQuery,
  97. m = g(window),
  98. b = g(document),
  99. T = g.extend,
  100. y = g.isFunction,
  101. k = Math.max,
  102. V = Math.min,
  103. E = Math.round,
  104. x = (function () {
  105. var t = {},
  106. i = 1;
  107. return function (n) {
  108. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0;
  109. };
  110. })();
  111. T(s.prototype, {
  112. equals: function (t) {
  113. return r(this, t, ['left', 'top', 'width', 'height']);
  114. },
  115. area: function () {
  116. return this.width * this.height;
  117. },
  118. relativeTo: function (t) {
  119. return new s(this.left - t.left, this.top - t.top, this.width, this.height);
  120. },
  121. intersection: function (t) {
  122. if (!i(t, s)) return null;
  123. var n = k(this.left, t.left),
  124. e = V(this.right, t.right),
  125. o = k(this.top, t.top),
  126. r = V(this.bottom, t.bottom),
  127. h = e - n,
  128. l = r - o;
  129. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null;
  130. },
  131. envelope: function (t) {
  132. if (!i(t, s)) return this;
  133. var n = V(this.left, t.left),
  134. e = k(this.right, t.right),
  135. o = V(this.top, t.top),
  136. r = k(this.bottom, t.bottom),
  137. h = e - n,
  138. l = r - o;
  139. return new s(n, o, h, l);
  140. },
  141. }),
  142. T(s, {
  143. ofContent: function (t, i) {
  144. return t && t !== document && t !== window
  145. ? i
  146. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  147. : new s(
  148. t.offsetLeft - t.scrollLeft,
  149. t.offsetTop - t.scrollTop,
  150. t.scrollWidth,
  151. t.scrollHeight
  152. )
  153. : new s(0, 0, b.width(), b.height());
  154. },
  155. ofViewport: function (t, i) {
  156. return t && t !== document && t !== window
  157. ? i
  158. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  159. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  160. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height());
  161. },
  162. ofElement: function (t) {
  163. var i = g(t);
  164. if (!i.is(':visible')) return null;
  165. var n = i.offset();
  166. return new s(n.left, n.top, i.outerWidth(), i.outerHeight());
  167. },
  168. }),
  169. T(h.prototype, {
  170. equals: function (t) {
  171. return this.fracsEqual(t) && this.rectsEqual(t);
  172. },
  173. fracsEqual: function (t) {
  174. return r(this, t, ['visible', 'viewport', 'possible']);
  175. },
  176. rectsEqual: function (t) {
  177. return r(this.rects, t.rects, ['document', 'element', 'viewport']);
  178. },
  179. }),
  180. T(h, {
  181. of: function (t, i) {
  182. var e, o, r;
  183. return (
  184. (t = (n(t) && s.ofElement(t)) || t),
  185. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  186. t instanceof s && (e = t.intersection(i))
  187. ? ((o = e.area()),
  188. (r = V(t.width, i.width) * V(t.height, i.height)),
  189. new h(o / t.area(), o / i.area(), o / r, {
  190. document: e,
  191. element: e.relativeTo(t),
  192. viewport: e.relativeTo(i),
  193. }))
  194. : new h()
  195. );
  196. },
  197. });
  198. var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  199. S = ['possible', 'visible', 'viewport'];
  200. T(l.prototype, {
  201. sorted: function (t, i) {
  202. var n = this.viewport;
  203. return g
  204. .map(this.els, function (i) {
  205. return {
  206. el: i,
  207. val: c(i, n, t),
  208. };
  209. })
  210. .sort(i ? a : u);
  211. },
  212. best: function (t, i) {
  213. return this.els.length ? this.sorted(t, i)[0] : null;
  214. },
  215. }),
  216. T(f.prototype, {
  217. equals: function (t) {
  218. return r(this, t, [
  219. 'width',
  220. 'height',
  221. 'left',
  222. 'top',
  223. 'right',
  224. 'bottom',
  225. 'content',
  226. 'viewport',
  227. ]);
  228. },
  229. }),
  230. T(p.prototype, {
  231. equals: function (t) {
  232. return r(this, t, ['el']);
  233. },
  234. scrollState: function () {
  235. return new f(this.el);
  236. },
  237. scrollTo: function (t, i, n) {
  238. var e = g(this.el === window ? 'html,body' : this.el);
  239. (t = t || 0),
  240. (i = i || 0),
  241. (n = isNaN(n) ? 1e3 : n),
  242. e.stop(!0).animate(
  243. {
  244. scrollLeft: t,
  245. scrollTop: i,
  246. },
  247. n
  248. );
  249. },
  250. scroll: function (t, i, n) {
  251. var e = this.el === window ? m : g(this.el);
  252. (t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n);
  253. },
  254. scrollToRect: function (t, i, n, e) {
  255. (i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e);
  256. },
  257. scrollToElement: function (t, i, n, e) {
  258. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  259. this.scrollToRect(o, i, n, e);
  260. },
  261. });
  262. var C = {
  263. init: function () {
  264. (this.callbacks = g.Callbacks('memory unique')),
  265. (this.currVal = null),
  266. (this.prevVal = null),
  267. (this.checkProxy = g.proxy(this.check, this)),
  268. this.autoCheck();
  269. },
  270. bind: function (t) {
  271. this.callbacks.add(t);
  272. },
  273. unbind: function (t) {
  274. t ? this.callbacks.remove(t) : this.callbacks.empty();
  275. },
  276. trigger: function () {
  277. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal]);
  278. },
  279. check: function (t) {
  280. var i = this.updatedValue(t);
  281. return (
  282. void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  283. );
  284. },
  285. $autoTarget: m,
  286. autoEvents: 'load resize scroll',
  287. autoCheck: function (t) {
  288. this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy);
  289. },
  290. };
  291. T(d.prototype, C, {
  292. updatedValue: function () {
  293. var t = h.of(this.context, this.viewport);
  294. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  295. },
  296. }),
  297. T(v.prototype, C, {
  298. updatedValue: function () {
  299. var t = this.context.best(this.property, this.descending);
  300. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0;
  301. },
  302. }),
  303. T(w.prototype, C, {
  304. updatedValue: function () {
  305. var t = new f(this.context);
  306. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  307. },
  308. });
  309. var L = function (t, i) {
  310. var n = [].slice,
  311. e = jQuery,
  312. o = e.extend,
  313. r = e.isFunction,
  314. s = o({}, i),
  315. h = function (i, n, o, s) {
  316. return (
  317. (o = r(o) ? o.apply(i, n) : o),
  318. r(s[o])
  319. ? s[o].apply(i, n)
  320. : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  321. );
  322. },
  323. l = function () {
  324. return h(this, n.call(arguments), s.defaultStatic, l);
  325. },
  326. c = function (t) {
  327. return r(c[t])
  328. ? c[t].apply(this, n.call(arguments, 1))
  329. : h(this, n.call(arguments), s.defaultMethod, c);
  330. },
  331. u = function (t) {
  332. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u);
  333. };
  334. (u.prev = {
  335. statics: e[t],
  336. methods: e.fn[t],
  337. }),
  338. u(i),
  339. (e[t] = l),
  340. (e.fn[t] = c);
  341. },
  342. M = 'fracs';
  343. L(M, {
  344. statics: {
  345. version: '0.15.0',
  346. Rect: s,
  347. Fractions: h,
  348. Group: l,
  349. ScrollState: f,
  350. Viewport: p,
  351. FracsCallbacks: d,
  352. GroupCallbacks: v,
  353. ScrollStateCallbacks: w,
  354. fracs: function (t, i) {
  355. return h.of(t, i);
  356. },
  357. },
  358. methods: {
  359. content: function (t) {
  360. return this.length ? s.ofContent(this[0], t) : null;
  361. },
  362. envelope: function () {
  363. return o(this, function (t) {
  364. var i = s.ofElement(this);
  365. return t ? t.envelope(i) : i;
  366. });
  367. },
  368. fracs: function (i, n, o) {
  369. t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o));
  370. var r = M + '.fracs.' + x(o);
  371. return 'unbind' === i
  372. ? this.each(function () {
  373. var t = g(this).data(r);
  374. t && t.unbind(n);
  375. })
  376. : 'check' === i
  377. ? this.each(function () {
  378. var t = g(this).data(r);
  379. t && t.check();
  380. })
  381. : y(n)
  382. ? this.each(function () {
  383. var t = g(this),
  384. i = t.data(r);
  385. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n);
  386. })
  387. : this.length
  388. ? h.of(this[0], o)
  389. : null;
  390. },
  391. intersection: function () {
  392. return o(this, function (t) {
  393. var i = s.ofElement(this);
  394. return t ? t.intersection(i) : i;
  395. });
  396. },
  397. max: function (t, i, n) {
  398. return (
  399. y(i) || ((n = i), (i = null)),
  400. (n = e(n)),
  401. i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
  402. );
  403. },
  404. min: function (t, i, n) {
  405. return (
  406. y(i) || ((n = i), (i = null)),
  407. (n = e(n)),
  408. i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
  409. );
  410. },
  411. rect: function () {
  412. return this.length ? s.ofElement(this[0]) : null;
  413. },
  414. scrollState: function (i, n) {
  415. var e = M + '.scrollState';
  416. return (
  417. t(i, 'string') || ((n = i), (i = null)),
  418. 'unbind' === i
  419. ? this.each(function () {
  420. var t = g(this).data(e);
  421. t && t.unbind(n);
  422. })
  423. : 'check' === i
  424. ? this.each(function () {
  425. var t = g(this).data(e);
  426. t && t.check();
  427. })
  428. : y(n)
  429. ? this.each(function () {
  430. var t = g(this),
  431. i = t.data(e);
  432. i || ((i = new w(this)), t.data(e, i)), i.bind(n);
  433. })
  434. : this.length
  435. ? new f(this[0])
  436. : null
  437. );
  438. },
  439. scroll: function (t, i, n) {
  440. return this.each(function () {
  441. new p(this).scroll(t, i, n);
  442. });
  443. },
  444. scrollTo: function (t, i, n, o) {
  445. return (
  446. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  447. (t = e(t)),
  448. this.each(function () {
  449. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o);
  450. })
  451. );
  452. },
  453. scrollToThis: function (t, i, n, o) {
  454. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this;
  455. },
  456. softLink: function (t, i, n, o) {
  457. return (
  458. (o = new p(e(o))),
  459. this.filter('a[href^=#]').each(function () {
  460. var e = g(this);
  461. e.on('click', function () {
  462. o.scrollToElement(g(e.attr('href'))[0], t, i, n);
  463. });
  464. })
  465. );
  466. },
  467. sort: function (i, n, o) {
  468. return (
  469. t(n, 'boolean') || ((o = n), (n = null)),
  470. (o = e(o)),
  471. this.pushStack(
  472. g.map(new l(this, o).sorted(i, !n), function (t) {
  473. return t.el;
  474. })
  475. )
  476. );
  477. },
  478. viewport: function (t) {
  479. return this.length ? s.ofViewport(this[0], t) : null;
  480. },
  481. },
  482. defaultStatic: 'fracs',
  483. defaultMethod: 'fracs',
  484. });
  485. })();
  486. if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery");
  487. +(function (t) {
  488. 'use strict';
  489. function e(e) {
  490. return this.each(function () {
  491. var o = t(this),
  492. s = o.data('bs.tooltip'),
  493. n = 'object' == typeof e && e;
  494. (s || 'destroy' != e) &&
  495. (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]());
  496. });
  497. }
  498. var i = function (t, e) {
  499. (this.type =
  500. this.options =
  501. this.enabled =
  502. this.timeout =
  503. this.hoverState =
  504. this.$element =
  505. null),
  506. this.init('tooltip', t, e);
  507. };
  508. (i.VERSION = '3.2.0'),
  509. (i.DEFAULTS = {
  510. animation: !0,
  511. placement: 'top',
  512. selector: !1,
  513. template:
  514. '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  515. trigger: 'hover focus',
  516. title: '',
  517. delay: 0,
  518. html: !1,
  519. container: !1,
  520. viewport: {
  521. selector: 'body',
  522. padding: 0,
  523. },
  524. }),
  525. (i.prototype.init = function (e, i, o) {
  526. (this.enabled = !0),
  527. (this.type = e),
  528. (this.$element = t(i)),
  529. (this.options = this.getOptions(o)),
  530. (this.$viewport =
  531. this.options.viewport && t(this.options.viewport.selector || this.options.viewport));
  532. for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
  533. var r = s[n];
  534. if ('click' == r)
  535. this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this));
  536. else if ('manual' != r) {
  537. var a = 'hover' == r ? 'mouseenter' : 'focusin',
  538. l = 'hover' == r ? 'mouseleave' : 'focusout';
  539. this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)),
  540. this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this));
  541. }
  542. }
  543. this.options.selector
  544. ? (this._options = t.extend({}, this.options, {
  545. trigger: 'manual',
  546. selector: '',
  547. }))
  548. : this.fixTitle();
  549. }),
  550. (i.prototype.getDefaults = function () {
  551. return i.DEFAULTS;
  552. }),
  553. (i.prototype.getOptions = function (e) {
  554. return (
  555. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  556. e.delay &&
  557. 'number' == typeof e.delay &&
  558. (e.delay = {
  559. show: e.delay,
  560. hide: e.delay,
  561. }),
  562. e
  563. );
  564. }),
  565. (i.prototype.getDelegateOptions = function () {
  566. var e = {},
  567. i = this.getDefaults();
  568. return (
  569. this._options &&
  570. t.each(this._options, function (t, o) {
  571. i[t] != o && (e[t] = o);
  572. }),
  573. e
  574. );
  575. }),
  576. (i.prototype.enter = function (e) {
  577. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type);
  578. return (
  579. i ||
  580. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  581. t(e.currentTarget).data('bs.' + this.type, i)),
  582. clearTimeout(i.timeout),
  583. (i.hoverState = 'in'),
  584. i.options.delay && i.options.delay.show
  585. ? void (i.timeout = setTimeout(function () {
  586. // "in" == i.hoverState && i.show()
  587. }, i.options.delay.show))
  588. : i.show()
  589. );
  590. }),
  591. (i.prototype.leave = function (e) {
  592. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type);
  593. return (
  594. i ||
  595. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  596. t(e.currentTarget).data('bs.' + this.type, i)),
  597. clearTimeout(i.timeout),
  598. (i.hoverState = 'out'),
  599. i.options.delay && i.options.delay.hide
  600. ? void (i.timeout = setTimeout(function () {
  601. 'out' == i.hoverState && i.hide();
  602. }, i.options.delay.hide))
  603. : i.hide()
  604. );
  605. }),
  606. (i.prototype.show = function () {
  607. var e = t.Event('show.bs.' + this.type);
  608. if (this.hasContent() && this.enabled) {
  609. this.$element.trigger(e);
  610. var i = t.contains(document.documentElement, this.$element[0]);
  611. if (e.isDefaultPrevented() || !i) return;
  612. var o = this,
  613. s = this.tip(),
  614. n = this.getUID(this.type);
  615. this.setContent(),
  616. s.attr('id', n),
  617. this.$element.attr('aria-describedby', n),
  618. this.options.animation && s.addClass('fade');
  619. var r =
  620. 'function' == typeof this.options.placement
  621. ? this.options.placement.call(this, s[0], this.$element[0])
  622. : this.options.placement,
  623. a = /\s?auto?\s?/i,
  624. l = a.test(r);
  625. l && (r = r.replace(a, '') || 'top'),
  626. s
  627. .detach()
  628. .css({
  629. top: 0,
  630. left: 0,
  631. display: 'block',
  632. })
  633. .addClass(r)
  634. .data('bs.' + this.type, this),
  635. this.options.container
  636. ? s.appendTo(this.options.container)
  637. : s.insertAfter(this.$element);
  638. var p = this.getPosition(),
  639. h = s[0].offsetWidth,
  640. f = s[0].offsetHeight;
  641. if (l) {
  642. var u = r,
  643. c = this.$element.parent(),
  644. d = this.getPosition(c);
  645. (r =
  646. 'bottom' == r && p.top + p.height + f - d.scroll > d.height
  647. ? 'top'
  648. : 'top' == r && p.top - d.scroll - f < 0
  649. ? 'bottom'
  650. : 'right' == r && p.right + h > d.width
  651. ? 'left'
  652. : 'left' == r && p.left - h < d.left
  653. ? 'right'
  654. : r),
  655. s.removeClass(u).addClass(r);
  656. }
  657. var g = this.getCalculatedOffset(r, p, h, f);
  658. this.applyPlacement(g, r);
  659. var y = function () {
  660. o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null);
  661. };
  662. t.support.transition && this.$tip.hasClass('fade')
  663. ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150)
  664. : y();
  665. }
  666. }),
  667. (i.prototype.applyPlacement = function (e, i) {
  668. var o = this.tip(),
  669. s = o[0].offsetWidth,
  670. n = o[0].offsetHeight,
  671. r = parseInt(o.css('margin-top'), 10),
  672. a = parseInt(o.css('margin-left'), 10);
  673. isNaN(r) && (r = 0),
  674. isNaN(a) && (a = 0),
  675. (e.top = e.top + r),
  676. (e.left = e.left + a),
  677. t.offset.setOffset(
  678. o[0],
  679. t.extend(
  680. {
  681. using: function (t) {
  682. o.css({
  683. top: Math.round(t.top),
  684. left: Math.round(t.left),
  685. });
  686. },
  687. },
  688. e
  689. ),
  690. 0
  691. ),
  692. o.addClass('in');
  693. var l = o[0].offsetWidth,
  694. p = o[0].offsetHeight;
  695. 'top' == i && p != n && (e.top = e.top + n - p);
  696. var h = this.getViewportAdjustedDelta(i, e, l, p);
  697. h.left ? (e.left += h.left) : (e.top += h.top);
  698. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  699. u = h.left ? 'left' : 'top',
  700. c = h.left ? 'offsetWidth' : 'offsetHeight';
  701. o.offset(e), this.replaceArrow(f, o[0][c], u);
  702. }),
  703. (i.prototype.replaceArrow = function (t, e, i) {
  704. this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '');
  705. }),
  706. (i.prototype.setContent = function () {
  707. var t = this.tip(),
  708. e = this.getTitle();
  709. t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e),
  710. t.removeClass('fade in top bottom left right');
  711. }),
  712. (i.prototype.hide = function () {
  713. function e() {
  714. 'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type);
  715. }
  716. var i = this,
  717. o = this.tip(),
  718. s = t.Event('hide.bs.' + this.type);
  719. if (
  720. (this.$element.removeAttr('aria-describedby'),
  721. this.$element.trigger(s),
  722. !s.isDefaultPrevented())
  723. )
  724. return (
  725. o.removeClass('in'),
  726. t.support.transition && this.$tip.hasClass('fade')
  727. ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150)
  728. : e(),
  729. (this.hoverState = null),
  730. this
  731. );
  732. }),
  733. (i.prototype.fixTitle = function () {
  734. var t = this.$element;
  735. (t.attr('title') || 'string' != typeof t.attr('data-original-title')) &&
  736. t.attr('data-original-title', t.attr('title') || '').attr('title', '');
  737. }),
  738. (i.prototype.hasContent = function () {
  739. return this.getTitle();
  740. }),
  741. (i.prototype.getPosition = function (e) {
  742. e = e || this.$element;
  743. var i = e[0],
  744. o = 'BODY' == i.tagName;
  745. return t.extend(
  746. {},
  747. 'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
  748. {
  749. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  750. width: o ? t(window).width() : e.outerWidth(),
  751. height: o ? t(window).height() : e.outerHeight(),
  752. },
  753. o
  754. ? {
  755. top: 0,
  756. left: 0,
  757. }
  758. : e.offset()
  759. );
  760. }),
  761. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  762. return 'bottom' == t
  763. ? {
  764. top: e.top + e.height,
  765. left: e.left + e.width / 2 - i / 2,
  766. }
  767. : 'top' == t
  768. ? {
  769. top: e.top - o,
  770. left: e.left + e.width / 2 - i / 2,
  771. }
  772. : 'left' == t
  773. ? {
  774. top: e.top + e.height / 2 - o / 2,
  775. left: e.left - i,
  776. }
  777. : {
  778. top: e.top + e.height / 2 - o / 2,
  779. left: e.left + e.width,
  780. };
  781. }),
  782. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  783. var s = {
  784. top: 0,
  785. left: 0,
  786. };
  787. if (!this.$viewport) return s;
  788. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  789. r = this.getPosition(this.$viewport);
  790. if (/right|left/.test(t)) {
  791. var a = e.top - n - r.scroll,
  792. l = e.top + n - r.scroll + o;
  793. a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l);
  794. } else {
  795. var p = e.left - n,
  796. h = e.left + n + i;
  797. p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h);
  798. }
  799. return s;
  800. }),
  801. (i.prototype.getTitle = function () {
  802. var t,
  803. e = this.$element,
  804. i = this.options;
  805. return (t =
  806. e.attr('data-original-title') ||
  807. ('function' == typeof i.title ? i.title.call(e[0]) : i.title));
  808. }),
  809. (i.prototype.getUID = function (t) {
  810. do t += ~~(1e6 * Math.random());
  811. while (document.getElementById(t));
  812. return t;
  813. }),
  814. (i.prototype.tip = function () {
  815. return (this.$tip = this.$tip || t(this.options.template));
  816. }),
  817. (i.prototype.arrow = function () {
  818. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'));
  819. }),
  820. (i.prototype.validate = function () {
  821. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null));
  822. }),
  823. (i.prototype.enable = function () {
  824. this.enabled = !0;
  825. }),
  826. (i.prototype.disable = function () {
  827. this.enabled = !1;
  828. }),
  829. (i.prototype.toggleEnabled = function () {
  830. this.enabled = !this.enabled;
  831. }),
  832. (i.prototype.toggle = function (e) {
  833. var i = this;
  834. e &&
  835. ((i = t(e.currentTarget).data('bs.' + this.type)),
  836. i ||
  837. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  838. t(e.currentTarget).data('bs.' + this.type, i))),
  839. i.tip().hasClass('in') ? i.leave(i) : i.enter(i);
  840. }),
  841. (i.prototype.destroy = function () {
  842. clearTimeout(this.timeout),
  843. this.hide()
  844. .$element.off('.' + this.type)
  845. .removeData('bs.' + this.type);
  846. });
  847. var o = t.fn.tooltip;
  848. (t.fn.tooltip = e),
  849. (t.fn.tooltip.Constructor = i),
  850. (t.fn.tooltip.noConflict = function () {
  851. return (t.fn.tooltip = o), this;
  852. });
  853. })(jQuery);
  854. !(function (e, t, n) {
  855. 'undefined' != typeof module && module.exports
  856. ? (module.exports = n())
  857. : 'function' == typeof define && define.amd
  858. ? define(n)
  859. : (t[e] = n());
  860. })('Keen', this, function () {
  861. 'use strict';
  862. function Keen() {
  863. return _init.apply(this, arguments);
  864. }
  865. function _init(e) {
  866. if (_isUndefined(e))
  867. throw new Error(
  868. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  869. );
  870. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1)
  871. throw new Error('Please provide a projectId');
  872. this.configure(e);
  873. }
  874. function _extend(e) {
  875. for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n];
  876. return e;
  877. }
  878. function _isUndefined(e) {
  879. return void 0 === e;
  880. }
  881. function _type(e) {
  882. var t = e && e.constructor ? e.constructor.toString() : void 0;
  883. return t ? t.match(/function (.*)\(/)[1] : 'Null';
  884. }
  885. function _each(e, t, n) {
  886. var r;
  887. if (!e) return 0;
  888. if (((n = n ? n : e), 'array' === _type(e))) {
  889. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0;
  890. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0;
  891. return 1;
  892. }
  893. function _parse_params(e) {
  894. for (
  895. var t,
  896. n = {},
  897. r = /\+/g,
  898. i = /([^&=]+)=?([^&]*)/g,
  899. o = function (e) {
  900. return decodeURIComponent(e.replace(r, ' '));
  901. },
  902. a = e.split('?')[1];
  903. (t = i.exec(a));
  904. )
  905. n[o(t[1])] = o(t[2]);
  906. return n;
  907. }
  908. function _set_protocol(e) {
  909. switch (e) {
  910. case 'http':
  911. return 'http';
  912. case 'auto':
  913. return location.protocol.replace(/:/g, '');
  914. case 'https':
  915. case void 0:
  916. default:
  917. return 'https';
  918. }
  919. }
  920. function _set_request_type(e) {
  921. var t = e || 'jsonp',
  922. n = !1;
  923. return (
  924. ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) &&
  925. 'withCredentials' in new XMLHttpRequest() &&
  926. (n = !0),
  927. null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
  928. );
  929. }
  930. function _build_url(e) {
  931. return this.client.endpoint + '/projects/' + this.client.projectId + e;
  932. }
  933. function _uploadEvent(e, t, n, r, i) {
  934. var o = _build_url.apply(this, ['/events/' + e]),
  935. a = {};
  936. (n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e));
  937. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c]);
  938. switch (this.client.requestType) {
  939. case 'xhr':
  940. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i]);
  941. break;
  942. case 'jsonp':
  943. var s = JSON.stringify(a),
  944. l = Keen.Base64.encode(s);
  945. (o = o + '?api_key=' + this.client.writeKey),
  946. (o = o + '&data=' + l),
  947. (o = o + '&modified=' + new Date().getTime()),
  948. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  949. break;
  950. case 'beacon':
  951. var s = JSON.stringify(a),
  952. l = Keen.Base64.encode(s);
  953. (o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
  954. (o = o + '&data=' + encodeURIComponent(l)),
  955. (o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
  956. (o += '&c=clv1'),
  957. _request.beacon.apply(this, [o, null, r, i]);
  958. }
  959. }
  960. Keen.prototype.configure = function (e) {
  961. return (
  962. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  963. (e.protocol = _set_protocol(e.protocol)),
  964. (e.requestType = _set_request_type(e.requestType)),
  965. (this.client = {
  966. projectId: e.projectId,
  967. writeKey: e.writeKey,
  968. readKey: e.readKey,
  969. globalProperties: null,
  970. endpoint: e.protocol + '://' + e.host,
  971. requestType: e.requestType,
  972. }),
  973. Keen.trigger('client', this, e),
  974. this.trigger('ready'),
  975. this
  976. );
  977. };
  978. var _request = {
  979. xhr: function (e, t, n, r, i, o, a, c) {
  980. if (!i)
  981. return Keen.log(
  982. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  983. );
  984. var s = new XMLHttpRequest();
  985. if (
  986. ((s.onreadystatechange = function () {
  987. if (4 == s.readyState)
  988. if (s.status >= 200 && s.status < 300) {
  989. var e;
  990. try {
  991. e = JSON.parse(s.responseText);
  992. } catch (e) {
  993. Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e);
  994. }
  995. a && e && a(e);
  996. } else Keen.log('HTTP request failed.'), c && c(s, null);
  997. }),
  998. s.open(e, t, o),
  999. i && s.setRequestHeader('Authorization', i),
  1000. r && s.setRequestHeader('Content-Type', 'application/json'),
  1001. n)
  1002. )
  1003. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1004. var u = r ? JSON.stringify(r) : null;
  1005. s.send(u);
  1006. },
  1007. jsonp: function (e, t, n, r) {
  1008. if (!t)
  1009. return Keen.log(
  1010. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  1011. );
  1012. if (t && e.indexOf('api_key') < 0) {
  1013. var i = e.indexOf('?') > 0 ? '&' : '?';
  1014. e = e + i + 'api_key=' + t;
  1015. }
  1016. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a';
  1017. var a = !1;
  1018. (window[o] = function (e) {
  1019. (a = !0), n && e && n(e), (window[o] = void 0);
  1020. }),
  1021. (e = e + '&jsonp=' + o);
  1022. var c = document.createElement('script');
  1023. (c.id = 'keen-jsonp'),
  1024. (c.src = e),
  1025. document.getElementsByTagName('head')[0].appendChild(c),
  1026. (c.onreadystatechange = function () {
  1027. a === !1 && 'loaded' === this.readyState && ((a = !0), r && r());
  1028. }),
  1029. (c.onerror = function () {
  1030. a === !1 && ((a = !0), r && r());
  1031. });
  1032. },
  1033. beacon: function (e, t, n, r) {
  1034. if (t && e.indexOf('api_key') < 0) {
  1035. var i = e.indexOf('?') > 0 ? '&' : '?';
  1036. e = e + i + 'api_key=' + t;
  1037. }
  1038. var o = !1,
  1039. a = document.createElement('img');
  1040. (a.onload = function () {
  1041. if (((o = !0), 'naturalHeight' in this)) {
  1042. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror();
  1043. } else if (this.width + this.height === 0) return void this.onerror();
  1044. n &&
  1045. n({
  1046. created: !0,
  1047. });
  1048. }),
  1049. (a.onerror = function () {
  1050. (o = !0), r && r();
  1051. }),
  1052. (a.src = e);
  1053. },
  1054. },
  1055. Events = (Keen.Events = {
  1056. on: function (e, t) {
  1057. this.listeners || (this.listeners = {});
  1058. var n = this.listeners[e] || (this.listeners[e] = []);
  1059. return (
  1060. n.push({
  1061. callback: t,
  1062. }),
  1063. this
  1064. );
  1065. },
  1066. off: function (e, t) {
  1067. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this;
  1068. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1069. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1070. (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e]);
  1071. return this;
  1072. },
  1073. trigger: function (e) {
  1074. if (!this.listeners) return this;
  1075. for (
  1076. var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0;
  1077. r < n.length;
  1078. r++
  1079. )
  1080. n[r].callback.apply(this, t);
  1081. return this;
  1082. },
  1083. });
  1084. _extend(Keen.prototype, Events),
  1085. _extend(Keen, Events),
  1086. (Keen.loaded = !0),
  1087. (Keen.utils = {
  1088. each: _each,
  1089. extend: _extend,
  1090. parseParams: _parse_params,
  1091. }),
  1092. (Keen.ready = function (e) {
  1093. Keen.loaded ? e() : Keen.on('ready', e);
  1094. }),
  1095. (Keen.log = function (e) {
  1096. 'object' == typeof console && console.log('[Keen IO]', e);
  1097. });
  1098. var Plugins = (Keen.Plugins = {});
  1099. (Keen.prototype.addEvent = function () {
  1100. _uploadEvent.apply(this, arguments);
  1101. }),
  1102. (Keen.prototype.addEventSync = function (e, t, n, r) {
  1103. _uploadEvent.apply(this, [e, t, !1, n, r]);
  1104. }),
  1105. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  1106. var o = e,
  1107. a = o.metaKey,
  1108. c = o.target,
  1109. s = !1,
  1110. l = function () {};
  1111. return (
  1112. void 0 === r && (r = 500),
  1113. 'A' === c.nodeName
  1114. ? (l = function () {
  1115. a || s || ((s = !0), (window.location = c.href));
  1116. })
  1117. : 'FORM' === c.nodeName &&
  1118. (l = function () {
  1119. s || ((s = !0), c.submit());
  1120. }),
  1121. i &&
  1122. (l = function () {
  1123. s || ((s = !0), i());
  1124. }),
  1125. _uploadEvent.call(this, t, n, l, l),
  1126. setTimeout(function () {
  1127. l();
  1128. }, r),
  1129. !!a && void 0
  1130. );
  1131. }),
  1132. (Keen.prototype.setGlobalProperties = function (e) {
  1133. if (!this.client)
  1134. return Keen.log(
  1135. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  1136. );
  1137. if (!e || 'function' != typeof e)
  1138. throw new Error('Invalid value for global properties: ' + e);
  1139. this.client.globalProperties = e;
  1140. }),
  1141. (Keen.Base64 = {
  1142. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1143. encode: function (e) {
  1144. var t,
  1145. n,
  1146. r,
  1147. i,
  1148. o,
  1149. a,
  1150. c,
  1151. s = '',
  1152. l = 0,
  1153. u = this.map;
  1154. for (e = this.utf8.encode(e); l < e.length; )
  1155. (t = e.charCodeAt(l++)),
  1156. (n = e.charCodeAt(l++)),
  1157. (r = e.charCodeAt(l++)),
  1158. (i = t >> 2),
  1159. (o = ((3 & t) << 4) | (n >> 4)),
  1160. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1161. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1162. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c));
  1163. return s;
  1164. },
  1165. decode: function (e) {
  1166. var t,
  1167. n,
  1168. r,
  1169. i,
  1170. o,
  1171. a,
  1172. c,
  1173. s = '',
  1174. l = 0,
  1175. u = this.map,
  1176. f = String.fromCharCode;
  1177. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1178. (t = u.indexOf(e.charAt(l++))),
  1179. (n = u.indexOf(e.charAt(l++))),
  1180. (r = u.indexOf(e.charAt(l++))),
  1181. (i = u.indexOf(e.charAt(l++))),
  1182. (o = (t << 2) | (n >> 4)),
  1183. (a = ((15 & n) << 4) | (r >> 2)),
  1184. (c = ((3 & r) << 6) | i),
  1185. (s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''));
  1186. return this.utf8.decode(s);
  1187. },
  1188. utf8: {
  1189. encode: function (e) {
  1190. for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
  1191. (t = e.charCodeAt(r++)),
  1192. (n +=
  1193. 128 > t
  1194. ? i(t)
  1195. : t > 127 && 2048 > t
  1196. ? i((t >> 6) | 192) + i((63 & t) | 128)
  1197. : i((t >> 12) | 224) + i(((t >> 6) & 63) | 128) + i((63 & t) | 128));
  1198. return n;
  1199. },
  1200. decode: function (e) {
  1201. for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
  1202. (n = e.charCodeAt(i)),
  1203. (r +=
  1204. 128 > n
  1205. ? [o(n), i++][0]
  1206. : n > 191 && 224 > n
  1207. ? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
  1208. : [
  1209. o(
  1210. ((15 & n) << 12) |
  1211. ((63 & (t = e.charCodeAt(i + 1))) << 6) |
  1212. (63 & (c3 = e.charCodeAt(i + 2)))
  1213. ),
  1214. (i += 3),
  1215. ][0]);
  1216. return r;
  1217. },
  1218. },
  1219. }),
  1220. 'object' != typeof JSON && (JSON = {}),
  1221. (function () {
  1222. function f(e) {
  1223. return 10 > e ? '0' + e : e;
  1224. }
  1225. function quote(e) {
  1226. return (
  1227. (escapable.lastIndex = 0),
  1228. escapable.test(e)
  1229. ? '"' +
  1230. e.replace(escapable, function (e) {
  1231. var t = meta[e];
  1232. return 'string' == typeof t
  1233. ? t
  1234. : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4);
  1235. }) +
  1236. '"'
  1237. : '"' + e + '"'
  1238. );
  1239. }
  1240. function str(e, t) {
  1241. var n,
  1242. r,
  1243. i,
  1244. o,
  1245. a,
  1246. c = gap,
  1247. s = t[e];
  1248. switch (
  1249. (s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)),
  1250. 'function' == typeof rep && (s = rep.call(t, e, s)),
  1251. typeof s)
  1252. ) {
  1253. case 'string':
  1254. return quote(s);
  1255. case 'number':
  1256. return isFinite(s) ? String(s) : 'null';
  1257. case 'boolean':
  1258. case 'null':
  1259. return String(s);
  1260. case 'object':
  1261. if (!s) return 'null';
  1262. if (
  1263. ((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))
  1264. ) {
  1265. for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null';
  1266. return (
  1267. (i =
  1268. 0 === a.length
  1269. ? '[]'
  1270. : gap
  1271. ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']'
  1272. : '[' + a.join(',') + ']'),
  1273. (gap = c),
  1274. i
  1275. );
  1276. }
  1277. if (rep && 'object' == typeof rep)
  1278. for (o = rep.length, n = 0; o > n; n += 1)
  1279. 'string' == typeof rep[n] &&
  1280. ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i));
  1281. else
  1282. for (r in s)
  1283. Object.prototype.hasOwnProperty.call(s, r) &&
  1284. ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i));
  1285. return (
  1286. (i =
  1287. 0 === a.length
  1288. ? '{}'
  1289. : gap
  1290. ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}'
  1291. : '{' + a.join(',') + '}'),
  1292. (gap = c),
  1293. i
  1294. );
  1295. }
  1296. }
  1297. 'function' != typeof Date.prototype.toJSON &&
  1298. ((Date.prototype.toJSON = function () {
  1299. return isFinite(this.valueOf())
  1300. ? this.getUTCFullYear() +
  1301. '-' +
  1302. f(this.getUTCMonth() + 1) +
  1303. '-' +
  1304. f(this.getUTCDate()) +
  1305. 'T' +
  1306. f(this.getUTCHours()) +
  1307. ':' +
  1308. f(this.getUTCMinutes()) +
  1309. ':' +
  1310. f(this.getUTCSeconds()) +
  1311. 'Z'
  1312. : null;
  1313. }),
  1314. (String.prototype.toJSON =
  1315. Number.prototype.toJSON =
  1316. Boolean.prototype.toJSON =
  1317. function () {
  1318. return this.valueOf();
  1319. }));
  1320. var cx =
  1321. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1322. escapable =
  1323. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1324. gap,
  1325. indent,
  1326. meta = {
  1327. '\b': '\\b',
  1328. '\t': '\\t',
  1329. '\n': '\\n',
  1330. '\f': '\\f',
  1331. '\r': '\\r',
  1332. '"': '\\"',
  1333. '\\': '\\\\',
  1334. },
  1335. rep;
  1336. 'function' != typeof JSON.stringify &&
  1337. (JSON.stringify = function (e, t, n) {
  1338. var r;
  1339. if (((gap = ''), (indent = ''), 'number' == typeof n))
  1340. for (r = 0; n > r; r += 1) indent += ' ';
  1341. else 'string' == typeof n && (indent = n);
  1342. if (
  1343. ((rep = t),
  1344. t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))
  1345. )
  1346. throw new Error('JSON.stringify');
  1347. return str('', {
  1348. '': e,
  1349. });
  1350. }),
  1351. 'function' != typeof JSON.parse &&
  1352. (JSON.parse = function (text, reviver) {
  1353. function walk(e, t) {
  1354. var n,
  1355. r,
  1356. i = e[t];
  1357. if (i && 'object' == typeof i)
  1358. for (n in i)
  1359. Object.prototype.hasOwnProperty.call(i, n) &&
  1360. ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n]);
  1361. return reviver.call(e, t, i);
  1362. }
  1363. var j;
  1364. if (
  1365. ((text = String(text)),
  1366. (cx.lastIndex = 0),
  1367. cx.test(text) &&
  1368. (text = text.replace(cx, function (e) {
  1369. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4);
  1370. })),
  1371. /^[\],:{}\s]*$/.test(
  1372. text
  1373. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1374. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1375. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1376. ))
  1377. )
  1378. return (
  1379. (j = eval('(' + text + ')')),
  1380. 'function' == typeof reviver
  1381. ? walk(
  1382. {
  1383. '': j,
  1384. },
  1385. ''
  1386. )
  1387. : j
  1388. );
  1389. throw new SyntaxError('JSON.parse');
  1390. });
  1391. })(),
  1392. !(function (e, t, n) {
  1393. 'undefined' != typeof module && module.exports
  1394. ? (module.exports = n())
  1395. : 'function' == typeof define && define.amd
  1396. ? define(n)
  1397. : (t[e] = n());
  1398. })('domready', Keen.utils, function (e) {
  1399. function t(e) {
  1400. for (d = 1; (e = r.shift()); ) e();
  1401. }
  1402. var n,
  1403. r = [],
  1404. i = !1,
  1405. o = document,
  1406. a = o.documentElement,
  1407. c = a.doScroll,
  1408. s = 'DOMContentLoaded',
  1409. l = 'addEventListener',
  1410. u = 'onreadystatechange',
  1411. f = 'readyState',
  1412. p = c ? /^loaded|^c/ : /^loaded|c/,
  1413. d = p.test(o[f]);
  1414. return (
  1415. o[l] &&
  1416. o[l](
  1417. s,
  1418. (n = function () {
  1419. o.removeEventListener(s, n, i), t();
  1420. }),
  1421. i
  1422. ),
  1423. c &&
  1424. o.attachEvent(
  1425. u,
  1426. (n = function () {
  1427. /^c/.test(o[f]) && (o.detachEvent(u, n), t());
  1428. })
  1429. ),
  1430. (e = c
  1431. ? function (t) {
  1432. self != top
  1433. ? d
  1434. ? t()
  1435. : r.push(t)
  1436. : (function () {
  1437. try {
  1438. a.doScroll('left');
  1439. } catch (n) {
  1440. return setTimeout(function () {
  1441. e(t);
  1442. }, 50);
  1443. }
  1444. t();
  1445. })();
  1446. }
  1447. : function (e) {
  1448. d ? e() : r.push(e);
  1449. })
  1450. );
  1451. });
  1452. var loaded = window.Keen,
  1453. cached = window._Keen || {},
  1454. clients,
  1455. ready;
  1456. if (loaded && cached) {
  1457. (clients = cached.clients || {}), (ready = cached.ready || []);
  1458. for (var instance in clients)
  1459. if (clients.hasOwnProperty(instance)) {
  1460. var client = clients[instance];
  1461. for (var method in Keen.prototype)
  1462. Keen.prototype.hasOwnProperty(method) &&
  1463. (loaded.prototype[method] = Keen.prototype[method]);
  1464. if (
  1465. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1466. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1467. client._config && (client.configure.call(client, client._config), delete client._config),
  1468. client._setGlobalProperties)
  1469. ) {
  1470. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1471. client.setGlobalProperties.apply(client, globals[i]);
  1472. delete client._setGlobalProperties;
  1473. }
  1474. if (client._addEvent) {
  1475. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1476. client.addEvent.apply(client, queue[i]);
  1477. delete client._addEvent;
  1478. }
  1479. var callback = client._on || [];
  1480. if (client._on) {
  1481. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i]);
  1482. client.trigger('ready'), delete client._on;
  1483. }
  1484. }
  1485. for (var i = 0; i < ready.length; i++) {
  1486. var callback = ready[i];
  1487. Keen.on('ready', function () {
  1488. callback();
  1489. });
  1490. }
  1491. }
  1492. return (
  1493. Keen.loaded &&
  1494. setTimeout(function () {
  1495. Keen.utils.domready(function () {
  1496. Keen.trigger('ready');
  1497. });
  1498. }, 0),
  1499. Keen
  1500. );
  1501. });
  1502. !(function () {
  1503. var t = (window.analytics = window.analytics || []);
  1504. if (!t.initialize) {
  1505. if (t.invoked)
  1506. return void (
  1507. window.console &&
  1508. console.error &&
  1509. console.error('Segment snippet included twice.')
  1510. );
  1511. (t.invoked = !0),
  1512. (t.methods = [
  1513. 'trackSubmit',
  1514. 'trackClick',
  1515. 'trackLink',
  1516. 'trackForm',
  1517. 'pageview',
  1518. 'identify',
  1519. 'reset',
  1520. 'group',
  1521. 'track',
  1522. 'ready',
  1523. 'alias',
  1524. 'debug',
  1525. 'page',
  1526. 'once',
  1527. 'off',
  1528. 'on',
  1529. ]),
  1530. (t.factory = function (e) {
  1531. return function () {
  1532. var n = Array.prototype.slice.call(arguments);
  1533. return n.unshift(e), t.push(n), t;
  1534. };
  1535. });
  1536. for (var e = 0; e < t.methods.length; e++) {
  1537. var n = t.methods[e];
  1538. t[n] = t.factory(n);
  1539. }
  1540. (t.load = function (t) {
  1541. var e = document.createElement('script');
  1542. (e.type = 'text/javascript'),
  1543. (e.async = !0),
  1544. (e.src =
  1545. ('https:' === document.location.protocol ? 'https://' : 'http://') +
  1546. 'cdn.segment.com/analytics.js/v1/' +
  1547. t +
  1548. '/analytics.min.js');
  1549. var n = document.getElementsByTagName('script')[0];
  1550. n.parentNode.insertBefore(e, n);
  1551. }),
  1552. (t.SNIPPET_VERSION = '4.0.0');
  1553. }
  1554. })();
  1555. !(function (i, e) {
  1556. 'use strict';
  1557. var s = '',
  1558. r = '?',
  1559. o = 'function',
  1560. a = 'undefined',
  1561. n = 'object',
  1562. t = 'major',
  1563. d = 'model',
  1564. w = 'name',
  1565. l = 'type',
  1566. p = 'vendor',
  1567. m = 'version',
  1568. c = 'architecture',
  1569. u = 'console',
  1570. g = 'mobile',
  1571. f = 'tablet',
  1572. h = 'smarttv',
  1573. b = {
  1574. has: function (i, e) {
  1575. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1;
  1576. },
  1577. lowerize: function (i) {
  1578. return i.toLowerCase();
  1579. },
  1580. },
  1581. y = {
  1582. rgx: function () {
  1583. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1584. var c = m[p],
  1585. u = m[p + 1];
  1586. if (typeof i === a) {
  1587. i = {};
  1588. for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e);
  1589. }
  1590. for (s = r = 0; s < c.length; s++)
  1591. if ((w = c[s].exec(this.getUA()))) {
  1592. for (t = 0; t < u.length; t++)
  1593. (l = w[++r]),
  1594. (d = u[t]),
  1595. typeof d === n && d.length > 0
  1596. ? 2 == d.length
  1597. ? typeof d[1] == o
  1598. ? (i[d[0]] = d[1].call(this, l))
  1599. : (i[d[0]] = d[1])
  1600. : 3 == d.length
  1601. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1602. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1603. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1604. : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
  1605. : (i[d] = l ? l : e);
  1606. break;
  1607. }
  1608. if (w) break;
  1609. }
  1610. return i;
  1611. },
  1612. str: function (i, s) {
  1613. for (var o in s)
  1614. if (typeof s[o] === n && s[o].length > 0) {
  1615. for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o;
  1616. } else if (b.has(s[o], i)) return o === r ? e : o;
  1617. return i;
  1618. },
  1619. },
  1620. v = {
  1621. browser: {
  1622. oldsafari: {
  1623. major: {
  1624. 1: ['/8', '/1', '/3'],
  1625. 2: '/4',
  1626. '?': '/',
  1627. },
  1628. version: {
  1629. '1.0': '/8',
  1630. 1.2: '/1',
  1631. 1.3: '/3',
  1632. '2.0': '/412',
  1633. '2.0.2': '/416',
  1634. '2.0.3': '/417',
  1635. '2.0.4': '/419',
  1636. '?': '/',
  1637. },
  1638. },
  1639. },
  1640. device: {
  1641. sprint: {
  1642. model: {
  1643. 'Evo Shift 4G': '7373KT',
  1644. },
  1645. vendor: {
  1646. HTC: 'APA',
  1647. Sprint: 'Sprint',
  1648. },
  1649. },
  1650. },
  1651. os: {
  1652. windows: {
  1653. version: {
  1654. ME: '4.90',
  1655. 'NT 3.11': 'NT3.51',
  1656. 'NT 4.0': 'NT4.0',
  1657. 2e3: 'NT 5.0',
  1658. XP: ['NT 5.1', 'NT 5.2'],
  1659. Vista: 'NT 6.0',
  1660. 7: 'NT 6.1',
  1661. 8: 'NT 6.2',
  1662. 8.1: 'NT 6.3',
  1663. RT: 'ARM',
  1664. },
  1665. },
  1666. },
  1667. },
  1668. k = {
  1669. browser: [
  1670. [
  1671. /(opera\smini)\/((\d+)?[\w\.-]+)/i,
  1672. /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,
  1673. /(opera).+version\/((\d+)?[\w\.]+)/i,
  1674. /(opera)[\/\s]+((\d+)?[\w\.]+)/i,
  1675. ],
  1676. [w, m, t],
  1677. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1678. [[w, 'Opera'], m, t],
  1679. [
  1680. /(kindle)\/((\d+)?[\w\.]+)/i,
  1681. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1682. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1683. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1684. /(rekonq)((?:\/)[\w\.]+)*/i,
  1685. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i,
  1686. ],
  1687. [w, m, t],
  1688. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1689. [[w, 'IE'], m, t],
  1690. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1691. [[w, 'Yandex'], m, t],
  1692. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1693. [[w, /_/g, ' '], m, t],
  1694. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1695. [w, m, t],
  1696. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1697. [[w, 'Dolphin'], m, t],
  1698. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1699. [[w, 'Chrome'], m, t],
  1700. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1701. [m, t, [w, 'Mobile Safari']],
  1702. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1703. [m, t, w],
  1704. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1705. [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
  1706. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1707. [w, m, t],
  1708. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1709. [[w, 'Netscape'], m, t],
  1710. [
  1711. /(swiftfox)/i,
  1712. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1713. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1714. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1715. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1716. /(links)\s\(((\d+)?[\w\.]+)/i,
  1717. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1718. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1719. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i,
  1720. ],
  1721. [w, m, t],
  1722. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1723. [w, m, t],
  1724. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1725. [w, m],
  1726. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1727. [w, m, t],
  1728. [
  1729. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1730. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1731. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1732. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i,
  1733. ],
  1734. [w, m, t],
  1735. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1736. [w, m, t],
  1737. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1738. [[w, 'Flip Player'], m, t],
  1739. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1740. [w],
  1741. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1742. [w, m, t],
  1743. [
  1744. /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i,
  1745. /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
  1746. /(lavf)((\d+)[\d\.]+)/i,
  1747. ],
  1748. [w, m, t],
  1749. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1750. [[w, /_/g, ' '], m, t],
  1751. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1752. [w, m],
  1753. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1754. [w, m, t],
  1755. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1756. [w],
  1757. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1758. [w, m, t],
  1759. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1760. [w, m, t],
  1761. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1762. [w, m, t],
  1763. [
  1764. /(winamp)3 version ((\d+)[\w\.-]+)/i,
  1765. /(winamp)\s((\d+)[\w\.-]+)/i,
  1766. /(winamp)mpeg\/((\d+)[\w\.-]+)/i,
  1767. ],
  1768. [w, m, t],
  1769. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1770. [w],
  1771. [
  1772. /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i,
  1773. ],
  1774. [w, m, t],
  1775. [/(smp)((\d+)[\d\.]+)/i],
  1776. [w, m, t],
  1777. [
  1778. /(vlc) media player - version ((\d+)[\w\.]+)/i,
  1779. /(vlc)\/((\d+)[\w\.-]+)/i,
  1780. /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i,
  1781. /(foobar2000)\/((\d+)[\d\.]+)/i,
  1782. /(itunes)\/((\d+)[\d\.]+)/i,
  1783. ],
  1784. [w, m, t],
  1785. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1786. [[w, /-/g, ' '], m, t],
  1787. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1788. [m, t, [w, 'Windows']],
  1789. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1790. [w, m, t],
  1791. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1792. [[w, 'rad.io'], m, t],
  1793. ],
  1794. cpu: [
  1795. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1796. [[c, 'amd64']],
  1797. [/(ia32(?=;))/i],
  1798. [[c, b.lowerize]],
  1799. [/((?:i[346]|x)86)[;\)]/i],
  1800. [[c, 'ia32']],
  1801. [/windows\s(ce|mobile);\sppc;/i],
  1802. [[c, 'arm']],
  1803. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1804. [[c, /ower/, '', b.lowerize]],
  1805. [/(sun4\w)[;\)]/i],
  1806. [[c, 'sparc']],
  1807. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1808. [c, b.lowerize],
  1809. ],
  1810. device: [
  1811. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1812. [d, p, [l, f]],
  1813. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1814. [d, [p, 'Apple'], [l, f]],
  1815. [/(apple\s{0,1}tv)/i],
  1816. [
  1817. [d, 'Apple TV'],
  1818. [p, 'Apple'],
  1819. ],
  1820. [
  1821. /(hp).+(touchpad)/i,
  1822. /(kindle)\/([\w\.]+)/i,
  1823. /\s(nook)[\w\s]+build\/(\w+)/i,
  1824. /(dell)\s(strea[kpr\s\d]*[\dko])/i,
  1825. ],
  1826. [p, d, [l, f]],
  1827. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1828. [d, p, [l, g]],
  1829. [/\((ip[honed|\s\w*]+);/i],
  1830. [d, [p, 'Apple'], [l, g]],
  1831. [
  1832. /(blackberry)[\s-]?(\w+)/i,
  1833. /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
  1834. /(hp)\s([\w\s]+\w)/i,
  1835. /(asus)-?(\w+)/i,
  1836. ],
  1837. [p, d, [l, g]],
  1838. [/\((bb10);\s(\w+)/i],
  1839. [[p, 'BlackBerry'], d, [l, g]],
  1840. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1841. [[p, 'Asus'], d, [l, f]],
  1842. [/(sony)\s(tablet\s[ps])/i],
  1843. [p, d, [l, f]],
  1844. [/(nintendo)\s([wids3u]+)/i],
  1845. [p, d, [l, u]],
  1846. [/((playstation)\s[3portablevi]+)/i],
  1847. [[p, 'Sony'], d, [l, u]],
  1848. [/(sprint\s(\w+))/i],
  1849. [
  1850. [p, y.str, v.device.sprint.vendor],
  1851. [d, y.str, v.device.sprint.model],
  1852. [l, g],
  1853. ],
  1854. [
  1855. /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,
  1856. /(zte)-(\w+)*/i,
  1857. /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i,
  1858. ],
  1859. [p, [d, /_/g, ' '], [l, g]],
  1860. [
  1861. /\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
  1862. /(mot)[\s-]?(\w+)*/i,
  1863. ],
  1864. [[p, 'Motorola'], d, [l, g]],
  1865. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1866. [[p, 'Motorola'], d, [l, f]],
  1867. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1868. [[p, 'Samsung'], d, [l, f]],
  1869. [
  1870. /((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
  1871. /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
  1872. /sec-((sgh\w+))/i,
  1873. ],
  1874. [[p, 'Samsung'], d, [l, g]],
  1875. [/(sie)-(\w+)*/i],
  1876. [[p, 'Siemens'], d, [l, g]],
  1877. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1878. [[p, 'Nokia'], d, [l, g]],
  1879. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1880. [[p, 'Acer'], d, [l, f]],
  1881. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1882. [[p, 'LG'], d, [l, f]],
  1883. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1884. [[p, 'LG'], d, [l, g]],
  1885. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1886. [[p, 'Lenovo'], d, [l, f]],
  1887. [/(lg) netcast\.tv/i],
  1888. [p, [l, h]],
  1889. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1890. [l, p, d],
  1891. ],
  1892. engine: [
  1893. [
  1894. /(presto)\/([\w\.]+)/i,
  1895. /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  1896. /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  1897. /(icab)[\/\s]([23]\.[\d\.]+)/i,
  1898. ],
  1899. [w, m],
  1900. [/rv\:([\w\.]+).*(gecko)/i],
  1901. [m, w],
  1902. ],
  1903. os: [
  1904. [/microsoft\s(windows)\s(vista|xp)/i],
  1905. [w, m],
  1906. [
  1907. /(windows)\snt\s6\.2;\s(arm)/i,
  1908. /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i,
  1909. ],
  1910. [w, [m, y.str, v.os.windows.version]],
  1911. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1912. [
  1913. [w, 'Windows'],
  1914. [m, y.str, v.os.windows.version],
  1915. ],
  1916. [/\((bb)(10);/i],
  1917. [[w, 'BlackBerry'], m],
  1918. [
  1919. /(blackberry)\w*\/?([\w\.]+)*/i,
  1920. /(tizen)\/([\w\.]+)/i,
  1921. /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i,
  1922. ],
  1923. [w, m],
  1924. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1925. [[w, 'Symbian'], m],
  1926. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1927. [[w, 'Firefox OS'], m],
  1928. [
  1929. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1930. /(mint)[\/\s\(]?(\w+)*/i,
  1931. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1932. /(hurd|linux)\s?([\w\.]+)*/i,
  1933. /(gnu)\s?([\w\.]+)*/i,
  1934. ],
  1935. [w, m],
  1936. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1937. [[w, 'Chromium OS'], m],
  1938. [/(sunos)\s?([\w\.]+\d)*/i],
  1939. [[w, 'Solaris'], m],
  1940. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1941. [w, m],
  1942. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1943. [
  1944. [w, 'iOS'],
  1945. [m, /_/g, '.'],
  1946. ],
  1947. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1948. [w, [m, /_/g, '.']],
  1949. [
  1950. /(haiku)\s(\w+)/i,
  1951. /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  1952. /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
  1953. /(unix)\s?([\w\.]+)*/i,
  1954. ],
  1955. [w, m],
  1956. ],
  1957. },
  1958. x = function (e) {
  1959. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1960. return this instanceof x
  1961. ? ((this.getBrowser = function () {
  1962. return y.rgx.apply(this, k.browser);
  1963. }),
  1964. (this.getCPU = function () {
  1965. return y.rgx.apply(this, k.cpu);
  1966. }),
  1967. (this.getDevice = function () {
  1968. return y.rgx.apply(this, k.device);
  1969. }),
  1970. (this.getEngine = function () {
  1971. return y.rgx.apply(this, k.engine);
  1972. }),
  1973. (this.getOS = function () {
  1974. return y.rgx.apply(this, k.os);
  1975. }),
  1976. (this.getResult = function () {
  1977. return {
  1978. ua: this.getUA(),
  1979. browser: this.getBrowser(),
  1980. engine: this.getEngine(),
  1981. os: this.getOS(),
  1982. device: this.getDevice(),
  1983. cpu: this.getCPU(),
  1984. };
  1985. }),
  1986. (this.getUA = function () {
  1987. return r;
  1988. }),
  1989. (this.setUA = function (i) {
  1990. return (r = i), this;
  1991. }),
  1992. void this.setUA(r))
  1993. : new x(e).getResult();
  1994. };
  1995. if (typeof exports !== a)
  1996. typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x);
  1997. else if (
  1998. ((i.UAParser = x),
  1999. typeof define === o &&
  2000. define.amd &&
  2001. define(function () {
  2002. return x;
  2003. }),
  2004. typeof i.jQuery !== a)
  2005. ) {
  2006. var A = i.jQuery,
  2007. _ = new x();
  2008. (A.ua = _.getResult()),
  2009. (A.ua.get = function () {
  2010. return _.getUA();
  2011. }),
  2012. (A.ua.set = function (i) {
  2013. _.setUA(i);
  2014. var e = _.getResult();
  2015. for (var s in e) A.ua[s] = e[s];
  2016. });
  2017. }
  2018. })(this);
  2019. window.Modernizr = (function (n, e, t) {
  2020. function o(n) {
  2021. d.cssText = n;
  2022. }
  2023. function r(n, e) {
  2024. return typeof n === e;
  2025. }
  2026. var i,
  2027. c,
  2028. u,
  2029. a = '2.8.2',
  2030. f = {},
  2031. s = e.documentElement,
  2032. l = 'modernizr',
  2033. p = e.createElement(l),
  2034. d = p.style,
  2035. y = ({}.toString, {}),
  2036. w = [],
  2037. b = w.slice,
  2038. v = {}.hasOwnProperty;
  2039. (u =
  2040. r(v, 'undefined') || r(v.call, 'undefined')
  2041. ? function (n, e) {
  2042. return e in n && r(n.constructor.prototype[e], 'undefined');
  2043. }
  2044. : function (n, e) {
  2045. return v.call(n, e);
  2046. }),
  2047. Function.prototype.bind ||
  2048. (Function.prototype.bind = function (n) {
  2049. var e = this;
  2050. if ('function' != typeof e) throw new TypeError();
  2051. var t = b.call(arguments, 1),
  2052. o = function () {
  2053. if (this instanceof o) {
  2054. var r = function () {};
  2055. r.prototype = e.prototype;
  2056. var i = new r(),
  2057. c = e.apply(i, t.concat(b.call(arguments)));
  2058. return Object(c) === c ? c : i;
  2059. }
  2060. return e.apply(n, t.concat(b.call(arguments)));
  2061. };
  2062. return o;
  2063. }),
  2064. (y.webgl = function () {
  2065. return !!n.WebGLRenderingContext;
  2066. });
  2067. for (var h in y)
  2068. u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c));
  2069. return (
  2070. (f.addTest = function (n, e) {
  2071. if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o]);
  2072. else {
  2073. if (((n = n.toLowerCase()), f[n] !== t)) return f;
  2074. (e = 'function' == typeof e ? e() : e),
  2075. 'undefined' != typeof enableClasses &&
  2076. enableClasses &&
  2077. (s.className += ' ' + (e ? '' : 'no-') + n),
  2078. (f[n] = e);
  2079. }
  2080. return f;
  2081. }),
  2082. o(''),
  2083. (p = i = null),
  2084. (f._version = a),
  2085. f
  2086. );
  2087. })(this, this.document);
  2088. !(function (e, t, a) {
  2089. 'use strict';
  2090. function n(t, h, m) {
  2091. function H(a) {
  2092. var n = 0,
  2093. i = Ee.length;
  2094. if (
  2095. ((Ce.old = e.extend({}, Ce)),
  2096. (Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
  2097. (ke = Be[ge.horizontal ? 'width' : 'height']()),
  2098. (ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2099. (Ee.length = 0),
  2100. (Ce.start = 0),
  2101. (Ce.end = q(ze - Ie, 0)),
  2102. Re)
  2103. ) {
  2104. (n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0);
  2105. var r,
  2106. s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
  2107. o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
  2108. l = 'border-box' === e(qe).css('boxSizing'),
  2109. u = 'none' !== qe.css('float'),
  2110. f = 0,
  2111. v = qe.length - 1;
  2112. (ze = 0),
  2113. qe.each(function (t, a) {
  2114. var n = e(a),
  2115. i = a.getBoundingClientRect(),
  2116. l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
  2117. d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
  2118. p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
  2119. h = l + d + p,
  2120. m = !d || !p,
  2121. g = {};
  2122. (g.el = a),
  2123. (g.size = m ? l : h),
  2124. (g.half = g.size / 2),
  2125. (g.start = ze + (m ? d : 0)),
  2126. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  2127. (g.end = g.start - Ie + g.size),
  2128. t || (ze += s),
  2129. (ze += h),
  2130. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  2131. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  2132. Ne.push(g),
  2133. (r = g);
  2134. }),
  2135. (Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
  2136. (ze -= f),
  2137. Ne.length
  2138. ? ((Ce.start = Ne[0][Me ? 'center' : 'start']),
  2139. (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start))
  2140. : (Ce.start = Ce.end = 0);
  2141. }
  2142. if (
  2143. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  2144. Q(),
  2145. Se.length &&
  2146. ke > 0 &&
  2147. (ge.dynamicHandle
  2148. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)),
  2149. (Te = d(Te, ge.minHandleSize, ke)),
  2150. (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
  2151. : (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2152. (xe.end = ke - Te),
  2153. it || j()),
  2154. !we && Ie > 0)
  2155. ) {
  2156. var p = Ce.start,
  2157. h = '';
  2158. if (Re)
  2159. e.each(Ne, function (e, t) {
  2160. Me
  2161. ? Ee.push(t.center)
  2162. : t.start + t.size > p &&
  2163. p <= Ce.end &&
  2164. ((p = t.start),
  2165. Ee.push(p),
  2166. (p += Ie),
  2167. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end));
  2168. });
  2169. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie);
  2170. if (De[0] && i !== Ee.length) {
  2171. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m);
  2172. (Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass);
  2173. }
  2174. }
  2175. if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
  2176. a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt));
  2177. var g = Ne[Oe.activeItem];
  2178. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end));
  2179. } else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  2180. pe('load');
  2181. }
  2182. function X(e, t, a) {
  2183. if (Re && at.released && !a) {
  2184. var n = $(e),
  2185. i = e > Ce.start && e < Ce.end;
  2186. Le
  2187. ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem))
  2188. : i && (e = Ne[n.firstItem].start);
  2189. }
  2190. at.init && at.slidee && ge.elasticBounds
  2191. ? e > Ce.end
  2192. ? (e = Ce.end + (e - Ce.end) / 6)
  2193. : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)
  2194. : (e = d(e, Ce.start, Ce.end)),
  2195. (et.start = +new Date()),
  2196. (et.time = 0),
  2197. (et.from = Ce.cur),
  2198. (et.to = e),
  2199. (et.delta = e - Ce.cur),
  2200. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  2201. (et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  2202. (at.tweese = 0),
  2203. e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
  2204. K(),
  2205. Q(),
  2206. Z(),
  2207. F();
  2208. }
  2209. function Y() {
  2210. if (ye.initialized) {
  2211. if (!it) return (it = w(Y)), void (at.released && pe('moveStart'));
  2212. et.immediate
  2213. ? (Ce.cur = et.to)
  2214. : et.tweesing
  2215. ? ((et.tweeseDelta = et.to - Ce.cur),
  2216. x(et.tweeseDelta) < 0.1
  2217. ? (Ce.cur = et.to)
  2218. : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
  2219. : ((et.time = N(+new Date() - et.start, ge.speed)),
  2220. (Ce.cur =
  2221. et.from +
  2222. et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
  2223. et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
  2224. pe('move'),
  2225. we ||
  2226. (f
  2227. ? (Pe[0].style[f] =
  2228. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + -Ce.cur + 'px)')
  2229. : (Pe[0].style[ge.horizontal ? 'left' : 'top'] = -E(Ce.cur) + 'px')),
  2230. !it && at.released && pe('moveEnd'),
  2231. j();
  2232. }
  2233. }
  2234. function j() {
  2235. Se.length &&
  2236. ((xe.cur =
  2237. Ce.start === Ce.end
  2238. ? 0
  2239. : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) *
  2240. xe.end),
  2241. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  2242. _e.hPos !== xe.cur &&
  2243. ((_e.hPos = xe.cur),
  2244. f
  2245. ? (Se[0].style[f] =
  2246. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)')
  2247. : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')));
  2248. }
  2249. function F() {
  2250. Ae[0] &&
  2251. _e.page !== Oe.activePage &&
  2252. ((_e.page = Oe.activePage),
  2253. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2254. pe('activePage', _e.page));
  2255. }
  2256. function M() {
  2257. (tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  2258. (ot = at.init ? w(M) : 0),
  2259. (tt.now = +new Date()),
  2260. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  2261. X(at.init ? tt.pos : E(tt.pos)),
  2262. at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
  2263. (tt.lastTime = tt.now);
  2264. }
  2265. function L(e, t, n) {
  2266. if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n);
  2267. else {
  2268. if (Le && 'center' !== e) return;
  2269. var r = ye.getPos(t);
  2270. r && X(r[e], n, !Le);
  2271. }
  2272. }
  2273. function R(e) {
  2274. return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1;
  2275. }
  2276. function U(e) {
  2277. return R(l(e) && 0 > e ? e + Ne.length : e);
  2278. }
  2279. function W(e, t) {
  2280. var a = R(e);
  2281. return (
  2282. !(!Re || 0 > a) &&
  2283. ((_e.active !== a || t) &&
  2284. (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2285. qe.eq(a).addClass(ge.activeClass),
  2286. (_e.active = Oe.activeItem = a),
  2287. Z(),
  2288. pe('active', a)),
  2289. a)
  2290. );
  2291. }
  2292. function $(e) {
  2293. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2294. var t = {},
  2295. a = Me ? 0 : Ie / 2;
  2296. if (!we)
  2297. for (var n = 0, i = Ee.length; i > n; n++) {
  2298. if (e >= Ce.end || n === Ee.length - 1) {
  2299. t.activePage = Ee.length - 1;
  2300. break;
  2301. }
  2302. if (e <= Ee[n] + a) {
  2303. t.activePage = n;
  2304. break;
  2305. }
  2306. }
  2307. if (Re) {
  2308. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2309. if (
  2310. (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2311. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2312. c === u - 1 || e <= Ne[c].end + Ne[c].half)
  2313. ) {
  2314. s = c;
  2315. break;
  2316. }
  2317. (t.firstItem = l(r) ? r : 0),
  2318. (t.centerItem = l(o) ? o : t.firstItem),
  2319. (t.lastItem = l(s) ? s : t.centerItem);
  2320. }
  2321. return t;
  2322. }
  2323. function Q(t) {
  2324. e.extend(Oe, $(t));
  2325. }
  2326. function Z() {
  2327. var e = Ce.dest <= Ce.start,
  2328. t = Ce.dest >= Ce.end,
  2329. a = (e ? 1 : 0) | (t ? 2 : 0);
  2330. if (
  2331. (_e.slideePosState !== a &&
  2332. ((_e.slideePosState = a),
  2333. Je.is('button,input') && Je.prop('disabled', e),
  2334. Ke.is('button,input') && Ke.prop('disabled', t),
  2335. Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
  2336. Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
  2337. _e.fwdbwdState !== a &&
  2338. at.released &&
  2339. ((_e.fwdbwdState = a),
  2340. Qe.is('button,input') && Qe.prop('disabled', e),
  2341. $e.is('button,input') && $e.prop('disabled', t)),
  2342. Re && null != Oe.activeItem)
  2343. ) {
  2344. var n = 0 === Oe.activeItem,
  2345. i = Oe.activeItem >= Ne.length - 1,
  2346. r = (n ? 1 : 0) | (i ? 2 : 0);
  2347. _e.itemsButtonState !== r &&
  2348. ((_e.itemsButtonState = r),
  2349. Ze.is('button,input') && Ze.prop('disabled', n),
  2350. Ge.is('button,input') && Ge.prop('disabled', i),
  2351. Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
  2352. Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass));
  2353. }
  2354. }
  2355. function G(e, t, a) {
  2356. if (
  2357. ((e = U(e)),
  2358. (t = U(t)),
  2359. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))
  2360. ) {
  2361. qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el);
  2362. var n = t > e ? e : a ? t : t - 1,
  2363. i = e > t ? e : a ? t + 1 : t,
  2364. r = e > t;
  2365. null != Oe.activeItem &&
  2366. (e === Oe.activeItem
  2367. ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1)
  2368. : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2369. H();
  2370. }
  2371. }
  2372. function J(e, t) {
  2373. for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a;
  2374. return -1;
  2375. }
  2376. function K() {
  2377. at.released && !ye.isPaused && ye.resume();
  2378. }
  2379. function V(e) {
  2380. return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start;
  2381. }
  2382. function _() {
  2383. (at.history[0] = at.history[1]),
  2384. (at.history[1] = at.history[2]),
  2385. (at.history[2] = at.history[3]),
  2386. (at.history[3] = at.delta);
  2387. }
  2388. function ee(e) {
  2389. (at.released = 0), (at.source = e), (at.slidee = 'slidee' === e);
  2390. }
  2391. function te(t) {
  2392. var a = 'touchstart' === t.type,
  2393. n = t.data.source,
  2394. i = 'slidee' === n;
  2395. at.init ||
  2396. (!a && ie(t.target)) ||
  2397. (('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2398. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2399. (a || r(t),
  2400. ee(n),
  2401. (at.init = 0),
  2402. (at.$source = e(t.target)),
  2403. (at.touch = a),
  2404. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2405. (at.initX = at.pointer.pageX),
  2406. (at.initY = at.pointer.pageY),
  2407. (at.initPos = i ? Ce.cur : xe.cur),
  2408. (at.start = +new Date()),
  2409. (at.time = 0),
  2410. (at.path = 0),
  2411. (at.delta = 0),
  2412. (at.locked = 0),
  2413. (at.history = [0, 0, 0, 0]),
  2414. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2415. b.on(a ? z : I, ae),
  2416. ye.pause(1),
  2417. (i ? Pe : Se).addClass(ge.draggedClass),
  2418. pe('moveStart'),
  2419. i && (rt = setInterval(_, 10))));
  2420. }
  2421. function ae(e) {
  2422. if (
  2423. ((at.released = 'mouseup' === e.type || 'touchend' === e.type),
  2424. (at.pointer = at.touch
  2425. ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0]
  2426. : e),
  2427. (at.pathX = at.pointer.pageX - at.initX),
  2428. (at.pathY = at.pointer.pageY - at.initY),
  2429. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2430. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2431. at.released || !(at.path < 1))
  2432. ) {
  2433. if (!at.init) {
  2434. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne();
  2435. at.init = 1;
  2436. }
  2437. r(e),
  2438. !at.locked &&
  2439. at.path > at.pathToLock &&
  2440. at.slidee &&
  2441. ((at.locked = 1), at.$source.on(B, s)),
  2442. at.released &&
  2443. (ne(),
  2444. ge.releaseSwing &&
  2445. at.slidee &&
  2446. ((at.swing = ((at.delta - at.history[0]) / 40) * 300),
  2447. (at.delta += at.swing),
  2448. (at.tweese = x(at.swing) > 10))),
  2449. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta));
  2450. }
  2451. }
  2452. function ne() {
  2453. clearInterval(rt),
  2454. (at.released = !0),
  2455. b.off(at.touch ? z : I, ae),
  2456. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2457. setTimeout(function () {
  2458. at.$source.off(B, s);
  2459. }),
  2460. Ce.cur === Ce.dest && at.init && pe('moveEnd'),
  2461. ye.resume(1),
  2462. (at.init = 0);
  2463. }
  2464. function ie(t) {
  2465. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive);
  2466. }
  2467. function re() {
  2468. ye.stop(), b.off('mouseup', re);
  2469. }
  2470. function se(e) {
  2471. switch ((r(e), this)) {
  2472. case $e[0]:
  2473. case Qe[0]:
  2474. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re);
  2475. break;
  2476. case Ze[0]:
  2477. ye.prev();
  2478. break;
  2479. case Ge[0]:
  2480. ye.next();
  2481. break;
  2482. case Je[0]:
  2483. ye.prevPage();
  2484. break;
  2485. case Ke[0]:
  2486. ye.nextPage();
  2487. }
  2488. }
  2489. function oe(e) {
  2490. return (
  2491. (nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2492. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2493. Re
  2494. ? ((p = +new Date()),
  2495. nt.last < p - nt.resetTime && (nt.delta = 0),
  2496. (nt.last = p),
  2497. (nt.delta += nt.curDelta),
  2498. x(nt.delta) < 1
  2499. ? (nt.finalDelta = 0)
  2500. : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2501. nt.finalDelta)
  2502. : nt.curDelta
  2503. );
  2504. }
  2505. function le(e) {
  2506. e.originalEvent[g] = ye;
  2507. var t = +new Date();
  2508. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t);
  2509. if (ge.scrollBy && Ce.start !== Ce.end) {
  2510. var a = oe(e.originalEvent);
  2511. (ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1),
  2512. ye.slideBy(ge.scrollBy * a);
  2513. }
  2514. }
  2515. function ce(e) {
  2516. ge.clickBar &&
  2517. e.target === Be[0] &&
  2518. (r(e),
  2519. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)));
  2520. }
  2521. function de(e) {
  2522. if (ge.keyboardNavBy)
  2523. switch (e.which) {
  2524. case ge.horizontal ? 37 : 38:
  2525. r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']();
  2526. break;
  2527. case ge.horizontal ? 39 : 40:
  2528. r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']();
  2529. }
  2530. }
  2531. function ue(e) {
  2532. return ie(this)
  2533. ? void (e.originalEvent[g + 'ignore'] = !0)
  2534. : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this));
  2535. }
  2536. function fe() {
  2537. this.parentNode === De[0] && ye.activatePage(Ae.index(this));
  2538. }
  2539. function ve(e) {
  2540. ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2);
  2541. }
  2542. function pe(e, t) {
  2543. if (Ve[e]) {
  2544. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he]);
  2545. for (he = 0; me > he; he++) T[he].call(ye, e, t);
  2546. }
  2547. }
  2548. var he,
  2549. me,
  2550. ge = e.extend({}, n.defaults, h),
  2551. ye = this,
  2552. we = l(t),
  2553. be = e(t),
  2554. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2555. Ie = 0,
  2556. ze = 0,
  2557. Ce = {
  2558. start: 0,
  2559. center: 0,
  2560. end: 0,
  2561. cur: 0,
  2562. dest: 0,
  2563. },
  2564. Be = e(ge.scrollBar).eq(0),
  2565. Se = Be.children().eq(0),
  2566. ke = 0,
  2567. Te = 0,
  2568. xe = {
  2569. start: 0,
  2570. end: 0,
  2571. cur: 0,
  2572. },
  2573. De = e(ge.pagesBar),
  2574. Ae = 0,
  2575. Ee = [],
  2576. qe = 0,
  2577. Ne = [],
  2578. Oe = {
  2579. firstItem: 0,
  2580. lastItem: 0,
  2581. centerItem: 0,
  2582. activeItem: null,
  2583. activePage: 0,
  2584. },
  2585. He = new u(be[0]),
  2586. Xe = new u(Pe[0]),
  2587. Ye = new u(Be[0]),
  2588. je = new u(Se[0]),
  2589. Fe = 'basic' === ge.itemNav,
  2590. Me = 'forceCentered' === ge.itemNav,
  2591. Le = 'centered' === ge.itemNav || Me,
  2592. Re = !we && (Fe || Le || Me),
  2593. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2594. We = ge.dragSource ? e(ge.dragSource) : be,
  2595. $e = e(ge.forward),
  2596. Qe = e(ge.backward),
  2597. Ze = e(ge.prev),
  2598. Ge = e(ge.next),
  2599. Je = e(ge.prevPage),
  2600. Ke = e(ge.nextPage),
  2601. Ve = {},
  2602. _e = {},
  2603. et = {},
  2604. tt = {},
  2605. at = {
  2606. released: 1,
  2607. },
  2608. nt = {
  2609. last: 0,
  2610. delta: 0,
  2611. resetTime: 200,
  2612. },
  2613. it = 0,
  2614. rt = 0,
  2615. st = 0,
  2616. ot = 0;
  2617. we || (t = be[0]),
  2618. (ye.initialized = 0),
  2619. (ye.frame = t),
  2620. (ye.slidee = Pe[0]),
  2621. (ye.pos = Ce),
  2622. (ye.rel = Oe),
  2623. (ye.items = Ne),
  2624. (ye.pages = Ee),
  2625. (ye.isPaused = 0),
  2626. (ye.options = ge),
  2627. (ye.dragging = at),
  2628. (ye.reload = function () {
  2629. H();
  2630. }),
  2631. (ye.getPos = function (e) {
  2632. if (Re) {
  2633. var t = R(e);
  2634. return -1 !== t && Ne[t];
  2635. }
  2636. var a = Pe.find(e).eq(0);
  2637. if (a[0]) {
  2638. var n = ge.horizontal
  2639. ? a.offset().left - Pe.offset().left
  2640. : a.offset().top - Pe.offset().top,
  2641. i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']();
  2642. return {
  2643. start: n,
  2644. center: n - Ie / 2 + i / 2,
  2645. end: n - Ie + i,
  2646. size: i,
  2647. };
  2648. }
  2649. return !1;
  2650. }),
  2651. (ye.moveBy = function (e) {
  2652. (tt.speed = e),
  2653. !at.init &&
  2654. tt.speed &&
  2655. Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) &&
  2656. ((tt.lastTime = +new Date()),
  2657. (tt.startPos = Ce.cur),
  2658. ee('button'),
  2659. (at.init = 1),
  2660. pe('moveStart'),
  2661. y(ot),
  2662. M());
  2663. }),
  2664. (ye.stop = function () {
  2665. 'button' === at.source && ((at.init = 0), (at.released = 1));
  2666. }),
  2667. (ye.prev = function () {
  2668. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1);
  2669. }),
  2670. (ye.next = function () {
  2671. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1);
  2672. }),
  2673. (ye.prevPage = function () {
  2674. ye.activatePage(Oe.activePage - 1);
  2675. }),
  2676. (ye.nextPage = function () {
  2677. ye.activatePage(Oe.activePage + 1);
  2678. }),
  2679. (ye.slideBy = function (e, t) {
  2680. e &&
  2681. (Re
  2682. ? ye[Le ? 'toCenter' : 'toStart'](
  2683. d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)
  2684. )
  2685. : X(Ce.dest + e, t));
  2686. }),
  2687. (ye.slideTo = function (e, t) {
  2688. X(e, t);
  2689. }),
  2690. (ye.toStart = function (e, t) {
  2691. L('start', e, t);
  2692. }),
  2693. (ye.toEnd = function (e, t) {
  2694. L('end', e, t);
  2695. }),
  2696. (ye.toCenter = function (e, t) {
  2697. L('center', e, t);
  2698. }),
  2699. (ye.getIndex = R),
  2700. (ye.activate = function (e, t) {
  2701. var a = W(e);
  2702. ge.smart &&
  2703. a !== !1 &&
  2704. (Le
  2705. ? ye.toCenter(a, t)
  2706. : a >= Oe.lastItem
  2707. ? ye.toStart(a, t)
  2708. : a <= Oe.firstItem
  2709. ? ye.toEnd(a, t)
  2710. : K());
  2711. }),
  2712. (ye.activatePage = function (e, t) {
  2713. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t);
  2714. }),
  2715. (ye.resume = function (e) {
  2716. ge.cycleBy &&
  2717. ge.cycleInterval &&
  2718. ('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2719. !(e < ye.isPaused) &&
  2720. ((ye.isPaused = 0),
  2721. st ? (st = clearTimeout(st)) : pe('resume'),
  2722. (st = setTimeout(function () {
  2723. switch ((pe('cycle'), ge.cycleBy)) {
  2724. case 'items':
  2725. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2726. break;
  2727. case 'pages':
  2728. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1);
  2729. }
  2730. }, ge.cycleInterval)));
  2731. }),
  2732. (ye.pause = function (e) {
  2733. e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')));
  2734. }),
  2735. (ye.toggle = function () {
  2736. ye[st ? 'pause' : 'resume']();
  2737. }),
  2738. (ye.set = function (t, a) {
  2739. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a);
  2740. }),
  2741. (ye.add = function (t, a) {
  2742. var n = e(t);
  2743. Re
  2744. ? (null == a || !Ne[0] || a >= Ne.length
  2745. ? n.appendTo(Pe)
  2746. : Ne.length && n.insertBefore(Ne[a].el),
  2747. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
  2748. : Pe.append(n),
  2749. H();
  2750. }),
  2751. (ye.remove = function (t) {
  2752. if (Re) {
  2753. var a = U(t);
  2754. if (a > -1) {
  2755. qe.eq(a).remove();
  2756. var n = a === Oe.activeItem;
  2757. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2758. H(),
  2759. n && ((_e.active = null), ye.activate(Oe.activeItem));
  2760. }
  2761. } else e(t).remove(), H();
  2762. }),
  2763. (ye.moveAfter = function (e, t) {
  2764. G(e, t, 1);
  2765. }),
  2766. (ye.moveBefore = function (e, t) {
  2767. G(e, t);
  2768. }),
  2769. (ye.on = function (e, t) {
  2770. if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a]);
  2771. else if ('function' === i(t))
  2772. for (var n = e.split(' '), r = 0, s = n.length; s > r; r++)
  2773. (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t);
  2774. else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o]);
  2775. }),
  2776. (ye.one = function (e, t) {
  2777. function a() {
  2778. t.apply(ye, arguments), ye.off(e, a);
  2779. }
  2780. ye.on(e, a);
  2781. }),
  2782. (ye.off = function (e, t) {
  2783. if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a]);
  2784. else
  2785. for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
  2786. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0;
  2787. else {
  2788. var o = J(i[r], t);
  2789. -1 !== o && Ve[i[r]].splice(o, 1);
  2790. }
  2791. }),
  2792. (ye.destroy = function () {
  2793. return (
  2794. Ue.add(Se)
  2795. .add(Be)
  2796. .add(De)
  2797. .add($e)
  2798. .add(Qe)
  2799. .add(Ze)
  2800. .add(Ge)
  2801. .add(Je)
  2802. .add(Ke)
  2803. .off('.' + g),
  2804. b.off('keydown', de),
  2805. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2806. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2807. De.empty(),
  2808. we ||
  2809. (be.off('.' + g),
  2810. He.restore(),
  2811. Xe.restore(),
  2812. Ye.restore(),
  2813. je.restore(),
  2814. e.removeData(t, g)),
  2815. (Ne.length = Ee.length = 0),
  2816. (_e = {}),
  2817. (ye.initialized = 0),
  2818. ye
  2819. );
  2820. }),
  2821. (ye.init = function () {
  2822. if (!ye.initialized) {
  2823. ye.on(m);
  2824. var e = ['overflow', 'position'],
  2825. t = [
  2826. 'position',
  2827. 'webkitTransform',
  2828. 'msTransform',
  2829. 'transform',
  2830. 'left',
  2831. 'top',
  2832. 'width',
  2833. 'height',
  2834. ];
  2835. He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t);
  2836. var a = Se;
  2837. return (
  2838. we ||
  2839. ((a = a.add(Pe)),
  2840. be.css('overflow', 'hidden'),
  2841. f || 'static' !== be.css('position') || be.css('position', 'relative')),
  2842. f
  2843. ? v && a.css(f, v)
  2844. : ('static' === Be.css('position') && Be.css('position', 'relative'),
  2845. a.css({
  2846. position: 'absolute',
  2847. })),
  2848. ge.forward && $e.on(S, se),
  2849. ge.backward && Qe.on(S, se),
  2850. ge.prev && Ze.on(B, se),
  2851. ge.next && Ge.on(B, se),
  2852. ge.prevPage && Je.on(B, se),
  2853. ge.nextPage && Ke.on(B, se),
  2854. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  2855. Be[0] && Be.on(B, ce),
  2856. Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
  2857. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
  2858. We.on(
  2859. P,
  2860. {
  2861. source: 'slidee',
  2862. },
  2863. te
  2864. ),
  2865. Se &&
  2866. Se.on(
  2867. P,
  2868. {
  2869. source: 'handle',
  2870. },
  2871. te
  2872. ),
  2873. b.on('keydown', de),
  2874. we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
  2875. (ye.initialized = 1),
  2876. H(!0),
  2877. ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
  2878. ye
  2879. );
  2880. }
  2881. });
  2882. }
  2883. function i(e) {
  2884. return null == e
  2885. ? String(e)
  2886. : 'object' == typeof e || 'function' == typeof e
  2887. ? Object.prototype.toString
  2888. .call(e)
  2889. .match(/\s([a-z]+)/i)[1]
  2890. .toLowerCase() || 'object'
  2891. : typeof e;
  2892. }
  2893. function r(e, t) {
  2894. e.preventDefault(), t && e.stopPropagation();
  2895. }
  2896. function s(t) {
  2897. r(t, 1), e(this).off(t.type, s);
  2898. }
  2899. function o() {
  2900. (this.scrollLeft = 0), (this.scrollTop = 0);
  2901. }
  2902. function l(e) {
  2903. return !isNaN(parseFloat(e)) && isFinite(e);
  2904. }
  2905. function c(e, t) {
  2906. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''));
  2907. }
  2908. function d(e, t, a) {
  2909. return t > e ? t : e > a ? a : e;
  2910. }
  2911. function u(e) {
  2912. var t = {};
  2913. return (
  2914. (t.style = {}),
  2915. (t.save = function () {
  2916. if (e && e.nodeType) {
  2917. for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]];
  2918. return t;
  2919. }
  2920. }),
  2921. (t.restore = function () {
  2922. if (e && e.nodeType) {
  2923. for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2924. return t;
  2925. }
  2926. }),
  2927. t
  2928. );
  2929. }
  2930. var f,
  2931. v,
  2932. p,
  2933. h = 'sly',
  2934. m = 'Sly',
  2935. g = h,
  2936. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  2937. w = t.requestAnimationFrame,
  2938. b = e(document),
  2939. P = 'touchstart.' + g + ' mousedown.' + g,
  2940. I = 'mousemove.' + g + ' mouseup.' + g,
  2941. z = 'touchmove.' + g + ' touchend.' + g,
  2942. C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
  2943. B = 'click.' + g,
  2944. S = 'mousedown.' + g,
  2945. k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2946. T = [],
  2947. x = Math.abs,
  2948. D = Math.sqrt,
  2949. A = Math.pow,
  2950. E = Math.round,
  2951. q = Math.max,
  2952. N = Math.min,
  2953. O = 0;
  2954. b.on(C, function (e) {
  2955. var t = e.originalEvent[g],
  2956. a = +new Date();
  2957. (!t || t.options.scrollHijack < a - O) && (O = a);
  2958. }),
  2959. (function (e) {
  2960. function t(e) {
  2961. var t = new Date().getTime(),
  2962. n = Math.max(0, 16 - (t - a)),
  2963. i = setTimeout(e, n);
  2964. return (a = t), i;
  2965. }
  2966. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2967. var a = new Date().getTime(),
  2968. n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2969. y = function (t) {
  2970. n.call(e, t);
  2971. };
  2972. })(window),
  2973. (function () {
  2974. function e(e) {
  2975. for (var n = 0, i = t.length; i > n; n++) {
  2976. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2977. if (null != a.style[r]) return r;
  2978. }
  2979. }
  2980. var t = ['', 'webkit', 'moz', 'ms', 'o'],
  2981. a = document.createElement('div');
  2982. (f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '');
  2983. })(),
  2984. (t[m] = n),
  2985. (e.fn[h] = function (t, a) {
  2986. var r, s;
  2987. return (
  2988. e.isPlainObject(t) ||
  2989. (('string' === i(t) || t === !1) &&
  2990. ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))),
  2991. (t = {})),
  2992. this.each(function (i, o) {
  2993. var l = e.data(o, g);
  2994. l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()));
  2995. })
  2996. );
  2997. }),
  2998. (n.defaults = {
  2999. slidee: null,
  3000. horizontal: !1,
  3001. itemNav: null,
  3002. itemSelector: null,
  3003. smart: !1,
  3004. activateOn: null,
  3005. activateMiddle: !1,
  3006. scrollSource: null,
  3007. scrollBy: 0,
  3008. scrollHijack: 300,
  3009. scrollTrap: !1,
  3010. dragSource: null,
  3011. mouseDragging: !1,
  3012. touchDragging: !1,
  3013. releaseSwing: !1,
  3014. swingSpeed: 0.2,
  3015. elasticBounds: !1,
  3016. interactive: null,
  3017. scrollBar: null,
  3018. dragHandle: !1,
  3019. dynamicHandle: !1,
  3020. minHandleSize: 50,
  3021. clickBar: !1,
  3022. syncSpeed: 0.5,
  3023. pagesBar: null,
  3024. activatePageOn: null,
  3025. pageBuilder: function (e) {
  3026. return '<li>' + (e + 1) + '</li>';
  3027. },
  3028. forward: null,
  3029. backward: null,
  3030. prev: null,
  3031. next: null,
  3032. prevPage: null,
  3033. nextPage: null,
  3034. cycleBy: null,
  3035. cycleInterval: 5e3,
  3036. pauseOnHover: !1,
  3037. startPaused: !1,
  3038. moveBy: 300,
  3039. speed: 0,
  3040. easing: 'swing',
  3041. startAt: null,
  3042. keyboardNavBy: null,
  3043. draggedClass: 'dragged',
  3044. activeClass: 'active',
  3045. disabledClass: 'disabled',
  3046. });
  3047. })(jQuery, window);
  3048. !(function e(t, i, n) {
  3049. function r(a, s) {
  3050. if (!i[a]) {
  3051. if (!t[a]) {
  3052. var l = 'function' == typeof require && require;
  3053. if (!s && l) return l(a, !0);
  3054. if (o) return o(a, !0);
  3055. var c = new Error("Cannot find module '" + a + "'");
  3056. throw ((c.code = 'MODULE_NOT_FOUND'), c);
  3057. }
  3058. var h = (i[a] = {
  3059. exports: {},
  3060. });
  3061. t[a][0].call(
  3062. h.exports,
  3063. function (e) {
  3064. var i = t[a][1][e];
  3065. return r(i ? i : e);
  3066. },
  3067. h,
  3068. h.exports,
  3069. e,
  3070. t,
  3071. i,
  3072. n
  3073. );
  3074. }
  3075. return i[a].exports;
  3076. }
  3077. for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a]);
  3078. return r;
  3079. })(
  3080. {
  3081. 1: [
  3082. function (e, t, i) {
  3083. (function (i) {
  3084. 'use strict';
  3085. function n(e) {
  3086. (this.player = null),
  3087. (this.director = null),
  3088. (this.modelManager = null),
  3089. (this.container = null),
  3090. (this.tagManager = null),
  3091. (this.fadeInSpeed = e),
  3092. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0);
  3093. }
  3094. var r = e('three'),
  3095. o = e('./util/logger'),
  3096. a = (e('./util/common'), e('./enum/PlayerEvents')),
  3097. s = e('./enum/DirectorEvents'),
  3098. l = e('./settings'),
  3099. c = e('./enum/Viewmode'),
  3100. h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
  3101. u = e('./enum/tagEvents'),
  3102. d = e('./util/transitions'),
  3103. p = e('./util/lerp'),
  3104. f = new o(i);
  3105. //window.THREE = r;
  3106. (n.prototype.init = function (e, t, i, n, r) {
  3107. window.app = this;
  3108. (this.player = t),
  3109. (this.director = e),
  3110. (this.modelManager = i),
  3111. (this.tagManager = n),
  3112. (this.container = r),
  3113. this.updateModel(),
  3114. this.bindEvents();
  3115. }),
  3116. (n.prototype.bindEvents = function () {
  3117. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  3118. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  3119. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  3120. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  3121. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  3122. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  3123. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  3124. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  3125. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  3126. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this));
  3127. }),
  3128. (n.prototype.updateModel = function () {
  3129. //模型this.model
  3130. this.model = this.modelManager.getActiveModel();
  3131. }),
  3132. (n.prototype.handleWarpStarted = function () {
  3133. this.hidePlayerReticule();
  3134. }),
  3135. (n.prototype.ontagActivated = function () {
  3136. this.hidePlayerReticule();
  3137. }),
  3138. (n.prototype.onNavigationTotag = function () {
  3139. this.hidePlayerReticule();
  3140. }),
  3141. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  3142. var n = this.modelManager.getActiveModel(),
  3143. r =
  3144. this.player.is360View(t, i) || this.director.tourIsPlaying
  3145. ? 0
  3146. : l[t].markerOpacity;
  3147. n.fadePanoMarkers(r), n.setMode(t);
  3148. }),
  3149. (n.prototype.handlePlayerModeChanged = function (e, t) {
  3150. var i = this.modelManager.getActiveModel(),
  3151. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  3152. i.setSide(n), i.setMode(t);
  3153. }),
  3154. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  3155. i !== c.TRANSITIONING &&
  3156. (e && !this.director.tourIsPlaying && e.hoverOff(i),
  3157. t && !this.director.tourIsPlaying && t.hoverOn(i));
  3158. }),
  3159. (n.prototype.handleActionInterruption = function () {}),
  3160. (n.prototype.handleStartInside = function (e) {
  3161. var t = l[this.player.mode],
  3162. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  3163. this.fadeIn(this.fadeInSpeed),
  3164. (this.model.alpha = 0),
  3165. (this.model.skybox.material.uniforms.opacity.value = 1),
  3166. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  3167. var n = this.player.reticule;
  3168. d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac');
  3169. }),
  3170. (n.prototype.handleStartOutside = function (e) {
  3171. this.fadeIn(e);
  3172. }),
  3173. (n.prototype.fadeIn = function (e) {
  3174. (null !== e && void 0 !== e) ||
  3175. ((e = 2e3),
  3176. f.warn(
  3177. 'DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.'
  3178. )),
  3179. $(this.container).fadeIn(e);
  3180. }),
  3181. (n.prototype.hidePlayerReticule = function () {
  3182. this.player.reticule.hide();
  3183. }),
  3184. (t.exports = n);
  3185. }.call(this, '/js/DisplayController.js'));
  3186. },
  3187. {
  3188. './enum/BlackoutStyle': 18,
  3189. './enum/DirectorEvents': 23,
  3190. './enum/tagEvents': 32,
  3191. './enum/ModelManagerEvents': 33,
  3192. './enum/PlayerEvents': 40,
  3193. './enum/Viewmode': 51,
  3194. './enum/WarpStyle': 52,
  3195. './settings': 166,
  3196. './util/common': 185,
  3197. './util/lerp': 188,
  3198. './util/logger': 189,
  3199. './util/transitions': 195,
  3200. three: 217,
  3201. },
  3202. ],
  3203. 2: [
  3204. function (e, t, i) {
  3205. 'use strict';
  3206. function n() {
  3207. (this.baseStartTime = performance.timing.navigationStart),
  3208. (this.loadingStartTime = null),
  3209. (this.waitingStartTime = null),
  3210. (this.appReadyTime = null);
  3211. }
  3212. (n.prototype.setBaseStartTime = function (e) {
  3213. this.baseStartTime = e || Date.now();
  3214. }),
  3215. (n.prototype.setWaitingStartTime = function (e) {
  3216. this.waitingStartTime = e || Date.now();
  3217. }),
  3218. (n.prototype.setLoadingStartTime = function (e) {
  3219. this.loadingStartTime = e || Date.now();
  3220. }),
  3221. (n.prototype.setAppReadyTime = function (e) {
  3222. this.appReadyTime = e || Date.now();
  3223. }),
  3224. (n.prototype.calcFullLoadingTime = function () {
  3225. var e = this.appReadyTime - this.baseStartTime;
  3226. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e;
  3227. }),
  3228. (t.exports = n);
  3229. },
  3230. {},
  3231. ],
  3232. 3: [
  3233. function (e, t, i) {
  3234. (function (i) {
  3235. 'use strict';
  3236. function n() {
  3237. return 100 * Math.random();
  3238. }
  3239. var r = e('./util/logger'),
  3240. o = e('./util/browser'),
  3241. a = new r(i),
  3242. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3243. initialized: !1,
  3244. init: function (e, t) {
  3245. if (((t = t || {}), !this.initialized)) {
  3246. (this.initialized = !0),
  3247. o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
  3248. o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0));
  3249. for (var i in e) {
  3250. var r = i.match('^sc_tilegen_([0-9]+)$');
  3251. r && (s.tilegen = n() < parseInt(r[1]));
  3252. var l = i.match('^sc_imgopt_([0-9]+)$');
  3253. l && (s.imgopt = n() < parseInt(l[1]));
  3254. }
  3255. for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c]);
  3256. }
  3257. },
  3258. changeIfTileGenerating: function (e) {
  3259. return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e;
  3260. },
  3261. changeIfImageOptimzing: function (e) {
  3262. return (
  3263. s.imgopt &&
  3264. e.indexOf('imgopt=1') === -1 &&
  3265. ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')),
  3266. e
  3267. );
  3268. },
  3269. tilegen: !1,
  3270. imgopt: !1,
  3271. });
  3272. t.exports = s;
  3273. }.call(this, '/js/ab.js'));
  3274. },
  3275. {
  3276. './util/browser': 182,
  3277. './util/logger': 189,
  3278. },
  3279. ],
  3280. 4: [
  3281. function (e, t, i) {
  3282. (function (i) {
  3283. 'use strict';
  3284. function n() {
  3285. return {
  3286. addons: [
  3287. {
  3288. name: 'keen:ua_parser',
  3289. input: {
  3290. ua_string: 'user_agent',
  3291. },
  3292. output: 'parsed_user_agent',
  3293. },
  3294. ],
  3295. };
  3296. }
  3297. function r(e, t, i, n) {
  3298. function r(t) {
  3299. l[t.sid] = !0;
  3300. var i = t.billboard.media && t.billboard.media.type,
  3301. n = {
  3302. tag_id: t.sid,
  3303. tags_visited: Object.keys(l).length,
  3304. tag_count: Object.keys(e.tags).length,
  3305. tag_view_count: ++E,
  3306. has_media: !!i,
  3307. };
  3308. i && (n.media_type = i), u('tag_opened', n);
  3309. }
  3310. var l = {},
  3311. h = Date.now() - N,
  3312. f = null;
  3313. n && (f = Date.now() - window.navigationStart);
  3314. var g;
  3315. try {
  3316. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0;
  3317. } catch (e) {
  3318. g = !1;
  3319. }
  3320. var v,
  3321. A = e.supportsVR;
  3322. A ||
  3323. ((v = 'VR disabled at the model/account level'),
  3324. m.valueFromHash('vr') === _.NONE
  3325. ? (v = 'VR disabled, using &vr=0')
  3326. : m.detectAndroid()
  3327. ? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
  3328. : m.detectIOS() &&
  3329. (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
  3330. u('model_loaded', {
  3331. duration: h,
  3332. duration_from_navigation_start: f,
  3333. has_hlr: g,
  3334. has_vr: A,
  3335. vr_reason: v,
  3336. });
  3337. var I = 0;
  3338. e.panos.forEach(function (e) {
  3339. e.on('enter', function () {
  3340. c('pano_viewed', {
  3341. pano_id: e.id,
  3342. pano_view_count: ++I,
  3343. alignment_type: e.alignmentType,
  3344. interaction_source: O,
  3345. navigation_source: p,
  3346. });
  3347. });
  3348. });
  3349. var E = 0;
  3350. for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3351. t.on('tour_auto', function (e) {
  3352. p = 'tour_' + e;
  3353. }),
  3354. t.on('tour_manual', function (e) {
  3355. (O = 'gui-' + e), (p = 'tour_manual');
  3356. }),
  3357. i.on(C.InteractionKey, function () {
  3358. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey);
  3359. }),
  3360. i.on(C.InteractionDirect, function () {
  3361. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect);
  3362. }),
  3363. o(t),
  3364. a(),
  3365. s();
  3366. }
  3367. function o(e) {
  3368. I.on(T.OPENED, function () {
  3369. c('showcase_share_intent', {
  3370. pano_id: e.currentPano && e.currentPano.id,
  3371. });
  3372. }),
  3373. I.on(T.LINK_CLICKED, function (t) {
  3374. c('showcase_share_action', {
  3375. channel: t.channel,
  3376. pano_id: e.currentPano && e.currentPano.id,
  3377. });
  3378. }),
  3379. E.on(x.ORIGIN_LINK_CLICKED, function () {
  3380. c('showcase_share_origin_link_clicked');
  3381. });
  3382. }
  3383. function a() {}
  3384. function s() {
  3385. b.on(
  3386. S.OPENED,
  3387. c.bind(this, 'showcase_gui', {
  3388. gui_action: 'click_vr_button',
  3389. })
  3390. ),
  3391. b.on(S.LAUNCH, function (e) {
  3392. c('showcase_gui', {
  3393. gui_action: 'launch_vr',
  3394. vr_platform: e.vr_platform,
  3395. vr_app: e.vr_app,
  3396. });
  3397. }),
  3398. b.on(
  3399. S.PREV,
  3400. c.bind(this, 'showcase_gui', {
  3401. gui_action: 'vr_modal_prev',
  3402. })
  3403. ),
  3404. b.on(S.NEXT, function (e) {
  3405. c('showcase_gui', {
  3406. gui_action: e.nextAction,
  3407. });
  3408. }),
  3409. b.on(
  3410. S.CLOSED,
  3411. c.bind(this, 'showcase_gui', {
  3412. gui_action: 'vr_modal_close',
  3413. })
  3414. ),
  3415. b.on(S.falseICECHOSEN, function (e) {
  3416. c('showcase_gui', {
  3417. gui_action: e.name + ' ',
  3418. });
  3419. }),
  3420. b.on(S.STORE, function (e) {
  3421. c('showcase_gui', {
  3422. gui_action: 'launch_store',
  3423. store: e,
  3424. });
  3425. });
  3426. }
  3427. function l(e, t) {
  3428. if (f)
  3429. try {
  3430. f.addEvent(
  3431. e,
  3432. v.extendObject(
  3433. {
  3434. host: window.location.host,
  3435. keen: n(),
  3436. user_agent: '${keen.user_agent}',
  3437. referrer: {
  3438. url: v.normalizeUrl(document.referrer),
  3439. domain: v.domainFromUrl(document.referrer),
  3440. url_original: document.referrer,
  3441. },
  3442. embedded: m.inIframe(),
  3443. is_mobile: m.isMobile(),
  3444. version: '2.25.6-0-gd87e5b1',
  3445. },
  3446. t
  3447. )
  3448. );
  3449. } catch (e) {
  3450. P.warn(
  3451. 'analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' +
  3452. e
  3453. );
  3454. }
  3455. }
  3456. function c(e, t) {
  3457. if (((t = t || {}), L))
  3458. try {
  3459. window.analytics.track(e, v.extendObject(t, B), {
  3460. context: {
  3461. app: {
  3462. name: 'showcase',
  3463. version: '2.25.6-0-gd87e5b1',
  3464. },
  3465. screen: {
  3466. width: window.screen.width,
  3467. height: window.screen.height,
  3468. density: window.devicePixelRatio,
  3469. },
  3470. },
  3471. });
  3472. } catch (t) {
  3473. console.warn('Failed to send data to segment for ' + e);
  3474. }
  3475. }
  3476. function h(e, t) {
  3477. if (((t = t || {}), navigator.sendBeacon && L))
  3478. try {
  3479. navigator.sendBeacon(
  3480. 'https://api.segment.io/v1/t',
  3481. JSON.stringify({
  3482. event: e,
  3483. anonymousId: window.analytics.user().anonymousId(),
  3484. properties: v.extendObject(t, B),
  3485. writeKey: L,
  3486. sentAt: Date.now(),
  3487. type: 'track',
  3488. context: {
  3489. userAgent: m.userAgent(),
  3490. library: {
  3491. name: 'showcase-beacon',
  3492. version: '2.25.6-0-gd87e5b1',
  3493. },
  3494. app: {
  3495. name: 'showcase',
  3496. version: '2.25.6-0-gd87e5b1',
  3497. },
  3498. },
  3499. })
  3500. );
  3501. } catch (e) {
  3502. console.warn('Failed to send async segment request');
  3503. }
  3504. }
  3505. function u(e, t) {
  3506. (t = t || {}), c(e, t);
  3507. }
  3508. function d(e, t) {
  3509. (O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided');
  3510. }
  3511. var p,
  3512. f,
  3513. g = (e('three'), e('./util/ajax'), e('./ab')),
  3514. m = e('./util/browser'),
  3515. v = e('./util/common'),
  3516. A = e('./settings'),
  3517. y = (e('./localization/localize'), e('./enum/Viewmode')),
  3518. C = e('./enum/ControlEvents'),
  3519. I = e('./gui/sharing/modal'),
  3520. E = e('./gui/title/titleBar'),
  3521. b = e('./gui/vr/vrModal'),
  3522. w = e('./enum/VRPlatforms'),
  3523. _ = e('./enum/VROption'),
  3524. T = e('./gui/sharing/ShareEvents'),
  3525. x = e('./gui/title/TitleEvents'),
  3526. S = e('./gui/vr/vrEvent'),
  3527. M = e('./tag/Billboard/BillboardEvent'),
  3528. R = e('./util/logger'),
  3529. P = new R(i),
  3530. O = (e('./enum/PlayerEvents'), 'direct'),
  3531. L = null,
  3532. D = !1,
  3533. N = null,
  3534. B = null,
  3535. F = v.uuid4();
  3536. t.exports = {
  3537. report: function (e, t, i, n) {
  3538. l('Session starts', {
  3539. model: e,
  3540. status: t,
  3541. loadtime: Date.now() - (N || Date.now()),
  3542. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3543. autoplay: i,
  3544. quickstart: n,
  3545. ab_tilegen: g.tilegen,
  3546. ab_imgopt: g.imgopt,
  3547. });
  3548. },
  3549. impression: function (e) {
  3550. e = e || {};
  3551. var t = void 0 === e.isVisible || e.isVisible,
  3552. i =
  3553. (void 0 !== e.immediate && e.immediate,
  3554. window.location.search.substr(1).split('&'));
  3555. u('impression', {
  3556. visible: t,
  3557. url_params: i,
  3558. });
  3559. },
  3560. initKeen: function (e) {
  3561. return e.token && e.appId
  3562. ? void (f = new Keen({
  3563. projectId: e.appId,
  3564. writeKey: e.token,
  3565. readKey: '',
  3566. requestType: 'xhr',
  3567. }))
  3568. : void P.warn('no keen token/appId');
  3569. },
  3570. initSegment: function (e) {
  3571. return e.token
  3572. ? ((L = e.token),
  3573. window.analytics.load(e.token),
  3574. (B = {
  3575. model_id: e.model,
  3576. start_source: e.startSource,
  3577. autoplay: e.autoplay,
  3578. quickstart: e.quickstart,
  3579. language_tag: A.languageTag,
  3580. is_mobile: m.isMobile(),
  3581. iframe: m.inIframe(),
  3582. aspect_ratio: m.aspectRatio(),
  3583. session_id: F,
  3584. window: {
  3585. width: $('#player').width(),
  3586. height: $('#player').height(),
  3587. },
  3588. platform: {
  3589. browser: {
  3590. name: $.ua.browser.name,
  3591. major: $.ua.browser.major,
  3592. version: $.ua.browser.version,
  3593. },
  3594. os: {
  3595. name: $.ua.os.name,
  3596. version: $.ua.os.version,
  3597. },
  3598. device: {
  3599. vendor: $.ua.device.vendor,
  3600. model: $.ua.device.model,
  3601. type: $.ua.device.type,
  3602. },
  3603. },
  3604. }),
  3605. (D = Math.random() < A.analytics.sessionTrackingRate),
  3606. P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
  3607. void P.debug('tracking this session = ' + D))
  3608. : void P.warn('no segment token');
  3609. },
  3610. sessionStart: function (e) {
  3611. P.debug('analytics user_session_start'),
  3612. c('session_started'),
  3613. (N = Date.now()),
  3614. window.addEventListener('unload', function () {
  3615. h('session_ended', {
  3616. duration: Date.now() - N,
  3617. });
  3618. });
  3619. },
  3620. modelLoaded: function (e, t, i, n) {
  3621. r(e, t, i, n);
  3622. },
  3623. loadComplete: function (e) {
  3624. var t = {
  3625. time_to_app_start: e,
  3626. };
  3627. c('load_times', t);
  3628. },
  3629. track: function (e, t) {
  3630. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t));
  3631. },
  3632. trackAlways: function (e, t) {
  3633. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t);
  3634. },
  3635. getSessionId: function () {
  3636. return F;
  3637. },
  3638. updateInteraction: d,
  3639. };
  3640. }.call(this, '/js/analytics.js'));
  3641. },
  3642. {
  3643. './ab': 3,
  3644. './enum/ControlEvents': 21,
  3645. './enum/PlayerEvents': 40,
  3646. './enum/VROption': 47,
  3647. './enum/VRPlatforms': 49,
  3648. './enum/Viewmode': 51,
  3649. './gui/sharing/ShareEvents': 76,
  3650. './gui/sharing/modal': 77,
  3651. './gui/title/TitleEvents': 80,
  3652. './gui/title/titleBar': 82,
  3653. './gui/vr/vrEvent': 85,
  3654. './gui/vr/vrModal': 87,
  3655. './localization/localize': 108,
  3656. './tag/Billboard/BillboardEvent': 120,
  3657. './settings': 166,
  3658. './util/ajax': 181,
  3659. './util/browser': 182,
  3660. './util/common': 185,
  3661. './util/logger': 189,
  3662. three: 217,
  3663. },
  3664. ],
  3665. 5: [
  3666. function (e, t, i) {
  3667. 'use strict';
  3668. function n() {
  3669. r.PerspectiveCamera.call(
  3670. this,
  3671. a.clampVFOV(o.dollhouseFOV),
  3672. $('#player').width() / $('#player').height(),
  3673. o.dollhouseNear,
  3674. o.dollhouseFar
  3675. ),
  3676. (this.controls = null);
  3677. }
  3678. var r = e('three'),
  3679. o = e('../constants'),
  3680. a = e('../util/cameraLight');
  3681. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3682. (n.prototype.updateAspect = function (e) {
  3683. (this.aspect = e), this.updateProjectionMatrix();
  3684. }),
  3685. (t.exports = n);
  3686. },
  3687. {
  3688. '../constants': 8,
  3689. '../util/cameraLight': 184,
  3690. three: 217,
  3691. },
  3692. ],
  3693. 6: [
  3694. function (e, t, i) {
  3695. 'use strict';
  3696. function n() {
  3697. var e = $('#player').width() / $('#player').height();
  3698. r.OrthographicCamera.call(
  3699. this,
  3700. -o.orthoBase,
  3701. o.orthoBase,
  3702. o.orthoBase / e,
  3703. -o.orthoBase / e,
  3704. o.orthoNear,
  3705. o.orthoFar
  3706. ),
  3707. (this.controls = null),
  3708. this.updateAspect(e);
  3709. }
  3710. var r = e('three'),
  3711. o = e('../constants');
  3712. (n.prototype = Object.create(r.OrthographicCamera.prototype)),
  3713. (n.prototype.updateAspect = function (e) {
  3714. (this.aspect = e),
  3715. (this.top = o.orthoBase / e),
  3716. (this.bottom = -o.orthoBase / e),
  3717. this.updateProjectionMatrix();
  3718. }),
  3719. (t.exports = n);
  3720. },
  3721. {
  3722. '../constants': 8,
  3723. three: 217,
  3724. },
  3725. ],
  3726. 7: [
  3727. function (e, t, i) {
  3728. 'use strict';
  3729. function n() {
  3730. r.PerspectiveCamera.call(
  3731. this,
  3732. a.clampVFOV(o.insideFOV),
  3733. $('#player').width() / $('#player').height(),
  3734. o.insideNear,
  3735. o.insideFar
  3736. ),
  3737. (this.controls = null);
  3738. }
  3739. var r = e('three'),
  3740. o = e('../settings'),
  3741. a = e('../util/cameraLight');
  3742. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3743. (n.prototype.updateAspect = function (e) {
  3744. (this.aspect = e), this.updateProjectionMatrix();
  3745. }),
  3746. (t.exports = n);
  3747. },
  3748. {
  3749. '../settings': 166,
  3750. '../util/cameraLight': 184,
  3751. three: 217,
  3752. },
  3753. ],
  3754. 8: [
  3755. function (e, t, i) {
  3756. 'use strict';
  3757. t.exports = {
  3758. signedUrlDefaultExpireTime: 24e4,
  3759. signedUrlCheckInterval: 1e4,
  3760. signedUrlRefreshBuffer: 15e3,
  3761. dollhouseFOV: 70,
  3762. dollhouseNear: 1,
  3763. dollhouseFar: 5e3,
  3764. insideFOV: 70,
  3765. insideFOVMax: 120,
  3766. insideNear: 0.1,
  3767. insideFar: 5e3,
  3768. insideLookSpeed: 0.12,
  3769. insideLookLimitUp: 40, //视角
  3770. insideLookLimitDown: -40,
  3771. orthoNear: 1,
  3772. orthoFar: 5e3,
  3773. orthoBase: 10,
  3774. narrowLandscapeHeight: 290,
  3775. reallyNarrowLandscapeHeight: 250,
  3776. visionTilingStartDate: new Date('8/26/2016'),
  3777. visionTilingStartVersion: '1.1.407.13667',
  3778. windowHeightHighQualityThreshold: 900,
  3779. tourStepDelayDefault: 3500,
  3780. tourStepDelaySlideShow: 5e3,
  3781. workshopApsect: 9 / 16,
  3782. highQualityMaxZoom: 2,
  3783. ultraHighQualityMaxZoom: 3,
  3784. };
  3785. },
  3786. {},
  3787. ],
  3788. 9: [
  3789. function (e, t, i) {
  3790. 'use strict';
  3791. function n() {
  3792. (this.activeControl = null), (this.controls = {}), (this.cameras = {});
  3793. }
  3794. var r = e('./PanoramaControls'),
  3795. o = e('./DollhouseControls'),
  3796. a = e('./FloorplanControls'),
  3797. s = e('../cameras/PanoramaCamera'),
  3798. l = e('../cameras/DollhouseCamera'),
  3799. c = e('../cameras/FloorplanCamera'),
  3800. h = e('events').EventEmitter,
  3801. u = e('../enum/ControlEvents'),
  3802. d = e('../enum/ModelManagerEvents'),
  3803. p = e('../enum/Viewmode'),
  3804. f = e('../settings');
  3805. (n.prototype = Object.create(h.prototype)),
  3806. (n.prototype.init = function (e, t) {
  3807. this.setUpControls(), this.bindEvents(e, t);
  3808. }),
  3809. (n.prototype.activateControls = function (e) {
  3810. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)),
  3811. this.controls[e] && (this.controls[e].enabled = !0),
  3812. (this.activeControl = this.controls[e]);
  3813. }),
  3814. (n.prototype.setUpControls = function () {
  3815. var e = {},
  3816. t = {},
  3817. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3818. n = [s, l, c],
  3819. h = [r, o, a];
  3820. i.forEach(
  3821. function (i, r) {
  3822. (e[i] = new n[r]()),
  3823. (t[i] = new h[r](e[i])),
  3824. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3825. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3826. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3827. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3828. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3829. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll));
  3830. }.bind(this)
  3831. ),
  3832. (this.controls = t),
  3833. (this.cameras = e);
  3834. }),
  3835. (n.prototype.bindEvents = function (e, t) {
  3836. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3837. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3838. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3839. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3840. f.useWheel &&
  3841. (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }),
  3842. e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3843. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3844. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3845. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3846. e.addEventListener('contextmenu', function (e) {
  3847. e.preventDefault();
  3848. }),
  3849. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3850. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3851. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3852. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3853. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3854. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3855. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3856. t.on(
  3857. d.ActiveModelChanged,
  3858. function (e) {
  3859. this.setModelForControls(e.model);
  3860. }.bind(this)
  3861. );
  3862. }),
  3863. (n.prototype.setModelForControls = function (e) {
  3864. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3865. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3866. [p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3867. function (e) {
  3868. this.controls[e].setBounds(t);
  3869. }.bind(this)
  3870. );
  3871. }),
  3872. (n.prototype.onMouseDown = function (e) {
  3873. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e);
  3874. }),
  3875. (n.prototype.onMouseMove = function (e) {
  3876. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e);
  3877. }),
  3878. (n.prototype.onMouseUp = function (e) {
  3879. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e);
  3880. }),
  3881. (n.prototype.onMouseOver = function (e) {
  3882. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e);
  3883. }),
  3884. (n.prototype.onMouseWheel = function (e) {
  3885. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e);
  3886. }),
  3887. (n.prototype.onTouchStart = function (e) {
  3888. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e);
  3889. var hotList = $('#hotListWrap')[0];
  3890. hotList.classList.remove('hotListActive');
  3891. $('#hotListContent ul .active').removeClass('active');
  3892. $('#hotList')[0].classList.remove('active');
  3893. }),
  3894. (n.prototype.onTouchMove = function (e) {
  3895. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e);
  3896. }),
  3897. (n.prototype.onTouchEnd = function (e) {
  3898. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e);
  3899. }),
  3900. (n.prototype.onPointerDown = function (e) {
  3901. if ((e.preventDefault(), this.activeControl))
  3902. switch (e.pointerType) {
  3903. case 'mouse':
  3904. this.activeControl.onMouseDown(e);
  3905. break;
  3906. default:
  3907. this.activeControl.onPointerDown(e);
  3908. }
  3909. }),
  3910. (n.prototype.onPointerMove = function (e) {
  3911. if ((e.preventDefault(), this.activeControl))
  3912. switch (e.pointerType) {
  3913. case 'mouse':
  3914. this.activeControl.onMouseMove(e);
  3915. break;
  3916. default:
  3917. this.activeControl.onPointerMove(e);
  3918. }
  3919. }),
  3920. (n.prototype.onPointerUp = function (e) {
  3921. if ((e.preventDefault(), this.activeControl))
  3922. switch (e.pointerType) {
  3923. case 'mouse':
  3924. this.activeControl.onMouseUp(e);
  3925. break;
  3926. default:
  3927. this.activeControl.onPointerUp(e);
  3928. }
  3929. }),
  3930. (n.prototype.onPointerCancel = function (e) {
  3931. e.preventDefault(),
  3932. this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e);
  3933. }),
  3934. (n.prototype.onKeyDown = function (e) {
  3935. e.metaKey ||
  3936. e.ctrlKey ||
  3937. (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e));
  3938. }),
  3939. (n.prototype.onKeyUp = function (e) {
  3940. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e);
  3941. }),
  3942. (t.exports = n);
  3943. },
  3944. {
  3945. '../cameras/DollhouseCamera': 5,
  3946. '../cameras/FloorplanCamera': 6,
  3947. '../cameras/PanoramaCamera': 7,
  3948. '../enum/ControlEvents': 21,
  3949. '../enum/ModelManagerEvents': 33,
  3950. '../enum/Viewmode': 51,
  3951. '../settings': 166,
  3952. './DollhouseControls': 10,
  3953. './FloorplanControls': 11,
  3954. './PanoramaControls': 13,
  3955. events: 202,
  3956. },
  3957. ],
  3958. 10: [
  3959. function (e, t, i) {
  3960. 'use strict';
  3961. function n(e) {
  3962. a.call(this, e),
  3963. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3964. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3965. (this.minDistance = o.dollhouseDefault.minDistance),
  3966. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3967. (this.adjustedMinDistance = this.minDistance),
  3968. (this.adjustedMaxDistance = this.maxDistance);
  3969. }
  3970. var r = e('three'),
  3971. o = e('../settings'),
  3972. a = e('./OutsideControls');
  3973. (n.prototype = Object.create(a.prototype)),
  3974. (n.prototype.pan = function (e, t) {
  3975. this.camera.updateMatrix();
  3976. var i = this.camera.position.clone().sub(this.target).length();
  3977. (i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)),
  3978. this.panLeft((2 * e * i) / $('#player').height()),
  3979. this.panUp((-2 * t * i) / $('#player').height());
  3980. }),
  3981. (n.prototype.updateZoom = function () {
  3982. var e = this.offset.length();
  3983. return e * this.scale;
  3984. }),
  3985. (n.prototype.setZoomBounds = function (e) {
  3986. var t = e.min.distanceTo(e.max);
  3987. (this.adjustedMinDistance = Math.max(
  3988. Math.min(t / 2, o.dollhouseDefault.minDistance),
  3989. 0
  3990. )),
  3991. (this.adjustedMaxDistance = Math.min(
  3992. Math.max(t, o.dollhouseDefault.maxDistance),
  3993. o.skyboxRadius
  3994. )),
  3995. (this.minDistance = this.adjustedMinDistance),
  3996. (this.maxDistance = this.adjustedMaxDistance);
  3997. }),
  3998. (n.prototype.resetRanges = function (e, t) {
  3999. e
  4000. ? ((this.minDistance = Math.min(e, this.minDistance)),
  4001. (this.maxDistance = Math.max(e, this.maxDistance)))
  4002. : ((this.minDistance = this.adjustedMinDistance),
  4003. (this.maxDistance = this.adjustedMaxDistance)),
  4004. t
  4005. ? ((this.minPolarAngle = r.Math.degToRad(-15)),
  4006. (this.maxPolarAngle = r.Math.degToRad(89.9)))
  4007. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4008. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle));
  4009. }),
  4010. (n.prototype.toJSON = function () {
  4011. return a.prototype.toJSON.call(this);
  4012. }),
  4013. (t.exports = n);
  4014. },
  4015. {
  4016. '../settings': 166,
  4017. './OutsideControls': 12,
  4018. three: 217,
  4019. },
  4020. ],
  4021. 11: [
  4022. function (e, t, i) {
  4023. 'use strict';
  4024. function n(e) {
  4025. a.call(this, e),
  4026. (this.minDistance = 15),
  4027. (this.maxDistance = 50),
  4028. (this.noRotateUpDown = !0),
  4029. (this.minPolarAngle = 0),
  4030. (this.maxPolarAngle = 0),
  4031. (this.mouseActions[l.LEFT] = s.PAN),
  4032. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  4033. (this.mouseActions[l.RIGHT] = s.ROTATE),
  4034. (this.touchActions[1] = s.PAN),
  4035. (this.touchActions[2] = s.ROTATE_DOLLY),
  4036. (this.absoluteScale = 1),
  4037. (this.currentScale = 1);
  4038. }
  4039. var r = e('three'),
  4040. o = e('../settings'),
  4041. a = e('./OutsideControls'),
  4042. s = e('../enum/ControlActions'),
  4043. l = e('../enum/MouseButton'),
  4044. c = e('../util/math'),
  4045. h = e('../util/browser');
  4046. (n.prototype = Object.create(a.prototype)),
  4047. (n.prototype.zoomToContain = function (e) {
  4048. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  4049. this.currentScale = this.absoluteScale;
  4050. }),
  4051. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  4052. let defaultRatio = 1.2,
  4053. absoluteScale;
  4054. if (_settings.floorPlanAngle) {
  4055. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  4056. var angle = parseFloat(_settings.floorPlanAngle);
  4057. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0));
  4058. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect); //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  4059. var screenSize = Math.min($('#player').width(), $('#player').height());
  4060. var maxSize = 800; //模型最大占据像素
  4061. ratio =
  4062. ratio != void 0
  4063. ? ratio
  4064. : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio);
  4065. absoluteScale = (n / 2 / o.orthoBase) * ratio; //根据模型所占最大视口尺寸调整缩放
  4066. } else {
  4067. var t = Math.max(modelSize.x, modelSize.z),
  4068. i = Math.min(modelSize.x, modelSize.z),
  4069. n = Math.max(t, i * this.camera.aspect),
  4070. r = Math.max(i, t * this.camera.aspect);
  4071. absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio;
  4072. }
  4073. return absoluteScale;
  4074. }),
  4075. /* n.prototype.rotateToView = function(e, t) {
  4076. var i = 0
  4077. , n = h.aspectRatio() < 1
  4078. , r = e.x < e.z;
  4079. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  4080. this.rotateLeft(i),
  4081. this.update(0)
  4082. },
  4083. */
  4084. (n.prototype.rotateToView = function (modelSize, direction) {
  4085. let i = 0,
  4086. n = h.aspectRatio() < 1; //是否模型尺寸显“细长”
  4087. if (_settings.floorPlanAngle) {
  4088. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  4089. i = parseFloat(_settings.floorPlanAngle);
  4090. } else {
  4091. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  4092. if (n === r) {
  4093. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  4094. if (direction.z > 0) {
  4095. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  4096. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  4097. }
  4098. //(第二种情况) 不做处理
  4099. } else if (direction.x > 0) {
  4100. i = Math.PI / 2;
  4101. } else {
  4102. i = -Math.PI / 2;
  4103. }
  4104. }
  4105. this.rotateLeft(i);
  4106. this.update(0);
  4107. }),
  4108. (n.prototype.rotateToAngle = function (angle) {
  4109. //add 旋转到特定角度
  4110. this.rotateLeft(angle + this.lon);
  4111. this.update(0);
  4112. }),
  4113. (n.prototype.pan = function (e, t) {
  4114. this.camera.updateMatrix(),
  4115. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  4116. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height());
  4117. }),
  4118. (n.prototype.updateZoom = function () {
  4119. return (
  4120. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  4121. (this.absoluteScale = Math.max(
  4122. o.zoomNearLimit,
  4123. Math.min(this.absoluteScale, o.zoomFarLimit)
  4124. )),
  4125. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  4126. (this.camera.left = -o.orthoBase * this.currentScale),
  4127. (this.camera.right = o.orthoBase * this.currentScale),
  4128. (this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
  4129. (this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
  4130. this.camera.updateProjectionMatrix(),
  4131. this.offset.length()
  4132. );
  4133. }),
  4134. (n.prototype.toJSON = (function () {
  4135. var e = new r.Quaternion(),
  4136. t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
  4137. i = new r.Quaternion();
  4138. return function () {
  4139. var n = a.prototype.toJSON.call(this);
  4140. return (
  4141. e.copy(n.camera_quaternion),
  4142. i.copy(t),
  4143. i.multiply(e),
  4144. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  4145. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  4146. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  4147. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  4148. (n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
  4149. n
  4150. );
  4151. };
  4152. })()),
  4153. (t.exports = n);
  4154. },
  4155. {
  4156. '../enum/ControlActions': 20,
  4157. '../enum/MouseButton': 34,
  4158. '../settings': 166,
  4159. '../util/browser': 182,
  4160. '../util/math': 190,
  4161. './OutsideControls': 12,
  4162. three: 217,
  4163. },
  4164. ],
  4165. 12: [
  4166. function (e, t, i) {
  4167. 'use strict';
  4168. function n(e) {
  4169. (this.camera = e),
  4170. (this.camera.controls = this),
  4171. (this.enabled = !1),
  4172. (this.target = new r.Vector3()),
  4173. (this.targetBounds = new r.Box3()),
  4174. (this.zoomSpeed = 1),
  4175. (this.minDistance = 0),
  4176. (this.maxDistance = 1 / 0),
  4177. (this.noRotateUpDown = !1),
  4178. (this.rotateSpeed = 1),
  4179. (this.keyboardZoomSpeed = 0),
  4180. (this.keyPanSpeed = 7),
  4181. (this.autoRotate = !1),
  4182. (this.autoRotateSpeed = 2),
  4183. (this.autoPan = !1),
  4184. (this.autoPanPosition = new r.Vector3()),
  4185. (this.minPolarAngle = r.Math.degToRad(25)),
  4186. (this.maxPolarAngle = r.Math.degToRad(65)),
  4187. (this.rotationAcceleration = new r.Vector2()),
  4188. (this.rotationSpeed = new r.Vector2()),
  4189. (this.panAcceleration = new r.Vector2()),
  4190. (this.panSpeed = new r.Vector2()),
  4191. (this.rotateStart = new r.Vector2()),
  4192. (this.rotateEnd = new r.Vector2()),
  4193. (this.rotateDelta = new r.Vector2()),
  4194. (this.panStart = new r.Vector2()),
  4195. (this.panEnd = new r.Vector2()),
  4196. (this.panDelta = new r.Vector2()),
  4197. (this.panOffset = new r.Vector3()),
  4198. (this.offset = new r.Vector3()),
  4199. (this.dollyStart = new r.Vector2()),
  4200. (this.dollyEnd = new r.Vector2()),
  4201. (this.dollyDelta = new r.Vector2()),
  4202. (this.phiDelta = 0),
  4203. (this.thetaDelta = 0),
  4204. (this.scale = 1),
  4205. (this.panVector = new r.Vector3()),
  4206. (this.lastPosition = new r.Vector3()),
  4207. (this.state = c.NONE),
  4208. (this.mouseActions = {}),
  4209. (this.mouseActions[h.LEFT] = c.ROTATE),
  4210. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  4211. (this.mouseActions[h.RIGHT] = c.PAN),
  4212. (this.touchActions = {}),
  4213. (this.touchActions[1] = c.ROTATE),
  4214. (this.touchActions[2] = c.PAN_DOLLY),
  4215. (this.lastMoveTime = 0),
  4216. (this.pointersLimit = 2),
  4217. (this.pointers = []);
  4218. }
  4219. var r = e('three'),
  4220. o = e('../settings'),
  4221. a = e('../util/common'),
  4222. s = e('../util/math'),
  4223. l = e('../enum/Vectors'),
  4224. c = e('../enum/ControlActions'),
  4225. h = e('../enum/MouseButton'),
  4226. u = e('../enum/Keys'),
  4227. d = e('../enum/ControlEvents'),
  4228. p = e('events').EventEmitter,
  4229. f = 1e-6;
  4230. (n.prototype = Object.create(p.prototype)),
  4231. (n.prototype.setBounds = function (e) {
  4232. this.targetBounds = e;
  4233. }),
  4234. (n.prototype.isEngaged = function () {
  4235. return this.state !== c.NONE;
  4236. }),
  4237. (n.prototype.rotateLeft = function (e) {
  4238. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e);
  4239. }),
  4240. (n.prototype.rotateUp = function (e) {
  4241. this.noRotateUpDown ||
  4242. (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e));
  4243. }),
  4244. (n.prototype.panLeft = function (e) {
  4245. var t = this.camera.matrix.elements;
  4246. this.panOffset.set(t[0], 0, t[2]).normalize(),
  4247. this.panOffset.multiplyScalar(-e),
  4248. this.panVector.add(this.panOffset);
  4249. }),
  4250. (n.prototype.panUp = function (e) {
  4251. var t = this.camera.matrix.elements;
  4252. this.panOffset.set(t[4], 0, t[6]).normalize(),
  4253. this.panOffset.multiplyScalar(-e),
  4254. this.panVector.add(this.panOffset);
  4255. }),
  4256. (n.prototype.startRotating = function (e, t) {
  4257. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t);
  4258. }),
  4259. (n.prototype.stopRotating = function (e) {
  4260. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4261. this.navRotationAcc('x', 0),
  4262. this.navRotationAcc('y', 0);
  4263. }),
  4264. (n.prototype.setAutoPanPosition = (function (e, t) {
  4265. var i = new r.Vector3(),
  4266. n = new r.Vector3();
  4267. return function (e, t) {
  4268. i.copy(this.camera.position),
  4269. (void 0 === e && null === e) || i.setX(e),
  4270. (void 0 === t && null === t) || i.setZ(t);
  4271. var r = this.camera.position.distanceTo(this.target),
  4272. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  4273. (this.targetClamped = !1),
  4274. n.copy(i).addScaledVector(o, r),
  4275. this.targetBounds.containsPoint(n) ||
  4276. (this.targetBounds.clampPoint(n, n),
  4277. i.copy(n).addScaledVector(o, -r),
  4278. (this.targetClamped = !0)),
  4279. (this.autoPanPosition.x = i.x),
  4280. (this.autoPanPosition.z = i.z),
  4281. this.autoPan && this.stopAutoPanning();
  4282. };
  4283. })()),
  4284. (n.prototype.stopAutoPanning = function () {
  4285. var e = this.autoPan;
  4286. (this.autoPan = !1),
  4287. this.emit(
  4288. this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete
  4289. );
  4290. }),
  4291. (n.prototype.dollyIn = function (e) {
  4292. void 0 === e && (e = this.getZoomScale()), (this.scale /= e);
  4293. }),
  4294. (n.prototype.dollyOut = function (e) {
  4295. void 0 === e && (e = this.getZoomScale()), (this.scale *= e);
  4296. }),
  4297. (n.prototype.updatePan = function (e) {
  4298. if (
  4299. (this.panSpeed
  4300. .multiplyScalar(1 - o.panFriction)
  4301. .addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4302. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4303. this.autoPan)
  4304. ) {
  4305. var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position);
  4306. t.setY(0).clampLength(0, 50 * e),
  4307. this.target.add(t),
  4308. this.camera.position.add(t),
  4309. this.autoPanPosition.x === this.camera.position.x &&
  4310. this.autoPanPosition.z === this.camera.position.z &&
  4311. ((this.autoPan = !1), this.stopAutoPanning());
  4312. }
  4313. }),
  4314. (n.prototype.update = function (e) {
  4315. e || (e = 1 / 60);
  4316. var friction = Math.min(1, o.rotationFriction * e * 60); //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4317. this.rotationSpeed
  4318. .multiplyScalar(1 - friction)
  4319. .addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4320. this.rotateLeft(-this.rotationSpeed.x),
  4321. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4322. this.updatePan(e);
  4323. var t = this.camera.position;
  4324. this.offset.copy(t).sub(this.target);
  4325. var i = Math.atan2(this.offset.x, this.offset.z),
  4326. n = Math.atan2(
  4327. Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z),
  4328. this.offset.y
  4329. );
  4330. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4331. (i += this.thetaDelta),
  4332. (n += this.phiDelta),
  4333. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  4334. (n = Math.max(f, Math.min(Math.PI - f, n)));
  4335. (this.lon = i), (this.lat = n); //add
  4336. var r = this.updateZoom();
  4337. (r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  4338. this.target.add(this.panVector),
  4339. this.targetBounds.clampPoint(this.target, this.target),
  4340. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  4341. (this.offset.y = r * Math.cos(n)),
  4342. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  4343. t.copy(this.target).add(this.offset),
  4344. this.camera.lookAt(this.target),
  4345. (this.thetaDelta = 0),
  4346. (this.phiDelta = 0),
  4347. (this.scale = 1),
  4348. this.panVector.set(0, 0, 0),
  4349. this.lastPosition.distanceTo(this.camera.position) > 0 &&
  4350. this.lastPosition.copy(this.camera.position);
  4351. }),
  4352. (n.prototype.getAutoRotationAngle = function () {
  4353. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed;
  4354. }),
  4355. (n.prototype.getZoomScale = function () {
  4356. return Math.pow(0.95, this.zoomSpeed);
  4357. }),
  4358. (n.prototype.onMouseDown = function (e) {
  4359. if (this.enabled) {
  4360. switch (
  4361. (e.preventDefault(),
  4362. this.stopAutoPanning(),
  4363. (this.mouseDown = !0),
  4364. (this.state = this.mouseActions[e.button]),
  4365. this.state)
  4366. ) {
  4367. case c.ROTATE:
  4368. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4369. this.rotationSpeed.set(0, 0);
  4370. break;
  4371. case c.DOLLY:
  4372. this.dollyStart.set(e.clientX, e.clientY);
  4373. break;
  4374. case c.PAN:
  4375. this.panStart.set(e.clientX, e.clientY);
  4376. }
  4377. this.emit(d.InputStart, 'mouse');
  4378. }
  4379. }),
  4380. (n.prototype.onMouseMove = function (e) {
  4381. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4382. switch ((e.preventDefault(), this.state)) {
  4383. case c.ROTATE:
  4384. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4385. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4386. this.rotateLeft(
  4387. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4388. ),
  4389. this.rotateUp(
  4390. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4391. this.rotateSpeed
  4392. ),
  4393. this.rotateStart.copy(this.rotateEnd);
  4394. break;
  4395. case c.DOLLY:
  4396. this.dollyEnd.set(e.clientX, e.clientY),
  4397. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4398. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4399. t.call(this), this.dollyStart.copy(this.dollyEnd);
  4400. break;
  4401. case c.PAN:
  4402. this.panEnd.set(e.clientX, e.clientY),
  4403. this.panDelta.subVectors(this.panEnd, this.panStart),
  4404. this.pan(this.panDelta.x, this.panDelta.y),
  4405. this.panStart.copy(this.panEnd);
  4406. }
  4407. this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update();
  4408. }
  4409. }),
  4410. (n.prototype.onMouseUp = function (e) {
  4411. this.enabled &&
  4412. ((this.mouseDown = !1),
  4413. (this.state = c.NONE),
  4414. 'mouseover' !== e.type &&
  4415. (e.timeStamp > this.lastMoveTime + 100
  4416. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4417. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4418. this.update(),
  4419. this.rotationAcceleration.set(0, 0),
  4420. this.rotateDelta.set(0, 0)));
  4421. }),
  4422. (n.prototype.onMouseOver = function (e) {
  4423. (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e);
  4424. }),
  4425. (n.prototype.onMouseWheel = function (e) {
  4426. if (this.enabled && o.useWheel) {
  4427. this.emit(d.Move, 'wheel');
  4428. var t = e.wheelDelta || -e.detail,
  4429. i = t > 0 ? this.dollyOut : this.dollyIn;
  4430. i.call(this), this.update();
  4431. }
  4432. }),
  4433. (n.prototype.onKeyDown = function (e) {
  4434. this.enabled &&
  4435. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)));
  4436. }),
  4437. (n.prototype.navRotationAcc = function (e, t) {
  4438. 'y' === e
  4439. ? this.noRotateUpDown
  4440. ? (this.keyboardZoomSpeed = t)
  4441. : (this.rotationAcceleration.y = t)
  4442. : (this.rotationAcceleration.x = t);
  4443. }),
  4444. (n.prototype.navPanAcc = function (e, t) {
  4445. this.stopAutoPanning(), (this.panAcceleration[e] = t);
  4446. }),
  4447. (n.prototype.handleKeyDown = function (e) {
  4448. var t = !0;
  4449. switch (e) {
  4450. case u.UPARROW:
  4451. case u.I:
  4452. this.navRotationAcc('y', 1);
  4453. break;
  4454. case u.DOWNARROW:
  4455. case u.K:
  4456. this.navRotationAcc('y', -1);
  4457. break;
  4458. case u.LEFTARROW:
  4459. case u.J:
  4460. this.navRotationAcc('x', -1);
  4461. break;
  4462. case u.RIGHTARROW:
  4463. case u.L:
  4464. this.navRotationAcc('x', 1);
  4465. break;
  4466. case u.W:
  4467. this.navPanAcc('y', 1);
  4468. break;
  4469. case u.S:
  4470. this.navPanAcc('y', -1);
  4471. break;
  4472. case u.A:
  4473. this.navPanAcc('x', -1);
  4474. break;
  4475. case u.D:
  4476. this.navPanAcc('x', 1);
  4477. break;
  4478. default:
  4479. t = !1;
  4480. }
  4481. t && this.emit(d.Move, 'key');
  4482. }),
  4483. (n.prototype.onKeyUp = function (e) {
  4484. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which));
  4485. }),
  4486. (n.prototype.handleKeyUp = function (e) {
  4487. switch (e) {
  4488. case u.I:
  4489. case u.K:
  4490. case u.UPARROW:
  4491. case u.DOWNARROW:
  4492. (this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0);
  4493. break;
  4494. case u.J:
  4495. case u.L:
  4496. case u.LEFTARROW:
  4497. case u.RIGHTARROW:
  4498. this.rotationAcceleration.x = 0;
  4499. break;
  4500. case u.S:
  4501. case u.W:
  4502. this.panAcceleration.y = 0;
  4503. break;
  4504. case u.A:
  4505. case u.D:
  4506. this.panAcceleration.x = 0;
  4507. }
  4508. }),
  4509. (n.prototype.onTouchStart = function (e) {
  4510. if (this.enabled || this.state === c.NONE) {
  4511. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning();
  4512. var t = function () {
  4513. if (2 === e.touches.length) {
  4514. var t = e.touches[0].pageX - e.touches[1].pageX,
  4515. i = e.touches[0].pageY - e.touches[1].pageY;
  4516. this.dollyStart.set(t, i);
  4517. }
  4518. }.bind(this),
  4519. i = function () {
  4520. this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'));
  4521. }.bind(this),
  4522. n = function () {
  4523. this.rotateStart.set(
  4524. a.average(e.touches, 'pageX'),
  4525. a.average(e.touches, 'pageY')
  4526. );
  4527. }.bind(this);
  4528. switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
  4529. case c.PAN_DOLLY:
  4530. t();
  4531. case c.PAN:
  4532. i();
  4533. break;
  4534. case c.ROTATE_DOLLY:
  4535. t();
  4536. case c.ROTATE:
  4537. n();
  4538. }
  4539. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch');
  4540. }
  4541. }),
  4542. (n.prototype.onTouchMove = function (e) {
  4543. if (this.enabled && this.state !== c.NONE) {
  4544. e.preventDefault(), e.stopPropagation();
  4545. var t = function () {
  4546. var t = e.touches[0].pageX - e.touches[1].pageX,
  4547. i = e.touches[0].pageY - e.touches[1].pageY;
  4548. this.dollyEnd.set(t, i);
  4549. var n = this.dollyStart.length() - this.dollyEnd.length();
  4550. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4551. this.dollyStart.copy(this.dollyEnd);
  4552. }.bind(this),
  4553. i = function () {
  4554. this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4555. this.panDelta.subVectors(this.panEnd, this.panStart),
  4556. this.pan(this.panDelta.x, this.panDelta.y),
  4557. this.panStart.copy(this.panEnd),
  4558. this.rotateDelta.set(0, 0);
  4559. }.bind(this),
  4560. n = function () {
  4561. this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4562. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4563. this.rotateLeft(
  4564. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4565. ),
  4566. this.rotateUp(
  4567. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4568. this.rotateSpeed
  4569. ),
  4570. this.rotateStart.copy(this.rotateEnd);
  4571. }.bind(this),
  4572. r = function () {
  4573. if (2 === e.touches.length) {
  4574. var i = window.devicePixelRatio || 1,
  4575. r = e.touches[1].pageX - e.touches[0].pageX,
  4576. s = e.touches[1].pageY - e.touches[0].pageY,
  4577. l = Math.sqrt(r * r + s * s),
  4578. h = Math.abs(this.dollyStart.length() - l);
  4579. if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t();
  4580. else {
  4581. var u = a.average(e.touches, 'pageX'),
  4582. d = a.average(e.touches, 'pageY'),
  4583. p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  4584. p > o.input.touchMoveThreshold &&
  4585. ((this.state = c.ROTATE), this.rotateStart.set(u, d), n());
  4586. }
  4587. }
  4588. }.bind(this);
  4589. switch (this.state) {
  4590. case c.PAN_DOLLY:
  4591. t();
  4592. case c.PAN:
  4593. i();
  4594. break;
  4595. case c.ROTATE_DOLLY:
  4596. r();
  4597. break;
  4598. case c.DOLLY:
  4599. t();
  4600. break;
  4601. case c.ROTATE:
  4602. n();
  4603. break;
  4604. default:
  4605. this.state = c.NONE;
  4606. }
  4607. (this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch');
  4608. }
  4609. }),
  4610. (n.prototype.onTouchEnd = function (e) {
  4611. this.enabled &&
  4612. (this.state === c.ROTATE &&
  4613. (e.timeStamp > this.lastMoveTime + 100
  4614. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4615. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4616. (this.state = c.NONE),
  4617. this.update(),
  4618. this.rotationAcceleration.set(0, 0),
  4619. this.rotateDelta.set(0, 0));
  4620. }),
  4621. (n.prototype.onPointerDown = function (e) {
  4622. this.enabled &&
  4623. ('touch' === e.pointerType &&
  4624. (this.pointers.length < this.pointersLimit &&
  4625. this.pointers.push({
  4626. id: e.pointerId,
  4627. pageX: e.pageX,
  4628. pageY: e.pageY,
  4629. }),
  4630. (e.touches = this.pointers),
  4631. this.onTouchStart(e)),
  4632. this.emit(d.InputStart, 'pointer'));
  4633. }),
  4634. (n.prototype.onPointerMove = function (e) {
  4635. this.enabled &&
  4636. 'touch' === e.pointerType &&
  4637. (this.pointers.forEach(function (t) {
  4638. e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY));
  4639. }),
  4640. (e.touches = this.pointers),
  4641. this.onTouchMove(e));
  4642. }),
  4643. (n.prototype.onPointerUp = function (e) {
  4644. this.enabled &&
  4645. 'touch' === e.pointerType &&
  4646. (this.pointers.forEach(
  4647. function (t, i) {
  4648. e.pointerId === t.id && this.pointers.splice(i, 1);
  4649. }.bind(this)
  4650. ),
  4651. (e.touches = this.pointers),
  4652. this.onTouchEnd(e));
  4653. }),
  4654. (n.prototype.reset = function () {
  4655. (this.state = c.NONE),
  4656. this.stopAutoPanning(),
  4657. this.rotationSpeed.set(0, 0),
  4658. this.rotationAcceleration.set(0, 0),
  4659. this.panSpeed.set(0, 0),
  4660. this.panAcceleration.set(0, 0);
  4661. }),
  4662. (n.prototype.toJSON = function () {
  4663. var e = {
  4664. camera_position: {
  4665. x: s.toPrecision(this.camera.position.x, 4),
  4666. y: s.toPrecision(this.camera.position.y, 4),
  4667. z: s.toPrecision(this.camera.position.z, 4),
  4668. },
  4669. camera_quaternion: {
  4670. x: s.toPrecision(this.camera.quaternion.x, 4),
  4671. y: s.toPrecision(this.camera.quaternion.y, 4),
  4672. z: s.toPrecision(this.camera.quaternion.z, 4),
  4673. w: s.toPrecision(this.camera.quaternion.w, 4),
  4674. },
  4675. };
  4676. return e;
  4677. }),
  4678. (t.exports = n);
  4679. },
  4680. {
  4681. '../enum/ControlActions': 20,
  4682. '../enum/ControlEvents': 21,
  4683. '../enum/Keys': 30,
  4684. '../enum/MouseButton': 34,
  4685. '../enum/Vectors': 50,
  4686. '../settings': 166,
  4687. '../util/common': 185,
  4688. '../util/math': 190,
  4689. events: 202,
  4690. three: 217,
  4691. },
  4692. ],
  4693. 13: [
  4694. function (e, t, i) {
  4695. (function (i) {
  4696. 'use strict';
  4697. function n(e) {
  4698. (this.camera = e),
  4699. (this.camera.controls = this),
  4700. (this.target = new r.Vector3(0, 0, 0)),
  4701. (this.lookVector = new r.Vector3()),
  4702. (this.lookSpeed = 0.05),
  4703. (this.rotationAcc = new r.Vector2()),
  4704. (this.rotationSpeed = new r.Vector2()),
  4705. (this.lat = 0),
  4706. (this.lon = 0),
  4707. (this.phi = 0),
  4708. (this.theta = 0),
  4709. (this.enabled = !1),
  4710. (this.locked = !1),
  4711. (this.pointer = new r.Vector2(0, 0)),
  4712. (this.rotationHistory = []),
  4713. (this.rotationDifference = new r.Vector2()),
  4714. (this.pointerDragOn = !1),
  4715. (this.pointerDragStart = new r.Vector2(0, 0)),
  4716. (this.pinchDistance = 0),
  4717. (this.moveStart = new r.Vector2()),
  4718. (this.moveTolerance = 0.01),
  4719. (this.pointersLimit = 2),
  4720. (this.pointers = []);
  4721. }
  4722. var r = e('three'),
  4723. o = e('../util/logger'),
  4724. a = e('../settings'),
  4725. s = e('../util/common'),
  4726. l = e('../util/math'),
  4727. c = (e('../enum/Vectors'), e('../enum/MouseButton')),
  4728. h = e('../enum/Keys'),
  4729. u = e('../enum/ControlEvents'),
  4730. d = e('events').EventEmitter;
  4731. new o(i);
  4732. (n.prototype = Object.create(d.prototype)),
  4733. (n.prototype.usable = function () {
  4734. return this.enabled && !this.locked;
  4735. }),
  4736. /* n.prototype.lookAt = function(e) {
  4737. var t = this.camera.position.clone().sub(e)
  4738. , i = Math.atan(t.z / t.x);
  4739. i += t.x < 0 ? Math.PI : 0,
  4740. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4741. this.lon = r.Math.radToDeg(i) + 180;
  4742. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4743. , o = Math.atan(t.y / n);
  4744. this.lat = -r.Math.radToDeg(o)
  4745. }
  4746. */
  4747. (n.prototype.lookAt = function (aim, dir) {
  4748. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4749. var i = Math.atan(t.z / t.x);
  4750. i += t.x < 0 ? Math.PI : 0;
  4751. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4752. this.lon = r.Math.radToDeg(i) + 180;
  4753. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4754. o = Math.atan(t.y / n);
  4755. this.lat = -r.Math.radToDeg(o);
  4756. }),
  4757. (n.prototype.startRotationFrom = function (e, t) {
  4758. l.convertScreenPositionToNDC(e, t, this.pointer),
  4759. (this.pointerDragOn = !0),
  4760. this.pointerDragStart.copy(this.pointer),
  4761. this.moveStart.copy(this.pointer),
  4762. (this.rotationHistory = []),
  4763. this.rotationSpeed.set(0, 0);
  4764. }),
  4765. (n.prototype.onMouseOver = function (e) {
  4766. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e);
  4767. }),
  4768. (n.prototype.onTouchStart = function (e) {
  4769. if (this.usable()) {
  4770. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4771. case 1:
  4772. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4773. break;
  4774. case 2:
  4775. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4776. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height();
  4777. this.pinchDistance = Math.sqrt(t * t + i * i);
  4778. }
  4779. this.emit(u.InputStart, 'touch');
  4780. }
  4781. }),
  4782. (n.prototype.onPointerDown = function (e) {
  4783. this.usable() &&
  4784. 'touch' === e.pointerType &&
  4785. (this.pointers.length < this.pointersLimit &&
  4786. this.pointers.push({
  4787. id: e.pointerId,
  4788. clientX: e.clientX,
  4789. clientY: e.clientY,
  4790. }),
  4791. (e.touches = this.pointers),
  4792. this.onTouchStart(e),
  4793. this.emit(u.InputStart, 'pointer'));
  4794. }),
  4795. (n.prototype.onMouseDown = function (e) {
  4796. if (this.usable()) {
  4797. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4798. case c.LEFT:
  4799. this.startRotationFrom(e.clientX, e.clientY);
  4800. }
  4801. SoundManager.pause('tour'); // zeg 点击场景时停止语音
  4802. this.emit(u.InputStart, 'mouse');
  4803. }
  4804. }),
  4805. (n.prototype.updateRotation = function () {
  4806. if (this.usable() && this.pointerDragOn) {
  4807. var e = new r.Vector3(
  4808. this.pointerDragStart.x,
  4809. this.pointerDragStart.y,
  4810. -1
  4811. ).unproject(this.camera),
  4812. t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4813. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4814. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4815. o = Math.atan2(e.y, i),
  4816. a = Math.atan2(t.y, n);
  4817. (this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0);
  4818. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4819. isNaN(s) ||
  4820. ((this.rotationDifference.x = r.Math.radToDeg(s)),
  4821. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4822. this.pointerDragStart.copy(this.pointer);
  4823. }
  4824. }),
  4825. (n.prototype.onMouseMove = function (e) {
  4826. this.usable() &&
  4827. (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4828. this.pointerDragOn &&
  4829. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance ||
  4830. Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4831. this.emit(u.Move, 'mouse'));
  4832. }),
  4833. (n.prototype.onTouchMove = function (e) {
  4834. if (this.usable())
  4835. switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
  4836. case 1:
  4837. l.convertScreenPositionToNDC(
  4838. e.touches[0].clientX,
  4839. e.touches[0].clientY,
  4840. this.pointer
  4841. );
  4842. break;
  4843. case 2:
  4844. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4845. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4846. n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4847. Math.abs(n) > 0.01 &&
  4848. (this.emit(u.InteractionDirect),
  4849. this.emit(u.Pinch, n),
  4850. (this.pinchDistance -= n));
  4851. }
  4852. }),
  4853. (n.prototype.onPointerMove = function (e) {
  4854. this.usable() &&
  4855. 'touch' === e.pointerType &&
  4856. (this.pointers.forEach(function (t) {
  4857. e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY));
  4858. }),
  4859. (e.touches = this.pointers),
  4860. this.onTouchMove(e));
  4861. }),
  4862. (n.prototype.endRotation = function () {
  4863. this.pointerDragOn = !1;
  4864. var e = s.averageVectors(this.rotationHistory);
  4865. this.rotationSpeed.set(
  4866. e.x * a.rotationAfterMoveMultiplier,
  4867. e.y * a.rotationAfterMoveMultiplier
  4868. );
  4869. }),
  4870. (n.prototype.onTouchEnd = function (e) {
  4871. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation());
  4872. }),
  4873. (n.prototype.onMouseUp = function (e) {
  4874. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation());
  4875. }),
  4876. (n.prototype.onPointerUp = function (e) {
  4877. this.usable() &&
  4878. 'touch' === e.pointerType &&
  4879. (this.pointers.forEach(
  4880. function (t, i) {
  4881. e.pointerId === t.id && this.pointers.splice(i, 1);
  4882. }.bind(this)
  4883. ),
  4884. (e.touches = this.pointers),
  4885. this.onTouchEnd(e));
  4886. }),
  4887. (n.prototype.update = function (e) {
  4888. this.lon, this.lat;
  4889. for (
  4890. this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone());
  4891. this.rotationHistory.length > a.rotationAfterMoveHistoryCount;
  4892. )
  4893. this.rotationHistory.shift();
  4894. (this.lon += this.rotationDifference.x),
  4895. (this.lat += this.rotationDifference.y),
  4896. this.rotationDifference.set(0, 0);
  4897. //改
  4898. var friction = Math.min(1, a.rotationFriction * e * 60); //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4899. (this.rotationSpeed.x =
  4900. this.rotationSpeed.x * (1 - friction) +
  4901. this.rotationAcc.x * a.rotationAccelerationInside),
  4902. (this.rotationSpeed.y =
  4903. this.rotationSpeed.y * (1 - friction) +
  4904. this.rotationAcc.y * a.rotationAccelerationInside),
  4905. (this.lon += this.rotationSpeed.x * e),
  4906. (this.lat += this.rotationSpeed.y * e);
  4907. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4908. var insideLookLimitDown =
  4909. a.insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2;
  4910. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2;
  4911. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4912. (this.phi = r.Math.degToRad(90 - this.lat)),
  4913. (this.theta = r.Math.degToRad(this.lon)),
  4914. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4915. (this.lookVector.y = Math.cos(this.phi)),
  4916. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4917. this.target.copy(this.lookVector).add(this.camera.position),
  4918. this.camera.lookAt(this.target);
  4919. }),
  4920. (n.prototype.onMouseWheel = function (e) {
  4921. if (this.usable()) {
  4922. var t = e.wheelDelta || -e.detail;
  4923. this.emit(u.InteractionDirect), this.emit(u.Scroll, t);
  4924. }
  4925. }),
  4926. (n.prototype.onKeyDown = function (e) {
  4927. this.usable() &&
  4928. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)));
  4929. }),
  4930. (n.prototype.handleKeyDown = function (e) {
  4931. var t = function (e, t) {
  4932. this.rotationAcc[e] = t;
  4933. }.bind(this);
  4934. this.emit(u.InteractionKey);
  4935. var i = !0;
  4936. switch (e) {
  4937. case h.LEFTARROW:
  4938. case h.J:
  4939. t('x', -1);
  4940. break;
  4941. case h.RIGHTARROW:
  4942. case h.L:
  4943. t('x', 1);
  4944. break;
  4945. case h.I:
  4946. t('y', 1);
  4947. break;
  4948. case h.K:
  4949. t('y', -1);
  4950. break;
  4951. default:
  4952. i = !1;
  4953. }
  4954. i && this.emit(u.Move, 'key');
  4955. }),
  4956. (n.prototype.onKeyUp = function (e) {
  4957. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which));
  4958. }),
  4959. (n.prototype.handleKeyUp = function (e) {
  4960. switch (e) {
  4961. case h.LEFTARROW:
  4962. case h.J:
  4963. case h.RIGHTARROW:
  4964. case h.L:
  4965. this.rotationAcc.x = 0;
  4966. break;
  4967. case h.I:
  4968. case h.K:
  4969. this.rotationAcc.y = 0;
  4970. }
  4971. }),
  4972. (n.prototype.startRotating = function (e, t) {
  4973. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t);
  4974. }),
  4975. (n.prototype.stopRotating = function (e) {
  4976. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0);
  4977. }),
  4978. (n.prototype.reset = function () {
  4979. (this.pointerDragOn = !1),
  4980. this.rotationAcc.set(0, 0),
  4981. this.rotationSpeed.set(0, 0),
  4982. (this.pointers = []);
  4983. }),
  4984. (n.prototype.toJSON = function () {
  4985. var e = {
  4986. camera_position: {
  4987. x: l.toPrecision(this.camera.position.x, 4),
  4988. y: l.toPrecision(this.camera.position.y, 4),
  4989. z: l.toPrecision(this.camera.position.z, 4),
  4990. },
  4991. camera_quaternion: {
  4992. x: l.toPrecision(this.camera.quaternion.x, 4),
  4993. y: l.toPrecision(this.camera.quaternion.y, 4),
  4994. z: l.toPrecision(this.camera.quaternion.z, 4),
  4995. w: l.toPrecision(this.camera.quaternion.w, 4),
  4996. },
  4997. };
  4998. return e;
  4999. }),
  5000. (n.prototype.setStateFromJSON = function (e) {
  5001. this.camera.position.copy(e.camera_position),
  5002. this.camera.quaternion.copy(e.camera_quaternion);
  5003. }),
  5004. (t.exports = n);
  5005. }.call(this, '/js/controls/PanoramaControls.js'));
  5006. },
  5007. {
  5008. '../enum/ControlEvents': 21,
  5009. '../enum/Keys': 30,
  5010. '../enum/MouseButton': 34,
  5011. '../enum/Vectors': 50,
  5012. '../settings': 166,
  5013. '../util/common': 185,
  5014. '../util/logger': 189,
  5015. '../util/math': 190,
  5016. events: 202,
  5017. three: 217,
  5018. },
  5019. ],
  5020. 14: [
  5021. function (e, t, i) {
  5022. (function (i) {
  5023. 'use strict';
  5024. var n = e('three'),
  5025. r = e('../enum/Viewmode'),
  5026. o = e('../util/logger'),
  5027. a = new o(i);
  5028. t.exports = {
  5029. serialize: function (e) {
  5030. return encodeURI(JSON.stringify(e));
  5031. },
  5032. deserialize: function (e) {
  5033. function t(e) {
  5034. function t(e, t) {
  5035. return e && 'number' == typeof t && !isNaN(t);
  5036. }
  5037. return e.reduce(t, !0);
  5038. }
  5039. try {
  5040. var i = JSON.parse(decodeURI(e)),
  5041. o = {
  5042. mode: r.fromInt(i.camera_mode),
  5043. panoId: i.scan_id,
  5044. position: new n.Vector3().copy(i.camera_position),
  5045. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  5046. zoom: i.ortho_zoom,
  5047. floorVisibility: i.floor_visibility,
  5048. },
  5049. s = o.position;
  5050. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  5051. var l = o.quaternion;
  5052. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o;
  5053. } catch (i) {
  5054. a.debug(
  5055. 'Not able to parse start location as JSON; falling back to old array style parsing'
  5056. );
  5057. try {
  5058. var c = e.split(','),
  5059. h = {
  5060. x: parseFloat(c[2]),
  5061. y: parseFloat(c[3]),
  5062. z: parseFloat(c[4]),
  5063. },
  5064. u = {
  5065. x: parseFloat(c[5]),
  5066. y: parseFloat(c[6]),
  5067. z: parseFloat(c[7]),
  5068. w: parseFloat(c[8]),
  5069. };
  5070. return (
  5071. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  5072. t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  5073. {
  5074. mode: r.fromInt(c[0]),
  5075. panoId: c[1],
  5076. position: new n.Vector3().copy(h),
  5077. quaternion: new n.Quaternion().copy(u),
  5078. }
  5079. );
  5080. } catch (t) {
  5081. a.warn('Invalid start override, ignoring: "' + e + '"', t.message);
  5082. }
  5083. }
  5084. return null;
  5085. },
  5086. };
  5087. }.call(this, '/js/controls/serializer.js'));
  5088. },
  5089. {
  5090. '../enum/Viewmode': 51,
  5091. '../util/logger': 189,
  5092. three: 217,
  5093. },
  5094. ],
  5095. 15: [
  5096. function (e, t, i) {
  5097. (function (i) {
  5098. 'use strict';
  5099. function n() {
  5100. (this.endlessLoop = a.warp.loop),
  5101. (this.clock = new r.Clock(!0)),
  5102. (this.model = null),
  5103. (this.player = null),
  5104. (this.currentItem = null),
  5105. (this.destinationItem = null),
  5106. (this.tourIsPlaying = !1),
  5107. (this.transitionStage = y.None),
  5108. (this.nextFunc = null),
  5109. (this.onTheBus = !1),
  5110. (this.tourInProgress = !1),
  5111. (this.reachSource = null),
  5112. (this.interrupted = !1),
  5113. (this.nItems = 0),
  5114. (this.walkingSectionPaused = !1);
  5115. }
  5116. var r = e('three'),
  5117. o = e('./util/logger'),
  5118. a = e('./settings'),
  5119. s = e('./util/transitions'),
  5120. l = e('events').EventEmitter,
  5121. c = e('./enum/Viewmode'),
  5122. h = e('./analytics'),
  5123. u = e('./enum/WarpStyle'),
  5124. s = e('./util/transitions'),
  5125. d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
  5126. p = e('./enum/DirectorEvents'),
  5127. f = e('./enum/PlayerEvents'),
  5128. g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
  5129. m = e('./enum/PathDiscardMode'),
  5130. v = e('./enum/PathDisplayMode'),
  5131. A = (e('./player'), new o(i)),
  5132. y = Object.freeze({
  5133. None: 0,
  5134. Moving: 1,
  5135. Aiming: 2,
  5136. Interlude: 3,
  5137. }),
  5138. C = Object.freeze({
  5139. Forward: 1,
  5140. NoChange: 0,
  5141. Backwards: -1,
  5142. }),
  5143. I = s.getUniqueId();
  5144. (n.prototype = Object.create(l.prototype)),
  5145. (n.prototype.init = function (e, t) {
  5146. (this.player = e),
  5147. (this.modelManager = t),
  5148. this.updateModel(),
  5149. this.resetAll(),
  5150. this.bindEvents();
  5151. // // zeg 查询pano对应的导览片段
  5152. // if(!this.panoIdMap) {
  5153. // this.panoIdMap = new Map()
  5154. // this.model.heroLocations.forEach( (value, index) => {
  5155. // // value.heroLocations.forEach( hl => {
  5156. // if(!value.heroLocations) return
  5157. // let hl = value.heroLocations[0]
  5158. // let arr = this.panoIdMap.get(hl.panoId)
  5159. // if(arr){
  5160. // this.panoIdMap.set(hl.panoId, [...arr, index])
  5161. // } else {
  5162. // this.panoIdMap.set(hl.panoId, [index])
  5163. // }
  5164. // // })
  5165. // })
  5166. // }
  5167. }),
  5168. (n.prototype.resetAll = function () {
  5169. if (
  5170. ((this.currentItem = null),
  5171. (this.destinationItem = null),
  5172. (this.tourIsPlaying = !1),
  5173. // this.bgmReplay(),//xzw
  5174. (this.transitionStage = y.None),
  5175. (this.nextFunc = null),
  5176. (this.onTheBus = !1),
  5177. (this.reachSource = null),
  5178. (this.interrupted = !1),
  5179. this.model)
  5180. ) {
  5181. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  5182. this.defaultWarpStyle =
  5183. this.model.data.hasOwnProperty('player_options') &&
  5184. this.model.data.player_options &&
  5185. this.model.data.player_options.fast_transitions === !1
  5186. ? e
  5187. : u.BLACK;
  5188. } else
  5189. (this.defaultWarpStyle = u.BLACK),
  5190. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  5191. this.resetSpecialTransition();
  5192. }),
  5193. (n.prototype.updateModel = function () {
  5194. (this.model = this.modelManager.getActiveModel()),
  5195. (this.nItems = this.model.heroLocations.length);
  5196. }),
  5197. (n.prototype.bindEvents = function () {
  5198. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  5199. this.player.on(
  5200. f.WarpInterruptedWithFlyTo,
  5201. this.checkAndHandleWalkingtourInterruption.bind(this)
  5202. ),
  5203. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  5204. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  5205. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  5206. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  5207. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  5208. this.player.once(f.Move, function () {
  5209. s.cancelById(I);
  5210. });
  5211. }),
  5212. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  5213. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  5214. return (
  5215. /* e === u.WALK && ( */ this.interrupt(g.NONE),
  5216. this.pauseWalkingSection(),
  5217. this.player.fastForwardActivePanoFlight(),
  5218. !0
  5219. ); /* ) */
  5220. }),
  5221. (n.prototype.handlePlayerMove = function (e) {
  5222. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  5223. this.emit('update.controls');
  5224. }),
  5225. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  5226. this.intermediateState() ||
  5227. e.id === t.id ||
  5228. ((this.onTheBus = !1), this.emit('update.controls'));
  5229. }),
  5230. (n.prototype.handlePlayerModeChanged = function (e, t) {
  5231. this.intermediateState() ||
  5232. e === t ||
  5233. ((this.onTheBus = !1), this.emit('update.controls'));
  5234. }),
  5235. (n.prototype.handlePlayerInputStart = function (e) {
  5236. this.transitionStage === y.Interlude && this.interrupt(g.NONE);
  5237. }),
  5238. (n.prototype.handlePlayerFlyingStarted = function () {
  5239. this.clearWalkingSectionPaused();
  5240. }),
  5241. (n.prototype.describe = function () {
  5242. return {
  5243. nItems: this.nItems,
  5244. currentItem: this.currentItem,
  5245. destinationItem: this.destinationItem,
  5246. tourIsPlaying: this.tourIsPlaying,
  5247. onTheBus: this.onTheBus,
  5248. endlessLoop: this.endlessLoop,
  5249. viewMode: this.player.mode,
  5250. inTransition: this._inTransition(),
  5251. transitionStage: this.transitionStage,
  5252. tourInProgress: this.tourInProgress,
  5253. };
  5254. }),
  5255. (n.prototype._inTransition = function () {
  5256. return (
  5257. this.player.flying ||
  5258. this.player.isWarping() ||
  5259. this.player.isWaitingToWarp() ||
  5260. this.player.mode === c.TRANSITIONING ||
  5261. this.tourIsPlaying
  5262. );
  5263. }),
  5264. (n.prototype.bounceable = function () {
  5265. var e = this.clock.getDelta();
  5266. return (
  5267. this.isInterrupted() ||
  5268. (e < 0.9 && e > 0.01) ||
  5269. (this.player.flying && !this.player.isWarping())
  5270. );
  5271. }),
  5272. (n.prototype.itemCompare = function (item1, item2, type) {
  5273. //add
  5274. if (type == 'equal') {
  5275. //==
  5276. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1];
  5277. } else if (type == 'less') {
  5278. //<
  5279. return (
  5280. (item1 && item2 && item1[0] < item2[0]) ||
  5281. (item1[0] == item2[0] && item1[1] < item2[1])
  5282. );
  5283. }
  5284. });
  5285. (n.prototype.currentMoveDirection = function () {
  5286. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  5287. return null === this.currentItem || void 0 === this.currentItem
  5288. ? y.Forward
  5289. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  5290. ? y.NoChange
  5291. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  5292. ? y.Forward
  5293. : y.Backwards;
  5294. }),
  5295. (n.prototype.clearPath = function () {
  5296. this._inTransition() || this.player.path.discardPathObject();
  5297. }),
  5298. (n.prototype.allFloors = function () {
  5299. this.model.toggleAllFloors();
  5300. }),
  5301. (n.prototype.actionComplete = function (e) {
  5302. if (
  5303. ((this.interrupted = !1),
  5304. (this.transitionStage = y.None),
  5305. this.resetSpecialTransition(),
  5306. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  5307. this.tourIsPlaying ||
  5308. (this.player.disablePreRendering(),
  5309. this.player.mode === c.PANORAMA &&
  5310. this.player.currentPano.isAligned() &&
  5311. this.model.fadePanoMarkers()),
  5312. this.emit('update.controls'),
  5313. this.nextFunc)
  5314. ) {
  5315. var t = this.nextFunc;
  5316. (this.nextFunc = null), t();
  5317. }
  5318. }),
  5319. (n.prototype.awaitCompletion = function (e, t) {
  5320. (this.nextFunc = t), e();
  5321. }),
  5322. (n.prototype.updateSuccessFunction = function (e) {
  5323. this.nextFunc = e;
  5324. }),
  5325. (n.prototype.interrupt = function (e, t) {
  5326. return (
  5327. !!this.wouldInterrupt() &&
  5328. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5329. (this.tourIsPlaying = !1),
  5330. //this.bgmReplay(),//xzw
  5331. (this.interrupted = !0),
  5332. (this.nextFunc = null),
  5333. this.emit(p.ActionInterrupted),
  5334. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  5335. this.player.interruptAndFastForward(e, t),
  5336. !0)
  5337. );
  5338. }),
  5339. (n.prototype.wouldInterrupt = function () {
  5340. return this.transitionStage !== y.None;
  5341. }),
  5342. (n.prototype.intermediateState = function () {
  5343. return this.transitionStage !== y.None;
  5344. }),
  5345. (n.prototype.isInterrupted = function () {
  5346. return this.interrupted;
  5347. }),
  5348. (n.prototype.pauseWalkingSection = function () {
  5349. this.walkingSectionPaused = !0;
  5350. }),
  5351. (n.prototype.clearWalkingSectionPaused = function () {
  5352. this.walkingSectionPaused = !1;
  5353. }),
  5354. (n.prototype.autoTour = function () {
  5355. var e = Date.now();
  5356. this.model.auxDataPromise.then(
  5357. function () {
  5358. e = Date.now() - e;
  5359. var t = a.warp.auto,
  5360. i =
  5361. this.model.data &&
  5362. this.model.data
  5363. .player_options; /* && this.model.data.player_options.highlight_reel */
  5364. t >= 0 &&
  5365. this.model.heroCount() > 1 &&
  5366. i &&
  5367. s.trigger({
  5368. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5369. done: function () {
  5370. this.playTour();
  5371. }.bind(this),
  5372. name: '_atr',
  5373. id: I,
  5374. });
  5375. }.bind(this)
  5376. );
  5377. }),
  5378. (n.prototype.atDestinationPano = function (pano) {
  5379. if (null === this.destinationItem) return !1;
  5380. pano = pano || this.player.currentPano;
  5381. if (!pano) {
  5382. return !1;
  5383. }
  5384. var destination =
  5385. this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem);
  5386. return destination && destination.panoId == pano.id;
  5387. }),
  5388. (n.prototype.redirectToItem = function (e, t) {
  5389. if (null === e || void 0 === e)
  5390. return void A.warn('Director.redirectToItem() -> Redirecting to null item.');
  5391. if (!this.wouldInterrupt())
  5392. return void A.warn(
  5393. 'Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.'
  5394. );
  5395. if (this.player.mode === c.TRANSITIONING)
  5396. return void A.debug(
  5397. 'Director.redirectToItem() -> Cannot redirect while transitioning.'
  5398. );
  5399. A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t);
  5400. var i = function () {
  5401. s.setTimeout(
  5402. function () {
  5403. this.setDestinationItem(e),
  5404. this.goToDestination(
  5405. !0,
  5406. g.BEGINNING,
  5407. a.warp.warpInterruptionRedirectTime,
  5408. !1
  5409. );
  5410. }.bind(this),
  5411. 0
  5412. );
  5413. }.bind(this);
  5414. this.interrupt(g.END, 0), this.updateSuccessFunction(i);
  5415. }),
  5416. (n.prototype.useSpecialTransition = function (e) {
  5417. void 0 !== e &&
  5418. this.defaultWarpStyle !== u.BLACK &&
  5419. A.debug('useSpecialTransition(): ' + e),
  5420. (this.nextWarpStyle = u.BLACK);
  5421. }),
  5422. (n.prototype.resetSpecialTransition = function () {
  5423. this.nextWarpStyle = this.defaultWarpStyle;
  5424. }),
  5425. (n.prototype.arrivedAtDestination = function (e) {
  5426. if (this.player.flying || this.player.isWarping())
  5427. A.warn('Cannot advance to interlude or aiming while player is flying or warping.');
  5428. else {
  5429. this.transitionStage = y.Aiming;
  5430. var t = this.tourIsPlaying
  5431. ? this.tourInterlude.bind(this, this.nextItem(this.currentItem))
  5432. : null;
  5433. this.player.model.fadePanoMarkers(0),
  5434. this.awaitCompletion(
  5435. function () {
  5436. this.resetSpecialTransition(),
  5437. e
  5438. ? this.player.aimTourCamera(
  5439. this.destinationItem,
  5440. v.Retain,
  5441. v.Slow,
  5442. this.actionComplete.bind(this)
  5443. )
  5444. : this.actionComplete();
  5445. }.bind(this),
  5446. t
  5447. );
  5448. }
  5449. }),
  5450. (n.prototype.goToDestination = function (e, t, i, n) {
  5451. //音频
  5452. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo;
  5453. // zeg 手动导览不播放音频
  5454. if (musicInfo && musicInfo.music && !e) {
  5455. let musicType = localStorage.getItem('xunirole') || 'male';
  5456. let isMale = musicType.indexOf('female') < 0;
  5457. let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music;
  5458. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5459. let src = fixMusic;
  5460. let audioObj = SoundManager.list.find((e) => e.name == 'tour');
  5461. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  5462. let audioSrc2 = common.getFileNameFromUrl(src);
  5463. if (audioSrc1 == audioSrc2) {
  5464. //应该是继续播放该folder
  5465. if (this.destinationItem[1] == 0) {
  5466. //从头开始播放 因为可能暂停后然后再点该缩略图播
  5467. SoundManager.play('tour', null, 0); // currentTime = 0;
  5468. } else if (
  5469. audioObj.audio.paused &&
  5470. audioObj.audio.currentTime < audioObj.audio.duration
  5471. ) {
  5472. //未播完
  5473. SoundManager.play('tour'); //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  5474. }
  5475. } else {
  5476. //很可能是该folder的起始
  5477. SoundManager.play('tour', manage.dealURL(src));
  5478. }
  5479. }
  5480. let oldPos = this.player.position.clone();
  5481. let oldPano = this.player.currentPano;
  5482. if (
  5483. ((this.onTheBus = !0),
  5484. this.emit('update.controls'),
  5485. this.player.updateLastView(),
  5486. !n && this.atDestinationPano())
  5487. ) {
  5488. /*
  5489. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5490. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5491. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5492. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5493. } */
  5494. return void this.arrivedAtDestination(!0);
  5495. }
  5496. if (this.player.flying || this.player.isWarping())
  5497. A.warn('Cannot go to new destination while player is flying or warping.');
  5498. else {
  5499. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  5500. o = null,
  5501. a1 = null;
  5502. if (r.isPano()) {
  5503. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5504. //var walk = window.DATA.black ? 'black' : 'walk';
  5505. //若是点击item,直接瞬间过渡。
  5506. var s = e ? 'black' : this.getMomentTour(this.destinationItem); //window.DATA.momentTour || "walk";
  5507. if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0) s = 'black'; // 周恩光加 返回最初导览点是瞬间过渡
  5508. (a1 = this.player.warpToPanoByHeroIndex.bind(
  5509. this.player,
  5510. this.destinationItem,
  5511. v.Show,
  5512. m.Slow,
  5513. s,
  5514. true,
  5515. i,
  5516. this.actionComplete.bind(this)
  5517. )),
  5518. (o = this.arrivedAtDestination.bind(this, !0));
  5519. if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
  5520. //add
  5521. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime); //瞬间过渡的时间
  5522. }
  5523. } else {
  5524. (a1 = this.player.warpToNonPanoByHeroIndex.bind(
  5525. this.player,
  5526. this.destinationItem,
  5527. this.actionComplete.bind(this)
  5528. )),
  5529. (o = this.arrivedAtDestination.bind(this, !1));
  5530. }
  5531. (this.transitionStage = y.Moving),
  5532. this.model.fadePanoMarkers(0),
  5533. this.awaitCompletion(
  5534. function () {
  5535. a1();
  5536. }.bind(this),
  5537. o
  5538. ),
  5539. this.emit('update.controls');
  5540. }
  5541. }),
  5542. (n.prototype.tourInterlude = function () {
  5543. if (
  5544. (h.trackAlways('reach_highlight', {
  5545. reach_source: this.reachSource,
  5546. }),
  5547. this.model.fadePanoMarkers(0),
  5548. this.emit('update.controls'),
  5549. this.tourIsPlaying)
  5550. )
  5551. return this.atEndOfTour() && !this.endlessLoop
  5552. ? ((this.tourInProgress = !1),
  5553. void this.awaitCompletion(
  5554. function () {
  5555. (this.transitionStage = y.Interlude),
  5556. this.player.tourInterlude(
  5557. this.nextItem(this.currentItem),
  5558. this.actionComplete.bind(this)
  5559. );
  5560. }.bind(this),
  5561. function () {
  5562. (this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd);
  5563. }.bind(this)
  5564. ),
  5565. void (
  5566. this.player.mode === c.PANORAMA &&
  5567. this.model.fadePanoMarkers(a.panorama.markerOpacity)
  5568. ))
  5569. : void this.awaitCompletion(
  5570. function () {
  5571. (this.transitionStage = y.Interlude),
  5572. this.player.tourInterlude(
  5573. this.nextItem(this.currentItem),
  5574. this.actionComplete.bind(this)
  5575. );
  5576. }.bind(this),
  5577. this.goNext.bind(this)
  5578. );
  5579. }),
  5580. (n.prototype.findNearestItem = function (endToStart = true) {
  5581. //找到离currentPano最近的导览
  5582. if (this.atDestinationPano(this.player.currentPano)) {
  5583. //在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  5584. return [0, 0];
  5585. }
  5586. //注:没有判断此刻是否在panorama模式,就使用currentPano
  5587. var result = { item: [0, 0], dis: Infinity };
  5588. var compare = (location, item) => {
  5589. if (location.panoId != void 0 && location.panoId != 'outside') {
  5590. var pano = this.model.panos.index[location.panoId];
  5591. var dis = pano.position.distanceTo(this.player.currentPano.position);
  5592. if (dis < result.dis) {
  5593. (result.item = item), (result.dis = dis);
  5594. } else if (dis == result.dis) {
  5595. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  5596. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  5597. result.item = item, result.dis = dis
  5598. } */
  5599. if (
  5600. this.currentItem &&
  5601. Math.abs(item[0] - this.currentItem[0]) <
  5602. Math.abs(result.item[0] - this.currentItem[0])
  5603. ) {
  5604. (result.item = item), (result.dis = dis);
  5605. }
  5606. }
  5607. }
  5608. };
  5609. this.model.heroLocations.forEach((e, i) => {
  5610. if (e.heroLocations) {
  5611. /* e.heroLocations.forEach((a,j)=>{
  5612. compare(a, [i,j])
  5613. }) */
  5614. var location = e.heroLocations.find((e) => e.panoId != void 0);
  5615. location && compare(location, [i, 0]); //跳到此区域开头
  5616. } else {
  5617. compare(e, [i, 0]);
  5618. }
  5619. });
  5620. if (endToStart && this.atEndOfTour(result.item)) {
  5621. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  5622. return [0, 0]; //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  5623. }
  5624. return result.item;
  5625. });
  5626. n.prototype.playTour = function () {
  5627. if (!this.bounceable() && this.model.heroLocations.length) {
  5628. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  5629. // if(!this.currentItem) this.currentItem = []
  5630. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  5631. // // zeg 从当前pano进行自动导览
  5632. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  5633. // // this.model.heroLocations.forEach( (value, index) => {
  5634. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  5635. // // currentPanoDestinations.push(index)
  5636. // // }
  5637. // // })
  5638. // if(!currentPanoDestinations) {
  5639. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  5640. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  5641. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  5642. // for(var i = 0; i < neighbourIndex.length; i++) {
  5643. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  5644. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  5645. // }
  5646. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  5647. // }
  5648. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  5649. // this.currentItem[0] = currentPanoDestinations[0]
  5650. // }
  5651. // }
  5652. return this.tourIsPlaying
  5653. ? void A.info('tour is already playing')
  5654. : void (
  5655. this.wouldInterrupt() ||
  5656. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5657. (this.tourInProgress = !0),
  5658. (this.reachSource = 'play'),
  5659. (this.tourIsPlaying = !0),
  5660. (this.wasZoomEnabled = this.player.zoomEnabled),
  5661. (this.player.zoomEnabled = !1),
  5662. this.resetSpecialTransition(),
  5663. this.emit('update.controls'),
  5664. this.emit(p.TourStart),
  5665. this.player.enablePreRendering(),
  5666. // this.currentItem[1] = null,
  5667. this.walkingSectionPaused
  5668. ? (this.clearWalkingSectionPaused(), this.goToDestination())
  5669. : this.goNext())
  5670. );
  5671. }
  5672. };
  5673. (n.prototype.playTourNearBy = function () {
  5674. //就近导览
  5675. if (!this.bounceable()) {
  5676. return this.tourIsPlaying
  5677. ? void A.info('tour is already playing')
  5678. : void (
  5679. this.wouldInterrupt() ||
  5680. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5681. (this.tourInProgress = !0),
  5682. (this.reachSource = 'play'),
  5683. (this.tourIsPlaying = !0),
  5684. (this.wasZoomEnabled = this.player.zoomEnabled),
  5685. (this.player.zoomEnabled = !1),
  5686. this.resetSpecialTransition(),
  5687. this.emit('update.controls'),
  5688. this.emit(p.TourStart),
  5689. this.player.enablePreRendering(),
  5690. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5691. this.goToDestination()) : this.goNext())
  5692. // this.setDestinationItem(this.findNearestItem()),
  5693. // this.goToDestination())
  5694. );
  5695. }
  5696. }),
  5697. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5698. } */
  5699. (n.prototype.stopTour = function (isAutoStop) {
  5700. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5701. SoundManager.pause('tour'), // zeg 自动导览暂停时同时停止语音
  5702. this.isInterrupted() ||
  5703. (this.transitionStage === y.Moving &&
  5704. this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  5705. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5706. (this.tourIsPlaying = !1),
  5707. this.interrupt(),
  5708. this.clearWalkingSectionPaused(),
  5709. this.resetSpecialTransition(),
  5710. this.emit('update.controls'));
  5711. }),
  5712. (n.prototype.endTourProgress = function () {
  5713. (this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd);
  5714. }),
  5715. (n.prototype.goToHighlight = function (e) {
  5716. if (this.wouldInterrupt())
  5717. this.itemCompare(this.destinationItem, e, 'equal')
  5718. ? this.interrupt()
  5719. : this.redirectToItem(e, 'goToHighlight');
  5720. else {
  5721. if ((A.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return;
  5722. this.clearWalkingSectionPaused(),
  5723. this.setDestinationItem(e),
  5724. this.useSpecialTransition('Hilight');
  5725. this.goToDestination(true), //add true
  5726. h.trackAlways('reach_highlight', {
  5727. reach_source: 'thumb',
  5728. });
  5729. }
  5730. }),
  5731. (n.prototype.prevHighlight = function () {
  5732. this.bounceable() ||
  5733. (this.player.emit('tour_manual', 'prev'),
  5734. this.interrupt(g.BEGINNING) ||
  5735. this.isInterrupted() ||
  5736. (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()));
  5737. }),
  5738. (n.prototype.nextHighlight = function () {
  5739. this.bounceable() ||
  5740. (this.player.emit('tour_manual', 'next'),
  5741. this.interrupt(g.BEGINNING) ||
  5742. this.isInterrupted() ||
  5743. (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()));
  5744. }),
  5745. (n.prototype.changeMode = function (e) {
  5746. var t = $.Deferred(),
  5747. i = t.resolve.bind(t),
  5748. n = t.reject.bind(t);
  5749. this.emit(p.StartModeChange);
  5750. var r = function () {
  5751. return (
  5752. this.clearWalkingSectionPaused(),
  5753. !!this.wouldInterrupt() && (this.interrupt(), !0)
  5754. );
  5755. }.bind(this);
  5756. if (!r()) {
  5757. switch (e) {
  5758. case c.PANORAMA:
  5759. this.player.mode === c.PANORAMA
  5760. ? this.player.currentPano.isAligned() ||
  5761. this.player.goToLastView(!0).done(i).fail(n)
  5762. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  5763. break;
  5764. case c.DOLLHOUSE:
  5765. case c.FLOORPLAN:
  5766. this.player
  5767. .flyToNewMode({
  5768. mode: e,
  5769. })
  5770. .done(i)
  5771. .fail(n);
  5772. break;
  5773. case c.OUTDOOR:
  5774. this.player.model.has360Views &&
  5775. (this.player.mode !== c.PANORAMA ||
  5776. (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
  5777. this.player.goToLastView(!1).done(i).fail(n);
  5778. }
  5779. return t.promise();
  5780. }
  5781. }),
  5782. (n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
  5783. var end = currentItem && currentItem[0] >= this.nItems - 1;
  5784. if (end) {
  5785. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations;
  5786. if (heroLocations) {
  5787. end = currentItem[1] >= heroLocations.length - 1;
  5788. }
  5789. }
  5790. return end;
  5791. }),
  5792. (n.prototype.firstDestination = function () {
  5793. //return 0 < this.nItems ? 0 : null
  5794. return 0 < this.nItems ? [0, 0] : null;
  5795. }),
  5796. (n.prototype.finalDestination = function () {
  5797. //return 0 < this.nItems ? this.nItems - 1 : null
  5798. return 0 < this.nItems ? [this.nItems - 1, 0] : null;
  5799. }),
  5800. (n.prototype.goPrev = function () {
  5801. this.tourAdvance(-1);
  5802. }),
  5803. (n.prototype.goNext = function () {
  5804. this.tourAdvance(1);
  5805. }),
  5806. (n.prototype.setDestinationItem = function (e) {
  5807. (this.destinationItem = e), this.emit('update.controls');
  5808. }),
  5809. (n.prototype.setCurrentItem = function (e) {
  5810. (this.currentItem = e), this.emit('update.controls');
  5811. }),
  5812. (n.prototype.nextItem = function (currentItem) {
  5813. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5814. if (currentItem == void 0) return this.firstDestination();
  5815. var currentLocation = this.model.heroLocations[currentItem[0]];
  5816. var currentChildNum = currentLocation.heroLocations
  5817. ? currentLocation.heroLocations.length
  5818. : 1;
  5819. var item;
  5820. if (this.currentItem[1] >= currentChildNum - 1) {
  5821. //子目录中最后一个
  5822. item = [currentItem[0] + 1, 0]; //结果可能超出nItems
  5823. } else {
  5824. item = [currentItem[0], currentItem[1] + 1];
  5825. }
  5826. if (item[0] >= this.nItems) {
  5827. item = this.firstDestination();
  5828. }
  5829. return item;
  5830. //暂时不理会endlessLoop,默认为false
  5831. }),
  5832. (n.prototype.prevItem = function (currentItem) {
  5833. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5834. if (currentItem == void 0) return this.firstDestination();
  5835. var item;
  5836. var lastLocation = this.model.heroLocations[currentItem[0] - 1];
  5837. if (!lastLocation)
  5838. return this.finalDestination(); //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5839. else {
  5840. var lastChildNum = lastLocation.heroLocations
  5841. ? lastLocation.heroLocations.length
  5842. : 1;
  5843. if (this.currentItem[1] == 0) {
  5844. //子目录中第一个
  5845. return [currentItem[0] - 1, lastChildNum - 1];
  5846. } else {
  5847. return [currentItem[0], currentItem[1] - 1];
  5848. }
  5849. }
  5850. }),
  5851. (n.prototype.tourAdvance = function (e) {
  5852. //e是1或-1
  5853. A.debug('tourAdvance(' + e + ')');
  5854. // // zeg改
  5855. if (null === this.currentItem || void 0 === this.currentItem) {
  5856. this.setDestinationItem(this.firstDestination())
  5857. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5858. // this.setDestinationItem([this.currentItem[0], 0]);
  5859. }
  5860. // else if(this.currentItem[1] == null) {
  5861. // this.setDestinationItem([this.currentItem[0], 0])
  5862. // }
  5863. else {
  5864. var item;
  5865. if (e == 1) {
  5866. item = this.nextItem(this.currentItem);
  5867. } else if (e == -1) {
  5868. item = this.prevItem(this.currentItem);
  5869. }
  5870. this.setDestinationItem(item);
  5871. }
  5872. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')) {
  5873. this.useSpecialTransition('reverse-looping to end');
  5874. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5875. this.useSpecialTransition('looping back to start');
  5876. }
  5877. /* var momentTour = this.getMomentTour(this.destinationItem);
  5878. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5879. var zoomLevel = this.player.zoomLevel;
  5880. this.player.zoomEnabled = true;
  5881. var zoom = function(e, d) {
  5882. this.player.zoomTo((1-e)*zoomLevel, true)
  5883. }.bind(this)
  5884. s.start(zoom, 1500, function(){
  5885. }, 0, d.easeOutQuad, "zoom")
  5886. } */
  5887. this.goToDestination();
  5888. }),
  5889. (n.prototype.getMomentTour = function (destinationItem) {
  5890. //add
  5891. var wholeMomentTour = window.DATA.momentTour || 'walk'; //最外层 还有一种是'std'
  5892. if (!destinationItem) return wholeMomentTour;
  5893. else {
  5894. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem); //最内层。 如果有使用最内层
  5895. if (currentLocation.momentTour) return currentLocation.momentTour;
  5896. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5897. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5898. }
  5899. }),
  5900. (t.exports = n);
  5901. }.call(this, '/js/director.js'));
  5902. },
  5903. {
  5904. './analytics': 4,
  5905. './enum/BlackoutStyle': 18,
  5906. './enum/ControlEvents': 21,
  5907. './enum/DirectorEvents': 23,
  5908. './enum/ModelManagerEvents': 33,
  5909. './enum/PathDiscardMode': 38,
  5910. './enum/PathDisplayMode': 39,
  5911. './enum/PlayerEvents': 40,
  5912. './enum/Viewmode': 51,
  5913. './enum/WarpStyle': 52,
  5914. './model/ModelManager': 140,
  5915. './player': 155,
  5916. './settings': 166,
  5917. './util/logger': 189,
  5918. './util/transitions': 195,
  5919. events: 202,
  5920. three: 217,
  5921. },
  5922. ],
  5923. 16: [
  5924. function (e, t, i) {
  5925. 'use strict';
  5926. var n = e('three'),
  5927. r = e('./enum/Viewmode'),
  5928. o = (e('./settings'), e('./util/transitions')),
  5929. a = e('./enum/PlayerEvents'),
  5930. s = new n.ShaderPass(n.HorizontalBlurShader),
  5931. l = new n.ShaderPass(n.VerticalBlurShader);
  5932. l.renderToScreen = !0;
  5933. var c = $('#player').width() / $('#player').height();
  5934. isNaN(c) && (c = 1);
  5935. //initTransitionPass(n)
  5936. var h = {
  5937. currentBlur: 0,
  5938. aspect: c,
  5939. blurStrength: 1,
  5940. hblurPass: s,
  5941. vblurPass: l,
  5942. transitionMaskPass: new n.TransitionPass(),
  5943. bindEvents: function (e) {
  5944. e.on(a.ModeChanged, function (e, t) {
  5945. e === r.PANORAMA &&
  5946. (o.cancel(h.blur),
  5947. o.cancel(h.addBlur),
  5948. o.start(h.removeBlur, 500, null, 0, null, 'deblur'));
  5949. });
  5950. },
  5951. blur: function (e) {
  5952. h.currentBlur = e;
  5953. var t = e * h.blurStrength;
  5954. (l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512);
  5955. },
  5956. addBlur: function (e) {
  5957. (e = Math.max(e, h.currentBlur)), h.blur(e);
  5958. },
  5959. removeBlur: function (e) {
  5960. (e = Math.min(1 - e, h.currentBlur)), h.blur(e);
  5961. },
  5962. };
  5963. h.blur(0), (t.exports = h);
  5964. },
  5965. {
  5966. './enum/PlayerEvents': 40,
  5967. './enum/Viewmode': 51,
  5968. './settings': 166,
  5969. './util/transitions': 195,
  5970. three: 217,
  5971. },
  5972. ],
  5973. 17: [
  5974. function (e, t, i) {
  5975. 'use strict';
  5976. t.exports = {
  5977. UNKNOWN: 0,
  5978. ALIGNED: 1,
  5979. UNALIGNED: 2,
  5980. PLACED: 3,
  5981. };
  5982. },
  5983. {},
  5984. ],
  5985. 18: [
  5986. function (e, t, i) {
  5987. 'use strict';
  5988. t.exports = {
  5989. NONE: 0,
  5990. MIDDLE: 1,
  5991. END: 2,
  5992. BEGINNING: 3,
  5993. FADEIN: 4,
  5994. };
  5995. },
  5996. {},
  5997. ],
  5998. 19: [
  5999. function (e, t, i) {
  6000. 'use strict';
  6001. var n = e('three');
  6002. t.exports = {
  6003. newBlue: new n.Color(4967932),
  6004. altBlue: new n.Color(47355),
  6005. tagDefault: new n.Color(223357),
  6006. classicBlue: new n.Color(53759),
  6007. mpYellow: new n.Color(16502016),
  6008. mpOrange: new n.Color(16428055),
  6009. mpBlue: new n.Color(12096),
  6010. mpLtGrey: new n.Color(13751252),
  6011. mpDkGrey: new n.Color(10000019),
  6012. mpRed: new n.Color(12525854),
  6013. mpOrangeDesat: new n.Color(16764529),
  6014. mpBlueDesat: new n.Color(4034734),
  6015. mpRedDesat: new n.Color(14705505),
  6016. white: new n.Color(16777215),
  6017. black: new n.Color(0),
  6018. _desat: function (e, t) {
  6019. var i = t || 0.3,
  6020. r = new n.Color().copy(e).getHSL();
  6021. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l);
  6022. },
  6023. _darken: function (e, t) {
  6024. var i = t || 0.2,
  6025. r = e.getHSL();
  6026. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i));
  6027. },
  6028. };
  6029. },
  6030. {
  6031. three: 217,
  6032. },
  6033. ],
  6034. 20: [
  6035. function (e, t, i) {
  6036. 'use strict';
  6037. t.exports = {
  6038. NONE: -1,
  6039. ROTATE: 0,
  6040. DOLLY: 1,
  6041. PAN: 2,
  6042. ROTATE_DOLLY: 3,
  6043. PAN_DOLLY: 4,
  6044. };
  6045. },
  6046. {},
  6047. ],
  6048. 21: [
  6049. function (e, t, i) {
  6050. 'use strict';
  6051. t.exports = {
  6052. Move: 'move',
  6053. InteractionDirect: 'interaction.direct',
  6054. InteractionKey: 'interaction.key',
  6055. InteractionGui: 'interaction.gui',
  6056. FlyInDirection: 'fly.direction',
  6057. InputStart: 'input.start',
  6058. Pinch: 'input.pinch',
  6059. Scroll: 'input.scroll',
  6060. AutoPanInterrupt: 'autopan.interrupt',
  6061. AutoPanComplete: 'autopan.complete',
  6062. AutoPanClamped: 'autopan.clamped',
  6063. LongTap: 'longtap',
  6064. };
  6065. },
  6066. {},
  6067. ],
  6068. 22: [
  6069. function (e, t, i) {
  6070. 'use strict';
  6071. t.exports = Object.freeze({
  6072. FORWARD: 'FORWARD',
  6073. LEFT: 'LEFT',
  6074. RIGHT: 'RIGHT',
  6075. BACK: 'BACK',
  6076. UP: 'UP',
  6077. DOWN: 'DOWN',
  6078. });
  6079. },
  6080. {},
  6081. ],
  6082. 23: [
  6083. function (e, t, i) {
  6084. 'use strict';
  6085. t.exports = {
  6086. ActionInterrupted: 'action.interrupted',
  6087. TourStart: 'tour.start',
  6088. TourEnd: 'tour.end',
  6089. StartModeChange: 'mode.startChange',
  6090. };
  6091. },
  6092. {},
  6093. ],
  6094. 24: [
  6095. function (e, t, i) {
  6096. 'use strict';
  6097. t.exports = Object.freeze({
  6098. None: 0,
  6099. Queued: 1,
  6100. ForceQueued: 2,
  6101. Downloading: 3,
  6102. Downloaded: 4,
  6103. DownloadFailed: 5,
  6104. });
  6105. },
  6106. {},
  6107. ],
  6108. 25: [
  6109. function (e, t, i) {
  6110. 'use strict';
  6111. t.exports = {
  6112. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  6113. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  6114. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  6115. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  6116. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  6117. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5,
  6118. };
  6119. },
  6120. {},
  6121. ],
  6122. 26: [
  6123. function (e, t, i) {
  6124. 'use strict';
  6125. t.exports = {
  6126. Texture2D: 0,
  6127. TextureCube: 1,
  6128. };
  6129. },
  6130. {},
  6131. ],
  6132. 27: [
  6133. function (e, t, i) {
  6134. 'use strict';
  6135. t.exports = {
  6136. SMALL: 'small',
  6137. LARGE: 'large',
  6138. };
  6139. },
  6140. {},
  6141. ],
  6142. 28: [
  6143. function (e, t, i) {
  6144. 'use strict';
  6145. var n = e('./Viewmode'),
  6146. r = {
  6147. LANDING: {},
  6148. NAVIGATION: 'navigation',
  6149. MORE_HELP: 'moreHelp',
  6150. TOUR_INTERACTION: {},
  6151. };
  6152. (r.LANDING[n.PANORAMA] = 'panorama.landing'),
  6153. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  6154. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  6155. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  6156. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  6157. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  6158. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  6159. (t.exports = r);
  6160. },
  6161. {
  6162. './Viewmode': 51,
  6163. },
  6164. ],
  6165. 29: [
  6166. function (e, t, i) {
  6167. 'use strict';
  6168. var n = {
  6169. UP: 1,
  6170. DOWN: -1,
  6171. LEFT: 'L',
  6172. RIGHT: 'R',
  6173. FORWARD: 'F',
  6174. BACK: 'B',
  6175. reverse: {},
  6176. opposite: function (e) {
  6177. return this.reverse[e.toString()];
  6178. },
  6179. };
  6180. !(function () {
  6181. (n.reverse[n.UP] = n.DOWN),
  6182. (n.reverse[n.DOWN] = n.UP),
  6183. (n.reverse[n.LEFT] = n.RIGHT),
  6184. (n.reverse[n.RIGHT] = n.LEFT),
  6185. (n.reverse[n.FORWARD] = n.BACK),
  6186. (n.reverse[n.BACK] = n.FORWARD);
  6187. })(),
  6188. (t.exports = n);
  6189. },
  6190. {},
  6191. ],
  6192. 30: [
  6193. function (e, t, i) {
  6194. 'use strict';
  6195. var n = e('../util/browser'),
  6196. r = {
  6197. ZERO: 48,
  6198. ONE: 49,
  6199. TWO: 50,
  6200. THREE: 51,
  6201. FOUR: 52,
  6202. FIVE: 53,
  6203. SIX: 54,
  6204. SEVEN: 55,
  6205. EIGHT: 56,
  6206. NINE: 57,
  6207. LEFTARROW: 37,
  6208. UPARROW: 38,
  6209. RIGHTARROW: 39,
  6210. DOWNARROW: 40,
  6211. A: 65,
  6212. B: 66,
  6213. C: 67,
  6214. D: 68,
  6215. E: 69,
  6216. F: 70,
  6217. G: 71,
  6218. H: 72,
  6219. I: 73,
  6220. J: 74,
  6221. K: 75,
  6222. L: 76,
  6223. M: 77,
  6224. N: 78,
  6225. O: 79,
  6226. P: 80,
  6227. Q: 81,
  6228. R: 82,
  6229. S: 83,
  6230. T: 84,
  6231. U: 85,
  6232. V: 86,
  6233. W: 87,
  6234. X: 88,
  6235. Y: 89,
  6236. Z: 90,
  6237. SPACE: 32,
  6238. RETURN: 13,
  6239. SEMICOLON: 186,
  6240. PLUSEQUALS: 187,
  6241. DASHUNDERSCORE: 189,
  6242. OPENBRACKET: 219,
  6243. };
  6244. n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)),
  6245. (t.exports = r);
  6246. },
  6247. {
  6248. '../util/browser': 182,
  6249. },
  6250. ],
  6251. 31: [
  6252. function (e, t, i) {
  6253. 'use strict';
  6254. t.exports = {
  6255. EN_US: 'en-US',
  6256. ES_MX: 'es-MX',
  6257. FR_FR: 'fr-FR',
  6258. DE_DE: 'de-DE',
  6259. RU_RU: 'ru-RU',
  6260. CN_CN: 'cn-CN',
  6261. JP_JP: 'jp-JP',
  6262. };
  6263. },
  6264. {},
  6265. ],
  6266. 32: [
  6267. function (e, t, i) {
  6268. 'use strict';
  6269. t.exports = {
  6270. TagActivated: 'tag.activated',
  6271. TagDismissed: 'tag.dismissed',
  6272. TagNavigation: 'tag.navigation',
  6273. };
  6274. },
  6275. {},
  6276. ],
  6277. 33: [
  6278. function (e, t, i) {
  6279. 'use strict';
  6280. t.exports = {
  6281. ModelAdded: 'model-added',
  6282. ActiveModelChanged: 'active-model-changed',
  6283. };
  6284. },
  6285. {},
  6286. ],
  6287. 34: [
  6288. function (e, t, i) {
  6289. 'use strict';
  6290. t.exports = {
  6291. LEFT: 0,
  6292. MIDDLE: 1,
  6293. RIGHT: 2,
  6294. };
  6295. },
  6296. {},
  6297. ],
  6298. 35: [
  6299. function (e, t, i) {
  6300. 'use strict';
  6301. t.exports = {
  6302. PanoRenderComplete: 'panorama.render.complete',
  6303. TileRenderFailure: 'panorama.tile.render.failed',
  6304. TileRenderSuccess: 'panorama.tile.render.success',
  6305. TileUploadAttempted: 'panorama.tile.upload.attempted',
  6306. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  6307. ZoomLevelRenderStarted: 'panorama.zoom.render.started',
  6308. };
  6309. },
  6310. {},
  6311. ],
  6312. 36: [
  6313. function (e, t, i) {
  6314. 'use strict';
  6315. t.exports = {
  6316. BASE: 1,
  6317. STANDARD: 2,
  6318. HIGH: 3,
  6319. ULTRAHIGH: 4,
  6320. };
  6321. },
  6322. {},
  6323. ],
  6324. 37: [
  6325. function (e, t, i) {
  6326. 'use strict';
  6327. t.exports = {
  6328. LoadComplete: 'panorama.load.complete',
  6329. LoadFailed: 'panorama.load.failed',
  6330. TileLoaded: 'panorama.tile.loaded',
  6331. };
  6332. },
  6333. {},
  6334. ],
  6335. 38: [
  6336. function (e, t, i) {
  6337. 'use strict';
  6338. t.exports = Object.freeze({
  6339. Standard: 0,
  6340. Slow: 1,
  6341. Retain: 2,
  6342. });
  6343. },
  6344. {},
  6345. ],
  6346. 39: [
  6347. function (e, t, i) {
  6348. 'use strict';
  6349. t.exports = Object.freeze({
  6350. Show: 0,
  6351. Hide: 1,
  6352. Retain: 2,
  6353. });
  6354. },
  6355. {},
  6356. ],
  6357. 40: [
  6358. function (e, t, i) {
  6359. 'use strict';
  6360. t.exports = {
  6361. Move: 'move',
  6362. MoveComplete: 'move.complete',
  6363. ModeChanged: 'mode.changed',
  6364. ModeChanging: 'mode.changing',
  6365. PanoChosen: 'pano.chosen',
  6366. ClosestPanoChanging: 'closest.pano.changing',
  6367. WarpStarted: 'warp.started',
  6368. WarpInterrupted: 'warp.interrupted',
  6369. WarpEnded: 'warp.ended',
  6370. FlyinFinished: 'flyin.finished',
  6371. FlyingStarted: 'flying.started',
  6372. FlyingInterrupted: 'flying.interrupted',
  6373. FlyingEnded: 'flying.ended',
  6374. Ready: 'ready',
  6375. StartInside: 'start.inside',
  6376. StartOutside: 'start.outside',
  6377. ViewChanged: 'view.changed',
  6378. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  6379. InputStart: 'input.start',
  6380. };
  6381. },
  6382. {},
  6383. ],
  6384. 41: [
  6385. function (e, t, i) {
  6386. 'use strict';
  6387. t.exports = Object.freeze({
  6388. DEFAULT: 0,
  6389. PANOMARKERS: 1,
  6390. RETICULE: 2,
  6391. TAG: 3,
  6392. });
  6393. },
  6394. {},
  6395. ],
  6396. 42: [
  6397. function (e, t, i) {
  6398. 'use strict';
  6399. t.exports = {
  6400. visibleFloor: 1,
  6401. ghostFloor: 3,
  6402. boundingSkybox: 1,
  6403. panoMarker: 2,
  6404. reticule: 3,
  6405. tagStem: 4,
  6406. tagDisc: 5,
  6407. ribbon: 100,
  6408. };
  6409. },
  6410. {},
  6411. ],
  6412. 43: [
  6413. function (e, t, i) {
  6414. 'use strict';
  6415. t.exports = {
  6416. ContextCreated: 'scene-renderer-context-created',
  6417. AfterRender: 'after-render',
  6418. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated',
  6419. };
  6420. },
  6421. {},
  6422. ],
  6423. 44: [
  6424. function (e, t, i) {
  6425. 'use strict';
  6426. t.exports = {
  6427. IDLE: 'idle',
  6428. BROWSE: 'browse',
  6429. EXAMINE: 'examine',
  6430. };
  6431. },
  6432. {},
  6433. ],
  6434. 45: [
  6435. function (e, t, i) {
  6436. 'use strict';
  6437. t.exports = {
  6438. TileDownloadSuccess: 'tiledownloader.download.success',
  6439. TileDownloadFailure: 'tiledownloader.download.failure',
  6440. PanoDownloadComplete: 'tiledownloader.pano.download.complete',
  6441. };
  6442. },
  6443. {},
  6444. ],
  6445. 46: [
  6446. function (e, t, i) {
  6447. 'use strict';
  6448. t.exports = {
  6449. CardboardAndroid: 'googlevr',
  6450. GearVR: 'gearvr',
  6451. CardboardIOS: 'googlevrios',
  6452. Cardboard: 'googlevr',
  6453. };
  6454. },
  6455. {},
  6456. ],
  6457. 47: [
  6458. function (e, t, i) {
  6459. 'use strict';
  6460. t.exports = {
  6461. NONE: 0,
  6462. CONTEXTUAL: 1,
  6463. ANDROID: 2,
  6464. };
  6465. },
  6466. {},
  6467. ],
  6468. 48: [
  6469. function (e, t, i) {
  6470. 'use strict';
  6471. var n = {
  6472. Title: 0,
  6473. Cardboard: 1,
  6474. },
  6475. r = {
  6476. Title: 0,
  6477. Cardboard: 1,
  6478. Gear: 2,
  6479. };
  6480. !(function () {
  6481. [n, r].forEach(function (e) {
  6482. e.pageCount = Object.keys(e).length;
  6483. });
  6484. })(),
  6485. (t.exports.ios = n),
  6486. (t.exports.standard = r);
  6487. },
  6488. {},
  6489. ],
  6490. 49: [
  6491. function (e, t, i) {
  6492. 'use strict';
  6493. t.exports = {
  6494. Android: 'android',
  6495. IOS: 'ios',
  6496. Desktop: 'desktop',
  6497. UnsupportedAndroid: 'android-unsupported',
  6498. };
  6499. },
  6500. {},
  6501. ],
  6502. 50: [
  6503. function (e, t, i) {
  6504. 'use strict';
  6505. var n = e('three');
  6506. t.exports = {
  6507. UP: new n.Vector3(0, 1, 0),
  6508. DOWN: new n.Vector3(0, -1, 0),
  6509. LEFT: new n.Vector3(-1, 0, 0),
  6510. RIGHT: new n.Vector3(1, 0, 0),
  6511. FORWARD: new n.Vector3(0, 0, -1),
  6512. BACK: new n.Vector3(0, 0, 1),
  6513. };
  6514. },
  6515. {
  6516. three: 217,
  6517. },
  6518. ],
  6519. 51: [
  6520. function (e, t, i) {
  6521. 'use strict';
  6522. var n = e('../exception/ViewmodeConvertException'),
  6523. r = e('./coreViewmodes'),
  6524. o = e('../util/common'),
  6525. a = {
  6526. MESH: 'mesh',
  6527. OUTDOOR: 'outdoor',
  6528. TRANSITIONING: 'transitioning',
  6529. toInt: function (e) {
  6530. switch (e) {
  6531. case this.PANORAMA:
  6532. return 1;
  6533. case this.DOLLHOUSE:
  6534. return 2;
  6535. case this.FLOORPLAN:
  6536. return 3;
  6537. case this.OUTDOOR:
  6538. return 4;
  6539. case this.TRANSITIONING:
  6540. return -1;
  6541. }
  6542. throw new n('No known conversion for Viewmode to int for mode: ' + e);
  6543. },
  6544. fromInt: function (e) {
  6545. switch (e) {
  6546. case '1':
  6547. case 1:
  6548. return this.PANORAMA;
  6549. case '2':
  6550. case 2:
  6551. return this.DOLLHOUSE;
  6552. case '3':
  6553. case 3:
  6554. return this.FLOORPLAN;
  6555. case '4':
  6556. case 4:
  6557. return this.OUTDOOR;
  6558. }
  6559. throw new n('No known conversion for int to viewmode for int: ' + e);
  6560. },
  6561. convertWorkshopModeInt: function (e) {
  6562. switch (e) {
  6563. case '0':
  6564. case 0:
  6565. case undefined: //xzw add
  6566. return this.PANORAMA;
  6567. case '1':
  6568. case 1:
  6569. return this.FLOORPLAN;
  6570. case '2':
  6571. case 2:
  6572. return this.DOLLHOUSE;
  6573. case '3':
  6574. case 3:
  6575. return this.MESH;
  6576. }
  6577. throw new n('No known conversion for Workshop int to viewmode for int: ' + e);
  6578. },
  6579. };
  6580. o.extendObject(a, r), (t.exports = a);
  6581. },
  6582. {
  6583. '../exception/ViewmodeConvertException': 58,
  6584. '../util/common': 185,
  6585. './coreViewmodes': 54,
  6586. },
  6587. ],
  6588. 52: [
  6589. function (e, t, i) {
  6590. 'use strict';
  6591. t.exports = {
  6592. BLACK: 'black',
  6593. STD: 'std',
  6594. WALK: 'walk',
  6595. };
  6596. },
  6597. {},
  6598. ],
  6599. 53: [
  6600. function (e, t, i) {
  6601. 'use strict';
  6602. t.exports = {
  6603. ZoomIn: 'zoom.in',
  6604. ZoomOut: 'zoom.out',
  6605. ZoomMax: 'zoom.max',
  6606. ZoomMin: 'zoom.min',
  6607. };
  6608. },
  6609. {},
  6610. ],
  6611. 54: [
  6612. function (e, t, i) {
  6613. 'use strict';
  6614. t.exports = {
  6615. PANORAMA: 'panorama',
  6616. DOLLHOUSE: 'dollhouse',
  6617. FLOORPLAN: 'floorplan',
  6618. };
  6619. },
  6620. {},
  6621. ],
  6622. 55: [
  6623. function (e, t, i) {
  6624. 'use strict';
  6625. function n(e) {
  6626. this.message = e;
  6627. }
  6628. t.exports = n;
  6629. },
  6630. {},
  6631. ],
  6632. 56: [
  6633. function (e, t, i) {
  6634. 'use strict';
  6635. function n(e) {
  6636. r.call(this, e);
  6637. }
  6638. var r = e('./BasicException');
  6639. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  6640. },
  6641. {
  6642. './BasicException': 55,
  6643. },
  6644. ],
  6645. 57: [
  6646. function (e, t, i) {
  6647. 'use strict';
  6648. function n(e) {
  6649. r.call(this, e);
  6650. }
  6651. var r = e('./BasicException');
  6652. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  6653. },
  6654. {
  6655. './BasicException': 55,
  6656. },
  6657. ],
  6658. 58: [
  6659. function (e, t, i) {
  6660. 'use strict';
  6661. function n(e) {
  6662. r.call(this, e);
  6663. }
  6664. var r = e('./BasicException');
  6665. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  6666. },
  6667. {
  6668. './BasicException': 55,
  6669. },
  6670. ],
  6671. 59: [
  6672. function (e, t, i) {
  6673. (function (i) {
  6674. 'use strict';
  6675. function n(e) {
  6676. var t = {};
  6677. if (e) {
  6678. var i = e.flags;
  6679. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0);
  6680. return t;
  6681. }
  6682. return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null;
  6683. }
  6684. var r = e('./util/ajax'),
  6685. o = e('./util/showcase'),
  6686. a = e('./util/logger'),
  6687. s = '',
  6688. l = new a(i),
  6689. c = {};
  6690. t.exports = {
  6691. loadFeatureFlags: function (e) {
  6692. var t = $.Deferred();
  6693. return (
  6694. r
  6695. .get(e.urlBase + s, {
  6696. responseType: 'json',
  6697. prefetchFrom: 'user',
  6698. auth: o.getAuthorizationHeader(),
  6699. })
  6700. .done(function (e) {
  6701. (c = n(e)), c ? t.resolve(c) : t.reject('loading-failed');
  6702. })
  6703. .fail(function () {
  6704. l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed');
  6705. }),
  6706. t.promise()
  6707. );
  6708. },
  6709. getFlags: function () {
  6710. return c;
  6711. },
  6712. updateDependentSettings: function (e, t) {
  6713. (e = e || c),
  6714. e.labels && (t.labels.enabled = !0),
  6715. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6716. e.showcase_sdk && (t.sdkInit = !0),
  6717. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6718. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6719. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6720. e.hide_sc_sharing && (t.share.enabled = !1);
  6721. },
  6722. };
  6723. }.call(this, '/js/featureflags.js'));
  6724. },
  6725. {
  6726. './util/ajax': 181,
  6727. './util/logger': 189,
  6728. './util/showcase': 193,
  6729. },
  6730. ],
  6731. 60: [
  6732. function (e, t, i) {
  6733. 'use strict';
  6734. var n =
  6735. (e('../util/common'),
  6736. {
  6737. status: 0,
  6738. set: function (e) {
  6739. if (isNaN(e)) return !1;
  6740. var t = $('.progressbar');
  6741. 0 > e && (e = 0);
  6742. e > 100 && (e = 100);
  6743. var width = parseInt(t.css('width').replace('px', '')) / 100; //获取进度条总长度除以100
  6744. var barperc = e * width;
  6745. var perc = Math.round(e);
  6746. var labelpos = parseInt(barperc) - 15;
  6747. t.find('.bar').css('width', barperc); //已经再跑颜色的百分比
  6748. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  6749. t.find('.perc').text(perc + '%'); //具体数字的百分比
  6750. this.status = e;
  6751. },
  6752. done: function (e) {
  6753. return e || this.status ? ((this.status = null), this.set(100)) : this;
  6754. },
  6755. });
  6756. t.exports.circleLoader = n;
  6757. },
  6758. {
  6759. '../util/common': 185,
  6760. },
  6761. ],
  6762. 61: [
  6763. function (e, t, i) {
  6764. 'use strict';
  6765. t.exports = Object.freeze({
  6766. CLOSE: 'modal.closer.close',
  6767. });
  6768. },
  6769. {},
  6770. ],
  6771. 62: [
  6772. function (e, t, i) {
  6773. 'use strict';
  6774. function n(e, t) {
  6775. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset();
  6776. }
  6777. function r(e, t) {
  6778. function i() {
  6779. var t =
  6780. e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width();
  6781. t !== f &&
  6782. ((f = t),
  6783. t
  6784. ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter'))
  6785. : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')));
  6786. }
  6787. t ? setTimeout(i, o.guiAnimationSpeed) : i();
  6788. }
  6789. var o = e('../../settings'),
  6790. a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  6791. s = e('../../util/common'),
  6792. l = e('./ModalCloserEvent'),
  6793. c = e('events').EventEmitter,
  6794. h = document.getElementsByClassName('footer')[0],
  6795. u = h.querySelectorAll('.close')[0],
  6796. d = null,
  6797. p = null,
  6798. f = null,
  6799. g =
  6800. (a.isMobile(),
  6801. {
  6802. open: function (e) {
  6803. e &&
  6804. (r(e),
  6805. d && u.removeEventListener('click', d, !0),
  6806. (d = n.bind(this, e.id)),
  6807. u.addEventListener('click', d, !0),
  6808. p && window.removeEventListener('resize', p, !0),
  6809. (p = r.bind(this, e)),
  6810. window.addEventListener('resize', p, !0));
  6811. },
  6812. reset: function () {
  6813. h.classList.remove('closeByFooter'),
  6814. u.removeEventListener('click', d, !0),
  6815. window.removeEventListener('resize', p, !0),
  6816. (d = p = f = null);
  6817. },
  6818. });
  6819. s.extendObject(g, c.prototype), (t.exports = g);
  6820. },
  6821. {
  6822. '../../tag/Media/MediaEvent': 131,
  6823. '../../settings': 166,
  6824. '../../util/browser': 182,
  6825. '../../util/common': 185,
  6826. './ModalCloserEvent': 61,
  6827. events: 202,
  6828. },
  6829. ],
  6830. 63: [
  6831. function (e, t, i) {
  6832. 'use strict';
  6833. function n(e, t, i) {
  6834. var n = new r.GUI({
  6835. width: 400,
  6836. }),
  6837. u = n.addFolder('Flydown from Dollhouse');
  6838. u.add(h.flydown, 'movementEasing', Object.keys(a)),
  6839. u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
  6840. u.add(h.flydown, 'rotationEasing', Object.keys(a)),
  6841. u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
  6842. u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  6843. u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
  6844. u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
  6845. u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170));
  6846. var d = n.addFolder('Transition between panos');
  6847. d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
  6848. d
  6849. .add(h.transition, 'flySpeed', 0, 10)
  6850. .step(0.01)
  6851. .onFinishChange(function () {
  6852. (h.transition.flyTime = 0),
  6853. d.__controllers.forEach(function (e) {
  6854. e.updateDisplay();
  6855. });
  6856. }),
  6857. d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  6858. (h.transition.flySpeed = 0),
  6859. d.__controllers.forEach(function (e) {
  6860. e.updateDisplay();
  6861. });
  6862. }),
  6863. d.add(h.transition, 'aimTime', 500, 2500).step(50),
  6864. d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
  6865. d.add(h.transition, 'movementEasing', Object.keys(a));
  6866. var p = n.addFolder('Path Display');
  6867. p
  6868. .add(h.path, 'opacity', 0, 1)
  6869. .step(0.01)
  6870. .onFinishChange(function () {}),
  6871. p
  6872. .add(h.path, 'height', 0, 0.2)
  6873. .step(0.01)
  6874. .onFinishChange(function () {}),
  6875. p
  6876. .add(h.path, 'outsideHeight', 0, 2)
  6877. .step(0.01)
  6878. .onFinishChange(function () {}),
  6879. p
  6880. .add(h.path, 'ribbonWidth', 0.01, 0.35)
  6881. .step(0.01)
  6882. .onFinishChange(function () {}),
  6883. p
  6884. .add(h.path, 'waypointRadius', 0.01, 1.2)
  6885. .step(0.01)
  6886. .onFinishChange(function () {}),
  6887. p
  6888. .add(h.path, 'waypointPulse', 0, 3600)
  6889. .step(20)
  6890. .onFinishChange(function () {}),
  6891. p
  6892. .add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
  6893. .step(0.01)
  6894. .onFinishChange(function () {}),
  6895. p
  6896. .add(h.path, 'fadeInTime', 0, 1200)
  6897. .step(10)
  6898. .onFinishChange(function () {}),
  6899. p
  6900. .add(h.path, 'fadeOutTime', 0, 1200)
  6901. .step(10)
  6902. .onFinishChange(function () {}),
  6903. p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
  6904. (h.path.color = l[h.path.color]),
  6905. (h.path.colorUp = l._desat(h.path.color)),
  6906. (h.path.colorDown = l.darken(h.path.color));
  6907. }),
  6908. p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
  6909. h.reticuleColor = l[h.reticuleColor];
  6910. });
  6911. var f = n.addFolder('Warping'),
  6912. g = f.addFolder('Warp/Teleport');
  6913. g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6914. g
  6915. .add(h.warp, 'softPushEnd', 0, 1)
  6916. .step(0.01)
  6917. .onFinishChange(function () {}),
  6918. g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6919. g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6920. g
  6921. .add(h.warp, 'softBendEnd', 0, 1)
  6922. .step(0.01)
  6923. .onFinishChange(function () {}),
  6924. g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6925. g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6926. g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6927. g
  6928. .add(h.warp, 'minBrakeAngle', 0, 5)
  6929. .step(0.01)
  6930. .onFinishChange(function () {}),
  6931. g
  6932. .add(h.warp, 'maxBrakeAngle', 0, 5)
  6933. .step(0.01)
  6934. .onFinishChange(function () {}),
  6935. g.add(h.path, 'mapGuides').onFinishChange(function () {}),
  6936. g
  6937. .add(h.warp, 'teleportTime', 0, 5e3)
  6938. .step(10)
  6939. .onFinishChange(function () {}),
  6940. g
  6941. .add(h.warp, 'outsideTime', 0, 5e3)
  6942. .step(10)
  6943. .onFinishChange(function () {}),
  6944. g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
  6945. h.path.typ = c[h.path.typ];
  6946. }),
  6947. g
  6948. .add(h.warp, 'loop')
  6949. .onChange(function () {})
  6950. .onFinishChange(function () {
  6951. t.endlessLoop = h.warp.loop;
  6952. }),
  6953. g
  6954. .add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6955. .step(1)
  6956. .onFinishChange(function () {}),
  6957. g
  6958. .add(h.warp, 'walkExtraPanosDistance', 0, 3)
  6959. .step(0.1)
  6960. .onFinishChange(function () {}),
  6961. g
  6962. .add(h.transition, 'fastForwardFactor', 1, 10)
  6963. .step(1)
  6964. .onFinishChange(function () {});
  6965. var m = f.addFolder('Long Warp Only');
  6966. m
  6967. .add(h.warp, 'minWarpTime', 0, 5e3)
  6968. .step(10)
  6969. .onFinishChange(function () {
  6970. (h.warp.flySpeed = 0),
  6971. m.__controllers.forEach(function (e) {
  6972. e.updateDisplay();
  6973. });
  6974. }),
  6975. m
  6976. .add(h.warp, 'timePerMeter', 0, 5e3)
  6977. .step(10)
  6978. .onFinishChange(function () {}),
  6979. m
  6980. .add(h.warp, 'lookAheadMax', 0.01, 1)
  6981. .step(0.01)
  6982. .onFinishChange(function () {}),
  6983. m
  6984. .add(h.warp, 'lookAheadDist', 0.01, 4)
  6985. .step(0.01)
  6986. .onFinishChange(function () {}),
  6987. m
  6988. .add(h.warp, 'maxTurnPerSec', 0, 720)
  6989. .step(1)
  6990. .onFinishChange(function () {}),
  6991. m
  6992. .add(h.warp, 'maxAimPerSec', 0, 720)
  6993. .step(1)
  6994. .onFinishChange(function () {}),
  6995. m
  6996. .add(h.warp, 'turnFriction', 0, 1)
  6997. .step(0.01)
  6998. .onFinishChange(function () {}),
  6999. m
  7000. .add(h.warp, 'walkDelay', 0, 2e3)
  7001. .step(10)
  7002. .onFinishChange(function () {}),
  7003. m
  7004. .add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  7005. .step(10)
  7006. .onFinishChange(function () {}),
  7007. m
  7008. .add(h.warp, 'walkMaxDist', 0, 100)
  7009. .step(1)
  7010. .onFinishChange(function () {});
  7011. var v = n.addFolder('Warp Esoterica');
  7012. v
  7013. .add(h.warp, 'nearPanoDist', 0.01, 12)
  7014. .step(0)
  7015. .onFinishChange(function () {}),
  7016. v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  7017. v
  7018. .add(h.warp, 'flySpeed', 0, 10)
  7019. .step(0.01)
  7020. .onFinishChange(function () {
  7021. (h.warp.minWarpTime = 0),
  7022. v.__controllers.forEach(function (e) {
  7023. e.updateDisplay();
  7024. });
  7025. }),
  7026. v.add(h.warp, 'showBunny').onFinishChange(function () {}),
  7027. v
  7028. .add(h.warp, 'fastTime', 0, 2500)
  7029. .step(10)
  7030. .onFinishChange(function () {}),
  7031. v.add(h.warp, 'movementEasing', Object.keys(a));
  7032. var A = n.addFolder('Misc');
  7033. A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
  7034. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV;
  7035. }),
  7036. A.add(h, 'insideFOV', 10, 180).onChange(function () {
  7037. i.cameras[s.PANORAMA].fov = h.insideFOV;
  7038. }),
  7039. A.add(h, 'insideLookSpeed', 0.01, 0.3)
  7040. .step(0.01)
  7041. .onChange(function () {}),
  7042. A.add(h, 'rotationAccelerationInside', 0.1, 10)
  7043. .step(0.1)
  7044. .onChange(function () {}),
  7045. A.add(h, 'rotationAccelerationOutside', 0.1, 10)
  7046. .step(0.1)
  7047. .onChange(function () {});
  7048. var y = n.addFolder('Navigation');
  7049. y.add(h.navigation, 'panoScores').onFinishChange(function () {
  7050. h.navigation.panoScores ||
  7051. e.panos.forEach(function (e) {
  7052. e.floor.remove(e.text3d), (e.text3d = null);
  7053. });
  7054. }),
  7055. y.add(h.navigation, 'mouseDirection'),
  7056. y.add(h.navigation, 'filterStrictness', 0, 1),
  7057. y.add(h.navigation, 'angleFactor', -60, 0),
  7058. y.add(h.navigation, 'directionFactor', 1, 20),
  7059. y.add(h.navigation, 'distanceFactor', -5, 5),
  7060. y.add(h.navigation, 'optionalityFactor', 0.1, 10);
  7061. var C = n.addFolder('tags'),
  7062. I = C.addFolder('Tag Creation');
  7063. I.add(h.tags.pole, 'enabled').name('poleEnabled'),
  7064. I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  7065. I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  7066. I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity');
  7067. var E = C.addFolder('Visibility');
  7068. E.add(h.tags.visibility, 'anyDistance'),
  7069. E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  7070. E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  7071. E.add(h.tags.visibility, 'hideViaFloor'),
  7072. E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  7073. E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject');
  7074. var b = C.addFolder('Disc Parameters');
  7075. b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  7076. b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  7077. b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  7078. e &&
  7079. (h.tags.disc.scale.farBound =
  7080. h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100));
  7081. }),
  7082. b
  7083. .add(h.tags.disc.scale, 'linkPercent', 0, 100)
  7084. .step(1)
  7085. .onChange(function (e) {
  7086. h.tags.disc.scale.linkFarBound &&
  7087. (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100));
  7088. }),
  7089. b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
  7090. b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
  7091. b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1);
  7092. var w = C.addFolder('Navigate');
  7093. w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
  7094. w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
  7095. w.add(h.tags.navigate, 'reactivate').name('reactivate'),
  7096. w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  7097. w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  7098. w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1);
  7099. var _ = n.addFolder('Debug');
  7100. _.add(h, 'wireframe').onFinishChange(function () {
  7101. e.chunks.forEach(function (t) {
  7102. t.material &&
  7103. (t.wireframeTwin ||
  7104. ((t.wireframeTwin = new o.WireframeHelper(t)),
  7105. (t.wireframeTwin.material.depthWrite = !1),
  7106. (t.wireframeTwin.material.depthTest = !1),
  7107. (t.wireframeTwin.material.opacity = 0.5),
  7108. (t.wireframeTwin.material.transparent = !0)),
  7109. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin));
  7110. });
  7111. }),
  7112. _.add(h, 'skyboxWireframe').onFinishChange(function () {
  7113. h.skyboxWireframe
  7114. ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)),
  7115. e.add(e.skybox.wireframe))
  7116. : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null));
  7117. }),
  7118. _.add(h, 'showSweeps').onFinishChange(function () {
  7119. e.setSweepVisibility(h.showSweeps);
  7120. }),
  7121. _.add(h, 'showMesh').onFinishChange(function () {
  7122. e.chunks.forEach(function (e) {
  7123. e.visible = h.showMesh;
  7124. });
  7125. }),
  7126. _.add(h, 'showFloors').onFinishChange(function () {
  7127. e.floors.forEach(function (e) {
  7128. e.collider.children.forEach(function (e) {
  7129. e.material.visible = h.showFloors;
  7130. });
  7131. });
  7132. }),
  7133. _.add(h, 'showSkyboxes').onFinishChange(function () {
  7134. e.panos.forEach(function (e) {
  7135. e.skyboxMesh.visible = h.showSkyboxes;
  7136. });
  7137. }),
  7138. _.add(h, 'showNeighbors').onChange(function () {}),
  7139. _.add(e, 'alpha', 0, 1);
  7140. }
  7141. var r = e('../lib/dat.gui'),
  7142. o = e('three'),
  7143. a = e('../util/easing'),
  7144. s = e('../enum/Viewmode'),
  7145. l = e('../enum/Colors'),
  7146. c = e('../enum/WarpStyle'),
  7147. h = e('../settings');
  7148. e('../tag/tag');
  7149. (r.GUI.prototype.removeFolder = function (e) {
  7150. var t = this.__folders[e];
  7151. t &&
  7152. (t.close(),
  7153. this.__ul.removeChild(t.domElement.parentNode),
  7154. delete this.__folders[e],
  7155. this.onResize());
  7156. }),
  7157. (t.exports.toggle = n);
  7158. },
  7159. {
  7160. '../enum/Colors': 19,
  7161. '../enum/Viewmode': 51,
  7162. '../enum/WarpStyle': 52,
  7163. '../lib/dat.gui': 93,
  7164. '../tag/tag': 123,
  7165. '../settings': 166,
  7166. '../util/easing': 186,
  7167. three: 217,
  7168. },
  7169. ],
  7170. 64: [
  7171. function (e, t, i) {
  7172. (function (i) {
  7173. 'use strict';
  7174. function n(e, t, i, n) {
  7175. $('.gui-error .error-problem-text').text(e),
  7176. $('.gui-error .error-solution-text').text(t),
  7177. $('.gui-error .error-explanation').text(i),
  7178. $('.gui-error .error-actions').html(n),
  7179. $(window).resize(),
  7180. $('.gui-error').fadeIn(),
  7181. $('#bottom-logo').fadeIn();
  7182. }
  7183. function r(e) {
  7184. var t = [
  7185. '<div class="browser-tiles">',
  7186. '<div class="tile">',
  7187. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  7188. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  7189. 'rel="tiletip" title="Chrome"></a>',
  7190. '</div>',
  7191. '<div class="tile">',
  7192. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  7193. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  7194. 'rel="tiletip" title="Firefox"></a>',
  7195. '</div>',
  7196. '<div class="tile">',
  7197. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  7198. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  7199. 'rel="tiletip" title="Internet Explorer"></a>',
  7200. '</div>',
  7201. '<div class="tile">',
  7202. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  7203. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  7204. 'rel="tiletip" title="Safari"></a>',
  7205. '</div>',
  7206. '</div>',
  7207. ].join('');
  7208. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  7209. s.isMobile() ||
  7210. $('[rel=tiletip]').tooltip({
  7211. placement: 'bottom',
  7212. delay: {
  7213. show: 50,
  7214. hide: 0,
  7215. },
  7216. trigger: 'hover',
  7217. viewport: {
  7218. selector: 'body',
  7219. padding: 10,
  7220. },
  7221. });
  7222. }
  7223. function o() {
  7224. var e = s.isMobile()
  7225. ? ''
  7226. : '<span class="link install-browser">' +
  7227. h.ERROR_GENERIC_ACTIONS_2 +
  7228. '</span>' +
  7229. h.ERROR_GENERIC_ACTIONS_3,
  7230. t = [h.ERROR_GENERIC_ACTIONS_1, e].join('');
  7231. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
  7232. s.isMobile() ||
  7233. $('.install-browser').on('click touchstart', function (e) {
  7234. e.preventDefault(), e.stopPropagation(), r(' ');
  7235. });
  7236. }
  7237. function a(e) {
  7238. if (
  7239. ($('head title').text(c.pageTitle),
  7240. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  7241. $('#gui-loading').fadeOut(250),
  7242. $('#quick-blackout').hide(),
  7243. l.track('showcase_error', {
  7244. error_key: e,
  7245. }),
  7246. h.locale || h.init(),
  7247. 'webgl-unsupported' === e)
  7248. )
  7249. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  7250. else if ('webgl-ios' === e)
  7251. n(
  7252. h.ERROR_WEBGL_IOS_PROBLEM,
  7253. h.ERROR_WEBGL_IOS_SOLUTION,
  7254. '',
  7255. h.ERROR_WEBGL_IOS_ACTIONS_1 +
  7256. '<strong>' +
  7257. h.ERROR_WEBGL_IOS_ACTIONS_2 +
  7258. '</strong>.'
  7259. );
  7260. else if ('webgl-safari' === e)
  7261. n(
  7262. h.ERROR_WEBGL_SAFARI_PROBLEM,
  7263. '',
  7264. '',
  7265. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  7266. '<strong>' +
  7267. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  7268. '</strong>. ' +
  7269. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  7270. '<strong>' +
  7271. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  7272. '</strong>.'
  7273. );
  7274. else if ('webgl-generic' === e) o();
  7275. else if ('missing-urls' === e)
  7276. n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION);
  7277. else if ('loading-failed' === e)
  7278. n(
  7279. h.ERROR_LOADING_FAILED_PROBLEM,
  7280. '',
  7281. '',
  7282. h.ERROR_LOADING_FAILED_ACTIONS_1 +
  7283. '<a class="link" target="_blank" href=' +
  7284. p +
  7285. '>' +
  7286. h.ERROR_LOADING_FAILED_ACTIONS_2 +
  7287. '</a>.'
  7288. );
  7289. else {
  7290. if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e);
  7291. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION);
  7292. }
  7293. }
  7294. var s = e('./../util/browser'),
  7295. l = e('./../analytics'),
  7296. c = e('./../settings'),
  7297. h = e('../localization/localize'),
  7298. u = e('./../util/logger'),
  7299. d = new u(i),
  7300. p = '"https://support.port.com/hc/articles/208220058"';
  7301. t.exports.error = a;
  7302. }.call(this, '/js/gui/error.js'));
  7303. },
  7304. {
  7305. '../localization/localize': 108,
  7306. './../analytics': 4,
  7307. './../settings': 166,
  7308. './../util/browser': 182,
  7309. './../util/logger': 189,
  7310. },
  7311. ],
  7312. 65: [
  7313. function (e, t, i) {
  7314. (function (i) {
  7315. 'use strict';
  7316. function n() {
  7317. (Ue = []),
  7318. je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'),
  7319. Ue.push('.hideTarget', '.pinTop.right');
  7320. }
  7321. function r() {
  7322. for (var e in je)
  7323. if (je.hasOwnProperty(e)) {
  7324. var t = je[e];
  7325. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide();
  7326. }
  7327. je.highlight.visible && $('.pinBottom').addClass('highlightExists'),
  7328. je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'),
  7329. n();
  7330. }
  7331. function o(e, t) {
  7332. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  7333. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i);
  7334. }
  7335. function a() {
  7336. c(),
  7337. $('.pinBottom').toggleClass('open'),
  7338. $('#drawer').toggleClass('open'),
  7339. $('.footer').toggleClass('open'),
  7340. $('#drawer').hasClass('open')
  7341. ? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS),
  7342. Ze('highlights'))
  7343. : ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS),
  7344. ie.resetDrawer()),
  7345. setTimeout(
  7346. function () {
  7347. $('#pullTab').toggleClass('opened');
  7348. },
  7349. $('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
  7350. ),
  7351. $('.pinBottom').hasClass('open') &&
  7352. s($('.vr-popup')) &&
  7353. $('.vr-popup').is(':visible') &&
  7354. Ae.dismiss();
  7355. }
  7356. function s(e) {
  7357. var t;
  7358. 'none' !== e.css('display')
  7359. ? (t = e.position().top + e.outerHeight())
  7360. : (e.attr('style', 'visibility: hidden'),
  7361. (t = e.position().top + e.outerHeight()),
  7362. e.attr('style', 'display: none'));
  7363. var i = $('#player').outerHeight(),
  7364. n = i - 130;
  7365. return n < t + 25;
  7366. }
  7367. function l(e) {
  7368. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation();
  7369. }
  7370. function c() {
  7371. W && (W.reload(), W.init());
  7372. }
  7373. function h(e) {
  7374. ne.show(e), r();
  7375. }
  7376. function u(e) {
  7377. ne.progress(e);
  7378. }
  7379. function d(e, t, i) {
  7380. var n = t.player;
  7381. $('#gui-thumb').fadeOut(2500),
  7382. ne.hide(function () {
  7383. Ge = !1;
  7384. }),
  7385. me.init(e, i),
  7386. de.finishSetup(Object.keys(e.tags).length),
  7387. i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'));
  7388. var s = function () {
  7389. i.dismissExaminedTag(), i.disableHovering();
  7390. };
  7391. Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s);
  7392. var l = i.enableHovering.bind(i);
  7393. if (
  7394. (Ae.on(ye.CLOSED, l),
  7395. Ce.on(Me.CLOSED, l),
  7396. he.on(ue.CLOSED, l),
  7397. fe.on(ge.CLOSED, l),
  7398. Q.labels.enabled && Object.keys(e.labels).length,
  7399. e.floors.length <= 1 || !je.floors.visible
  7400. ? (je.floors.visible = !1)
  7401. : (y(e, t), C(e.currentFloor, n.mode)),
  7402. getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
  7403. r(),
  7404. o(t, t.player),
  7405. $('#gui').fadeIn(1500),
  7406. je.highlight.visible &&
  7407. (2 !== Q.startHighlights || e.has360Views) &&
  7408. setTimeout(function () {
  7409. a(),
  7410. ((!e.has360Views && 1 !== Q.startHighlights) ||
  7411. (e.has360Views && 0 === Q.startHighlights)) &&
  7412. setTimeout(a, 2e3);
  7413. }, 2e3),
  7414. !K.isMobile())
  7415. )
  7416. for (
  7417. var c = [
  7418. 'a',
  7419. '#title-toggle',
  7420. '.next-button',
  7421. '.prev-button',
  7422. '.gui-floor',
  7423. '.meta-toggle',
  7424. '.thumbImg',
  7425. 'logo-button',
  7426. ],
  7427. h = 0;
  7428. h < c.length;
  7429. h++
  7430. )
  7431. $(c[h]).addClass('hasHover');
  7432. O(e), de.setupToggling();
  7433. //xzw:
  7434. window.editHotPanel && editHotPanel();
  7435. //czj
  7436. navBorderRadius(e);
  7437. //czj 编辑界面
  7438. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  7439. window.EditTools && new EditTools(n.sceneRenderer);
  7440. }
  7441. function navBorderRadius(e) {
  7442. var pullTab = $('#pullTab'),
  7443. mobileRadius = {
  7444. bottom: {
  7445. 'border-bottom-left-radius': '10px',
  7446. 'border-bottom-right-radius': '10px',
  7447. },
  7448. top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' },
  7449. },
  7450. topRadius = {
  7451. bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
  7452. top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' },
  7453. };
  7454. function BorderRadius(bottom, top) {
  7455. $('#gui-modes-map > div:visible:last').css(bottom);
  7456. if (pullTab.is(':visible')) {
  7457. $('.viewContainer > div:visible:first').css(top);
  7458. } else {
  7459. $('#gui-modes-map > div:visible:first').css(top);
  7460. }
  7461. }
  7462. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  7463. BorderRadius(mobileRadius.bottom, mobileRadius.top);
  7464. } else {
  7465. BorderRadius(topRadius.bottom, topRadius.top);
  7466. }
  7467. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  7468. if (window.DATA.model.special || window.DATA.special) {
  7469. window.specialScene && specialScene.special().afterImplement();
  7470. }
  7471. }
  7472. function p(e) {
  7473. e || (e = 0),
  7474. (We = !1),
  7475. window.setTimeout(
  7476. function () {
  7477. We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show());
  7478. }.bind(this),
  7479. e
  7480. );
  7481. }
  7482. function f() {
  7483. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1);
  7484. }
  7485. function g(e, t) {
  7486. var i = e.mode,
  7487. n = t || e.currentPano;
  7488. $('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
  7489. $('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
  7490. $('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
  7491. i === _e.PANORAMA
  7492. ? ($('#view-controllers').slideUp(500),
  7493. Q.show360Views.enabled && !n.isAligned()
  7494. ? ($('.gui-floor').addClass('hidden'),
  7495. $('#gui-modes-outside').addClass('desktop-only'))
  7496. : ($('.gui-floor').removeClass('hidden'),
  7497. $('#gui-modes-outside').removeClass('desktop-only')),
  7498. $('#gui-modes-outside').removeClass('hidden'))
  7499. : i !== _e.TRANSITIONING &&
  7500. (f(),
  7501. (Be = i),
  7502. $('#gui-modes-outside').addClass('hidden'),
  7503. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  7504. $('#view-controllers').is(':visible') ||
  7505. $('#view-controllers').slideDown(Q.guiAnimationSpeed));
  7506. }
  7507. function m(e, t) {
  7508. var i = t.player;
  7509. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  7510. l(e),
  7511. J.updateInteraction(Se.InteractionGui, 'inside-button'),
  7512. J.track('USER', {
  7513. event_type: 'showcase_gui',
  7514. gui_action: 'click_inside_mode_button',
  7515. }),
  7516. t.changeMode(_e.PANORAMA);
  7517. }),
  7518. $('#gui-modes-outside')
  7519. .find('a')
  7520. .on('click', function (e) {
  7521. l(e),
  7522. J.track('showcase_gui', {
  7523. gui_action: 'click_outside_mode_button',
  7524. }),
  7525. t.changeMode(Be);
  7526. }),
  7527. $('#gui-modes-floorplan').on('click', function (e) {
  7528. l(e),
  7529. i.mode !== _e.FLOORPLAN &&
  7530. (J.track('showcase_gui', {
  7531. gui_action: 'click_floorplan_mode_button',
  7532. }),
  7533. t.changeMode(_e.FLOORPLAN));
  7534. }),
  7535. $('#gui-modes-dollhouse').on('click', function (e) {
  7536. l(e),
  7537. i.mode !== _e.DOLLHOUSE &&
  7538. (J.track('showcase_gui', {
  7539. gui_action: 'click_dollhouse_mode_button',
  7540. }),
  7541. t.changeMode(_e.DOLLHOUSE));
  7542. });
  7543. }
  7544. function v(e, t) {
  7545. function i() {
  7546. document.getElementById('vr').classList.remove('hidden'),
  7547. Q.vr.allowWebVR
  7548. ? K.getVRDisplay().then(
  7549. function (e) {
  7550. K.supportsFullscreen()
  7551. ? n(e)
  7552. : (De.warn('Unable to use WebVR when full screen is not supported'),
  7553. $('.improper-embed').toggleClass('hidden', !1),
  7554. r());
  7555. },
  7556. function (e) {
  7557. r();
  7558. }
  7559. )
  7560. : r();
  7561. }
  7562. function n(i) {
  7563. De.info(i.displayName + ' detected, VR button activates WebVR experience'),
  7564. Ie.init(e.data, t, i, q),
  7565. Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')),
  7566. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe));
  7567. }
  7568. function r() {
  7569. De.info('WebVR support not found, VR button activates native app VR modal'),
  7570. Ae.init(e.data, q),
  7571. Ae.on(
  7572. ye.OPENED,
  7573. (function () {
  7574. var e = document.getElementById('vr-modal');
  7575. return function () {
  7576. Ze('vr'), le.open(e);
  7577. };
  7578. })()
  7579. ),
  7580. Ae.on(ye.CLOSED, le.reset);
  7581. }
  7582. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
  7583. /*********************** 方奕卓 VR功能事件监听 ********************/
  7584. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  7585. switch (Q.vr.option) {
  7586. case Pe.CONTEXTUAL:
  7587. i();
  7588. break;
  7589. case Pe.ANDROID:
  7590. K.detectAndroid() && i();
  7591. break;
  7592. case Pe.NONE:
  7593. }
  7594. }
  7595. }
  7596. function A(e, t) {
  7597. $('#play').on('mousedown touchstart', function (e) {
  7598. l(e);
  7599. Ze('tour');
  7600. ve.play();
  7601. J.trackAlways('showcase_gui', {
  7602. gui_action: 'play_highlights',
  7603. });
  7604. }),
  7605. (window.startAndPlay = function (e) {
  7606. // l(e);
  7607. Ze('tour');
  7608. ve.play();
  7609. J.trackAlways('showcase_gui', {
  7610. gui_action: 'play_highlights',
  7611. });
  7612. });
  7613. $('#pause').on('mousedown touchstart', function (e) {
  7614. l(e),
  7615. ve.pause(),
  7616. J.trackAlways('showcase_gui', {
  7617. gui_action: 'pause_highlights',
  7618. });
  7619. }),
  7620. $('#gui-zoomin')
  7621. .find('a')
  7622. .on('click', function (e) {
  7623. l(e), t.player.zoomInIncrementally();
  7624. }),
  7625. $('#gui-zoomout')
  7626. .find('a')
  7627. .on('click', function (e) {
  7628. l(e), t.player.zoomOutIncrementally();
  7629. });
  7630. }
  7631. function y(e, t) {
  7632. for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
  7633. if (getQueryVariable('m') === '372') continue;
  7634. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(
  7635. e.floors.get(n).name
  7636. );
  7637. $('.gui-floor').find('.container').prepend(r);
  7638. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  7639. }
  7640. i
  7641. .find('.container')
  7642. .prepend(
  7643. '<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' +
  7644. Re.FLOOR_ALL +
  7645. '</div>'
  7646. ),
  7647. i.on('click', function (e) {
  7648. l(e), Ze('floor'), i.toggleClass('open');
  7649. }),
  7650. $('.floorChoice').on('click', function (e) {
  7651. l(e);
  7652. var n = $(this).data('index');
  7653. 'all' !== n
  7654. ? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7655. t.player.gotoFloor(n),
  7656. J.track('showcase_gui', {
  7657. gui_action: 'click_floor_select_button',
  7658. interaction_source: 'gui',
  7659. }))
  7660. : (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7661. Ze('move'),
  7662. t.allFloors(),
  7663. J.track('showcase_gui', {
  7664. gui_action: 'click_toggle_all_floors_button',
  7665. interaction_source: 'gui',
  7666. })),
  7667. i.removeClass('open');
  7668. });
  7669. }
  7670. function C(e, t) {
  7671. e &&
  7672. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  7673. ? ($('.allFloorBtn').show(),
  7674. $('.gui-floor-icon').hide(),
  7675. $('.gui-floor-title').show())
  7676. : ($('.allFloorBtn').hide(),
  7677. $('.gui-floor-icon').show(),
  7678. $('.gui-floor-title').hide()),
  7679. e.model.allFloorsVisible
  7680. ? ($('.gui-floor-title').text(Re.FLOOR_ALL),
  7681. $('.gui-floor-number').text(Re.FLOOR_ALL),
  7682. $('.floorChoice').removeClass('active'),
  7683. $('.floorChoice[data-index="all"]').addClass('active'))
  7684. : ($('.gui-floor-title').text(e.name),
  7685. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  7686. $('.floorChoice').removeClass('active'),
  7687. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')));
  7688. }
  7689. function I(e) {
  7690. return e.describe().inTransition;
  7691. }
  7692. function b(e, t, i) {
  7693. Fe = e.heroLocations.length;
  7694. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  7695. r = 100 / Fe + '%',
  7696. o = $('#thumb-container'),
  7697. a = $('#progressBar');
  7698. $('#status').find('.totalSteps').text(Fe);
  7699. for (var s = 0; s < Fe; s++) {
  7700. var c = e.heroLocations[s],
  7701. h = $(n);
  7702. var thumbUrl;
  7703. if (c.heroLocations) {
  7704. //有子项,选第一张截图
  7705. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl); //.replace('https://','').replace('http://','')
  7706. } else {
  7707. thumbUrl = manage.dealURL(c.thumbUrl); //.replace('https://','').replace('http://','')
  7708. }
  7709. h.attr('data-index', s);
  7710. je.highlight.visible && h.find('img').attr('src', thumbUrl);
  7711. if (c.name) {
  7712. var u = $('<div class="overlay"></div>').text(c.name);
  7713. h.prepend(u);
  7714. }
  7715. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  7716. var d = e.panos.get(c.panoId),
  7717. p = d && !d.isAligned(),
  7718. f = p
  7719. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  7720. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  7721. h.prepend(f);
  7722. }
  7723. o.append(h),
  7724. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>');
  7725. }
  7726. (j = 144 * Fe),
  7727. (Y = 111 * Fe),
  7728. $('.thumbImg').on('mouseover', function () {
  7729. I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]); //改
  7730. }),
  7731. $('.thumbImg').on('mouseout', function () {
  7732. t.clearPath();
  7733. }),
  7734. $('.thumbImg').on('click', function (e) {
  7735. l(e);
  7736. var i = $(this);
  7737. J.updateInteraction(Se.InteractionGui, 'thumbnail'),
  7738. J.trackAlways('showcase_gui', {
  7739. gui_action: 'click_highlight',
  7740. }),
  7741. t.goToHighlight([i.data('index'), 0]); //改
  7742. }),
  7743. $('.previous')
  7744. .find('a')
  7745. .on('click', function (e) {
  7746. l(e),
  7747. J.trackAlways('showcase_gui', {
  7748. gui_action: 'prev_highlight',
  7749. }),
  7750. t.prevHighlight();
  7751. }),
  7752. $('.next')
  7753. .find('a')
  7754. .on('click', function (e) {
  7755. l(e),
  7756. J.trackAlways('showcase_gui', {
  7757. gui_action: 'next_highlight',
  7758. }),
  7759. t.nextHighlight();
  7760. }),
  7761. $('#drawer').on('mouseleave', function (e) {
  7762. l(e);
  7763. var t;
  7764. try {
  7765. t = new MouseEvent('mouseup', {
  7766. clientX: e.clientX,
  7767. clientY: e.clientY,
  7768. screenX: e.screenX,
  7769. screenY: e.screenY,
  7770. });
  7771. } catch (i) {
  7772. (t = document.createEvent('MouseEvents')),
  7773. t.initMouseEvent(
  7774. 'mouseup',
  7775. e.bubbles,
  7776. e.cancelable,
  7777. e.view,
  7778. e.detail,
  7779. e.screenX,
  7780. e.screenY,
  7781. e.clientX,
  7782. e.clientY,
  7783. e.ctrlKey,
  7784. e.altKey,
  7785. e.shiftKey,
  7786. e.metaKey,
  7787. e.button,
  7788. e.relatedTarget
  7789. );
  7790. }
  7791. document.dispatchEvent(t);
  7792. }),
  7793. (W = new Sly($('#scrollFrame'), {
  7794. horizontal: !0,
  7795. itemNav: 'centered',
  7796. smart: !0,
  7797. scrollTrap: !0,
  7798. scrollBy: 1,
  7799. mouseDragging: !0,
  7800. touchDragging: !0,
  7801. speed: 300,
  7802. dragHandle: !0,
  7803. dynamicHandle: !0,
  7804. clickBar: !0,
  7805. scrollBar: $('#scroller'),
  7806. activateOn: null,
  7807. }).init()),
  7808. W.on('active', function (e, t) {
  7809. (Ve = t),
  7810. Ze('tour'),
  7811. $('.step').removeClass('active'),
  7812. $('#status')
  7813. .find('.curIdx')
  7814. .text(t + 1);
  7815. for (var i = 0; i <= t; i++)
  7816. $('#progressBar')
  7817. .find("[data-idx='" + i + "']")
  7818. .addClass('active');
  7819. }),
  7820. w();
  7821. //add :
  7822. let scrollFrame = $(W.frame);
  7823. scrollFrame.on('wheel.sly', function () {
  7824. lastMoveScrollTime = Date.now();
  7825. });
  7826. let dragstart;
  7827. /* scrollFrame.on("pointerdown", function() {
  7828. dragstart = true
  7829. })
  7830. scrollFrame.on("pointerup", function() {
  7831. dragstart = false
  7832. }) */
  7833. scrollFrame.on('pointermove', function () {
  7834. //if(dragstart){
  7835. lastMoveScrollTime = Date.now();
  7836. //}
  7837. });
  7838. }
  7839. function w() {
  7840. var e = $('#player').width() - 20,
  7841. t = $('#scroller'),
  7842. i = $('#drawer'),
  7843. n = $('.pinBottom');
  7844. if ($('#player').width() < 488 || $('#player').height() < 488)
  7845. t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll');
  7846. else {
  7847. var r = j > e,
  7848. o = !i.hasClass('noScroll'),
  7849. a = r !== o;
  7850. a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'));
  7851. }
  7852. }
  7853. function _(e) {
  7854. je.tourControls.visible = true; //e.tour_buttons && K.valueFromHash("gt", 1),
  7855. (je.coBrand.visible =
  7856. e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
  7857. (je.highlight.visible =
  7858. /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights);
  7859. }
  7860. function T(e) {
  7861. function t(t, i) {
  7862. return !!e.player_options[t] && e[i || t];
  7863. }
  7864. $('.model-title').text(e.name);
  7865. var i = Q.pageTitle;
  7866. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7867. 2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
  7868. (document.title = i),
  7869. K.isMobile()
  7870. ? $('#gui-fullscreen').css('display', 'none')
  7871. : ($('[rel=tooltip]').tooltip({
  7872. delay: {
  7873. show: 50,
  7874. hide: 0,
  7875. },
  7876. trigger: 'hover',
  7877. html: !1,
  7878. viewport: {
  7879. selector: 'body',
  7880. padding: 10,
  7881. },
  7882. }),
  7883. K.inIframe() &&
  7884. document
  7885. .getElementsByClassName('pinBottom-container')[0]
  7886. .classList.add('embed')),
  7887. // t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  7888. de.populate({
  7889. name: t('model_name', 'name'),
  7890. coBrand: t('presented_by'),
  7891. description: t('model_summary', 'summary') || '暂无内容',
  7892. contactName: t('contact_name'),
  7893. address: t('address'),
  7894. phone: t('contact_phone'),
  7895. formattedPhone: e.formatted_contact_phone,
  7896. email: t('contact_email'),
  7897. url: t('external_url'),
  7898. socialSharing: e.enable_social_sharing && e.is_public,
  7899. });
  7900. }
  7901. function x(e, t, i, n, r, o) {
  7902. function a() {
  7903. o.setLoadingStartTime(),
  7904. H(),
  7905. r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l);
  7906. }
  7907. var s = $.Deferred(),
  7908. l = s.resolve.bind(s);
  7909. return (
  7910. (Ge = !0),
  7911. O(e),
  7912. e.data.player_options && _(e.data.player_options),
  7913. 1 === Q.specialEdition && $('body').addClass('specialEdition'),
  7914. Re.localizeGUI(),
  7915. T(e.data),
  7916. r || $('.quick').addClass('hidden'),
  7917. //e.data.image && !r && E(e.data.image),
  7918. n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
  7919. s
  7920. );
  7921. }
  7922. function S(e, t, i, n, r, a, s) {
  7923. (q = s),
  7924. e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  7925. e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  7926. ae.init(),
  7927. re.init(e, a),
  7928. Oe.init(e, t, n),
  7929. $('.icon').on('mouseover', function () {
  7930. t.player && t.player.reticule.hide();
  7931. }),
  7932. m(e, t),
  7933. A(e, t),
  7934. e.data.enable_social_sharing &&
  7935. e.data.is_public &&
  7936. Q.share.enabled &&
  7937. (Ce.init(window.DATA.name /* e.data.name */),
  7938. Ce.on(
  7939. Me.OPENED,
  7940. (function () {
  7941. var e = document.getElementById('share-modal');
  7942. return function () {
  7943. Ze('share'), le.open(e);
  7944. };
  7945. })()
  7946. ),
  7947. Ce.on(Me.CLOSED, le.reset)),
  7948. e.heroLocations.length > 0
  7949. ? b(e, t, i)
  7950. : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  7951. de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
  7952. z(),
  7953. g(i),
  7954. v(e, r),
  7955. e.on('floor.changed', C),
  7956. e.on('waiting', R.bind(this, e)),
  7957. e.on('waiting-done', P.bind(this, e)),
  7958. i.on(xe.ModeChanged, function (e, n) {
  7959. g(i),
  7960. o(t, i),
  7961. n === _e.PANORAMA &&
  7962. i.currentPano &&
  7963. !i.currentPano.isAligned() &&
  7964. (n = _e.OUTDOOR),
  7965. he.updateMode(n);
  7966. }),
  7967. n.on(Se.Move, Ze.bind(this, 'move')),
  7968. i.on(xe.Ready, function () {
  7969. ie.init(n, i, i.tagManager, t),
  7970. i.on(xe.ModeChanged, function (e, t) {
  7971. e !== t && $('.vr-popup').is(':visible') && Ae.dismiss();
  7972. });
  7973. }),
  7974. i.on(xe.PanoChosen, function (e, t) {
  7975. g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA);
  7976. }),
  7977. le.on(ce.CLOSE, function (e) {
  7978. switch (e) {
  7979. case 'vr-modal':
  7980. Ae.dismiss();
  7981. break;
  7982. case 'share-modal':
  7983. Ce.hide();
  7984. break;
  7985. case 'terms-modal':
  7986. fe.hide();
  7987. }
  7988. });
  7989. var l = $('#play').eq(0),
  7990. c = $('#pause').eq(0),
  7991. h = $('.pinBottom').toArray(),
  7992. u = $('#drawer').eq(0),
  7993. d = $('#playHead').eq(0),
  7994. p = $('#progressBar').eq(0),
  7995. f = $('#thumb-container').eq(0),
  7996. y = f.children(),
  7997. I = p.children();
  7998. t.on('update.controls', function () {
  7999. //导览控制
  8000. var n = t.describe();
  8001. n.tourIsPlaying || i.isWarping()
  8002. ? (je.tourControls.visible && (l.hide(), c.show()),
  8003. n.tourInProgress &&
  8004. (h.forEach(function (e) {
  8005. e.classList.add('playing');
  8006. }),
  8007. u.addClass('playing'),
  8008. d.addClass('playing')))
  8009. : (je.tourControls.visible && (l.show(), c.hide()),
  8010. n.tourInProgress ||
  8011. (ve.stopTour(),
  8012. h.forEach(function (e) {
  8013. e.classList.remove('playing');
  8014. }),
  8015. u.removeClass('playing'),
  8016. d.removeClass('playing')));
  8017. var r, a, s;
  8018. if (null !== n.currentItem) {
  8019. var p, f;
  8020. $('#status')
  8021. .find('.curIdx')
  8022. .text(n.currentItem[0] + 1),
  8023. n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'));
  8024. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  8025. /* for (r = 0; r < e.heroLocations.length; r += 1)
  8026. s = y.eq(r),
  8027. a = I.eq(r),
  8028. s.removeClass(f),
  8029. a.removeClass(f),
  8030. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  8031. a.addClass(p),
  8032. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  8033. a.addClass(p)) : (s.removeClass(p),
  8034. a.removeClass(p)) */
  8035. for (r = 0; r < e.heroLocations.length; r += 1) {
  8036. (s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f);
  8037. if (n.onTheBus && r === n.destinationItem[0]) {
  8038. s.addClass(p);
  8039. a.addClass(p);
  8040. if (Date.now() - lastMoveScrollTime > 2000) {
  8041. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  8042. W.activate(r); // scrollbar slide to this
  8043. }
  8044. } else {
  8045. n.onTheBus && g && r === n.currentItem[0]
  8046. ? (s.addClass(p), a.addClass(p))
  8047. : (s.removeClass(p), a.removeClass(p));
  8048. }
  8049. }
  8050. } else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass('active recent'), a.removeClass('active recent');
  8051. o(t, i);
  8052. }),
  8053. document.addEventListener(
  8054. 'keydown',
  8055. function (n) {
  8056. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  8057. case we.ZERO:
  8058. Q.debug && e.toggleAlpha();
  8059. break;
  8060. case we.NINE:
  8061. Q.debug && se.toggle();
  8062. break;
  8063. case we.ONE:
  8064. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  8065. break;
  8066. case we.TWO:
  8067. e.outsideAllowed() &&
  8068. !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
  8069. t.changeMode(_e.DOLLHOUSE);
  8070. break;
  8071. case we.THREE:
  8072. e.outsideAllowed() &&
  8073. !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
  8074. t.changeMode(_e.FLOORPLAN);
  8075. break;
  8076. case we.FOUR:
  8077. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  8078. break;
  8079. case we.SPACE:
  8080. je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'));
  8081. break;
  8082. case we.RETURN:
  8083. Q.debug && e.toggleExplodeUp();
  8084. break;
  8085. case we.P:
  8086. k();
  8087. break;
  8088. case we.U:
  8089. B();
  8090. break;
  8091. case we.X:
  8092. Q.debug && e.toggleExplode();
  8093. break;
  8094. case we.PLUSEQUALS:
  8095. t.player.activatePersistentZooming(!0), ie.hideUi();
  8096. break;
  8097. case we.DASHUNDERSCORE:
  8098. t.player.activatePersistentZooming(!1), ie.hideUi();
  8099. break;
  8100. case we.SEVEN:
  8101. De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov);
  8102. break;
  8103. case we.EIGHT:
  8104. t.player.decreaseZoomSpeed();
  8105. break;
  8106. case we.NINE:
  8107. t.player.increaseZoomSpeed();
  8108. }
  8109. return i && i.reticule.hide(), !0;
  8110. }.bind(this)
  8111. ),
  8112. document.addEventListener(
  8113. 'keyup',
  8114. function (e) {
  8115. switch (e.which) {
  8116. case we.PLUSEQUALS:
  8117. t.player.deactivatePersistentZooming();
  8118. break;
  8119. case we.DASHUNDERSCORE:
  8120. t.player.deactivatePersistentZooming();
  8121. }
  8122. }.bind(this)
  8123. ),
  8124. F(e),
  8125. L(e, t.player),
  8126. M(i),
  8127. te.setAutoPlay(e.heroCount()),
  8128. he.init(i, a.mode),
  8129. he.on(ue.OPENED, Ze.bind(this, 'help')),
  8130. fe.init(),
  8131. fe.on(
  8132. ge.OPENED,
  8133. (function () {
  8134. var e = document.getElementById('terms-modal');
  8135. return function () {
  8136. Ze('terms'), le.open(e);
  8137. };
  8138. })()
  8139. ),
  8140. fe.on(ge.CLOSED, le.reset),
  8141. Q.quickstart.enabled ||
  8142. re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  8143. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  8144. Q.profiling.enabled && se.show(),
  8145. ve.init(t);
  8146. }
  8147. function M(e) {
  8148. var t = function (e, t) {
  8149. $(e)
  8150. .find('a')
  8151. .each(function (e, i) {
  8152. t
  8153. ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled')
  8154. : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  8155. (i.style.pointerEvents = t ? 'auto' : 'none');
  8156. });
  8157. },
  8158. i = function () {
  8159. e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
  8160. e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0);
  8161. };
  8162. e.on(Ne.ZoomMax, function () {
  8163. t('#gui-zoomin', !1), t('#gui-zoomout', !0);
  8164. }),
  8165. e.on(Ne.ZoomMin, function () {
  8166. t('#gui-zoomin', !0), t('#gui-zoomout', !1);
  8167. }),
  8168. e.on(Ne.ZoomIn, function () {
  8169. t('#gui-zoomout', !0);
  8170. }),
  8171. e.on(Ne.ZoomOut, function () {
  8172. t('#gui-zoomin', !0);
  8173. }),
  8174. i();
  8175. }
  8176. function R(e) {
  8177. O(e);
  8178. }
  8179. function P(e) {
  8180. O(e);
  8181. }
  8182. function O(e) {
  8183. var t = e.waitQueue.length;
  8184. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay);
  8185. }
  8186. function L(e, t) {
  8187. He = {
  8188. gui: null,
  8189. visible: !1,
  8190. model: e,
  8191. player: t,
  8192. };
  8193. }
  8194. function D(e, t) {
  8195. function i() {
  8196. var i = t.toJSON();
  8197. (n.linkToLocation =
  8198. window.location.protocol +
  8199. '//' +
  8200. window.location.host +
  8201. window.location.pathname +
  8202. '?m=' +
  8203. e.sid +
  8204. '&start=' +
  8205. be.serialize(i)),
  8206. t.tagManager.activeTag &&
  8207. (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid);
  8208. }
  8209. var n = {},
  8210. r = new Le.GUI({
  8211. autoPlace: !0,
  8212. width: '60%',
  8213. });
  8214. i(),
  8215. t.on(xe.ViewChanged, i),
  8216. r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(),
  8217. (r.domElement.id = 'datLinks');
  8218. var o = [].slice.call(r.domElement.querySelectorAll('.property-name'));
  8219. return (
  8220. o.forEach(function (e) {
  8221. if (!K.detectSafari()) {
  8222. var t = document.createElement('button');
  8223. t.classList.add('btn-deep-link'),
  8224. (t.innerText = Re.MENU_COPY),
  8225. e.nextSibling.appendChild(t);
  8226. var i = function () {
  8227. alert(Re.LINK_ALERT_COPY), t.hide();
  8228. };
  8229. t.addEventListener('click', function (e) {
  8230. try {
  8231. var t = e.target.parentNode.childNodes[0];
  8232. t.select();
  8233. var n = document.execCommand('copy');
  8234. t.blur(), n || i();
  8235. } catch (e) {
  8236. i();
  8237. }
  8238. });
  8239. }
  8240. }),
  8241. $(r.__closeButton).hide(),
  8242. r
  8243. );
  8244. }
  8245. function N(e) {
  8246. He.gui || (He.gui = D(He.model, He.player)),
  8247. (He.visible = e),
  8248. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide();
  8249. }
  8250. function B() {
  8251. N(!He.visible);
  8252. }
  8253. function F(e) {
  8254. ke = {
  8255. gui: null,
  8256. visible: !1,
  8257. model: e,
  8258. };
  8259. }
  8260. function V(e) {
  8261. var t = new Le.GUI();
  8262. return (
  8263. t
  8264. .add(Q, 'showSweeps')
  8265. .name('Show sweeps')
  8266. .onFinishChange(function () {
  8267. e.setSweepVisibility(Q.showSweeps);
  8268. }),
  8269. t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  8270. t
  8271. .add(Q.transition, 'flyTime', 0, 5e3)
  8272. .name('Transition time')
  8273. .onFinishChange(function () {
  8274. (Q.transition.flySpeed = 0),
  8275. t.__controllers.forEach(function (e) {
  8276. e.updateDisplay();
  8277. });
  8278. }),
  8279. t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
  8280. $(t.__closeButton).hide(),
  8281. t
  8282. );
  8283. }
  8284. function U(e) {
  8285. ke.gui || (ke.gui = V(ke.model)),
  8286. (ke.visible = e),
  8287. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide();
  8288. }
  8289. function k() {
  8290. U(!ke.visible);
  8291. }
  8292. function H() {
  8293. function e(e) {
  8294. e.target === t ||
  8295. $.contains(t, e.target) ||
  8296. e.target === i ||
  8297. $.contains(i, e.target) ||
  8298. e.target === n ||
  8299. $.contains(n, e.target); /* || e.preventDefault()*/
  8300. }
  8301. $('body').css('touch-action', 'none'),
  8302. $('#gui-parent')
  8303. .find('*:not(#tag-billboards)')
  8304. .on('touchmove', function (e) {
  8305. // e.preventDefault()
  8306. });
  8307. var t = document.getElementById('terms-text'),
  8308. i = document.getElementById('more-help-wrapper'),
  8309. n =
  8310. (document.getElementById('navigation-help-wrapper'),
  8311. document.getElementById('help-dialog'),
  8312. document.getElementById('tag-billboards'));
  8313. Q.useWheel &&
  8314. (document.body.addEventListener('mousewheel', e, { passive: false }),
  8315. document.body.addEventListener('DOMMouseScroll', e)),
  8316. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  8317. .off('touchmove')
  8318. .on('touchmove', function (e) {
  8319. e.stopPropagation();
  8320. });
  8321. }
  8322. function G(e, t) {
  8323. for (var i = []; e; ) i.push(e), (e = e.parentNode);
  8324. for (; t && i.indexOf(t) === -1; ) t = t.parentNode;
  8325. return t;
  8326. }
  8327. function z() {
  8328. var e,
  8329. t = function (t) {
  8330. e = 0 === t.button || 1 === t.which ? t.target : null;
  8331. },
  8332. i = function (t) {
  8333. e !== t.target && (e = G(e, t.target));
  8334. var i = document.getElementById('gui-parent');
  8335. if ((G(i, e) !== i && (e = null), e)) {
  8336. var n;
  8337. try {
  8338. n = new MouseEvent('click', t);
  8339. } catch (e) {
  8340. (n = document.createEvent('MouseEvents')),
  8341. n.initMouseEvent(
  8342. 'click',
  8343. t.bubbles,
  8344. t.cancelable,
  8345. t.view,
  8346. t.detail,
  8347. t.screenX,
  8348. t.screenY,
  8349. t.clientX,
  8350. t.clientY,
  8351. t.ctrlKey,
  8352. t.altKey,
  8353. t.shiftKey,
  8354. t.metaKey,
  8355. t.button,
  8356. t.relatedTarget
  8357. );
  8358. }
  8359. (n.syntheticClick = !0), e.dispatchEvent(n), (e = null);
  8360. }
  8361. };
  8362. document.body.addEventListener('mousedown', t, !0),
  8363. document.body.addEventListener('mouseup', i, !0),
  8364. document.getElementById('gui-parent').addEventListener(
  8365. 'click',
  8366. function (e) {
  8367. e.syntheticClick ||
  8368. (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault());
  8369. },
  8370. !0
  8371. );
  8372. }
  8373. var lastMoveScrollTime = 0; //add
  8374. var W,
  8375. j,
  8376. Y,
  8377. X,
  8378. Z,
  8379. q,
  8380. K = (e('three'), e('../util/ajax'), e('../util/browser')),
  8381. Q = e('../settings'),
  8382. J = e('../analytics'),
  8383. ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
  8384. te = (e('../objects/Snapshot'), e('./helpManager')),
  8385. ie = e('./immersiveMode'),
  8386. ne = e('./loadingScreen'),
  8387. re = e('./landingScreen'),
  8388. oe = e('./playButton'),
  8389. ae = e('./populateModal'),
  8390. se = e('./memoryUsage'),
  8391. le = e('./closer/modalCloser'),
  8392. ce = e('./closer/ModalCloserEvent'),
  8393. he = e('./help/help'),
  8394. ue = e('./help/HelpEvent'),
  8395. de = e('./title/titleBar'),
  8396. pe = e('./title/TitleEvents'),
  8397. fe = e('./terms/terms'),
  8398. ge = e('./terms/TermsEvent'),
  8399. me = e('./title/tagToggle'),
  8400. ve = e('./tourInteraction'),
  8401. Ae = e('./vr/vrModal'),
  8402. ye = e('./vr/vrEvent'),
  8403. Ce = e('./sharing/modal'),
  8404. Ie = e('./webvr/webVRgui'),
  8405. Ee = e('./webvr/WebVrEvent'),
  8406. be = e('../controls/serializer'),
  8407. we = e('../enum/Keys'),
  8408. _e = e('../enum/Viewmode'),
  8409. Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
  8410. xe =
  8411. (e('../enum/PathDiscardMode'),
  8412. e('../enum/PathDisplayMode'),
  8413. e('../enum/DirectorEvents'),
  8414. e('../enum/PlayerEvents')),
  8415. Se = e('../enum/ControlEvents'),
  8416. Me = e('./sharing/ShareEvents'),
  8417. Re = e('../localization/localize'),
  8418. Pe =
  8419. (e('../enum/Vectors'),
  8420. e('../enum/WarpStyle'),
  8421. e('../enum/AlignmentType'),
  8422. e('../enum/VROption')),
  8423. Oe = e('./konami'),
  8424. Le = e('../lib/dat.gui'),
  8425. De = new ee(i),
  8426. Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
  8427. Be = _e.DOLLHOUSE,
  8428. Fe = 0,
  8429. Ve = 0,
  8430. Ue = ['.hideTarget'],
  8431. ke = null,
  8432. He = null,
  8433. Ge = !1,
  8434. ze = !1,
  8435. We = !1,
  8436. je = {
  8437. coBrand: {
  8438. visible: !0,
  8439. elements: ['.co-brand', '#loaderCoBrand'],
  8440. },
  8441. help: {
  8442. visible: !0,
  8443. elements: ['.nav-help', '#nav-help'],
  8444. },
  8445. tourControls: {
  8446. visible: !0,
  8447. elements: ['.next', '.previous', '#play'],
  8448. },
  8449. highlight: {
  8450. visible: !0,
  8451. elements: ['#drawer', '#pullTab'],
  8452. },
  8453. share: {
  8454. visible: !0,
  8455. elements: ['.socialButton', '#share'],
  8456. },
  8457. fullScreen: {
  8458. visible: !0,
  8459. elements: ['#gui-fullscreen'],
  8460. },
  8461. floors: {
  8462. visible: !0,
  8463. elements: ['.gui-floor'],
  8464. },
  8465. },
  8466. Ye = (function () {
  8467. var e = document.getElementById('drawer');
  8468. return function () {
  8469. $('#player').height() < 400 && e.classList.contains('open') && a();
  8470. };
  8471. })(),
  8472. Xe = (function () {
  8473. var e = document.getElementById('meta-info');
  8474. return function () {
  8475. $('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0);
  8476. };
  8477. })(),
  8478. Ze = (function (e) {
  8479. function t() {
  8480. u.classList.contains('expand') && de.toggleMeta(!0);
  8481. }
  8482. function i() {
  8483. fe.hide();
  8484. }
  8485. function n() {
  8486. he.close();
  8487. }
  8488. function r() {
  8489. Ae.dismiss();
  8490. }
  8491. function o() {
  8492. p.hasClass('open') && a(!0);
  8493. }
  8494. function l() {
  8495. Ce.hide();
  8496. }
  8497. function c() {
  8498. f.hasClass('open') && f.removeClass('open');
  8499. }
  8500. function h() {
  8501. d.classList.contains('fadeIn') &&
  8502. (d.classList.contains('landing')
  8503. ? re.dismissModal()
  8504. : d.classList.contains('tour') && ve.dismissModal());
  8505. }
  8506. var u = document.getElementById('meta-info'),
  8507. d = document.getElementById('interaction-modal'),
  8508. p = $('#drawer').eq(0),
  8509. f = $('.gui-floor').eq(0),
  8510. g = $('.vr-popup').eq(0);
  8511. return function (e) {
  8512. switch (e) {
  8513. case 'info':
  8514. i(), n(), Ye(), l(), c(), r(), h();
  8515. break;
  8516. case 'terms':
  8517. t(), n(), o(), l(), c(), r(), h();
  8518. break;
  8519. case 'help':
  8520. t(), i(), l(), c(), r(), h();
  8521. break;
  8522. case 'vr':
  8523. t(), i(), l(), c(), n(), h(), s(g) && o();
  8524. break;
  8525. case 'highlights':
  8526. Xe(), i(), l(), c();
  8527. break;
  8528. case 'share':
  8529. t(), i(), n(), c(), r(), h();
  8530. break;
  8531. case 'floor':
  8532. i(), l(), r();
  8533. break;
  8534. case 'view':
  8535. c(), l(), i(), r();
  8536. break;
  8537. case 'tour':
  8538. i(), l(), c(), r();
  8539. break;
  8540. case 'move':
  8541. i(), l(), c(), r();
  8542. break;
  8543. case 'resize':
  8544. t(), Ye(), c();
  8545. break;
  8546. case 'tag':
  8547. i(), n(), l(), c(), r();
  8548. }
  8549. };
  8550. })();
  8551. $(document).on(
  8552. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  8553. function (e) {
  8554. $('#gui-fullscreen').toggle(!K.isFullscreen()),
  8555. $('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
  8556. setTimeout(function () {
  8557. $('.icon:visible').hide().show(0);
  8558. }, 100);
  8559. }
  8560. ),
  8561. $('#gui-fullscreen')
  8562. .find('a')
  8563. .on('click', function (e) {
  8564. l(e),
  8565. K.requestFullscreen($('body')[0]),
  8566. J.track('showcase_gui', {
  8567. gui_action: 'click_enter_fullscreen',
  8568. interaction_source: 'gui',
  8569. });
  8570. //czj
  8571. //W.reload()
  8572. }),
  8573. $('#gui-fullscreen-exit')
  8574. .find('a')
  8575. .on('click', function (e) {
  8576. l(e),
  8577. K.exitFullscreen(),
  8578. J.track('showcase_gui', {
  8579. gui_action: 'click_exit_fullscreen',
  8580. interaction_source: 'gui',
  8581. });
  8582. });
  8583. $(window)
  8584. .on('resize', function (e) {
  8585. var t = e.target.innerHeight,
  8586. i = e.target.innerWidth;
  8587. (t === X && i === Z) ||
  8588. (je.highlight.visible && w(),
  8589. Ze('resize'),
  8590. $('.pinTop.right').removeClass('hideUnderMeta'),
  8591. c(),
  8592. (X = t),
  8593. (Z = i));
  8594. })
  8595. .resize(),
  8596. K.supportsFullscreen() || $('#gui-fullscreen').hide(),
  8597. $('#pullTab').on('click', function (e) {
  8598. l(e),
  8599. $('#drawer').hasClass('open')
  8600. ? (J.trackAlways('showcase_gui', {
  8601. gui_action: 'hide_highlight_reel',
  8602. }),
  8603. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  8604. : (J.trackAlways('showcase_gui', {
  8605. gui_action: 'show_highlight_reel',
  8606. }),
  8607. $(this)
  8608. .removeClass('open')
  8609. .children('img')
  8610. .attr('src', 'images/auto-suspend.png'));
  8611. a();
  8612. });
  8613. /***********************方奕卓 热点列表事件监听 ************************/
  8614. if (window.DATA.showHotListSta) {
  8615. $('#hotList').css('display', '');
  8616. $('#hotList').on('click', function (e) {
  8617. l(e);
  8618. var hotList = $('#hotListWrap')[0];
  8619. var isActive = hotList.classList.contains('hotListActive');
  8620. if (isActive) {
  8621. hotList.classList.remove('hotListActive');
  8622. this.classList.remove('active');
  8623. } else {
  8624. hotList.classList.add('hotListActive');
  8625. this.classList.add('active');
  8626. }
  8627. }),
  8628. // $('#hotListContent ul').on('mouseover', function (e) {
  8629. // l(e);
  8630. // var target = e.target;
  8631. // var hotList = document.getElementById('hotListWrap');
  8632. // if (target.tagName === 'SPAN') {
  8633. // var targetParent = target.parentElement.parentElement;
  8634. // if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  8635. // hotList.style.width = target.offsetWidth + 116 + 'px';
  8636. // } else {
  8637. // hotList.style.width = '';
  8638. // }
  8639. // } else if (target.tagName === 'LI') {
  8640. // var targetParent = target.parentElement;
  8641. // if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
  8642. // hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  8643. // } else {
  8644. // hotList.style.width = '';
  8645. // }
  8646. // } else {
  8647. // hotList.style.width = '';
  8648. // }
  8649. // });
  8650. $('#hotListContent ul').on('click', function (e) {
  8651. l(e);
  8652. this.preElem && this.preElem.classList.remove('active');
  8653. if (e.target.tagName === 'SPAN') {
  8654. e.target.parentElement.classList.add('active');
  8655. e.target.parentElement.hot &&
  8656. e.target.parentElement.hot.examine(window.player, true); // 打开热点
  8657. this.preElem = e.target.parentElement;
  8658. } else {
  8659. e.target.classList.add('active');
  8660. e.target.hot && e.target.hot.examine(window.player, true); // 打开热点
  8661. this.preElem = e.target;
  8662. }
  8663. });
  8664. $('#hotListClose').on('click', function (e) {
  8665. l(e);
  8666. var hotList = $('#hotListWrap')[0];
  8667. hotList.classList.remove('hotListActive');
  8668. $('#hotListContent ul .active').removeClass('active');
  8669. $('#hotList')[0].classList.remove('active');
  8670. });
  8671. }
  8672. /*****************************************************************/
  8673. $('#more-menu-button').on('click', function (e) {
  8674. l(e);
  8675. var t = $('#more-menu');
  8676. t.toggleClass('open');
  8677. }),
  8678. (t.exports.init = S),
  8679. (t.exports.startLoading = x),
  8680. (t.exports.endLoading = d),
  8681. (t.exports.onProgress = u);
  8682. }.call(this, '/js/gui/gui.js'));
  8683. },
  8684. {
  8685. '../analytics': 4,
  8686. '../controls/serializer': 14,
  8687. '../enum/AlignmentType': 17,
  8688. '../enum/BlackoutStyle': 18,
  8689. '../enum/ControlEvents': 21,
  8690. '../enum/DirectorEvents': 23,
  8691. '../enum/Keys': 30,
  8692. '../enum/PathDiscardMode': 38,
  8693. '../enum/PathDisplayMode': 39,
  8694. '../enum/PlayerEvents': 40,
  8695. '../enum/VROption': 47,
  8696. '../enum/Vectors': 50,
  8697. '../enum/Viewmode': 51,
  8698. '../enum/WarpStyle': 52,
  8699. '../enum/ZoomEvents': 53,
  8700. '../lib/dat.gui': 93,
  8701. '../localization/localize': 108,
  8702. '../tag/Media/MediaEvent': 131,
  8703. '../objects/Snapshot': 153,
  8704. '../settings': 166,
  8705. '../util/ajax': 181,
  8706. '../util/browser': 182,
  8707. '../util/camera': 183,
  8708. '../util/logger': 189,
  8709. '../util/showcase': 193,
  8710. '../util/transitions': 195,
  8711. './closer/ModalCloserEvent': 61,
  8712. './closer/modalCloser': 62,
  8713. './help/HelpEvent': 66,
  8714. './help/help': 67,
  8715. './helpManager': 68,
  8716. './immersiveMode': 69,
  8717. './konami': 70,
  8718. './landingScreen': 71,
  8719. './loadingScreen': 72,
  8720. './memoryUsage': 73,
  8721. './playButton': 74,
  8722. './populateModal': 75,
  8723. './sharing/ShareEvents': 76,
  8724. './sharing/modal': 77,
  8725. './terms/TermsEvent': 78,
  8726. './terms/terms': 79,
  8727. './title/TitleEvents': 80,
  8728. './title/tagToggle': 81,
  8729. './title/titleBar': 82,
  8730. './tourInteraction': 84,
  8731. './vr/vrEvent': 85,
  8732. './vr/vrModal': 87,
  8733. './webvr/WebVrEvent': 88,
  8734. './webvr/webVRgui': 89,
  8735. three: 217,
  8736. },
  8737. ],
  8738. 66: [
  8739. function (e, t, i) {
  8740. 'use strict';
  8741. t.exports = Object.freeze({
  8742. OPENED: 'help.opened',
  8743. CLOSED: 'help.closed',
  8744. });
  8745. },
  8746. {},
  8747. ],
  8748. 67: [
  8749. function (e, t, i) {
  8750. 'use strict';
  8751. function n() {
  8752. g.on('click', function (e) {
  8753. if (S && S !== l.TRANSITIONING) {
  8754. var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0;
  8755. t && !M ? R.close() : r();
  8756. }
  8757. }),
  8758. w.on('click', function (e) {
  8759. R.close();
  8760. }),
  8761. E.on('click', function (e) {
  8762. S && S !== l.TRANSITIONING && (s(), o());
  8763. }),
  8764. b.on('click', function (e) {
  8765. s(), a();
  8766. });
  8767. }
  8768. function r() {
  8769. S &&
  8770. S !== l.TRANSITIONING &&
  8771. ((M = !0),
  8772. setTimeout(function () {
  8773. M = !1;
  8774. }, d.help.modalStayDuration),
  8775. R.emit(h.OPENED),
  8776. m.addClass('open ' + S),
  8777. g.addClass('open'),
  8778. s(),
  8779. o(),
  8780. y.style.removeProperty
  8781. ? y.style.removeProperty('display')
  8782. : y.style.removeAttribute('display'),
  8783. y.classList.add('fadeIn'));
  8784. }
  8785. function o() {
  8786. E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S);
  8787. }
  8788. function a() {
  8789. b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help');
  8790. }
  8791. function s(e, t) {
  8792. m.removeClass(
  8793. 'more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR
  8794. ),
  8795. I.forEach(function (e) {
  8796. e.classList.remove('underline-tab');
  8797. });
  8798. }
  8799. var l = e('../../enum/Viewmode'),
  8800. c = e('../../enum/HelpModalType'),
  8801. h = e('./HelpEvent'),
  8802. u = (e('../helpManager'), e('./../populateModal')),
  8803. d = e('../../settings'),
  8804. p = e('../../util/common'),
  8805. f = e('events').EventEmitter,
  8806. g = $('.footer-help').eq(0),
  8807. m = $('#help-dialog').eq(0),
  8808. v = document.querySelector('#quick-logo'),
  8809. A = document.querySelector('#loaderCoBrand'),
  8810. y = document.querySelector('#help-dialog'),
  8811. C = document.querySelector('.footer'),
  8812. I = $('.help-tabs').children().toArray(),
  8813. E = $('.navigation-tab').eq(0),
  8814. b = $('.more-help-tab').eq(0),
  8815. w =
  8816. ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
  8817. _ = m.find('.interactions').toArray(),
  8818. T = m.find('.ui-instructions').toArray(),
  8819. x = l.PANORAMA,
  8820. S = l.PANORAMA,
  8821. M = !1,
  8822. R = {
  8823. init: function (e, t) {
  8824. (S = t),
  8825. (x = t),
  8826. [y, A, v, C].forEach(function (e) {
  8827. e.classList.add(u.deviceType);
  8828. }),
  8829. n();
  8830. },
  8831. close: function () {
  8832. if (
  8833. m.hasClass('open') &&
  8834. (this.emit(h.CLOSED),
  8835. g.removeClass('open'),
  8836. m.removeClass('open'),
  8837. y.classList.contains('fadeIn'))
  8838. ) {
  8839. y.classList.remove('fadeIn');
  8840. var e = S === l.TRANSITIONING ? x : S;
  8841. u.clear(_, c.NAVIGATION, e);
  8842. }
  8843. },
  8844. updateMode: function (e) {
  8845. (x = S), (S = e);
  8846. },
  8847. };
  8848. p.extendObject(R, f.prototype), (t.exports = R);
  8849. },
  8850. {
  8851. '../../enum/HelpModalType': 28,
  8852. '../../enum/Viewmode': 51,
  8853. '../../settings': 166,
  8854. '../../util/common': 185,
  8855. '../helpManager': 68,
  8856. './../populateModal': 75,
  8857. './HelpEvent': 66,
  8858. events: 202,
  8859. },
  8860. ],
  8861. 68: [
  8862. function (e, t, i) {
  8863. (function (i) {
  8864. 'use strict';
  8865. var n = e('../util/browser'),
  8866. r = e('./../util/logger'),
  8867. o = e('./../settings'),
  8868. a = new r(i),
  8869. s = (function () {
  8870. var e;
  8871. try {
  8872. return (
  8873. (e = window.localStorage.getItem('visitCount') || '0'),
  8874. (e = (parseFloat(e) + 1).toString()),
  8875. window.localStorage.setItem('visitCount', e),
  8876. a.debug('visitCount = ' + e),
  8877. e
  8878. );
  8879. } catch (t) {
  8880. (e = '1'), a.debug("couldn't set local storage");
  8881. }
  8882. })(),
  8883. l = !1;
  8884. t.exports = {
  8885. isHelpDisabled: function () {
  8886. return '0' === n.valueFromHash('help', null) || l;
  8887. },
  8888. isLargeHelpEnabled: function () {
  8889. return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled();
  8890. },
  8891. isSmallHelpEnabled: function () {
  8892. return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled();
  8893. },
  8894. isHelpEnabled: function () {
  8895. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled();
  8896. },
  8897. setAutoPlay: function (e) {
  8898. l = o.warp.auto >= 0 && e > 1;
  8899. },
  8900. };
  8901. }.call(this, '/js/gui/helpManager.js'));
  8902. },
  8903. {
  8904. '../util/browser': 182,
  8905. './../settings': 166,
  8906. './../util/logger': 189,
  8907. },
  8908. ],
  8909. 69: [
  8910. function (e, t, i) {
  8911. 'use strict';
  8912. function n(e, t, i, n) {
  8913. (F = n), r(e, t, i, F), o(), (N = t.mode);
  8914. }
  8915. function r(e, t, i, n) {
  8916. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  8917. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c);
  8918. }),
  8919. M.on('mousewheel DOMMouseScroll', a),
  8920. i.on(m.TagActivated, a),
  8921. i.on(m.TagNavigation, a),
  8922. t.on(A.FlyingEnded, s),
  8923. t.on(A.ModeChanging, function (e, t) {
  8924. B = t !== C.PANORAMA && e !== C.PANORAMA;
  8925. }),
  8926. t.on(A.ModeChanged, function (e, i) {
  8927. (N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange');
  8928. }),
  8929. n.on(y.TourStart, function () {
  8930. (L = !0), a();
  8931. }),
  8932. n.on(y.TourEnd, function () {
  8933. (L = !1), l();
  8934. }),
  8935. n.on(y.ActionInterrupted, function () {
  8936. L = !1;
  8937. }),
  8938. R.addEventListener(
  8939. 'touchend',
  8940. function () {
  8941. $('#pullTab').hasClass('opened') && !L && l();
  8942. },
  8943. !0
  8944. );
  8945. }
  8946. function o() {
  8947. p.isMobile()
  8948. ? (b.forEach(function (e) {
  8949. e.classList.add('mobile');
  8950. }),
  8951. w.click(l))
  8952. : (b.forEach(function (e) {
  8953. e.addEventListener(
  8954. 'mouseleave',
  8955. function () {
  8956. !M.is(':hover') && b[0].classList.contains('detectHover') && l();
  8957. },
  8958. !0
  8959. );
  8960. }),
  8961. M.mouseleave(function () {
  8962. b[0].classList.contains('detectHover') && l();
  8963. }));
  8964. }
  8965. function a(e) {
  8966. D ||
  8967. (d(e) && _.hasClass('playing')) ||
  8968. (clearTimeout(O),
  8969. (P = !0),
  8970. g.close(),
  8971. h(e),
  8972. N !== C.DOLLHOUSE &&
  8973. N !== C.FLOORPLAN &&
  8974. ((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
  8975. _.hasClass('playing') ||
  8976. (b.forEach(function (e) {
  8977. e.classList.add('detectHover');
  8978. }),
  8979. (O = setTimeout(l, f.immersive.timeToShowAgain)))));
  8980. }
  8981. function s() {
  8982. _.hasClass('playing') ||
  8983. (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)));
  8984. }
  8985. function l() {
  8986. clearTimeout(O),
  8987. (P = !1),
  8988. I.forEach(function (e) {
  8989. e.classList.remove('drawerOpen');
  8990. }),
  8991. L ||
  8992. E.forEach(function (e) {
  8993. e.classList.remove('duringTour');
  8994. }),
  8995. b.forEach(function (e) {
  8996. e.classList.remove('detectHover');
  8997. });
  8998. }
  8999. function c() {
  9000. P ? l() : a(),
  9001. (D = !0),
  9002. setTimeout(function () {
  9003. D = !1;
  9004. }, f.immersive.uiStayDuration);
  9005. }
  9006. function h(e) {
  9007. !d(e) && L
  9008. ? E.forEach(function (e) {
  9009. e.classList.remove('drawerOpen'), e.classList.add('duringTour');
  9010. })
  9011. : _.hasClass('open')
  9012. ? E.forEach(function (e) {
  9013. e.classList.remove('duringTour'), e.classList.add('drawerOpen');
  9014. })
  9015. : B ||
  9016. N === C.FLOORPLAN ||
  9017. N === C.DOLLHOUSE ||
  9018. E.forEach(function (e) {
  9019. e.classList.add('fadeOut');
  9020. });
  9021. }
  9022. function u() {
  9023. T.hasClass('duringTour') || ((L = !1), a('gui'), l());
  9024. }
  9025. function d(e) {
  9026. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e;
  9027. }
  9028. var p = e('../util/browser'),
  9029. f = e('../settings'),
  9030. g = e('./help/help'),
  9031. m = e('../enum/tagEvents'),
  9032. v = e('../enum/ControlEvents'),
  9033. A = e('../enum/PlayerEvents'),
  9034. y = e('../enum/DirectorEvents'),
  9035. A = e('../enum/PlayerEvents'),
  9036. C = e('../enum/Viewmode'),
  9037. I = $(
  9038. '.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer'
  9039. ).toArray(),
  9040. E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  9041. b = $('#hover-bottom, #hover-top').toArray(),
  9042. w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  9043. _ = $('#drawer').eq(0),
  9044. T = $('#drawer-container').eq(0),
  9045. x = $('#meta-info').eq(0),
  9046. S = $('.pinTop.left').eq(0),
  9047. M = $('#player').eq(0),
  9048. R = document.getElementById('pullTab'),
  9049. P = !1,
  9050. O = null,
  9051. L = !1,
  9052. D = !1,
  9053. N = null,
  9054. B = !1,
  9055. F = null;
  9056. (t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u);
  9057. },
  9058. {
  9059. '../enum/ControlEvents': 21,
  9060. '../enum/DirectorEvents': 23,
  9061. '../enum/tagEvents': 32,
  9062. '../enum/PlayerEvents': 40,
  9063. '../enum/Viewmode': 51,
  9064. '../settings': 166,
  9065. '../util/browser': 182,
  9066. './help/help': 67,
  9067. },
  9068. ],
  9069. 70: [
  9070. function (e, t, i) {
  9071. (function (i) {
  9072. 'use strict';
  9073. function n(e, t, i) {
  9074. l.debug('konami has the modelInstance');
  9075. var n = [];
  9076. $(window).on('keydown', function (e) {
  9077. n.push(e.which),
  9078. n.length > o.secretPanelWord.length && n.shift(),
  9079. s.equalLists(n, o.secretPanelWord) &&
  9080. (l.debug('Developer mode active.'), (o.debug = !0));
  9081. }),
  9082. $(window).on('keydown', function n(r) {
  9083. o.debug &&
  9084. 72 === r.which &&
  9085. (e && i
  9086. ? (a.toggle(e, t, i), $(window).off('keydown', n))
  9087. : console.warn("sorry we're not ready yet"));
  9088. });
  9089. }
  9090. var r = e('./../util/logger'),
  9091. o = e('./../settings'),
  9092. a = e('./debug'),
  9093. s = e('./../util/common'),
  9094. l = (e('./gui'), new r(i));
  9095. o.console && $('body').append('<div id="debug-console"></div>'), (t.exports.init = n);
  9096. }.call(this, '/js/gui/konami.js'));
  9097. },
  9098. {
  9099. './../settings': 166,
  9100. './../util/common': 185,
  9101. './../util/logger': 189,
  9102. './debug': 63,
  9103. './gui': 65,
  9104. },
  9105. ],
  9106. 71: [
  9107. function (e, t, i) {
  9108. 'use strict';
  9109. function n(e, t) {
  9110. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode;
  9111. }
  9112. function r(e) {
  9113. var t = $.Deferred();
  9114. e || t.resolve();
  9115. var i = c.startupFlyinDelay;
  9116. return (
  9117. e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  9118. setTimeout(t.resolve.bind(t), i),
  9119. t
  9120. );
  9121. }
  9122. function o(e, t, i) {
  9123. var n = 0;
  9124. c.quickstart.enabled &&
  9125. (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay));
  9126. var r = function () {
  9127. e.once(g.Move, l), t.once(f.TourStart, l);
  9128. };
  9129. s(n, r);
  9130. }
  9131. function a(e) {
  9132. return; /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  9133. v.before(y),
  9134. A = $(".quick-brand").toArray()),*/
  9135. m.addClass('fadeOut'),
  9136. setTimeout(function () {
  9137. A.forEach(function (e) {
  9138. e.classList.add('fadeIn');
  9139. });
  9140. }, c.quickstart.showTextDelay),
  9141. setTimeout(function () {
  9142. A.forEach(function (e) {
  9143. e.classList.add('fadeOut');
  9144. });
  9145. }, c.quickstart.fadeOutDelay),
  9146. !0;
  9147. }
  9148. function s(e, t) {
  9149. setTimeout(function () {
  9150. if (h.isHelpEnabled()) {
  9151. if (
  9152. (t(),
  9153. u.init(),
  9154. C.addClass('fadeIn landing ' + u.deviceType),
  9155. h.isSmallHelpEnabled())
  9156. )
  9157. return void C.addClass('small');
  9158. u.fill(I, d.LANDING[E]), C.addClass(E);
  9159. }
  9160. }, e);
  9161. //csz 用户引导界面
  9162. var helpData = {
  9163. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  9164. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png'],
  9165. };
  9166. var navIcon = $('.nav-icon .icon');
  9167. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
  9168. navIcon.attr('src', helpData.mobile[0]);
  9169. function paging(id) {
  9170. id.on('click', function () {
  9171. var navPage = null;
  9172. $(this).attr('data-id') == 'plus'
  9173. ? (navPage = +navIcon.attr('data-page') + 1)
  9174. : (navPage = +navIcon.attr('data-page') - 1);
  9175. if (navPage > helpData.length || navPage < 1) return false;
  9176. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  9177. navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] });
  9178. } else {
  9179. navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] });
  9180. }
  9181. });
  9182. }
  9183. paging($('.next-button'));
  9184. paging($('.prev-button'));
  9185. }
  9186. function l() {
  9187. u.clear(I, d.LANDING[E]), C.removeClass('fadeIn');
  9188. }
  9189. var c = e('../settings'),
  9190. h = (e('./help/help'), e('./helpManager')),
  9191. u = e('./populateModal'),
  9192. d = e('../enum/HelpModalType'),
  9193. p = e('../enum/Viewmode'),
  9194. f = e('../enum/DirectorEvents'),
  9195. g = e('../enum/PlayerEvents'),
  9196. m = $('#quick-blackout').eq(0),
  9197. v = $('#quick-logo').eq(0),
  9198. A = $('.quick-brand').toArray(),
  9199. y = $('#loaderCoBrand').eq(0),
  9200. C = $('#interaction-modal').eq(0),
  9201. I = C.find('.interaction').toArray(),
  9202. E =
  9203. ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  9204. '');
  9205. (t.exports.delayLanding = r),
  9206. (t.exports.showMessage = o),
  9207. (t.exports.init = n),
  9208. (t.exports.dismissModal = l);
  9209. },
  9210. {
  9211. '../enum/DirectorEvents': 23,
  9212. '../enum/HelpModalType': 28,
  9213. '../enum/PlayerEvents': 40,
  9214. '../enum/Viewmode': 51,
  9215. '../settings': 166,
  9216. './help/help': 67,
  9217. './helpManager': 68,
  9218. './populateModal': 75,
  9219. },
  9220. ],
  9221. 72: [
  9222. function (e, t, i) {
  9223. 'use strict';
  9224. var n = e('./circleLoader').circleLoader;
  9225. t.exports = {
  9226. element: $('#gui-loading'),
  9227. hide: function (e) {
  9228. n.done(), this.element.fadeOut(1500, e);
  9229. },
  9230. show: function (e) {
  9231. this.element.fadeIn(
  9232. 500,
  9233. function () {
  9234. this.element.css('display', 'table'), e && e();
  9235. }.bind(this)
  9236. );
  9237. },
  9238. progress: function (e) {
  9239. n.set(e);
  9240. },
  9241. };
  9242. },
  9243. {
  9244. './circleLoader': 60,
  9245. },
  9246. ],
  9247. 73: [
  9248. function (e, t, i) {
  9249. 'use strict';
  9250. var n = e('../settings'),
  9251. r = $('#memory-info'),
  9252. o = r.find('#memory-gpu'),
  9253. a = !1;
  9254. t.exports = {
  9255. show: function () {
  9256. n.profiling.enabled && (r.show(), (a = !0));
  9257. },
  9258. hide: function () {
  9259. r.hide(), (a = !1);
  9260. },
  9261. toggle: function () {
  9262. a ? this.hide() : this.show();
  9263. },
  9264. update: function (e) {
  9265. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB');
  9266. },
  9267. };
  9268. },
  9269. {
  9270. '../settings': 166,
  9271. },
  9272. ],
  9273. 74: [
  9274. function (e, t, i) {
  9275. 'use strict';
  9276. var n = e('../util/browser'),
  9277. r = e('../analytics');
  9278. e('../settings');
  9279. t.exports = {
  9280. show: function (e, t) {
  9281. $('#gui-message').fadeOut(500, function () {
  9282. t();
  9283. });
  9284. },
  9285. };
  9286. },
  9287. {
  9288. '../analytics': 4,
  9289. '../settings': 166,
  9290. '../util/browser': 182,
  9291. },
  9292. ],
  9293. 75: [
  9294. function (e, t, i) {
  9295. 'use strict';
  9296. function n(e, t, i, n) {
  9297. function r(e) {
  9298. return e.classList.contains(a);
  9299. }
  9300. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  9301. //for (var a in o) {
  9302. //var s = e.find(r);
  9303. //for (var l in o[a]) {
  9304. //var c = o[a][l];
  9305. //if ("top-info" === l || "bottom-info" === l) {
  9306. //var h = n ? c : "";
  9307. //czj 注释掉第一次打开的用户引导
  9308. //s.querySelector("." + l).textContent = h
  9309. //} else {
  9310. //var u = n ? c : "";
  9311. //, d = s.querySelector("." + l);
  9312. //d.src = u,
  9313. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  9314. //}
  9315. //}
  9316. //}
  9317. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  9318. // p.forEach(function(e) {
  9319. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  9320. // })
  9321. }
  9322. var r = e('../util/browser'),
  9323. o = e('../localization/localize'),
  9324. a = e('../enum/HelpModalType'),
  9325. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'));
  9326. t.exports = {
  9327. init: function () {
  9328. if (!this.hasInitialized) {
  9329. (this.hasInitialized = !0),
  9330. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  9331. (this.assets = {}),
  9332. (this.assets[a.LANDING[s.PANORAMA]] = {
  9333. desktop: {
  9334. left: {
  9335. 'top-info': o.ROTATE,
  9336. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9337. keyboard: 'images/nav_help_keyboard_left_right.png',
  9338. },
  9339. middle: {
  9340. 'top-info': o.MOVE,
  9341. 'big-image': 'images/nav_help_mouse_click.png',
  9342. keyboard: 'images/nav_help_keyboard_up_down.png',
  9343. },
  9344. right: {
  9345. 'top-info': o.ZOOM,
  9346. 'big-image': 'images/nav_help_mouse_zoom.png',
  9347. keyboard: 'images/nav_help_zoom_keys.png',
  9348. },
  9349. },
  9350. mobile: {
  9351. left: {
  9352. 'top-info': o.ROTATE,
  9353. 'big-image': 'images/nav_help_gesture_drag.png',
  9354. },
  9355. middle: {
  9356. 'top-info': o.MOVE,
  9357. 'big-image': 'images/nav_help_gesture_tap.png',
  9358. },
  9359. right: {
  9360. 'top-info': o.ZOOM,
  9361. 'big-image': 'images/nav_help_gesture_pinch.png',
  9362. },
  9363. },
  9364. }),
  9365. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
  9366. JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
  9367. )),
  9368. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  9369. desktop: {
  9370. left: {
  9371. 'top-info': o.ROTATE,
  9372. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9373. keyboard: 'images/nav_help_keyboard_left_right.png',
  9374. },
  9375. middle: {
  9376. 'top-info': o.MOVE,
  9377. 'big-image': 'images/nav_help_mouse_position_right.png',
  9378. },
  9379. },
  9380. mobile: {
  9381. left: {
  9382. 'top-info': o.ROTATE,
  9383. 'big-image': 'images/nav_help_gesture_drag.png',
  9384. },
  9385. middle: {
  9386. 'top-info': o.MOVE,
  9387. 'big-image': 'images/nav_help_gesture_position_two_finger.png',
  9388. },
  9389. },
  9390. }),
  9391. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  9392. desktop: {
  9393. left: {
  9394. 'top-info': o.MOVE,
  9395. 'big-image': 'images/nav_help_mouse_position_left.png',
  9396. },
  9397. middle: {
  9398. 'top-info': o.ROTATE,
  9399. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9400. keyboard: 'images/nav_help_keyboard_left_right.png',
  9401. },
  9402. },
  9403. mobile: {
  9404. left: {
  9405. 'top-info': o.MOVE,
  9406. 'big-image': 'images/nav_help_gesture_position.png',
  9407. },
  9408. middle: {
  9409. 'top-info': o.ROTATE,
  9410. 'big-image': 'images/nav_help_gesture_drag_two_finger.png',
  9411. },
  9412. },
  9413. });
  9414. var e = {
  9415. 'top-info': o.INSIDE,
  9416. 'big-image': 'images/nav_help_click_inside.png',
  9417. keyboard: 'images/nav_help_inside_key.png',
  9418. };
  9419. (this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
  9420. (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
  9421. (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e);
  9422. var t = {
  9423. 'top-info': o.INSIDE,
  9424. 'big-image': 'images/nav_help_tap_inside.png',
  9425. };
  9426. (this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  9427. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  9428. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  9429. (this.assets[a.NAVIGATION] = {}),
  9430. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  9431. desktop: {
  9432. left: {
  9433. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  9434. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  9435. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9436. keyboard: 'images/nav_help_keyboard_left_right.png',
  9437. },
  9438. middle: {
  9439. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  9440. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  9441. 'big-image': 'images/nav_help_mouse_click.png',
  9442. keyboard: 'images/nav_help_keyboard_up_down.png',
  9443. },
  9444. right: {
  9445. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  9446. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  9447. 'big-image': 'images/nav_help_mouse_zoom.png',
  9448. keyboard: 'images/nav_help_zoom_keys.png',
  9449. },
  9450. },
  9451. mobile: {
  9452. left: {
  9453. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  9454. 'big-image': 'images/nav_help_gesture_drag.png',
  9455. },
  9456. middle: {
  9457. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  9458. 'big-image': 'images/nav_help_gesture_tap.png',
  9459. },
  9460. right: {
  9461. 'top-info': o.HELP_MOBILE_3,
  9462. 'big-image': 'images/nav_help_gesture_pinch.png',
  9463. },
  9464. },
  9465. }),
  9466. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  9467. desktop: {
  9468. left: {
  9469. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  9470. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  9471. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9472. keyboard: 'images/nav_help_keyboard_all.png',
  9473. },
  9474. middle: {
  9475. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  9476. 'big-image': 'images/nav_help_mouse_position_right.png',
  9477. },
  9478. right: {
  9479. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  9480. 'big-image': 'images/nav_help_mouse_zoom.png',
  9481. },
  9482. },
  9483. mobile: {
  9484. left: {
  9485. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  9486. 'big-image': 'images/nav_help_gesture_drag.png',
  9487. },
  9488. middle: {
  9489. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  9490. 'big-image': 'images/nav_help_gesture_position_two_finger.png',
  9491. },
  9492. right: {
  9493. 'top-info': o.HELP_MOBILE_3,
  9494. 'big-image': 'images/nav_help_gesture_pinch.png',
  9495. },
  9496. },
  9497. }),
  9498. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  9499. desktop: {
  9500. left: {
  9501. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  9502. 'big-image': 'images/nav_help_mouse_position_left.png',
  9503. },
  9504. middle: {
  9505. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  9506. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  9507. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9508. keyboard: 'images/nav_help_keyboard_left_right.png',
  9509. },
  9510. right: {
  9511. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  9512. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  9513. 'big-image': 'images/nav_help_mouse_zoom.png',
  9514. keyboard: 'images/nav_help_keyboard_up_down.png',
  9515. },
  9516. },
  9517. mobile: {
  9518. left: {
  9519. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  9520. 'big-image': 'images/nav_help_gesture_position.png',
  9521. },
  9522. middle: {
  9523. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  9524. 'big-image': 'images/nav_help_gesture_drag_two_finger.png',
  9525. },
  9526. right: {
  9527. 'top-info': o.HELP_MOBILE_3,
  9528. 'big-image': 'images/nav_help_gesture_pinch.png',
  9529. },
  9530. },
  9531. }),
  9532. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
  9533. JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
  9534. )),
  9535. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  9536. 'top-info': o.HELP_DESKTOP_360_2A,
  9537. 'bottom-info': o.HELP_DESKTOP_360_2B,
  9538. 'big-image': 'images/nav_help_click_inside.png',
  9539. keyboard: 'images/nav_help_inside_key.png',
  9540. }),
  9541. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  9542. 'top-info': o.HELP_MOBILE_360_2,
  9543. 'big-image': 'images/nav_help_tap_inside.png',
  9544. }),
  9545. (this.assets[a.MORE_HELP] = {
  9546. desktop: {
  9547. 'more-help-hlr': {
  9548. 'top-info': o.HELP_MORE_HLR_A,
  9549. 'big-image': 'images/nav_help_expand.svg',
  9550. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B,
  9551. },
  9552. 'more-help-dollhouse': {
  9553. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9554. 'big-image': 'images/nav_help_dollhouse.svg',
  9555. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B,
  9556. },
  9557. 'more-help-floors': {
  9558. 'top-info': o.HELP_MORE_FLOORS_A,
  9559. 'big-image': 'images/nav_help_floor picker.svg',
  9560. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B,
  9561. },
  9562. 'more-help-tag': {
  9563. 'top-info': o.HELP_MORE_TAG_A,
  9564. 'big-image': 'images/nav_help_tag.svg',
  9565. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B,
  9566. },
  9567. 'more-help-zoom': {
  9568. 'top-info': o.HELP_MORE_ZOOM_A,
  9569. 'big-image': 'images/nav_help_zoom.svg',
  9570. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B,
  9571. },
  9572. 'more-help-tour': {
  9573. 'top-info': o.HELP_MORE_TOUR_A,
  9574. 'big-image': 'images/nav_help_play.png',
  9575. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B,
  9576. },
  9577. 'more-help-inside': {
  9578. 'top-info': o.HELP_MORE_INSIDE_A,
  9579. 'big-image': 'images/nav_help_inside.svg',
  9580. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B,
  9581. },
  9582. 'more-help-vr': {
  9583. 'top-info': o.HELP_MORE_VR_A,
  9584. 'big-image': 'images/nav_help_vr.svg',
  9585. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B,
  9586. },
  9587. 'more-help-360': {
  9588. 'top-info': o.HELP_MORE_360_A,
  9589. 'big-image': 'images/nav_help_360.svg',
  9590. 'bottom-info': o.HELP_DESKTOP_MORE_360_B,
  9591. },
  9592. 'more-help-fullscreen': {
  9593. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  9594. 'big-image': 'images/nav_help_fullscreen.svg',
  9595. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B,
  9596. },
  9597. },
  9598. mobile: {
  9599. 'more-help-hlr': {
  9600. 'top-info': o.HELP_MORE_HLR_A,
  9601. 'big-image': 'images/nav_help_expand.svg',
  9602. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B,
  9603. },
  9604. 'more-help-dollhouse': {
  9605. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9606. 'big-image': 'images/nav_help_dollhouse.svg',
  9607. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B,
  9608. },
  9609. 'more-help-floors': {
  9610. 'top-info': o.HELP_MORE_FLOORS_A,
  9611. 'big-image': 'images/nav_help_floor picker.svg',
  9612. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B,
  9613. },
  9614. 'more-help-tag': {
  9615. 'top-info': o.HELP_MORE_TAG_A,
  9616. 'big-image': 'images/nav_help_tag.svg',
  9617. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B,
  9618. },
  9619. 'more-help-tour': {
  9620. 'top-info': o.HELP_MORE_TOUR_A,
  9621. 'big-image': 'images/nav_help_play.png',
  9622. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B,
  9623. },
  9624. 'more-help-inside': {
  9625. 'top-info': o.HELP_MORE_INSIDE_A,
  9626. 'big-image': 'images/nav_help_inside.svg',
  9627. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B,
  9628. },
  9629. 'more-help-vr': {
  9630. 'top-info': o.HELP_MORE_VR_A,
  9631. 'big-image': 'images/webvr.svg',
  9632. 'bottom-info': o.HELP_MOBILE_MORE_VR_B,
  9633. },
  9634. 'more-help-360': {
  9635. 'top-info': o.HELP_MORE_360_A,
  9636. 'big-image': 'images/nav_help_360.svg',
  9637. 'bottom-info': o.HELP_MOBILE_MORE_360_B,
  9638. },
  9639. },
  9640. }),
  9641. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  9642. desktop: {
  9643. left: {
  9644. 'top-info': o.ROTATE,
  9645. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9646. keyboard: 'images/nav_help_keyboard_left_right.png',
  9647. },
  9648. middle: {
  9649. 'top-info': o.MOVE,
  9650. 'big-image': 'images/nav_help_mouse_click.png',
  9651. keyboard: 'images/nav_help_keyboard_up_down.png',
  9652. },
  9653. right: {
  9654. 'top-info': o.PLAY,
  9655. 'big-image': 'images/Desktop-help-play-button.svg',
  9656. keyboard: 'images/Desktop-help-spacebar-2.svg',
  9657. },
  9658. },
  9659. mobile: {
  9660. left: {
  9661. 'top-info': o.ROTATE,
  9662. 'big-image': 'images/nav_help_gesture_drag.png',
  9663. },
  9664. middle: {
  9665. 'top-info': o.MOVE,
  9666. 'big-image': 'images/nav_help_gesture_tap.png',
  9667. },
  9668. right: {
  9669. 'top-info': o.PLAY,
  9670. 'big-image': 'images/mobile-help-play-button.svg',
  9671. },
  9672. },
  9673. }),
  9674. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
  9675. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
  9676. )),
  9677. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
  9678. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  9679. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
  9680. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  9681. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
  9682. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
  9683. )),
  9684. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
  9685. this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  9686. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
  9687. this.assets[a.LANDING[s.FLOORPLAN]].mobile.left);
  9688. }
  9689. },
  9690. fill: function (e, t, i) {
  9691. n.call(this, e, t, i, !0);
  9692. },
  9693. clear: function (e, t, i) {
  9694. n.call(this, e, t, i, !1);
  9695. },
  9696. };
  9697. },
  9698. {
  9699. '../enum/HelpModalSize': 27,
  9700. '../enum/HelpModalType': 28,
  9701. '../enum/Viewmode': 51,
  9702. '../localization/localize': 108,
  9703. '../util/browser': 182,
  9704. },
  9705. ],
  9706. 76: [
  9707. function (e, t, i) {
  9708. 'use strict';
  9709. t.exports = Object.freeze({
  9710. OPENED: 'share.open',
  9711. CLOSED: 'share.closed',
  9712. LINK_CLICKED: 'share.linked',
  9713. });
  9714. },
  9715. {},
  9716. ],
  9717. 77: [
  9718. function (e, t, i) {
  9719. 'use strict';
  9720. function n(e) {
  9721. function t(t, i) {
  9722. var n = window.screenY + ($('#player').height() - i) / 2,
  9723. r = window.screenX + ($('#player').width() - t) / 2,
  9724. o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i;
  9725. I.emit(l.LINK_CLICKED, {
  9726. channel: e,
  9727. }),
  9728. window.open(C[e], 'shareWindow', o);
  9729. }
  9730. switch (e) {
  9731. case y.FACEBOOK:
  9732. t(580, 420);
  9733. break;
  9734. case y.TWITTER:
  9735. t(550, 440);
  9736. break;
  9737. case y.MAIL:
  9738. I.emit(l.LINK_CLICKED, {
  9739. channel: 'email',
  9740. }),
  9741. window.open(C[e], '_blank');
  9742. break;
  9743. case y.LINKEDIN:
  9744. }
  9745. }
  9746. function r(e) {
  9747. I.emit(l.LINK_CLICKED, {
  9748. channel: 'copylink',
  9749. });
  9750. var t = document.createRange();
  9751. t.selectNodeContents(v);
  9752. var i = window.getSelection();
  9753. i.removeAllRanges(),
  9754. i.addRange(t),
  9755. document.execCommand('copy'),
  9756. A.classList.remove('hidden'),
  9757. v.classList.add('highlighted');
  9758. }
  9759. function o(e) {
  9760. (e && (e.stopPropagation(), e.target === v)) ||
  9761. (window.getSelection().removeAllRanges(),
  9762. v.classList.remove('highlighted'),
  9763. A.classList.add('hidden'));
  9764. }
  9765. var a = e('../../util/browser'),
  9766. s = e('../../localization/localize'),
  9767. l = e('./ShareEvents'),
  9768. c = e('../../util/common'),
  9769. h = e('events').EventEmitter,
  9770. u = document.getElementById('sharing'),
  9771. d = document.getElementById('share-modal'),
  9772. p = document.getElementById('share-close'),
  9773. f = document.getElementById('facebook-share'),
  9774. g = document.getElementById('twitter-share'),
  9775. m = document.getElementById('mail-share'),
  9776. v = document.getElementById('share-url-text'),
  9777. A = document.getElementById('copy-success'),
  9778. y = Object.freeze({
  9779. FACEBOOK: 'facebook',
  9780. TWITTER: 'twitter',
  9781. MAIL: 'mail',
  9782. LINKEDIN: 'linkedin',
  9783. }),
  9784. C = {};
  9785. (C[y.FACEBOOK] =
  9786. 'http://www.facebook.com/sharer.php?u=' +
  9787. encodeURIComponent(window.location.href + '&utm_source=1') +
  9788. '&t='),
  9789. (C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  9790. (C[y.MAIL] = 'mailto:?subject=');
  9791. var I = {
  9792. init: function (e) {
  9793. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ');
  9794. (C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  9795. (C[y.TWITTER] +=
  9796. t +
  9797. encodeURIComponent(
  9798. window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port'
  9799. )),
  9800. (C[y.MAIL] +=
  9801. encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
  9802. '&body=' +
  9803. t +
  9804. encodeURIComponent(window.location.href + '&utm_source=3')),
  9805. u.addEventListener('click', this.toggle.bind(this)),
  9806. p.addEventListener('click', this.hide.bind(this)),
  9807. v.addEventListener('click', r),
  9808. d.addEventListener('click', o),
  9809. f.addEventListener('click', n.bind(this, y.FACEBOOK)),
  9810. g.addEventListener('click', n.bind(this, y.TWITTER)),
  9811. m.addEventListener('click', n.bind(this, y.MAIL)),
  9812. (v.textContent = window.location.href + '&utm_source=4'),
  9813. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  9814. u.classList.remove('hidden');
  9815. },
  9816. show: function () {
  9817. this.emit(l.OPENED), d.classList.add('fadeIn');
  9818. },
  9819. hide: function () {
  9820. d.classList.contains('fadeIn') &&
  9821. (this.emit(l.CLOSED),
  9822. document.selection && document.selection.empty(),
  9823. window.getSelection().removeAllRanges(),
  9824. o(),
  9825. d.classList.remove('fadeIn'));
  9826. },
  9827. toggle: function () {
  9828. d.classList.contains('fadeIn') ? this.hide() : this.show();
  9829. },
  9830. };
  9831. c.extendObject(I, h.prototype), (t.exports = I);
  9832. },
  9833. {
  9834. '../../localization/localize': 108,
  9835. '../../util/browser': 182,
  9836. '../../util/common': 185,
  9837. './ShareEvents': 76,
  9838. events: 202,
  9839. },
  9840. ],
  9841. 78: [
  9842. function (e, t, i) {
  9843. 'use strict';
  9844. t.exports = Object.freeze({
  9845. OPENED: 'terms.opened',
  9846. CLOSED: 'terms.closed',
  9847. });
  9848. },
  9849. {},
  9850. ],
  9851. 79: [
  9852. function (e, t, i) {
  9853. 'use strict';
  9854. var n = e('./TermsEvent'),
  9855. r = e('../../localization/localize'),
  9856. o = e('../../analytics'),
  9857. a = e('../../util/ajax'),
  9858. s = e('../../util/common'),
  9859. l = e('events').EventEmitter,
  9860. c = document.getElementById('terms-modal'),
  9861. h = {
  9862. init: function () {
  9863. $('.footer-terms').on(
  9864. 'click',
  9865. function (e) {
  9866. e.preventDefault(), this.show();
  9867. }.bind(this)
  9868. ),
  9869. $('#terms-modal .close').on('click', this.hide.bind(this));
  9870. },
  9871. show: function () {
  9872. this.emit(n.OPENED),
  9873. a
  9874. .get('static/' + r.TERMS_TEXT_FILE)
  9875. .done(function (e) {
  9876. var t = $('#terms-text').html(e);
  9877. o.track('showcase_gui', {
  9878. gui_action: 'click_terms_button',
  9879. interaction_source: 'gui',
  9880. }),
  9881. t.find('a').attr('target', '_blank');
  9882. })
  9883. .fail(function () {
  9884. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL);
  9885. }),
  9886. c.classList.add('fadeIn');
  9887. },
  9888. hide: function (e) {
  9889. e && e.preventDefault(),
  9890. c.classList.contains('fadeIn') && this.emit(n.CLOSED),
  9891. c.classList.remove('fadeIn');
  9892. },
  9893. };
  9894. s.extendObject(h, l.prototype), (t.exports = h);
  9895. },
  9896. {
  9897. '../../analytics': 4,
  9898. '../../localization/localize': 108,
  9899. '../../util/ajax': 181,
  9900. '../../util/common': 185,
  9901. './TermsEvent': 78,
  9902. events: 202,
  9903. },
  9904. ],
  9905. 80: [
  9906. function (e, t, i) {
  9907. 'use strict';
  9908. t.exports = Object.freeze({
  9909. OPEN_INFO: 'title.open.info',
  9910. CLOSE_INFO: 'title.close.info',
  9911. SHOW_INFO: 'title.show.info',
  9912. HIDE_INFO: 'title.hide.info',
  9913. LINK_CLICKED: 'title.link.click',
  9914. CONTACT_LINK_CLICKED: 'title.contact.click',
  9915. ORIGIN_LINK_CLICKED: 'title.origin.click',
  9916. });
  9917. },
  9918. {},
  9919. ],
  9920. 81: [
  9921. function (e, t, i) {
  9922. 'use strict';
  9923. function n(e, t) {
  9924. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t);
  9925. }
  9926. function r(e, t) {
  9927. function i(i) {
  9928. (e.shouldShowtags = 'show' === this.value),
  9929. e.shouldShowtags
  9930. ? t.showAlltags(o.tags.startup.fadeInDuration)
  9931. : t.hideAlltags(o.tags.startup.fadeInDuration);
  9932. }
  9933. document.getElementById('tag-toggles').classList.remove('hidden'),
  9934. (document.getElementById('radio-tag-show').checked = !0);
  9935. for (
  9936. var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0;
  9937. r < n.length;
  9938. r++
  9939. )
  9940. n[r].addEventListener('change', i);
  9941. }
  9942. var o = e('../../settings');
  9943. t.exports.init = n;
  9944. },
  9945. {
  9946. '../../settings': 166,
  9947. },
  9948. ],
  9949. 82: [
  9950. function (e, t, i) {
  9951. (function (i) {
  9952. 'use strict';
  9953. function n(e, t) {
  9954. return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
  9955. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  9956. (g_weixinObj.title = e),
  9957. e.length > g.minTooltipCharacters &&
  9958. I.parentElement.setAttribute('data-original-title', e),
  9959. t && 1 !== m.specialEdition && m.brand && !m.mls
  9960. ? (document.getElementById('cobrandTitle').innerText = t)
  9961. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  9962. document.getElementById('gui-name').classList.add('noCoBrand'),
  9963. document.getElementById('cobrandTitle').classList.add('hidden')),
  9964. !0)
  9965. : (document.getElementById('model-title').classList.add('hidden'), !1);
  9966. }
  9967. function r(e) {
  9968. return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden');
  9969. }
  9970. function o(e, t, i, n) {
  9971. if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1))
  9972. return void T.classList.add('hidden');
  9973. L = !0;
  9974. var r = [],
  9975. o = c(r, '<br>');
  9976. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  9977. var a = n || t,
  9978. s = u.isMobile()
  9979. ? '<a id="phone" href="callto:' + t + '">' + a + '</a>'
  9980. : '<span>' + a + '</span>';
  9981. o(s);
  9982. }
  9983. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'),
  9984. (r[0] = ''),
  9985. (x.innerHTML = r.join(''));
  9986. }
  9987. function a(e) {
  9988. if ('string' == typeof e)
  9989. try {
  9990. e = JSON.parse(e);
  9991. } catch (e) {
  9992. return (
  9993. y.warn('Unable to parse address data'),
  9994. void S.parentElement.classList.add('hidden')
  9995. );
  9996. }
  9997. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9998. return void S.parentElement.classList.add('hidden');
  9999. L = !0;
  10000. var t = [],
  10001. i = c(t, ' ');
  10002. e.address_1 && i(e.address_1),
  10003. e.address_2 && i(e.address_2),
  10004. e.city && i(e.city, ', '),
  10005. e.state && i(e.state, ', '),
  10006. e.zip && i(e.zip, e.state ? ' ' : ', '),
  10007. (t[0] = ''),
  10008. (S.innerText = t.join(''));
  10009. }
  10010. function s(e) {
  10011. var t = document.createElement('a');
  10012. return (
  10013. (t.id = 'url'),
  10014. (t.target = '_blank'),
  10015. (t.href = e),
  10016. (t.innerText = e),
  10017. t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  10018. t
  10019. );
  10020. }
  10021. function l(e) {
  10022. return (
  10023. !(!e || (u.inIframe() && document.referrer === e)) &&
  10024. (R.classList.remove('hidden'),
  10025. (P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
  10026. P.appendChild(s(e)),
  10027. O.forEach(function (e) {
  10028. e.classList.add('share-link');
  10029. }),
  10030. !0)
  10031. );
  10032. }
  10033. function c(e, t) {
  10034. var i = e,
  10035. n = t;
  10036. return function (e, t) {
  10037. i.push(t || n, e);
  10038. };
  10039. }
  10040. function h() {
  10041. document
  10042. .getElementById('title-toggle')
  10043. .addEventListener('click', N.toggleTitle.bind(N)),
  10044. L && I.addEventListener('click', N.toggleMeta.bind(N, !1));
  10045. var e = [].slice.call(_.querySelectorAll('a'));
  10046. e.forEach(function (e) {
  10047. e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED));
  10048. });
  10049. var t = [].slice.call(T.querySelectorAll('a'));
  10050. t.forEach(function (e) {
  10051. e.addEventListener(
  10052. 'click',
  10053. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  10054. contact_type: e.getAttribute('id'),
  10055. })
  10056. );
  10057. });
  10058. }
  10059. var u = e('../../util/browser'),
  10060. d = e('../../util/common'),
  10061. p = e('../../util/logger'),
  10062. f = e('../../localization/localize'),
  10063. g = e('./titleBarSettings'),
  10064. m = e('../../settings'),
  10065. v = e('./TitleEvents'),
  10066. A = e('events').EventEmitter,
  10067. y = new p(i),
  10068. C = document.querySelector('.pinTop.left'),
  10069. I = document.getElementsByClassName('title-container')[0],
  10070. E = document.getElementById('title-toggle').querySelector('i'),
  10071. b = document.getElementById('meta-info-wrapper'),
  10072. w = document.getElementById('meta-info'),
  10073. _ = document.getElementById('meta-description'),
  10074. T = document.getElementsByClassName('contact-info')[0],
  10075. x = document.getElementById('contact-data'),
  10076. S = document.getElementById('addressTxt'),
  10077. M = document.getElementById('tag-toggles'),
  10078. R = document.getElementById('share-origin'),
  10079. P = document.getElementById('share-link-wrapper'),
  10080. O = [w, b, I],
  10081. L = !1,
  10082. D = !1,
  10083. N = {
  10084. populate: function (e) {
  10085. if (n(window.DATA.name, e.coBrand)) {
  10086. if (
  10087. (r(e.description),
  10088. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  10089. a(e.address),
  10090. L)
  10091. ) {
  10092. var t = document.createElement('br');
  10093. M.insertBefore(t, M.firstElementChild);
  10094. }
  10095. e.socialSharing && m.share.enabled && (D = l(e.url));
  10096. }
  10097. },
  10098. finishSetup: function (e) {
  10099. (L = L || !!e),
  10100. h(),
  10101. L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'));
  10102. },
  10103. toggleMeta: function (e, t) {
  10104. var title = document.getElementById('model-title');
  10105. t && t.preventDefault();
  10106. var i = w.classList.contains('expand');
  10107. (e && !i) ||
  10108. (i
  10109. ? (O.forEach(function (e) {
  10110. e.classList.remove('expand');
  10111. }),
  10112. this.emit(v.CLOSE_INFO),
  10113. title.classList.remove('expand'))
  10114. : (O.forEach(function (e) {
  10115. e.classList.add('expand');
  10116. }),
  10117. title.classList.add('expand'),
  10118. this.emit(v.OPEN_INFO)));
  10119. },
  10120. setupToggling: function () {
  10121. (b.style.height = w.offsetHeight + 'px'),
  10122. w.addEventListener('transitionend', function () {
  10123. b.style.height = w.offsetHeight + 'px';
  10124. });
  10125. },
  10126. toggleTitle: function (e) {
  10127. e && e.preventDefault(),
  10128. C.classList.contains('closed')
  10129. ? (C.classList.add('open'),
  10130. E.classList.remove('icon-dpad-right'),
  10131. E.classList.add('icon-dpad-left'),
  10132. this.emit(v.SHOW_INFO),
  10133. setTimeout(function () {
  10134. C.classList.remove('closed'), C.classList.remove('open');
  10135. }, g.removeAnimationClasses))
  10136. : (C.classList.add('closed'),
  10137. E.classList.remove('icon-dpad-left'),
  10138. E.classList.add('icon-dpad-right'),
  10139. this.emit(v.HIDE_INFO));
  10140. },
  10141. };
  10142. d.extendObject(N, A.prototype), (t.exports = N);
  10143. }.call(this, '/js/gui/title/titleBar.js'));
  10144. },
  10145. {
  10146. '../../localization/localize': 108,
  10147. '../../settings': 166,
  10148. '../../util/browser': 182,
  10149. '../../util/common': 185,
  10150. '../../util/logger': 189,
  10151. './TitleEvents': 80,
  10152. './titleBarSettings': 83,
  10153. events: 202,
  10154. },
  10155. ],
  10156. 83: [
  10157. function (e, t, i) {
  10158. 'use strict';
  10159. t.exports = Object.freeze({
  10160. minTooltipCharacters: 19,
  10161. removeAnimationClasses: 500,
  10162. });
  10163. },
  10164. {},
  10165. ],
  10166. 84: [
  10167. function (e, t, i) {
  10168. 'use strict';
  10169. function n(e) {
  10170. (C = e),
  10171. P.forEach(function (e) {
  10172. b.addEventListener(e, u.bind(this, !1), !0),
  10173. w.addEventListener(e, u.bind(this, !0), !0),
  10174. E.addEventListener(e, o, !0);
  10175. S.forEach(function (t) {
  10176. //会触发导览停止
  10177. t.addEventListener(e, a, !0);
  10178. });
  10179. $('#drawer img').on(e, a);
  10180. });
  10181. document.addEventListener('keydown', u.bind(this, !1), !0);
  10182. C.on(v.TourStart, function () {
  10183. E.classList.add('playing');
  10184. });
  10185. }
  10186. function r() {
  10187. // C.playTour(),
  10188. C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn');
  10189. }
  10190. function o() {
  10191. E.classList.contains('playing') &&
  10192. (C.stopTour(),
  10193. _.addClass('fadeIn'),
  10194. setTimeout(function () {
  10195. _.removeClass('fadeIn');
  10196. }, p.tourInteraction.showPauseButton),
  10197. O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
  10198. setTimeout(function () {
  10199. E.classList.remove('playing');
  10200. }, p.tourInteraction.allowNextClick));
  10201. }
  10202. function a() {
  10203. C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'));
  10204. }
  10205. function s() {
  10206. T.is(':visible') ? r() : o();
  10207. }
  10208. function l() {
  10209. x.hasClass('playing') &&
  10210. (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'));
  10211. }
  10212. function c() {
  10213. E.classList.remove('playing'), h();
  10214. }
  10215. function h() {
  10216. //去掉导览结束时的提示
  10217. /* if (!p.tourInteraction.disabled) {
  10218. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  10219. M.addClass("fadeIn tour " + m.deviceType);
  10220. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  10221. if (!p.tourInteraction.smallModal) {
  10222. var t;
  10223. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  10224. m.fill(R, A.TOUR_INTERACTION[t]),
  10225. M.addClass(t)
  10226. }
  10227. M.addClass(e)
  10228. } */
  10229. }
  10230. function u(e, t) {
  10231. if (t) {
  10232. var i = 'keydown' === t.type,
  10233. n = t.which === f.SPACE || C.tourIsPlaying;
  10234. (i && n) || e || (O = !0),
  10235. C.atEndOfTour() && d(),
  10236. !C.tourIsPlaying &&
  10237. C.tourInProgress &&
  10238. (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && a()),
  10239. i && n && s();
  10240. }
  10241. }
  10242. function d() {
  10243. M.removeClass('fadeIn');
  10244. }
  10245. var p = (e('../util/browser'), e('../settings')),
  10246. f = e('../enum/Keys'),
  10247. g = e('../enum/Viewmode'),
  10248. m = (e('./helpManager'), e('./populateModal')),
  10249. v = e('../enum/DirectorEvents'),
  10250. A = e('../enum/HelpModalType'),
  10251. y = e('../enum/HelpModalSize'),
  10252. C = null,
  10253. I = null,
  10254. E = document.getElementById('pause-overlay'),
  10255. b = document.getElementById('player'),
  10256. w = document.getElementById('gui'),
  10257. _ = $('#pause-icon').eq(0),
  10258. T = $('#play').eq(0),
  10259. x = $('#playHead').eq(0),
  10260. S = $(
  10261. '.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan'
  10262. ).toArray(),
  10263. M = $('#interaction-modal').eq(0),
  10264. R = $('#interaction-modal .interaction').toArray(),
  10265. P = ['touchstart', 'mousedown', 'pointerdown'],
  10266. O = !1;
  10267. (t.exports.init = n),
  10268. (t.exports.play = r),
  10269. (t.exports.pause = o),
  10270. (t.exports.pauseWithoutCTA = a),
  10271. (t.exports.togglePlay = s),
  10272. (t.exports.stopTour = l),
  10273. (t.exports.dismissModal = d);
  10274. },
  10275. {
  10276. '../enum/DirectorEvents': 23,
  10277. '../enum/HelpModalSize': 27,
  10278. '../enum/HelpModalType': 28,
  10279. '../enum/Keys': 30,
  10280. '../enum/Viewmode': 51,
  10281. '../settings': 166,
  10282. '../util/browser': 182,
  10283. './helpManager': 68,
  10284. './populateModal': 75,
  10285. },
  10286. ],
  10287. 85: [
  10288. function (e, t, i) {
  10289. 'use strict';
  10290. t.exports = Object.freeze({
  10291. OPENED: 'vr.modal.opened',
  10292. LAUNCH: 'vr.modal.launch',
  10293. CLOSED: 'vr.modal.closed',
  10294. NEXT: 'vr.modal.next',
  10295. PREV: 'vr.modal.prev',
  10296. STORE: 'vr.modal.store',
  10297. falseICECHOSEN: 'vr.modal.device',
  10298. });
  10299. },
  10300. {},
  10301. ],
  10302. 86: [
  10303. function (e, t, i) {
  10304. 'use strict';
  10305. function n(e, t, i) {
  10306. function n(e, t, n, r) {
  10307. function o() {
  10308. return p + '&m=' + t + '&display=' + e;
  10309. }
  10310. function s() {
  10311. var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
  10312. t = '&utm_source=' + u,
  10313. n = '&utm_showcase_session_id=' + i;
  10314. return e + t + n;
  10315. }
  10316. function l() {
  10317. return (
  10318. d +
  10319. '&sids=' +
  10320. t +
  10321. '&lsid=' +
  10322. t +
  10323. '&ln=' +
  10324. encodeURIComponent(n) +
  10325. '&ld=' +
  10326. encodeURIComponent(r) +
  10327. '&display=' +
  10328. e
  10329. );
  10330. }
  10331. return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s();
  10332. }
  10333. function r(e, t, i, r) {
  10334. var o = 'https://api.branch.io/v1/url',
  10335. a = n(e, t, i, r),
  10336. s = {
  10337. responseType: 'json',
  10338. data: {
  10339. branch_key: h.appConfig.branch_key,
  10340. data: {
  10341. m: t,
  10342. full_url: a,
  10343. $desktop_url: m,
  10344. $og_app_id: '331853976762864119',
  10345. $og_title: i,
  10346. $og_description: r,
  10347. $og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
  10348. $canonical_url: window.location.href,
  10349. },
  10350. },
  10351. };
  10352. c.post(o, s)
  10353. .done(function (t) {
  10354. f[e] = t.url;
  10355. })
  10356. .fail(
  10357. function (t) {
  10358. f[e] = t;
  10359. }.bind(this, a)
  10360. );
  10361. }
  10362. function o(e, t, i) {
  10363. for (var r in s) {
  10364. var o = s[r],
  10365. a = n(o, e, t, i);
  10366. f[o] = a;
  10367. }
  10368. }
  10369. var u = a.inIframe()
  10370. ? encodeURIComponent(document.referrer)
  10371. : encodeURIComponent(window.location.href),
  10372. d = g + '/vr/dlist/?ret=' + u,
  10373. p = g + '/vr/show/?ret=' + u,
  10374. m = '';
  10375. switch (e) {
  10376. case l.IOS:
  10377. r(s.CardboardIOS, t.sid, t.name, t.summary);
  10378. break;
  10379. default:
  10380. o(t.sid, t.name, t.summary);
  10381. }
  10382. }
  10383. function r(e) {
  10384. var t = f[e];
  10385. window.open(t, '_blank');
  10386. }
  10387. function o(e) {
  10388. var t = u[e];
  10389. window.open(t, '_blank');
  10390. }
  10391. var a = e('../../util/browser'),
  10392. s = e('../../enum/VRApps'),
  10393. l = e('../../enum/VRPlatforms'),
  10394. c = e('../../util/ajax'),
  10395. h = e('../../settings'),
  10396. u = {};
  10397. (u[s.CardboardAndroid] =
  10398. 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  10399. (u[s.CardboardIOS] =
  10400. 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  10401. (u[s.GearVR] =
  10402. 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=');
  10403. for (var d in s) {
  10404. var p = s[d];
  10405. u[p] += encodeURIComponent(document.referrer + '&display=' + p);
  10406. }
  10407. var f = {},
  10408. g = (function () {
  10409. var e = window.location.host;
  10410. return (
  10411. e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'),
  10412. 'https://' + e
  10413. );
  10414. })();
  10415. (t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o);
  10416. },
  10417. {
  10418. '../../enum/VRApps': 46,
  10419. '../../enum/VRPlatforms': 49,
  10420. '../../settings': 166,
  10421. '../../util/ajax': 181,
  10422. '../../util/browser': 182,
  10423. },
  10424. ],
  10425. 87: [
  10426. function (e, t, i) {
  10427. 'use strict';
  10428. function n(e) {
  10429. var t;
  10430. switch (e) {
  10431. case m.IOS:
  10432. return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1);
  10433. case m.Android:
  10434. return (
  10435. (t = p.androidVersion()),
  10436. t.major > 4 ||
  10437. (4 === t.major && t.minor > 4) ||
  10438. (4 === t.major && 4 === t.minor && t.patch >= 4)
  10439. );
  10440. }
  10441. return !1;
  10442. }
  10443. function r(e, t) {
  10444. function i(e) {
  10445. K.emit(A.STORE, {
  10446. type: e,
  10447. }),
  10448. f.launchStore(e);
  10449. }
  10450. function r(e) {
  10451. switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
  10452. case _.Title:
  10453. O.css('display', 'none'), L.text(u[e]), o(s);
  10454. break;
  10455. case _.Cardboard:
  10456. O.css('display', 'block'),
  10457. L.text(u[e]),
  10458. M.filter('.cardboard').off(),
  10459. M.filter('.gearvr').off(),
  10460. c(e, s),
  10461. h(H, X, Z);
  10462. break;
  10463. case _.Gear:
  10464. L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z);
  10465. break;
  10466. case _.pageCount:
  10467. T.removeClass('fadeIn'), K.emit(A.CLOSED);
  10468. }
  10469. B.filter("[src='']").hide();
  10470. }
  10471. var s = (function () {
  10472. return p.detectAndroid()
  10473. ? p.detectAndroidMobile() && n(m.Android)
  10474. ? (T.addClass('supported'), (w = '.show-supported'), m.Android)
  10475. : (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
  10476. : p.detectIPhone() || p.detectIPod()
  10477. ? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
  10478. : (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop);
  10479. })();
  10480. f.init(s, e, t), s !== m.Desktop && T.addClass('mobile');
  10481. var l = function (e) {
  10482. K.emit(A.LAUNCH, {
  10483. vr_platform: s,
  10484. vr_app: e,
  10485. }),
  10486. f.launch(e);
  10487. };
  10488. (q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  10489. (q.gear = l.bind(this, g.GearVR)),
  10490. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  10491. d(),
  10492. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  10493. $(w).show();
  10494. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  10495. y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done'];
  10496. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  10497. $('#vr').on('click', function (e) {
  10498. e.preventDefault();
  10499. player.FlyToMode('panorama', () => {
  10500. if (!window.vrEnabled) {
  10501. // 开启VR
  10502. window.vrEnabled = true;
  10503. this.classList.add('active');
  10504. $('#gui div').not('#vrOff').addClass('vrHide');
  10505. $('#vrOffImg').css({ display: 'inline-block' });
  10506. } else {
  10507. }
  10508. });
  10509. });
  10510. let exitVR = function () {
  10511. $('#gui div').not('#vrOff').removeClass('vrHide');
  10512. $('#vrOffImg').css({ display: 'none' });
  10513. $('#player canvas').css({ width: '', height: '' }); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  10514. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  10515. };
  10516. $('#vrOff').on('click', function () {
  10517. window.vrEnabled = false;
  10518. exitVR();
  10519. });
  10520. window.bus.addEventListener('exitWebXR', (e) => {
  10521. exitVR();
  10522. });
  10523. var I = 'https://my.port.com/vr/show/?m=' + e.sid;
  10524. s === m.IOS
  10525. ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS))
  10526. : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
  10527. $('.gearLink').on('click', i.bind(this, g.GearVR)),
  10528. $('span.modelLink').text(I),
  10529. O.on('click', function (e) {
  10530. K.emit(A.PREV), b--, r(b);
  10531. }),
  10532. L.on('click', function (e) {
  10533. L.text();
  10534. K.emit(A.NEXT, {
  10535. nextAction: y[b],
  10536. }),
  10537. b++,
  10538. r(b);
  10539. }),
  10540. T.find('.close').on('click', K.dismiss);
  10541. }
  10542. function o(e) {
  10543. switch (e) {
  10544. case m.Android:
  10545. M.filter('.cardboard').off().on('click', q.cardboardAndroid),
  10546. M.filter('.gearvr').off().on('click', q.gear),
  10547. s(H, G, 'logo-button', 'same-line');
  10548. break;
  10549. case m.UnsupportedAndroid:
  10550. s('', z, '', '');
  10551. break;
  10552. case m.IOS:
  10553. M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '');
  10554. break;
  10555. case m.Desktop:
  10556. M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)),
  10557. M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)),
  10558. s(H, G, 'logo-button', 'same-line'),
  10559. Q.cardboard();
  10560. }
  10561. }
  10562. function a(e) {
  10563. $('.p1, .p2, .p3').hide(),
  10564. x.insertAfter(S),
  10565. T.removeClass('front-page'),
  10566. T.removeClass('details-page'),
  10567. T.removeClass('lastPage'),
  10568. M.removeClass('logo-button'),
  10569. M.removeClass('same-line'),
  10570. S.removeClass('headsetOptions'),
  10571. R.attr('src', ''),
  10572. R.filter('.second').removeClass('gear'),
  10573. R.css('display', 'inline-block'),
  10574. R.off(),
  10575. P.filter('.second').css('display', ''),
  10576. D.css('display', 'none'),
  10577. $('.p' + (e + 1) + w).show(),
  10578. R.filter('.third').insertBefore(P.filter('.third'));
  10579. }
  10580. function s(e, t, i, n) {
  10581. T.addClass('front-page'),
  10582. R.filter('.first').attr('src', e),
  10583. R.filter('.second').attr('src', t),
  10584. M.filter('.first').addClass(i),
  10585. M.filter('.second').addClass(i),
  10586. M.addClass(n),
  10587. '.show-desktop' === w && S.insertAfter(x);
  10588. }
  10589. function l(e, t, i) {
  10590. S.addClass('headsetOptions'),
  10591. M.off(),
  10592. R.filter('.second').attr('src', t),
  10593. D.css('display', 'block'),
  10594. P.filter('.second').css('display', 'none'),
  10595. D.on('click', function () {
  10596. a(_.Title), o(m.Desktop);
  10597. }),
  10598. e &&
  10599. (K.emit(A.falseICECHOSEN, {
  10600. name: g.GearVR,
  10601. }),
  10602. R.filter('.first').attr('src', e),
  10603. R.filter('.second').addClass('gear'),
  10604. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10605. Q.gearvr()),
  10606. i &&
  10607. (K.emit(A.falseICECHOSEN, {
  10608. name: g.Cardboard,
  10609. }),
  10610. R.filter('.third').attr('src', i),
  10611. R.filter('.third').show(),
  10612. R.filter('.third').insertAfter(R.filter('.second')),
  10613. R.filter('.third').addClass('link'),
  10614. R.filter('.second').addClass('link'),
  10615. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10616. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
  10617. Q.cardboard());
  10618. }
  10619. function c(e, t) {
  10620. switch (t) {
  10621. case m.IOS:
  10622. (X = Y), (Z = j);
  10623. break;
  10624. case m.Desktop:
  10625. e === _.Cardboard
  10626. ? ((X = F),
  10627. (Z = U),
  10628. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10629. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
  10630. : ((X = V),
  10631. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10632. (Z = ''));
  10633. break;
  10634. default:
  10635. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W));
  10636. }
  10637. }
  10638. function h(e, t, i) {
  10639. T.find('.inner').addClass('details-page'),
  10640. T.addClass('details-page'),
  10641. R.filter('.first').attr('src', e),
  10642. R.filter('.second').attr('src', t),
  10643. R.filter('.third').attr('src', i);
  10644. }
  10645. function u() {
  10646. T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED));
  10647. }
  10648. function d() {
  10649. var e = p.aspectRatio() > 1 && p.isMobile();
  10650. T.toggleClass('landscape', e).toggleClass('portrait', !e),
  10651. T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
  10652. T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight);
  10653. }
  10654. var p = e('../../util/browser'),
  10655. f = e('./vrLink'),
  10656. g = e('../../enum/VRApps'),
  10657. m = e('../../enum/VRPlatforms'),
  10658. v = e('../../enum/VRPages'),
  10659. A = e('./vrEvent'),
  10660. y = (e('../../settings'), e('../../constants')),
  10661. C = e('../../localization/localize'),
  10662. I = e('../../util/common'),
  10663. E = e('events').EventEmitter,
  10664. b = 0,
  10665. w = null,
  10666. _ = v.standard,
  10667. T = $('.vr-popup'),
  10668. x = T.find('.vr-popup-body'),
  10669. S = T.find('.vr-images'),
  10670. M = T.find('.img-container'),
  10671. R = T.find('.vr-sm-image'),
  10672. P = M.find('.vr-img-caption'),
  10673. O = $('.vr-buttons').find('.prev-button'),
  10674. L = $('.vr-buttons').find('.next-button'),
  10675. D = S.find('.front-close'),
  10676. N = $('.vr-page'),
  10677. B = T.find('img'),
  10678. F = 'images/apple-store.png',
  10679. V = 'images/badge-oculus.png',
  10680. U = 'images/badge-cardboard.png',
  10681. k = 'images/logo-samsung.png',
  10682. H = 'images/headset-cardboard.png',
  10683. G = 'images/headset-gearvr.png',
  10684. z = 'images/ico-android-robot.png',
  10685. W = 'images/ico-gearvr.png',
  10686. j = 'images/ico-vr.png',
  10687. Y = 'images/apple-logo-white.svg',
  10688. X = null,
  10689. Z = null,
  10690. q = {},
  10691. K = {
  10692. init: r,
  10693. dismiss: u,
  10694. isDeviceSupported: n,
  10695. };
  10696. I.extendObject(K, E.prototype), $(window).resize(d);
  10697. var Q = (function () {
  10698. var e = P.filter('.first').find('.cardboard'),
  10699. t = P.filter('.first').find('.gearvr');
  10700. return {
  10701. cardboard: function () {
  10702. t.addClass('hidden'), e.removeClass('hidden');
  10703. },
  10704. gearvr: function () {
  10705. e.addClass('hidden'), t.removeClass('hidden');
  10706. },
  10707. };
  10708. })();
  10709. t.exports = K;
  10710. },
  10711. {
  10712. '../../constants': 8,
  10713. '../../enum/VRApps': 46,
  10714. '../../enum/VRPages': 48,
  10715. '../../enum/VRPlatforms': 49,
  10716. '../../localization/localize': 108,
  10717. '../../settings': 166,
  10718. '../../util/browser': 182,
  10719. '../../util/common': 185,
  10720. './vrEvent': 85,
  10721. './vrLink': 86,
  10722. events: 202,
  10723. },
  10724. ],
  10725. 88: [
  10726. function (e, t, i) {
  10727. 'use strict';
  10728. t.exports = Object.freeze({
  10729. OPENED: 'webvr.modal.opened',
  10730. SHOW_TERMS: 'webvr.footer.show.terms',
  10731. });
  10732. },
  10733. {},
  10734. ],
  10735. 89: [
  10736. function (e, t, i) {
  10737. (function (i) {
  10738. 'use strict';
  10739. function n(e, t, i, n) {
  10740. function r(e) {
  10741. e.preventDefault(), a(e.currentTarget.id);
  10742. }
  10743. function a(e) {
  10744. ne[e](),
  10745. Object.keys(ne).map(function (t, i) {
  10746. $('#' + t).toggleClass('tabs-underlined', t === e);
  10747. });
  10748. }
  10749. (y = i), (v = t), w.init(E.Android, e, n), m();
  10750. var l = new RegExp('daydream', 'i'),
  10751. c = l.test(y.displayName);
  10752. c
  10753. ? (a('tabdaydream'),
  10754. B.filter('.device-headset-side').attr('src', H),
  10755. D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
  10756. : (a('tabcardboard'),
  10757. B.filter('.device-headset-side').attr('src', Y),
  10758. D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
  10759. $('#vr').on('click', function (e) {
  10760. e.preventDefault(),
  10761. g('click_webvr_button'),
  10762. L.is(':hidden') && (ie.emit(_.OPENED), o());
  10763. }),
  10764. $('.webvr-popup .close').on('click', function (e) {
  10765. e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s();
  10766. }),
  10767. $('#tabcardboard').on('click', r),
  10768. $('#tabdaydream').on('click', r),
  10769. $('#tabnative').on('click', r),
  10770. $('.webvr-popup .open-with-app').on('click', function (e) {
  10771. e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p();
  10772. }),
  10773. $('.webvr-popup .help').on('click', function (e) {
  10774. e.preventDefault(),
  10775. g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'),
  10776. p();
  10777. }),
  10778. $('.webvr-popup .terms').on('click', function (e) {
  10779. e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS);
  10780. }),
  10781. F.on('click', function (e) {
  10782. e.preventDefault(), g(ee), window.open(J, '_blank');
  10783. }),
  10784. V.on('click', function (e) {
  10785. e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank');
  10786. }),
  10787. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  10788. e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid);
  10789. }),
  10790. $('.webvr-popup .badge-oculus').on('click', function (e) {
  10791. e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR);
  10792. });
  10793. }
  10794. function r() {
  10795. function e() {
  10796. y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e));
  10797. }
  10798. R.info('Headset mounted'), v.suspend();
  10799. var t = document.createElement('canvas');
  10800. for (
  10801. t.getContext('webgl'),
  10802. t.className = 'webvr-canvas',
  10803. document.bgColor = '#000',
  10804. document.body.style.backgroundColor = '#000';
  10805. document.body.firstChild;
  10806. )
  10807. document.body.removeChild(document.body.firstChild);
  10808. document.body.appendChild(t),
  10809. g('webvr_enter_app'),
  10810. y
  10811. .requestPresent([
  10812. {
  10813. source: t,
  10814. predistorted: !0,
  10815. },
  10816. ])
  10817. .catch(function (t) {
  10818. R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e();
  10819. }),
  10820. A.then(function () {
  10821. window.dispatchEvent(new Event('vrapp-start'));
  10822. }),
  10823. window.addEventListener('vrdisplaypresentchange', e);
  10824. }
  10825. function o() {
  10826. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a();
  10827. }
  10828. function a() {
  10829. if (!A) {
  10830. var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
  10831. t = 'https://static.port.com/webvr/' + e + '/js/main.js';
  10832. A = new Promise(function (e, i) {
  10833. var n = document.createElement('script');
  10834. (n.type = 'text/javascript'),
  10835. (n.src = t),
  10836. (n.onload = e),
  10837. document.head.appendChild(n);
  10838. });
  10839. }
  10840. D.find('.enter-button').on('click', r);
  10841. }
  10842. function s() {
  10843. g('webvr_modal_close'),
  10844. D.find('.enter-button').off('click', r),
  10845. L.fadeOut(I.guiAnimationSpeed, function () {
  10846. D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen();
  10847. }),
  10848. O.fadeIn(I.guiAnimationSpeed);
  10849. }
  10850. function l() {
  10851. k.toggleClass('hidden', !1), U.toggleClass('hidden', !0);
  10852. }
  10853. function c() {
  10854. k.toggleClass('hidden', !0), U.toggleClass('hidden', !1);
  10855. }
  10856. function h() {
  10857. B.filter('.device-headset').attr('src', G),
  10858. B.filter('.device-phone').attr('src', z),
  10859. (J = Z),
  10860. (ee = K),
  10861. F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
  10862. V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
  10863. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  10864. c();
  10865. }
  10866. function u() {
  10867. B.filter('.badge-cardboard').attr('src', j),
  10868. B.filter('.badge-oculus').attr('src', X),
  10869. l();
  10870. }
  10871. function d() {
  10872. B.filter('.device-headset').attr('src', Y),
  10873. B.filter('.device-phone').attr('src', W),
  10874. (J = q),
  10875. (ee = Q),
  10876. F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
  10877. V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  10878. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  10879. c();
  10880. }
  10881. function p() {
  10882. D.toggleClass('hidden'), N.toggleClass('hidden');
  10883. }
  10884. function f() {
  10885. R.info('exiting webVR'),
  10886. g('webvr_exit_app'),
  10887. window.location.search.indexOf('&qs=1') === -1
  10888. ? (window.location = window.location + '&qs=1')
  10889. : (window.location = window.location);
  10890. }
  10891. function g(e) {
  10892. var t = C.isLandscape() ? 'landscape' : 'portrait';
  10893. T.trackAlways('showcase_gui', {
  10894. gui_action: e,
  10895. orientation: t,
  10896. });
  10897. }
  10898. function m() {
  10899. var e = C.isLandscape();
  10900. L.toggleClass('landscape', e).toggleClass('portrait', !e);
  10901. }
  10902. var v,
  10903. A,
  10904. y,
  10905. C = e('../../util/browser'),
  10906. I = e('../../settings'),
  10907. E = (e('./../gui'), e('../../enum/VRPlatforms')),
  10908. b = e('../../enum/VRApps'),
  10909. w = e('./../vr/vrLink'),
  10910. _ = e('./WebVrEvent'),
  10911. T = e('../../analytics'),
  10912. x = (e('../../constants'), e('../../localization/localize')),
  10913. S = e('../../util/common'),
  10914. M = e('../../util/logger'),
  10915. R = new M(i),
  10916. P = e('events').EventEmitter,
  10917. O = $('#gui'),
  10918. L = $('.webvr-popup'),
  10919. D = $('.webvr-popup .page.p1'),
  10920. N = $('.webvr-popup .page.p2'),
  10921. B = L.find('.image'),
  10922. F = $('.webvr-popup .detail.headset'),
  10923. V = $('.webvr-popup .detail.phone'),
  10924. U = $('.webvr-popup .tab-content.webvr'),
  10925. k = $('.webvr-popup .tab-content.native'),
  10926. H = 'images/device-daydream-side.png',
  10927. G = 'images/device-daydream.png',
  10928. z = 'images/device-pixel.png',
  10929. W = 'images/ico-android-robot.png',
  10930. j = 'images/badge-cardboard.png',
  10931. Y = 'images/headset-cardboard.png',
  10932. X = 'images/badge-oculus.png',
  10933. Z = 'https://madeby.google.com/vr/',
  10934. q = 'https://vr.google.com/cardboard/get-cardboard/',
  10935. K = 'webvr_daydream_link',
  10936. Q = 'webvr_cardboard_link',
  10937. J = Z,
  10938. ee = K,
  10939. te = 'https://vr.google.com/daydream/phones/',
  10940. ie = {
  10941. init: n,
  10942. },
  10943. ne = {
  10944. tabcardboard: d,
  10945. tabdaydream: h,
  10946. tabnative: u,
  10947. };
  10948. S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie);
  10949. }.call(this, '/js/gui/webvr/webVRgui.js'));
  10950. },
  10951. {
  10952. '../../analytics': 4,
  10953. '../../constants': 8,
  10954. '../../enum/VRApps': 46,
  10955. '../../enum/VRPlatforms': 49,
  10956. '../../localization/localize': 108,
  10957. '../../settings': 166,
  10958. '../../util/browser': 182,
  10959. '../../util/common': 185,
  10960. '../../util/logger': 189,
  10961. './../gui': 65,
  10962. './../vr/vrLink': 86,
  10963. './WebVrEvent': 88,
  10964. events: 202,
  10965. },
  10966. ],
  10967. 90: [
  10968. function (e, t, i) {
  10969. 'use strict';
  10970. function n(e, t, i, n, o) {
  10971. n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
  10972. (this.roomId = o || ''),
  10973. (this.labelId = e),
  10974. (this.position = new r.Vector3().copy(t)),
  10975. (this.text = i);
  10976. }
  10977. var r = e('three'),
  10978. o = e('../util/browser');
  10979. (n.prototype.build = function () {
  10980. var e = window.document.createElement('div');
  10981. o.isMobile()
  10982. ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile')
  10983. : e.setAttribute('class', 'gui-floorplan-label');
  10984. var t = window.document.createElement('div');
  10985. t.setAttribute('class', 'gui-floorplan-label-text');
  10986. var i = window.document.createTextNode(this.text);
  10987. t.appendChild(i),
  10988. e.appendChild(t),
  10989. window.document.body.appendChild(e),
  10990. (this.labelGui = e),
  10991. (this.textBlock = t),
  10992. $(this.labelGui).hide();
  10993. var n = window.getComputedStyle(this.labelGui);
  10994. this.initialTransform = n.transform || n.webkitTransform;
  10995. }),
  10996. (t.exports = n);
  10997. },
  10998. {
  10999. '../util/browser': 182,
  11000. three: 217,
  11001. },
  11002. ],
  11003. 91: [
  11004. function (e, t, i) {
  11005. 'use strict';
  11006. function n() {
  11007. (this.player = null), (this.modelManager = null), (this.container = null);
  11008. }
  11009. var r = e('three'),
  11010. o = (e('../util/common'), e('../enum/PlayerEvents')),
  11011. a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  11012. s = e('../settings'),
  11013. l = e('../enum/Viewmode'),
  11014. c =
  11015. (e('../enum/WarpStyle'),
  11016. e('../util/transitions'),
  11017. e('../util/lerp'),
  11018. e('../util/browser'));
  11019. //场景初始化
  11020. (n.prototype.init = function (e, t, i) {
  11021. (this.player = e),
  11022. (this.modelManager = t),
  11023. (this.container = i),
  11024. this.updateModel(),
  11025. this.bindEvents();
  11026. }),
  11027. (n.prototype.bindEvents = function () {
  11028. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  11029. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  11030. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  11031. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  11032. this.player.on(o.StartOutside, this.handleStartOutside.bind(this));
  11033. }),
  11034. (n.prototype.updateModel = function () {
  11035. this.model = this.modelManager.getActiveModel();
  11036. }),
  11037. (n.prototype.handlePlayerViewChanged = function () {
  11038. this.updateLabelVisibility(), this.updateLabelDisplay();
  11039. }),
  11040. (n.prototype.getLabelsForFloor = function (e, t) {
  11041. return (
  11042. (t = t || []),
  11043. (t.length = 0),
  11044. this.model.labels.forEach(
  11045. function (i) {
  11046. this.labelVisibleForFloor(i, e) && t.push(i);
  11047. }.bind(this)
  11048. ),
  11049. t
  11050. );
  11051. }),
  11052. (n.prototype.getLabelsForCurrentFloor = function (e) {
  11053. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e);
  11054. }),
  11055. (n.prototype.labelVisibleForFloor = function (e, t) {
  11056. var i =
  11057. (c.isMobile() &&
  11058. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) ||
  11059. (!c.isMobile() &&
  11060. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop);
  11061. if (!this.model.showingLabels || !e.labelGui || !i) return !1;
  11062. var n = e.floorId === this.model.floors.size() - 1;
  11063. return this.model.allFloorsVisible ? n : e.floorId === t;
  11064. }),
  11065. (n.prototype.updateLabelVisibility = function (e) {
  11066. this.model.labels.forEach(
  11067. function (e) {
  11068. this.supportedMode() &&
  11069. this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  11070. ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
  11071. : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration);
  11072. }.bind(this)
  11073. );
  11074. }),
  11075. (n.prototype.showAllLabels = function (e, t) {
  11076. this.model.labels.forEach(
  11077. function (i) {
  11078. this.showLabel(i, e, t);
  11079. }.bind(this)
  11080. );
  11081. }),
  11082. (n.prototype.hideAllLabels = function (e, t) {
  11083. this.model.labels.forEach(
  11084. function (i) {
  11085. this.hideLabel(i, e, t);
  11086. }.bind(this)
  11087. );
  11088. }),
  11089. (n.prototype.showLabel = function (e, t, i) {
  11090. this.model.showingLabels &&
  11091. (e.visible ||
  11092. ((e.visible = !0),
  11093. (e.labelGui.style.display = 'block'),
  11094. (e.labelGui.style.opacity = 0),
  11095. $(e.labelGui).delay(t).fadeTo(i, 1)));
  11096. }),
  11097. (n.prototype.hideLabel = function (e, t, i) {
  11098. e.visible &&
  11099. ((e.visible = !1),
  11100. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i));
  11101. }),
  11102. (n.prototype.supportedMode = function () {
  11103. return this.player.mode === l.FLOORPLAN;
  11104. }),
  11105. (n.prototype.updateLabelDisplay = (function () {
  11106. var e = (new r.Vector3(), new r.Vector3(), []);
  11107. return function () {
  11108. var t = this.player.getLabelScaleFactor(),
  11109. i = 0.6,
  11110. n = 1.2,
  11111. r = (1 - t) * n + i,
  11112. o = c.isMobile()
  11113. ? s.labels.zoomTruncateThreshhold.mobile
  11114. : s.labels.zoomTruncateThreshhold.desktop;
  11115. this.getLabelsForCurrentFloor(e);
  11116. for (var a = 0; a < e.length; a++) {
  11117. var l = e[a];
  11118. this.supportedMode() &&
  11119. l.labelGui &&
  11120. (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  11121. t >= o && l.text.length >= s.labels.minLengthForTruncate
  11122. ? (l.textBlock.innerText =
  11123. l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
  11124. : (l.textBlock.innerText = l.text));
  11125. }
  11126. };
  11127. })()),
  11128. (n.prototype.updateProjectedGuiElement = (function () {
  11129. var e = new r.Vector3();
  11130. new r.Vector3();
  11131. return function (t, i, n, r, o) {
  11132. i.style.fontSize = 100 * o + '%';
  11133. var a = $('#player').width(),
  11134. s = $('#player').height(),
  11135. l = 0.5 * a,
  11136. c = 0.5 * s;
  11137. e.copy(n), e.project(this.player.camera);
  11138. var h = e.x * l + l,
  11139. u = -(e.y * c) + c;
  11140. (h -= t.offsetWidth / 2),
  11141. (u -= t.offsetHeight / 2),
  11142. (t.style.left = h + 'px'),
  11143. (t.style.top = u + 'px');
  11144. };
  11145. })()),
  11146. (n.prototype.handleStartInside = function (e) {
  11147. this.updateLabelVisibility();
  11148. }),
  11149. (n.prototype.handleStartOutside = function () {
  11150. this.updateLabelVisibility();
  11151. }),
  11152. (t.exports = n);
  11153. },
  11154. {
  11155. '../enum/DirectorEvents': 23,
  11156. '../enum/ModelManagerEvents': 33,
  11157. '../enum/PlayerEvents': 40,
  11158. '../enum/Viewmode': 51,
  11159. '../enum/WarpStyle': 52,
  11160. '../settings': 166,
  11161. '../util/browser': 182,
  11162. '../util/common': 185,
  11163. '../util/lerp': 188,
  11164. '../util/transitions': 195,
  11165. three: 217,
  11166. },
  11167. ],
  11168. 92: [
  11169. function (e, t, i) {
  11170. 'use strict';
  11171. Array.prototype.findIndex ||
  11172. (Array.prototype.findIndex = function (e) {
  11173. if (null == this)
  11174. throw new TypeError('Array.prototype.findIndex called on null or undefined');
  11175. if ('function' != typeof e) throw new TypeError('predicate must be a function');
  11176. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  11177. if (((t = i[o]), e.call(r, t, o, i))) return o;
  11178. return -1;
  11179. }),
  11180. Array.prototype.find ||
  11181. Object.defineProperty(Array.prototype, 'find', {
  11182. value: function (e) {
  11183. if (null == this) throw new TypeError('"this" is null or not defined');
  11184. var t = Object(this),
  11185. i = t.length >>> 0;
  11186. if ('function' != typeof e) throw new TypeError('predicate must be a function');
  11187. for (var n = arguments[1], r = 0; r < i; ) {
  11188. var o = t[r];
  11189. if (e.call(n, o, r, t)) return o;
  11190. r++;
  11191. }
  11192. },
  11193. });
  11194. },
  11195. {},
  11196. ],
  11197. 93: [
  11198. function (e, t, i) {
  11199. 'use strict';
  11200. var n = n || {};
  11201. (t.exports = n),
  11202. (n.gui = n.gui || {}),
  11203. (n.utils = n.utils || {}),
  11204. (n.controllers = n.controllers || {}),
  11205. (n.dom = n.dom || {}),
  11206. (n.color = n.color || {}),
  11207. (n.utils.css = (function () {
  11208. return {
  11209. load: function (e, t) {
  11210. t = t || document;
  11211. var i = t.createElement('link');
  11212. (i.type = 'text/css'),
  11213. (i.rel = 'stylesheet'),
  11214. (i.href = e),
  11215. t.getElementsByTagName('head')[0].appendChild(i);
  11216. },
  11217. inject: function (e, t) {
  11218. t = t || document;
  11219. var i = document.createElement('style');
  11220. (i.type = 'text/css'),
  11221. (i.innerHTML = e),
  11222. t.getElementsByTagName('head')[0].appendChild(i);
  11223. },
  11224. };
  11225. })()),
  11226. (n.utils.common = (function () {
  11227. var e = Array.prototype.forEach,
  11228. t = Array.prototype.slice;
  11229. return {
  11230. BREAK: {},
  11231. extend: function (e) {
  11232. return (
  11233. this.each(
  11234. t.call(arguments, 1),
  11235. function (t) {
  11236. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i]);
  11237. },
  11238. this
  11239. ),
  11240. e
  11241. );
  11242. },
  11243. defaults: function (e) {
  11244. return (
  11245. this.each(
  11246. t.call(arguments, 1),
  11247. function (t) {
  11248. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i]);
  11249. },
  11250. this
  11251. ),
  11252. e
  11253. );
  11254. },
  11255. compose: function () {
  11256. var e = t.call(arguments);
  11257. return function () {
  11258. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  11259. i = [e[n].apply(this, i)];
  11260. return i[0];
  11261. };
  11262. },
  11263. each: function (t, i, n) {
  11264. if (t)
  11265. if (e && t.forEach && t.forEach === e) t.forEach(i, n);
  11266. else if (t.length === t.length + 0) {
  11267. for (var r = 0, o = t.length; r < o; r++)
  11268. if (r in t && i.call(n, t[r], r) === this.BREAK) return;
  11269. } else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return;
  11270. },
  11271. defer: function (e) {
  11272. setTimeout(e, 0);
  11273. },
  11274. toArray: function (e) {
  11275. return e.toArray ? e.toArray() : t.call(e);
  11276. },
  11277. isUndefined: function (e) {
  11278. return void 0 === e;
  11279. },
  11280. isNull: function (e) {
  11281. return null === e;
  11282. },
  11283. isNaN: function (e) {
  11284. return e !== e;
  11285. },
  11286. isArray:
  11287. Array.isArray ||
  11288. function (e) {
  11289. return e.constructor === Array;
  11290. },
  11291. isObject: function (e) {
  11292. return e === Object(e);
  11293. },
  11294. isNumber: function (e) {
  11295. return e === e + 0;
  11296. },
  11297. isString: function (e) {
  11298. return e === e + '';
  11299. },
  11300. isBoolean: function (e) {
  11301. return e === !1 || e === !0;
  11302. },
  11303. isFunction: function (e) {
  11304. return '[object Function]' === Object.prototype.toString.call(e);
  11305. },
  11306. };
  11307. })()),
  11308. (n.controllers.Controller = (function (e) {
  11309. var t = function (e, t) {
  11310. (this.initialValue = e[t]),
  11311. (this.domElement = document.createElement('div')),
  11312. (this.object = e),
  11313. (this.property = t),
  11314. (this.__onChange = void 0),
  11315. (this.__onFinishChange = void 0);
  11316. };
  11317. return (
  11318. e.extend(t.prototype, {
  11319. onChange: function (e) {
  11320. return (this.__onChange = e), this;
  11321. },
  11322. onFinishChange: function (e) {
  11323. return (this.__onFinishChange = e), this;
  11324. },
  11325. setValue: function (e) {
  11326. return (
  11327. (this.object[this.property] = e),
  11328. this.__onChange && this.__onChange.call(this, e),
  11329. this.updateDisplay(),
  11330. this
  11331. );
  11332. },
  11333. getValue: function () {
  11334. return this.object[this.property];
  11335. },
  11336. updateDisplay: function () {
  11337. return this;
  11338. },
  11339. isModified: function () {
  11340. return this.initialValue !== this.getValue();
  11341. },
  11342. }),
  11343. t
  11344. );
  11345. })(n.utils.common)),
  11346. (n.dom.dom = (function (e) {
  11347. function t(t) {
  11348. if ('0' === t || e.isUndefined(t)) return 0;
  11349. var i = t.match(r);
  11350. return e.isNull(i) ? 0 : parseFloat(i[1]);
  11351. }
  11352. var i = {
  11353. HTMLEvents: ['change'],
  11354. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  11355. KeyboardEvents: ['keydown'],
  11356. },
  11357. n = {};
  11358. e.each(i, function (t, i) {
  11359. e.each(t, function (e) {
  11360. n[e] = i;
  11361. });
  11362. });
  11363. var r = /(\d+(\.\d+)?)px/,
  11364. o = {
  11365. makeSelectable: function (e, t) {
  11366. void 0 !== e &&
  11367. void 0 !== e.style &&
  11368. ((e.onselectstart = t
  11369. ? function () {
  11370. return !1;
  11371. }
  11372. : function () {}),
  11373. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  11374. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  11375. (e.unselectable = t ? 'on' : 'off'));
  11376. },
  11377. makeFullscreen: function (t, i, n) {
  11378. e.isUndefined(i) && (i = !0),
  11379. e.isUndefined(n) && (n = !0),
  11380. (t.style.position = 'absolute'),
  11381. i && ((t.style.left = 0), (t.style.right = 0)),
  11382. n && ((t.style.top = 0), (t.style.bottom = 0));
  11383. },
  11384. fakeEvent: function (t, i, r, o) {
  11385. r = r || {};
  11386. var a = n[i];
  11387. if (!a) throw new Error('Event type ' + i + ' not supported.');
  11388. var s = document.createEvent(a);
  11389. switch (a) {
  11390. case 'MouseEvents':
  11391. var l = r.x || r.clientX || 0,
  11392. c = r.y || r.clientY || 0;
  11393. s.initMouseEvent(
  11394. i,
  11395. r.bubbles || !1,
  11396. r.cancelable || !0,
  11397. window,
  11398. r.clickCount || 1,
  11399. 0,
  11400. 0,
  11401. l,
  11402. c,
  11403. !1,
  11404. !1,
  11405. !1,
  11406. !1,
  11407. 0,
  11408. null
  11409. );
  11410. break;
  11411. case 'KeyboardEvents':
  11412. var h = s.initKeyboardEvent || s.initKeyEvent;
  11413. e.defaults(r, {
  11414. cancelable: !0,
  11415. ctrlKey: !1,
  11416. altKey: !1,
  11417. shiftKey: !1,
  11418. metaKey: !1,
  11419. keyCode: void 0,
  11420. charCode: void 0,
  11421. }),
  11422. h(
  11423. i,
  11424. r.bubbles || !1,
  11425. r.cancelable,
  11426. window,
  11427. r.ctrlKey,
  11428. r.altKey,
  11429. r.shiftKey,
  11430. r.metaKey,
  11431. r.keyCode,
  11432. r.charCode
  11433. );
  11434. break;
  11435. default:
  11436. s.initEvent(i, r.bubbles || !1, r.cancelable || !0);
  11437. }
  11438. e.defaults(s, o), t.dispatchEvent(s);
  11439. },
  11440. bind: function (e, t, i, n) {
  11441. return (
  11442. (n = n || !1),
  11443. e.addEventListener
  11444. ? e.addEventListener(t, i, n)
  11445. : e.attachEvent && e.attachEvent('on' + t, i),
  11446. o
  11447. );
  11448. },
  11449. unbind: function (e, t, i, n) {
  11450. return (
  11451. (n = n || !1),
  11452. e.removeEventListener
  11453. ? e.removeEventListener(t, i, n)
  11454. : e.detachEvent && e.detachEvent('on' + t, i),
  11455. o
  11456. );
  11457. },
  11458. addClass: function (e, t) {
  11459. if (void 0 === e.className) e.className = t;
  11460. else if (e.className !== t) {
  11461. var i = e.className.split(/ +/);
  11462. i.indexOf(t) == -1 &&
  11463. (i.push(t),
  11464. (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')));
  11465. }
  11466. return o;
  11467. },
  11468. removeClass: function (e, t) {
  11469. if (t)
  11470. if (void 0 === e.className);
  11471. else if (e.className === t) e.removeAttribute('class');
  11472. else {
  11473. var i = e.className.split(/ +/),
  11474. n = i.indexOf(t);
  11475. n != -1 && (i.splice(n, 1), (e.className = i.join(' ')));
  11476. }
  11477. else e.className = void 0;
  11478. return o;
  11479. },
  11480. hasClass: function (e, t) {
  11481. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1;
  11482. },
  11483. getWidth: function (e) {
  11484. var i = getComputedStyle(e);
  11485. return (
  11486. t(i['border-left-width']) +
  11487. t(i['border-right-width']) +
  11488. t(i['padding-left']) +
  11489. t(i['padding-right']) +
  11490. t(i.width)
  11491. );
  11492. },
  11493. getHeight: function (e) {
  11494. var i = getComputedStyle(e);
  11495. return (
  11496. t(i['border-top-width']) +
  11497. t(i['border-bottom-width']) +
  11498. t(i['padding-top']) +
  11499. t(i['padding-bottom']) +
  11500. t(i.height)
  11501. );
  11502. },
  11503. getOffset: function (e) {
  11504. var t = {
  11505. left: 0,
  11506. top: 0,
  11507. };
  11508. if (e.offsetParent)
  11509. do (t.left += e.offsetLeft), (t.top += e.offsetTop);
  11510. while ((e = e.offsetParent));
  11511. return t;
  11512. },
  11513. isActive: function (e) {
  11514. return e === document.activeElement && (e.type || e.href);
  11515. },
  11516. };
  11517. return o;
  11518. })(n.utils.common)),
  11519. (n.controllers.OptionController = (function (e, t, i) {
  11520. var n = function (e, r, o) {
  11521. n.superclass.call(this, e, r);
  11522. var a = this;
  11523. if (((this.__select = document.createElement('select')), i.isArray(o))) {
  11524. var s = {};
  11525. i.each(o, function (e) {
  11526. s[e] = e;
  11527. }),
  11528. (o = s);
  11529. }
  11530. i.each(o, function (e, t) {
  11531. var i = document.createElement('option');
  11532. (i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i);
  11533. }),
  11534. this.updateDisplay(),
  11535. t.bind(this.__select, 'change', function () {
  11536. var e = this.options[this.selectedIndex].value;
  11537. a.setValue(e);
  11538. }),
  11539. this.domElement.appendChild(this.__select);
  11540. };
  11541. return (
  11542. (n.superclass = e),
  11543. i.extend(n.prototype, e.prototype, {
  11544. setValue: function (e) {
  11545. var t = n.superclass.prototype.setValue.call(this, e);
  11546. return (
  11547. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  11548. );
  11549. },
  11550. updateDisplay: function () {
  11551. return (
  11552. (this.__select.value = this.getValue()),
  11553. n.superclass.prototype.updateDisplay.call(this)
  11554. );
  11555. },
  11556. }),
  11557. n
  11558. );
  11559. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11560. (n.controllers.NumberController = (function (e, t) {
  11561. function i(e) {
  11562. return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0;
  11563. }
  11564. var n = function (e, r, o) {
  11565. n.superclass.call(this, e, r),
  11566. (o = o || {}),
  11567. (this.__min = o.min),
  11568. (this.__max = o.max),
  11569. (this.__step = o.step),
  11570. t.isUndefined(this.__step)
  11571. ? 0 == this.initialValue
  11572. ? (this.__impliedStep = 1)
  11573. : (this.__impliedStep =
  11574. Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  11575. : (this.__impliedStep = this.__step),
  11576. (this.__precision = i(this.__impliedStep));
  11577. };
  11578. return (
  11579. (n.superclass = e),
  11580. t.extend(n.prototype, e.prototype, {
  11581. setValue: function (e) {
  11582. return (
  11583. void 0 !== this.__min && e < this.__min
  11584. ? (e = this.__min)
  11585. : void 0 !== this.__max && e > this.__max && (e = this.__max),
  11586. void 0 !== this.__step &&
  11587. e % this.__step != 0 &&
  11588. (e = Math.round(e / this.__step) * this.__step),
  11589. n.superclass.prototype.setValue.call(this, e)
  11590. );
  11591. },
  11592. min: function (e) {
  11593. return (this.__min = e), this;
  11594. },
  11595. max: function (e) {
  11596. return (this.__max = e), this;
  11597. },
  11598. step: function (e) {
  11599. return (
  11600. (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
  11601. );
  11602. },
  11603. }),
  11604. n
  11605. );
  11606. })(n.controllers.Controller, n.utils.common)),
  11607. (n.controllers.NumberControllerBox = (function (e, t, i) {
  11608. function n(e, t) {
  11609. var i = Math.pow(10, t);
  11610. return Math.round(e * i) / i;
  11611. }
  11612. var r = function (e, n, o) {
  11613. function a() {
  11614. var e = parseFloat(d.__input.value);
  11615. i.isNaN(e) || d.setValue(e);
  11616. }
  11617. function s() {
  11618. a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue());
  11619. }
  11620. function l(e) {
  11621. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY);
  11622. }
  11623. function c(e) {
  11624. var t = u - e.clientY;
  11625. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY);
  11626. }
  11627. function h() {
  11628. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h);
  11629. }
  11630. (this.__truncationSuspended = !1), r.superclass.call(this, e, n, o);
  11631. var u,
  11632. d = this;
  11633. (this.__input = document.createElement('input')),
  11634. this.__input.setAttribute('type', 'text'),
  11635. t.bind(this.__input, 'change', a),
  11636. t.bind(this.__input, 'blur', s),
  11637. t.bind(this.__input, 'mousedown', l),
  11638. t.bind(this.__input, 'keydown', function (e) {
  11639. 13 === e.keyCode &&
  11640. ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1));
  11641. }),
  11642. this.updateDisplay(),
  11643. this.domElement.appendChild(this.__input);
  11644. };
  11645. return (
  11646. (r.superclass = e),
  11647. i.extend(r.prototype, e.prototype, {
  11648. updateDisplay: function () {
  11649. return (
  11650. (this.__input.value = this.__truncationSuspended
  11651. ? this.getValue()
  11652. : n(this.getValue(), this.__precision)),
  11653. r.superclass.prototype.updateDisplay.call(this)
  11654. );
  11655. },
  11656. }),
  11657. r
  11658. );
  11659. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  11660. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  11661. function o(e, t, i, n, r) {
  11662. return n + (r - n) * ((e - t) / (i - t));
  11663. }
  11664. var a = function (e, i, n, r, s) {
  11665. function l(e) {
  11666. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e);
  11667. }
  11668. function c(e) {
  11669. e.preventDefault();
  11670. var i = t.getOffset(u.__background),
  11671. n = t.getWidth(u.__background);
  11672. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1;
  11673. }
  11674. function h() {
  11675. t.unbind(window, 'mousemove', c),
  11676. t.unbind(window, 'mouseup', h),
  11677. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue());
  11678. }
  11679. a.superclass.call(this, e, i, {
  11680. min: n,
  11681. max: r,
  11682. step: s,
  11683. });
  11684. var u = this;
  11685. (this.__background = document.createElement('div')),
  11686. (this.__foreground = document.createElement('div')),
  11687. t.bind(this.__background, 'mousedown', l),
  11688. t.addClass(this.__background, 'slider'),
  11689. t.addClass(this.__foreground, 'slider-fg'),
  11690. this.updateDisplay(),
  11691. this.__background.appendChild(this.__foreground),
  11692. this.domElement.appendChild(this.__background);
  11693. };
  11694. return (
  11695. (a.superclass = e),
  11696. (a.useDefaultStyles = function () {
  11697. i.inject(r);
  11698. }),
  11699. n.extend(a.prototype, e.prototype, {
  11700. updateDisplay: function () {
  11701. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  11702. return (
  11703. (this.__foreground.style.width = 100 * e + '%'),
  11704. a.superclass.prototype.updateDisplay.call(this)
  11705. );
  11706. },
  11707. }),
  11708. a
  11709. );
  11710. })(
  11711. n.controllers.NumberController,
  11712. n.dom.dom,
  11713. n.utils.css,
  11714. n.utils.common,
  11715. '/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: \'\';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}'
  11716. )),
  11717. (n.controllers.FunctionController = (function (e, t, i) {
  11718. var n = function (e, i, r) {
  11719. n.superclass.call(this, e, i);
  11720. var o = this;
  11721. (this.__button = document.createElement('div')),
  11722. (this.__button.innerHTML = void 0 === r ? 'Fire' : r),
  11723. t.bind(this.__button, 'click', function (e) {
  11724. return e.preventDefault(), o.fire(), !1;
  11725. }),
  11726. t.addClass(this.__button, 'button'),
  11727. this.domElement.appendChild(this.__button);
  11728. };
  11729. return (
  11730. (n.superclass = e),
  11731. i.extend(n.prototype, e.prototype, {
  11732. fire: function () {
  11733. this.__onChange && this.__onChange.call(this),
  11734. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11735. this.getValue().call(this.object);
  11736. },
  11737. }),
  11738. n
  11739. );
  11740. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11741. (n.controllers.BooleanController = (function (e, t, i) {
  11742. var n = function (e, i) {
  11743. function r() {
  11744. o.setValue(!o.__prev);
  11745. }
  11746. n.superclass.call(this, e, i);
  11747. var o = this;
  11748. (this.__prev = this.getValue()),
  11749. (this.__checkbox = document.createElement('input')),
  11750. this.__checkbox.setAttribute('type', 'checkbox'),
  11751. t.bind(this.__checkbox, 'change', r, !1),
  11752. this.domElement.appendChild(this.__checkbox),
  11753. this.updateDisplay();
  11754. };
  11755. return (
  11756. (n.superclass = e),
  11757. i.extend(n.prototype, e.prototype, {
  11758. setValue: function (e) {
  11759. var t = n.superclass.prototype.setValue.call(this, e);
  11760. return (
  11761. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11762. (this.__prev = this.getValue()),
  11763. t
  11764. );
  11765. },
  11766. updateDisplay: function () {
  11767. return (
  11768. this.getValue() === !0
  11769. ? (this.__checkbox.setAttribute('checked', 'checked'),
  11770. (this.__checkbox.checked = !0))
  11771. : (this.__checkbox.checked = !1),
  11772. n.superclass.prototype.updateDisplay.call(this)
  11773. );
  11774. },
  11775. }),
  11776. n
  11777. );
  11778. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11779. (n.color.toString = (function (e) {
  11780. return function (t) {
  11781. if (1 == t.a || e.isUndefined(t.a)) {
  11782. for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i;
  11783. return '#' + i;
  11784. }
  11785. return (
  11786. 'rgba(' +
  11787. Math.round(t.r) +
  11788. ',' +
  11789. Math.round(t.g) +
  11790. ',' +
  11791. Math.round(t.b) +
  11792. ',' +
  11793. t.a +
  11794. ')'
  11795. );
  11796. };
  11797. })(n.utils.common)),
  11798. (n.color.interpret = (function (e, t) {
  11799. var i,
  11800. n,
  11801. r = function () {
  11802. n = !1;
  11803. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  11804. return (
  11805. t.each(o, function (r) {
  11806. if (r.litmus(e))
  11807. return (
  11808. t.each(r.conversions, function (r, o) {
  11809. if (((i = r.read(e)), n === !1 && i !== !1))
  11810. return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK;
  11811. }),
  11812. t.BREAK
  11813. );
  11814. }),
  11815. n
  11816. );
  11817. },
  11818. o = [
  11819. {
  11820. litmus: t.isString,
  11821. conversions: {
  11822. THREE_CHAR_HEX: {
  11823. read: function (e) {
  11824. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  11825. return (
  11826. null !== t && {
  11827. space: 'HEX',
  11828. hex: parseInt(
  11829. '0x' +
  11830. t[1].toString() +
  11831. t[1].toString() +
  11832. t[2].toString() +
  11833. t[2].toString() +
  11834. t[3].toString() +
  11835. t[3].toString()
  11836. ),
  11837. }
  11838. );
  11839. },
  11840. write: e,
  11841. },
  11842. SIX_CHAR_HEX: {
  11843. read: function (e) {
  11844. var t = e.match(/^#([A-F0-9]{6})$/i);
  11845. return (
  11846. null !== t && {
  11847. space: 'HEX',
  11848. hex: parseInt('0x' + t[1].toString()),
  11849. }
  11850. );
  11851. },
  11852. write: e,
  11853. },
  11854. CSS_RGB: {
  11855. read: function (e) {
  11856. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  11857. return (
  11858. null !== t && {
  11859. space: 'RGB',
  11860. r: parseFloat(t[1]),
  11861. g: parseFloat(t[2]),
  11862. b: parseFloat(t[3]),
  11863. }
  11864. );
  11865. },
  11866. write: e,
  11867. },
  11868. CSS_RGBA: {
  11869. read: function (e) {
  11870. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  11871. return (
  11872. null !== t && {
  11873. space: 'RGB',
  11874. r: parseFloat(t[1]),
  11875. g: parseFloat(t[2]),
  11876. b: parseFloat(t[3]),
  11877. a: parseFloat(t[4]),
  11878. }
  11879. );
  11880. },
  11881. write: e,
  11882. },
  11883. },
  11884. },
  11885. {
  11886. litmus: t.isNumber,
  11887. conversions: {
  11888. HEX: {
  11889. read: function (e) {
  11890. return {
  11891. space: 'HEX',
  11892. hex: e,
  11893. conversionName: 'HEX',
  11894. };
  11895. },
  11896. write: function (e) {
  11897. return e.hex;
  11898. },
  11899. },
  11900. },
  11901. },
  11902. {
  11903. litmus: t.isArray,
  11904. conversions: {
  11905. RGB_ARRAY: {
  11906. read: function (e) {
  11907. return (
  11908. 3 == e.length && {
  11909. space: 'RGB',
  11910. r: e[0],
  11911. g: e[1],
  11912. b: e[2],
  11913. }
  11914. );
  11915. },
  11916. write: function (e) {
  11917. return [e.r, e.g, e.b];
  11918. },
  11919. },
  11920. RGBA_ARRAY: {
  11921. read: function (e) {
  11922. return (
  11923. 4 == e.length && {
  11924. space: 'RGB',
  11925. r: e[0],
  11926. g: e[1],
  11927. b: e[2],
  11928. a: e[3],
  11929. }
  11930. );
  11931. },
  11932. write: function (e) {
  11933. return [e.r, e.g, e.b, e.a];
  11934. },
  11935. },
  11936. },
  11937. },
  11938. {
  11939. litmus: t.isObject,
  11940. conversions: {
  11941. RGBA_OBJ: {
  11942. read: function (e) {
  11943. return (
  11944. !!(
  11945. t.isNumber(e.r) &&
  11946. t.isNumber(e.g) &&
  11947. t.isNumber(e.b) &&
  11948. t.isNumber(e.a)
  11949. ) && {
  11950. space: 'RGB',
  11951. r: e.r,
  11952. g: e.g,
  11953. b: e.b,
  11954. a: e.a,
  11955. }
  11956. );
  11957. },
  11958. write: function (e) {
  11959. return {
  11960. r: e.r,
  11961. g: e.g,
  11962. b: e.b,
  11963. a: e.a,
  11964. };
  11965. },
  11966. },
  11967. RGB_OBJ: {
  11968. read: function (e) {
  11969. return (
  11970. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  11971. space: 'RGB',
  11972. r: e.r,
  11973. g: e.g,
  11974. b: e.b,
  11975. }
  11976. );
  11977. },
  11978. write: function (e) {
  11979. return {
  11980. r: e.r,
  11981. g: e.g,
  11982. b: e.b,
  11983. };
  11984. },
  11985. },
  11986. HSVA_OBJ: {
  11987. read: function (e) {
  11988. return (
  11989. !!(
  11990. t.isNumber(e.h) &&
  11991. t.isNumber(e.s) &&
  11992. t.isNumber(e.v) &&
  11993. t.isNumber(e.a)
  11994. ) && {
  11995. space: 'HSV',
  11996. h: e.h,
  11997. s: e.s,
  11998. v: e.v,
  11999. a: e.a,
  12000. }
  12001. );
  12002. },
  12003. write: function (e) {
  12004. return {
  12005. h: e.h,
  12006. s: e.s,
  12007. v: e.v,
  12008. a: e.a,
  12009. };
  12010. },
  12011. },
  12012. HSV_OBJ: {
  12013. read: function (e) {
  12014. return (
  12015. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  12016. space: 'HSV',
  12017. h: e.h,
  12018. s: e.s,
  12019. v: e.v,
  12020. }
  12021. );
  12022. },
  12023. write: function (e) {
  12024. return {
  12025. h: e.h,
  12026. s: e.s,
  12027. v: e.v,
  12028. };
  12029. },
  12030. },
  12031. },
  12032. },
  12033. ];
  12034. return r;
  12035. })(n.color.toString, n.utils.common)),
  12036. (n.GUI = n.gui.GUI =
  12037. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  12038. function g(e, t, i, o) {
  12039. if (void 0 === t[i])
  12040. throw new Error('Object ' + t + ' has no property "' + i + '"');
  12041. var a;
  12042. if (o.color) a = new h(t, i);
  12043. else {
  12044. var s = [t, i].concat(o.factoryArgs);
  12045. a = n.apply(e, s);
  12046. }
  12047. o.before instanceof r && (o.before = o.before.__li),
  12048. A(e, a),
  12049. p.addClass(a.domElement, 'c');
  12050. var l = document.createElement('span');
  12051. p.addClass(l, 'property-name'), (l.innerHTML = a.property);
  12052. var c = document.createElement('div');
  12053. c.appendChild(l), c.appendChild(a.domElement);
  12054. var u = m(e, c, o.before);
  12055. return (
  12056. p.addClass(u, V.CLASS_CONTROLLER_ROW),
  12057. p.addClass(u, typeof a.getValue()),
  12058. v(e, u, a),
  12059. e.__controllers.push(a),
  12060. a
  12061. );
  12062. }
  12063. function m(e, t, i) {
  12064. var n = document.createElement('li');
  12065. return (
  12066. t && n.appendChild(t),
  12067. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  12068. e.onResize(),
  12069. n
  12070. );
  12071. }
  12072. function v(e, t, i) {
  12073. if (
  12074. ((i.__li = t),
  12075. (i.__gui = e),
  12076. f.extend(i, {
  12077. options: function (t) {
  12078. return arguments.length > 1
  12079. ? (i.remove(),
  12080. g(e, i.object, i.property, {
  12081. before: i.__li.nextElementSibling,
  12082. factoryArgs: [f.toArray(arguments)],
  12083. }))
  12084. : f.isArray(t) || f.isObject(t)
  12085. ? (i.remove(),
  12086. g(e, i.object, i.property, {
  12087. before: i.__li.nextElementSibling,
  12088. factoryArgs: [t],
  12089. }))
  12090. : void 0;
  12091. },
  12092. name: function (e) {
  12093. return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i;
  12094. },
  12095. listen: function () {
  12096. return i.__gui.listen(i), i;
  12097. },
  12098. remove: function () {
  12099. return i.__gui.remove(i), i;
  12100. },
  12101. }),
  12102. i instanceof l)
  12103. ) {
  12104. var n = new s(i.object, i.property, {
  12105. min: i.__min,
  12106. max: i.__max,
  12107. step: i.__step,
  12108. });
  12109. f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  12110. var t = i[e],
  12111. r = n[e];
  12112. i[e] = n[e] = function () {
  12113. var e = Array.prototype.slice.call(arguments);
  12114. return t.apply(i, e), r.apply(n, e);
  12115. };
  12116. }),
  12117. p.addClass(t, 'has-slider'),
  12118. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild);
  12119. } else if (i instanceof s) {
  12120. var r = function (t) {
  12121. return f.isNumber(i.__min) && f.isNumber(i.__max)
  12122. ? (i.remove(),
  12123. g(e, i.object, i.property, {
  12124. before: i.__li.nextElementSibling,
  12125. factoryArgs: [i.__min, i.__max, i.__step],
  12126. }))
  12127. : t;
  12128. };
  12129. (i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max));
  12130. } else
  12131. i instanceof o
  12132. ? (p.bind(t, 'click', function () {
  12133. p.fakeEvent(i.__checkbox, 'click');
  12134. }),
  12135. p.bind(i.__checkbox, 'click', function (e) {
  12136. e.stopPropagation();
  12137. }))
  12138. : i instanceof a
  12139. ? (p.bind(t, 'click', function () {
  12140. p.fakeEvent(i.__button, 'click');
  12141. }),
  12142. p.bind(t, 'mouseover', function () {
  12143. p.addClass(i.__button, 'hover');
  12144. }),
  12145. p.bind(t, 'mouseout', function () {
  12146. p.removeClass(i.__button, 'hover');
  12147. }))
  12148. : i instanceof h &&
  12149. (p.addClass(t, 'color'),
  12150. (i.updateDisplay = f.compose(function (e) {
  12151. return (t.style.borderLeftColor = i.__color.toString()), e;
  12152. }, i.updateDisplay)),
  12153. i.updateDisplay());
  12154. i.setValue = f.compose(function (t) {
  12155. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t;
  12156. }, i.setValue);
  12157. }
  12158. function A(e, t) {
  12159. var i = e.getRoot(),
  12160. n = i.__rememberedObjects.indexOf(t.object);
  12161. if (n != -1) {
  12162. var r = i.__rememberedObjectIndecesToControllers[n];
  12163. if (
  12164. (void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)),
  12165. (r[t.property] = t),
  12166. i.load && i.load.remembered)
  12167. ) {
  12168. var o,
  12169. a = i.load.remembered;
  12170. if (a[e.preset]) o = a[e.preset];
  12171. else {
  12172. if (!a[L]) return;
  12173. o = a[L];
  12174. }
  12175. if (o[n] && void 0 !== o[n][t.property]) {
  12176. var s = o[n][t.property];
  12177. (t.initialValue = s), t.setValue(s);
  12178. }
  12179. }
  12180. }
  12181. }
  12182. function y(e, t) {
  12183. return document.location.href + '.' + t;
  12184. }
  12185. function C(e) {
  12186. var t = (e.__save_row = document.createElement('li'));
  12187. p.addClass(e.domElement, 'has-save'),
  12188. e.__ul.insertBefore(t, e.__ul.firstChild),
  12189. p.addClass(t, 'save-row');
  12190. var i = document.createElement('span');
  12191. (i.innerHTML = '&nbsp;'), p.addClass(i, 'button gears');
  12192. var n = document.createElement('span');
  12193. (n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save');
  12194. var r = document.createElement('span');
  12195. (r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as');
  12196. var o = document.createElement('span');
  12197. (o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert');
  12198. var a = (e.__preset_select = document.createElement('select'));
  12199. if (
  12200. (e.load && e.load.remembered
  12201. ? f.each(e.load.remembered, function (t, i) {
  12202. w(e, i, i == e.preset);
  12203. })
  12204. : w(e, L, !1),
  12205. p.bind(a, 'change', function () {
  12206. for (var t = 0; t < e.__preset_select.length; t++)
  12207. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  12208. e.preset = this.value;
  12209. }),
  12210. t.appendChild(a),
  12211. t.appendChild(i),
  12212. t.appendChild(n),
  12213. t.appendChild(r),
  12214. t.appendChild(o),
  12215. D)
  12216. ) {
  12217. var s = document.getElementById('dg-save-locally'),
  12218. l = document.getElementById('dg-local-explain');
  12219. s.style.display = 'block';
  12220. var c = document.getElementById('dg-local-storage');
  12221. 'true' === localStorage.getItem(y(e, 'isLocal')) &&
  12222. c.setAttribute('checked', 'checked');
  12223. var h = function () {
  12224. l.style.display = e.useLocalStorage ? 'block' : 'none';
  12225. };
  12226. h(),
  12227. p.bind(c, 'change', function () {
  12228. (e.useLocalStorage = !e.useLocalStorage), h();
  12229. });
  12230. }
  12231. var u = document.getElementById('dg-new-constructor');
  12232. p.bind(u, 'keydown', function (e) {
  12233. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide();
  12234. }),
  12235. p.bind(i, 'click', function () {
  12236. (u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)),
  12237. S.show(),
  12238. u.focus(),
  12239. u.select();
  12240. }),
  12241. p.bind(n, 'click', function () {
  12242. e.save();
  12243. }),
  12244. p.bind(r, 'click', function () {
  12245. var t = prompt('Enter a new preset name.');
  12246. t && e.saveAs(t);
  12247. }),
  12248. p.bind(o, 'click', function () {
  12249. e.revert();
  12250. });
  12251. }
  12252. function I(e) {
  12253. function t(t) {
  12254. return (
  12255. t.preventDefault(),
  12256. (r = t.clientX),
  12257. p.addClass(e.__closeButton, V.CLASS_DRAG),
  12258. p.bind(window, 'mousemove', i),
  12259. p.bind(window, 'mouseup', n),
  12260. !1
  12261. );
  12262. }
  12263. function i(t) {
  12264. return (
  12265. t.preventDefault(),
  12266. (e.width += r - t.clientX),
  12267. e.onResize(),
  12268. (r = t.clientX),
  12269. !1
  12270. );
  12271. }
  12272. function n() {
  12273. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  12274. p.unbind(window, 'mousemove', i),
  12275. p.unbind(window, 'mouseup', n);
  12276. }
  12277. (e.__resize_handle = document.createElement('div')),
  12278. f.extend(e.__resize_handle.style, {
  12279. width: '6px',
  12280. marginLeft: '-3px',
  12281. height: '200px',
  12282. cursor: 'ew-resize',
  12283. position: 'absolute',
  12284. });
  12285. var r;
  12286. p.bind(e.__resize_handle, 'mousedown', t),
  12287. p.bind(e.__closeButton, 'mousedown', t),
  12288. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild);
  12289. }
  12290. function E(e, t) {
  12291. (e.domElement.style.width = t + 'px'),
  12292. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'),
  12293. e.__closeButton && (e.__closeButton.style.width = t + 'px');
  12294. }
  12295. function b(e, t) {
  12296. var i = {};
  12297. return (
  12298. f.each(e.__rememberedObjects, function (n, r) {
  12299. var o = {},
  12300. a = e.__rememberedObjectIndecesToControllers[r];
  12301. f.each(a, function (e, i) {
  12302. o[i] = t ? e.initialValue : e.getValue();
  12303. }),
  12304. (i[r] = o);
  12305. }),
  12306. i
  12307. );
  12308. }
  12309. function w(e, t, i) {
  12310. var n = document.createElement('option');
  12311. (n.innerHTML = t),
  12312. (n.value = t),
  12313. e.__preset_select.appendChild(n),
  12314. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1);
  12315. }
  12316. function _(e) {
  12317. for (var t = 0; t < e.__preset_select.length; t++)
  12318. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t);
  12319. }
  12320. function T(e, t) {
  12321. var i = e.__preset_select[e.__preset_select.selectedIndex];
  12322. t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value);
  12323. }
  12324. function x(e) {
  12325. 0 != e.length &&
  12326. u(function () {
  12327. x(e);
  12328. }),
  12329. f.each(e, function (e) {
  12330. e.updateDisplay();
  12331. });
  12332. }
  12333. e.inject(i);
  12334. var S,
  12335. M,
  12336. R = 'dg',
  12337. P = 72,
  12338. O = 20,
  12339. L = 'Default',
  12340. D = (function () {
  12341. try {
  12342. return 'localStorage' in window && null !== window.localStorage;
  12343. } catch (e) {
  12344. return !1;
  12345. }
  12346. })(),
  12347. N = !0,
  12348. B = !1,
  12349. F = [],
  12350. V = function (e) {
  12351. function t() {
  12352. var e = i.getRoot();
  12353. (e.width += 1),
  12354. f.defer(function () {
  12355. e.width -= 1;
  12356. });
  12357. }
  12358. var i = this;
  12359. (this.domElement = document.createElement('div')),
  12360. (this.__ul = document.createElement('ul')),
  12361. this.domElement.appendChild(this.__ul),
  12362. p.addClass(this.domElement, R),
  12363. (this.__folders = {}),
  12364. (this.__controllers = []),
  12365. (this.__rememberedObjects = []),
  12366. (this.__rememberedObjectIndecesToControllers = []),
  12367. (this.__listening = []),
  12368. (e = e || {}),
  12369. (e = f.defaults(e, {
  12370. autoPlace: !0,
  12371. width: V.DEFAULT_WIDTH,
  12372. })),
  12373. (e = f.defaults(e, {
  12374. resizable: e.autoPlace,
  12375. hideable: e.autoPlace,
  12376. })),
  12377. f.isUndefined(e.load)
  12378. ? (e.load = {
  12379. preset: L,
  12380. })
  12381. : e.preset && (e.load.preset = e.preset),
  12382. f.isUndefined(e.parent) && e.hideable && F.push(this),
  12383. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  12384. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  12385. var n,
  12386. r = D && 'true' === localStorage.getItem(y(this, 'isLocal'));
  12387. if (
  12388. (Object.defineProperties(this, {
  12389. parent: {
  12390. get: function () {
  12391. return e.parent;
  12392. },
  12393. },
  12394. scrollable: {
  12395. get: function () {
  12396. return e.scrollable;
  12397. },
  12398. },
  12399. autoPlace: {
  12400. get: function () {
  12401. return e.autoPlace;
  12402. },
  12403. },
  12404. preset: {
  12405. get: function () {
  12406. return i.parent ? i.getRoot().preset : e.load.preset;
  12407. },
  12408. set: function (t) {
  12409. i.parent ? (i.getRoot().preset = t) : (e.load.preset = t),
  12410. _(this),
  12411. i.revert();
  12412. },
  12413. },
  12414. width: {
  12415. get: function () {
  12416. return e.width;
  12417. },
  12418. set: function (t) {
  12419. (e.width = t), E(i, t);
  12420. },
  12421. },
  12422. name: {
  12423. get: function () {
  12424. return e.name;
  12425. },
  12426. set: function (t) {
  12427. (e.name = t), a && (a.innerHTML = e.name);
  12428. },
  12429. },
  12430. closed: {
  12431. get: function () {
  12432. return e.closed;
  12433. },
  12434. set: function (t) {
  12435. (e.closed = t),
  12436. e.closed
  12437. ? p.addClass(i.__ul, V.CLASS_CLOSED)
  12438. : p.removeClass(i.__ul, V.CLASS_CLOSED),
  12439. this.onResize(),
  12440. i.__closeButton &&
  12441. (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED);
  12442. },
  12443. },
  12444. load: {
  12445. get: function () {
  12446. return e.load;
  12447. },
  12448. },
  12449. useLocalStorage: {
  12450. get: function () {
  12451. return r;
  12452. },
  12453. set: function (e) {
  12454. D &&
  12455. ((r = e),
  12456. e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n),
  12457. localStorage.setItem(y(i, 'isLocal'), e));
  12458. },
  12459. },
  12460. }),
  12461. f.isUndefined(e.parent))
  12462. ) {
  12463. if (
  12464. ((e.closed = !1),
  12465. p.addClass(this.domElement, V.CLASS_MAIN),
  12466. p.makeSelectable(this.domElement, !1),
  12467. D && r)
  12468. ) {
  12469. i.useLocalStorage = !0;
  12470. var o = localStorage.getItem(y(this, 'gui'));
  12471. o && (e.load = JSON.parse(o));
  12472. }
  12473. (this.__closeButton = document.createElement('div')),
  12474. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  12475. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  12476. this.domElement.appendChild(this.__closeButton),
  12477. p.bind(this.__closeButton, 'click', function () {
  12478. i.closed = !i.closed;
  12479. });
  12480. } else {
  12481. void 0 === e.closed && (e.closed = !0);
  12482. var a = document.createTextNode(e.name);
  12483. p.addClass(a, 'controller-name');
  12484. var s = m(i, a),
  12485. l = function (e) {
  12486. return e.preventDefault(), (i.closed = !i.closed), !1;
  12487. };
  12488. p.addClass(this.__ul, V.CLASS_CLOSED),
  12489. p.addClass(s, 'title'),
  12490. p.bind(s, 'click', l),
  12491. e.closed || (this.closed = !1);
  12492. }
  12493. e.autoPlace &&
  12494. (f.isUndefined(e.parent) &&
  12495. (N &&
  12496. ((M = document.createElement('div')),
  12497. p.addClass(M, R),
  12498. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  12499. document.body.appendChild(M),
  12500. (N = !1)),
  12501. M.appendChild(this.domElement),
  12502. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  12503. this.parent || E(i, e.width)),
  12504. p.bind(window, 'resize', function () {
  12505. i.onResize();
  12506. }),
  12507. p.bind(this.__ul, 'webkitTransitionEnd', function () {
  12508. i.onResize();
  12509. }),
  12510. p.bind(this.__ul, 'transitionend', function () {
  12511. i.onResize();
  12512. }),
  12513. p.bind(this.__ul, 'oTransitionEnd', function () {
  12514. i.onResize();
  12515. }),
  12516. this.onResize(),
  12517. e.resizable && I(this),
  12518. (n = function () {
  12519. D &&
  12520. 'true' === localStorage.getItem(y(i, 'isLocal')) &&
  12521. localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()));
  12522. }),
  12523. (this.saveToLocalStorageIfPossible = n);
  12524. i.getRoot();
  12525. e.parent || t();
  12526. };
  12527. return (
  12528. (V.toggleHide = function () {
  12529. (B = !B),
  12530. f.each(F, function (e) {
  12531. (e.domElement.style.zIndex = B ? -999 : 999),
  12532. (e.domElement.style.opacity = B ? 0 : 1);
  12533. });
  12534. }),
  12535. (V.CLASS_AUTO_PLACE = 'a'),
  12536. (V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  12537. (V.CLASS_MAIN = 'main'),
  12538. (V.CLASS_CONTROLLER_ROW = 'cr'),
  12539. (V.CLASS_TOO_TALL = 'taller-than-window'),
  12540. (V.CLASS_CLOSED = 'closed'),
  12541. (V.CLASS_CLOSE_BUTTON = 'close-button'),
  12542. (V.CLASS_DRAG = 'drag'),
  12543. (V.DEFAULT_WIDTH = 245),
  12544. (V.TEXT_CLOSED = 'Close Controls'),
  12545. (V.TEXT_OPEN = 'Open Controls'),
  12546. p.bind(
  12547. window,
  12548. 'keydown',
  12549. function (e) {
  12550. 'text' === document.activeElement.type ||
  12551. (e.which !== P && e.keyCode != P) ||
  12552. V.toggleHide();
  12553. },
  12554. !1
  12555. ),
  12556. f.extend(V.prototype, {
  12557. add: function (e, t) {
  12558. return g(this, e, t, {
  12559. factoryArgs: Array.prototype.slice.call(arguments, 2),
  12560. });
  12561. },
  12562. addColor: function (e, t) {
  12563. return g(this, e, t, {
  12564. color: !0,
  12565. });
  12566. },
  12567. remove: function (e) {
  12568. this.__ul.removeChild(e.__li),
  12569. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  12570. var t = this;
  12571. f.defer(function () {
  12572. t.onResize();
  12573. });
  12574. },
  12575. destroy: function () {
  12576. this.autoPlace && M.removeChild(this.domElement);
  12577. },
  12578. addFolder: function (e) {
  12579. if (void 0 !== this.__folders[e])
  12580. throw new Error(
  12581. 'You already have a folder in this GUI by the name "' + e + '"'
  12582. );
  12583. var t = {
  12584. name: e,
  12585. parent: this,
  12586. };
  12587. (t.autoPlace = this.autoPlace),
  12588. this.load &&
  12589. this.load.folders &&
  12590. this.load.folders[e] &&
  12591. ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]));
  12592. var i = new V(t);
  12593. this.__folders[e] = i;
  12594. var n = m(this, i.domElement);
  12595. return p.addClass(n, 'folder'), i;
  12596. },
  12597. open: function () {
  12598. this.closed = !1;
  12599. },
  12600. close: function () {
  12601. this.closed = !0;
  12602. },
  12603. onResize: function () {
  12604. var e = this.getRoot();
  12605. if (e.scrollable) {
  12606. var t = p.getOffset(e.__ul).top,
  12607. i = 0;
  12608. f.each(e.__ul.childNodes, function (t) {
  12609. (e.autoPlace && t === e.__save_row) || (i += p.getHeight(t));
  12610. }),
  12611. $('#player').height() - t - O < i
  12612. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  12613. (e.__ul.style.height = $('#player').height() - t - O + 'px'))
  12614. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  12615. (e.__ul.style.height = 'auto'));
  12616. }
  12617. e.__resize_handle &&
  12618. f.defer(function () {
  12619. e.__resize_handle.style.height = e.__ul.offsetHeight + 'px';
  12620. }),
  12621. e.__closeButton && (e.__closeButton.style.width = e.width + 'px');
  12622. },
  12623. remember: function () {
  12624. if (
  12625. (f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)),
  12626. this.parent)
  12627. )
  12628. throw new Error('You can only call remember on a top level GUI.');
  12629. var e = this;
  12630. f.each(Array.prototype.slice.call(arguments), function (t) {
  12631. 0 == e.__rememberedObjects.length && C(e),
  12632. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t);
  12633. }),
  12634. this.autoPlace && E(this, this.width);
  12635. },
  12636. getRoot: function () {
  12637. for (var e = this; e.parent; ) e = e.parent;
  12638. return e;
  12639. },
  12640. getSaveObject: function () {
  12641. var e = this.load;
  12642. return (
  12643. (e.closed = this.closed),
  12644. this.__rememberedObjects.length > 0 &&
  12645. ((e.preset = this.preset),
  12646. e.remembered || (e.remembered = {}),
  12647. (e.remembered[this.preset] = b(this))),
  12648. (e.folders = {}),
  12649. f.each(this.__folders, function (t, i) {
  12650. e.folders[i] = t.getSaveObject();
  12651. }),
  12652. e
  12653. );
  12654. },
  12655. save: function () {
  12656. this.load.remembered || (this.load.remembered = {}),
  12657. (this.load.remembered[this.preset] = b(this)),
  12658. T(this, !1),
  12659. this.saveToLocalStorageIfPossible();
  12660. },
  12661. saveAs: function (e) {
  12662. this.load.remembered ||
  12663. ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
  12664. (this.load.remembered[e] = b(this)),
  12665. (this.preset = e),
  12666. w(this, e, !0),
  12667. this.saveToLocalStorageIfPossible();
  12668. },
  12669. revert: function (e) {
  12670. f.each(
  12671. this.__controllers,
  12672. function (t) {
  12673. this.getRoot().load.remembered
  12674. ? A(e || this.getRoot(), t)
  12675. : t.setValue(t.initialValue);
  12676. },
  12677. this
  12678. ),
  12679. f.each(this.__folders, function (e) {
  12680. e.revert(e);
  12681. }),
  12682. e || T(this.getRoot(), !1);
  12683. },
  12684. listen: function (e) {
  12685. var t = 0 == this.__listening.length;
  12686. this.__listening.push(e), t && x(this.__listening);
  12687. },
  12688. }),
  12689. V
  12690. );
  12691. })(
  12692. n.utils.css,
  12693. '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>',
  12694. ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n",
  12695. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  12696. return function (s, l) {
  12697. var c = s[l];
  12698. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  12699. ? new e(s, l, arguments[2])
  12700. : a.isNumber(c)
  12701. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  12702. ? new i(s, l, arguments[2], arguments[3])
  12703. : new t(s, l, {
  12704. min: arguments[2],
  12705. max: arguments[3],
  12706. })
  12707. : a.isString(c)
  12708. ? new n(s, l)
  12709. : a.isFunction(c)
  12710. ? new r(s, l, '')
  12711. : a.isBoolean(c)
  12712. ? new o(s, l)
  12713. : void 0;
  12714. };
  12715. })(
  12716. n.controllers.OptionController,
  12717. n.controllers.NumberControllerBox,
  12718. n.controllers.NumberControllerSlider,
  12719. (n.controllers.StringController = (function (e, t, i) {
  12720. var n = function (e, i) {
  12721. function r() {
  12722. a.setValue(a.__input.value);
  12723. }
  12724. function o() {
  12725. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue());
  12726. }
  12727. n.superclass.call(this, e, i);
  12728. var a = this;
  12729. (this.__input = document.createElement('input')),
  12730. this.__input.setAttribute('type', 'text'),
  12731. t.bind(this.__input, 'keyup', r),
  12732. t.bind(this.__input, 'change', r),
  12733. t.bind(this.__input, 'blur', o),
  12734. t.bind(this.__input, 'keydown', function (e) {
  12735. 13 === e.keyCode && this.blur();
  12736. }),
  12737. this.updateDisplay(),
  12738. this.domElement.appendChild(this.__input);
  12739. };
  12740. return (
  12741. (n.superclass = e),
  12742. i.extend(n.prototype, e.prototype, {
  12743. updateDisplay: function () {
  12744. return (
  12745. t.isActive(this.__input) || (this.__input.value = this.getValue()),
  12746. n.superclass.prototype.updateDisplay.call(this)
  12747. );
  12748. },
  12749. }),
  12750. n
  12751. );
  12752. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12753. n.controllers.FunctionController,
  12754. n.controllers.BooleanController,
  12755. n.utils.common
  12756. )),
  12757. n.controllers.Controller,
  12758. n.controllers.BooleanController,
  12759. n.controllers.FunctionController,
  12760. n.controllers.NumberControllerBox,
  12761. n.controllers.NumberControllerSlider,
  12762. n.controllers.OptionController,
  12763. (n.controllers.ColorController = (function (e, t, i, n, r) {
  12764. function o(e, t, i, n) {
  12765. (e.style.background = ''),
  12766. r.each(l, function (r) {
  12767. e.style.cssText +=
  12768. 'background: ' +
  12769. r +
  12770. 'linear-gradient(' +
  12771. t +
  12772. ', ' +
  12773. i +
  12774. ' 0%, ' +
  12775. n +
  12776. ' 100%); ';
  12777. });
  12778. }
  12779. function a(e) {
  12780. (e.style.background = ''),
  12781. (e.style.cssText +=
  12782. 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  12783. (e.style.cssText +=
  12784. 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12785. (e.style.cssText +=
  12786. 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12787. (e.style.cssText +=
  12788. 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12789. (e.style.cssText +=
  12790. 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);');
  12791. }
  12792. var s = function (e, l) {
  12793. function c(e) {
  12794. p(e), t.bind(window, 'mousemove', p), t.bind(window, 'mouseup', h);
  12795. }
  12796. function h() {
  12797. t.unbind(window, 'mousemove', p), t.unbind(window, 'mouseup', h);
  12798. }
  12799. function u() {
  12800. var e = n(this.value);
  12801. e !== !1
  12802. ? ((g.__color.__state = e), g.setValue(g.__color.toOriginal()))
  12803. : (this.value = g.__color.toString());
  12804. }
  12805. function d() {
  12806. t.unbind(window, 'mousemove', f), t.unbind(window, 'mouseup', d);
  12807. }
  12808. function p(e) {
  12809. e.preventDefault();
  12810. var i = t.getWidth(g.__saturation_field),
  12811. n = t.getOffset(g.__saturation_field),
  12812. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  12813. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  12814. return (
  12815. o > 1 ? (o = 1) : o < 0 && (o = 0),
  12816. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12817. (g.__color.v = o),
  12818. (g.__color.s = r),
  12819. g.setValue(g.__color.toOriginal()),
  12820. !1
  12821. );
  12822. }
  12823. function f(e) {
  12824. e.preventDefault();
  12825. var i = t.getHeight(g.__hue_field),
  12826. n = t.getOffset(g.__hue_field),
  12827. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  12828. return (
  12829. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12830. (g.__color.h = 360 * r),
  12831. g.setValue(g.__color.toOriginal()),
  12832. !1
  12833. );
  12834. }
  12835. s.superclass.call(this, e, l),
  12836. (this.__color = new i(this.getValue())),
  12837. (this.__temp = new i(0));
  12838. var g = this;
  12839. (this.domElement = document.createElement('div')),
  12840. t.makeSelectable(this.domElement, !1),
  12841. (this.__selector = document.createElement('div')),
  12842. (this.__selector.className = 'selector'),
  12843. (this.__saturation_field = document.createElement('div')),
  12844. (this.__saturation_field.className = 'saturation-field'),
  12845. (this.__field_knob = document.createElement('div')),
  12846. (this.__field_knob.className = 'field-knob'),
  12847. (this.__field_knob_border = '2px solid '),
  12848. (this.__hue_knob = document.createElement('div')),
  12849. (this.__hue_knob.className = 'hue-knob'),
  12850. (this.__hue_field = document.createElement('div')),
  12851. (this.__hue_field.className = 'hue-field'),
  12852. (this.__input = document.createElement('input')),
  12853. (this.__input.type = 'text'),
  12854. (this.__input_textShadow = '0 1px 1px '),
  12855. t.bind(this.__input, 'keydown', function (e) {
  12856. 13 === e.keyCode && u.call(this);
  12857. }),
  12858. t.bind(this.__input, 'blur', u),
  12859. t.bind(this.__selector, 'mousedown', function (e) {
  12860. t.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  12861. t.removeClass(g.__selector, 'drag');
  12862. });
  12863. });
  12864. var m = document.createElement('div');
  12865. r.extend(this.__selector.style, {
  12866. width: '122px',
  12867. height: '102px',
  12868. padding: '3px',
  12869. backgroundColor: '#222',
  12870. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)',
  12871. }),
  12872. r.extend(this.__field_knob.style, {
  12873. position: 'absolute',
  12874. width: '12px',
  12875. height: '12px',
  12876. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  12877. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  12878. borderRadius: '12px',
  12879. zIndex: 1,
  12880. }),
  12881. r.extend(this.__hue_knob.style, {
  12882. position: 'absolute',
  12883. width: '15px',
  12884. height: '2px',
  12885. borderRight: '4px solid #fff',
  12886. zIndex: 1,
  12887. }),
  12888. r.extend(this.__saturation_field.style, {
  12889. width: '100px',
  12890. height: '100px',
  12891. border: '1px solid #555',
  12892. marginRight: '3px',
  12893. display: 'inline-block',
  12894. cursor: 'pointer',
  12895. }),
  12896. r.extend(m.style, {
  12897. width: '100%',
  12898. height: '100%',
  12899. background: 'none',
  12900. }),
  12901. o(m, 'top', 'rgba(0,0,0,0)', '#000'),
  12902. r.extend(this.__hue_field.style, {
  12903. width: '15px',
  12904. height: '100px',
  12905. display: 'inline-block',
  12906. border: '1px solid #555',
  12907. cursor: 'ns-resize',
  12908. }),
  12909. a(this.__hue_field),
  12910. r.extend(this.__input.style, {
  12911. outline: 'none',
  12912. textAlign: 'center',
  12913. color: '#fff',
  12914. border: 0,
  12915. fontWeight: 'bold',
  12916. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)',
  12917. }),
  12918. t.bind(this.__saturation_field, 'mousedown', c),
  12919. t.bind(this.__field_knob, 'mousedown', c),
  12920. t.bind(this.__hue_field, 'mousedown', function (e) {
  12921. f(e), t.bind(window, 'mousemove', f), t.bind(window, 'mouseup', d);
  12922. }),
  12923. this.__saturation_field.appendChild(m),
  12924. this.__selector.appendChild(this.__field_knob),
  12925. this.__selector.appendChild(this.__saturation_field),
  12926. this.__selector.appendChild(this.__hue_field),
  12927. this.__hue_field.appendChild(this.__hue_knob),
  12928. this.domElement.appendChild(this.__input),
  12929. this.domElement.appendChild(this.__selector),
  12930. this.updateDisplay();
  12931. };
  12932. (s.superclass = e),
  12933. r.extend(s.prototype, e.prototype, {
  12934. updateDisplay: function () {
  12935. var e = n(this.getValue());
  12936. if (e !== !1) {
  12937. var t = !1;
  12938. r.each(
  12939. i.COMPONENTS,
  12940. function (i) {
  12941. if (
  12942. !r.isUndefined(e[i]) &&
  12943. !r.isUndefined(this.__color.__state[i]) &&
  12944. e[i] !== this.__color.__state[i]
  12945. )
  12946. return (t = !0), {};
  12947. },
  12948. this
  12949. ),
  12950. t && r.extend(this.__color.__state, e);
  12951. }
  12952. r.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1);
  12953. var a = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
  12954. s = 255 - a;
  12955. r.extend(this.__field_knob.style, {
  12956. marginLeft: 100 * this.__color.s - 7 + 'px',
  12957. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  12958. backgroundColor: this.__temp.toString(),
  12959. border: this.__field_knob_border + 'rgb(' + a + ',' + a + ',' + a + ')',
  12960. }),
  12961. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  12962. (this.__temp.s = 1),
  12963. (this.__temp.v = 1),
  12964. o(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  12965. r.extend(this.__input.style, {
  12966. backgroundColor: (this.__input.value = this.__color.toString()),
  12967. color: 'rgb(' + a + ',' + a + ',' + a + ')',
  12968. textShadow:
  12969. this.__input_textShadow + 'rgba(' + s + ',' + s + ',' + s + ',.7)',
  12970. });
  12971. },
  12972. });
  12973. var l = ['-moz-', '-o-', '-webkit-', '-ms-', ''];
  12974. return s;
  12975. })(
  12976. n.controllers.Controller,
  12977. n.dom.dom,
  12978. (n.color.Color = (function (e, t, i, n) {
  12979. function r(e, t, i) {
  12980. Object.defineProperty(e, t, {
  12981. get: function () {
  12982. return 'RGB' === this.__state.space
  12983. ? this.__state[t]
  12984. : (a(this, t, i), this.__state[t]);
  12985. },
  12986. set: function (e) {
  12987. 'RGB' !== this.__state.space &&
  12988. (a(this, t, i), (this.__state.space = 'RGB')),
  12989. (this.__state[t] = e);
  12990. },
  12991. });
  12992. }
  12993. function o(e, t) {
  12994. Object.defineProperty(e, t, {
  12995. get: function () {
  12996. return 'HSV' === this.__state.space
  12997. ? this.__state[t]
  12998. : (s(this), this.__state[t]);
  12999. },
  13000. set: function (e) {
  13001. 'HSV' !== this.__state.space && (s(this), (this.__state.space = 'HSV')),
  13002. (this.__state[t] = e);
  13003. },
  13004. });
  13005. }
  13006. function a(e, i, r) {
  13007. if ('HEX' === e.__state.space)
  13008. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  13009. else {
  13010. if ('HSV' !== e.__state.space) throw 'Corrupted color state';
  13011. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v));
  13012. }
  13013. }
  13014. function s(e) {
  13015. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  13016. n.extend(e.__state, {
  13017. s: i.s,
  13018. v: i.v,
  13019. }),
  13020. n.isNaN(i.h)
  13021. ? n.isUndefined(e.__state.h) && (e.__state.h = 0)
  13022. : (e.__state.h = i.h);
  13023. }
  13024. var l = function () {
  13025. if (((this.__state = e.apply(this, arguments)), this.__state === !1))
  13026. throw 'Failed to interpret color arguments';
  13027. this.__state.a = this.__state.a || 1;
  13028. };
  13029. return (
  13030. (l.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  13031. n.extend(l.prototype, {
  13032. toString: function () {
  13033. return i(this);
  13034. },
  13035. toOriginal: function () {
  13036. return this.__state.conversion.write(this);
  13037. },
  13038. }),
  13039. r(l.prototype, 'r', 2),
  13040. r(l.prototype, 'g', 1),
  13041. r(l.prototype, 'b', 0),
  13042. o(l.prototype, 'h'),
  13043. o(l.prototype, 's'),
  13044. o(l.prototype, 'v'),
  13045. Object.defineProperty(l.prototype, 'a', {
  13046. get: function () {
  13047. return this.__state.a;
  13048. },
  13049. set: function (e) {
  13050. this.__state.a = e;
  13051. },
  13052. }),
  13053. Object.defineProperty(l.prototype, 'hex', {
  13054. get: function () {
  13055. return (
  13056. 'HEX' !== !this.__state.space &&
  13057. (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  13058. this.__state.hex
  13059. );
  13060. },
  13061. set: function (e) {
  13062. (this.__state.space = 'HEX'), (this.__state.hex = e);
  13063. },
  13064. }),
  13065. l
  13066. );
  13067. })(
  13068. n.color.interpret,
  13069. (n.color.math = (function () {
  13070. var e;
  13071. return {
  13072. hsv_to_rgb: function (e, t, i) {
  13073. var n = Math.floor(e / 60) % 6,
  13074. r = e / 60 - Math.floor(e / 60),
  13075. o = i * (1 - t),
  13076. a = i * (1 - r * t),
  13077. s = i * (1 - (1 - r) * t),
  13078. l = [
  13079. [i, s, o],
  13080. [a, i, o],
  13081. [o, i, s],
  13082. [o, a, i],
  13083. [s, o, i],
  13084. [i, o, a],
  13085. ][n];
  13086. return {
  13087. r: 255 * l[0],
  13088. g: 255 * l[1],
  13089. b: 255 * l[2],
  13090. };
  13091. },
  13092. rgb_to_hsv: function (e, t, i) {
  13093. var n,
  13094. r,
  13095. o = Math.min(e, t, i),
  13096. a = Math.max(e, t, i),
  13097. s = a - o;
  13098. return 0 == a
  13099. ? {
  13100. h: NaN,
  13101. s: 0,
  13102. v: 0,
  13103. }
  13104. : ((r = s / a),
  13105. (n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s),
  13106. (n /= 6),
  13107. n < 0 && (n += 1),
  13108. {
  13109. h: 360 * n,
  13110. s: r,
  13111. v: a / 255,
  13112. });
  13113. },
  13114. rgb_to_hex: function (e, t, i) {
  13115. var n = this.hex_with_component(0, 2, e);
  13116. return (
  13117. (n = this.hex_with_component(n, 1, t)),
  13118. (n = this.hex_with_component(n, 0, i))
  13119. );
  13120. },
  13121. component_from_hex: function (e, t) {
  13122. return (e >> (8 * t)) & 255;
  13123. },
  13124. hex_with_component: function (t, i, n) {
  13125. return (n << (e = 8 * i)) | (t & ~(255 << e));
  13126. },
  13127. };
  13128. })()),
  13129. n.color.toString,
  13130. n.utils.common
  13131. )),
  13132. n.color.interpret,
  13133. n.utils.common
  13134. )),
  13135. (n.utils.requestAnimationFrame = (function () {
  13136. return (
  13137. window.requestAnimationFrame ||
  13138. window.webkitRequestAnimationFrame ||
  13139. window.mozRequestAnimationFrame ||
  13140. window.oRequestAnimationFrame ||
  13141. window.msRequestAnimationFrame ||
  13142. function (e, t) {
  13143. window.setTimeout(e, 1e3 / 60);
  13144. }
  13145. );
  13146. })()),
  13147. (n.dom.CenteredDiv = (function (e, t) {
  13148. var i = function () {
  13149. (this.backgroundElement = document.createElement('div')),
  13150. t.extend(this.backgroundElement.style, {
  13151. backgroundColor: 'rgba(0,0,0,0.8)',
  13152. top: 0,
  13153. left: 0,
  13154. display: 'none',
  13155. zIndex: '1000',
  13156. opacity: 0,
  13157. WebkitTransition: 'opacity 0.2s linear',
  13158. }),
  13159. e.makeFullscreen(this.backgroundElement),
  13160. (this.backgroundElement.style.position = 'fixed'),
  13161. (this.domElement = document.createElement('div')),
  13162. t.extend(this.domElement.style, {
  13163. position: 'fixed',
  13164. display: 'none',
  13165. zIndex: '1001',
  13166. opacity: 0,
  13167. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',
  13168. }),
  13169. document.body.appendChild(this.backgroundElement),
  13170. document.body.appendChild(this.domElement);
  13171. var i = this;
  13172. e.bind(this.backgroundElement, 'click', function () {
  13173. i.hide();
  13174. });
  13175. };
  13176. return (
  13177. (i.prototype.show = function () {
  13178. var e = this;
  13179. (this.backgroundElement.style.display = 'block'),
  13180. (this.domElement.style.display = 'block'),
  13181. (this.domElement.style.opacity = 0),
  13182. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  13183. this.layout(),
  13184. t.defer(function () {
  13185. (e.backgroundElement.style.opacity = 1),
  13186. (e.domElement.style.opacity = 1),
  13187. (e.domElement.style.webkitTransform = 'scale(1)');
  13188. });
  13189. }),
  13190. (i.prototype.hide = function () {
  13191. var t = this,
  13192. i = function () {
  13193. (t.domElement.style.display = 'none'),
  13194. (t.backgroundElement.style.display = 'none'),
  13195. e.unbind(t.domElement, 'webkitTransitionEnd', i),
  13196. e.unbind(t.domElement, 'transitionend', i),
  13197. e.unbind(t.domElement, 'oTransitionEnd', i);
  13198. };
  13199. e.bind(this.domElement, 'webkitTransitionEnd', i),
  13200. e.bind(this.domElement, 'transitionend', i),
  13201. e.bind(this.domElement, 'oTransitionEnd', i),
  13202. (this.backgroundElement.style.opacity = 0),
  13203. (this.domElement.style.opacity = 0),
  13204. (this.domElement.style.webkitTransform = 'scale(1.1)');
  13205. }),
  13206. (i.prototype.layout = function () {
  13207. (this.domElement.style.left =
  13208. $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + 'px'),
  13209. (this.domElement.style.top =
  13210. $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + 'px');
  13211. }),
  13212. i
  13213. );
  13214. })(n.dom.dom, n.utils.common)),
  13215. n.dom.dom,
  13216. n.utils.common
  13217. ));
  13218. },
  13219. {},
  13220. ],
  13221. 94: [
  13222. function (e, t, i) {
  13223. (function (e) {
  13224. 'use strict';
  13225. function i(t) {
  13226. function i(e) {
  13227. for (
  13228. var t = [
  13229. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24,
  13230. 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103,
  13231. 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
  13232. 92, 95, 98, 112, 100, 103, 99,
  13233. ],
  13234. i = 0;
  13235. i < 64;
  13236. i++
  13237. ) {
  13238. var n = _((t[i] * e + 50) / 100);
  13239. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n);
  13240. }
  13241. for (
  13242. var r = [
  13243. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99,
  13244. 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13245. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13246. 99, 99, 99, 99,
  13247. ],
  13248. o = 0;
  13249. o < 64;
  13250. o++
  13251. ) {
  13252. var a = _((r[o] * e + 50) / 100);
  13253. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a);
  13254. }
  13255. for (
  13256. var s = [
  13257. 1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961,
  13258. 0.275899379,
  13259. ],
  13260. l = 0,
  13261. c = 0;
  13262. c < 8;
  13263. c++
  13264. )
  13265. for (var h = 0; h < 8; h++)
  13266. (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)),
  13267. (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)),
  13268. l++;
  13269. }
  13270. function n(e, t) {
  13271. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  13272. for (var a = 1; a <= e[o]; a++)
  13273. (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++;
  13274. i *= 2;
  13275. }
  13276. return r;
  13277. }
  13278. function r() {
  13279. (C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K));
  13280. }
  13281. function o() {
  13282. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  13283. for (var n = e; n < t; n++)
  13284. (P[32767 + n] = i),
  13285. (R[32767 + n] = []),
  13286. (R[32767 + n][1] = i),
  13287. (R[32767 + n][0] = n);
  13288. for (var r = -(t - 1); r <= -e; r++)
  13289. (P[32767 + r] = i),
  13290. (R[32767 + r] = []),
  13291. (R[32767 + r][1] = i),
  13292. (R[32767 + r][0] = t - 1 + r);
  13293. (e <<= 1), (t <<= 1);
  13294. }
  13295. }
  13296. function a() {
  13297. for (var e = 0; e < 256; e++)
  13298. (H[e] = 19595 * e),
  13299. (H[(e + 256) >> 0] = 38470 * e),
  13300. (H[(e + 512) >> 0] = 7471 * e + 32768),
  13301. (H[(e + 768) >> 0] = -11059 * e),
  13302. (H[(e + 1024) >> 0] = -21709 * e),
  13303. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  13304. (H[(e + 1536) >> 0] = -27439 * e),
  13305. (H[(e + 1792) >> 0] = -5329 * e);
  13306. }
  13307. function s(e) {
  13308. for (var t = e[0], i = e[1] - 1; i >= 0; )
  13309. t & (1 << i) && (N |= 1 << B),
  13310. i--,
  13311. B--,
  13312. B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0));
  13313. }
  13314. function l(e) {
  13315. D.push(e);
  13316. }
  13317. function c(e) {
  13318. l((e >> 8) & 255), l(255 & e);
  13319. }
  13320. function h(e, t) {
  13321. var i,
  13322. n,
  13323. r,
  13324. o,
  13325. a,
  13326. s,
  13327. l,
  13328. c,
  13329. h,
  13330. u = 0,
  13331. d = 8,
  13332. p = 64;
  13333. for (h = 0; h < d; ++h) {
  13334. (i = e[u]),
  13335. (n = e[u + 1]),
  13336. (r = e[u + 2]),
  13337. (o = e[u + 3]),
  13338. (a = e[u + 4]),
  13339. (s = e[u + 5]),
  13340. (l = e[u + 6]),
  13341. (c = e[u + 7]);
  13342. var f = i + c,
  13343. g = i - c,
  13344. m = n + l,
  13345. v = n - l,
  13346. A = r + s,
  13347. y = r - s,
  13348. C = o + a,
  13349. I = o - a,
  13350. E = f + C,
  13351. b = f - C,
  13352. w = m + A,
  13353. _ = m - A;
  13354. (e[u] = E + w), (e[u + 4] = E - w);
  13355. var T = 0.707106781 * (_ + b);
  13356. (e[u + 2] = b + T), (e[u + 6] = b - T), (E = I + y), (w = y + v), (_ = v + g);
  13357. var x = 0.382683433 * (E - _),
  13358. S = 0.5411961 * E + x,
  13359. M = 1.306562965 * _ + x,
  13360. R = 0.707106781 * w,
  13361. P = g + R,
  13362. L = g - R;
  13363. (e[u + 5] = L + S),
  13364. (e[u + 3] = L - S),
  13365. (e[u + 1] = P + M),
  13366. (e[u + 7] = P - M),
  13367. (u += 8);
  13368. }
  13369. for (u = 0, h = 0; h < d; ++h) {
  13370. (i = e[u]),
  13371. (n = e[u + 8]),
  13372. (r = e[u + 16]),
  13373. (o = e[u + 24]),
  13374. (a = e[u + 32]),
  13375. (s = e[u + 40]),
  13376. (l = e[u + 48]),
  13377. (c = e[u + 56]);
  13378. var D = i + c,
  13379. N = i - c,
  13380. B = n + l,
  13381. F = n - l,
  13382. V = r + s,
  13383. U = r - s,
  13384. k = o + a,
  13385. H = o - a,
  13386. G = D + k,
  13387. z = D - k,
  13388. W = B + V,
  13389. j = B - V;
  13390. (e[u] = G + W), (e[u + 32] = G - W);
  13391. var Y = 0.707106781 * (j + z);
  13392. (e[u + 16] = z + Y), (e[u + 48] = z - Y), (G = H + U), (W = U + F), (j = F + N);
  13393. var X = 0.382683433 * (G - j),
  13394. Z = 0.5411961 * G + X,
  13395. q = 1.306562965 * j + X,
  13396. K = 0.707106781 * W,
  13397. Q = N + K,
  13398. J = N - K;
  13399. (e[u + 40] = J + Z),
  13400. (e[u + 24] = J - Z),
  13401. (e[u + 8] = Q + q),
  13402. (e[u + 56] = Q - q),
  13403. u++;
  13404. }
  13405. var $;
  13406. for (h = 0; h < p; ++h)
  13407. ($ = e[h] * t[h]), (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0);
  13408. return O;
  13409. }
  13410. function u() {
  13411. c(65504),
  13412. c(16),
  13413. l(74),
  13414. l(70),
  13415. l(73),
  13416. l(70),
  13417. l(0),
  13418. l(1),
  13419. l(1),
  13420. l(0),
  13421. c(1),
  13422. c(1),
  13423. l(0),
  13424. l(0);
  13425. }
  13426. function d(e, t) {
  13427. c(65472),
  13428. c(17),
  13429. l(8),
  13430. c(t),
  13431. c(e),
  13432. l(3),
  13433. l(1),
  13434. l(17),
  13435. l(0),
  13436. l(2),
  13437. l(17),
  13438. l(1),
  13439. l(3),
  13440. l(17),
  13441. l(1);
  13442. }
  13443. function p() {
  13444. c(65499), c(132), l(0);
  13445. for (var e = 0; e < 64; e++) l(T[e]);
  13446. l(1);
  13447. for (var t = 0; t < 64; t++) l(x[t]);
  13448. }
  13449. function f() {
  13450. c(65476), c(418), l(0);
  13451. for (var e = 0; e < 16; e++) l(z[e + 1]);
  13452. for (var t = 0; t <= 11; t++) l(W[t]);
  13453. l(16);
  13454. for (var i = 0; i < 16; i++) l(j[i + 1]);
  13455. for (var n = 0; n <= 161; n++) l(Y[n]);
  13456. l(1);
  13457. for (var r = 0; r < 16; r++) l(X[r + 1]);
  13458. for (var o = 0; o <= 11; o++) l(Z[o]);
  13459. l(17);
  13460. for (var a = 0; a < 16; a++) l(q[a + 1]);
  13461. for (var s = 0; s <= 161; s++) l(K[s]);
  13462. }
  13463. function g() {
  13464. c(65498), c(12), l(3), l(1), l(0), l(2), l(17), l(3), l(17), l(0), l(63), l(0);
  13465. }
  13466. function m(e, t, i, n, r) {
  13467. for (
  13468. var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0;
  13469. f < d;
  13470. ++f
  13471. )
  13472. L[G[f]] = p[f];
  13473. var g = L[0] - i;
  13474. (i = L[0]), 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]));
  13475. for (var m = 63; m > 0 && 0 == L[m]; m--);
  13476. if (0 == m) return s(a), i;
  13477. for (var v, A = 1; A <= m; ) {
  13478. for (var y = A; 0 == L[A] && A <= m; ++A);
  13479. var C = A - y;
  13480. if (C >= c) {
  13481. v = C >> 4;
  13482. for (var I = 1; I <= v; ++I) s(l);
  13483. C &= 15;
  13484. }
  13485. (o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++;
  13486. }
  13487. return m != u && s(a), i;
  13488. }
  13489. function v() {
  13490. for (var e = String.fromCharCode, t = 0; t < 256; t++) k[t] = e(t);
  13491. }
  13492. function A(e) {
  13493. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  13494. var t = 0;
  13495. (t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i(t), (w = e);
  13496. }
  13497. }
  13498. function y() {
  13499. var e = new Date().getTime();
  13500. t || (t = 50), v(), r(), o(), a(), A(t);
  13501. new Date().getTime() - e;
  13502. }
  13503. var C,
  13504. I,
  13505. E,
  13506. b,
  13507. w,
  13508. _ = (Math.round, Math.floor),
  13509. T = new Array(64),
  13510. x = new Array(64),
  13511. S = new Array(64),
  13512. M = new Array(64),
  13513. R = new Array(65535),
  13514. P = new Array(65535),
  13515. O = new Array(64),
  13516. L = new Array(64),
  13517. D = [],
  13518. N = 0,
  13519. B = 7,
  13520. F = new Array(64),
  13521. V = new Array(64),
  13522. U = new Array(64),
  13523. k = new Array(256),
  13524. H = new Array(2048),
  13525. G = [
  13526. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41,
  13527. 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38,
  13528. 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63,
  13529. ],
  13530. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  13531. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13532. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  13533. Y = [
  13534. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145,
  13535. 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24,
  13536. 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72,
  13537. 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115,
  13538. 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147,
  13539. 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178,
  13540. 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  13541. 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232,
  13542. 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
  13543. ],
  13544. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  13545. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13546. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  13547. K = [
  13548. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66,
  13549. 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37,
  13550. 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71,
  13551. 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106,
  13552. 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138,
  13553. 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169,
  13554. 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200,
  13555. 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231,
  13556. 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250,
  13557. ];
  13558. (this.encode = function (t, i) {
  13559. var n = (new Date().getTime(), i.quality);
  13560. n && A(n),
  13561. (D = new Array()),
  13562. (N = 0),
  13563. (B = 7),
  13564. c(65496),
  13565. u(),
  13566. p(),
  13567. d(t.width, t.height),
  13568. f(),
  13569. g();
  13570. var r = 0,
  13571. o = 0,
  13572. a = 0;
  13573. (N = 0), (B = 7), (this.encode.displayName = '_encode_');
  13574. for (
  13575. var l,
  13576. h,
  13577. v,
  13578. y,
  13579. w,
  13580. _,
  13581. T,
  13582. x,
  13583. R,
  13584. P = t.data,
  13585. O = t.width,
  13586. L = t.height,
  13587. k = i.flipY,
  13588. G = 4 * O,
  13589. z = k ? L : 0,
  13590. W = k ? -8 : 8;
  13591. (k && z > 0) || (!k && z < L);
  13592. ) {
  13593. for (l = 0; l < G; ) {
  13594. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  13595. (x = (k ? 63 - R : R) >> 3),
  13596. (T = 4 * (7 & R)),
  13597. (_ = w + x * G + T),
  13598. z + x >= L && (_ -= G * (z + 1 + x - L)),
  13599. l + T >= G && (_ -= l + T - G + 4),
  13600. (h = P[_++]),
  13601. (v = P[_++]),
  13602. (y = P[_++]),
  13603. (F[R] = ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) - 128),
  13604. (V[R] =
  13605. ((H[(h + 768) >> 0] + H[(v + 1024) >> 0] + H[(y + 1280) >> 0]) >> 16) -
  13606. 128),
  13607. (U[R] =
  13608. ((H[(h + 1280) >> 0] + H[(v + 1536) >> 0] + H[(y + 1792) >> 0]) >> 16) -
  13609. 128);
  13610. (r = m(F, S, r, C, E)), (o = m(V, M, o, I, b)), (a = m(U, M, a, I, b)), (l += 32);
  13611. }
  13612. z += W;
  13613. }
  13614. if (B >= 0) {
  13615. var j = [];
  13616. (j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j);
  13617. }
  13618. return c(65497), new e(D);
  13619. }),
  13620. y();
  13621. }
  13622. function n(e, t) {
  13623. (t = t || {}), (t.quality = t.quality || 50);
  13624. var n = t.quality,
  13625. r = new i(n),
  13626. o = r.encode(e, t);
  13627. return {
  13628. data: o,
  13629. width: e.width,
  13630. height: e.height,
  13631. };
  13632. }
  13633. t.exports.encode = n;
  13634. }.call(this, e('buffer').Buffer));
  13635. },
  13636. {
  13637. buffer: 198,
  13638. },
  13639. ],
  13640. 95: [
  13641. function (e, t, i) {
  13642. 'use strict';
  13643. !(function () {
  13644. if (
  13645. ('performance' in window == !1 && (window.performance = {}),
  13646. (Date.now =
  13647. Date.now ||
  13648. function () {
  13649. return new Date().getTime();
  13650. }),
  13651. 'now' in window.performance == !1)
  13652. ) {
  13653. var e = Date.now();
  13654. performance.timing &&
  13655. performance.timing.navigationStart &&
  13656. (e = performance.timing.navigationStart),
  13657. (window.performance.now = function () {
  13658. return Date.now() - e;
  13659. });
  13660. }
  13661. })();
  13662. },
  13663. {},
  13664. ],
  13665. 96: [
  13666. function (e, t, i) {
  13667. 'use strict';
  13668. var n = e('three');
  13669. (n.EffectComposer = function (e, t) {
  13670. if (((this.renderer = e), void 0 === t)) {
  13671. var i = {
  13672. minFilter: n.LinearFilter,
  13673. magFilter: n.LinearFilter,
  13674. format: n.RGBAFormat,
  13675. stencilBuffer: !1,
  13676. },
  13677. r = e.getSize();
  13678. t = new n.WebGLRenderTarget(r.width, r.height, i);
  13679. }
  13680. (this.renderTarget1 = t),
  13681. (this.renderTarget2 = t.clone()),
  13682. (this.writeBuffer = this.renderTarget1),
  13683. (this.readBuffer = this.renderTarget2),
  13684. (this.passes = []),
  13685. void 0 === n.CopyShader &&
  13686. console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  13687. (this.copyPass = new n.ShaderPass(n.CopyShader));
  13688. }),
  13689. (n.EffectComposer.prototype = {
  13690. swapBuffers: function () {
  13691. var e = this.readBuffer;
  13692. (this.readBuffer = this.writeBuffer), (this.writeBuffer = e);
  13693. },
  13694. addPass: function (e) {
  13695. this.passes.push(e);
  13696. },
  13697. insertPass: function (e, t) {
  13698. this.passes.splice(t, 0, e);
  13699. },
  13700. render: function (e) {
  13701. (this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2);
  13702. var t,
  13703. i,
  13704. r = !1,
  13705. o = this.passes.length;
  13706. for (i = 0; i < o; i++)
  13707. if (((t = this.passes[i]), t.enabled)) {
  13708. if (
  13709. (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r), t.needsSwap)
  13710. ) {
  13711. if (r) {
  13712. var a = this.renderer.context;
  13713. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  13714. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  13715. a.stencilFunc(a.EQUAL, 1, 4294967295);
  13716. }
  13717. this.swapBuffers();
  13718. }
  13719. t instanceof n.MaskPass ? (r = !0) : t instanceof n.ClearMaskPass && (r = !1);
  13720. }
  13721. },
  13722. reset: function (e) {
  13723. if (void 0 === e) {
  13724. var t = this.renderer.getSize();
  13725. (e = this.renderTarget1.clone()), e.setSize(t.width, t.height);
  13726. }
  13727. this.renderTarget1.dispose(),
  13728. this.renderTarget2.dispose(),
  13729. (this.renderTarget1 = e),
  13730. (this.renderTarget2 = e.clone()),
  13731. (this.writeBuffer = this.renderTarget1),
  13732. (this.readBuffer = this.renderTarget2);
  13733. },
  13734. setSize: function (e, t) {
  13735. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t);
  13736. this.passes.forEach((a) => {
  13737. //add for TransitionPass
  13738. a.setSize && a.setSize(e, t);
  13739. });
  13740. },
  13741. });
  13742. },
  13743. {
  13744. three: 217,
  13745. },
  13746. ],
  13747. 97: [
  13748. function (e, t, i) {
  13749. 'use strict';
  13750. var n = e('three');
  13751. (n.MaskPass = function (e, t) {
  13752. (this.scene = e),
  13753. (this.camera = t),
  13754. (this.enabled = !0),
  13755. (this.clear = !0),
  13756. (this.needsSwap = !1),
  13757. (this.inverse = !1);
  13758. }),
  13759. (n.MaskPass.prototype = {
  13760. render: function (e, t, i, n) {
  13761. var r = e.context;
  13762. r.colorMask(!1, !1, !1, !1), r.depthMask(!1);
  13763. var o, a;
  13764. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  13765. r.enable(r.STENCIL_TEST),
  13766. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  13767. r.stencilFunc(r.ALWAYS, o, 4294967295),
  13768. r.clearStencil(a),
  13769. e.render(this.scene, this.camera, i, this.clear),
  13770. e.render(this.scene, this.camera, t, this.clear),
  13771. r.colorMask(!0, !0, !0, !0),
  13772. r.depthMask(!0),
  13773. r.stencilFunc(r.EQUAL, 1, 4294967295),
  13774. r.stencilOp(r.KEEP, r.KEEP, r.KEEP);
  13775. },
  13776. }),
  13777. (n.ClearMaskPass = function () {
  13778. this.enabled = !0;
  13779. }),
  13780. (n.ClearMaskPass.prototype = {
  13781. render: function (e, t, i, n) {
  13782. var r = e.context;
  13783. r.disable(r.STENCIL_TEST);
  13784. },
  13785. });
  13786. },
  13787. {
  13788. three: 217,
  13789. },
  13790. ],
  13791. 98: [
  13792. function (e, t, i) {
  13793. 'use strict';
  13794. var n = e('three');
  13795. (n.RenderPass = function (e, t, i, r, o) {
  13796. (this.scene = e),
  13797. (this.camera = t),
  13798. (this.overrideMaterial = i),
  13799. (this.clearColor = r),
  13800. (this.clearAlpha = void 0 !== o ? o : 1),
  13801. (this.oldClearColor = new n.Color()),
  13802. (this.oldClearAlpha = 1),
  13803. (this.enabled = !0),
  13804. (this.clear = !0),
  13805. (this.needsSwap = !1);
  13806. }),
  13807. (n.RenderPass.prototype = {
  13808. render: function (e, t, i, n) {
  13809. (this.scene.overrideMaterial = this.overrideMaterial),
  13810. this.clearColor &&
  13811. (this.oldClearColor.copy(e.getClearColor()),
  13812. (this.oldClearAlpha = e.getClearAlpha()),
  13813. e.setClearColor(this.clearColor, this.clearAlpha)),
  13814. e.render(this.scene, this.camera, i, this.clear),
  13815. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  13816. (this.scene.overrideMaterial = null);
  13817. },
  13818. });
  13819. },
  13820. {
  13821. three: 217,
  13822. },
  13823. ],
  13824. 99: [
  13825. function (e, t, i) {
  13826. 'use strict';
  13827. var n = e('three');
  13828. (n.ShaderPass = function (e, t) {
  13829. (this.textureID = void 0 !== t ? t : 'tDiffuse'),
  13830. e instanceof n.ShaderMaterial
  13831. ? ((this.uniforms = e.uniforms), (this.material = e))
  13832. : e &&
  13833. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  13834. (this.material = new n.ShaderMaterial({
  13835. defines: e.defines || {},
  13836. uniforms: this.uniforms,
  13837. vertexShader: e.vertexShader,
  13838. fragmentShader: e.fragmentShader,
  13839. }))),
  13840. (this.renderToScreen = !1),
  13841. (this.enabled = !0),
  13842. (this.needsSwap = !0),
  13843. (this.clear = !1),
  13844. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  13845. (this.scene = new n.Scene()),
  13846. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  13847. this.scene.add(this.quad);
  13848. }),
  13849. (n.ShaderPass.prototype = {
  13850. render: function (e, t, i, n) {
  13851. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  13852. (this.quad.material = this.material),
  13853. this.renderToScreen
  13854. ? e.render(this.scene, this.camera)
  13855. : e.render(this.scene, this.camera, t, this.clear);
  13856. },
  13857. });
  13858. },
  13859. {
  13860. three: 217,
  13861. },
  13862. ],
  13863. 100: [
  13864. function (e, t, i) {
  13865. 'use strict';
  13866. var n = e('three');
  13867. n.CopyShader = {
  13868. uniforms: {
  13869. tDiffuse: {
  13870. type: 't',
  13871. value: null,
  13872. },
  13873. opacity: {
  13874. type: 'f',
  13875. value: 1,
  13876. },
  13877. },
  13878. vertexShader: [
  13879. 'varying vec2 vUv;',
  13880. 'void main() {',
  13881. 'vUv = uv;',
  13882. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13883. '}',
  13884. ].join('\n'),
  13885. fragmentShader: [
  13886. 'uniform float opacity;',
  13887. 'uniform sampler2D tDiffuse;',
  13888. 'varying vec2 vUv;',
  13889. 'void main() {',
  13890. 'vec4 texel = texture2D( tDiffuse, vUv );',
  13891. 'gl_FragColor = opacity * texel;',
  13892. '}',
  13893. ].join('\n'),
  13894. };
  13895. },
  13896. {
  13897. three: 217,
  13898. },
  13899. ],
  13900. 101: [
  13901. function (e, t, i) {
  13902. 'use strict';
  13903. var n = e('three');
  13904. n.HorizontalBlurShader = {
  13905. uniforms: {
  13906. tDiffuse: {
  13907. type: 't',
  13908. value: null,
  13909. },
  13910. h: {
  13911. type: 'f',
  13912. value: 1 / 512,
  13913. },
  13914. },
  13915. vertexShader: [
  13916. 'varying vec2 vUv;',
  13917. 'void main() {',
  13918. 'vUv = uv;',
  13919. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13920. '}',
  13921. ].join('\n'),
  13922. fragmentShader: [
  13923. 'uniform sampler2D tDiffuse;',
  13924. 'uniform float h;',
  13925. 'varying vec2 vUv;',
  13926. 'void main() {',
  13927. 'vec4 sum = vec4( 0.0 );',
  13928. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  13929. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  13930. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  13931. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  13932. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13933. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  13934. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  13935. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  13936. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  13937. 'gl_FragColor = sum;',
  13938. '}',
  13939. ].join('\n'),
  13940. };
  13941. },
  13942. {
  13943. three: 217,
  13944. },
  13945. ],
  13946. 102: [
  13947. function (e, t, i) {
  13948. 'use strict';
  13949. var n = e('three');
  13950. n.VerticalBlurShader = {
  13951. uniforms: {
  13952. tDiffuse: {
  13953. type: 't',
  13954. value: null,
  13955. },
  13956. v: {
  13957. type: 'f',
  13958. value: 1 / 512,
  13959. },
  13960. },
  13961. vertexShader: [
  13962. 'varying vec2 vUv;',
  13963. 'void main() {',
  13964. 'vUv = uv;',
  13965. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13966. '}',
  13967. ].join('\n'),
  13968. fragmentShader: [
  13969. 'uniform sampler2D tDiffuse;',
  13970. 'uniform float v;',
  13971. 'varying vec2 vUv;',
  13972. 'void main() {',
  13973. 'vec4 sum = vec4( 0.0 );',
  13974. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  13975. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  13976. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  13977. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  13978. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13979. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  13980. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  13981. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  13982. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  13983. 'gl_FragColor = sum;',
  13984. '}',
  13985. ].join('\n'),
  13986. };
  13987. },
  13988. {
  13989. three: 217,
  13990. },
  13991. ],
  13992. 103: [
  13993. function (e, t, i) {
  13994. 'use strict';
  13995. var n = e('three');
  13996. !(function () {
  13997. if (
  13998. ('performance' in window == 0 && (window.performance = {}),
  13999. 'now' in window.performance == 0)
  14000. ) {
  14001. var e = Date.now();
  14002. performance.timing &&
  14003. performance.timing.navigationStart &&
  14004. (e = performance.timing.navigationStart),
  14005. (window.performance.now = function () {
  14006. return Date.now() - e;
  14007. });
  14008. }
  14009. })(),
  14010. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  14011. var t,
  14012. i = this.extensions,
  14013. r = this.context;
  14014. if (e === n.RepeatWrapping) return r.REPEAT;
  14015. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE;
  14016. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT;
  14017. if (e === n.NearestFilter) return r.NEAREST;
  14018. if (e === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST;
  14019. if (e === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR;
  14020. if (e === n.LinearFilter) return r.LINEAR;
  14021. if (e === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST;
  14022. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR;
  14023. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE;
  14024. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4;
  14025. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1;
  14026. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5;
  14027. if (e === n.ByteType) return r.BYTE;
  14028. if (e === n.ShortType) return r.SHORT;
  14029. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT;
  14030. if (e === n.IntType) return r.INT;
  14031. if (e === n.UnsignedIntType) return r.UNSIGNED_INT;
  14032. if (e === n.FloatType) return r.FLOAT;
  14033. if (((t = i.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  14034. return t.HALF_FLOAT_OES;
  14035. if (e === n.AlphaFormat) return r.ALPHA;
  14036. if (e === n.RGBFormat) return r.RGB;
  14037. if (e === n.RGBAFormat) return r.RGBA;
  14038. if (e === n.LuminanceFormat) return r.LUMINANCE;
  14039. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA;
  14040. if (e === n.AddEquation) return r.FUNC_ADD;
  14041. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT;
  14042. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT;
  14043. if (e === n.ZeroFactor) return r.ZERO;
  14044. if (e === n.OneFactor) return r.ONE;
  14045. if (e === n.SrcColorFactor) return r.SRC_COLOR;
  14046. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR;
  14047. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA;
  14048. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA;
  14049. if (e === n.DstAlphaFactor) return r.DST_ALPHA;
  14050. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA;
  14051. if (e === n.DstColorFactor) return r.DST_COLOR;
  14052. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR;
  14053. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE;
  14054. if (((t = i.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  14055. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  14056. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  14057. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  14058. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  14059. }
  14060. if (((t = i.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  14061. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  14062. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  14063. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  14064. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  14065. }
  14066. if (
  14067. ((t = i.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)
  14068. )
  14069. return t.COMPRESSED_RGB_ETC1_WEBGL;
  14070. if (((t = i.get('EXT_blend_minmax')), null !== t)) {
  14071. if (e === n.MinEquation) return t.MIN_EXT;
  14072. if (e === n.MaxEquation) return t.MAX_EXT;
  14073. }
  14074. return 0;
  14075. }),
  14076. (n.WebGLState = function (e, t, i) {
  14077. var r = this,
  14078. o = new n.Vector4(),
  14079. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  14080. s = new Uint8Array(a),
  14081. l = new Uint8Array(a),
  14082. c = new Uint8Array(a),
  14083. h = {},
  14084. u = null,
  14085. d = null,
  14086. p = null,
  14087. f = null,
  14088. g = null,
  14089. m = null,
  14090. v = null,
  14091. A = null,
  14092. y = !1,
  14093. C = null,
  14094. I = null,
  14095. E = null,
  14096. b = null,
  14097. w = null,
  14098. _ = null,
  14099. T = null,
  14100. x = null,
  14101. S = null,
  14102. M = null,
  14103. R = null,
  14104. P = null,
  14105. O = null,
  14106. L = null,
  14107. D = null,
  14108. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  14109. B = void 0,
  14110. F = {},
  14111. V = new n.Vector4(),
  14112. U = null,
  14113. k = null,
  14114. H = new n.Vector4(),
  14115. G = new n.Vector4();
  14116. (this.init = function () {
  14117. this.clearColor(0, 0, 0, 1),
  14118. this.clearDepth(1),
  14119. this.clearStencil(0),
  14120. this.enable(e.DEPTH_TEST),
  14121. e.depthFunc(e.LEQUAL),
  14122. e.frontFace(e.CCW),
  14123. e.cullFace(e.BACK),
  14124. this.enable(e.CULL_FACE),
  14125. this.enable(e.BLEND),
  14126. e.blendEquation(e.FUNC_ADD),
  14127. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  14128. }),
  14129. (this.initAttributes = function () {
  14130. for (var e = 0, t = s.length; e < t; e++) s[e] = 0;
  14131. }),
  14132. (this.enableAttribute = function (i) {
  14133. if (
  14134. ((s[i] = 1), 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)), 0 !== c[i])
  14135. ) {
  14136. var n = t.get('ANGLE_instanced_arrays');
  14137. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0);
  14138. }
  14139. }),
  14140. (this.enableAttributeAndDivisor = function (t, i, n) {
  14141. (s[t] = 1),
  14142. 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)),
  14143. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i));
  14144. }),
  14145. (this.disableUnusedAttributes = function () {
  14146. for (var t = 0, i = l.length; t < i; t++)
  14147. l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  14148. }),
  14149. (this.enable = function (t) {
  14150. h[t] !== !0 && (e.enable(t), (h[t] = !0));
  14151. }),
  14152. (this.disable = function (t) {
  14153. h[t] !== !1 && (e.disable(t), (h[t] = !1));
  14154. }),
  14155. (this.getCompressedTextureFormats = function () {
  14156. if (
  14157. null === u &&
  14158. ((u = []),
  14159. t.get('WEBGL_compressed_texture_pvrtc') ||
  14160. t.get('WEBGL_compressed_texture_s3tc') ||
  14161. t.get('WEBGL_compressed_texture_etc1'))
  14162. )
  14163. for (
  14164. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  14165. n < i.length;
  14166. n++
  14167. )
  14168. u.push(i[n]);
  14169. return u;
  14170. }),
  14171. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  14172. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  14173. (t === d && h === y) ||
  14174. (t === n.AdditiveBlending
  14175. ? h
  14176. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14177. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  14178. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  14179. : t === n.SubtractiveBlending
  14180. ? h
  14181. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14182. e.blendFuncSeparate(
  14183. e.ZERO,
  14184. e.ZERO,
  14185. e.ONE_MINUS_SRC_COLOR,
  14186. e.ONE_MINUS_SRC_ALPHA
  14187. ))
  14188. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  14189. : t === n.MultiplyBlending
  14190. ? h
  14191. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14192. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  14193. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  14194. : h
  14195. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14196. e.blendFuncSeparate(
  14197. e.ONE,
  14198. e.ONE_MINUS_SRC_ALPHA,
  14199. e.ONE,
  14200. e.ONE_MINUS_SRC_ALPHA
  14201. ))
  14202. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14203. e.blendFuncSeparate(
  14204. e.SRC_ALPHA,
  14205. e.ONE_MINUS_SRC_ALPHA,
  14206. e.ONE,
  14207. e.ONE_MINUS_SRC_ALPHA
  14208. )),
  14209. (d = t),
  14210. (y = h)),
  14211. t === n.CustomBlending
  14212. ? ((s = s || r),
  14213. (l = l || o),
  14214. (c = c || a),
  14215. (r === p && s === m) ||
  14216. (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  14217. (o === f && a === g && l === v && c === A) ||
  14218. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  14219. (f = o),
  14220. (g = a),
  14221. (v = l),
  14222. (A = c)))
  14223. : ((p = null), (f = null), (g = null), (m = null), (v = null), (A = null));
  14224. }),
  14225. (this.setDepthFunc = function (t) {
  14226. if (C !== t) {
  14227. if (t)
  14228. switch (t) {
  14229. case n.NeverDepth:
  14230. e.depthFunc(e.NEVER);
  14231. break;
  14232. case n.AlwaysDepth:
  14233. e.depthFunc(e.ALWAYS);
  14234. break;
  14235. case n.LessDepth:
  14236. e.depthFunc(e.LESS);
  14237. break;
  14238. case n.LessEqualDepth:
  14239. e.depthFunc(e.LEQUAL);
  14240. break;
  14241. case n.EqualDepth:
  14242. e.depthFunc(e.EQUAL);
  14243. break;
  14244. case n.GreaterEqualDepth:
  14245. e.depthFunc(e.GEQUAL);
  14246. break;
  14247. case n.GreaterDepth:
  14248. e.depthFunc(e.GREATER);
  14249. break;
  14250. case n.NotEqualDepth:
  14251. e.depthFunc(e.NOTEQUAL);
  14252. break;
  14253. default:
  14254. e.depthFunc(e.LEQUAL);
  14255. }
  14256. else e.depthFunc(e.LEQUAL);
  14257. C = t;
  14258. }
  14259. }),
  14260. (this.setDepthTest = function (t) {
  14261. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  14262. }),
  14263. (this.setDepthWrite = function (t) {
  14264. I !== t && (e.depthMask(t), (I = t));
  14265. }),
  14266. (this.setColorWrite = function (t) {
  14267. E !== t && (e.colorMask(t, t, t, t), (E = t));
  14268. }),
  14269. (this.setStencilFunc = function (t, i, n) {
  14270. (w === t && _ === i && T === n) ||
  14271. (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n));
  14272. }),
  14273. (this.setStencilOp = function (t, i, n) {
  14274. (x === t && S === i && M === n) ||
  14275. (e.stencilOp(t, i, n), (x = t), (S = i), (M = n));
  14276. }),
  14277. (this.setStencilTest = function (t) {
  14278. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  14279. }),
  14280. (this.setStencilWrite = function (t) {
  14281. b !== t && (e.stencilMask(t), (b = t));
  14282. }),
  14283. (this.setFlipSided = function (t) {
  14284. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t));
  14285. }),
  14286. (this.setLineWidth = function (t) {
  14287. t !== P && (e.lineWidth(t), (P = t));
  14288. }),
  14289. (this.setPolygonOffset = function (t, i, n) {
  14290. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  14291. !t || (O === i && L === n) || (e.polygonOffset(i, n), (O = i), (L = n));
  14292. }),
  14293. (this.getScissorTest = function () {
  14294. return D;
  14295. }),
  14296. (this.setScissorTest = function (t) {
  14297. (D = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST);
  14298. }),
  14299. (this.activeTexture = function (t) {
  14300. void 0 === t && (t = e.TEXTURE0 + N - 1), B !== t && (e.activeTexture(t), (B = t));
  14301. }),
  14302. (this.bindTexture = function (t, i) {
  14303. void 0 === B && r.activeTexture();
  14304. var n = F[B];
  14305. void 0 === n &&
  14306. ((n = {
  14307. type: void 0,
  14308. texture: void 0,
  14309. }),
  14310. (F[B] = n)),
  14311. (n.type === t && n.texture === i) ||
  14312. (e.bindTexture(t, i), (n.type = t), (n.texture = i));
  14313. }),
  14314. (this.compressedTexImage2D = function () {
  14315. try {
  14316. e.compressedTexImage2D.apply(e, arguments);
  14317. } catch (e) {
  14318. console.error(e);
  14319. }
  14320. }),
  14321. (this.texImage2D = function () {
  14322. try {
  14323. e.texImage2D.apply(e, arguments);
  14324. } catch (e) {
  14325. console.error(e);
  14326. }
  14327. }),
  14328. (this.clearColor = function (t, i, n, r) {
  14329. o.set(t, i, n, r), V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o));
  14330. }),
  14331. (this.clearDepth = function (t) {
  14332. U !== t && (e.clearDepth(t), (U = t));
  14333. }),
  14334. (this.clearStencil = function (t) {
  14335. k !== t && (e.clearStencil(t), (k = t));
  14336. }),
  14337. (this.scissor = function (t) {
  14338. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), H.copy(t));
  14339. }),
  14340. (this.viewport = function (t) {
  14341. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), G.copy(t));
  14342. }),
  14343. (this.reset = function () {
  14344. for (var t = 0; t < l.length; t++)
  14345. 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  14346. (h = {}),
  14347. (u = null),
  14348. (B = void 0),
  14349. (F = {}),
  14350. (d = null),
  14351. (E = null),
  14352. (I = null),
  14353. (b = null),
  14354. (R = null);
  14355. });
  14356. });
  14357. },
  14358. {
  14359. three: 217,
  14360. },
  14361. ],
  14362. 104: [
  14363. function (e, t, i) {
  14364. (function (i, n) {
  14365. 'use strict';
  14366. function r(e) {
  14367. this.urls = e;
  14368. var t = i(
  14369. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  14370. 'base64'
  14371. );
  14372. (this.builder = a.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'));
  14373. }
  14374. var o = e('three'),
  14375. a = e('protobufjs'),
  14376. s = e('../util/logger'),
  14377. l = (e('../util/common'), e('../util/ajax')),
  14378. c = e('../objects/Chunk'),
  14379. h = new s(n);
  14380. (r.prototype = {
  14381. constructor: r,
  14382. load: function (e, t, i, n) {
  14383. return (
  14384. h.time('download'),
  14385. l
  14386. .get(e, {
  14387. responseType: 'arraybuffer',
  14388. })
  14389. .done(
  14390. function (r) {
  14391. h.timeEnd('download'), this.parse(r, e, t, i, n);
  14392. }.bind(this)
  14393. )
  14394. .fail(n)
  14395. );
  14396. },
  14397. parse: function (e, t, i, n, r) {
  14398. var o = this.readProtobuf(e);
  14399. if (!o) return r();
  14400. try {
  14401. h.time('convert to webgl'),
  14402. this.convertProtobufToSceneObject(o, t, i, n, r),
  14403. h.timeEnd('convert to webgl');
  14404. } catch (e) {
  14405. return h.error('failed parsing .dam'), h.error(e.message), r();
  14406. }
  14407. },
  14408. readProtobuf: function (e) {
  14409. var t;
  14410. try {
  14411. h.time('parse proto'), (t = this.decoder.decode(e)), h.timeEnd('parse proto');
  14412. } catch (e) {
  14413. return h.error('failed parsing proto for .dam'), h.error(e.message), null;
  14414. }
  14415. return t;
  14416. },
  14417. convertProtobufToSceneObject: function (e, t, i, n, r) {
  14418. function a(e) {
  14419. var i = new o.BufferGeometry();
  14420. return (
  14421. i.addAttribute(
  14422. 'position',
  14423. new o.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)
  14424. ),
  14425. e.vertices.uv.length > 0 &&
  14426. i.addAttribute(
  14427. 'uv',
  14428. new o.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)
  14429. ),
  14430. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  14431. i.applyMatrix(s),
  14432. i.computeBoundingBox(),
  14433. new c({
  14434. geometry: i,
  14435. textureName: e.material_name,
  14436. name: e.chunk_name,
  14437. meshUrl: t,
  14438. })
  14439. );
  14440. }
  14441. if (0 === e.chunk.length) return h.warn('No chunks in damfile...'), i([]);
  14442. var s = new o.Matrix4();
  14443. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  14444. var l = e.chunk.map(a);
  14445. return l ? i(l) : (h.error('.dam protobuf came out with no chunks...'), r());
  14446. },
  14447. }),
  14448. (t.exports = r);
  14449. }.call(this, e('buffer').Buffer, '/js/loaders/DamLoader.js'));
  14450. },
  14451. {
  14452. '../objects/Chunk': 144,
  14453. '../util/ajax': 181,
  14454. '../util/common': 185,
  14455. '../util/logger': 189,
  14456. buffer: 198,
  14457. protobufjs: 214,
  14458. three: 217,
  14459. },
  14460. ],
  14461. 105: [
  14462. function (e, t, i) {
  14463. (function (i) {
  14464. 'use strict';
  14465. var n = (e('three'), e('../settings'), e('../util/browser'), e('./DamLoader')),
  14466. r = e('../util/logger'),
  14467. o = (e('../ab'), new r(i));
  14468. t.exports = {
  14469. getLoaders: function () {
  14470. return [
  14471. ['_50k', '.dam', n],
  14472. ['', '.dam', n],
  14473. ];
  14474. },
  14475. load: function (e, t, i, n, r, a) {
  14476. var s = this.getLoaders();
  14477. a = a || 0;
  14478. var l = s[a];
  14479. if (!l) return void (r && r('No suitable model file found...'));
  14480. var c = l[0],
  14481. h = l[1],
  14482. u = new l[2](t),
  14483. d = t.get(e + c + h);
  14484. d
  14485. ? (o.debug('Trying ' + c + h),
  14486. u.load(
  14487. d,
  14488. i,
  14489. n,
  14490. function () {
  14491. this.load(e, t, i, n, r, ++a);
  14492. }.bind(this)
  14493. ))
  14494. : (o.debug('Skipping ' + h + ', not available'), this.load(e, t, i, n, r, ++a));
  14495. },
  14496. };
  14497. }.call(this, '/js/loaders/ModelLoader.js'));
  14498. },
  14499. {
  14500. '../ab': 3,
  14501. '../settings': 166,
  14502. '../util/browser': 182,
  14503. '../util/logger': 189,
  14504. './DamLoader': 104,
  14505. three: 217,
  14506. },
  14507. ],
  14508. 106: [
  14509. function (e, t, i) {
  14510. (function (i) {
  14511. 'use strict';
  14512. var n = e('../util/common'),
  14513. r = e('../util/texture'),
  14514. o = e('../util/browser'),
  14515. a = e('../util/logger'),
  14516. s = e('../settings'),
  14517. l = new a(i);
  14518. t.exports = {
  14519. load: function (e, t) {
  14520. function i(e, i) {
  14521. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve());
  14522. }
  14523. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when();
  14524. var a = n.countUnique(
  14525. e.chunks.map(function (e) {
  14526. return e.textureName;
  14527. })
  14528. ),
  14529. c = e.chunks[0].meshUrl.indexOf('_50k') !== -1 ? '_50k' : '',
  14530. h = '_50k' === c ? 'high' : 'low';
  14531. s.minimalMemoryMode &&
  14532. 'high' === h &&
  14533. (o.detectSamsungS6()
  14534. ? (l.warn('Galaxy S6 cannot handle large textures, turning down quality.'),
  14535. (h = 'low'))
  14536. : a > s.maxMobileTextures &&
  14537. (l.warn('Model probably too large for mobile, turning down quality.'),
  14538. (h = 'low')));
  14539. var u = e.data.job.uuid + c + '_texture_jpg_' + h + '/',
  14540. d = $.Deferred(),
  14541. p = 0;
  14542. return (
  14543. e.chunks.forEach(function (t) {
  14544. if (!t.material.map && t.textureName) {
  14545. var n = e.urls.get(u + t.textureName);
  14546. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))));
  14547. }
  14548. }),
  14549. d.promise()
  14550. );
  14551. },
  14552. };
  14553. }.call(this, '/js/loaders/ModelTextureLoader.js'));
  14554. },
  14555. {
  14556. '../settings': 166,
  14557. '../util/browser': 182,
  14558. '../util/common': 185,
  14559. '../util/logger': 189,
  14560. '../util/texture': 194,
  14561. },
  14562. ],
  14563. 107: [
  14564. function (e, t, i) {
  14565. (function (i, n) {
  14566. 'use strict';
  14567. function r(e) {
  14568. (this.model = e),
  14569. (this.modelDataPath =
  14570. this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()),
  14571. (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'));
  14572. var t = i(
  14573. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  14574. 'base64'
  14575. ),
  14576. n = o.loadProto(t);
  14577. this.decoder = n.build('VisionModeldata');
  14578. }
  14579. var o = e('protobufjs'),
  14580. a = e('../util/ajax'),
  14581. s = (e('../util/common'), e('../util/math')),
  14582. l = e('../util/logger'),
  14583. c = new l(n);
  14584. (r.prototype.load = function () {
  14585. return this.modelDataPath
  14586. ? (c.info('Using vision.modeldata'), this.loadVisionModelData())
  14587. : this.sweepLocationsPath
  14588. ? (c.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  14589. : (c.warn('No sweep file found'), $.when([]));
  14590. }),
  14591. (r.prototype.loadVisionModelData = function () {
  14592. return a
  14593. .get(this.modelDataPath, {
  14594. responseType: 'arraybuffer',
  14595. })
  14596. .then(
  14597. function (e) {
  14598. var t;
  14599. try {
  14600. t = this.decoder.decode(e);
  14601. } catch (e) {
  14602. return (
  14603. c.warn('Could not decode vision.modeldata, trying sweep_locations.csv'),
  14604. this.loadSweepLocationsCSV()
  14605. );
  14606. }
  14607. var i = t.sweepLocations
  14608. .map(function (e) {
  14609. return {
  14610. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  14611. position: {
  14612. x: e.pose.translation.x,
  14613. y: e.pose.translation.y,
  14614. z: e.pose.translation.z,
  14615. },
  14616. quaternion: {
  14617. x: e.pose.rotation.x,
  14618. y: e.pose.rotation.y,
  14619. z: e.pose.rotation.z,
  14620. w: e.pose.rotation.w,
  14621. },
  14622. puck: {
  14623. x: e.puck.x,
  14624. y: e.puck.y,
  14625. z: e.puck.z,
  14626. },
  14627. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  14628. neighbours: e.visibles,
  14629. alignmentType: e.alignment_type,
  14630. };
  14631. })
  14632. .map(function (e) {
  14633. return (
  14634. (e.position = s.convertVisionVector(e.position)),
  14635. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14636. (e.puck = s.convertVisionVector(e.puck)),
  14637. e
  14638. );
  14639. });
  14640. return (
  14641. i.forEach(function (e) {
  14642. e.neighbours = e.neighbours.map(function (e) {
  14643. return i[e].uuid;
  14644. });
  14645. }),
  14646. i
  14647. );
  14648. }.bind(this),
  14649. function () {
  14650. return (
  14651. c.warn('Could not load vision.modeldata, trying sweep_locations.csv'),
  14652. this.loadSweepLocationsCSV()
  14653. );
  14654. }.bind(this)
  14655. );
  14656. }),
  14657. (r.prototype.loadSweepLocationsCSV = function () {
  14658. return a
  14659. .get(this.sweepLocationsPath)
  14660. .then(function (e) {
  14661. var t = e
  14662. .split('\n')
  14663. .map(function (e) {
  14664. return e.split(', ');
  14665. })
  14666. .filter(function (e) {
  14667. return e.length > 1;
  14668. })
  14669. .map(function (e) {
  14670. return {
  14671. uuid: e[0],
  14672. position: {
  14673. x: parseFloat(e[1]),
  14674. y: parseFloat(e[2]),
  14675. z: parseFloat(e[3]),
  14676. },
  14677. quaternion: {
  14678. x: parseFloat(e[4]),
  14679. y: parseFloat(e[5]),
  14680. z: parseFloat(e[6]),
  14681. w: parseFloat(e[7]),
  14682. },
  14683. };
  14684. })
  14685. .map(function (e) {
  14686. return (
  14687. (e.position = s.convertVisionVector(e.position)),
  14688. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14689. e
  14690. );
  14691. });
  14692. return t;
  14693. })
  14694. .fail(function () {
  14695. c.warn('Could not load sweep_locations.csv, no sweeps loaded.');
  14696. });
  14697. }),
  14698. (t.exports = r);
  14699. }.call(this, e('buffer').Buffer, '/js/loaders/SweepDataLoader.js'));
  14700. },
  14701. {
  14702. '../util/ajax': 181,
  14703. '../util/common': 185,
  14704. '../util/logger': 189,
  14705. '../util/math': 190,
  14706. buffer: 198,
  14707. protobufjs: 214,
  14708. },
  14709. ],
  14710. 108: [
  14711. function (e, t, i) {
  14712. (function (i) {
  14713. 'use strict';
  14714. function n() {
  14715. this.locale = null;
  14716. }
  14717. var r = e('../settings'),
  14718. o = e('../util/common'),
  14719. a = e('../util/logger'),
  14720. s = e('../enum/Locale'),
  14721. l = new a(i);
  14722. (n.prototype.init = function () {
  14723. var t;
  14724. switch (r.languageTag) {
  14725. case null:
  14726. case 'en':
  14727. case s.EN_US:
  14728. (this.locale = s.EN_US), (t = e('./strings-en-US'));
  14729. break;
  14730. case 'es':
  14731. case s.ES_MX:
  14732. (this.locale = s.ES_MX), (t = e('./strings-es-MX'));
  14733. break;
  14734. case 'fr':
  14735. case s.FR_FR:
  14736. (this.locale = s.FR_FR), (t = e('./strings-fr-FR'));
  14737. break;
  14738. case 'de':
  14739. case s.DE_DE:
  14740. (this.locale = s.DE_DE), (t = e('./strings-de-DE'));
  14741. break;
  14742. case 'ru':
  14743. case s.RU_RU:
  14744. (this.locale = s.RU_RU), (t = e('./strings-ru-RU'));
  14745. break;
  14746. case 'cn':
  14747. case s.CN_CN:
  14748. (this.locale = s.CN_CN), (t = e('./strings-cn-CN'));
  14749. break;
  14750. case 'jp':
  14751. case s.JP_JP:
  14752. (this.locale = s.JP_JP), (t = e('./strings-jp-JP'));
  14753. break;
  14754. default:
  14755. l.info("Unsupported language tag, defaulting to 'en-US'"),
  14756. (this.locale = s.EN_US),
  14757. (t = e('./strings-en-US'));
  14758. }
  14759. l.info("Using locale '" + this.locale + "'"), o.extendObject(this, t);
  14760. }),
  14761. (n.prototype.localizeGUI = function () {
  14762. var e = document.querySelector('#gui-parent');
  14763. this.localizeTree(e), this.localizeLoadingText();
  14764. }),
  14765. (n.prototype.localizeLoadingText = function () {
  14766. // var e = document.querySelector("#loader-cont")
  14767. // , t = e.getAttribute("title");
  14768. // e.removeAttribute("title"),
  14769. // e.setAttribute("data-status", t),
  14770. // e.classList.add(this.locale),
  14771. document.querySelector('#help-dialog').classList.add(this.locale),
  14772. document.querySelector('#interaction-modal').classList.add(this.locale),
  14773. document.querySelector('#gui').classList.add(this.locale);
  14774. }),
  14775. (n.prototype.localizeTree = function (e) {
  14776. var t,
  14777. i,
  14778. n = /{\[{ ?(\w+) ?}\]}/;
  14779. if (e.nodeType === Node.TEXT_NODE)
  14780. (t = e.data.match(n)), t && ((i = t[1]), (e.data = this.localizeText(i) || i));
  14781. else if (e.nodeType === Node.ELEMENT_NODE) {
  14782. var r = e.getAttribute('title');
  14783. r &&
  14784. ((t = r.match(n)),
  14785. t && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i)));
  14786. }
  14787. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling);
  14788. }),
  14789. (n.prototype.localizeText = function (t) {
  14790. var i = this[t];
  14791. return (
  14792. i ||
  14793. this.locale === s.EN_US ||
  14794. (l.warn(
  14795. "Localization key '" +
  14796. t +
  14797. "' not available for locale '" +
  14798. this.locale +
  14799. "', defaulting to English."
  14800. ),
  14801. (i = e('./strings-en-US')[t])),
  14802. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  14803. i
  14804. );
  14805. }),
  14806. (t.exports = new n());
  14807. }.call(this, '/js/localization/localize.js'));
  14808. },
  14809. {
  14810. '../enum/Locale': 31,
  14811. '../settings': 166,
  14812. '../util/common': 185,
  14813. '../util/logger': 189,
  14814. './strings-cn-CN': 109,
  14815. './strings-de-DE': 110,
  14816. './strings-en-US': 111,
  14817. './strings-es-MX': 112,
  14818. './strings-fr-FR': 113,
  14819. './strings-jp-JP': 114,
  14820. './strings-ru-RU': 115,
  14821. },
  14822. ],
  14823. 109: [
  14824. function (e, t, i) {
  14825. 'use strict';
  14826. t.exports = {
  14827. PAGE_TITLE: '',
  14828. LOADING: '正在加载',
  14829. PRESENTED_BY_CAPS: '呈现者:',
  14830. POWERED_BY: '技术支持:',
  14831. POWERED_BY_CAPS: '技术支持:',
  14832. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14833. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14834. PRESENTED_BY: '呈现者:',
  14835. MORE: '更多 ',
  14836. LESS: '更少 ',
  14837. TAG_CONTENT: 'tag™ 内容',
  14838. SHOW: '显示',
  14839. HIDE: '隐藏',
  14840. DOLLHOUSE: '场景屋',
  14841. FLOOR_PLAN: '楼层平面图',
  14842. OPEN_HIGHLIGHTS: '打开精彩片段',
  14843. CLOSE_HIGHLIGHTS: '关闭',
  14844. PREVIOUS: '上一个',
  14845. PLAY: '播放',
  14846. PAUSE: '暂停',
  14847. NEXT: '下一个',
  14848. EXPLORE_3D_SPACE: '探索 3D 空间',
  14849. VIEW_DOLLHOUSE: '观看场景屋',
  14850. SOCIAL_SHARING: '分享这个空间',
  14851. VIEW_IN_VR: '以 VR 观看',
  14852. VIEW_FULLSCREEN: '全屏观看',
  14853. EXIT_FULLSCREEN: ' 退出全屏',
  14854. ZOOM_IN: '放大',
  14855. ZOOM_OUT: '缩小',
  14856. FLOOR_NAME: '楼层',
  14857. FLOOR_ALL: 'ALL',
  14858. FLOOR_Lang: ['Floor', ''],
  14859. TERMS: '条款',
  14860. PORT_TERMS: 'port 条款',
  14861. TERMS_OF_USE: '使用条款',
  14862. CLOSE_TERMS: '关闭',
  14863. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  14864. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  14865. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  14866. WEBVR_ENTER_WEBVR: '进入 VR',
  14867. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  14868. WEBVR_LEARN_MORE: '了解更多',
  14869. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  14870. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  14871. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14872. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  14873. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  14874. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  14875. VR_LEARN_MORE_CAPS: '了解更多',
  14876. VR_PREVIOUS_CAPS: '上一个’,',
  14877. VR_NEXT_CAPS: '下一个',
  14878. VR_GOT_IT_CAPS: '明白了',
  14879. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  14880. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  14881. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  14882. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  14883. VR_WHAT_YOU_NEED: '关于...您需要什么',
  14884. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  14885. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  14886. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  14887. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14888. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14889. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14890. VR_APP: 'port VR 应用程序',
  14891. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14892. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14893. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  14894. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  14895. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  14896. VR_COMPATIBLE_ANDROID_LONG:
  14897. '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  14898. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  14899. VR_ANDROID_DVICES: 'Android 设备',
  14900. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  14901. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  14902. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  14903. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  14904. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  14905. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  14906. VR_DOWNLOAD_HERE: '在此下载',
  14907. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  14908. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  14909. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  14910. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  14911. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  14912. SHARE_TO: '分享到',
  14913. SHARE_LINK: '直接链接',
  14914. SHARE_EXPLORE: '探索',
  14915. SHARE_AT: '在',
  14916. SHARE_WITH: '使用',
  14917. SHARE_3D: '以 3D',
  14918. SHARE_COPIED: '已复制!',
  14919. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  14920. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  14921. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  14922. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  14923. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  14924. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  14925. ERROR_GENERIC_ACTIONS_3: ' 或',
  14926. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  14927. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  14928. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  14929. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  14930. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  14931. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  14932. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  14933. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  14934. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  14935. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  14936. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  14937. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  14938. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  14939. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  14940. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  14941. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  14942. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  14943. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  14944. LINK_TO_LOCATION: '地点链接',
  14945. MENU_COPY: '复制',
  14946. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  14947. ROTATE: '旋转',
  14948. MOVE: '移动',
  14949. INSIDE: '内部',
  14950. ZOOM: '缩放',
  14951. HELP: '小帮手',
  14952. HELP_NAVIGATION_TAB: '导航',
  14953. HELP_MORE_HELP_TAB: '更多帮助',
  14954. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  14955. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  14956. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  14957. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  14958. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  14959. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  14960. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  14961. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  14962. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  14963. HELP_DESKTOP_DOLLHOUSE_2A:
  14964. '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  14965. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  14966. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  14967. HELP_DESKTOP_FLOORPLAN_1A:
  14968. '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  14969. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  14970. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  14971. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  14972. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  14973. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  14974. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  14975. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  14976. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  14977. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  14978. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  14979. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  14980. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  14981. HELP_MORE_HLR_A: '精彩片段集锦',
  14982. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  14983. HELP_MORE_DOLLHOUSE_A: '场景屋',
  14984. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  14985. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  14986. HELP_MORE_FLOORS_A: '楼层选择器',
  14987. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  14988. HELP_MORE_TAG_A: 'tag™ 贴文',
  14989. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  14990. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  14991. HELP_MORE_ZOOM_A: '缩放控件',
  14992. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  14993. HELP_MORE_TOUR_A: '导览控件',
  14994. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  14995. HELP_MORE_INSIDE_A: '内部视图',
  14996. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  14997. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  14998. HELP_MORE_VR_A: 'VR 模式',
  14999. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  15000. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  15001. HELP_MORE_360_A: '360° 视图',
  15002. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  15003. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  15004. HELP_MORE_FULLSCREEN_A: '全屏',
  15005. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  15006. CLOSE: '关闭',
  15007. };
  15008. },
  15009. {},
  15010. ],
  15011. 110: [
  15012. function (e, t, i) {
  15013. 'use strict';
  15014. t.exports = {
  15015. PAGE_TITLE: '',
  15016. LOADING: 'Lädt',
  15017. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  15018. POWERED_BY: 'Angetrieben von',
  15019. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  15020. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15021. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15022. PRESENTED_BY: 'Präsentiert von ',
  15023. MORE: 'Mehr ',
  15024. LESS: 'Weniger ',
  15025. TAG_CONTENT: 'tag™ Inhalt',
  15026. SHOW: 'Anzeigen',
  15027. HIDE: 'Verbergen',
  15028. DOLLHOUSE: 'Puppenhaus',
  15029. FLOOR_PLAN: 'Grundriss',
  15030. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  15031. CLOSE_HIGHLIGHTS: 'Schließen',
  15032. PREVIOUS: 'Vorheriges',
  15033. PLAY: 'Abspielen',
  15034. PAUSE: 'Pausieren',
  15035. NEXT: 'Nächstes',
  15036. EXPLORE_3D_SPACE: 'Innenraum betreten',
  15037. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  15038. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  15039. VIEW_IN_VR: 'In VR ansehen',
  15040. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  15041. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  15042. ZOOM_IN: 'Vergrößern',
  15043. ZOOM_OUT: 'Verkleinern',
  15044. FLOOR_NAME: 'Etage ',
  15045. FLOOR_ALL: 'Alle',
  15046. TERMS: 'Bedingungen',
  15047. PORT_TERMS: 'port Bedingungen',
  15048. TERMS_OF_USE: 'Nutzungsbedingungen',
  15049. TERMS_TEXT_FILE: 'terms-de-DE.html',
  15050. CLOSE_TERMS: 'Schließen',
  15051. TERMS_FAIL:
  15052. 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  15053. HELP: 'Hilfe',
  15054. HELP_NAVIGATION_TAB: 'Navigation',
  15055. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  15056. CLOSE: 'Schließen',
  15057. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  15058. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  15059. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15060. HELP_DESKTOP_PANORAMA_1B:
  15061. 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  15062. HELP_DESKTOP_PANORAMA_2B:
  15063. 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  15064. HELP_DESKTOP_PANORAMA_3B:
  15065. 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  15066. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  15067. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  15068. HELP_DESKTOP_DOLLHOUSE_1A:
  15069. 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  15070. HELP_DESKTOP_DOLLHOUSE_2A:
  15071. 'Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.',
  15072. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15073. HELP_DESKTOP_DOLLHOUSE_1B:
  15074. 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  15075. HELP_DESKTOP_FLOORPLAN_1A:
  15076. 'Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.',
  15077. HELP_DESKTOP_FLOORPLAN_2A:
  15078. 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  15079. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15080. HELP_DESKTOP_FLOORPLAN_2B:
  15081. 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  15082. HELP_DESKTOP_FLOORPLAN_3B:
  15083. 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  15084. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  15085. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  15086. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  15087. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  15088. HELP_MOBILE_DOLLHOUSE_1:
  15089. 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  15090. HELP_MOBILE_DOLLHOUSE_2:
  15091. 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  15092. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  15093. HELP_MOBILE_FLOORPLAN_2:
  15094. 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  15095. HELP_MORE_HLR_A: 'Liste das Highlight',
  15096. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  15097. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  15098. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15099. 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15100. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15101. 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15102. HELP_MORE_FLOORS_A: 'Etage auswählen',
  15103. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  15104. HELP_MORE_TAG_A: 'tag™ Posts',
  15105. HELP_DESKTOP_MORE_TAG_B:
  15106. 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  15107. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  15108. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  15109. HELP_DESKTOP_MORE_ZOOM_B:
  15110. 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  15111. HELP_MORE_TOUR_A: 'Tour Steuerung',
  15112. HELP_DESKTOP_MORE_TOUR_B:
  15113. 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  15114. HELP_MORE_INSIDE_A: 'Innenansicht',
  15115. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  15116. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  15117. HELP_MORE_VR_A: 'VR Modus',
  15118. HELP_DESKTOP_MORE_VR_B:
  15119. 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  15120. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  15121. HELP_MORE_360_A: '360° Views Ansicht ',
  15122. HELP_DESKTOP_MORE_360_B:
  15123. 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15124. HELP_MOBILE_MORE_360_B:
  15125. 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15126. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  15127. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  15128. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  15129. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  15130. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  15131. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  15132. WEBVR_LEARN_MORE: 'Mehr Infos',
  15133. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15134. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15135. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15136. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  15137. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  15138. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15139. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15140. VR_APP: 'port VR App',
  15141. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  15142. VR_COMPATIBLE_ANDROID_LONG:
  15143. 'Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15144. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  15145. VR_APP_FOR_ANDROID: 'port VR app für Android',
  15146. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  15147. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15148. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  15149. VR_PREVIOUS_CAPS: 'ZURÜCK',
  15150. VR_NEXT_CAPS: 'WEITER',
  15151. VR_GOT_IT_CAPS: 'VERSTANDEN',
  15152. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  15153. VR_SHOW_UNSUPPORTED:
  15154. 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  15155. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  15156. VR_SHOW_IOS_2:
  15157. 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  15158. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  15159. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  15160. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15161. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15162. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15163. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  15164. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  15165. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  15166. VR_ANDROID_DETAIL:
  15167. 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15168. VR_ANDROID_DVICES: 'Android Geräte',
  15169. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  15170. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  15171. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  15172. VR_DOWNLOAD_HERE: 'Hier runterladen',
  15173. VR_REQUIRE_HEADSET:
  15174. 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  15175. VR_REDIRECT_TO_STORE:
  15176. 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  15177. VR_IMPROPER_EMBED:
  15178. 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  15179. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  15180. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  15181. SHARE_TO: 'Teilen auf',
  15182. SHARE_LINK: 'Direkter Link',
  15183. SHARE_EXPLORE: 'Umsehen',
  15184. SHARE_AT: 'auf',
  15185. SHARE_WITH: 'mit',
  15186. SHARE_3D: 'in 3D',
  15187. SHARE_COPIED: 'Kopiert!',
  15188. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  15189. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  15190. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  15191. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  15192. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15193. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  15194. ERROR_GENERIC_ACTIONS_3: ' oder ',
  15195. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15196. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  15197. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  15198. ERROR_WEBGL_IOS_SOLUTION:
  15199. 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  15200. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  15201. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  15202. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  15203. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  15204. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  15205. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  15206. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  15207. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  15208. ERROR_MISSING_URLS_EXPLANATION:
  15209. 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  15210. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  15211. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15212. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15213. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  15214. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  15215. LINK_TO_LOCATION: 'Link zu',
  15216. MENU_COPY: 'Kopieren',
  15217. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  15218. ROTATE: 'Drehen',
  15219. INSIDE: 'Drinnen',
  15220. MOVE: 'Bewegen',
  15221. ZOOM: 'Vergrößern',
  15222. };
  15223. },
  15224. {},
  15225. ],
  15226. 111: [
  15227. function (e, t, i) {
  15228. 'use strict';
  15229. t.exports = {
  15230. PAGE_TITLE: '',
  15231. LOADING: 'Loading',
  15232. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15233. POWERED_BY: 'powered by ',
  15234. POWERED_BY_CAPS: 'POWERED BY',
  15235. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  15236. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  15237. PRESENTED_BY: 'Presented by ',
  15238. MORE: 'More ',
  15239. LESS: 'Less ',
  15240. TAG_CONTENT: 'tag™ Content',
  15241. SHOW: 'Show',
  15242. HIDE: 'Hide',
  15243. DOLLHOUSE: 'Dollhouse',
  15244. FLOOR_PLAN: 'Floor plan',
  15245. OPEN_HIGHLIGHTS: 'Open Highlights',
  15246. CLOSE_HIGHLIGHTS: 'Close',
  15247. PREVIOUS: 'Previous',
  15248. PLAY: 'Play',
  15249. PAUSE: 'Pause',
  15250. NEXT: 'Next',
  15251. EXPLORE_3D_SPACE: 'Explore 3D Space',
  15252. VIEW_DOLLHOUSE: 'View dollhouse',
  15253. SOCIAL_SHARING: 'Share this Space',
  15254. VIEW_IN_VR: 'View in VR',
  15255. VIEW_FULLSCREEN: '全屏',
  15256. EXIT_FULLSCREEN: '退出全屏',
  15257. ZOOM_IN: 'Zoom in',
  15258. ZOOM_OUT: 'Zoom out',
  15259. FLOOR_NAME: 'Floor ',
  15260. FLOOR_ALL: '全部',
  15261. TERMS: 'Terms',
  15262. PORT_TERMS: 'port terms',
  15263. TERMS_OF_USE: 'Terms of Use',
  15264. TERMS_TEXT_FILE: 'terms-en-US.html',
  15265. CLOSE_TERMS: 'Close',
  15266. TERMS_FAIL:
  15267. 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  15268. HELP: 'Help',
  15269. HELP_NAVIGATION_TAB: 'Navigation',
  15270. HELP_MORE_HELP_TAB: 'More Help',
  15271. CLOSE: 'Close',
  15272. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  15273. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  15274. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  15275. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  15276. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  15277. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  15278. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  15279. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  15280. HELP_DESKTOP_DOLLHOUSE_1A:
  15281. 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  15282. HELP_DESKTOP_DOLLHOUSE_2A:
  15283. 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  15284. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  15285. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  15286. HELP_DESKTOP_FLOORPLAN_1A:
  15287. 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  15288. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  15289. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  15290. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  15291. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  15292. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  15293. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  15294. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  15295. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  15296. HELP_MOBILE_DOLLHOUSE_1:
  15297. 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  15298. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  15299. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  15300. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  15301. HELP_MORE_HLR_A: 'Highlight Reel',
  15302. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  15303. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  15304. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15305. 'Click to view and rotate a top-down view of the entire Space in 3D.',
  15306. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15307. 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  15308. HELP_MORE_FLOORS_A: 'Floor Selector',
  15309. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  15310. HELP_MORE_TAG_A: 'tag™ Posts',
  15311. HELP_DESKTOP_MORE_TAG_B:
  15312. 'Click or hover over for information about features in the Space.',
  15313. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  15314. HELP_MORE_ZOOM_A: 'Zoom Controls',
  15315. HELP_DESKTOP_MORE_ZOOM_B:
  15316. 'Use these controls to zoom in and out or use the scroll wheel.',
  15317. HELP_MORE_TOUR_A: 'Tour Controls',
  15318. HELP_DESKTOP_MORE_TOUR_B:
  15319. 'Play, pause, and navigate forward and backward through a Guided Tour.',
  15320. HELP_MORE_INSIDE_A: 'Inside View',
  15321. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  15322. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  15323. HELP_MORE_VR_A: 'VR Mode',
  15324. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  15325. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  15326. HELP_MORE_360_A: '360° Views',
  15327. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  15328. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  15329. HELP_MORE_FULLSCREEN_A: 'Full screen',
  15330. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  15331. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  15332. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  15333. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  15334. WEBVR_ENTER_WEBVR: 'ENTER VR',
  15335. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  15336. WEBVR_LEARN_MORE: 'Learn more',
  15337. WEBVR_VIEW_SPACE: 'View Space in VR',
  15338. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15339. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  15340. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  15341. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  15342. VR_PREVIOUS_CAPS: 'PREVIOUS',
  15343. VR_NEXT_CAPS: 'NEXT',
  15344. VR_GOT_IT_CAPS: 'GOT IT',
  15345. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  15346. VR_SHOW_UNSUPPORTED:
  15347. "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  15348. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  15349. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  15350. VR_WHAT_YOU_NEED: "What You'll Need For...",
  15351. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  15352. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  15353. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  15354. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  15355. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15356. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15357. VR_APP: 'port VR App',
  15358. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15359. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15360. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  15361. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  15362. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  15363. VR_COMPATIBLE_ANDROID_LONG:
  15364. 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15365. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15366. VR_ANDROID_DVICES: 'Android Devices',
  15367. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  15368. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  15369. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  15370. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  15371. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  15372. VR_APP_OPEN: 'Open with the port VR app instead',
  15373. VR_DOWNLOAD_HERE: 'Download here',
  15374. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  15375. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  15376. VR_IMPROPER_EMBED:
  15377. 'The port Space is not embedded properly to support VR in your web browser.',
  15378. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  15379. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  15380. SHARE_TO: 'Share to',
  15381. SHARE_LINK: 'Direct Link',
  15382. SHARE_EXPLORE: 'Explore ',
  15383. SHARE_AT: 'at',
  15384. SHARE_WITH: 'with',
  15385. SHARE_3D: ' in 3D',
  15386. SHARE_COPIED: 'Copied!',
  15387. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  15388. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  15389. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  15390. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  15391. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  15392. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  15393. ERROR_GENERIC_ACTIONS_3: ' or ',
  15394. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  15395. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  15396. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  15397. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  15398. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  15399. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  15400. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  15401. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  15402. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  15403. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  15404. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  15405. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  15406. ERROR_MISSING_URLS_EXPLANATION:
  15407. 'This is an older model. The website owner may have a new model on the way.',
  15408. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  15409. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  15410. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  15411. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  15412. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  15413. LINK_TO_LOCATION: 'Link to location',
  15414. MENU_COPY: 'Copy',
  15415. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  15416. ROTATE: 'Rotate',
  15417. INSIDE: 'Inside',
  15418. MOVE: 'Move',
  15419. ZOOM: 'Zoom',
  15420. };
  15421. },
  15422. {},
  15423. ],
  15424. 112: [
  15425. function (e, t, i) {
  15426. 'use strict';
  15427. t.exports = {
  15428. PAGE_TITLE: '',
  15429. LOADING: 'Cargando',
  15430. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  15431. POWERED_BY: 'potenciando por ',
  15432. POWERED_BY_CAPS: 'POTENCIADO POR ',
  15433. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  15434. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  15435. PRESENTED_BY: 'Presentado por ',
  15436. MORE: 'Más ',
  15437. LESS: 'Menos ',
  15438. TAG_CONTENT: 'Contenido de tag™',
  15439. SHOW: 'Mostrar',
  15440. HIDE: 'Ocultar',
  15441. DOLLHOUSE: 'Dollhouse',
  15442. FLOOR_PLAN: 'Planos',
  15443. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  15444. CLOSE_HIGHLIGHTS: 'Cerrar',
  15445. PREVIOUS: 'Anterior',
  15446. PLAY: 'Play',
  15447. PAUSE: 'Pausa',
  15448. NEXT: 'Siguiente',
  15449. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  15450. VIEW_DOLLHOUSE: 'Ver dollhouse',
  15451. SOCIAL_SHARING: 'Compartir este espacio',
  15452. VIEW_IN_VR: 'Ver en realidad virtual',
  15453. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  15454. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  15455. ZOOM_IN: 'Acercar',
  15456. ZOOM_OUT: 'Alejar',
  15457. FLOOR_NAME: 'Piso ',
  15458. FLOOR_ALL: 'Todas',
  15459. TERMS: 'Condiciones',
  15460. PORT_TERMS: 'port términos de uso',
  15461. TERMS_OF_USE: 'Términos de uso',
  15462. TERMS_TEXT_FILE: 'terms-es-MX.html',
  15463. CLOSE_TERMS: 'Cerrar',
  15464. TERMS_FAIL:
  15465. 'No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.',
  15466. HELP: 'Ayuda',
  15467. HELP_NAVIGATION_TAB: 'Navegación',
  15468. HELP_MORE_HELP_TAB: 'Más Ayuda',
  15469. CLOSE: 'Cerrar',
  15470. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  15471. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  15472. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15473. HELP_DESKTOP_PANORAMA_1B:
  15474. 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  15475. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  15476. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  15477. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  15478. HELP_DESKTOP_360_2B:
  15479. 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  15480. HELP_DESKTOP_DOLLHOUSE_1A:
  15481. 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  15482. HELP_DESKTOP_DOLLHOUSE_2A:
  15483. 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  15484. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15485. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  15486. HELP_DESKTOP_FLOORPLAN_1A:
  15487. 'Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.',
  15488. HELP_DESKTOP_FLOORPLAN_2A:
  15489. 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  15490. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15491. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  15492. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  15493. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  15494. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  15495. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  15496. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  15497. HELP_MOBILE_DOLLHOUSE_1:
  15498. 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  15499. HELP_MOBILE_DOLLHOUSE_2:
  15500. 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  15501. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  15502. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  15503. HELP_MORE_HLR_A: 'Galería destacada',
  15504. HELP_DESKTOP_MORE_HLR_B:
  15505. 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  15506. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  15507. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15508. 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  15509. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15510. 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  15511. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  15512. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  15513. HELP_MORE_TAG_A: 'tag™ Posts',
  15514. HELP_DESKTOP_MORE_TAG_B:
  15515. 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  15516. HELP_MOBILE_MORE_TAG_B:
  15517. 'Toque para obtener más información acerca de las características del espacio.',
  15518. HELP_MORE_ZOOM_A: 'Controles de zoom',
  15519. HELP_DESKTOP_MORE_ZOOM_B:
  15520. 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  15521. HELP_MORE_TOUR_A: 'Controles de recorrido',
  15522. HELP_DESKTOP_MORE_TOUR_B:
  15523. 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  15524. HELP_MORE_INSIDE_A: 'Vista interior',
  15525. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  15526. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  15527. HELP_MORE_VR_A: 'Modo de realidad virtual',
  15528. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15529. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15530. HELP_MORE_360_A: '360° Views',
  15531. HELP_DESKTOP_MORE_360_B:
  15532. 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  15533. HELP_MOBILE_MORE_360_B:
  15534. 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  15535. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  15536. HELP_DESKTOP_MORE_FULLSCREEN_B:
  15537. 'Expanda el escenario 3D para verlo en pantalla completa.',
  15538. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  15539. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  15540. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  15541. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  15542. WEBVR_LEARN_MORE: 'Más información',
  15543. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  15544. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15545. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  15546. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  15547. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  15548. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  15549. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  15550. VR_APP: 'port VR App',
  15551. VR_COMPATIBLE_ANDROID_LONG:
  15552. 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  15553. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  15554. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  15555. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  15556. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  15557. VR_PREVIOUS_CAPS: 'ANTERIOR',
  15558. VR_NEXT_CAPS: 'SIGUIENTE',
  15559. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  15560. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  15561. VR_SHOW_UNSUPPORTED:
  15562. 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  15563. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  15564. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  15565. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  15566. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  15567. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  15568. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15569. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15570. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15571. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  15572. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15573. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  15574. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  15575. VR_ANDROID_DVICES: 'Dispositivos Android',
  15576. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  15577. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  15578. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  15579. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  15580. VR_DOWNLOAD_HERE: 'Descargar aquí',
  15581. VR_REQUIRE_HEADSET:
  15582. 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  15583. VR_REDIRECT_TO_STORE:
  15584. 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  15585. VR_IMPROPER_EMBED:
  15586. 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  15587. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  15588. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  15589. SHARE_TO: 'Compartir en',
  15590. SHARE_LINK: 'Enlace directo',
  15591. SHARE_EXPLORE: 'Explorar ',
  15592. SHARE_AT: 'en',
  15593. SHARE_WITH: 'con',
  15594. SHARE_3D: ' en 3D',
  15595. SHARE_COPIED: '¡Copiado!',
  15596. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  15597. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  15598. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  15599. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  15600. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  15601. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  15602. ERROR_GENERIC_ACTIONS_3: ' o ',
  15603. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  15604. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  15605. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  15606. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  15607. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  15608. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  15609. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  15610. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  15611. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  15612. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  15613. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  15614. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  15615. ERROR_MISSING_URLS_EXPLANATION:
  15616. 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  15617. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  15618. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  15619. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  15620. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  15621. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  15622. LINK_TO_LOCATION: 'Enlace a la ubicación',
  15623. MENU_COPY: 'Copiar',
  15624. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  15625. ROTATE: 'Girar',
  15626. INSIDE: 'Interior',
  15627. MOVE: 'Moverse',
  15628. ZOOM: 'Acercar o alejar',
  15629. };
  15630. },
  15631. {},
  15632. ],
  15633. 113: [
  15634. function (e, t, i) {
  15635. 'use strict';
  15636. t.exports = {
  15637. PAGE_TITLE: '',
  15638. LOADING: 'Chargement',
  15639. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  15640. POWERED_BY: 'alimenté par ',
  15641. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  15642. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15643. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15644. PRESENTED_BY: 'Présenté par ',
  15645. MORE: 'Plus ',
  15646. LESS: 'Moins ',
  15647. TAG_CONTENT: 'Contenu tag™',
  15648. SHOW: 'Montrer',
  15649. HIDE: 'Cacher',
  15650. DOLLHOUSE: 'Dollhouse',
  15651. FLOOR_PLAN: 'Plan de sol',
  15652. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  15653. CLOSE_HIGHLIGHTS: 'Fermer',
  15654. PREVIOUS: 'Précédent',
  15655. PLAY: 'Lecture',
  15656. PAUSE: 'Pause',
  15657. NEXT: 'Suivant',
  15658. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  15659. VIEW_DOLLHOUSE: 'Voir dollhouse',
  15660. SOCIAL_SHARING: 'Partager cet espace',
  15661. VIEW_IN_VR: 'Voir en VR',
  15662. VIEW_FULLSCREEN: 'Plein écran',
  15663. EXIT_FULLSCREEN: 'Fermer plein écran',
  15664. ZOOM_IN: 'Zoom avant',
  15665. ZOOM_OUT: 'Zoom arrière',
  15666. FLOOR_NAME: 'Étage ',
  15667. FLOOR_ALL: 'Tous',
  15668. TERMS: 'Mentions légales',
  15669. PORT_TERMS: 'port mentions légales',
  15670. TERMS_OF_USE: "Conditions d'utilisation",
  15671. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  15672. CLOSE_TERMS: 'Fermer',
  15673. TERMS_FAIL:
  15674. "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  15675. HELP: 'Aide',
  15676. HELP_NAVIGATION_TAB: 'Navigation',
  15677. HELP_MORE_HELP_TAB: 'Aide',
  15678. CLOSE: 'Fermer',
  15679. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  15680. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  15681. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15682. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  15683. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  15684. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  15685. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15686. HELP_DESKTOP_360_2B:
  15687. 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  15688. HELP_DESKTOP_DOLLHOUSE_1A:
  15689. 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  15690. HELP_DESKTOP_DOLLHOUSE_2A:
  15691. 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  15692. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15693. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  15694. HELP_DESKTOP_FLOORPLAN_1A:
  15695. 'Faites un clic droit pour changer la position du plan sur l’écran.',
  15696. HELP_DESKTOP_FLOORPLAN_2A:
  15697. 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  15698. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15699. HELP_DESKTOP_FLOORPLAN_2B:
  15700. 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  15701. HELP_DESKTOP_FLOORPLAN_3B:
  15702. 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  15703. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  15704. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  15705. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  15706. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15707. HELP_MOBILE_DOLLHOUSE_1:
  15708. 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  15709. HELP_MOBILE_DOLLHOUSE_2:
  15710. 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  15711. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  15712. HELP_MOBILE_FLOORPLAN_2:
  15713. 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  15714. HELP_MORE_HLR_A: 'Carrousel',
  15715. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  15716. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  15717. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15718. 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  15719. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15720. 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  15721. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  15722. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  15723. HELP_MORE_TAG_A: 'tag™ Posts',
  15724. HELP_DESKTOP_MORE_TAG_B:
  15725. 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  15726. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  15727. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  15728. HELP_DESKTOP_MORE_ZOOM_B:
  15729. 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  15730. HELP_MORE_TOUR_A: 'Commandes de la visite',
  15731. HELP_DESKTOP_MORE_TOUR_B:
  15732. "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  15733. HELP_MORE_INSIDE_A: 'Vue intérieure',
  15734. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  15735. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  15736. HELP_MORE_VR_A: 'Mode RV',
  15737. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  15738. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  15739. HELP_MORE_360_A: 'Vues 360°',
  15740. HELP_DESKTOP_MORE_360_B:
  15741. 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15742. HELP_MOBILE_MORE_360_B:
  15743. 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15744. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  15745. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  15746. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  15747. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  15748. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  15749. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  15750. WEBVR_LEARN_MORE: 'En savoir plus',
  15751. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  15752. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15753. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  15754. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  15755. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  15756. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  15757. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  15758. VR_NEXT_CAPS: 'SUIVANT',
  15759. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  15760. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  15761. VR_SHOW_UNSUPPORTED:
  15762. 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  15763. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  15764. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  15765. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  15766. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  15767. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  15768. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  15769. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  15770. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15771. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15772. VR_APP: 'port VR App',
  15773. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15774. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15775. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  15776. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15777. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  15778. VR_COMPATIBLE_ANDROID_LONG:
  15779. 'Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus',
  15780. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  15781. VR_ANDROID_DVICES: 'Appareils Android',
  15782. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  15783. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  15784. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  15785. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  15786. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  15787. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  15788. VR_DOWNLOAD_HERE: 'Télécharger ici',
  15789. VR_REQUIRE_HEADSET:
  15790. "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  15791. VR_REDIRECT_TO_STORE:
  15792. "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  15793. VR_IMPROPER_EMBED:
  15794. "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  15795. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  15796. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  15797. SHARE_TO: 'Partager sur',
  15798. SHARE_LINK: 'Lien direct',
  15799. SHARE_EXPLORE: 'Explorer ',
  15800. SHARE_AT: 'à',
  15801. SHARE_WITH: 'avec',
  15802. SHARE_3D: ' en 3D',
  15803. SHARE_COPIED: 'Copié!',
  15804. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  15805. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  15806. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  15807. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  15808. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  15809. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  15810. ERROR_GENERIC_ACTIONS_3: ' ou ',
  15811. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  15812. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  15813. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  15814. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  15815. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  15816. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  15817. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  15818. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  15819. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  15820. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  15821. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  15822. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  15823. ERROR_MISSING_URLS_EXPLANATION:
  15824. 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  15825. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  15826. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  15827. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  15828. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  15829. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  15830. LINK_TO_LOCATION: "Lien vers l'emplacement",
  15831. MENU_COPY: 'Copie',
  15832. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  15833. ROTATE: 'Faire pivoter',
  15834. INSIDE: 'Intérieure',
  15835. MOVE: 'Se déplacer',
  15836. ZOOM: 'Zoom',
  15837. };
  15838. },
  15839. {},
  15840. ],
  15841. 114: [
  15842. function (e, t, i) {
  15843. 'use strict';
  15844. t.exports = {
  15845. PAGE_TITLE: '',
  15846. LOADING: '読み込み中',
  15847. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15848. POWERED_BY: 'powered by',
  15849. POWERED_BY_CAPS: 'POWERED BY',
  15850. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  15851. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  15852. PRESENTED_BY: 'Presented by ',
  15853. MORE: '全て表示 ',
  15854. LESS: '閉じる ',
  15855. TAG_CONTENT: 'tag™コンテンツ ',
  15856. SHOW: '表示',
  15857. HIDE: '非表示',
  15858. DOLLHOUSE: 'ドールハウス',
  15859. FLOOR_PLAN: 'フロアプラン',
  15860. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  15861. CLOSE_HIGHLIGHTS: '閉じる',
  15862. PREVIOUS: '前へ',
  15863. PLAY: '再生',
  15864. PAUSE: '一時停止',
  15865. NEXT: '次へ',
  15866. EXPLORE_3D_SPACE: '3DSpaceの探索',
  15867. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  15868. SOCIAL_SHARING: 'このSpaceを共有する',
  15869. VIEW_IN_VR: 'VRで表示',
  15870. VIEW_FULLSCREEN: 'フルスクリーン表示',
  15871. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  15872. ZOOM_IN: 'ズームイン',
  15873. ZOOM_OUT: 'ズームアウト',
  15874. FLOOR_NAME: 'フロア ',
  15875. FLOOR_ALL: 'すべて',
  15876. TERMS: '規約',
  15877. PORT_TERMS: 'port規約',
  15878. TERMS_OF_USE: '利用規約',
  15879. CLOSE_TERMS: '閉じる',
  15880. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  15881. TERMS_FAIL:
  15882. '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  15883. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  15884. WEBVR_ENTER_WEBVR: 'VRに入る',
  15885. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  15886. WEBVR_LEARN_MORE: 'もっと詳しく',
  15887. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  15888. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15889. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15890. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  15891. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  15892. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  15893. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  15894. VR_PREVIOUS_CAPS: '前へ',
  15895. VR_NEXT_CAPS: '次へ',
  15896. VR_GOT_IT_CAPS: '了解',
  15897. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  15898. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  15899. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  15900. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  15901. VR_WHAT_YOU_NEED: '必要なもの',
  15902. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  15903. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  15904. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  15905. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15906. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15907. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15908. VR_APP: 'port VRアプリ',
  15909. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15910. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  15911. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  15912. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  15913. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  15914. VR_COMPATIBLE_ANDROID_LONG:
  15915. 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  15916. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  15917. VR_ANDROID_DVICES: 'Androidデバイス',
  15918. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  15919. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  15920. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  15921. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  15922. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  15923. VR_APP_OPEN: 'port VRアプリで開く',
  15924. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  15925. VR_REQUIRE_HEADSET:
  15926. 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  15927. VR_REDIRECT_TO_STORE:
  15928. 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  15929. VR_IMPROPER_EMBED:
  15930. 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  15931. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  15932. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  15933. SHARE_TO: '共有先',
  15934. SHARE_LINK: 'ダイレクトリンク',
  15935. SHARE_EXPLORE: '探索',
  15936. SHARE_AT: '場所',
  15937. SHARE_WITH: '使用アプリ',
  15938. SHARE_3D: '3Dで',
  15939. SHARE_COPIED: 'コピーされました!',
  15940. ERROR_BROWSER_SOLUTION:
  15941. '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  15942. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  15943. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  15944. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  15945. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  15946. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  15947. ERROR_GENERIC_ACTIONS_3: 'または',
  15948. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  15949. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  15950. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  15951. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  15952. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  15953. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  15954. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  15955. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  15956. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  15957. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  15958. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  15959. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  15960. ERROR_MISSING_URLS_EXPLANATION:
  15961. 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  15962. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  15963. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  15964. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  15965. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  15966. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  15967. LINK_TO_LOCATION: 'ロケーションへのリンク',
  15968. MENU_COPY: 'コピー',
  15969. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  15970. ROTATE: '回転',
  15971. MOVE: '移動',
  15972. INSIDE: '内側',
  15973. ZOOM: 'ズーム',
  15974. HELP: 'ヘルプ',
  15975. HELP_NAVIGATION_TAB: 'ナビゲーション',
  15976. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  15977. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  15978. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  15979. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15980. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  15981. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  15982. HELP_DESKTOP_PANORAMA_3B:
  15983. 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  15984. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  15985. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  15986. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  15987. HELP_DESKTOP_DOLLHOUSE_2A:
  15988. '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  15989. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15990. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  15991. HELP_DESKTOP_FLOORPLAN_1A:
  15992. '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  15993. HELP_DESKTOP_FLOORPLAN_2A:
  15994. '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  15995. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15996. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  15997. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  15998. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  15999. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  16000. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  16001. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  16002. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  16003. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  16004. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  16005. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  16006. HELP_MORE_HLR_A: 'ハイライト',
  16007. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  16008. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  16009. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16010. 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  16011. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16012. 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  16013. HELP_MORE_FLOORS_A: 'フロアセレクター',
  16014. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  16015. HELP_MORE_TAG_A: 'tag™ Posts',
  16016. HELP_DESKTOP_MORE_TAG_B:
  16017. 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  16018. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  16019. HELP_MORE_ZOOM_A: 'ズームコントロール',
  16020. HELP_DESKTOP_MORE_ZOOM_B:
  16021. 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  16022. HELP_MORE_TOUR_A: 'ツアーコントロール',
  16023. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  16024. HELP_MORE_INSIDE_A: '内側ビュー',
  16025. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  16026. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  16027. HELP_MORE_VR_A: 'VRモード',
  16028. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  16029. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  16030. HELP_MORE_360_A: '360° Views',
  16031. HELP_DESKTOP_MORE_360_B:
  16032. 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  16033. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  16034. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  16035. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  16036. CLOSE: '閉じる',
  16037. };
  16038. },
  16039. {},
  16040. ],
  16041. 115: [
  16042. function (e, t, i) {
  16043. 'use strict';
  16044. t.exports = {
  16045. PAGE_TITLE: '',
  16046. LOADING: 'Загрузка',
  16047. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  16048. POWERED_BY: 'разработано на платформе ',
  16049. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  16050. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  16051. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  16052. PRESENTED_BY: 'Представлено ',
  16053. MORE: 'Больше ',
  16054. LESS: 'Меньше ',
  16055. TAG_CONTENT: 'tag™ Контент',
  16056. SHOW: 'Показать',
  16057. HIDE: 'Скрыть',
  16058. DOLLHOUSE: 'Dollhouse',
  16059. FLOOR_PLAN: 'Планировка',
  16060. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  16061. CLOSE_HIGHLIGHTS: 'Закрыть',
  16062. PREVIOUS: 'Предыдущий',
  16063. PLAY: 'Воспроизвести',
  16064. PAUSE: 'Пауза',
  16065. NEXT: 'Следующий',
  16066. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  16067. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  16068. SOCIAL_SHARING: 'Поделиться этой моделью',
  16069. VIEW_IN_VR: 'Посмотреть в VR',
  16070. VIEW_FULLSCREEN: 'Полный экран',
  16071. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  16072. ZOOM_IN: 'Увеличить',
  16073. ZOOM_OUT: 'Уменьшить',
  16074. FLOOR_NAME: 'Этаж ',
  16075. FLOOR_ALL: 'Все',
  16076. TERMS: 'Условия',
  16077. PORT_TERMS: 'Правила пользования',
  16078. TERMS_OF_USE: 'Условия использования',
  16079. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  16080. CLOSE_TERMS: 'Закрыть',
  16081. TERMS_FAIL:
  16082. 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  16083. HELP: 'Помощь',
  16084. HELP_NAVIGATION_TAB: 'Навигация',
  16085. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  16086. CLOSE: 'Закрыть',
  16087. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  16088. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  16089. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  16090. HELP_DESKTOP_PANORAMA_1B:
  16091. 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  16092. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  16093. HELP_DESKTOP_PANORAMA_3B:
  16094. 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  16095. HELP_DESKTOP_360_2A:
  16096. 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16097. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  16098. HELP_DESKTOP_DOLLHOUSE_1A:
  16099. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  16100. HELP_DESKTOP_DOLLHOUSE_2A:
  16101. 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  16102. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16103. HELP_DESKTOP_DOLLHOUSE_1B:
  16104. 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  16105. HELP_DESKTOP_FLOORPLAN_1A:
  16106. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  16107. HELP_DESKTOP_FLOORPLAN_2A:
  16108. 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  16109. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16110. HELP_DESKTOP_FLOORPLAN_2B:
  16111. 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  16112. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  16113. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  16114. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  16115. HELP_MOBILE_3:
  16116. 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  16117. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16118. HELP_MOBILE_DOLLHOUSE_1:
  16119. 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  16120. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  16121. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  16122. HELP_MOBILE_FLOORPLAN_2:
  16123. 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  16124. HELP_MORE_HLR_A: 'Фотоколлаж',
  16125. HELP_DESKTOP_MORE_HLR_B:
  16126. 'Откройте для перемещения по модели, используя иконки изображений.',
  16127. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  16128. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16129. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16130. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16131. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16132. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  16133. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  16134. HELP_MORE_TAG_A: 'tag™ Posts',
  16135. HELP_DESKTOP_MORE_TAG_B:
  16136. 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  16137. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  16138. HELP_MORE_ZOOM_A: 'Масштаб',
  16139. HELP_DESKTOP_MORE_ZOOM_B:
  16140. 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  16141. HELP_MORE_TOUR_A: 'Управление Туром',
  16142. HELP_DESKTOP_MORE_TOUR_B:
  16143. 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  16144. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  16145. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16146. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16147. HELP_MORE_VR_A: 'Режим VR',
  16148. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16149. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16150. HELP_MORE_360_A: '360° Views',
  16151. HELP_DESKTOP_MORE_360_B:
  16152. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16153. HELP_MOBILE_MORE_360_B:
  16154. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16155. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  16156. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  16157. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  16158. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  16159. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  16160. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  16161. WEBVR_LEARN_MORE: 'Узнать больше',
  16162. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  16163. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  16164. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16165. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  16166. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  16167. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16168. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  16169. VR_APP: 'port VR App',
  16170. VR_APP_OPEN: 'Или открыть через приложение port VR',
  16171. VR_COMPATIBLE_ANDROID_LONG:
  16172. 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  16173. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  16174. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  16175. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  16176. VR_VIEW_SPACE: 'Запустить модель в VR',
  16177. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  16178. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  16179. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  16180. VR_GOT_IT_CAPS: 'ЯСНО',
  16181. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  16182. VR_SHOW_UNSUPPORTED:
  16183. 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  16184. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  16185. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  16186. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  16187. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  16188. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  16189. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  16190. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  16191. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  16192. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  16193. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  16194. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  16195. VR_ANDROID_DVICES: 'Android устройства',
  16196. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  16197. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  16198. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  16199. VR_DOWNLOAD_HERE: 'Скачать здесь',
  16200. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  16201. VR_REDIRECT_TO_STORE:
  16202. 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  16203. VR_IMPROPER_EMBED:
  16204. 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  16205. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  16206. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  16207. SHARE_TO: 'Поделиться',
  16208. SHARE_LINK: 'Прямая ссылка',
  16209. SHARE_EXPLORE: 'просмотреть',
  16210. SHARE_AT: 'на',
  16211. SHARE_WITH: 'с',
  16212. SHARE_3D: 'в 3D',
  16213. SHARE_COPIED: 'Скопировано!',
  16214. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  16215. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  16216. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  16217. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  16218. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  16219. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  16220. ERROR_GENERIC_ACTIONS_3: ' или ',
  16221. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  16222. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  16223. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  16224. ERROR_WEBGL_IOS_SOLUTION:
  16225. 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  16226. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  16227. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  16228. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  16229. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  16230. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16231. 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  16232. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  16233. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  16234. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  16235. ERROR_MISSING_URLS_EXPLANATION:
  16236. 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  16237. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  16238. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  16239. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  16240. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  16241. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  16242. LINK_TO_LOCATION: 'Ссылка на местоположение',
  16243. MENU_COPY: 'Копировать',
  16244. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  16245. ROTATE: 'Вращать',
  16246. MOVE: 'Передвигаться',
  16247. INSIDE: 'Вид изнутри',
  16248. ZOOM: 'Масштаб',
  16249. };
  16250. },
  16251. {},
  16252. ],
  16253. 116: [
  16254. function (e, t, i) {
  16255. //main.js
  16256. (function (t) {
  16257. 'use strict';
  16258. var modelProgressBase = 0.4;
  16259. var progressUpdate = function (e) {
  16260. // 0 <= e <= 1
  16261. console.log('e1:' + e);
  16262. e = Math.round(modelProgressBase * e * 100);
  16263. console.log('e2:' + e);
  16264. var t = $('.progressbar');
  16265. t.find('.bar').css('width', e + '%');
  16266. t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px'); //上面跟着的字的百分比
  16267. t.find('.perc').text(e + '%'); //具体数字的百分比
  16268. };
  16269. $('#gui-loading').fadeIn(200);
  16270. progressUpdate(0.1);
  16271. var fileName = g_version ? 'modeldata.js' : 'someData.json';
  16272. $.ajax(
  16273. g_Prefix + 'data/' + window.number + '/' + fileName + '?' + randomTime().getTime(),
  16274. { dataType: 'json' }
  16275. )
  16276. .done(function (e) {
  16277. //改
  16278. var data = matcher(e);
  16279. data.files.templates[0] =
  16280. g_Prefix + e.files.templates[0].replace('{{number}}', window.number);
  16281. data.user = {
  16282. is_authenticated: false,
  16283. flags: [
  16284. 'payment_show_past_due',
  16285. 'sc_imgopt_100',
  16286. 'mattertags',
  16287. 'labels',
  16288. 'fastly_v2_urls',
  16289. 'vr',
  16290. 'uhql',
  16291. 'sc_segment_100',
  16292. 'show_segment_metrics',
  16293. 'content_distribution',
  16294. 'workshop_webgl',
  16295. 'show360views',
  16296. 'showcase_vr',
  16297. 'ws_zooming',
  16298. 'model_settings',
  16299. 'ws_360snapshots',
  16300. 'img_multi_dl',
  16301. 'vrworkshop',
  16302. 'tag_links',
  16303. 'ws_img_multi_dl',
  16304. 'mattertag_links',
  16305. 'billing_tab_hidden',
  16306. 'static_cloud_ui',
  16307. 'metrics',
  16308. 'mattertag_media',
  16309. 'img_size_download',
  16310. 'show_360snapshots',
  16311. 'floorplan',
  16312. 'sc_tilegen_0',
  16313. 'showcase_webvr',
  16314. 'sc_mixpanel_0',
  16315. 'show_clickbait',
  16316. 'zooming',
  16317. 'showcase_tiling',
  16318. 'list_signed_urls_default_3',
  16319. 'fastly_image_opto',
  16320. ],
  16321. };
  16322. try {
  16323. //处理一下导览数据
  16324. data.model.images = data.model.images.filter((e) => {
  16325. if (!e.locations && !e.thumbnail_signed_src) return; //旧的曾有导览数据是错误的,将它删除
  16326. if (e.locations && e.locations.length == 0) return;
  16327. return e;
  16328. });
  16329. } catch (e) {
  16330. console.log(e);
  16331. }
  16332. window.DATA = data;
  16333. data.model.summary = data.summary;
  16334. data.model.name = data.name;
  16335. for (let i in data) {
  16336. data[i] == 'false' && (data[i] = false);
  16337. }
  16338. progressUpdate(0.7);
  16339. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  16340. if (data.weixinDesc) {
  16341. g_weixinObj.desc = data.weixinDesc;
  16342. }
  16343. if (data.shareImgUrl) {
  16344. g_weixinObj.imgUrl = data.shareImgUrl;
  16345. }
  16346. window.wx && manage.weixinShare();
  16347. //初始画面
  16348. data.camera_start &&
  16349. data.camera_start.thumbImg &&
  16350. E(manage.dealURL(data.camera_start.thumbImg));
  16351. function E(e) {
  16352. $('<img/>')
  16353. .attr('src', e)
  16354. .on('load', function () {
  16355. $('#gui-thumb')
  16356. .css('backgroundImage', 'url(' + e + ')')
  16357. .fadeIn(500),
  16358. $(this).remove();
  16359. });
  16360. }
  16361. //背景
  16362. (settings.transparentBg = settings.transparentBg || data.transparentBg || false),
  16363. (settings.bgImg = settings.bgImg || data.bgImg || null);
  16364. if (settings.bgImg) {
  16365. $('#player').css({
  16366. 'background-image': 'url(' + settings.bgImg + ')',
  16367. 'background-position': 'center center',
  16368. });
  16369. }
  16370. {
  16371. //初始化导览时间
  16372. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100;
  16373. window._settings.warp.teleportTime =
  16374. (settings.teleportTime / DATA.tourBlackSpeed) * 100;
  16375. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100;
  16376. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  16377. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  16378. }
  16379. }
  16380. {
  16381. //其他
  16382. _settings.floorPlanAngle = DATA.floorPlanAngle || 0;
  16383. }
  16384. })
  16385. .fail((e) => {
  16386. alert('缺少someData文件,请检查场景码是否正确。');
  16387. });
  16388. function StartLoad() {
  16389. //当加载完data后
  16390. function i() {
  16391. var e = window.number; //Y.getModelIDFromQueryString();
  16392. if (!e) return b(null, 'loading-failed');
  16393. var t = Y.parseSidUrl(e),
  16394. i = l(),
  16395. a = c(),
  16396. s = o(),
  16397. u = V.quickstart.enabled,
  16398. g = null,
  16399. m = null,
  16400. v = null,
  16401. w = null,
  16402. T = null,
  16403. x = null,
  16404. S = null,
  16405. M = null,
  16406. R = null,
  16407. P = null,
  16408. O = null,
  16409. L = null,
  16410. N = new ue();
  16411. r(s);
  16412. h({
  16413. //MP开头写法
  16414. urlBase: t.urlBase,
  16415. })
  16416. .then(function () {
  16417. return re.init(), d(t, e); //getModel and load
  16418. })
  16419. .then(function (e) {
  16420. progressUpdate(0.9);
  16421. return (
  16422. (P = e),
  16423. p(
  16424. P,
  16425. V.appConfig.segment_key,
  16426. V.appConfig.keen_write_key,
  16427. V.appConfig.keen_project_id,
  16428. {
  16429. startSource: i,
  16430. autoplay: V.autoplay,
  16431. quickstart: u,
  16432. }
  16433. ),
  16434. P.urls.init()
  16435. );
  16436. })
  16437. .then(function () {
  16438. return P.loadPanos();
  16439. })
  16440. .then(function () {
  16441. (m = X.getStartCameraOptions(P, P.panos)),
  16442. (S = A(P)),
  16443. (O = y(u, m.mode)),
  16444. (v = O.controls),
  16445. (w = O.player),
  16446. (T = O.director),
  16447. (x = O.tagManager),
  16448. (M = O.tileDownloader),
  16449. (R = O.qualityManager),
  16450. (L = O.panoRenderer),
  16451. C(P, S, O, s),
  16452. (w.director = T), //xzw add
  16453. P.supportsTiles && M.start(),
  16454. !u ||
  16455. (m.mode === D.PANORAMA && m.pano) ||
  16456. (de.warn(
  16457. 'Tried to quickstart, but failed as we are not starting in inside mode.'
  16458. ),
  16459. (u = !1));
  16460. var e = null;
  16461. if (u) {
  16462. de.warn('Quickstart engaged. Hold on to your knickers.');
  16463. var t = v.controls[D.PANORAMA];
  16464. (g = new ie(R, S.scene, S.camera, t, s)),
  16465. _(S, s, P),
  16466. (e = g.load(m).then(function () {
  16467. S.addComponent(g),
  16468. S.once(le.AfterRender, function () {
  16469. de.warn('First render after quickstart load finished.');
  16470. });
  16471. }));
  16472. }
  16473. window.flyToFirst = function () {
  16474. //xzw add
  16475. var pano = w.model.panos.get('8d778e19657f433fb9cf8947d823bb70');
  16476. var q = new _x.Quaternion(
  16477. 0.7099827027821568,
  16478. -0.07708150183830938,
  16479. 0.6958985789714591,
  16480. 0.07555241737970636
  16481. );
  16482. var lookAtPoint = new _x.Vector3(0, 0, -1)
  16483. .applyQuaternion(q)
  16484. .add(pano.position);
  16485. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint });
  16486. };
  16487. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N));
  16488. })
  16489. .then(function () {
  16490. return f(P, U.onProgress, i, !u, a);
  16491. })
  16492. .then(function () {
  16493. if (
  16494. ((m.quickstart = u),
  16495. I(P, S, O, s),
  16496. S.started || _(S, s, P),
  16497. H.modelLoaded(P, w, v, V.autoplay),
  16498. E(w, P, m, V.autoplay).done(function () {
  16499. T.autoTour();
  16500. }),
  16501. !P.supportsTiles)
  16502. ) {
  16503. var e = new Z(P, w);
  16504. e.start();
  16505. }
  16506. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  16507. U.init(P, T, w, v, S, m, H.getSessionId()),
  16508. U.endLoading(P, T, x),
  16509. S.once(le.AfterRender, function () {
  16510. N.setAppReadyTime();
  16511. var e = N.calcFullLoadingTime();
  16512. de.warn('Total load time: ' + e / 1e3),
  16513. H.loadComplete(e),
  16514. de.warn('First render after model load finished.');
  16515. try {
  16516. window.evt && window.dispatchEvent(window.evt);
  16517. parent.postMessage(
  16518. {
  16519. cmd: 'loaded',
  16520. },
  16521. '*'
  16522. );
  16523. } catch (err) {}
  16524. }),
  16525. S.on(le.MemoryUsageUpdated, n);
  16526. })
  16527. .fail(b.bind(this, e));
  16528. }
  16529. function n(e) {
  16530. ce.update(e);
  16531. }
  16532. function r(e) {
  16533. de.info('Version', '2.25.6-0-gd87e5b1'), (q.defaultMaxListeners = 1e3), a(e), s();
  16534. }
  16535. function o() {
  16536. return document.getElementById('player');
  16537. }
  16538. function a(e) {
  16539. e.addEventListener('dragenter', T, !1), e.addEventListener('dragover', T, !1);
  16540. }
  16541. function s() {
  16542. F.valueFromHash('title', !0) ||
  16543. $(document).ready(function () {
  16544. var e = $('.model-title');
  16545. e.hide();
  16546. });
  16547. }
  16548. function l() {
  16549. return F.valueFromHash('play', !1) ? 'autoplay' : F.inIframe() ? 'click' : 'fullpage';
  16550. }
  16551. function c() {
  16552. return {
  16553. panoElementsToLoad: 6,
  16554. modelElementsToLoad: 0,
  16555. totalElementsLoaded: 0,
  16556. totalElementsToLoad: 0,
  16557. totalPercentageLoaded: 0,
  16558. progressCallback: null,
  16559. };
  16560. }
  16561. function h(e) {
  16562. return K.loadFeatureFlags(e).done(function (e) {
  16563. K.updateDependentSettings(e, V);
  16564. });
  16565. }
  16566. // function u(e) {
  16567. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  16568. // responseType: "json",
  16569. // prefetchFrom: "config"
  16570. // }).then(function(e) {
  16571. // return e ? void j.extendObject(V.appConfig, e) : {}
  16572. // }, function(e) {
  16573. // return de.warn("Failed loading runtime config, using defaults."),
  16574. // $.when({})
  16575. // })
  16576. // }
  16577. function d(e, t) {
  16578. var i = B.getModel({
  16579. url: t,
  16580. floors: F.valueFromHash('f', !0),
  16581. autoload: !1,
  16582. });
  16583. return $.when(i, n).then(null, function (e) {
  16584. return this;
  16585. });
  16586. }
  16587. function p(e, t, i, n, r) {
  16588. de.info('Model data loaded'),
  16589. de.debug('UUID: ' + e.data.job.uuid),
  16590. J.init(K.getFlags()),
  16591. i &&
  16592. H.initKeen({
  16593. token: i,
  16594. appId: n,
  16595. }),
  16596. H.initSegment({
  16597. model: e.sid,
  16598. version: '2.25.6-0-gd87e5b1',
  16599. startSource: r.startSource,
  16600. token: t,
  16601. autoplay: r.autoplay,
  16602. quickstart: r.quickstart,
  16603. });
  16604. }
  16605. function f(e, t, i, n, r) {
  16606. return (
  16607. (r.progressCallback = t), H.sessionStart(), e.load(n).progress(g.bind(this, r))
  16608. );
  16609. }
  16610. function g(e, t) {
  16611. (e.modelElementsToLoad = t[1]), v(e), m(e);
  16612. }
  16613. function m(e) {
  16614. e.totalElementsLoaded++,
  16615. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  16616. //----许钟文-----------------模型进度条向后调整
  16617. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  16618. e.totalPercentageLoaded =
  16619. modelProgressBase + (1 - modelProgressBase) * e.totalPercentageLoaded;
  16620. console.log('pro:' + e.totalPercentageLoaded);
  16621. //---------------------------
  16622. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded);
  16623. }
  16624. function v(e) {
  16625. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad;
  16626. }
  16627. function A(e) {
  16628. var t = new x.PerspectiveCamera();
  16629. t.layers.enable(he.PANOMARKERS),
  16630. t.layers.enable(he.RETICULE),
  16631. t.layers.enable(he.TAG);
  16632. var i = new x.Scene(),
  16633. n = new x.AmbientLight(16777215);
  16634. i.add(n),
  16635. (i.plane = new x.Mesh(
  16636. new x.PlaneBufferGeometry(1e5, 1e5),
  16637. new x.RawShaderMaterial({
  16638. side: x.DoubleSide,
  16639. })
  16640. )),
  16641. (i.plane.position.y = 0),
  16642. i.plane.rotateX(-Math.PI / 2),
  16643. (i.plane.material.visible = !1),
  16644. i.add(i.plane),
  16645. i.updateMatrixWorld(),
  16646. V.showScreenshotLocations &&
  16647. e.data.images.forEach(function (e) {
  16648. if (e.metadata && e.metadata.camera_position) {
  16649. var t = e.metadata.camera_position,
  16650. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3));
  16651. (n.position = t.clone()), i.add(n);
  16652. var r = e.metadata.camera_quaternion,
  16653. o = new x.Vector3(0, 0, -1).applyQuaternion(r);
  16654. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680));
  16655. }
  16656. }),
  16657. V.showAxis &&
  16658. (i.add(new x.ArrowHelper(new x.Vector3(0, 1, 0), new x.Vector3(0, 0, 0), 1, 255)),
  16659. i.add(
  16660. new x.ArrowHelper(new x.Vector3(0, 0, 1), new x.Vector3(0, 0, 0), 1, 16711680)
  16661. ),
  16662. i.add(
  16663. new x.ArrowHelper(new x.Vector3(1, 0, 0), new x.Vector3(0, 0, 0), 1, 65280)
  16664. ));
  16665. //背景
  16666. if (!settings.transparentBg && !settings.bgImg) {
  16667. i.skybox = new W();
  16668. i.add(i.skybox);
  16669. }
  16670. var r = new te(i, t, z);
  16671. return r;
  16672. }
  16673. function y(e, t) {
  16674. var i = e ? 1 : 1e3,
  16675. n = J.tilegen || J.imgopt ? 6 : 2;
  16676. n = F.valueFromHash('tileconc', n);
  16677. var r = new ne(),
  16678. o = new ae({
  16679. concurrentDownloads: n,
  16680. }),
  16681. a = new se(),
  16682. s = new P(),
  16683. l = new M(),
  16684. c = new S(t),
  16685. h = new R(),
  16686. u = new O(i),
  16687. d = new L(),
  16688. p = new oe();
  16689. return {
  16690. qualityManager: r,
  16691. panoRenderer: a,
  16692. tileDownloader: o,
  16693. player: c,
  16694. director: l,
  16695. modelManager: s,
  16696. tagManager: p,
  16697. displayController: u,
  16698. labelDisplayController: d,
  16699. controls: h,
  16700. };
  16701. }
  16702. function C(e, t, i, n) {
  16703. var r = i.controls,
  16704. o = i.qualityManager,
  16705. a = i.panoRenderer,
  16706. s = i.tileDownloader,
  16707. l = i.modelManager;
  16708. r.init(n, l),
  16709. ee.init(i.director, r, i.player, l, t),
  16710. o.init(l),
  16711. s.init(o),
  16712. a.init(t, s, o),
  16713. l.init(s, a, o),
  16714. l.addModel(e),
  16715. t.addComponent(G);
  16716. }
  16717. function I(e, t, i, n) {
  16718. var r = i.qualityManager,
  16719. o = i.panoRenderer,
  16720. a = i.tileDownloader,
  16721. s = i.modelManager,
  16722. l = i.player,
  16723. c = i.director,
  16724. h = i.tagManager,
  16725. u = i.displayController,
  16726. d = i.labelDisplayController,
  16727. p = i.controls;
  16728. t.scene.add(e), (t.qualityManager = r);
  16729. var f = {
  16730. camera: t.camera,
  16731. director: c,
  16732. modelManager: s,
  16733. tileDownloader: a,
  16734. panoRenderer: o,
  16735. qualityManager: r,
  16736. tagManager: h,
  16737. container: n,
  16738. controls: p,
  16739. };
  16740. l.init(f),
  16741. l.setScene(t.scene),
  16742. h.init(s, l),
  16743. c.init(l, s),
  16744. u.init(c, l, s, h, n),
  16745. d.init(l, s, n),
  16746. z.bindEvents(l),
  16747. t.addComponent(h),
  16748. t.addComponent(l),
  16749. t.addComponent(o),
  16750. (l.sceneRenderer = t); //xzw add 方便resize
  16751. }
  16752. function E(e, t, i, n) {
  16753. return (
  16754. de.info('Starting player in ' + i.mode),
  16755. H.report(t.sid, 'started-playing', n, i.quickstart),
  16756. e.start(i)
  16757. );
  16758. }
  16759. function b(e, t) {
  16760. de.error(t), k.error(t), H.report(e, 'error-' + t);
  16761. }
  16762. function w(e) {
  16763. var t = F.details();
  16764. t && 'Safari' === t.name && t.version > 500 && t.version < 600
  16765. ? (k.error('webgl-safari'), H.report(e, 'error-webgl-safari'))
  16766. : (k.error('webgl-generic'), H.report(e, 'error-webgl-generic'));
  16767. }
  16768. function _(e, t, i) {
  16769. try {
  16770. e.start(t);
  16771. } catch (e) {
  16772. throw (de.warn(e.message), w(i.sid), e);
  16773. }
  16774. }
  16775. function T(e) {
  16776. e.stopPropagation(), e.preventDefault();
  16777. }
  16778. //czj 判断someData 有没有hoticon字段 修改热点的样式
  16779. if (window.DATA.hoticon) {
  16780. g_HotImage = {
  16781. point:
  16782. window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  16783. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png',
  16784. };
  16785. }
  16786. //czj 判断someData 有没有backgroundMusic 添加音乐
  16787. if (window.DATA.backgroundMusic) {
  16788. if (window.isLocal) {
  16789. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic));
  16790. } else {
  16791. SoundManager.setSrc('bgm', window.DATA.backgroundMusic);
  16792. }
  16793. $('#volume').show();
  16794. } else if (g_version === 'one') {
  16795. SoundManager.setSrc(
  16796. 'bgm',
  16797. manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3')
  16798. );
  16799. $('#volume').show();
  16800. }
  16801. //隐藏公司logo
  16802. if (window.DATA.loadlogo) {
  16803. showLogo();
  16804. }
  16805. e('./lib/three75-shim'),
  16806. e('./lib/array-polyfill'),
  16807. e('./lib/performance-polyfill'),
  16808. e('./lib/shaders/CopyShader.js'),
  16809. e('./lib/shaders/HorizontalBlurShader.js'),
  16810. e('./lib/shaders/VerticalBlurShader.js'),
  16811. e('./lib/postprocessing/EffectComposer.js'),
  16812. e('./lib/postprocessing/RenderPass.js'),
  16813. e('./lib/postprocessing/MaskPass.js'),
  16814. e('./lib/postprocessing/ShaderPass.js'),
  16815. window.Promise || (window.Promise = e('promise-polyfill'));
  16816. var x = e('three'),
  16817. _x = e('three'),
  16818. S = (e('./util/sentry'), e('./player')),
  16819. M = e('./director'),
  16820. R = e('./controls/CameraControls'),
  16821. P = e('./model/ModelManager'),
  16822. O = e('./DisplayController'),
  16823. L = e('./label/LabelDisplayController'),
  16824. D = e('./enum/Viewmode'),
  16825. N = e('./util/logger'),
  16826. B = e('./showcase'),
  16827. F = e('./util/browser'),
  16828. V = e('./settings'),
  16829. U = e('./gui/gui'),
  16830. k = e('./gui/error'),
  16831. H = e('./analytics'),
  16832. G = e('./util/transitions'),
  16833. z = e('./effects'),
  16834. W = e('./objects/Skybox'),
  16835. j = e('./util/common'),
  16836. Y = (e('./util/PanoramaCollection'), e('./util/math'), e('./util/showcase')),
  16837. X = e('./util/camera'),
  16838. Z = (e('./objects/Panorama'), e('./cameras/PanoramaCamera'), e('./preloaders')),
  16839. q = e('events').EventEmitter,
  16840. K = e('./featureflags'),
  16841. Q = (e('./util/lerp'), e('./util/ajax')),
  16842. J = e('./ab'),
  16843. ee = e('./sdk/automation.js'),
  16844. te = e('./scene/SceneRenderer'),
  16845. ie = e('./scene/QuickstartManager'),
  16846. ne = e('./tile/QualityManager.js'),
  16847. re = e('./localization/localize'),
  16848. oe = e('./tag/tagManager'),
  16849. ae = e('./tile/TileDownloader'),
  16850. se = e('./tile/PanoRenderer'),
  16851. le =
  16852. (e('./enum/PanoSizeClass'),
  16853. e('./enum/PanoramaEvents'),
  16854. e('./enum/SceneRendererEvents')),
  16855. ce = e('./gui/memoryUsage'),
  16856. he = e('./enum/RenderLayers'),
  16857. ue = e('./TimingData'),
  16858. de = new N(t);
  16859. (N.level = V.logLevel), (N.consoleEnabled = V.console), i();
  16860. }
  16861. }.call(this, '/js/main.js'));
  16862. },
  16863. {
  16864. './DisplayController': 1,
  16865. './TimingData': 2,
  16866. './ab': 3,
  16867. './analytics': 4,
  16868. './cameras/PanoramaCamera': 7,
  16869. './controls/CameraControls': 9,
  16870. './director': 15,
  16871. './effects': 16,
  16872. './enum/PanoSizeClass': 36,
  16873. './enum/PanoramaEvents': 37,
  16874. './enum/RenderLayers': 41,
  16875. './enum/SceneRendererEvents': 43,
  16876. './enum/Viewmode': 51,
  16877. './featureflags': 59,
  16878. './gui/error': 64,
  16879. './gui/gui': 65,
  16880. './gui/memoryUsage': 73,
  16881. './label/LabelDisplayController': 91,
  16882. './lib/array-polyfill': 92,
  16883. './lib/performance-polyfill': 95,
  16884. './lib/postprocessing/EffectComposer.js': 96,
  16885. './lib/postprocessing/MaskPass.js': 97,
  16886. './lib/postprocessing/RenderPass.js': 98,
  16887. './lib/postprocessing/ShaderPass.js': 99,
  16888. './lib/shaders/CopyShader.js': 100,
  16889. './lib/shaders/HorizontalBlurShader.js': 101,
  16890. './lib/shaders/VerticalBlurShader.js': 102,
  16891. './lib/three75-shim': 103,
  16892. './localization/localize': 108,
  16893. './tag/tagManager': 124,
  16894. './model/ModelManager': 140,
  16895. './objects/Panorama': 148,
  16896. './objects/Skybox': 152,
  16897. './player': 155,
  16898. './preloaders': 156,
  16899. './scene/QuickstartManager': 157,
  16900. './scene/SceneRenderer': 158,
  16901. './sdk/automation.js': 164,
  16902. './settings': 166,
  16903. './showcase': 168,
  16904. './tile/PanoRenderer': 169,
  16905. './tile/QualityManager.js': 170,
  16906. './tile/TileDownloader': 171,
  16907. './util/PanoramaCollection': 178,
  16908. './util/ajax': 181,
  16909. './util/browser': 182,
  16910. './util/camera': 183,
  16911. './util/common': 185,
  16912. './util/lerp': 188,
  16913. './util/logger': 189,
  16914. './util/math': 190,
  16915. './util/sentry': 192,
  16916. './util/showcase': 193,
  16917. './util/transitions': 195,
  16918. events: 202,
  16919. 'promise-polyfill': 213,
  16920. three: 217,
  16921. },
  16922. ],
  16923. 117: [
  16924. function (e, t, i) {
  16925. 'use strict';
  16926. function n(e) {
  16927. e = e || {};
  16928. r.RawShaderMaterial.call(
  16929. this,
  16930. a.extendObject(
  16931. {
  16932. fragmentShader: o.cube.fragmentShader,
  16933. vertexShader: o.cube.vertexShader,
  16934. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  16935. name: 'CubemapMaterial',
  16936. },
  16937. e
  16938. )
  16939. );
  16940. }
  16941. var r = e('three'),
  16942. o = e('../shaders'),
  16943. a = e('../util/common');
  16944. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16945. (n.prototype.constructor = n),
  16946. (t.exports = n);
  16947. },
  16948. {
  16949. '../shaders': 167,
  16950. '../util/common': 185,
  16951. three: 217,
  16952. },
  16953. ],
  16954. 118: [
  16955. function (e, t, i) {
  16956. 'use strict';
  16957. function n(e) {
  16958. e = e || {};
  16959. r.RawShaderMaterial.call(
  16960. this,
  16961. a.extendObject(
  16962. {
  16963. fragmentShader: o.model.fragmentShader,
  16964. vertexShader: o.model.vertexShader,
  16965. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  16966. name: 'ModelTextureMaterial',
  16967. },
  16968. e
  16969. )
  16970. );
  16971. }
  16972. var r = e('three'),
  16973. o = e('../shaders'),
  16974. a = e('../util/common');
  16975. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16976. (n.prototype.constructor = n),
  16977. (n.prototype.setProjectedPanos = function (e, t, i) {
  16978. i && (this.uniforms.progress.value = 0),
  16979. e.ensureSkyboxReadyForRender(),
  16980. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  16981. this.uniforms.pano0Position.value.copy(e.position),
  16982. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  16983. t.ensureSkyboxReadyForRender(),
  16984. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  16985. this.uniforms.pano1Position.value.copy(t.position),
  16986. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld);
  16987. }),
  16988. /* n.prototype.setEyeDir = function(dir, pos) {//加
  16989. this.uniforms.eyeDir.value.copy(dir)
  16990. this.uniforms.eyePos.value.copy(pos)
  16991. }
  16992. n.prototype.setBendCameraQua = function(matrix) {//加
  16993. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  16994. } */
  16995. (t.exports = n);
  16996. },
  16997. {
  16998. '../shaders': 167,
  16999. '../util/common': 185,
  17000. three: 217,
  17001. },
  17002. ],
  17003. 119: [
  17004. function (e, t, i) {
  17005. (function (i) {
  17006. 'use strict';
  17007. function n(e, t, i, n) {
  17008. (this.div = null),
  17009. (this.body = null),
  17010. (this.label = e),
  17011. (this.description = t),
  17012. (this.parsedDescription = []),
  17013. (this.media = i || {
  17014. type: null,
  17015. }),
  17016. (this.loadingSpinner = null),
  17017. (this.parser = new r({
  17018. supportLinks: !u.valueFromHash('mls'),
  17019. keepLinkLabels: !0,
  17020. })),
  17021. (this.state = I.CLOSED),
  17022. (this.orientation = ''),
  17023. (this.initialTransform = ''),
  17024. (this.hovering = !1),
  17025. (this.openTransition = null),
  17026. (this.closeTransition = null),
  17027. (this.openPromise = null),
  17028. (this.closePromise = null),
  17029. (this.animationTransition = null),
  17030. (this.animationScale = 0);
  17031. }
  17032. var r = e('../Parser/DescriptionParser'),
  17033. o = e('../Media/Link'),
  17034. a = e('../Media/Image'),
  17035. s = e('../Media/EmbedlyPlayer'),
  17036. l = e('../Media/EmbedlyEmbed'),
  17037. c = e('../../util/transitions'),
  17038. h = e('../../util/lerp'),
  17039. u = e('../../util/browser'),
  17040. d = e('./BillboardEvent'),
  17041. p = e('../Media/MediaEvent'),
  17042. f = e('../Parser/DescriptionChunkType'),
  17043. g = e('events').EventEmitter,
  17044. m = e('./billboardSettings'),
  17045. v = e('./overlaySettings'),
  17046. A = e('../../util/logger'),
  17047. y = new A(i),
  17048. C = document.getElementById('tag-billboards');
  17049. C.addEventListener('touchend', function (e) {
  17050. C.style.pointerEvents = 'none';
  17051. }),
  17052. C.addEventListener('touchcancel', function (e) {
  17053. C.style.pointerEvents = 'none';
  17054. });
  17055. var I = {
  17056. CLOSED: 'closed',
  17057. OPENING: 'opening',
  17058. OPEN: 'open',
  17059. CLOSING: 'closing',
  17060. ACTIVE: 'active',
  17061. };
  17062. (n.prototype = Object.create(g.prototype)),
  17063. (n.prototype.build = function (e) {
  17064. this.parsedDescription = this.parser.parse(this.description);
  17065. var t = document.createElement('div');
  17066. (t.className = 'tag-container has-hotzone'),
  17067. (this.div = t),
  17068. (this.body = document.createElement('div')),
  17069. (this.body.className = 'tag-body');
  17070. var i = document.createElement('div');
  17071. i.classList.add('tag-content');
  17072. var n = document.createElement('div');
  17073. n.classList.add('tag-text-content');
  17074. var r = document.createElement('div');
  17075. (r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r);
  17076. var o = document.createElement('div');
  17077. (o.className = 'tag-desc'),
  17078. n.appendChild(o),
  17079. i.appendChild(n),
  17080. this.body.appendChild(i),
  17081. this.appendDescriptionElements(this.parsedDescription, o),
  17082. this.appendMedia(),
  17083. t.appendChild(this.body),
  17084. C.appendChild(t),
  17085. this.bindEvents(t, this.body);
  17086. }),
  17087. (n.prototype.bindEvents = function (e, t) {
  17088. var i = function (e) {
  17089. return function (t) {
  17090. if (!this.div.classList.contains('overlay')) {
  17091. var i,
  17092. n = document.getElementById('player');
  17093. try {
  17094. i = new MouseEvent(e, t);
  17095. } catch (n) {
  17096. (i = document.createEvent('MouseEvents')),
  17097. i.initMouseEvent(
  17098. e,
  17099. t.bubbles,
  17100. t.cancelable,
  17101. t.view,
  17102. t.detail,
  17103. t.screenX,
  17104. t.screenY,
  17105. t.clientX,
  17106. t.clientY,
  17107. t.ctrlKey,
  17108. t.altKey,
  17109. t.shiftKey,
  17110. t.metaKey,
  17111. t.button,
  17112. t.relatedTarget
  17113. );
  17114. }
  17115. n.dispatchEvent(i);
  17116. }
  17117. };
  17118. };
  17119. t.addEventListener('mousedown', function (e) {
  17120. e.stopPropagation();
  17121. }),
  17122. t.addEventListener('mouseup', function (e) {
  17123. e.stopPropagation();
  17124. }),
  17125. e.addEventListener('touchstart', function (e) {
  17126. C.style.pointerEvents = 'auto';
  17127. }),
  17128. e.addEventListener('mousedown', i('mousedown').bind(this)),
  17129. e.addEventListener('mouseup', i('mouseup').bind(this)),
  17130. t.addEventListener(
  17131. 'mouseover',
  17132. function (t) {
  17133. this.state === I.OPEN && e.classList.remove('has-hotzone');
  17134. }.bind(this)
  17135. ),
  17136. e.addEventListener(
  17137. 'mouseenter',
  17138. function (e) {
  17139. this.state !== I.CLOSING && ((this.hovering = !0), this.emit(d.ENTER));
  17140. }.bind(this)
  17141. ),
  17142. e.addEventListener(
  17143. 'mouseleave',
  17144. function (e) {
  17145. (this.hovering = !1), this.emit(d.LEAVE);
  17146. }.bind(this)
  17147. ),
  17148. e.addEventListener('gesturestart', function (e) {
  17149. e.preventDefault();
  17150. });
  17151. var n = e.querySelector('.tag-text-content'),
  17152. r = 0;
  17153. n.addEventListener('touchstart', function (e) {
  17154. r = e.changedTouches[0].clientY;
  17155. }),
  17156. n.addEventListener('touchmove', function (t) {
  17157. function i(e) {
  17158. e &&
  17159. ((0 === e.scrollTop && t.changedTouches[0].clientY > r) ||
  17160. (e.scrollTop + e.clientHeight - e.scrollHeight === 0 &&
  17161. t.changedTouches[0].clientY < r)) &&
  17162. t.preventDefault();
  17163. }
  17164. return e.classList.contains('overlay')
  17165. ? i(this.querySelector('.tag-desc'))
  17166. : void i(this);
  17167. }),
  17168. e.addEventListener('touchmove', function (e) {
  17169. 0 ===
  17170. (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) &&
  17171. e.preventDefault();
  17172. });
  17173. }),
  17174. (n.prototype.appendDescriptionElements = function (e, t) {
  17175. e.length > 0 && this.div.classList.add('has-text'),
  17176. e.forEach(
  17177. function (e, i) {
  17178. switch (e.type) {
  17179. case f.TEXT:
  17180. t.appendChild(this.createTextElement(e.text));
  17181. break;
  17182. case f.LINK:
  17183. t.appendChild(this.createLinkElement(e.link));
  17184. }
  17185. }.bind(this)
  17186. );
  17187. }),
  17188. (n.prototype.appendLoadingSpinner = function () {
  17189. (this.loadingSpinner = document.createElement('div')),
  17190. this.loadingSpinner.classList.add('loading-spinner');
  17191. var e = document.createElement('div');
  17192. e.classList.add('gui-spinner-icon'),
  17193. this.loadingSpinner.appendChild(e),
  17194. this.body.appendChild(this.loadingSpinner);
  17195. }),
  17196. (n.prototype.onMediaLoadFinished = function () {
  17197. this.loadingSpinner &&
  17198. (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  17199. this.applyOrientation(this.orientation),
  17200. (this.loadingSpinner = null));
  17201. }),
  17202. (n.prototype.appendMedia = function () {
  17203. if (
  17204. this.media &&
  17205. this.media.type &&
  17206. 'error' !== this.media.type &&
  17207. (!u.valueFromHash('mls', 0) || this.media.type === f.IMAGE)
  17208. ) {
  17209. this.appendLoadingSpinner();
  17210. var e = document.createElement('div');
  17211. e.classList.add('tag-media-content');
  17212. var t = document.createElement('i');
  17213. switch (
  17214. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  17215. t.classList.add(e);
  17216. }),
  17217. this.body.appendChild(t),
  17218. this.body.appendChild(e),
  17219. this.media.type)
  17220. ) {
  17221. case f.IMAGE:
  17222. e.appendChild(this.createImageElement(this.media, this.body));
  17223. break;
  17224. case f.VIDEO:
  17225. e.appendChild(this.createVideoElement(this.media, this.body));
  17226. break;
  17227. case f.RICH:
  17228. e.appendChild(this.createEmbedElement(this.media, this.body));
  17229. }
  17230. }
  17231. }),
  17232. (n.prototype.createTextElement = function (e) {
  17233. var t = document.createElement('span');
  17234. return (t.textContent = e), t;
  17235. });
  17236. (n.prototype.createLinkElement = function (e) {
  17237. var t = new o(e);
  17238. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)), t.createDomElement();
  17239. }),
  17240. (n.prototype.createImageElement = function (e, t) {
  17241. function i() {
  17242. function e() {
  17243. m ||
  17244. (r.classList.remove('view-image'),
  17245. c.classList.add('overlay'),
  17246. i(),
  17247. window.addEventListener('resize', b),
  17248. c.addEventListener('click', a),
  17249. g.addEventListener('click', l),
  17250. f.addEventListener('click', s),
  17251. (m = !0),
  17252. o.emit(p.IMAGE_OPENED));
  17253. }
  17254. function i() {
  17255. t.classList.add('show-info'),
  17256. h.classList.remove('collapsible'),
  17257. (h.style.height = '');
  17258. var e = parseFloat(getComputedStyle(I).lineHeight),
  17259. i = y + e,
  17260. r = c.clientWidth - 2 * v.boundaryWidth - C,
  17261. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  17262. s = a,
  17263. l = s * n.aspect;
  17264. l > r && ((l = r), (s = l / n.aspect)),
  17265. s > a && ((s = a), (l = s * n.aspect)),
  17266. (l += C),
  17267. (s += C + i),
  17268. (t.style.width = l + 'px'),
  17269. (t.style.height = s + 'px'),
  17270. (u.style.paddingTop = e + C + 'px'),
  17271. o.description.length > 0 &&
  17272. (h.classList.add('collapsible'),
  17273. (h.style.height = h.clientHeight + 12 + 'px'),
  17274. (E.style.height = 'calc(100% - ' + I.clientHeight + 'px)'));
  17275. }
  17276. function a(e) {
  17277. e.target === c && s();
  17278. }
  17279. function s() {
  17280. m &&
  17281. ((m = !1),
  17282. r.classList.add('view-image'),
  17283. c.classList.remove('overlay'),
  17284. (h.style.height = ''),
  17285. (u.style.paddingTop = ''),
  17286. (t.style.width = ''),
  17287. (t.style.height = ''),
  17288. window.removeEventListener('resize', b),
  17289. c.removeEventListener('click', a),
  17290. g.removeEventListener('click', l),
  17291. f.removeEventListener('click', s),
  17292. o.emit(p.IMAGE_CLOSED),
  17293. o.close(!0));
  17294. }
  17295. function l(e) {
  17296. t.classList.toggle('show-info');
  17297. }
  17298. var c = o.div,
  17299. h = c.getElementsByClassName('tag-content')[0],
  17300. u = c.getElementsByClassName('tag-media-content')[0],
  17301. f = t.getElementsByClassName('close')[0],
  17302. g = h.getElementsByClassName('tag-label')[0];
  17303. c.classList.add('has-image'),
  17304. r.classList.add('view-image'),
  17305. c.classList.add(n.aspect >= 1 ? 'image-landscape' : 'image-portrait'),
  17306. o.applyOrientation(o.orientation);
  17307. var m = !1,
  17308. A = getComputedStyle(h),
  17309. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  17310. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  17311. I = h.querySelector('.tag-label'),
  17312. E = h.querySelector('.tag-desc'),
  17313. b = (function () {
  17314. var e,
  17315. t,
  17316. n = 0;
  17317. return function () {
  17318. clearInterval(e),
  17319. clearTimeout(t),
  17320. (e = setInterval(function () {
  17321. var e = c.clientHeight;
  17322. n !== e && (i(), (n = e));
  17323. }, 100)),
  17324. (t = setTimeout(clearInterval.bind(this, e), 1e3));
  17325. };
  17326. })();
  17327. n.on(p.IMAGE_OPENING, e),
  17328. o.on(d.ACTIVATE, e),
  17329. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  17330. o.on(d.CLOSING, s);
  17331. }
  17332. var n = new a(),
  17333. r = n.createDomElement();
  17334. this.once(d.OPENED, function () {
  17335. n.load(e.src)
  17336. .then(i)
  17337. .catch(function (t) {
  17338. y.warn('Failed to load image:', e.src), y.warn('with error:', t);
  17339. })
  17340. .then(this.onMediaLoadFinished.bind(this));
  17341. });
  17342. var o = this;
  17343. return r;
  17344. }),
  17345. (n.prototype.createVideoElement = function (e, t) {
  17346. var i = new s({
  17347. autoPlay: !0,
  17348. autoResume: !0,
  17349. startMuted: !1,
  17350. loop: !1,
  17351. }),
  17352. n = i.createDomElement();
  17353. return (
  17354. this.once(
  17355. d.OPENED,
  17356. function () {
  17357. i.load(e.src)
  17358. .then(
  17359. function () {
  17360. this.div.classList.add('has-video'),
  17361. (this.state !== I.OPEN && this.state !== I.ACTIVE) ||
  17362. (i.show(), i.play()),
  17363. this.on(d.OPENING, i.show.bind(i)),
  17364. this.on(d.OPENED, i.play.bind(i)),
  17365. this.on(d.CLOSING, i.pause.bind(i)),
  17366. this.on(d.CLOSED, i.hide.bind(i));
  17367. }.bind(this)
  17368. )
  17369. .catch(function (t) {
  17370. y.warn('Failed to embed video:', e.src), y.warn('with error:', t);
  17371. })
  17372. .then(this.onMediaLoadFinished.bind(this));
  17373. }.bind(this)
  17374. ),
  17375. n
  17376. );
  17377. }),
  17378. (n.prototype.createEmbedElement = function (e, t) {
  17379. var i = new l(),
  17380. n = i.createDomElement();
  17381. return (
  17382. this.once(
  17383. d.OPENED,
  17384. function () {
  17385. i.load(e.src)
  17386. .then(
  17387. function () {
  17388. this.div.classList.add('has-embed'),
  17389. (this.state !== I.OPEN && this.state !== I.ACTIVE) || i.show(),
  17390. this.applyOrientation(this.orientation),
  17391. this.on(d.OPENING, i.show.bind(i)),
  17392. this.on(d.CLOSED, i.hide.bind(i));
  17393. }.bind(this)
  17394. )
  17395. .catch(function (t) {
  17396. y.warn('Failed to embed:', e.src), y.warn('with error:', t);
  17397. })
  17398. .then(this.onMediaLoadFinished.bind(this));
  17399. }.bind(this)
  17400. ),
  17401. n
  17402. );
  17403. }),
  17404. (n.prototype.open = function (e) {
  17405. return (
  17406. (this.openPromise = $.Deferred()),
  17407. this.state === I.ACTIVE
  17408. ? this.openPromise.resolve().promise()
  17409. : (this.hovering || this.div.classList.add('has-hotzone'),
  17410. this.openTransition
  17411. ? e && this.setActiveState()
  17412. : (this.openTransition = c.setTimeout(
  17413. function () {
  17414. this.state !== I.OPEN &&
  17415. (this.emit(d.OPENING),
  17416. e && this.emit(d.ACTIVATING),
  17417. (this.state = I.OPENING),
  17418. this.animateOpen(
  17419. function () {
  17420. e && this.setActiveState(), this.openPromise.resolve();
  17421. }.bind(this)
  17422. ));
  17423. }.bind(this),
  17424. m.animation.openDelay
  17425. )),
  17426. c.cancel(this.closeTransition),
  17427. this.closePromise && this.closePromise.reject(),
  17428. (this.closeTransition = void 0),
  17429. this.openPromise.promise())
  17430. );
  17431. }),
  17432. (n.prototype.close = function (e) {
  17433. return (
  17434. (this.closePromise = $.Deferred()),
  17435. !e && this.hovering
  17436. ? this.closePromise.reject().promise()
  17437. : (this.closeTransition ||
  17438. (this.closeTransition = c.setTimeout(
  17439. function () {
  17440. this.state !== I.CLOSED &&
  17441. (this.emit(d.CLOSING), (this.state = I.CLOSING), this.animateClose());
  17442. }.bind(this),
  17443. m.animation.closeDelay
  17444. )),
  17445. c.cancel(this.openTransition),
  17446. this.openPromise && this.openPromise.reject(),
  17447. (this.openTransition = void 0),
  17448. this.closePromise.resolve(),
  17449. this.closePromise.promise())
  17450. );
  17451. }),
  17452. (n.prototype.setActiveState = function () {
  17453. this.state !== I.CLOSED &&
  17454. ((this.state = I.ACTIVE),
  17455. this.emit(d.ACTIVATE),
  17456. this.div.classList.remove('has-hotzone'));
  17457. }),
  17458. (n.prototype.animateOpen = function (e) {
  17459. if (this.state === I.OPENING) {
  17460. if ((c.cancel(this.animationTransition), u.detectSamsungNative()))
  17461. return (
  17462. (this.boardOrientation = null),
  17463. (this.div.style.visibility = 'visible'),
  17464. this.emit(d.OPENED),
  17465. (this.state = I.OPEN),
  17466. void (e && e())
  17467. );
  17468. (this.div.style.webkitTransform = 'scale(0)'),
  17469. (this.div.style.transform = 'scale(0)'),
  17470. (this.div.style.visibility = 'visible'),
  17471. (this.animationTransition = c.start(
  17472. h.property(this, 'animationScale', 1),
  17473. m.animation.openDuration,
  17474. function () {
  17475. this.emit(d.OPENED), (this.state = I.OPEN), e && e();
  17476. }.bind(this)
  17477. ));
  17478. }
  17479. }),
  17480. (n.prototype.animateClose = function (e) {
  17481. this.state === I.CLOSING &&
  17482. (c.cancel(this.animationTransition),
  17483. (this.animationTransition = c.start(
  17484. h.property(this, 'animationScale', 0),
  17485. m.animation.closeDuration,
  17486. function () {
  17487. this.emit(d.CLOSED),
  17488. (this.state = I.CLOSED),
  17489. (this.div.style.visibility = 'hidden'),
  17490. this.div.classList.contains('has-hotzone') ||
  17491. this.div.classList.add('has-hotzone'),
  17492. e && e();
  17493. }.bind(this)
  17494. )));
  17495. }),
  17496. (n.prototype.needsUpdate = function () {
  17497. return this.state !== I.CLOSED;
  17498. }),
  17499. (n.prototype.update = function (e, t) {
  17500. if (this.needsUpdate()) {
  17501. var i = (this.updateOrientation(e), this.calcScale(t)),
  17502. n = {
  17503. x: ((e.x + 1) * $('#player').width()) / 2,
  17504. y: ((e.y + 1) * $('#player').height()) / 2,
  17505. };
  17506. (this.div.screenTransform =
  17507. this.initialTransform +
  17508. ' translate(' +
  17509. n.x +
  17510. 'px, ' +
  17511. n.y +
  17512. 'px) scale(' +
  17513. i * this.animationScale +
  17514. ')'),
  17515. (this.div.style.webkitTransform = this.div.screenTransform),
  17516. (this.div.style.transform = this.div.screenTransform);
  17517. }
  17518. }),
  17519. (n.prototype.getDimensions = function () {
  17520. return this.div.getBoundingClientRect();
  17521. }),
  17522. (n.prototype.calcScale = function (e) {
  17523. return Math.sqrt(e / 40) * m.boardToDiscRatio;
  17524. }),
  17525. (n.prototype.updateOrientation = function (e) {
  17526. if (this.state !== I.ACTIVE) {
  17527. var t = 1 / 3,
  17528. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  17529. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  17530. r = '';
  17531. (r += 0 === n ? 'right' : 2 === n ? 'left' : ''),
  17532. (r += 0 === i ? '-down' : 2 === i ? '-up' : ''),
  17533. 1 === n &&
  17534. ((r = 0 === i ? 'bottom' : 2 === i ? 'top' : ''),
  17535. 1 === i &&
  17536. (r =
  17537. $('#player').width() > $('#player').height()
  17538. ? e.x < 0
  17539. ? 'right'
  17540. : 'left'
  17541. : e.y < 0
  17542. ? 'bottom'
  17543. : 'top')),
  17544. (1 === n && 1 === i && r === this.orientation) || this.applyOrientation(r);
  17545. }
  17546. }),
  17547. (n.prototype.applyOrientation = function (e) {
  17548. (this.div.style.transform = this.div.style.webkitTransform = ''),
  17549. this.div.classList.remove('tag-container-' + this.orientation),
  17550. this.div.classList.add('tag-container-' + e);
  17551. var t = window.getComputedStyle(this.div);
  17552. (this.initialTransform = t.transform || t.webkitTransform),
  17553. 'none' === this.initialTransform && (this.initialTransform = '');
  17554. var i = t.transform.slice(7, -1).split(','),
  17555. n = -i[4],
  17556. r = -i[5];
  17557. (this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'),
  17558. (this.div.style.transformOrigin = n + 'px ' + r + 'px'),
  17559. (this.orientation = e);
  17560. }),
  17561. (t.exports = n);
  17562. }.call(this, '/js/tag/Billboard/Billboard.js'));
  17563. },
  17564. {
  17565. '../../util/browser': 182,
  17566. '../../util/lerp': 188,
  17567. '../../util/logger': 189,
  17568. '../../util/transitions': 195,
  17569. '../Media/EmbedlyEmbed': 125,
  17570. '../Media/EmbedlyPlayer': 126,
  17571. '../Media/Image': 128,
  17572. '../Media/Link': 129,
  17573. '../Media/MediaEvent': 131,
  17574. '../Parser/DescriptionChunkType': 133,
  17575. '../Parser/DescriptionParser': 134,
  17576. './BillboardEvent': 120,
  17577. './billboardSettings': 121,
  17578. './overlaySettings': 122,
  17579. events: 202,
  17580. },
  17581. ],
  17582. 120: [
  17583. function (e, t, i) {
  17584. 'use strict';
  17585. t.exports = Object.freeze({
  17586. ENTER: 'billboard.enter',
  17587. LEAVE: 'billboard.leave',
  17588. OPENING: 'billboard.opening',
  17589. OPENED: 'billboard.open',
  17590. CLOSING: 'billboard.closing',
  17591. CLOSED: 'billboard.closed',
  17592. ACTIVATING: 'billboard.activating',
  17593. ACTIVATE: 'billboard.activate',
  17594. });
  17595. },
  17596. {},
  17597. ],
  17598. 121: [
  17599. function (e, t, i) {
  17600. 'use strict';
  17601. t.exports = Object.freeze({
  17602. animation: Object.freeze({
  17603. hoverOnClosing: !1,
  17604. openDelay: 100,
  17605. closeDelay: 50,
  17606. openDuration: 200,
  17607. closeDuration: 100,
  17608. }),
  17609. boardToDiscRatio: 1.2,
  17610. });
  17611. },
  17612. {},
  17613. ],
  17614. 122: [
  17615. function (e, t, i) {
  17616. 'use strict';
  17617. t.exports = Object.freeze({
  17618. boundaryWidth: 30,
  17619. boundaryHeight: 0,
  17620. });
  17621. },
  17622. {},
  17623. ],
  17624. 123: [
  17625. function (e, t, i) {
  17626. //tag
  17627. (function (i) {
  17628. 'use strict';
  17629. function n(e, t, i) {
  17630. var n = i.version || '0';
  17631. '0' !== n && I.info('tag defined using version ' + n),
  17632. (this.model = e),
  17633. (this.sid = t),
  17634. (this.color = new r.Color().set(i.color || l.tagDefault)),
  17635. (this.hoverColor = l._darken(this.color, 0.2)),
  17636. (this.floor = null),
  17637. (this.floorIndex = i.floor),
  17638. (this.mode = s.PANORAMA),
  17639. i.preferred_camera &&
  17640. i.preferred_camera.mode &&
  17641. (this.mode = i.preferred_camera.mode),
  17642. (this.obj3d = null),
  17643. (this.disc = null),
  17644. (this.materials = {
  17645. disc: null,
  17646. pole: null,
  17647. }),
  17648. (this.position = new r.Vector3().copy(i.position)),
  17649. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  17650. (this.discWorldPosition = null),
  17651. (this.discScale = 0.05),
  17652. (this.poleEnabled = i.stem.enabled),
  17653. (this.billboard = new o(i.label, i.description, i.media, this)),
  17654. (this.visibleTransition = null),
  17655. (this.hoveringDisc = !1);
  17656. }
  17657. var r = e('three'),
  17658. o = e('./Billboard/Billboard'),
  17659. a = e('../settings'),
  17660. s = e('../enum/Viewmode'),
  17661. l = e('../enum/Colors'),
  17662. c = e('../enum/RenderLayers'),
  17663. h = e('../enum/RenderOrder'),
  17664. u = (e('../util/common'), e('../util/math')),
  17665. d = e('../util/texture'),
  17666. p = e('../objects/Panorama'),
  17667. f = e('../shaders'),
  17668. g = e('../util/transitions'),
  17669. m = e('../util/lerp'),
  17670. v = e('../util/easing'),
  17671. A = e('./Billboard/BillboardEvent'),
  17672. y = e('events').EventEmitter,
  17673. C = e('../util/logger'),
  17674. I = new C(i),
  17675. E = d.loadBase64(
  17676. 'iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=='
  17677. ),
  17678. b = d.loadBase64(
  17679. 'iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC'
  17680. ),
  17681. w = new r.PlaneBufferGeometry(1, 1);
  17682. (n.prototype = Object.create(y.prototype)),
  17683. (n.raycaster = new r.Raycaster()),
  17684. (n.prototype.bindEvents = function () {
  17685. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  17686. this.billboard.on(A.LEAVE, this.setFreeState.bind(this));
  17687. }),
  17688. (n.prototype.build = function () {
  17689. return (
  17690. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  17691. this.floor &&
  17692. (this.billboard.build(this.model.sid),
  17693. (this.obj3d = this.buildObject3D()),
  17694. this.floor.add(this.obj3d)),
  17695. this
  17696. );
  17697. }),
  17698. (n.prototype.buildObject3D = function () {
  17699. var e = new r.Object3D();
  17700. e.position.copy(this.position);
  17701. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  17702. (t.bg.value = b),
  17703. (t.mask.value = E),
  17704. t.color.value.copy(this.color),
  17705. (this.materials.disc = new r.RawShaderMaterial({
  17706. transparent: !0,
  17707. vertexShader: f.tagDisc.vertexShader,
  17708. fragmentShader: f.tagDisc.fragmentShader,
  17709. uniforms: t,
  17710. })),
  17711. (this.disc = new r.Mesh(w, this.materials.disc)),
  17712. this.disc.layers.set(c.TAG),
  17713. this.disc.position.copy(this.discPosition),
  17714. (this.disc.renderOrder = h.tagDisc),
  17715. (this.disc.tag = this);
  17716. var i = this.buildPole();
  17717. return (
  17718. i.layers.set(c.TAG),
  17719. (i.renderOrder = h.tagStem),
  17720. e.add(i),
  17721. e.layers.set(c.TAG),
  17722. e.add(this.disc)
  17723. );
  17724. }),
  17725. (n.prototype.buildPole = function () {
  17726. var e = new r.BufferGeometry(),
  17727. t = new Float32Array(6);
  17728. return (
  17729. (t[0] = t[1] = t[2] = 0),
  17730. (t[3] = this.discPosition.x),
  17731. (t[4] = this.discPosition.y),
  17732. (t[5] = this.discPosition.z),
  17733. e.addAttribute('position', new r.BufferAttribute(t, 3)),
  17734. (this.materials.pole = new r.LineBasicMaterial({
  17735. linewidth: a.tags.pole.width,
  17736. color: a.tags.pole.color,
  17737. opacity: 0,
  17738. visible: this.poleEnabled,
  17739. transparent: !0,
  17740. depthWrite: !1,
  17741. })),
  17742. new r.Line(e, this.materials.pole)
  17743. );
  17744. }),
  17745. (n.prototype.setFreeState = function (e) {
  17746. (!e && this.hoveringDisc) ||
  17747. this.billboard.close(e).then(
  17748. function () {
  17749. this.materials.disc.uniforms.color.value = this.color;
  17750. }.bind(this)
  17751. );
  17752. }),
  17753. (n.prototype.setHoverState = function (e) {
  17754. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor);
  17755. }),
  17756. (n.prototype.hide = function (e, t) {
  17757. var i = $.Deferred();
  17758. if (
  17759. 0 === this.materials.disc.uniforms.opacity.value &&
  17760. !g.isRunning(this.visibleTransition)
  17761. )
  17762. return i.resolve().promise();
  17763. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  17764. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity,
  17765. r = t + e,
  17766. o = t / r;
  17767. return (
  17768. (this.visibleTransition = g.start(
  17769. (function (e) {
  17770. var t = m.property(e.materials.disc.uniforms.opacity, 'value', 0),
  17771. i = m.property(e.materials.pole, 'opacity', 0);
  17772. return function (n) {
  17773. t(n), e.materials.pole && i(n);
  17774. };
  17775. })(this),
  17776. r * n,
  17777. function () {
  17778. i.resolve();
  17779. },
  17780. o,
  17781. v[a.warp.blendEasing]
  17782. )),
  17783. i.promise()
  17784. );
  17785. }),
  17786. (n.prototype.show = function (e, t) {
  17787. var i = $.Deferred();
  17788. if (
  17789. this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity &&
  17790. !g.isRunning(this.visibleTransition)
  17791. )
  17792. return i.resolve().promise();
  17793. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  17794. var n =
  17795. (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) /
  17796. a.tags.disc.opacity,
  17797. r = t + e,
  17798. o = t / r;
  17799. return (
  17800. (this.visibleTransition = g.start(
  17801. (function (e) {
  17802. var t = m.property(
  17803. e.materials.disc.uniforms.opacity,
  17804. 'value',
  17805. a.tags.disc.opacity
  17806. ),
  17807. i = m.property(e.materials.pole, 'opacity', a.tags.pole.opacity);
  17808. return function (n) {
  17809. t(n), e.materials.pole && i(n);
  17810. };
  17811. })(this),
  17812. r * n,
  17813. function () {
  17814. i.resolve();
  17815. },
  17816. o,
  17817. v[a.warp.blendEasing]
  17818. )),
  17819. i.promise()
  17820. );
  17821. }),
  17822. (n.prototype.closestPanoTowardTag = function (e, t) {
  17823. var i = [],
  17824. o = [],
  17825. l = this.disc.getWorldPosition();
  17826. if (e === s.PANORAMA) {
  17827. var c = 0.5,
  17828. h = t.position.clone().sub(l).normalize();
  17829. i.push(p.filters.isPanoAligned()),
  17830. i.push(p.filters.isNeighbourPanoTo(t)),
  17831. i.push(p.filters.inPanoDirection(l, h, c)),
  17832. o.push(p.scoreFunctions.direction(l, h));
  17833. }
  17834. var u = new r.Vector3(),
  17835. d = function (e) {
  17836. u.copy(l).sub(e.position);
  17837. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))),
  17838. i = a.tags.navigate.tiltTolerance;
  17839. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i;
  17840. },
  17841. f = function (e) {
  17842. return (
  17843. Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance ||
  17844. Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  17845. );
  17846. };
  17847. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2));
  17848. var g = this.model.panos.sortByScore(i, o);
  17849. if (a.tags.navigate.lineOfSight) {
  17850. for (var m = 0; m < g.length; m++) {
  17851. var v = g[m].item,
  17852. A = v.position.distanceTo(l);
  17853. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  17854. return null;
  17855. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  17856. var y = n.raycaster.intersectObjects(this.model.colliders);
  17857. if (0 === y.length || y[0].distance > A) return v;
  17858. }
  17859. return null;
  17860. }
  17861. return g.length > 0 && g[0].item;
  17862. }),
  17863. (n.prototype.examine = function (e) {
  17864. var t = e.mode,
  17865. i =
  17866. (a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano)) ||
  17867. e.currentPano,
  17868. n = this.disc.getWorldPosition();
  17869. this.billboard.setActiveState();
  17870. var o = function () {
  17871. var t = this.billboard.getDimensions(),
  17872. n = new r.Vector3();
  17873. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  17874. n.unproject(e.camera),
  17875. e.flyToPano({
  17876. pano: i,
  17877. lookAtPoint: n,
  17878. });
  17879. }.bind(this);
  17880. if (t === s.PANORAMA)
  17881. if (i !== e.currentPano) {
  17882. var l = {
  17883. pano: i,
  17884. lookAtPoint: n,
  17885. duration: null,
  17886. maxDistanceOverride: null,
  17887. skipWarpingCheck: !1,
  17888. };
  17889. e.flyToPano(l, o);
  17890. } else
  17891. setTimeout(
  17892. function () {
  17893. this.billboard.open().then(function () {
  17894. o();
  17895. });
  17896. }.bind(this),
  17897. 0
  17898. );
  17899. else {
  17900. var c = {
  17901. pano: i,
  17902. };
  17903. if (n) {
  17904. var h = new r.Matrix4().lookAt(i.position, n, new r.Vector3(0, 1, 0));
  17905. c.quaternion = new r.Quaternion().setFromRotationMatrix(h);
  17906. }
  17907. (c.callback = o), (c.duration = 1500), (c.mode = s.PANORAMA), e.flyToNewMode(c);
  17908. }
  17909. }),
  17910. (n.prototype.update = (function (e, t) {
  17911. var i = new r.Vector3();
  17912. return function (e, t) {
  17913. (this.discWorldPosition = this.disc.getWorldPosition()),
  17914. this.updateDisc(e, t),
  17915. this.billboard.needsUpdate() &&
  17916. (i.copy(this.discWorldPosition).project(t),
  17917. i.z < 1 && ((i.y *= -1), this.billboard.update(i, this.getDiscRadius(i, t))));
  17918. };
  17919. })()),
  17920. (n.prototype.updateDisc = (function (e, t) {
  17921. var i = new r.Vector3(),
  17922. o = new r.Vector3(),
  17923. l = new r.Vector3(),
  17924. c = new r.Vector3(),
  17925. h = new r.Vector3();
  17926. return function (e, t) {
  17927. var u = a.tags.visibility,
  17928. d = a.tags.disc.scale,
  17929. p =
  17930. e === s.DOLLHOUSE || e === s.FLOORPLAN
  17931. ? a.tags.visibility.visibleDistance
  17932. : t.position.distanceTo(this.discWorldPosition);
  17933. if (
  17934. ((this.obj3d.visible =
  17935. 0 !== this.disc.material.opacity &&
  17936. (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) &&
  17937. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  17938. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  17939. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  17940. this.obj3d.visible)
  17941. ) {
  17942. this.disc.quaternion.copy(t.quaternion);
  17943. var f =
  17944. d.maxSize -
  17945. (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  17946. i.copy(this.discWorldPosition).project(t),
  17947. o.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(i),
  17948. l.set(f / 2, 0, 0).add(o),
  17949. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  17950. h.copy(c).unproject(t);
  17951. var g = h.distanceTo(this.discWorldPosition),
  17952. m = 1 + (a.tags.disc.scale.responsiveness / 100) * (n.viewportScale() - 1);
  17953. (this.discScale = g * m),
  17954. this.disc.scale.set(this.discScale, this.discScale, this.discScale);
  17955. }
  17956. };
  17957. })()),
  17958. (n.prototype.getDiscRadius = (function (e, t) {
  17959. var i = new r.Vector3();
  17960. return function (e, t) {
  17961. return (
  17962. i
  17963. .set(-this.discScale / 2, 0, 0)
  17964. .applyQuaternion(t.quaternion)
  17965. .add(this.discWorldPosition)
  17966. .project(t),
  17967. Math.abs(e.x - i.x) * $('#player').width()
  17968. );
  17969. };
  17970. })()),
  17971. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  17972. return (
  17973. !(e === s.DOLLHOUSE || e === s.FLOORPLAN) ||
  17974. this.model.allFloorsVisible ||
  17975. !this.floor.hidden
  17976. );
  17977. }),
  17978. (n.prototype.offScreen = function (e, t) {
  17979. var i = e.getWorldPosition().project(t);
  17980. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1);
  17981. }),
  17982. (n.viewportScale = function () {
  17983. return (
  17984. (n.viewportWidth === $('#player').width() &&
  17985. n.viewportHeight === $('#player').height()) ||
  17986. ((n.viewportWidth = $('#player').width()),
  17987. (n.viewportHeight = $('#player').height()),
  17988. (n.currentViewportScale = Math.sqrt(
  17989. Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize
  17990. ))),
  17991. n.currentViewportScale
  17992. );
  17993. }),
  17994. (t.exports = n);
  17995. }.call(this, '/js/tag/tag.js'));
  17996. },
  17997. {
  17998. '../enum/Colors': 19,
  17999. '../enum/RenderLayers': 41,
  18000. '../enum/RenderOrder': 42,
  18001. '../enum/Viewmode': 51,
  18002. '../objects/Panorama': 148,
  18003. '../settings': 166,
  18004. '../shaders': 167,
  18005. '../util/common': 185,
  18006. '../util/easing': 186,
  18007. '../util/lerp': 188,
  18008. '../util/logger': 189,
  18009. '../util/math': 190,
  18010. '../util/texture': 194,
  18011. '../util/transitions': 195,
  18012. './Billboard/Billboard': 119,
  18013. './Billboard/BillboardEvent': 120,
  18014. events: 202,
  18015. three: 217,
  18016. },
  18017. ],
  18018. 124: [
  18019. function (e, t, i) {
  18020. (function (i) {
  18021. 'use strict';
  18022. function n() {
  18023. (this.tagState = y.IDLE),
  18024. (this.intersectTag = null),
  18025. (this.hoveredTag = null),
  18026. (this.activeTag = null),
  18027. (this.tagDiscs = []),
  18028. (this.raycaster = new r.Raycaster()),
  18029. (this.modelManager = null),
  18030. (this.player = null),
  18031. (this.totaltags = 0),
  18032. (this.navigatingViaTag = !1),
  18033. (this.enabled = !1);
  18034. }
  18035. var r = e('three'),
  18036. o = e('../util/logger'),
  18037. a = e('../util/common'),
  18038. s = e('../controls/serializer'),
  18039. l = e('../objects/Snapshot'),
  18040. c = e('../settings'),
  18041. h = e('./Billboard/BillboardEvent'),
  18042. u = e('./Media/MediaEvent'),
  18043. d = e('./Media/LinkType'),
  18044. p = e('../enum/Viewmode'),
  18045. f = e('../enum/WarpStyle'),
  18046. g = e('../enum/BlackoutStyle'),
  18047. m = e('../enum/ModelManagerEvents'),
  18048. v = e('../enum/tagEvents'),
  18049. A = e('../enum/PlayerEvents'),
  18050. y = (e('../util/lerp'), e('../enum/TagStates')),
  18051. C = e('events').EventEmitter,
  18052. I = new o(i);
  18053. a.extend(n, C),
  18054. (n.prototype.init = function (e, t) {
  18055. (this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents();
  18056. }),
  18057. (n.prototype.update = function (e) {
  18058. this.updateTags(
  18059. this.player.mode,
  18060. this.player.camera,
  18061. this.player.currentPano,
  18062. this.player.flying
  18063. );
  18064. }),
  18065. (n.prototype.updateTags = function (e, t, i, n) {
  18066. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n);
  18067. }),
  18068. (n.prototype.updateModel = function () {
  18069. (this.model = this.modelManager.getActiveModel()),
  18070. this.gettagsFromModel(),
  18071. (this.totaltags = Object.keys(this.model.tags).length);
  18072. }),
  18073. (n.prototype.gettagsFromModel = function () {
  18074. this.tagDiscs = [];
  18075. for (var e in this.model.tags) {
  18076. var t = this.model.tags[e].disc;
  18077. t && this.tagDiscs.push(t);
  18078. }
  18079. }),
  18080. (n.prototype.bindEvents = function () {
  18081. function e() {
  18082. Object.keys(this.model.tags).forEach(
  18083. function (e) {
  18084. var t = this.model.tags[e];
  18085. t.bindEvents(),
  18086. t.billboard.on(
  18087. u.LINK_CLICK,
  18088. function (e) {
  18089. e.type === d.NAVIGATION && this.navigateViaLink(e.url);
  18090. }.bind(this)
  18091. ),
  18092. t.billboard.on(
  18093. u.IMAGE_OPENED,
  18094. function () {
  18095. (this.tagState = y.EXAMINE), this.emit(u.IMAGE_OPENED);
  18096. }.bind(this)
  18097. ),
  18098. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this));
  18099. }.bind(this)
  18100. );
  18101. }
  18102. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  18103. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  18104. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  18105. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  18106. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  18107. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  18108. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  18109. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  18110. e.call(this);
  18111. }),
  18112. (n.prototype.navigateViaLink = function (e) {
  18113. var t = s.deserialize(e);
  18114. if (t)
  18115. if (t.mode === p.PANORAMA) {
  18116. try {
  18117. this.player.model.panos.get(t.panoId);
  18118. } catch (e) {
  18119. return void I.warn('Unable to find panorama location', t.panoId);
  18120. }
  18121. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK);
  18122. } else {
  18123. var i = {
  18124. cameraMode: t.mode,
  18125. position: t.position,
  18126. quaternion: t.quaternion,
  18127. scanId: t.panoId,
  18128. orthoZoom: t.zoom,
  18129. floorVisibility: t.floorVisibility,
  18130. thumbUrl: null,
  18131. name: null,
  18132. };
  18133. this.player.flyToNewMode({
  18134. mode: t.mode,
  18135. duration: c.warp.outsideTime,
  18136. warpDest: new l(i),
  18137. force: !0,
  18138. });
  18139. }
  18140. }),
  18141. (n.prototype.handleWarpStart = function (e, t, i, n) {
  18142. this.dismissExaminedTag(),
  18143. t === f.BLACK &&
  18144. ((null !== n && void 0 !== n) || (n = c.warp.teleportTime),
  18145. e && (i = g.END),
  18146. this.hideShowTagsForBlackoutStyle(i, n));
  18147. }),
  18148. (n.prototype.handleWarpInterruption = function (e, t, i) {
  18149. (null !== i && void 0 !== i) || (i = c.warp.teleportTime),
  18150. this.hideShowTagsForBlackoutStyle(t, i);
  18151. }),
  18152. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  18153. var i = 0,
  18154. n = 0,
  18155. r = t / 2;
  18156. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  18157. case g.END:
  18158. this.hideAlltags(r);
  18159. break;
  18160. case g.BEGINNING:
  18161. this.hideAlltags().done(this.showAlltags.bind(this, r));
  18162. break;
  18163. case g.NONE:
  18164. break;
  18165. case g.MIDDLE:
  18166. (i = r),
  18167. (n = r),
  18168. this.hideAlltags(n),
  18169. setTimeout(
  18170. function () {
  18171. this.showAlltags(i);
  18172. }.bind(this),
  18173. n
  18174. );
  18175. break;
  18176. case g.FADEIN:
  18177. setTimeout(
  18178. function () {
  18179. this.showAlltags(r);
  18180. }.bind(this),
  18181. r
  18182. );
  18183. }
  18184. }),
  18185. (n.prototype.onPlayerModeChanging = function (e, t) {
  18186. t !== p.PANORAMA && this.dismissExaminedTag(),
  18187. t === p.PANORAMA &&
  18188. player.currentPano &&
  18189. !player.currentPano.isAligned() &&
  18190. (t = p.OUTDOOR);
  18191. var i = t !== p.OUTDOOR;
  18192. i !== this.model.tagsShown &&
  18193. (i
  18194. ? this.showAlltags(c.tags.startup.fadeInDuration)
  18195. : this.hideAlltags(c.tags.startup.fadeInDuration));
  18196. }),
  18197. (n.prototype.onPanoChange = function (e, t) {
  18198. var i = this.navigatingViaTag;
  18199. if (((this.navigatingViaTag = !1), !i)) {
  18200. this.dismissExaminedTag();
  18201. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  18202. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  18203. n !== r &&
  18204. (r === p.PANORAMA
  18205. ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0)
  18206. : this.hideAlltags(c.tags.startup.fadeInDuration));
  18207. }
  18208. }),
  18209. (n.prototype.onPlayerReady = function (e, t, i) {
  18210. this.startAlltags(e, t ? i : null);
  18211. }),
  18212. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  18213. this.updateClosestTags(e);
  18214. }),
  18215. (n.prototype.dismissExaminedTag = function () {
  18216. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  18217. this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null));
  18218. }),
  18219. (n.prototype.startAlltags = function (e, t) {
  18220. (this.model.shouldShowtags = c.tags.enabled),
  18221. (this.enabled = !0),
  18222. e ||
  18223. (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  18224. t &&
  18225. setTimeout(
  18226. function () {
  18227. this.activateTag(this.model.getTagBySid(t));
  18228. }.bind(this),
  18229. c.tags.startup.fadeInDuration / 2
  18230. ));
  18231. }),
  18232. (n.prototype.showAlltags = function (e, t, i) {
  18233. function n() {
  18234. o++, o === this.totaltags && ((this.model.tagsShown = !0), r.resolve());
  18235. }
  18236. var r = $.Deferred();
  18237. if (
  18238. (!i &&
  18239. this.player.mode === p.PANORAMA &&
  18240. this.player.currentPano &&
  18241. !this.player.currentPano.isAligned()) ||
  18242. !this.model.shouldShowtags
  18243. )
  18244. return r.resolve().promise();
  18245. var o = 0;
  18246. for (var a in this.model.tags) {
  18247. var s = this.model.tags[a];
  18248. s.show(e, t).done(n.bind(this));
  18249. }
  18250. return r.promise();
  18251. }),
  18252. (n.prototype.hideAlltags = function (e, t) {
  18253. function i() {
  18254. r++, r === this.totaltags && ((this.model.tagsShown = !1), n.resolve());
  18255. }
  18256. var n = $.Deferred(),
  18257. r = 0;
  18258. for (var o in this.model.tags) {
  18259. var a = this.model.tags[o];
  18260. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag();
  18261. }
  18262. return n.promise();
  18263. }),
  18264. (n.prototype.enableHovering = function () {
  18265. this.enabled = !0;
  18266. }),
  18267. (n.prototype.disableHovering = function () {
  18268. this.enabled = !1;
  18269. }),
  18270. (n.prototype.activateTag = function (e, t) {
  18271. (t = t || y.EXAMINE),
  18272. (this.activeTag = e),
  18273. (this.activeTag.hoveringDisc = !0),
  18274. this.activeTag.setHoverState(t === y.EXAMINE),
  18275. (this.tagState = t),
  18276. this.emit(v.TagActivated, e);
  18277. }),
  18278. (n.prototype.dismissActiveTag = function () {
  18279. (this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0);
  18280. var e = this.activeTag;
  18281. (this.activeTag = null), (this.tagState = y.IDLE), this.emit(v.TagDismissed, e);
  18282. }),
  18283. (n.prototype.clickedOnTag = function (e) {
  18284. var t = function () {
  18285. (this.navigatingViaTag = !0),
  18286. this.activeTag.examine(this.player),
  18287. this.emit(v.TagNavigation, this.activeTag);
  18288. }.bind(this);
  18289. return this.tagState !== y.EXAMINE
  18290. ? (this.activateTag(this.intersectTag, y.EXAMINE),
  18291. (this.activeTag = this.intersectTag),
  18292. t(),
  18293. !0)
  18294. : (this.dismissActiveTag(), !1);
  18295. }),
  18296. (n.prototype.intersecttag = (function () {
  18297. var e = new r.Vector3(),
  18298. t = new r.Vector3(),
  18299. i = new r.Vector3();
  18300. return function (n, r, o) {
  18301. if (!this.enabled) return null;
  18302. var a = null,
  18303. s = this.tagDiscs.filter(function (e) {
  18304. return e.parent.visible;
  18305. });
  18306. if (s.length > 0) {
  18307. var l = this.model.floors.reduce(function (e, t) {
  18308. return t.hidden ? e : e.concat(t.collider.children);
  18309. }, s);
  18310. e.set(n.x, n.y, -1).unproject(o),
  18311. t.set(n.x, n.y, 1).unproject(o),
  18312. i.copy(t).sub(e).normalize(),
  18313. this.raycaster.set(e, i);
  18314. var c = this.raycaster.intersectObjects(l);
  18315. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag);
  18316. }
  18317. return (
  18318. (this.intersectTag = a),
  18319. r &&
  18320. (this.activeTag &&
  18321. a !== this.activeTag &&
  18322. (this.tagState === y.BROWSE || (this.tagState === y.EXAMINE && a)) &&
  18323. this.dismissActiveTag(),
  18324. a &&
  18325. a !== this.activeTag &&
  18326. (a.listeners(h.ENTER).length < 1 &&
  18327. (a.billboard.on(
  18328. h.ENTER,
  18329. function () {
  18330. this.hoveredTag = a;
  18331. }.bind(this)
  18332. ),
  18333. a.billboard.on(
  18334. h.LEAVE,
  18335. function () {
  18336. this.hoveredTag = null;
  18337. }.bind(this)
  18338. )),
  18339. this.activateTag(a, y.BROWSE))),
  18340. a
  18341. );
  18342. };
  18343. })()),
  18344. (n.prototype.rankedtagInDirection = (function () {
  18345. var e = [],
  18346. t = [],
  18347. i = new r.Vector3(),
  18348. n = new r.Vector3(),
  18349. o = new r.Vector3();
  18350. return function (r, a, s, l) {
  18351. var c = 0;
  18352. t.length = 0;
  18353. for (var h = 0; h < this.closesttags.length; h++) {
  18354. var u = this.closesttags[h];
  18355. n.copy(u.position),
  18356. n.add(u.discPosition),
  18357. i.copy(a),
  18358. i.sub(n).negate(),
  18359. i.normalize();
  18360. var d = i.dot(l);
  18361. if (d >= 0) {
  18362. o.copy(n), o.project(s);
  18363. var p = this.intersecttag(o, !1, s);
  18364. if (p) {
  18365. if (c >= e.length)
  18366. for (var f = 0; f < 64; f++)
  18367. e.push({
  18368. tag: u,
  18369. dot: d,
  18370. });
  18371. var g = e[c];
  18372. (g.tag = u),
  18373. (g.dot = d),
  18374. (g.position = math.projectPositionToCanvas(n, s)),
  18375. t.push(g),
  18376. c++;
  18377. }
  18378. }
  18379. }
  18380. return (
  18381. t.sort(function (e, t) {
  18382. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0;
  18383. }),
  18384. r < t.length ? t[r].tag : null
  18385. );
  18386. };
  18387. })()),
  18388. (n.prototype.updateClosestTags = (function () {
  18389. var e = new r.Vector3(),
  18390. t = 30;
  18391. return function (i) {
  18392. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0);
  18393. var n = this.model.tags;
  18394. if (n)
  18395. for (var r in n)
  18396. if (n.hasOwnProperty(r)) {
  18397. var o = n[r],
  18398. a = o.position;
  18399. e.copy(i), e.sub(a).negate();
  18400. var s = e.lengthSq();
  18401. s < t && this.closesttags.push(o);
  18402. }
  18403. };
  18404. })()),
  18405. (t.exports = n);
  18406. }.call(this, '/js/tag/tagManager.js'));
  18407. },
  18408. {
  18409. '../controls/serializer': 14,
  18410. '../enum/BlackoutStyle': 18,
  18411. '../enum/tagEvents': 32,
  18412. '../enum/ModelManagerEvents': 33,
  18413. '../enum/PlayerEvents': 40,
  18414. '../enum/TagStates': 44,
  18415. '../enum/Viewmode': 51,
  18416. '../enum/WarpStyle': 52,
  18417. '../objects/Snapshot': 153,
  18418. '../settings': 166,
  18419. '../util/common': 185,
  18420. '../util/lerp': 188,
  18421. '../util/logger': 189,
  18422. './Billboard/BillboardEvent': 120,
  18423. './Media/LinkType': 130,
  18424. './Media/MediaEvent': 131,
  18425. events: 202,
  18426. three: 217,
  18427. },
  18428. ],
  18429. 125: [
  18430. function (e, t, i) {
  18431. (function (i) {
  18432. 'use strict';
  18433. function n() {
  18434. (this.embedWrapper = null), (this.embedElement = null);
  18435. }
  18436. var r = e('../../util/ajax'),
  18437. o = e('./mediaSettings'),
  18438. a = e('../../settings'),
  18439. s = e('../../util/logger'),
  18440. l = new s(i);
  18441. (n.prototype.createDomElement = function () {
  18442. return (
  18443. (this.embedWrapper = document.createElement('div')),
  18444. this.embedWrapper.classList.add('tag-embed'),
  18445. this.embedWrapper.classList.add('hidden'),
  18446. this.embedWrapper
  18447. );
  18448. }),
  18449. (n.prototype.load = function (e) {
  18450. var t =
  18451. 'https://api.embedly.com/1/oembed?key=' +
  18452. a.appConfig.embedly_key +
  18453. '&url=' +
  18454. encodeURIComponent(e) +
  18455. '&maxwidth=' +
  18456. o.maxEmbedWidth;
  18457. return new Promise(
  18458. function (e, i) {
  18459. r.get(t).then(
  18460. function (t) {
  18461. if (((t = JSON.parse(t)), t.html && t.html.indexOf('<script') === -1)) {
  18462. this.embedWrapper.innerHTML = t.html;
  18463. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  18464. if (((this.embedWrapper.style.width = n + 'px'), t.height)) {
  18465. var r = t.height / t.width;
  18466. this.embedWrapper.style.height = n * r + 'px';
  18467. }
  18468. this.embedElement = this.embedWrapper.firstChild;
  18469. var a = [];
  18470. try {
  18471. a = [].slice.call(this.embedElement.querySelectorAll('a'));
  18472. } catch (e) {
  18473. l.debug('Error getting `a` elements for embed; was it an iframe?');
  18474. }
  18475. a.forEach(function (e) {
  18476. e.setAttribute('target', '_blank');
  18477. }),
  18478. this.embedElement.classList.add('hidden'),
  18479. this.embedWrapper.classList.remove('hidden'),
  18480. e();
  18481. } else i('Not a valid embed');
  18482. }.bind(this),
  18483. function (e) {
  18484. i(e.response);
  18485. }
  18486. );
  18487. }.bind(this)
  18488. );
  18489. }),
  18490. (n.prototype.show = function () {
  18491. this.embedElement && this.embedElement.classList.remove('hidden');
  18492. }),
  18493. (n.prototype.hide = function () {
  18494. this.embedElement && this.embedElement.classList.add('hidden');
  18495. }),
  18496. (t.exports = n);
  18497. }.call(this, '/js/tag/Media/EmbedlyEmbed.js'));
  18498. },
  18499. {
  18500. '../../settings': 166,
  18501. '../../util/ajax': 181,
  18502. '../../util/logger': 189,
  18503. './mediaSettings': 132,
  18504. },
  18505. ],
  18506. 126: [
  18507. function (e, t, i) {
  18508. (function (i) {
  18509. 'use strict';
  18510. function n(e) {
  18511. o.call(this),
  18512. (this.options = e),
  18513. (this.playerControls = null),
  18514. (this.state = s.NOT_READY);
  18515. }
  18516. var r = e('../../util/browser'),
  18517. o = e('./EmbedlyEmbed'),
  18518. a = e('../../util/logger'),
  18519. s =
  18520. (new a(i),
  18521. Object.freeze({
  18522. NOT_READY: 'player.not.ready',
  18523. CUED: 'player.cued',
  18524. PLAYING: 'player.playing',
  18525. PAUSED: 'player.paused',
  18526. }));
  18527. (n.prototype = Object.create(o.prototype)),
  18528. (n.prototype.createDomElement = function () {
  18529. return (
  18530. (this.embedWrapper = document.createElement('div')),
  18531. this.embedWrapper.classList.add('tag-video'),
  18532. this.embedWrapper.classList.add('hidden'),
  18533. this.embedWrapper
  18534. );
  18535. }),
  18536. (n.prototype.load = function (e) {
  18537. var t = function () {
  18538. function e(e) {
  18539. (this.playerState = s.CUED),
  18540. this.options.startMuted && this.playerControls.mute();
  18541. }
  18542. function t(e) {
  18543. this.playerState = e;
  18544. }
  18545. function i(e) {
  18546. this.playerControls.setCurrentTime(0),
  18547. this.options.loop ? this.playerControls.play() : this.playerControls.pause();
  18548. }
  18549. (this.playerControls = new playerjs.Player(this.embedElement)),
  18550. this.playerControls.on('ready', e.bind(this)),
  18551. this.playerControls.on('play', t.bind(this, s.PLAYING)),
  18552. this.playerControls.on('pause', t.bind(this, s.PAUSED)),
  18553. this.playerControls.on('ended', i.bind(this));
  18554. }.bind(this);
  18555. return o.prototype.load.call(this, e).then(t.bind(this));
  18556. }),
  18557. (n.prototype.play = (function () {
  18558. var e = r.isMobile();
  18559. return function () {
  18560. this.playerState !== s.NOT_READY &&
  18561. this.playerControls &&
  18562. !e &&
  18563. ((this.state === s.CUED && this.options.autoPlay) || this.options.autoResume) &&
  18564. this.playerControls.play();
  18565. };
  18566. })()),
  18567. (n.prototype.pause = function () {
  18568. this.playerState !== s.NOT_READY &&
  18569. this.playerControls &&
  18570. this.playerControls.pause();
  18571. }),
  18572. (t.exports = n);
  18573. }.call(this, '/js/tag/Media/EmbedlyPlayer.js'));
  18574. },
  18575. {
  18576. '../../util/browser': 182,
  18577. '../../util/logger': 189,
  18578. './EmbedlyEmbed': 125,
  18579. },
  18580. ],
  18581. 127: [
  18582. function (e, t, i) {
  18583. (function (i) {
  18584. 'use strict';
  18585. function n(e) {
  18586. function t() {
  18587. return (
  18588. a.debug('requesting file from embedly:', e.href),
  18589. r
  18590. .get(e.href, {
  18591. responseType: e.responseType,
  18592. })
  18593. .then(function (t) {
  18594. return a.debug('requesting file finished:', e.href), t;
  18595. })
  18596. );
  18597. }
  18598. function i() {}
  18599. return (s = new Promise(function (e, n) {
  18600. s.catch(i).then(function () {
  18601. t().then(e, n);
  18602. });
  18603. }));
  18604. }
  18605. var r = e('../../util/ajax'),
  18606. o = (e('./mediaSettings'), e('../../util/logger')),
  18607. a = new o(i),
  18608. s = Promise.resolve();
  18609. t.exports.enqueue = n;
  18610. }.call(this, '/js/tag/Media/EmbedlyQueue.js'));
  18611. },
  18612. {
  18613. '../../util/ajax': 181,
  18614. '../../util/logger': 189,
  18615. './mediaSettings': 132,
  18616. },
  18617. ],
  18618. 128: [
  18619. function (e, t, i) {
  18620. (function (i) {
  18621. 'use strict';
  18622. function n() {
  18623. (this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1);
  18624. }
  18625. var r = e('./MediaEvent'),
  18626. o = e('./EmbedlyQueue'),
  18627. a = e('events').EventEmitter,
  18628. s = e('../../util/logger'),
  18629. l = e('../../settings');
  18630. new s(i);
  18631. (n.prototype = Object.create(a.prototype)),
  18632. (n.prototype.createDomElement = function () {
  18633. return (
  18634. (this.imageWrapper = document.createElement('div')),
  18635. this.imageWrapper.classList.add('tag-image'),
  18636. this.imageWrapper.classList.add('hidden'),
  18637. this.imageWrapper.addEventListener(
  18638. 'click',
  18639. function (e) {
  18640. e.stopPropagation(),
  18641. this.emit(r.IMAGE_OPENING),
  18642. (this.imageWrapper.style.pointerEvents = 'none');
  18643. }.bind(this)
  18644. ),
  18645. this.imageWrapper
  18646. );
  18647. }),
  18648. (n.prototype.onClosed = function () {
  18649. this.imageWrapper.style.pointerEvents = 'auto';
  18650. }),
  18651. (n.prototype.load = function (e) {
  18652. var t = Math.max(window.screen.height, window.screen.width),
  18653. i =
  18654. 'https://i.embed.ly/1/display/resize?key=' +
  18655. l.appConfig.embedly_key +
  18656. '&url=' +
  18657. encodeURIComponent(e) +
  18658. '&width=' +
  18659. t +
  18660. '&height=' +
  18661. t;
  18662. return new Promise(
  18663. function (e, t) {
  18664. function n(t) {
  18665. var i = t.target;
  18666. (this.width = i.naturalWidth),
  18667. (this.height = i.naturalHeight),
  18668. (this.aspect = this.width / this.height);
  18669. var n = t.target.src;
  18670. (this.imageWrapper.style.backgroundImage = 'url("' + n + '")'),
  18671. (this.imageWrapper.style.width = this.width + 'px'),
  18672. (this.imageWrapper.style.height = this.height + 'px'),
  18673. this.imageWrapper.classList.remove('hidden'),
  18674. e();
  18675. }
  18676. o.enqueue({
  18677. href: i,
  18678. responseType: 'arraybuffer',
  18679. }).then(
  18680. function (e) {
  18681. var t = new Uint8Array(e),
  18682. i = new Blob([t]),
  18683. r = new window.Image();
  18684. r.addEventListener('load', n.bind(this));
  18685. var o = URL.createObjectURL(i);
  18686. r.src = o;
  18687. }.bind(this),
  18688. t
  18689. );
  18690. }.bind(this)
  18691. );
  18692. }),
  18693. (t.exports = n);
  18694. }.call(this, '/js/tag/Media/Image.js'));
  18695. },
  18696. {
  18697. '../../settings': 166,
  18698. '../../util/logger': 189,
  18699. './EmbedlyQueue': 127,
  18700. './MediaEvent': 131,
  18701. events: 202,
  18702. },
  18703. ],
  18704. 129: [
  18705. function (e, t, i) {
  18706. 'use strict';
  18707. function n(e) {
  18708. (this.label = e.label),
  18709. (this.href = e.url),
  18710. (this.type = this.updateLinkForType()),
  18711. (this.domElement = null),
  18712. (this.id = c++);
  18713. }
  18714. var r = e('./LinkType'),
  18715. o = e('./MediaEvent'),
  18716. a = e('../../util/browser'),
  18717. s = e('../../analytics'),
  18718. l = e('events').EventEmitter,
  18719. c = 0;
  18720. (n.prototype = Object.create(l.prototype)),
  18721. (n.prototype.updateLinkForType = function () {
  18722. function e(e) {
  18723. var t = new RegExp('[#&?]start=([^#&?]*)'),
  18724. i = t.exec(e);
  18725. return i[1];
  18726. }
  18727. function t(e) {
  18728. return e + '&play=1';
  18729. }
  18730. var i = a.valueFromHash('m') || a.valueFromHash('model');
  18731. return this.href.indexOf('port.com/show') !== -1 ||
  18732. this.href.indexOf(window.location.host + '/show') !== -1
  18733. ? this.href.indexOf(i) !== -1 && this.href.indexOf('start=') !== -1
  18734. ? ((this.href = e(this.href)), r.NAVIGATION)
  18735. : ((this.href = t(this.href)), r.MODEL)
  18736. : r.EXT_LINK;
  18737. });
  18738. var h = {};
  18739. (n.prototype.createDomElement = function () {
  18740. function e(e) {
  18741. switch (
  18742. (e.stopPropagation(),
  18743. (h[this.id] = !0),
  18744. s.trackAlways('click_tag_link', {
  18745. link_type: this.type,
  18746. link_count: c,
  18747. links_clicked: Object.keys(h).length,
  18748. }),
  18749. this.type)
  18750. ) {
  18751. case r.MODEL:
  18752. window.location.replace(this.href);
  18753. break;
  18754. case r.EXT_LINK:
  18755. window.open(this.href, '_blank');
  18756. }
  18757. this.emit(o.LINK_CLICK, {
  18758. type: this.type,
  18759. url: this.href,
  18760. });
  18761. }
  18762. if (
  18763. ((this.domElement = document.createElement('a')),
  18764. this.domElement.classList.add('tag-link'),
  18765. (this.domElement.textContent = this.label),
  18766. this.type === r.EXT_LINK)
  18767. ) {
  18768. this.domElement.textContent += ' ';
  18769. var t = document.createElement('i');
  18770. t.classList.add('icon-ext-link'),
  18771. (t.title = 'Link to external web site'),
  18772. this.domElement.appendChild(t);
  18773. }
  18774. return this.domElement.addEventListener('click', e.bind(this)), this.domElement;
  18775. }),
  18776. (t.exports = n);
  18777. },
  18778. {
  18779. '../../analytics': 4,
  18780. '../../util/browser': 182,
  18781. './LinkType': 130,
  18782. './MediaEvent': 131,
  18783. events: 202,
  18784. },
  18785. ],
  18786. 130: [
  18787. function (e, t, i) {
  18788. 'use strict';
  18789. t.exports = {
  18790. NAVIGATION: 'navigation',
  18791. MODEL: 'model',
  18792. EXT_LINK: 'ext-link',
  18793. };
  18794. },
  18795. {},
  18796. ],
  18797. 131: [
  18798. function (e, t, i) {
  18799. 'use strict';
  18800. t.exports = Object.freeze({
  18801. LINK_CLICK: 'mtmedia.link',
  18802. IMAGE_LOADED: 'mtmedia.image.loaded',
  18803. IMAGE_OPENING: 'mtmedia.image.opening',
  18804. IMAGE_OPENED: 'mtmedia.image.opened',
  18805. IMAGE_CLOSING: 'mtmedia.image.closing',
  18806. IMAGE_CLOSED: 'mtmedia.image.closed',
  18807. VIDEO_START: 'mtmedia.video.start',
  18808. VIDEO_PAUSE: 'mtmedia.video.pause',
  18809. VIDEO_ENDED: 'mtmedia.video.end',
  18810. });
  18811. },
  18812. {},
  18813. ],
  18814. 132: [
  18815. function (e, t, i) {
  18816. 'use strict';
  18817. t.exports = Object.freeze({
  18818. maxEmbedWidth: 350,
  18819. defaultAspectRatio: 0.75,
  18820. });
  18821. },
  18822. {},
  18823. ],
  18824. 133: [
  18825. function (e, t, i) {
  18826. 'use strict';
  18827. t.exports = Object.freeze({
  18828. TEXT: 'text',
  18829. LINK: 'link',
  18830. IMAGE: 'photo',
  18831. VIDEO: 'video',
  18832. RICH: 'rich',
  18833. });
  18834. },
  18835. {},
  18836. ],
  18837. 134: [
  18838. function (e, t, i) {
  18839. 'use strict';
  18840. function n(e) {
  18841. this.capabilities = {
  18842. links: {
  18843. enable: e.supportLinks,
  18844. keepLabels: e.keepLinkLabels,
  18845. },
  18846. };
  18847. }
  18848. var r = e('./DescriptionChunkType');
  18849. (n.prototype.parse = function (e, t) {
  18850. var i = [],
  18851. n = e.split('[').map(function (e, t) {
  18852. return 0 === t ? e : '[' + e;
  18853. });
  18854. return (
  18855. n.forEach(
  18856. function (e) {
  18857. var n = this.findMarkdown(e);
  18858. if (n) {
  18859. if (n.url.indexOf('javascript:') !== -1) return;
  18860. this.addLinkChunk(i, n, t), this.addTextChunk(i, e.slice(n.markdown.length));
  18861. } else this.addTextChunk(i, e);
  18862. }.bind(this)
  18863. ),
  18864. i
  18865. );
  18866. }),
  18867. (n.prototype.findMarkdown = function (e) {
  18868. var t = /\[([^\]]*)\]\((.*)\)/,
  18869. i = e.match(t);
  18870. if (i) {
  18871. for (
  18872. var n = i[2], r = 1, o = 0;
  18873. o < n.length && ('(' === n[o] ? r++ : ')' === n[o] && r--, 0 !== r);
  18874. )
  18875. o++;
  18876. var a = n.length - o;
  18877. return {
  18878. markdown: i[0].substring(0, i[0].length - a),
  18879. label: i[1],
  18880. url: i[2].substring(0, o),
  18881. };
  18882. }
  18883. }),
  18884. (n.prototype.addTextChunk = function (e, t) {
  18885. 0 !== t.length &&
  18886. e.push({
  18887. type: r.TEXT,
  18888. text: t,
  18889. });
  18890. }),
  18891. (n.prototype.addLinkChunk = function (e, t) {
  18892. if (!this.capabilities.links.enable)
  18893. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  18894. var i = {
  18895. label: t.label,
  18896. url: t.url,
  18897. };
  18898. i.url.indexOf('://') === -1 && (i.url = 'http://' + i.url),
  18899. e.push({
  18900. type: r.LINK,
  18901. link: i,
  18902. });
  18903. }),
  18904. (t.exports = n);
  18905. },
  18906. {
  18907. './DescriptionChunkType': 133,
  18908. },
  18909. ],
  18910. 135: [
  18911. function (e, t, i) {
  18912. (function (i) {
  18913. 'use strict';
  18914. var n = e('../util/logger'),
  18915. r = new n(i),
  18916. o = {
  18917. parseIdsFromChunkName: function (e, t) {
  18918. (t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e));
  18919. },
  18920. parseFloor: function (e) {
  18921. var t = e.match(/_group([0-9]+)/);
  18922. if (!t) return 0;
  18923. try {
  18924. return parseInt(t[1], 10);
  18925. } catch (e) {
  18926. return (
  18927. r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  18928. );
  18929. }
  18930. },
  18931. parseRoom: function (e) {
  18932. var t = e.match(/_sub([0-9]+)/);
  18933. if (!t) return -1;
  18934. try {
  18935. return parseInt(t[1], 10);
  18936. } catch (e) {
  18937. return (
  18938. r.warn(
  18939. 'Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'
  18940. ),
  18941. 0
  18942. );
  18943. }
  18944. },
  18945. };
  18946. t.exports = o;
  18947. }.call(this, '/js/model/Chunks.js'));
  18948. },
  18949. {
  18950. '../util/logger': 189,
  18951. },
  18952. ],
  18953. 136: [
  18954. function (e, t, i) {
  18955. (function (i) {
  18956. 'use strict';
  18957. function n(e) {
  18958. s.call(this), (this.model = e), (this.exploded = !1);
  18959. }
  18960. var r = e('../objects/Floor'),
  18961. o = (e('../settings'), e('../util/logger')),
  18962. a = e('../util/transitions'),
  18963. s = e('../util/IndexedCollection'),
  18964. l = e('../util/common'),
  18965. c = e('../util/easing');
  18966. new o(i);
  18967. l.inherit(n, s),
  18968. (n.prototype.add = function (e) {
  18969. s.prototype.add.call(this, e), this.model.add(e);
  18970. }),
  18971. (n.prototype.getIndex = function (e) {
  18972. return e.floorIndex;
  18973. }),
  18974. (n.prototype.build = function () {
  18975. this.list.forEach(function (e) {
  18976. e.build();
  18977. });
  18978. }),
  18979. (n.prototype.size = function () {
  18980. return this.length;
  18981. }),
  18982. (n.prototype.sort = function () {
  18983. s.prototype.sort.call(this, function (e, t) {
  18984. return e.floorIndex - t.floorIndex;
  18985. });
  18986. }),
  18987. (n.prototype.nextFloor = function (e, t) {
  18988. return this.index[e.floorIndex + t] || null;
  18989. }),
  18990. (n.prototype.getFloorAtPoint = function (e) {
  18991. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  18992. var r = this.list[n],
  18993. o = r.distanceToPoint(e);
  18994. (!t || i > o) && ((i = o), (t = r));
  18995. }
  18996. return t;
  18997. }),
  18998. (n.prototype.getOrMakeFloor = function (e) {
  18999. var t = this.index[e];
  19000. return t || ((t = new r(this.model, e)), this.add(t)), t;
  19001. }),
  19002. (n.prototype.hide = function () {
  19003. this.list.forEach(function (e) {
  19004. e.hide();
  19005. });
  19006. }),
  19007. (n.prototype.show = function () {
  19008. this.list.forEach(function (e) {
  19009. e.show();
  19010. });
  19011. }),
  19012. (n.prototype.names = function () {
  19013. return this.list.reduce(function (e, t) {
  19014. return e.concat(t.name);
  19015. }, []);
  19016. }),
  19017. (n.prototype.toggleExplodeHorizontal = function () {
  19018. function e(e, t) {
  19019. r.copy(e.position),
  19020. (e.position.x = i[e.floorIndex] * t),
  19021. (e.position.y = 1 * e.floorIndex * t),
  19022. r.sub(e.position).multiplyScalar(-1),
  19023. e.panos.forEach(function (e) {
  19024. e.translate(r);
  19025. });
  19026. }
  19027. var t,
  19028. i = [],
  19029. n = 0;
  19030. this.list.forEach(function (e, r, o) {
  19031. (t =
  19032. r > 0
  19033. ? Math.max(
  19034. o[r - 1].boundingBox.max.x - e.boundingBox.min.x,
  19035. e.boundingBox.size().x / 2
  19036. )
  19037. : 0),
  19038. (n += t),
  19039. (i[r] = n);
  19040. }),
  19041. (i = i.map(function (e) {
  19042. return e - n / 2;
  19043. }));
  19044. var r = this.list[0].position.clone();
  19045. this.exploded
  19046. ? this.list.forEach(function (t) {
  19047. a.start(
  19048. function (i) {
  19049. e(t, 1 - i);
  19050. },
  19051. 1500,
  19052. null,
  19053. 0,
  19054. c.easeOutExpo
  19055. );
  19056. })
  19057. : this.list.forEach(function (t) {
  19058. a.start(
  19059. function (i) {
  19060. e(t, i);
  19061. },
  19062. 1500,
  19063. null,
  19064. 0,
  19065. c.easeOutExpo
  19066. );
  19067. }),
  19068. (this.exploded = !this.exploded);
  19069. }),
  19070. (n.prototype.toggleExplodeVertical = function () {
  19071. function e(e, i) {
  19072. var n = n.copy(e.position);
  19073. (e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  19074. n.sub(e.position).multiplyScalar(-1),
  19075. e.panos.forEach(function (e) {
  19076. e.translate(n);
  19077. });
  19078. }
  19079. var t = this.model.size;
  19080. this.list[0].position.clone();
  19081. this.exploded
  19082. ? this.list.forEach(function (t) {
  19083. a.start(
  19084. function (i) {
  19085. e(t, 1 - i);
  19086. },
  19087. 1500,
  19088. null,
  19089. 0,
  19090. c.easeOutExpo
  19091. );
  19092. })
  19093. : this.list.forEach(function (t) {
  19094. a.start(
  19095. function (i) {
  19096. e(t, i);
  19097. },
  19098. 1500,
  19099. null,
  19100. 0,
  19101. c.easeOutExpo
  19102. );
  19103. }),
  19104. (this.exploded = !this.exploded);
  19105. }),
  19106. (t.exports = n);
  19107. }.call(this, '/js/model/FloorCollection.js'));
  19108. },
  19109. {
  19110. '../objects/Floor': 146,
  19111. '../settings': 166,
  19112. '../util/IndexedCollection': 175,
  19113. '../util/common': 185,
  19114. '../util/easing': 186,
  19115. '../util/logger': 189,
  19116. '../util/transitions': 195,
  19117. },
  19118. ],
  19119. 137: [
  19120. function (e, t, i) {
  19121. (function (i) {
  19122. 'use strict';
  19123. function n() {
  19124. c.call(this);
  19125. }
  19126. var r = e('../settings'),
  19127. o = e('../util/logger'),
  19128. a = e('../enum/Viewmode'),
  19129. s = e('../objects/Snapshot'),
  19130. l = (e('../util/math'), e('../util/common')),
  19131. c = e('../util/IndexedCollection'),
  19132. h = new o(i);
  19133. l.inherit(n, c),
  19134. (n.prototype.getImage = function (e) {
  19135. return e && this.index.hasOwnProperty(e) ? this.index[e] : null;
  19136. }),
  19137. (n.prototype.filterByModesAndReel = function (e, t) {
  19138. for (var i = [], n = 0; n < t.length; n += 1) {
  19139. var r = t[n],
  19140. o = this.index[r.sid];
  19141. o && i.push(o);
  19142. }
  19143. var s = e[a.DOLLHOUSE],
  19144. l = e[a.FLOORPLAN];
  19145. (i = i.filter(function (e) {
  19146. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0;
  19147. var t;
  19148. try {
  19149. t = a.convertWorkshopModeInt(e.metadata.camera_mode);
  19150. } catch (e) {
  19151. return h.debug(e.message), !1;
  19152. }
  19153. return t === a.PANORAMA || (t === a.FLOORPLAN && l) || (t === a.DOLLHOUSE && s);
  19154. })),
  19155. i.length !== this.list.length &&
  19156. h.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  19157. (this.list = i),
  19158. this.reIndex();
  19159. }),
  19160. (n.prototype.getHeroLocations = function (panos) {
  19161. //改 增加二级location
  19162. if (0 === this.list.length) return [];
  19163. var locations = [];
  19164. var deal = (info, container) => {
  19165. var src = info.thumbnail_signed_src,
  19166. o = info.name || '';
  19167. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  19168. if (!r.show360Views.enabled && info.metadata.scan_id) {
  19169. let a = panos.get(info.metadata.scan_id);
  19170. if (a && !a.isAligned()) return;
  19171. }
  19172. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  19173. if (cameraMode === a.MESH) return;
  19174. if (window.isLocal) src = manage.dealURL(src);
  19175. else
  19176. src =
  19177. 'one' === g_version
  19178. ? g_Prefix + src + '?' + randomTime().getTime()
  19179. : src + '?' + randomTime().getTime();
  19180. var l = {
  19181. cameraMode: cameraMode,
  19182. position: info.metadata.camera_position,
  19183. quaternion: info.metadata.camera_quaternion,
  19184. zoom: info.metadata.zoom,
  19185. panoId: info.metadata.scan_id,
  19186. orthoZoom: info.metadata.ortho_zoom,
  19187. floorVisibility:
  19188. void 0 !== info.metadata.floor_visibility
  19189. ? info.metadata.floor_visibility.slice(0)
  19190. : [],
  19191. thumbUrl: src,
  19192. name: n.filterImageName(o),
  19193. sid: info.sid,
  19194. };
  19195. var item = new s(l);
  19196. item.momentTour = info.momentTour;
  19197. item.dontRot = info.dontRot;
  19198. item.rotTime = info.rotTime;
  19199. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}; //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  19200. container.push(item);
  19201. return item;
  19202. }
  19203. };
  19204. this.list.forEach((image) => {
  19205. if (image.images) {
  19206. var folder = $.extend({}, image);
  19207. folder.heroLocations = [];
  19208. image.images.list.forEach((child) => {
  19209. deal(child, folder.heroLocations);
  19210. });
  19211. folder.musicInfo = folder.musicInfo || {};
  19212. locations.push(folder);
  19213. delete folder.images;
  19214. delete folder.locations;
  19215. } else {
  19216. var item = deal(image, locations);
  19217. }
  19218. });
  19219. return locations;
  19220. }),
  19221. (n.prototype.getIndex = function (e) {
  19222. return e.sid;
  19223. }),
  19224. (n.filterImageName = function (e) {
  19225. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e;
  19226. }),
  19227. (t.exports = n);
  19228. }.call(this, '/js/model/ImageCollection.js'));
  19229. },
  19230. {
  19231. '../enum/Viewmode': 51,
  19232. '../objects/Snapshot': 153,
  19233. '../settings': 166,
  19234. '../util/IndexedCollection': 175,
  19235. '../util/common': 185,
  19236. '../util/logger': 189,
  19237. '../util/math': 190,
  19238. },
  19239. ],
  19240. 138: [
  19241. function (e, t, i) {
  19242. (function (i) {
  19243. 'use strict';
  19244. function n() {
  19245. u.call(this);
  19246. }
  19247. var r = e('../label/Label'),
  19248. o = e('../settings'),
  19249. a = e('../util/logger'),
  19250. s = e('../util/math'),
  19251. l = e('../util/ajax'),
  19252. c = e('./RoomCollection'),
  19253. h = e('../util/common'),
  19254. u = e('../util/IndexedCollection');
  19255. new a(i);
  19256. h.inherit(n, u),
  19257. (n.prototype.getIndex = function (e) {
  19258. return e.labelId;
  19259. }),
  19260. (n.prototype.associateWithRooms = function (e) {
  19261. this.forEach(function (t) {
  19262. e.forEach(function (e) {
  19263. e.roomId === t.roomId && (t.room = e);
  19264. });
  19265. });
  19266. }),
  19267. (n.prototype.createFromLabelData = function (e) {
  19268. e.forEach(
  19269. function (e) {
  19270. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  19271. t = c.generateRoomId(e.floorId, t);
  19272. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t);
  19273. (i.position = s.convertWorkshopVector(i.position)), this.add(i), i.build();
  19274. }.bind(this)
  19275. );
  19276. }),
  19277. (n.prototype.load = function (e, t) {
  19278. return l
  19279. .get(e, {
  19280. responseType: 'json',
  19281. auth: t ? o.authorizationHeader : null,
  19282. })
  19283. .done(
  19284. function (e) {
  19285. var t = [];
  19286. for (var i in e) {
  19287. var n = e[i];
  19288. t.push(n);
  19289. }
  19290. this.createFromLabelData(t);
  19291. }.bind(this)
  19292. );
  19293. }),
  19294. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  19295. var t = -1;
  19296. if (e) {
  19297. if (typeof e == 'number') {
  19298. //add
  19299. t = parseInt(e);
  19300. } else {
  19301. var i = e.split('_');
  19302. t = parseInt(i[0]);
  19303. }
  19304. }
  19305. return t;
  19306. }),
  19307. (t.exports = n);
  19308. }.call(this, '/js/model/LabelCollection.js'));
  19309. },
  19310. {
  19311. '../label/Label': 90,
  19312. '../settings': 166,
  19313. '../util/IndexedCollection': 175,
  19314. '../util/ajax': 181,
  19315. '../util/common': 185,
  19316. '../util/logger': 189,
  19317. '../util/math': 190,
  19318. './RoomCollection': 141,
  19319. },
  19320. ],
  19321. 139: [
  19322. function (e, t, i) {
  19323. (function (i) {
  19324. 'use strict';
  19325. function n(e, t) {
  19326. o.Object3D.call(this);
  19327. this.sid = window.number; //t.sid,
  19328. (this.data = t),
  19329. (this.options = e),
  19330. (this.urls = new s(e.urlFiles)),
  19331. (this.isPublic = void 0 !== t.is_public && t.is_public),
  19332. //创建heroLocations
  19333. (this.images = new _(this)),
  19334. this.images.extend(t.images),
  19335. this.images.forEach((info) => {
  19336. if (info.locations) {
  19337. info.images = new _(this);
  19338. info.images.extend(info.locations);
  19339. }
  19340. });
  19341. this.heroLocations = [];
  19342. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  19343. (this.outdoorPanoLocations = []),
  19344. (this.floors = new d(this)),
  19345. (this.floorsEnabled = void 0 === e.floors || e.floors),
  19346. (this.changingFloor = !1),
  19347. (this.chunks = []),
  19348. (this.panos = new A()),
  19349. (this.colliders = []),
  19350. (this.loadPanosPromise = null),
  19351. (this.loadMeshTexturesPromise = null),
  19352. (this.auxDataPromise = null),
  19353. (this.meshTexturesLoaded = !1),
  19354. (this.meshTextures = []),
  19355. (this.tags = {}),
  19356. (this.tagsShown = !1),
  19357. (this.shouldShowtags = !1),
  19358. (this.has360Views = !1),
  19359. (this.showingLabels = f.labels.enabled && t.player_options.labels),
  19360. (this.supportedModes = {}),
  19361. (this.supportedModes[c.PANORAMA] = !0),
  19362. (this.supportedModes[c.DOLLHOUSE] =
  19363. !t.player_options || (t.player_options.dollhouse && w.valueFromHash('dh', 1))),
  19364. (this.supportedModes[c.FLOORPLAN] =
  19365. !t.player_options || (t.player_options.floor_plan && w.valueFromHash('dh', 1))),
  19366. (this.supportedModes[c.TRANSITIONING] = !0),
  19367. (this.supportsTiles = this.configureTiling()),
  19368. // this.supportsVR = t.is_vr,
  19369. (this.supportsVR = window.DATA.supportsVR || false); //true; // 方奕卓 VR功能可配置
  19370. (this.mode = c.DOLLHOUSE),
  19371. (this.size = null),
  19372. (this.center = null),
  19373. (this.boundingBox = new o.Box3()),
  19374. (this.currentFloor = null),
  19375. (this.allFloorsVisible = !0),
  19376. (this.projectedPano0 = null),
  19377. (this.projectedPano1 = null),
  19378. this.floorsEnabled &&
  19379. t.floors &&
  19380. t.floors.indexOf(',') !== -1 &&
  19381. t.floors.split(',').forEach(
  19382. function (e, t) {
  19383. this.addFloor(new u(this, t, e.trim()));
  19384. }.bind(this)
  19385. ),
  19386. (this.waitQueue = []),
  19387. this.on(
  19388. 'load',
  19389. function (e) {
  19390. 0 !== this.waitQueue.length &&
  19391. ((this.waitQueue = this.waitQueue.filter(function (e) {
  19392. return !e.isLoadedCallback();
  19393. })),
  19394. 0 === this.waitQueue.length && this.emit('waiting-done'));
  19395. }.bind(this)
  19396. ),
  19397. this.setupCustomProperties();
  19398. this.hots = {};
  19399. }
  19400. function r() {
  19401. try {
  19402. var e = document.createElement('canvas'),
  19403. t = e.getContext('webgl');
  19404. t || (t = e.getContext('experimental-webgl'));
  19405. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  19406. return i;
  19407. } catch (e) {
  19408. return 0;
  19409. }
  19410. }
  19411. var o = e('three'),
  19412. a = e('../util/ajax'),
  19413. s = e('../util/ModelUrls'),
  19414. l = e('../objects/BoundingTextureSkybox'),
  19415. c = e('../enum/Viewmode'),
  19416. h = e('../enum/RenderOrder'),
  19417. u = (e('../enum/AlignmentType'), e('../objects/Floor')),
  19418. d = e('./FloorCollection'),
  19419. p = e('../objects/Chunk'),
  19420. f =
  19421. (e('../objects/Room'),
  19422. e('../objects/Snapshot'),
  19423. e('../label/Label'),
  19424. e('../util/math'),
  19425. e('../settings')),
  19426. ss = e('../shaders'),
  19427. g = e('../util/logger'),
  19428. m = e('../tag/tag'),
  19429. v = (e('../tag/tagManager'), e('../objects/Panorama')),
  19430. A = e('../util/PanoramaCollection'),
  19431. y = e('../loaders/ModelLoader'),
  19432. C = e('../loaders/ModelTextureLoader'),
  19433. I = e('../loaders/SweepDataLoader'),
  19434. E = e('../util/transitions'),
  19435. b = e('../util/common'),
  19436. es = e('../util/easing'),
  19437. lerp = e('../util/lerp'),
  19438. tex = e('../util/texture'),
  19439. w = e('./../util/browser'),
  19440. _ = e('./ImageCollection'),
  19441. T = e('./RoomCollection'),
  19442. x = e('./LabelCollection'),
  19443. S = e('./Chunks'),
  19444. M = e('./../util/showcase'),
  19445. R = e('../exception/BasicException'),
  19446. P = (e('../constants'), e('events').EventEmitter),
  19447. GLCubeFaces = e('../enum/GLCubeFaces'),
  19448. //,Hot = e("hot")
  19449. O = new g(i);
  19450. (n.prototype = Object.create(o.Object3D.prototype)),
  19451. b.extend(n, P),
  19452. (n.prototype.setupCustomProperties = function () {
  19453. var e = f.modelAlpha;
  19454. Object.defineProperty(this, 'alpha', {
  19455. get: function () {
  19456. return e;
  19457. },
  19458. set: function (t) {
  19459. e = t;
  19460. //console.log(t)
  19461. this.chunks.forEach(function (chunk) {
  19462. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  19463. chunk.material.uniforms.modelAlpha.value = e;
  19464. //修改一下defines,为了在不需要map时不加载map。 by xzw
  19465. /* if (e>0) {
  19466. if (!('useModelMap' in chunk.material.defines)) {
  19467. chunk.material.defines.useModelMap = ''
  19468. chunk.material.needsUpdate = true
  19469. console.log('add useModelMap')
  19470. }
  19471. } else {
  19472. if ('useModelMap' in chunk.material.defines) {
  19473. delete chunk.material.defines.useModelMap
  19474. chunk.material.needsUpdate = true
  19475. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  19476. console.log('delete useModelMap')
  19477. }
  19478. } */
  19479. }
  19480. });
  19481. },
  19482. });
  19483. }),
  19484. (n.prototype.configureTiling = function () {
  19485. var e = r();
  19486. if (e < 2048) return !1;
  19487. O.warn('Max cube texture size: ' + e);
  19488. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  19489. var i = f.tiling.tilingFlagNames[t];
  19490. if ('1' === w.valueFromHash(i, null)) return !0;
  19491. if ('0' === w.valueFromHash(i, null)) return !1;
  19492. }
  19493. //--------------------------------------------许钟文-------------------------------------------
  19494. //return true;
  19495. return !!M.modelDataPromisesTiles(this.data); //免去访问mdoeldata.json的vision_version,不明白这是什么
  19496. //--------------------------------------------e n d -------------------------------------------
  19497. }),
  19498. (n.prototype.toggleAlpha = function () {
  19499. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0);
  19500. }),
  19501. (n.prototype.load = function (e) {
  19502. var t = function () {
  19503. return $.when(this.loadPanos(), this.loadMesh());
  19504. },
  19505. i = this.urls.init().then(t.bind(this));
  19506. return (
  19507. e
  19508. ? (i = i.then(this.loadMeshTextures.bind(this)))
  19509. : i.then(this.loadMeshTextures.bind(this)),
  19510. (this.auxDataPromise = $.when(
  19511. /*this.loadHighlightReel(), this.loadtags() */ this.loadhots(),
  19512. this.loadLabels()
  19513. )),
  19514. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  19515. ); //不要另外使用active_reel文件
  19516. }),
  19517. (n.prototype.loadMesh = function () {
  19518. function e(e) {
  19519. O.error(e), n.reject('loading-failed');
  19520. }
  19521. function t(e, t) {
  19522. n.notify(e, t);
  19523. }
  19524. function i(e, t) {
  19525. if (0 === e.length) {
  19526. O.warn(
  19527. 'No geometry found for model, loading faux geometry, disabling outside mode'
  19528. ),
  19529. (r.supportedModes[c.DOLLHOUSE] = !1),
  19530. (r.supportedModes[c.FLOORPLAN] = !1);
  19531. var i = new p({
  19532. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1),
  19533. });
  19534. (i.material.visible = !1),
  19535. i.rotateX(-Math.PI / 2),
  19536. i.geometry.computeBoundingBox(),
  19537. (e = [i]);
  19538. }
  19539. e.forEach(function (e) {
  19540. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  19541. r.addChunk(t, e);
  19542. }),
  19543. r.floors.sort(),
  19544. n.resolve(r);
  19545. }
  19546. var n = $.Deferred(),
  19547. r = this;
  19548. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise();
  19549. }),
  19550. (n.prototype.loadMeshTextures = function () {
  19551. return this.loadTexturesPromise
  19552. ? this.loadTexturesPromise
  19553. : ((this.loadTexturesPromise = C.load(this, this.meshTextures).then(
  19554. function () {
  19555. this.meshTexturesLoaded = !0;
  19556. }.bind(this)
  19557. )),
  19558. this.loadTexturesPromise);
  19559. }),
  19560. /* n.prototype.loadtags = function() {//xzw改
  19561. var e = $.Deferred();
  19562. if (!f.tags.enabled)
  19563. return e.resolve();
  19564. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  19565. t = "data/" + this.sid + "/tags.json"
  19566. return a.get(t, {
  19567. responseType: "json",
  19568. auth: this.isPublic ? null : f.authorizationHeader
  19569. }).done(function(t) {
  19570. var i = 0
  19571. , n = 0;
  19572. for (var r in t) {
  19573. var o = t[r];
  19574. o.enabled && (n++,
  19575. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  19576. i++))
  19577. }
  19578. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  19579. e.resolve()
  19580. }
  19581. .bind(this)).fail(function() {
  19582. O.warn("Getting tags failed, not displaying tags."),
  19583. e.resolve()
  19584. }),
  19585. e
  19586. } */
  19587. (n.prototype.shineHots = function () {
  19588. //xzw
  19589. E.trigger({
  19590. func: function (e) {
  19591. var opa = e <= 0.5 ? 2 * e : -2 * e + 2;
  19592. for (var i in this.hots) {
  19593. this.hots[i].mesh.material.uniforms.opac.value = opa;
  19594. }
  19595. }.bind(this),
  19596. cycling: true,
  19597. duration: 3000,
  19598. //easing: "easeInOutQuad",
  19599. name: 'hotShine',
  19600. });
  19601. }),
  19602. /* n.prototype.loadOverlays = function(overlays){
  19603. var overlays = window.data2 && window.data2.overlays
  19604. overlays && overlays.forEach((info)=>{
  19605. new Overlay(info)
  19606. })
  19607. Overlay.load()
  19608. }
  19609. */
  19610. (n.prototype.loadhots = function () {
  19611. //xzw
  19612. initHot(this);
  19613. var r = $.Deferred();
  19614. var t = g_Prefix + 'data/' + this.sid + '/data2.js' + '?' + randomTime().getTime();
  19615. return (
  19616. a
  19617. .get(t, {
  19618. responseType: 'json',
  19619. auth: this.isPublic ? null : f.authorizationHeader,
  19620. })
  19621. .done(
  19622. function (e) {
  19623. window.data2 = e;
  19624. this.roomLabels = [];
  19625. if (!e) {
  19626. console.error('data2 is null');
  19627. } else {
  19628. g_data2 = hotMatcher(e);
  19629. this.hotsCount = 0;
  19630. let create = () => {
  19631. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  19632. if (e.hots) {
  19633. var sids = Object.keys(e.hots).sort((a, b) => {
  19634. return e.hots[a].order - e.hots[b].order;
  19635. });
  19636. sids.forEach((sid) => {
  19637. e.hots[sid].sid = sid;
  19638. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  19639. //e.hots[sid].styleImg = []
  19640. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot');
  19641. //}
  19642. });
  19643. }
  19644. if (e.overlays) {
  19645. e.overlays.forEach((info) => {
  19646. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  19647. new Hot(info, 'byOverlay');
  19648. });
  19649. }
  19650. Hot.createHotList();
  19651. Hot.startLoad();
  19652. if (DATA.roomLabels) {
  19653. DATA.roomLabels.forEach((data) => {
  19654. this.roomLabels.push(new RoomLabel(data));
  19655. });
  19656. }
  19657. };
  19658. if (player.currentPano) {
  19659. create();
  19660. } else {
  19661. let f = () => {
  19662. window.bus.removeEventListener('playerAndModelReady', f);
  19663. create();
  19664. };
  19665. window.bus.addEventListener('playerAndModelReady', f);
  19666. }
  19667. g_index = w.valueFromHash('m');
  19668. }
  19669. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  19670. /* var dataJsPromise = $.Deferred();
  19671. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  19672. a.get(dataJsUrl,{
  19673. responseType: "json",
  19674. auth: this.isPublic ? null : f.authorizationHeader
  19675. }).done(function(data) {
  19676. window.hotData = data;
  19677. this.createHotItem(data, this.hots);
  19678. for(let i in this.hots){//add
  19679. data[i] && this.hots[i].initStyleImg(data[i]);
  19680. }
  19681. dataJsPromise.resolve();
  19682. }.bind(this)).fail(function(){
  19683. console.log('Data.js is empty');
  19684. dataJsPromise.resolve();
  19685. }) */
  19686. r.resolve();
  19687. }.bind(this)
  19688. )
  19689. .fail(function () {
  19690. console.log('没有热点');
  19691. r.resolve();
  19692. }),
  19693. r
  19694. );
  19695. }),
  19696. (n.prototype.loadPanos = function () {
  19697. if (this.loadPanosPromise) return this.loadPanosPromise;
  19698. var e = new I(this);
  19699. return (
  19700. (this.loadPanosPromise = e.load().then(
  19701. function (e) {
  19702. return (
  19703. this.data.sweeps &&
  19704. Object.keys(this.data.sweeps).length > 0 &&
  19705. (e = e.filter(
  19706. function (e) {
  19707. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled;
  19708. else console.log(e.uuid);
  19709. }.bind(this)
  19710. )),
  19711. this.panos.extend(
  19712. e.map(
  19713. function (e) {
  19714. return new v(this, e.uuid, e, this.supportsTiles);
  19715. }.bind(this)
  19716. )
  19717. ),
  19718. this.panos.forEach(
  19719. function (e) {
  19720. e.neighbourUUIDs &&
  19721. (e.neighbourUUIDs.forEach(
  19722. function (t) {
  19723. var i = this.panos.get(t);
  19724. i && this.panos.setNeighbour(e, i, !0);
  19725. }.bind(this)
  19726. ),
  19727. (e.neighbourPanos =
  19728. this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0)));
  19729. }.bind(this)
  19730. ),
  19731. 0 === this.panos.length &&
  19732. (O.warn('Model has no panos, turning off inside mode'),
  19733. (this.supportedModes[c.PANORAMA] = !1)),
  19734. $.when(this)
  19735. );
  19736. }.bind(this)
  19737. )),
  19738. this.loadPanosPromise
  19739. );
  19740. }),
  19741. (n.prototype.loadHighlightReel = function () {
  19742. //xzw
  19743. var e = $.Deferred(),
  19744. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  19745. t = this.options.urlBase + 'data/' + this.sid + '/active_reel.json';
  19746. return (
  19747. a
  19748. .get(t, {
  19749. responseType: 'json',
  19750. auth: this.isPublic ? null : f.authorizationHeader,
  19751. })
  19752. .done(
  19753. function (t) {
  19754. t.reel
  19755. ? (O.info('Got highlight reel with ' + t.reel.length + ' items'),
  19756. this.images.filterByModesAndReel(this.supportedModes, t.reel))
  19757. : O.info('No highlight reel found'),
  19758. e.resolve();
  19759. }.bind(this)
  19760. )
  19761. .fail(function () {
  19762. O.warn('Getting highlight reel failed, no highlights available'), e.resolve();
  19763. }),
  19764. e
  19765. );
  19766. }),
  19767. (n.prototype.waitForLoad = function (e, t) {
  19768. t() ||
  19769. (this.waitQueue.push({
  19770. object: e,
  19771. isLoadedCallback: t,
  19772. }),
  19773. 1 === this.waitQueue.length && this.emit('waiting'));
  19774. }),
  19775. (n.prototype.hide = function () {
  19776. this.floors.hide();
  19777. }),
  19778. (n.prototype.show = function () {
  19779. this.floors.show();
  19780. }),
  19781. (n.prototype.floorNames = function () {
  19782. return this.floors.names();
  19783. }),
  19784. (n.prototype.warpDestFloors = function (e, t) {
  19785. if (!e || this.floors.length !== e.length) return void this.toggleAllFloors(!0);
  19786. var i = e.findIndex(
  19787. function (e) {
  19788. return e;
  19789. }.bind(this)
  19790. );
  19791. i !== -1 && this.setFloor(this.floors.list[i], null, t);
  19792. }),
  19793. (n.prototype.setFloor = function (e, t, i) {
  19794. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor),
  19795. (this.allFloorsVisible = !1),
  19796. this._setFloor(e, t, i);
  19797. }),
  19798. (n.prototype.toggleAllFloors = function (e) {
  19799. (this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible),
  19800. this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor),
  19801. this._setFloor(this.currentFloor);
  19802. }),
  19803. (n.prototype._setFloor = function (e, t, i) {
  19804. (t = t || this.mode),
  19805. this.emit('floor.changed', e, t, this.currentFloor),
  19806. (this.currentFloor = e);
  19807. var n;
  19808. if (t === c.PANORAMA) {
  19809. if ((this.show(), this.shouldShowtags && this.tagsShown))
  19810. for (n in this.tags) this.tags[n].show(f.showFloorDuration);
  19811. } else if (
  19812. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  19813. (this.floors.list.forEach(
  19814. function (e, t) {
  19815. e.toggle(
  19816. e === this.currentFloor || this.allFloorsVisible,
  19817. i || this.allFloorsVisible
  19818. );
  19819. }.bind(this)
  19820. ),
  19821. this.shouldShowtags && this.tagsShown)
  19822. )
  19823. for (n in this.tags) {
  19824. var r = this.tags[n];
  19825. this.allFloorsVisible
  19826. ? r.show(f.showFloorDuration)
  19827. : r.floor === this.currentFloor
  19828. ? r.show(f.showFloorDuration, f.showFloorDelay)
  19829. : r.hide(f.hideFloorDuration, f.hideFloorDelay);
  19830. }
  19831. var o = this,
  19832. a = e;
  19833. E.start(
  19834. function () {},
  19835. f.showFloorDelay,
  19836. function () {
  19837. o.floors.forEach(function (e) {
  19838. e.chunks.forEach(function (t) {
  19839. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor;
  19840. });
  19841. });
  19842. }.bind(this)
  19843. );
  19844. }),
  19845. (n.prototype.toggleExplode = function () {
  19846. this.floors.toggleExplodeHorizontal();
  19847. }),
  19848. (n.prototype.toggleExplodeUp = function () {
  19849. this.floors.toggleExplodeVertical();
  19850. }),
  19851. (n.prototype.nextFloor = function (e) {
  19852. return this.floors.nextFloor(this.currentFloor, e);
  19853. }),
  19854. (n.prototype.addFloor = function (e) {
  19855. this.floors.add(e);
  19856. }),
  19857. (n.prototype.getFloorAtPoint = function (e) {
  19858. return this.floors.getFloorAtPoint(e);
  19859. }),
  19860. (n.prototype.getTagBySid = function (e) {
  19861. return this.tags[e];
  19862. }),
  19863. (n.prototype.addChunk = function (e, t) {
  19864. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t);
  19865. }),
  19866. (n.prototype.setMode = function (e) {
  19867. if (!this.supportedModes[e]) throw new R('Mode not supported for this model: ' + e);
  19868. this.mode = e;
  19869. this.skybox.material.transparent = e == 'panorama' ? false : true; //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  19870. this.chunks.forEach(function (t) {
  19871. t.setMode(e);
  19872. });
  19873. }),
  19874. (n.prototype.build = function () {
  19875. this.heroLocations = this.images.getHeroLocations(this.panos);
  19876. var e = function () {
  19877. return (
  19878. !!(
  19879. this.heroImage &&
  19880. this.heroImage.metadata &&
  19881. this.heroImage.metadata.scan_id &&
  19882. this.panos.get(this.heroImage.metadata.scan_id)
  19883. ) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  19884. );
  19885. }.bind(this)();
  19886. (this.has360Views =
  19887. (f.show360Views.enabled &&
  19888. this.heroLocations.some(
  19889. function (e) {
  19890. return (
  19891. e.cameraMode === c.PANORAMA &&
  19892. this.panos.get(e.panoId) &&
  19893. !this.panos.get(e.panoId).isAligned()
  19894. );
  19895. }.bind(this)
  19896. )) ||
  19897. e),
  19898. null === this.heroImage && O.warn('No hero image defined.'),
  19899. (this.currentFloor = this.floors.last()),
  19900. this.floors.build(),
  19901. (this.colliders = this.floors.reduce(function (e, t) {
  19902. return e.concat(t.collider.children);
  19903. }, [])),
  19904. this.panos.forEach(
  19905. function (e) {
  19906. e.build1(),
  19907. e.on(
  19908. 'enter',
  19909. function () {
  19910. e.floor !== this.currentFloor && this.setFloor(e.floor);
  19911. }.bind(this)
  19912. );
  19913. }.bind(this)
  19914. ),
  19915. this.panos.forEach(function (e) {
  19916. e.build2();
  19917. }),
  19918. this.floors.forEach(
  19919. function (e) {
  19920. this.boundingBox.union(e.boundingBox);
  19921. }.bind(this)
  19922. ),
  19923. (this.size = this.boundingBox.size()),
  19924. (this.center = this.boundingBox.center()),
  19925. this.floors.forEach(
  19926. function (e) {
  19927. O.info(
  19928. 'Floor ' +
  19929. e +
  19930. ': ' +
  19931. e.children.length +
  19932. ' chunks, ' +
  19933. e.panos.length +
  19934. ' panos.'
  19935. );
  19936. }.bind(this)
  19937. ),
  19938. this.panos.populate_path_graph(),
  19939. (this.skybox = new l(this.boundingBox)),
  19940. (this.skybox.matrixWorldNeedsUpdate = !0),
  19941. this.add(this.skybox);
  19942. /* setTimeout(function() {
  19943. //this.hotsCount && this.shineHots()
  19944. Hot.beginShineHot()
  19945. }
  19946. .bind(this), 1300) */
  19947. //add-----
  19948. {
  19949. let maxCount = browser.isMobile() ? 200000 : 400000;
  19950. let noVisiHots = this.hotGroup.children.filter(
  19951. (e) => !e.info.visiblePanos && e.info.texType != 'shine'
  19952. ); //只看非热点的,否则数据太多
  19953. let visiHots = this.hotGroup.children.filter((e) => e.info.visiblePanos);
  19954. let c = this.panos.list.length * this.colliders.length * noVisiHots.length;
  19955. if (c > maxCount) {
  19956. //防止加载时间过长,分批计算
  19957. console.log('hot分批setVisiblePanos');
  19958. Hot.visiPanosCountSlice = Math.ceil(
  19959. maxCount / this.colliders.length / noVisiHots.length
  19960. );
  19961. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  19962. let dur =
  19963. Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) *
  19964. Hot.visiEveryDurSlice;
  19965. console.log(
  19966. Hot.visiPanosCountSlice,
  19967. Hot.visiEveryDurSlice,
  19968. dur,
  19969. Math.round(dur * noVisiHots.length)
  19970. );
  19971. if (noVisiHots.length) {
  19972. let i = 0;
  19973. let hotVisiInterval = setInterval(() => {
  19974. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos);
  19975. i++;
  19976. if (i >= noVisiHots.length) {
  19977. clearInterval(hotVisiInterval);
  19978. }
  19979. }, dur);
  19980. }
  19981. }
  19982. }
  19983. //---------
  19984. this.createFloorLogo();
  19985. return (
  19986. O.debug('Done building model'),
  19987. v.raycastsDone > 0 &&
  19988. (O.warn('raycasts: ' + v.raycastsDone),
  19989. O.warn('raycasts skipped: ' + v.raycastsSkipped)),
  19990. this.buildRooms(),
  19991. this.labels.associateWithRooms(this.rooms),
  19992. $.when(this)
  19993. );
  19994. }),
  19995. (n.prototype.createFloorLogo = function () {
  19996. console.log('createFloorLogo');
  19997. if (this.floorLogos || !settings.floorlogoURL) return;
  19998. var url = settings.floorlogoURL;
  19999. var map = tex.load(url); //可以追加done
  20000. this.floorLogos = [];
  20001. for (var i = 0; i < 2; i++) {
  20002. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  20003. var material = new o.MeshBasicMaterial({
  20004. opacity: 0,
  20005. map: map,
  20006. side: o.DoubleSide,
  20007. transparent: !0,
  20008. depthWrite: !1,
  20009. depthTest: false, //改 在chunk\skybox外也可看到
  20010. });
  20011. var logo = new o.Mesh(new o.PlaneGeometry(2, 2, 1, 1), material);
  20012. //var s = (Store.metadata.floorLogoSize || 100)/100;
  20013. //logo.scale.set(s,s,s);
  20014. logo.position.set(0, -1.5, 0);
  20015. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)));
  20016. logo.renderOrder = 100; //cover the videoSkybox
  20017. //logo.layers.set(0)
  20018. this.add(logo);
  20019. this.floorLogos.push(logo);
  20020. }
  20021. this.floorLogos[1].visible = false;
  20022. });
  20023. (n.prototype.adjustfloorLogoHeight = function (o) {
  20024. var h = player.currentPano.floorPosition.y + 0.01;
  20025. this.floorLogos[1].position.setY(h);
  20026. this.floorLogos[0].position.setY(h);
  20027. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  20028. }),
  20029. (n.prototype.changefloorLogoOpa = function (o) {
  20030. //改 i, opacity, time, delay
  20031. if (!this.floorLogos) return;
  20032. E.cancelById('flOpa_' + o.index); //先停止之前该logo的透明度变化
  20033. if (o.from != void 0) this.floorLogos[o.index].material.opacity = o.from; //初始透明度
  20034. if (!o.dur) {
  20035. //立刻
  20036. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  20037. this.floorLogos[o.index].material.opacity = o.opa;
  20038. } else {
  20039. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  20040. E.start(
  20041. lerp.property(this.floorLogos[o.index].material, 'opacity', o.opa),
  20042. o.dur || 0,
  20043. null,
  20044. o.delay || 0,
  20045. es['easeInQuad'],
  20046. 'changefloorLogoOpa',
  20047. 'flOpa_' + o.index
  20048. );
  20049. }
  20050. }),
  20051. (n.prototype.updateFloorlogo = (function () {
  20052. //xzw add 更新地标的旋转
  20053. var lastQ, lastP;
  20054. var equals = function (v1, v2, min) {
  20055. return Math.abs(v1 - v2) < min;
  20056. };
  20057. var isSame = function (now, last, k) {
  20058. //如果和上次相同就不改变
  20059. if (!last) return false;
  20060. var R = k.sceneRenderer;
  20061. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  20062. //暂时:
  20063. var min = 0.0008;
  20064. var same =
  20065. equals(now.x, last.x, min) &&
  20066. equals(now.y, last.y, min) &&
  20067. equals(now.z, last.z, min) &&
  20068. (now.w != void 0 ? equals(now.w, last.w, min) : true);
  20069. return same;
  20070. };
  20071. return function (Q, k) {
  20072. if (!Q) return;
  20073. /* if(Config.ifFish && window.lowFPS){
  20074. this.fLCompute++;
  20075. if(R.AFPS < 38){
  20076. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  20077. else if(k.flying && k.fLCompute%2 !=1) return;
  20078. k.fLCompute %= 4;
  20079. }else if(R.AFPS < 45){
  20080. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  20081. else if(k.flying && k.fLCompute%2 !=1) return;
  20082. k.fLCompute %= 6;
  20083. }else{
  20084. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  20085. //else if(k.flying && k.fLCompute%2 !=1) return;
  20086. k.fLCompute %= 2;
  20087. }
  20088. } */
  20089. var sameQ, sameP, quaternion, visible;
  20090. for (var i = 0; i < 2; i++) {
  20091. var logo = this.floorLogos[i];
  20092. if (!logo.visible || logo.material.uniforms.opacity.value == 0) continue;
  20093. visible = true;
  20094. }
  20095. if (!visible) return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  20096. var c = k.cameraControls.activeControl;
  20097. var sameQ = c
  20098. ? c.lat < 10
  20099. ? equals(c.lon, lastQ, 0.1)
  20100. : equals(c.lon, lastQ, 1)
  20101. : false;
  20102. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  20103. for (var i = 0; i < 2; i++) {
  20104. var logo = this.floorLogos[i];
  20105. if (!sameQ) {
  20106. if (!quaternion) {
  20107. var a = new THREE.Vector3(0, 0, -1);
  20108. a.applyQuaternion(Q);
  20109. a.setY(0);
  20110. var _ = new THREE.Matrix4().lookAt(
  20111. a,
  20112. new THREE.Vector3(),
  20113. new THREE.Vector3(0, 1, 0)
  20114. );
  20115. quaternion = new THREE.Quaternion().setFromRotationMatrix(_);
  20116. var a = new THREE.Quaternion(0, 0.7071067811865476, 0.7071067811865476, 0); //计算得
  20117. quaternion.multiply(a);
  20118. }
  20119. logo.quaternion.copy(quaternion);
  20120. }
  20121. }
  20122. };
  20123. })());
  20124. (n.prototype.loadLabels = function () {
  20125. //xzw
  20126. this.labels = new x(this);
  20127. var e = $.Deferred();
  20128. //加载俯视图的标签 注释这个备注就会加载
  20129. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  20130. window.DATA.showingLabels ? (this.showingLabels = true) : '';
  20131. if (!this.showingLabels) return e.resolve();
  20132. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  20133. var t = g_Prefix + 'data/' + this.sid + '/labels.json';
  20134. return (
  20135. this.labels
  20136. .load(t, !this.isPublic)
  20137. .done(e.resolve.bind(e))
  20138. .fail(function () {
  20139. O.warn('Getting labels failed, not displaying labels.'), e.resolve();
  20140. }),
  20141. e
  20142. );
  20143. }),
  20144. (n.prototype.buildRooms = function () {
  20145. (this.rooms = new T(this)),
  20146. this.rooms.createFromChunks(this.chunks),
  20147. this.rooms.calcRoomBoundaries();
  20148. }),
  20149. (n.prototype.updateProjectedPanos = function () {
  20150. this.projectedPano0 &&
  20151. this.projectedPano1 &&
  20152. this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1);
  20153. }),
  20154. (n.prototype.setProjectedPanos = function (e, t, i) {
  20155. (void 0 !== i && null !== i) || (i = !0),
  20156. (i = !!i),
  20157. (this.projectedPano0 = e),
  20158. (this.projectedPano1 = t),
  20159. this.skybox.material.setProjectedPanos(e, t, i),
  20160. this.chunks.forEach(function (n) {
  20161. n.materialInside.setProjectedPanos(e, t, i);
  20162. });
  20163. }),
  20164. (n.prototype.setSide = function (e) {
  20165. this.floors.forEach(function (t) {
  20166. t.collider.material.side = e;
  20167. });
  20168. }),
  20169. (n.prototype.heroCount = function () {
  20170. return this.heroLocations ? this.heroLocations.length : 0;
  20171. }),
  20172. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  20173. //改 因增加了二级目录
  20174. if (e[0] < 0)
  20175. return (
  20176. O.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  20177. );
  20178. if (this.heroCount() < 1)
  20179. return (
  20180. O.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'),
  20181. null
  20182. );
  20183. var t = this.heroLocations[e[0]];
  20184. if (t.heroLocations && e[1] != void 0) {
  20185. t = t.heroLocations[e[1]];
  20186. }
  20187. return void 0 === t
  20188. ? (O.warn(
  20189. 'Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'
  20190. ),
  20191. null)
  20192. : t;
  20193. }),
  20194. (n.prototype.findPanoramicHero = function () {
  20195. for (var e in this.heroLocations)
  20196. if (this.heroLocations[e].cameraMode === c.PANORAMA) return this.heroLocations[e];
  20197. return null;
  20198. }),
  20199. (n.prototype.listImagePanos = function () {
  20200. var e = [],
  20201. t = this;
  20202. return (
  20203. this.images.forEach(function (i) {
  20204. if (i.metadata && i.metadata.scan_id) {
  20205. var n = t.panos.get(i.metadata.scan_id);
  20206. n && (t.supportsTiles || n.isLoaded('high') || e.push(n));
  20207. }
  20208. }),
  20209. e
  20210. );
  20211. }),
  20212. (n.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  20213. //改
  20214. //this.panos.fadeMarkerOpacity(e, t)
  20215. if (window.DATA.hideFloorMarker) return;
  20216. var currentPano = player.currentPano;
  20217. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity; //不传opacity代表显示
  20218. var hideWhenFlyOut = () => {
  20219. var shows = [],
  20220. hides = [];
  20221. player.model.panos.forEach((pano) => {
  20222. hides.push(pano);
  20223. });
  20224. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }]);
  20225. };
  20226. if (opacity == 0) {
  20227. hideWhenFlyOut();
  20228. } else {
  20229. if (player.mode == 'panorama' && currentPano) {
  20230. var shows = [],
  20231. hides = [];
  20232. player.model.panos.forEach((pano) => {
  20233. //是邻近点就显示否则隐藏
  20234. if (currentPano.neighbourPanos[pano.id]) {
  20235. shows.push(pano);
  20236. } else {
  20237. hides.push(pano);
  20238. }
  20239. });
  20240. this.panos.fadeMarkerOpacity(opacity, dur, [
  20241. { toOp: opacity, member: shows },
  20242. { toOp: 0, member: hides },
  20243. ]);
  20244. } else if (player.modeTran.split('-')[1] != 'panorama') {
  20245. //飞出后marker隐藏
  20246. hideWhenFlyOut();
  20247. }
  20248. }
  20249. }),
  20250. (n.prototype.setSweepVisibility = function (e) {
  20251. this.panos.forEach(function (t) {
  20252. t.marker && (t.marker.visible = e);
  20253. });
  20254. }),
  20255. (n.prototype.outsideAllowed = function () {
  20256. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN];
  20257. }),
  20258. (n.prototype.addHighMapCube = function () {
  20259. //创建8*8的tile cube
  20260. if (
  20261. player.qualityManager.getMaxZoomClass() == '4k' &&
  20262. player.qualityManager.maxRenderTargetSize == 2048
  20263. ) {
  20264. var geo = new THREE.PlaneGeometry(1, 1, 1, 1);
  20265. var cube = new THREE.Object3D();
  20266. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  20267. var face = new THREE.Object3D();
  20268. for (var i = 0; i < 8; i++) {
  20269. for (var j = 0; j < 8; j++) {
  20270. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }));
  20271. tile.position.set(i - 3.5, j - 3.5, -4);
  20272. if (highMapAddColor) {
  20273. tile.material.opacity = 0.4;
  20274. tile.material.transparent = true;
  20275. var colorHue = Math.random();
  20276. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9);
  20277. }
  20278. tile.visible = false;
  20279. face.add(tile);
  20280. }
  20281. }
  20282. switch (cubeIndex) {
  20283. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  20284. face.rotation.set(0, Math.PI / 2, 0);
  20285. break;
  20286. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  20287. face.rotation.set(0, -Math.PI / 2, 0);
  20288. break;
  20289. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  20290. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20291. new THREE.Vector3(0, 1, 0),
  20292. Math.PI
  20293. );
  20294. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20295. new THREE.Vector3(1, 0, 0),
  20296. Math.PI / 2
  20297. );
  20298. face.quaternion.copy(rot1).multiply(rot2);
  20299. //face.rotation.set(Math.PI/2,0,0);
  20300. break;
  20301. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  20302. //face.rotation.set(-Math.PI/2,0,0);
  20303. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20304. new THREE.Vector3(0, 1, 0),
  20305. Math.PI
  20306. );
  20307. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20308. new THREE.Vector3(1, 0, 0),
  20309. -Math.PI / 2
  20310. );
  20311. face.quaternion.copy(rot1).multiply(rot2);
  20312. break;
  20313. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  20314. face.rotation.set(0, Math.PI, 0);
  20315. break;
  20316. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  20317. face.rotation.set(0, 0, 0);
  20318. }
  20319. face.scale.set(1, -1, 1);
  20320. cube.add(face);
  20321. }
  20322. cube.name = 'highMapCube';
  20323. this.highMapCube = cube;
  20324. this.add(cube);
  20325. cube.scale.set(0.21, 0.21, 0.21); //camera.near is 0.1
  20326. this.highMapCube.visible = false;
  20327. }
  20328. });
  20329. /*
  20330. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  20331. */
  20332. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  20333. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  20334. return !!tile.material.map;
  20335. };
  20336. n.prototype.updateHighMap = function (tex, cubeFace, tileX, tileY) {
  20337. //console.log('updateHighMap')
  20338. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  20339. tile.material.map = tex;
  20340. if (highMapAddColor) {
  20341. tile.material.opacity = 1;
  20342. tile.material.transparent = false;
  20343. }
  20344. tile.visible = true;
  20345. tile.material.needsUpdate = true; //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  20346. };
  20347. n.prototype.resetHighMap = function () {
  20348. //console.log('resetHighMap')
  20349. if (!this.highMapCube) return;
  20350. this.highMapCube.children.forEach((e) =>
  20351. e.children.forEach((tile) => {
  20352. if (tile.material.map) {
  20353. tile.material.map.dispose();
  20354. tile.material.map.loaded = !1;
  20355. tile.material.map.version = 0;
  20356. var h = player.sceneRenderer.renderer.properties.get(tile.material.map);
  20357. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture);
  20358. tile.material.map = null;
  20359. if (highMapAddColor) {
  20360. tile.material.opacity = 0.4;
  20361. tile.material.transparent = true;
  20362. }
  20363. tile.material.needsUpdate = true;
  20364. tile.visible = false;
  20365. }
  20366. })
  20367. );
  20368. this.highMapCube.visible = false;
  20369. };
  20370. n.prototype.setHighMap = function (pano) {
  20371. if (!this.highMapCube) return;
  20372. this.highMapCube.position.copy(pano.position);
  20373. this.highMapCube.quaternion.copy(pano.quaternion);
  20374. };
  20375. n.prototype.showHighMap = function () {
  20376. if (!this.highMapCube) return;
  20377. this.highMapCube.visible = true;
  20378. };
  20379. n.prototype.hideHighMap = function () {
  20380. if (!this.highMapCube) return;
  20381. this.highMapCube.visible = false;
  20382. };
  20383. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  20384. t.exports = n;
  20385. }.call(this, '/js/model/Model.js'));
  20386. },
  20387. {
  20388. '../constants': 8,
  20389. '../enum/AlignmentType': 17,
  20390. '../enum/RenderOrder': 42,
  20391. '../enum/Viewmode': 51,
  20392. '../exception/BasicException': 55,
  20393. '../label/Label': 90,
  20394. '../loaders/ModelLoader': 105,
  20395. '../loaders/ModelTextureLoader': 106,
  20396. '../loaders/SweepDataLoader': 107,
  20397. '../tag/tag': 123,
  20398. '../tag/tagManager': 124,
  20399. '../objects/BoundingTextureSkybox': 143,
  20400. '../objects/Chunk': 144,
  20401. '../objects/Floor': 146,
  20402. '../objects/Panorama': 148,
  20403. '../objects/Room': 150,
  20404. '../objects/Snapshot': 153,
  20405. '../settings': 166,
  20406. '../shaders': 167,
  20407. '../util/ModelUrls': 177,
  20408. '../util/PanoramaCollection': 178,
  20409. '../util/ajax': 181,
  20410. '../util/common': 185,
  20411. '../util/easing': 186,
  20412. '../util/lerp': 188,
  20413. '../util/logger': 189,
  20414. '../util/math': 190,
  20415. '../util/texture': 194,
  20416. '../util/transitions': 195,
  20417. './../util/browser': 182,
  20418. './../util/showcase': 193,
  20419. './Chunks': 135,
  20420. './FloorCollection': 136,
  20421. './ImageCollection': 137,
  20422. './LabelCollection': 138,
  20423. './RoomCollection': 141,
  20424. events: 202,
  20425. three: 217,
  20426. hot: 'hot',
  20427. '../enum/GLCubeFaces': 25,
  20428. },
  20429. ],
  20430. 140: [
  20431. function (e, t, i) {
  20432. 'use strict';
  20433. function n() {
  20434. (this.modelMap = {}),
  20435. (this.activeModel = null),
  20436. (this.modelCount = 0),
  20437. (this.tileDownloader = null),
  20438. (this.panoRenderer = null);
  20439. }
  20440. var r = (e('three'), e('../util/common')),
  20441. o = e('../exception/BasicException'),
  20442. a = e('../enum/ModelManagerEvents'),
  20443. s = e('../enum/PanoRendererEvents'),
  20444. l = e('events').EventEmitter;
  20445. (n.prototype.init = function (e, t, i) {
  20446. (this.tileDownloader = e),
  20447. (this.panoRenderer = t),
  20448. (this.qualityManager = i),
  20449. this.bindEvents();
  20450. }),
  20451. (n.prototype.bindEvents = function () {
  20452. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this));
  20453. }),
  20454. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  20455. (n.prototype.addModel = function (e) {
  20456. (this.modelMap[e.sid] = e),
  20457. 0 === this.modelCount && this.activateModel(e.sid),
  20458. this.modelCount++,
  20459. this.emit(a.ModelAdded);
  20460. }),
  20461. (n.prototype.getModel = function (e) {
  20462. return this.modelMap[e];
  20463. }),
  20464. (n.prototype.activateModel = function (e) {
  20465. var t = this.modelMap[e];
  20466. if (!t) throw new o('Tried to activate invalid model!');
  20467. var i = this.activeModel;
  20468. (this.activeModel = t),
  20469. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  20470. this.tileDownloader.setUrls(t.urls),
  20471. t.panos.forEach(
  20472. function (e) {
  20473. e.attachToPanoRenderer(this.panoRenderer),
  20474. (e.tileDownloader = this.tileDownloader),
  20475. (e.qualityManager = this.qualityManager);
  20476. }.bind(this)
  20477. ),
  20478. this.emit(a.ActiveModelChanged, {
  20479. oldModel: i,
  20480. model: t,
  20481. });
  20482. }),
  20483. (n.prototype.getActiveModel = function () {
  20484. return this.activeModel;
  20485. }),
  20486. r.extend(n, l),
  20487. (t.exports = n);
  20488. },
  20489. {
  20490. '../enum/ModelManagerEvents': 33,
  20491. '../enum/PanoRendererEvents': 35,
  20492. '../exception/BasicException': 55,
  20493. '../util/common': 185,
  20494. events: 202,
  20495. three: 217,
  20496. },
  20497. ],
  20498. 141: [
  20499. function (e, t, i) {
  20500. (function (i) {
  20501. 'use strict';
  20502. function n() {
  20503. s.call(this);
  20504. }
  20505. var r = e('../objects/Room'),
  20506. o = (e('../settings'), e('../util/logger')),
  20507. a = (e('../util/transitions'), e('../util/easing'), e('../util/common')),
  20508. s = e('../util/IndexedCollection'),
  20509. l = e('./Chunks');
  20510. new o(i);
  20511. a.inherit(n, s),
  20512. (n.prototype.getIndex = function (e) {
  20513. return e.roomId;
  20514. }),
  20515. (n.prototype.calcRoomBoundaries = function () {
  20516. this.forEach(function (e) {
  20517. e.calcBoundaries();
  20518. });
  20519. }),
  20520. (n.prototype.createFromChunks = function (e) {
  20521. var t = {
  20522. floorId: -1,
  20523. roomId: -1,
  20524. },
  20525. i = {};
  20526. e.forEach(
  20527. function (e) {
  20528. l.parseIdsFromChunkName(e.name, t);
  20529. var o = i[t.roomId];
  20530. if (!o) {
  20531. var a = n.generateRoomId(t.floorId, t.roomId);
  20532. (o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o);
  20533. }
  20534. o.addChunk(e);
  20535. }.bind(this)
  20536. ),
  20537. this.calcRoomBoundaries();
  20538. }),
  20539. (n.generateRoomId = function (e, t) {
  20540. return e + '_' + t;
  20541. }),
  20542. (t.exports = n);
  20543. }.call(this, '/js/model/RoomCollection.js'));
  20544. },
  20545. {
  20546. '../objects/Room': 150,
  20547. '../settings': 166,
  20548. '../util/IndexedCollection': 175,
  20549. '../util/common': 185,
  20550. '../util/easing': 186,
  20551. '../util/logger': 189,
  20552. '../util/transitions': 195,
  20553. './Chunks': 135,
  20554. },
  20555. ],
  20556. 142: [
  20557. function (e, t, i) {
  20558. 'use strict';
  20559. function n(e, t, i) {
  20560. e = e.clone().expandByScalar(0.01); //改
  20561. var n = e.size(),
  20562. o = new r.BoxGeometry(n.x, n.y, n.z);
  20563. (o.boundingBox = e),
  20564. r.Mesh.call(this, o, t),
  20565. this.position.copy(e.center()),
  20566. (this.frustumCulled = !1),
  20567. i && this.add(new r.WireframeHelper(this));
  20568. }
  20569. var r = e('three');
  20570. (n.prototype = Object.create(r.Mesh.prototype)),
  20571. (n.prototype.constructor = n),
  20572. (t.exports = n);
  20573. },
  20574. {
  20575. three: 217,
  20576. },
  20577. ],
  20578. 143: [
  20579. function (e, t, i) {
  20580. (function (i) {
  20581. 'use strict';
  20582. function n(e) {
  20583. h.time('Computing a nice bounding cubemap');
  20584. var t = new a({
  20585. side: r.BackSide,
  20586. transparent: !0,
  20587. });
  20588. (t.uniforms.modelAlpha.value = 0),
  20589. (t.uniforms.opacity.value = 1 - s.modelAlpha),
  20590. (this.renderOrder = l.boundingSkybox),
  20591. o.call(this, e, t),
  20592. h.timeEnd('Computing a nice bounding cubemap');
  20593. }
  20594. var r = e('three'),
  20595. o = (e('../enum/Viewmode'), e('../shaders'), e('./BoundingMesh')),
  20596. a = e('../materials/ModelTextureMaterial'),
  20597. s = e('../settings'),
  20598. l = e('../enum/RenderOrder'),
  20599. c = e('../util/logger'),
  20600. h = new c(i);
  20601. (n.prototype = Object.create(o.prototype)),
  20602. (n.prototype.constructor = n),
  20603. (t.exports = n);
  20604. }.call(this, '/js/objects/BoundingTextureSkybox.js'));
  20605. },
  20606. {
  20607. '../enum/RenderOrder': 42,
  20608. '../enum/Viewmode': 51,
  20609. '../materials/ModelTextureMaterial': 118,
  20610. '../settings': 166,
  20611. '../shaders': 167,
  20612. '../util/logger': 189,
  20613. './BoundingMesh': 142,
  20614. three: 217,
  20615. },
  20616. ],
  20617. 144: [
  20618. function (e, t, i) {
  20619. 'use strict';
  20620. function n(e) {
  20621. this.materialInside = new s({
  20622. side: r.DoubleSide,
  20623. });
  20624. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  20625. (this.materialOutside = new r.RawShaderMaterial({
  20626. fragmentShader: o.modelOutside.fragmentShader,
  20627. vertexShader: o.modelOutside.vertexShader,
  20628. uniforms: t,
  20629. side: r.FrontSide,
  20630. name: 'chunkOut',
  20631. })),
  20632. r.Mesh.call(this, e.geometry, this.materialInside),
  20633. (this.name = e.name || ''),
  20634. (this.textureName = e.textureName),
  20635. (this.meshUrl = e.meshUrl);
  20636. }
  20637. var r = e('three'),
  20638. o = e('../shaders'),
  20639. a = e('../enum/Viewmode'),
  20640. s = e('../materials/ModelTextureMaterial');
  20641. (n.prototype = Object.create(r.Mesh.prototype)),
  20642. (n.prototype.setTextureMap = function (e) {
  20643. (this.materialInside.uniforms.map.value = e),
  20644. (this.materialOutside.uniforms.map.value = e);
  20645. }),
  20646. (n.prototype.setMode = function (e) {
  20647. var t =
  20648. e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  20649. (t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  20650. (t.transparent = this.material.transparent),
  20651. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  20652. (this.material = t);
  20653. }),
  20654. (t.exports = n);
  20655. },
  20656. {
  20657. '../enum/Viewmode': 51,
  20658. '../materials/ModelTextureMaterial': 118,
  20659. '../shaders': 167,
  20660. three: 217,
  20661. },
  20662. ],
  20663. 145: [
  20664. function (e, t, i) {
  20665. 'use strict';
  20666. function n(e) {
  20667. (this.chunksize = e || 10),
  20668. (this.chunks = {}),
  20669. (this.boundingBoxes = {}),
  20670. (this.children = []),
  20671. (this.offset = new r.Vector3(0, 0.5, 0)),
  20672. (this.material = new r.MeshBasicMaterial({
  20673. color: 16777215 * Math.random(),
  20674. side: r.DoubleSide,
  20675. }));
  20676. }
  20677. var r = e('three');
  20678. e('../enum/Viewmode');
  20679. (n.prototype.add = function (e) {
  20680. var t,
  20681. i,
  20682. n,
  20683. o,
  20684. a,
  20685. s,
  20686. l,
  20687. c,
  20688. h,
  20689. u,
  20690. d,
  20691. p,
  20692. f,
  20693. g,
  20694. m = e.attributes;
  20695. m
  20696. ? ((t = m.position.array), (i = void 0 !== e.index ? e.index.array : void 0))
  20697. : ((t = e.vertices), (n = e.faces));
  20698. var v = new r.Vector3();
  20699. if (i)
  20700. for (o = 0, a = i.length; o < a; o += 3) {
  20701. var A = 3 * i[o],
  20702. y = 3 * i[o + 1],
  20703. C = 3 * i[o + 2];
  20704. (s = (t[A] + t[y] + t[C]) / 3),
  20705. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  20706. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  20707. (h = Math.floor(s / this.chunksize)),
  20708. (u = Math.floor(l / this.chunksize)),
  20709. (d = Math.floor(c / this.chunksize)),
  20710. (p = h + '.' + u + '.' + d),
  20711. p in this.chunks
  20712. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20713. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20714. g.push(
  20715. t[A],
  20716. t[A + 1],
  20717. t[A + 2],
  20718. t[y],
  20719. t[y + 1],
  20720. t[y + 2],
  20721. t[C],
  20722. t[C + 1],
  20723. t[C + 2]
  20724. ),
  20725. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  20726. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  20727. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]));
  20728. }
  20729. else
  20730. for (o = 0, a = t.length; o < a; o += 9)
  20731. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  20732. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  20733. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  20734. (h = Math.floor(s / this.chunksize)),
  20735. (u = Math.floor(l / this.chunksize)),
  20736. (d = Math.floor(c / this.chunksize)),
  20737. (p = h + '.' + u + '.' + d),
  20738. p in this.chunks
  20739. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20740. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20741. g.push(
  20742. t[o],
  20743. t[o + 1],
  20744. t[o + 2],
  20745. t[o + 3],
  20746. t[o + 4],
  20747. t[o + 5],
  20748. t[o + 6],
  20749. t[o + 7],
  20750. t[o + 8]
  20751. ),
  20752. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  20753. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  20754. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]));
  20755. }),
  20756. (n.prototype.build = function () {
  20757. var e = new r.Object3D();
  20758. e.material = this.material;
  20759. for (var t in this.chunks) {
  20760. var i = this.chunks[t],
  20761. n = new r.BufferGeometry();
  20762. n.addAttribute('position', new r.BufferAttribute(new Float32Array(i), 3)),
  20763. (n.boundingBox = this.boundingBoxes[t]);
  20764. var o = new r.Mesh(n, this.material);
  20765. (o.material.visible = !1), e.add(o), (this.chunks[t] = []);
  20766. }
  20767. return e;
  20768. }),
  20769. (t.exports = n);
  20770. },
  20771. {
  20772. '../enum/Viewmode': 51,
  20773. three: 217,
  20774. },
  20775. ],
  20776. 146: [
  20777. function (e, t, i) {
  20778. 'use strict';
  20779. var r = e('three'),
  20780. o = e('../settings'),
  20781. a = e('../util/common'),
  20782. s = e('../util/lerp'),
  20783. l = e('./ChunkedCollider'),
  20784. c = e('../util/transitions'),
  20785. h = e('../util/easing'),
  20786. u = (e('../objects/Panorama'), e('../enum/RenderOrder')),
  20787. d = e('../localization/localize');
  20788. function n(e, t, i) {
  20789. r.Object3D.call(this),
  20790. (this.model = e),
  20791. (this.floorIndex = t),
  20792. (this.lang = o.languageTag),
  20793. (this.name =
  20794. i || o.languageTag === 'cn' ? 'Floor ' + (t + 1) + '' : '第' + (t + 1) + '层'),
  20795. (this.panos = []),
  20796. (this.chunks = []),
  20797. (this.colliderBuilder = new l(3)),
  20798. (this.collider = null),
  20799. (this.center = null),
  20800. (this.boundingBox = new r.Box3()),
  20801. (this.size = null),
  20802. (this.hidden = !1),
  20803. (this.conservativeBoundingBox = new r.Box3()),
  20804. (this.debugColor = 16777215 * Math.random()),
  20805. (this.transition = null);
  20806. }
  20807. (n.prototype = Object.create(r.Object3D.prototype)),
  20808. (n.prototype.enter = function (e) {
  20809. this.model.setFloor(this, e);
  20810. }),
  20811. (n.prototype.hide = function (e) {
  20812. if (!this.hidden || this.transition) {
  20813. this.chunks.forEach(function (e) {
  20814. e.material.transparent = !0;
  20815. }),
  20816. c.cancel(this.transition);
  20817. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  20818. i = e ? 0 : o.hideFloorDelay / t;
  20819. this.transition = c.start(
  20820. s.allUniforms(this.chunks, 'opacity', 0.08),
  20821. t,
  20822. function () {
  20823. this.hidden = !0;
  20824. }.bind(this),
  20825. i,
  20826. h.easeInOutQuad
  20827. );
  20828. }
  20829. }),
  20830. (n.prototype.show = function (e) {
  20831. if (this.hidden || this.transition) {
  20832. (this.hidden = !1), c.cancel(this.transition);
  20833. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay,
  20834. i = e ? 0 : o.showFloorDelay / t;
  20835. this.transition = c.start(
  20836. s.allUniforms(this.chunks, 'opacity', 1),
  20837. t,
  20838. function () {
  20839. this.hidden ||
  20840. this.chunks.forEach(function (e) {
  20841. e.material.transparent = !1;
  20842. });
  20843. }.bind(this),
  20844. i,
  20845. h.easeInOutQuad
  20846. );
  20847. }
  20848. }),
  20849. (n.prototype.toggle = function (e, t) {
  20850. (e = void 0 === e ? this.hidden : e), e ? this.show(t) : this.hide(t);
  20851. }),
  20852. (n.prototype.containsPoint = function (e) {
  20853. return this.collider.children.some(function (t) {
  20854. return (
  20855. t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  20856. t.geometry.boundingBox.containsPoint(e)
  20857. );
  20858. });
  20859. }),
  20860. (n.prototype.distanceToPoint = function (e) {
  20861. var t = null,
  20862. i = 1 / 0;
  20863. return (
  20864. this.collider.children.forEach(function (n) {
  20865. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  20866. var r = n.geometry.boundingBox.distanceToPoint(e);
  20867. (!t || i > r) && ((i = r), (t = n));
  20868. }),
  20869. i
  20870. );
  20871. }),
  20872. (n.prototype.addChunk = function (e) {
  20873. (e.renderOrder = u.ghostFloor),
  20874. this.add(e),
  20875. this.chunks.push(e),
  20876. this.boundingBox.union(e.geometry.boundingBox),
  20877. (this.size = this.boundingBox.size()),
  20878. this.colliderBuilder.add(e.geometry);
  20879. }),
  20880. (n.prototype.addPano = function (e) {
  20881. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker);
  20882. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  20883. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  20884. var t = new r.Vector3(1, 1, 1),
  20885. i = new r.Box3().setFromCenterAndSize(e.position, t);
  20886. this.boundingBox.union(i);
  20887. }
  20888. }),
  20889. (n.prototype.build = function () {
  20890. (this.collider = this.colliderBuilder.build(!0)),
  20891. this.add(this.collider),
  20892. (this.center = this.boundingBox.center()),
  20893. this.conservativeBoundingBox.copy(this.boundingBox),
  20894. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  20895. this.collider.children.map(function (e) {
  20896. return e.geometry.boundingBox.min.y;
  20897. }),
  20898. 5
  20899. )),
  20900. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  20901. this.collider.children.map(function (e) {
  20902. return e.geometry.boundingBox.max.y;
  20903. }),
  20904. 5
  20905. )),
  20906. (this.colliderBuilder = null);
  20907. }),
  20908. (n.prototype.toShortString = function () {
  20909. return a.nth(this.floorIndex + 1);
  20910. }),
  20911. (n.prototype.toString = function () {
  20912. return this.name;
  20913. }),
  20914. (t.exports = n);
  20915. },
  20916. {
  20917. '../enum/RenderOrder': 42,
  20918. '../localization/localize': 108,
  20919. './strings-cn-CN': 109,
  20920. '../objects/Panorama': 148,
  20921. '../settings': 166,
  20922. '../util/common': 185,
  20923. '../util/easing': 186,
  20924. '../util/lerp': 188,
  20925. '../util/transitions': 195,
  20926. './ChunkedCollider': 145,
  20927. three: 217,
  20928. },
  20929. ],
  20930. 147: [
  20931. function (e, t, i) {
  20932. 'use strict';
  20933. function n(e) {
  20934. (this.player = e), (this.obj3d = null), (this.UP = new r.Vector3(0, 1, 0));
  20935. }
  20936. var r = e('three'),
  20937. o = e('../settings');
  20938. (n.prototype.prefs = {
  20939. linewidth: 3,
  20940. height: 0.07,
  20941. opacity: 0.45,
  20942. endScale: 0.05,
  20943. }),
  20944. (n.prototype.discard = function () {
  20945. if (this.obj3d) {
  20946. var e = this.obj3d.parent;
  20947. e && e.remove(this.obj3d);
  20948. }
  20949. this.obj3d = null;
  20950. }),
  20951. (n.prototype.draw = function () {
  20952. if ((this.discard(), o.showNeighbors)) {
  20953. var e = this.player.currentPano.floor;
  20954. this.obj3d = new r.Object3D();
  20955. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  20956. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  20957. i.y += this.prefs.height;
  20958. var n = 0.1525,
  20959. a = 0.127,
  20960. s = 0.0127,
  20961. l = 0.1,
  20962. c = 0.19,
  20963. h = 0.2032,
  20964. u = 0.2286,
  20965. d = 0.255,
  20966. p = new r.Matrix4();
  20967. for (var f in t)
  20968. if (t[f]) {
  20969. var g = this.player.model.panos.get(f),
  20970. m =
  20971. (g.position.clone().sub(this.player.model.position),
  20972. g.position.clone().sub(g.floorPosition)),
  20973. v = g.floorPosition.clone().sub(this.player.model.position);
  20974. v.y += this.prefs.height;
  20975. var A = new r.Geometry();
  20976. A.vertices.push(
  20977. new r.Vector3(0, -s, 0),
  20978. new r.Vector3(-s, 0, 0),
  20979. new r.Vector3(0, s, 0),
  20980. new r.Vector3(s, 0, 0),
  20981. new r.Vector3(0, -s, 0)
  20982. ),
  20983. A.vertices.push(
  20984. new r.Vector3(0, -d, 0),
  20985. new r.Vector3(d, -d, 0),
  20986. new r.Vector3(d, n, 0),
  20987. new r.Vector3(-n, n, 0),
  20988. new r.Vector3(-n, a, 0),
  20989. new r.Vector3(-c, l, 0),
  20990. new r.Vector3(-c, -h, 0),
  20991. new r.Vector3(-n, -u, 0),
  20992. new r.Vector3(-n, -d, 0),
  20993. new r.Vector3(0, -d, 0)
  20994. ),
  20995. p.identity().setPosition(m),
  20996. A.applyMatrix(p),
  20997. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  20998. A.vertices.push(
  20999. new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  21000. new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  21001. new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  21002. new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  21003. ),
  21004. p.lookAt(v, i, this.UP).setPosition(v),
  21005. A.applyMatrix(p),
  21006. A.vertices.push(v, i);
  21007. var y = new r.Line(
  21008. A,
  21009. new r.LineBasicMaterial({
  21010. color: g.debugColor.getHex(),
  21011. transparent: !0,
  21012. opacity: this.prefs.opacity,
  21013. depthWrite: !1,
  21014. name: 'sLine' + f,
  21015. linewidth: this.prefs.linewidth,
  21016. })
  21017. );
  21018. this.obj3d.add(y);
  21019. }
  21020. e.add(this.obj3d);
  21021. }
  21022. }),
  21023. (n.prototype.update = function () {
  21024. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld();
  21025. }),
  21026. (t.exports = n);
  21027. },
  21028. {
  21029. '../settings': 166,
  21030. three: 217,
  21031. },
  21032. ],
  21033. 148: [
  21034. function (e, t, i) {
  21035. (function (i) {
  21036. 'use strict';
  21037. function n(e, t, i, n) {
  21038. (this.model = e),
  21039. (this.id = t),
  21040. (this.alignmentType = i.alignmentType || l.ALIGNED),
  21041. (this.neighbourUUIDs = i.neighbours || null),
  21042. (this.neighbourPanos = null),
  21043. (this.floor = null),
  21044. (this.floorIndex = i.floor),
  21045. (this.failedLoadingAt = 0),
  21046. (this.maxLoadRetries = 4),
  21047. (this.origin = i.position.clone()),
  21048. (this.position =
  21049. this.alignmentType === l.UNALIGNED ? new r.Vector3(0, -5, 0) : i.position.clone()),
  21050. (this.quaternion = i.quaternion.clone()),
  21051. (this.skyboxMesh = new r.Mesh(E)),
  21052. this.skyboxMesh.position.copy(this.position),
  21053. this.skyboxMesh.quaternion.copy(this.quaternion),
  21054. (this.skyboxMesh.name = 'skybox'),
  21055. (this.skyboxMesh.visible = !1),
  21056. this.skyboxMesh.updateMatrix(),
  21057. this.skyboxMesh.updateMatrixWorld(),
  21058. (this.marker = null),
  21059. (this.showFloorMarker = !window.DATA.hideFloorMarker);
  21060. if (this.isAligned()) {
  21061. (this.marker = new r.Mesh(
  21062. b,
  21063. new r.MeshBasicMaterial({
  21064. map: w,
  21065. side: r.DoubleSide,
  21066. opacity: 0,
  21067. transparent: !0,
  21068. depthWrite: !1,
  21069. })
  21070. )),
  21071. (this.marker.visible = false); //改:先不显示,之后根据opacity显示
  21072. (this.marker.renderOrder = s.panoMarker),
  21073. (this.marker.name = 'marker'),
  21074. (this.marker.pano = this),
  21075. this.marker.layers.set(v.PANOMARKERS),
  21076. this.marker.updateMatrixWorld();
  21077. if (!window.DATA.hideFloorMarker) {
  21078. //xzw
  21079. let opa = this.marker.material.opacity;
  21080. Object.defineProperty(this.marker.material, 'opacity', {
  21081. get: function () {
  21082. return opa;
  21083. },
  21084. set: (o) => {
  21085. opa = o;
  21086. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0);
  21087. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  21088. //console.log(o,this.id,this.marker.visible)
  21089. },
  21090. });
  21091. }
  21092. a.colorMarkerOnLoad &&
  21093. this.on('load', function () {
  21094. this.marker.material.color.set(65280);
  21095. });
  21096. }
  21097. (this.debugColor = new r.Color().setHSL(
  21098. 0.06 + 0.53 * Math.random(),
  21099. 0.8 + 0.2 * Math.random(),
  21100. 0.5 + 0.2 * Math.random()
  21101. )),
  21102. (this.floorPosition = i.puck ? i.puck.clone() : null),
  21103. (this.tiled = n),
  21104. this.tiled
  21105. ? (this.solidSkybox = null)
  21106. : ((this.solidSkybox = new r.Texture([null, null, null, null, null, null])),
  21107. (this.solidSkybox.flipY = !1),
  21108. a.minimalMemoryMode &&
  21109. ((this.solidSkybox.minFilter = r.LinearFilter),
  21110. (this.solidSkybox.magFilter = r.LinearFilter),
  21111. (this.solidSkybox.generateMipmaps = !1))),
  21112. (this.zoomed = !1),
  21113. (this.panoRenderer = null),
  21114. (this.qualityManager = null),
  21115. (this.tileDownloader = null),
  21116. (this.tiledPanoRenderTarget = null),
  21117. (this.minimumTiledPanoLoaded = !1),
  21118. (this.highestPartialTileRenderOpCompleted = 0),
  21119. (this.highestFullTileRenderOpCompleted = 0),
  21120. (this.shouldRedrawOnBaseLoaded = !1),
  21121. (this.lockUntilRenderingComplete = !1),
  21122. a.colorMarkerOnLoad &&
  21123. this.on('load', function () {
  21124. this.marker.material.color.set(65280);
  21125. });
  21126. /********************************************************************fyz改vr from徐世廷*************************************************************/
  21127. var e = new r.TextureLoader();
  21128. e.setCrossOrigin(!0);
  21129. var g = e.load('images/texture.jpg');
  21130. if (
  21131. ((this.vrMarker = new r.Mesh(
  21132. new r.OctahedronGeometry(0.1, 0),
  21133. new r.MeshLambertMaterial({
  21134. color: 16777215,
  21135. transparent: !0,
  21136. opacity: 0.75,
  21137. map: g,
  21138. })
  21139. )),
  21140. (this.vrMarker.boluoType = 'vr'),
  21141. (this.vrMarker.position.z = 1),
  21142. (this.vrMarker.enabled = !0),
  21143. (this.vrMarker.visible = !1),
  21144. (window.vrMarkers = window.vrMarkers || []),
  21145. window.vrMarkers.push(this.vrMarker),
  21146. this.marker && this.marker.add(this.vrMarker),
  21147. a.showAxis &&
  21148. (this.skyboxMesh.add(
  21149. new r.ArrowHelper(new r.Vector3(0, 1, 0), new r.Vector3(0, 0, 0), 1, 255)
  21150. ),
  21151. this.skyboxMesh.add(
  21152. new r.ArrowHelper(new r.Vector3(0, 0, 1), new r.Vector3(0, 0, 0), 1, 16711680)
  21153. ),
  21154. this.skyboxMesh.add(
  21155. new r.ArrowHelper(new r.Vector3(1, 0, 0), new r.Vector3(0, 0, 0), 1, 65280)
  21156. )),
  21157. this.adjustAngleEnable)
  21158. ) {
  21159. var i = new r.Quaternion();
  21160. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX),
  21161. this.skyboxMesh.quaternion.multiply(i);
  21162. var m = new r.Quaternion();
  21163. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY),
  21164. this.skyboxMesh.quaternion.multiply(m);
  21165. var n = new r.Quaternion();
  21166. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  21167. this.skyboxMesh.quaternion.multiply(n),
  21168. this.skyboxMesh.updateMatrix(),
  21169. this.skyboxMesh.updateMatrixWorld(),
  21170. this.model.updateProjectedPanos();
  21171. }
  21172. /**************************************************************************************************************************************/
  21173. }
  21174. var r = e('three'),
  21175. o = e('../util/logger'),
  21176. a = e('../settings'),
  21177. s = (e('../enum/Viewmode'), e('../enum/RenderOrder')),
  21178. l = e('../enum/AlignmentType'),
  21179. c = (e('../util/common'), e('../util/transitions')),
  21180. h = e('../util/lerp'),
  21181. u = e('../util/ajax'),
  21182. d = e('../util/texture'),
  21183. p = e('../util/panorama'),
  21184. f = (e('../enum/TileDownloaderEvents'), e('../enum/PanoramaEvents')),
  21185. g = e('../enum/PanoRendererEvents'),
  21186. m = e('../enum/PanoSizeClass'),
  21187. v = e('../enum/RenderLayers'),
  21188. A =
  21189. (e('../scene/SceneRenderer'),
  21190. e('../enum/GLCubeFaces'),
  21191. e('../exception/BasicException')),
  21192. y = e('../tile/TileUtils'),
  21193. C = e('events').EventEmitter,
  21194. I = new o(i),
  21195. E = new r.SphereBufferGeometry(0.1),
  21196. b = new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  21197. w = d.load('images/marker-256x256.png');
  21198. w.anisotropy = browser.isMobile() ? 1 : 3; //add
  21199. (n.prototype = Object.create(C.prototype)),
  21200. (n.prototype.enter = (function () {
  21201. var e = null;
  21202. return function () {
  21203. this.setZoomed(!1),
  21204. this.emit('enter', {
  21205. oldPano: e,
  21206. newPano: this,
  21207. }),
  21208. (e = this);
  21209. this.model.setHighMap(this); //add
  21210. };
  21211. })()),
  21212. (n.prototype.exit = function () {
  21213. this.tiled
  21214. ? (this.clearWaitDeferreds(),
  21215. (this.minimumTiledPanoLoaded = !1),
  21216. (this.tiledPanoRenderTarget = null),
  21217. this.setZoomed(!1),
  21218. this.panoRenderer.deactivateTiledPano(this),
  21219. (this.highestPartialTileRenderOpCompleted = 0),
  21220. (this.highestFullTileRenderOpCompleted = 0))
  21221. : (this.solidSkybox.dispose(),
  21222. (this.solidSkybox.loaded = !1),
  21223. (this.solidSkybox.version = 0)),
  21224. this.emit('exit');
  21225. }),
  21226. (n.prototype.hoverOn = function (e) {
  21227. this.marker &&
  21228. (c.start(
  21229. h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover),
  21230. 250
  21231. ),
  21232. a.navigation.panoScores & a.navigation.mouseDirection &&
  21233. this.addTextSprite('HIT', 12525854));
  21234. }),
  21235. (n.prototype.hoverOff = function (e) {
  21236. this.marker &&
  21237. c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250);
  21238. }),
  21239. (n.prototype.build1 = function () {
  21240. (this.floor =
  21241. this.floor ||
  21242. this.model.floors.get(this.floorIndex) ||
  21243. (this.model.floors.list.length == 1
  21244. ? this.model.floors.list[0]
  21245. : this.raycastToFindFloor()) ||
  21246. this.model.getFloorAtPoint(this.position)),
  21247. this.floor.addPano(this),
  21248. (this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  21249. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  21250. a.colorMarkerByFloor &&
  21251. this.marker &&
  21252. this.marker.material.color.set(this.floor.debugColor);
  21253. }),
  21254. (n.prototype.build2 = function () {
  21255. (this.floorPosition = this.floorPosition || this.interpolateFloorPosition()),
  21256. (this.height = this.position.distanceTo(this.floorPosition)),
  21257. this.placeMarker();
  21258. }),
  21259. (n.prototype.interpolateFloorPosition = function () {
  21260. var e = this.model.panos
  21261. .filter(n.filters.isNeighbourPanoTo(this))
  21262. .filter(function (e) {
  21263. return !!e.floorPosition;
  21264. })
  21265. .sort(
  21266. function (e, t) {
  21267. return (
  21268. e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  21269. );
  21270. }.bind(this)
  21271. ),
  21272. t = this.position.clone();
  21273. return (
  21274. e.length >= 2
  21275. ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2)
  21276. : t.add(a.noMeshFloorPositionOffset),
  21277. t
  21278. );
  21279. }),
  21280. (n.prototype.raycastFloorPosition = function () {
  21281. I.warn('Performance warning: Raycasting to find floor position');
  21282. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  21283. t = e.intersectObjects(this.model.colliders);
  21284. return t.length ? t[0].point : null;
  21285. }),
  21286. (n.prototype.raycastToFindFloor = (function () {
  21287. var e = [
  21288. new r.Vector3(0, -1, 0),
  21289. new r.Vector3(1, -1, 0),
  21290. new r.Vector3(0, -1, 1),
  21291. new r.Vector3(-1, -1, 0),
  21292. new r.Vector3(0, -1, -1),
  21293. new r.Vector3(1, 0, 0),
  21294. new r.Vector3(0, 0, 1),
  21295. new r.Vector3(-1, 0, 0),
  21296. new r.Vector3(0, 0, -1),
  21297. ];
  21298. return function () {
  21299. I.warn('Performance warning: Raycasting to find floor index');
  21300. for (var t = 0; t < e.length; t++) {
  21301. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  21302. n = i.intersectObjects(this.model.colliders);
  21303. if (n.length) return n[0].object.parent.parent;
  21304. }
  21305. return null;
  21306. };
  21307. })()),
  21308. (n.prototype.placeMarker = function () {
  21309. this.marker &&
  21310. (this.marker.position.copy(this.floorPosition),
  21311. (this.marker.position.y += 0.05),
  21312. this.marker.lookAt(new r.Vector3(0, 1, 0).add(this.marker.position)));
  21313. }),
  21314. (n.prototype.translate = function (e) {
  21315. this.position.add(e), this.floorPosition.add(e);
  21316. }),
  21317. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  21318. new r.Vector3().addVectors(this.position, e.position).divideScalar(2);
  21319. return this.model.panos.find(
  21320. [n.filters.notIn([this, e])],
  21321. [n.sortFunctions.distanceToPoint(point)]
  21322. );
  21323. }),
  21324. (n.prototype.attachToPanoRenderer = function (e) {
  21325. (this.panoRenderer = e),
  21326. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  21327. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  21328. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  21329. this.panoRenderer.on(
  21330. g.UploadAttemptedForAllTiles,
  21331. this.onUploadAttemptedForAllTiles.bind(this)
  21332. );
  21333. });
  21334. var _ = {};
  21335. (n.prototype.getWaitDeferred = function (e) {
  21336. var t = _[this.id];
  21337. t || ((t = {}), (_[this.id] = t));
  21338. var i = t[e];
  21339. return (
  21340. i ||
  21341. ((i = {
  21342. deferred: $.Deferred(),
  21343. active: !1,
  21344. }),
  21345. (t[e] = i)),
  21346. i
  21347. );
  21348. }),
  21349. (n.prototype.resetWaitDeferred = function (e) {
  21350. var t = this.getWaitDeferred(e);
  21351. (t.active = !1), (t.deferred = $.Deferred());
  21352. }),
  21353. (n.prototype.clearWaitDeferreds = function () {
  21354. var e = _[this.id];
  21355. e || ((e = {}), (_[this.id] = e));
  21356. for (var t in e)
  21357. if (e.hasOwnProperty(t)) {
  21358. var i = e[t];
  21359. (i.active = !1), (i.deferred = $.Deferred());
  21360. }
  21361. }),
  21362. (n.prototype.loadTiledPano = (function () {
  21363. var e = (new r.Vector3(), []),
  21364. t = [];
  21365. return function (i, n, r, o, a, s) {
  21366. (null !== o && void 0 !== o) || (o = !0), (null !== a && void 0 !== a) || (a = !0);
  21367. var l = this.getWaitDeferred(i),
  21368. c = l.deferred,
  21369. h = null,
  21370. u = null;
  21371. if (
  21372. (r && ('number' == typeof r ? (h = r) : ((h = r.hFov), (u = r.vFov))),
  21373. !this.isLoaded(i))
  21374. ) {
  21375. if (!l.active) {
  21376. if (((l.active = !0), r)) {
  21377. var d = y.matchingTilesInDirection(this, i, n, h, u);
  21378. (e[this.id + ':' + i] = {
  21379. tileCount: 0,
  21380. targetTileCount: d,
  21381. }),
  21382. I.info('Loading partial pano: ' + this.id + ' with ' + d + ' tiles');
  21383. }
  21384. t[this.id] ||
  21385. ((t[this.id] = !0),
  21386. this.on(
  21387. f.LoadComplete,
  21388. function (e, t) {
  21389. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  21390. var i = this.getWaitDeferred(e).deferred;
  21391. i &&
  21392. 'pending' === i.state() &&
  21393. this.highestPartialTileRenderOpCompleted >= e &&
  21394. (i.resolve(e, t), this.resetWaitDeferred(e));
  21395. }.bind(this)
  21396. ),
  21397. this.on(
  21398. f.LoadFailed,
  21399. function (e) {
  21400. var t = this.getWaitDeferred(e).deferred;
  21401. t &&
  21402. 'pending' === t.state() &&
  21403. this.highestPartialTileRenderOpCompleted >= e &&
  21404. (t.reject(e), this.resetWaitDeferred(e));
  21405. }.bind(this)
  21406. ),
  21407. this.on(
  21408. f.TileLoaded,
  21409. function (t, i, n) {
  21410. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  21411. var r = this.getWaitDeferred(t).deferred;
  21412. if (r && 'pending' === r.state()) {
  21413. r.notify(t, i, n);
  21414. var o = e[this.id + ':' + t];
  21415. o &&
  21416. (o.tileCount++,
  21417. o.tileCount === o.targetTileCount &&
  21418. (this.onPanoRendered(this.id, t, n, !0),
  21419. r.resolve(t, n),
  21420. this.resetWaitDeferred(t)));
  21421. }
  21422. }.bind(this)
  21423. ));
  21424. }
  21425. this.tileDownloader.clearForceQueue(),
  21426. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  21427. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(
  21428. this,
  21429. this.qualityManager.getMaxNavPanoSize(),
  21430. o
  21431. )),
  21432. this.panoRenderer.renderPanoTiles(this.id, n, a);
  21433. }
  21434. return c.promise();
  21435. };
  21436. })()),
  21437. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  21438. if (e === this.id) {
  21439. var n = this.qualityManager.getPanoSize(m.BASE);
  21440. t === n &&
  21441. this.shouldRedrawOnBaseLoaded &&
  21442. ((this.shouldRedrawOnBaseLoaded = !1),
  21443. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  21444. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0));
  21445. }
  21446. }),
  21447. (n.prototype.onTileRendered = function (e, t, i, n) {
  21448. e === this.id && this.emit(f.TileLoaded, t, i, n);
  21449. }),
  21450. (n.prototype.onPanoRendered = function (e, t, i, n) {
  21451. e === this.id &&
  21452. ((this.minimumTiledPanoLoaded = !0),
  21453. this.updateSkyboxForZoomLevel(),
  21454. t > this.highestPartialTileRenderOpCompleted &&
  21455. (this.highestPartialTileRenderOpCompleted = t),
  21456. !n &&
  21457. t > this.highestFullTileRenderOpCompleted &&
  21458. (this.highestFullTileRenderOpCompleted = t),
  21459. this.emit('load', t),
  21460. this.model.emit('load', this),
  21461. this.emit(f.LoadComplete, t, i));
  21462. }),
  21463. (n.prototype.setZoomed = function (e) {
  21464. (this.zoomed = e), this.updateSkyboxForZoomLevel();
  21465. e ? this.model.showHighMap() : this.model.hideHighMap(); //add
  21466. }),
  21467. (n.prototype.ensureSkyboxReadyForRender = function () {
  21468. this.tiled ||
  21469. (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  21470. (this.solidSkybox.loaded = !0));
  21471. }),
  21472. (n.prototype.updateSkyboxForZoomLevel = function () {
  21473. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos();
  21474. }),
  21475. (n.prototype.getSkyboxTexture = function () {
  21476. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  21477. if (!this.tiled) {
  21478. return this.solidSkybox;
  21479. }
  21480. if (this.minimumTiledPanoLoaded) {
  21481. if (
  21482. this.zoomed &&
  21483. this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize
  21484. ) {
  21485. //change 如果放大后和不放大都是2k就不用这个
  21486. return this.panoRenderer.zoomRenderTarget.texture;
  21487. } else {
  21488. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping; //add
  21489. return this.tiledPanoRenderTarget.texture;
  21490. }
  21491. } else {
  21492. return null;
  21493. }
  21494. }),
  21495. (n.prototype.onTileRenderFail = function (e, t, i) {
  21496. e === this.id && this.emit(f.LoadFailed, t);
  21497. }),
  21498. (n.prototype.isLoaded = function (e) {
  21499. if (this.tiled) {
  21500. if (e && 'string' == typeof e)
  21501. throw new A(
  21502. 'Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass'
  21503. );
  21504. return (
  21505. !!this.minimumTiledPanoLoaded &&
  21506. (!e || this.highestPartialTileRenderOpCompleted >= e)
  21507. );
  21508. }
  21509. if (e && 'number' == typeof e)
  21510. throw new A(
  21511. 'Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.'
  21512. );
  21513. return !!this.solidSkybox.high || e in this.solidSkybox;
  21514. }),
  21515. (n.prototype.loadCube = function (e) {
  21516. if (this.isLoaded(e))
  21517. return I.info('Skipping load of pano, already loaded'), $.when();
  21518. this.emit('loading', e), this.model.emit('loading', this);
  21519. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  21520. i = t.filter(function (e) {
  21521. return !e;
  21522. });
  21523. 'low' === e &&
  21524. i.length > 0 &&
  21525. (I.info('Pano', this.id, 'not available in low res, loading high res right away'),
  21526. (e = 'high'),
  21527. (t = p.getCubemapUrls(this.model.urls, this.id, e)));
  21528. var n = 0,
  21529. r = [0, 1, 2, 3, 4, 5].map(
  21530. function (e, i, n) {
  21531. return u.getImage(t[i]);
  21532. }.bind(this)
  21533. );
  21534. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  21535. function (t, i, n, r, o, a) {
  21536. return (
  21537. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  21538. ('high' !== e && this.solidSkybox.high) ||
  21539. ((this.solidSkybox.image = this.solidSkybox[e]),
  21540. (this.solidSkybox.low = null)),
  21541. (this.solidSkybox.needsUpdate = !0),
  21542. this.emit('load', e),
  21543. this.model.emit('load', this),
  21544. this
  21545. );
  21546. }.bind(this),
  21547. function () {
  21548. I.error('Downloading cubemap for pano', this.id, 'failed'),
  21549. (this.failedLoadingAt = Date.now());
  21550. }.bind(this),
  21551. function () {
  21552. return $.when(++n, 6);
  21553. }
  21554. );
  21555. }),
  21556. (n.raycastsSkipped = 0),
  21557. (n.raycastsDone = 0),
  21558. (n.prototype.findNeighourPanos = function () {
  21559. return (
  21560. this.model.panos.setNeighbour(this.id, this.id, !1),
  21561. this.model.panos.forEach(
  21562. function (e) {
  21563. if (
  21564. e !== this &&
  21565. (!this.model.panos.neighbourMap[this.id] ||
  21566. void 0 === this.model.panos.neighbourMap[this.id][e.id])
  21567. ) {
  21568. var t = this.position.distanceTo(e.position);
  21569. if (t > a.panoramaNeighbourMaxDistance)
  21570. return this.model.panos.setNeighbour(this, e, !1), void n.raycastsSkipped++;
  21571. var i = e.position.clone().sub(this.position).normalize(),
  21572. o = new r.Raycaster(this.position, i.clone(), 0, t),
  21573. s = o.intersectObjects(this.model.colliders);
  21574. n.raycastsDone++,
  21575. this.model.panos.setNeighbour(this, e, 0 === s.length),
  21576. a.showNeighbourRaycasts &&
  21577. (s.length
  21578. ? this.floor.model.add(
  21579. new r.ArrowHelper(i, this.position, s[0].distance, 16711680)
  21580. )
  21581. : this.floor.model.add(
  21582. new r.ArrowHelper(i, this.position, t, 16777215, 0, 0)
  21583. ));
  21584. }
  21585. }.bind(this)
  21586. ),
  21587. this.model.panos.neighbourMap[this.id]
  21588. );
  21589. }),
  21590. (n.prototype.worldPosition = function () {
  21591. return this.position;
  21592. }),
  21593. (n.prototype.addTextSprite = function (e, t) {
  21594. this.removeTextSprite();
  21595. var i = document.createElement('canvas'),
  21596. n = i.getContext('2d');
  21597. (i.width = 256), (i.height = 256);
  21598. var o = 'Arial',
  21599. a = 60;
  21600. (n.font = 'bold ' + a + 'px ' + o), (n.fillStyle = 'white');
  21601. var s = n.measureText(e).width;
  21602. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  21603. var l = new r.Texture(i);
  21604. l.needsUpdate = !0;
  21605. var c = new r.SpriteMaterial({
  21606. map: l,
  21607. color: t || 16428055,
  21608. });
  21609. (this.text3d = new r.Sprite(c)),
  21610. this.text3d.position.copy(this.skyboxMesh.position),
  21611. this.floor.add(this.text3d);
  21612. }),
  21613. (n.prototype.removeTextSprite = function () {
  21614. this.text3d && (this.floor.remove(this.text3d), (this.text3d = null));
  21615. }),
  21616. (n.prototype.isAligned = function () {
  21617. return this.alignmentType === l.ALIGNED;
  21618. }),
  21619. (n.filters = {
  21620. inDirection: function (e, t, i) {
  21621. return function (n) {
  21622. var r = n.position.clone().sub(e).normalize();
  21623. return r.dot(t) > i;
  21624. };
  21625. },
  21626. inFloorDirection: function (e, t, i) {
  21627. return function (n) {
  21628. var r = n.floorPosition.clone().sub(e).normalize();
  21629. return r.dot(t) > i;
  21630. };
  21631. },
  21632. inPanoDirection: function (e, t, i) {
  21633. return (
  21634. (i = a.navigation.panoScores ? a.navigation.filterStrictness : i),
  21635. function (n) {
  21636. var r = n.floorPosition.clone().sub(e).normalize(),
  21637. o = n.position.clone().sub(e).normalize();
  21638. return r.dot(t) > i || o.dot(t) > i;
  21639. }
  21640. );
  21641. },
  21642. atFloor: function (e) {
  21643. return function (t) {
  21644. return !e || t.floor === e;
  21645. };
  21646. },
  21647. not: function (e) {
  21648. return function (t) {
  21649. return t !== e;
  21650. };
  21651. },
  21652. notIn: function (e) {
  21653. return function (t) {
  21654. return e.indexOf(t) === -1;
  21655. };
  21656. },
  21657. isLoaded: function () {
  21658. return function (e) {
  21659. return e.isLoaded();
  21660. };
  21661. },
  21662. isNotLoaded: function () {
  21663. return function (e) {
  21664. return !e.isLoaded();
  21665. };
  21666. },
  21667. isCloseEnoughTo: function (e, t) {
  21668. return function (i) {
  21669. return e.distanceTo(i.floorPosition) < t;
  21670. };
  21671. },
  21672. hasMinimumHeightDifferenceTo: function (e, t) {
  21673. return function (i) {
  21674. return Math.abs(i.position.y - e.y) > t;
  21675. };
  21676. },
  21677. isNotBehindNormal: function (e, t) {
  21678. var i = new r.Vector3();
  21679. return (
  21680. (t = t.clone()),
  21681. function (n) {
  21682. var r = i.copy(n.position).sub(e).normalize();
  21683. return r.dot(t) > 0;
  21684. }
  21685. );
  21686. },
  21687. isNeighbourPanoTo: function (e) {
  21688. return function (t) {
  21689. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id];
  21690. };
  21691. },
  21692. isNeighbourOfNeighbourTo: function (e) {
  21693. return function (t) {
  21694. return (
  21695. !!e.neighbourPanos[t.id] ||
  21696. e.neighbourUUIDs.some(function (i) {
  21697. var n = e.model.panos.get(i);
  21698. return !!n && n.neighbourPanos[t.id];
  21699. })
  21700. );
  21701. };
  21702. },
  21703. isNotRecentlyFailed: function (e) {
  21704. return function (t) {
  21705. return Date.now() - t.failedLoadingAt > e;
  21706. };
  21707. },
  21708. isOnVisibleFloor: function () {
  21709. return function (e) {
  21710. return !e.floor.hidden;
  21711. };
  21712. },
  21713. isPanoAligned: function () {
  21714. return function (e) {
  21715. return e.isAligned();
  21716. };
  21717. },
  21718. }),
  21719. (n.sortFunctions = {
  21720. distanceToPoint: function (e) {
  21721. return function (t, i) {
  21722. return t.position.distanceTo(e) - i.position.distanceTo(e);
  21723. };
  21724. },
  21725. floorDistanceToPoint: function (e) {
  21726. return function (t, i) {
  21727. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e);
  21728. };
  21729. },
  21730. choose: function (e) {
  21731. return function (t, i) {
  21732. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0;
  21733. };
  21734. },
  21735. }),
  21736. (n.scoreFunctions = {
  21737. distance: function (e, t) {
  21738. return (
  21739. (t = t || a.navigation.distanceFactor),
  21740. function (i) {
  21741. return e ? e.position.distanceTo(i.position) * t : 0;
  21742. }
  21743. );
  21744. },
  21745. distanceSquared: function (e, t) {
  21746. return (
  21747. (t = t || a.navigation.distanceFactor),
  21748. function (i) {
  21749. return e ? e.position.distanceToSquared(i.position) * t : 0;
  21750. }
  21751. );
  21752. },
  21753. direction: function (e, t) {
  21754. return function (i) {
  21755. var n = i.position.clone().sub(e).normalize();
  21756. return n.dot(t) * a.navigation.directionFactor;
  21757. };
  21758. },
  21759. angle: function (e, t) {
  21760. return function (i) {
  21761. var n = i.position.clone().sub(e).normalize();
  21762. return n.angleTo(t) * a.navigation.angleFactor;
  21763. };
  21764. },
  21765. inFieldOfView: function (e, t) {
  21766. return function (i) {
  21767. var n = i.position.clone().sub(e).normalize();
  21768. return n.dot(t) > 0.75 ? 10 : -1;
  21769. };
  21770. },
  21771. optionality: function (e) {
  21772. return function (t) {
  21773. var i = t.neighbourUUIDs.filter(function (t) {
  21774. return !(t in e.neighbourUUIDs) && t !== e.id;
  21775. });
  21776. return i.length * a.navigation.optionalityFactor;
  21777. };
  21778. },
  21779. penalizeHeightDifferenceUnder: function (e, t) {
  21780. return function (i) {
  21781. return e.y - i.position.y < t ? -20 : 0;
  21782. };
  21783. },
  21784. }),
  21785. (t.exports = n);
  21786. }.call(this, '/js/objects/Panorama.js'));
  21787. },
  21788. {
  21789. '../enum/AlignmentType': 17,
  21790. '../enum/GLCubeFaces': 25,
  21791. '../enum/PanoRendererEvents': 35,
  21792. '../enum/PanoSizeClass': 36,
  21793. '../enum/PanoramaEvents': 37,
  21794. '../enum/RenderLayers': 41,
  21795. '../enum/RenderOrder': 42,
  21796. '../enum/TileDownloaderEvents': 45,
  21797. '../enum/Viewmode': 51,
  21798. '../exception/BasicException': 55,
  21799. '../scene/SceneRenderer': 158,
  21800. '../settings': 166,
  21801. '../tile/TileUtils': 174,
  21802. '../util/ajax': 181,
  21803. '../util/common': 185,
  21804. '../util/lerp': 188,
  21805. '../util/logger': 189,
  21806. '../util/panorama': 191,
  21807. '../util/texture': 194,
  21808. '../util/transitions': 195,
  21809. events: 202,
  21810. three: 217,
  21811. },
  21812. ],
  21813. 149: [
  21814. function (e, t, i) {
  21815. 'use strict';
  21816. function n(e) {
  21817. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  21818. (t.map.value = d),
  21819. (t.opacity.value = 0),
  21820. t.color.value.set(o.reticuleColor),
  21821. (t.showMouseMarker = !window.DATA.hideMouseMarker);
  21822. r.Mesh.call(
  21823. this,
  21824. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  21825. new r.RawShaderMaterial({
  21826. side: r.DoubleSide,
  21827. depthWrite: !1,
  21828. depthTest: !1,
  21829. transparent: !0,
  21830. vertexShader: c.waypoint.vertexShader,
  21831. fragmentShader: c.waypoint.fragmentShader,
  21832. uniforms: t,
  21833. name: 'waypoint',
  21834. opacity: 0,
  21835. visible: t.showMouseMarker, // 显示/隐藏鼠标标志
  21836. })
  21837. ),
  21838. this.layers.set(h.RETICULE),
  21839. (this.renderOrder = u.reticule),
  21840. (this.player = e),
  21841. (this.direction = new r.Vector3()),
  21842. (this.hidden = !0),
  21843. (this.mouseLastMoveTime = Date.now());
  21844. }
  21845. var r = e('three'),
  21846. o = e('../settings'),
  21847. a = e('../util/transitions'),
  21848. s = e('../util/texture'),
  21849. l = e('../util/lerp'),
  21850. c = e('../shaders'),
  21851. h = e('../enum/RenderLayers'),
  21852. u = e('../enum/RenderOrder'),
  21853. d = s.load('images/reticule-256x256.png');
  21854. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  21855. (n.prototype = Object.create(r.Mesh.prototype)),
  21856. (n.prototype.move = function (e, t, i) {
  21857. (this.hidden = i), (this.mouseLastMoveTime = Date.now());
  21858. }),
  21859. (n.prototype.hide = function () {
  21860. this.hidden ||
  21861. ((this.hidden = !0),
  21862. a.start(
  21863. l.property(this.material.uniforms.opacity, 'value', 0),
  21864. o.reticuleOpacityTransitionTime
  21865. ));
  21866. }),
  21867. (n.prototype.show = function () {
  21868. (this.hidden = !1),
  21869. this.material.opacity <= 0 &&
  21870. a.start(
  21871. l.property(
  21872. this.material.uniforms.opacity,
  21873. 'value',
  21874. o[this.player.mode].reticuleOpacity
  21875. ),
  21876. o.reticuleOpacityTransitionTime
  21877. );
  21878. }),
  21879. (n.prototype.update = function () {
  21880. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout &&
  21881. !this.hidden &&
  21882. this.hide();
  21883. }),
  21884. (n.prototype.updatePosition = function (e, t) {
  21885. if (!this.hidden) {
  21886. if (!t) return this.hide();
  21887. var i = t.point,
  21888. n = e.distanceTo(i),
  21889. r = 1 + 0.01 * n;
  21890. n < 1 && (r -= 1 - n),
  21891. this.show(),
  21892. this.scale.set(r, r, r),
  21893. (this.direction = this.direction.multiplyScalar(0.8)),
  21894. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  21895. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  21896. this.lookAt(this.position.clone().add(this.direction));
  21897. }
  21898. }),
  21899. (n.prototype.writeAstag = function () {
  21900. var e =
  21901. Math.floor(4294967296 * (1 + Math.random())).toString(16) +
  21902. Math.floor(16 * (1 + Math.random())).toString(16),
  21903. t = new Date();
  21904. this.tagCount = 'undefined' == typeof this.tagCount ? 1 : this.tagCount + 1;
  21905. var i = {
  21906. enabled: !0,
  21907. version: '0',
  21908. created: t.toISOString(),
  21909. created_by: 'APITest',
  21910. position: this.position.clone(),
  21911. stem: {
  21912. enabled: o.tags.pole.enabled,
  21913. direction: this.direction.multiplyScalar(o.tags.pole.height),
  21914. },
  21915. label: 'tag ' + this.tagCount,
  21916. description: 'Description ' + e,
  21917. floor: (function (e) {
  21918. if (e.currentFloor) {
  21919. var t = e.floors.indexOf(e.currentFloor);
  21920. return t > -1 ? t : void 0;
  21921. }
  21922. })(this.player.model),
  21923. type: 'info',
  21924. metadata: {
  21925. preferred_camera: {
  21926. mode: this.player.mode,
  21927. },
  21928. },
  21929. };
  21930. console.log('--------------------------'), console.log(JSON.stringify(i));
  21931. var n = this.player.model.addtag(e, i).build();
  21932. n &&
  21933. (n.disc && this.player.tagDiscs.push(n.disc),
  21934. n.visible || n.show(o.tags.startup.fadeInDuration));
  21935. }),
  21936. (t.exports = n);
  21937. },
  21938. {
  21939. '../enum/RenderLayers': 41,
  21940. '../enum/RenderOrder': 42,
  21941. '../settings': 166,
  21942. '../shaders': 167,
  21943. '../util/lerp': 188,
  21944. '../util/texture': 194,
  21945. '../util/transitions': 195,
  21946. three: 217,
  21947. },
  21948. ],
  21949. 150: [
  21950. function (e, t, i) {
  21951. 'use strict';
  21952. function n(e, t) {
  21953. (this.chunks = []),
  21954. (this.floorId = e),
  21955. (this.roomId = t),
  21956. (this.position = new r.Vector3());
  21957. }
  21958. var r = e('three');
  21959. (n.prototype.addChunk = function (e) {
  21960. this.chunks.push(e);
  21961. }),
  21962. (n.prototype.calcBoundaries = function () {
  21963. for (
  21964. var e = new r.Vector3(),
  21965. t = new r.Vector3(0, 0, 0),
  21966. i = new r.Vector3(0, 0, 0),
  21967. n = new r.Vector3(0, 0, 0),
  21968. o = 0,
  21969. a = 0;
  21970. a < this.chunks.length;
  21971. a++
  21972. ) {
  21973. var s = this.chunks[a],
  21974. l = s.geometry.attributes.position;
  21975. if (l)
  21976. for (var c = 0; c < l.array.length; c += 3)
  21977. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  21978. t.add(e),
  21979. 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)),
  21980. o++;
  21981. }
  21982. o > 0 ? (t.multiplyScalar(1 / o), (this.average = t)) : (this.average = null),
  21983. (this.boundsMax = i),
  21984. (this.boundsMin = n),
  21985. (this.center = new r.Vector3()),
  21986. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n);
  21987. }),
  21988. (t.exports = n);
  21989. },
  21990. {
  21991. three: 217,
  21992. },
  21993. ],
  21994. 151: [
  21995. function (e, t, i) {
  21996. (function (i) {
  21997. 'use strict';
  21998. function n(e, t, i) {
  21999. (this.obj3d = null),
  22000. (this.nodes = []),
  22001. (this.colorHull = []),
  22002. (this.shortPaths = {}),
  22003. (this.floorHull = null),
  22004. (this.cameraHull = null),
  22005. (this.floorPathDistance = 0),
  22006. (this.floorCurvePoints = null),
  22007. (this.floorCurveColors = null),
  22008. (this.camCurvePoints = null),
  22009. (this.warpDestHeroLoc = null),
  22010. (this.warpDestPano = null),
  22011. (this.warpPathPoints = null),
  22012. (this.warpPathLengths = [0]),
  22013. (this.warpLength = 0),
  22014. (this.closeWarpDistance = 4),
  22015. (this.UP = A.UP.clone()),
  22016. (this.longestStep = 0),
  22017. (this.upcomingTransType = null),
  22018. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  22019. (this.prevNextDist = 0),
  22020. (this.nextI = 0),
  22021. (this.activeTransType = null),
  22022. (this.lastTransType = null),
  22023. (this.bunnyObj = null),
  22024. (this.director = e),
  22025. (this.player = t),
  22026. (this.playerControls = i),
  22027. (this.modelManager = t.modelManager),
  22028. this.updateModel(),
  22029. this.updateDefaultsFromModelData(),
  22030. this.bindEvents(),
  22031. (this.warping = !1),
  22032. (this.waitingToWarp = !1),
  22033. (this.warpInterrupted = !1),
  22034. (this.warpInterruptionBlackoutStyle = null),
  22035. (this.warpInterruptionTravelTime = null);
  22036. }
  22037. var r = e('three'),
  22038. o = e('../util/logger'),
  22039. a = e('../enum/Viewmode'),
  22040. s = e('../enum/RenderOrder'),
  22041. l = e('../enum/WarpStyle'),
  22042. c = e('../settings'),
  22043. h = e('../util/math'),
  22044. u = e('../util/lerp'),
  22045. d = e('../util/easing'),
  22046. p = e('../util/transitions'),
  22047. f = e('../objects/Snapshot'),
  22048. g = e('../effects'),
  22049. m = e('../shaders'),
  22050. v = (e('../gui/gui'), e('../util/texture')),
  22051. A = e('../enum/Vectors'),
  22052. y = (e('../model/ModelManager'), new o(i)),
  22053. C = e('../enum/PlayerEvents'),
  22054. I = e('../enum/BlackoutStyle'),
  22055. E = e('../enum/ModelManagerEvents'),
  22056. b = e('../constants'),
  22057. w = {
  22058. path: v.loadBase64(
  22059. 'iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC'
  22060. ),
  22061. pathEnd: v.load('images/End.png'),
  22062. pathStart: v.loadBase64(
  22063. 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg=='
  22064. ),
  22065. };
  22066. (n.prototype.setScene = function (e) {
  22067. this.createCpm(e), this.createBunnyObj(e);
  22068. }),
  22069. (n.prototype.updateModel = function () {
  22070. this.model = this.modelManager.getActiveModel();
  22071. }),
  22072. (n.prototype.bindEvents = function () {
  22073. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this));
  22074. }),
  22075. (n.prototype.updateDefaultsFromModelData = function () {
  22076. this.model.data;
  22077. }),
  22078. (n.prototype.pointPathDistance = function (e) {
  22079. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i]);
  22080. return t;
  22081. }),
  22082. (n.prototype.pointPathLengths = function (e) {
  22083. for (var t = [0], i = 1; i < e.length; i += 1)
  22084. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  22085. return t;
  22086. }),
  22087. (n.prototype.interpAlongPath = function (e, t, i) {
  22088. var n,
  22089. o = new r.Vector3(),
  22090. a = t[t.length - 1];
  22091. if (i < 1) {
  22092. n = i * a;
  22093. for (var s = 1; s < t.length; s += 1)
  22094. if (t[s] > n) {
  22095. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  22096. return o.copy(e[s]), o.sub(e[s - 1]), o.multiplyScalar(l), o.add(e[s - 1]), o;
  22097. }
  22098. } else o.copy(e[e.length - 1]);
  22099. return o;
  22100. }),
  22101. (n.prototype.pathHeight = function () {
  22102. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight;
  22103. }),
  22104. (n.prototype.createBunnyObj = function (e) {
  22105. this.bunnyObj ||
  22106. ((this.bunnyObj = new r.AxisHelper(0.1)),
  22107. (this.bunnyObj.visible = c.warp.showBunny)),
  22108. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  22109. e.add(this.bunnyObj);
  22110. }),
  22111. (n.prototype.createCpm = function (e) {
  22112. if (!this.currentPanoMarker) {
  22113. var t = this.makeWaypointObj(w.pathEnd, 'Current');
  22114. (t.material.uniforms.opacity.value = 0),
  22115. (this.currentPanoMarker = {
  22116. mesh: t,
  22117. placed: !1,
  22118. });
  22119. }
  22120. this.currentPanoMarker.mesh.parent &&
  22121. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22122. this.placeCpm(),
  22123. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh);
  22124. }),
  22125. (n.prototype.placeCpm = function () {
  22126. if (
  22127. c.path.mapGuides &&
  22128. this.player.currentPano &&
  22129. this.player.currentPano.isAligned()
  22130. ) {
  22131. var e = this.player.currentPano.floor;
  22132. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  22133. (this.currentPanoMarker.mesh.parent &&
  22134. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22135. e.add(this.currentPanoMarker.mesh)),
  22136. this.currentPanoMarker.mesh.position
  22137. .copy(this.player.currentPano.floorPosition)
  22138. .sub(e.position),
  22139. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  22140. (this.currentPanoMarker.placed = !0);
  22141. } else this.popOutCpm();
  22142. }),
  22143. (n.prototype.fadeInCpm = function (e) {
  22144. (this.player.mode === a.PANORAMA &&
  22145. this.player.currentPano &&
  22146. !this.player.currentPano.isAligned()) ||
  22147. (c.path.mapGuides &&
  22148. this.currentPanoMarker.placed &&
  22149. p.start(
  22150. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1),
  22151. e
  22152. ));
  22153. }),
  22154. (n.prototype.fadeOutCpm = function (e) {
  22155. p.start(
  22156. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0),
  22157. e
  22158. );
  22159. }),
  22160. (n.prototype.popInCpm = function () {
  22161. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2);
  22162. }),
  22163. (n.prototype.popOutCpm = function () {
  22164. this.fadeOutCpm(2);
  22165. }),
  22166. (n.prototype.brushPrefs = {
  22167. linewidth: 7,
  22168. strokeWidth: 15,
  22169. cvSegments: 48,
  22170. paveStep: 0.1,
  22171. paveWidth: 0.2,
  22172. lookBlendDist: 3,
  22173. maxTurn: r.Math.degToRad(2),
  22174. }),
  22175. (n.prototype.panoPathDistance = function (e) {
  22176. var t = this.model.panos;
  22177. if (!e || e.length < 2) return 0;
  22178. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition);
  22179. return this.pointPathDistance(i);
  22180. }),
  22181. (n.prototype.loadTileTexture = function (e) {
  22182. var t = v.load(
  22183. e,
  22184. function (t) {
  22185. (t.wrapS = r.RepeatWrapping),
  22186. (t.wrapT = r.RepeatWrapping),
  22187. (t.needsUpdate = !0),
  22188. y.debug('path texture "' + e + '" is ready');
  22189. },
  22190. function () {
  22191. y.error('path texture "' + e + '" failed');
  22192. }
  22193. );
  22194. return (t.mapping = r.UVMapping), t;
  22195. }),
  22196. (n.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  22197. var a = {
  22198. cameraMode: n,
  22199. position: e,
  22200. quaternion: t,
  22201. panoId: i,
  22202. orthoZoom: o,
  22203. floorVisibility: r,
  22204. thumbUrl: null,
  22205. name: null,
  22206. };
  22207. return new f(a);
  22208. }),
  22209. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  22210. return this.buildWarpDestinationDescriptor(
  22211. e.position,
  22212. e.quaternion,
  22213. this.getHeroId(e),
  22214. e.cameraMode,
  22215. e.floorVisibility,
  22216. e.orthoZoom
  22217. );
  22218. }),
  22219. (n.prototype.setWarpDestination = function (e) {
  22220. this.warpDestHeroLoc = e;
  22221. }),
  22222. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  22223. var t = this.getHeroDescriptorByHeroIndex(e);
  22224. return null !== t && (this.setWarpDestination(t), !0);
  22225. }),
  22226. (n.prototype.setWarpDestinationByPano = function (e, t) {
  22227. var i = this.model.panos.get(e.id);
  22228. return !!i && this.setWarpDestinationByPanoId(e.id, t);
  22229. }),
  22230. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  22231. var i = this.model.panos.get(e);
  22232. if (i) {
  22233. t = t || new r.Quaternion();
  22234. var n = this.buildWarpDestinationDescriptor(
  22235. i.position,
  22236. t,
  22237. i.id,
  22238. 'panorama',
  22239. [],
  22240. -1
  22241. );
  22242. return this.setWarpDestination(n), !0;
  22243. }
  22244. return !1;
  22245. }),
  22246. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  22247. var t = this.model.heroCount();
  22248. /* if (null !== this.warpDestHeroLoc && t < 2)
  22249. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  22250. this.model.getHeroDescriptorByIndex(0); */
  22251. var i = this.model.getHeroDescriptorByIndex(e);
  22252. if (i) {
  22253. var n = i.isPano() ? i.panoId : i.cameraMode;
  22254. y.debug(
  22255. 'ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' +
  22256. n +
  22257. '" out of ' +
  22258. t +
  22259. ' choices.'
  22260. );
  22261. }
  22262. return i;
  22263. }),
  22264. (n.prototype.getHeroDescriptorByPano = function (e) {
  22265. var t = this.model.panos.get(e.id);
  22266. return t ? this.getHeroDescriptorByPanoId(e.id) : null;
  22267. }),
  22268. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  22269. var t = this.getHeroIndexFromPanoId(e);
  22270. return this.getHeroDescriptorByHeroIndex(t);
  22271. }),
  22272. (n.prototype.getHeroIndexFromPanoId = function (e) {
  22273. for (var t = 0; t < this.model.heroLocations.length; t++) {
  22274. var i = this.model.heroLocations[t],
  22275. n = this.getHeroId(i);
  22276. if (n && n === e) return t;
  22277. }
  22278. return -1;
  22279. }),
  22280. (n.prototype.getHeroPano = function (e) {
  22281. if (null === e) return y.warn('getHeroPano(): no destination'), null;
  22282. var t = this.getHeroId(e),
  22283. i = this.model.panos.get(t);
  22284. return (
  22285. void 0 === i &&
  22286. ((i = null), '' !== t && y.debug('unable to find pano "' + t + '"')),
  22287. i
  22288. );
  22289. }),
  22290. (n.prototype.getHeroId = function (e) {
  22291. return e.panoId;
  22292. }),
  22293. (n.prototype.setWarpDestPano = function () {
  22294. return (
  22295. (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  22296. );
  22297. }),
  22298. (n.prototype.brushToWarpPano = function (e, t) {
  22299. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1;
  22300. if (
  22301. (this.warpDestHeroLoc.cameraMode !== a.PANORAMA &&
  22302. y.warn('Can only brush from pano to pano'),
  22303. !this.warpDestPano)
  22304. )
  22305. return y.info('No brush'), !1;
  22306. if (!this.player.currentPano)
  22307. return y.debug('No current pano, visibility undefined'), !1;
  22308. if (!this.warpDestPano) return y.info('No wPano, visibility undefined'), !1;
  22309. if (!this.warpDestPano.isAligned())
  22310. return y.debug('Cannot brush to unaligned pano'), !1;
  22311. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  22312. n = !0;
  22313. if (this.player.currentPano.id === this.warpDestPano.id)
  22314. y.debug('Already at destination pano');
  22315. else {
  22316. (this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22317. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  22318. (this.obj3d = new r.Object3D()),
  22319. y.debug(
  22320. 'Brushing from "' +
  22321. this.player.currentPano.id +
  22322. '" to "' +
  22323. this.warpDestPano.id +
  22324. '" (' +
  22325. (this.nodes ? this.nodes.length : 0) +
  22326. ')'
  22327. ),
  22328. n
  22329. ? (y.info('No "walkable" route, using fall-back warp style transition'),
  22330. (e = t))
  22331. : (this.setPathHulls(this.nodes),
  22332. this.setFloorCurves(),
  22333. i &&
  22334. ('chevron' === c.path.style
  22335. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  22336. : 'ribbon' === c.path.style &&
  22337. this.obj3d.add(
  22338. this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)
  22339. ))),
  22340. this.player.currentPano.floor.add(this.obj3d);
  22341. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN,
  22342. s = e === l.STD;
  22343. if (!n && (i || s)) {
  22344. if (o) {
  22345. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  22346. this.obj3d.add(h);
  22347. }
  22348. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  22349. this.obj3d.add(u);
  22350. }
  22351. this.appearSlow();
  22352. }
  22353. return (this.upcomingTransType = e), !n;
  22354. }),
  22355. (n.prototype.findShortestPath = function (e, t) {
  22356. if (!e || !t) return null;
  22357. var i = c.warp.walkExtraPanosDistance,
  22358. n = e.id + ':' + t.id + ':' + i;
  22359. if (this.shortPaths.hasOwnProperty(n))
  22360. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  22361. var r = t.id + ':' + e.id + ':' + i;
  22362. if (this.shortPaths.hasOwnProperty(r))
  22363. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  22364. var o = this.model.panos.aStarSearch(e, t);
  22365. return (
  22366. this.model.panos.includeNodesNearPath(o, i),
  22367. (this.shortPaths[n] = o ? o.slice() : null),
  22368. o
  22369. );
  22370. }),
  22371. (n.prototype.makePathHulls = function (e) {
  22372. var t,
  22373. i,
  22374. n,
  22375. r,
  22376. o,
  22377. a = 0,
  22378. s = [],
  22379. l = [],
  22380. h = [],
  22381. u = this.model.panos;
  22382. (t = u.get(e[0])), (r = t.floor.floorIndex);
  22383. for (var d = 0; d < e.length; d += 1)
  22384. (t = u.get(e[d])),
  22385. (i = t.floorPosition.clone().sub(this.model.position)),
  22386. (i.y += this.pathHeight()),
  22387. s.push(i),
  22388. l.push(t.position.clone()),
  22389. (n = t.floor.floorIndex),
  22390. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  22391. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o));
  22392. return (
  22393. a > this.longestStep &&
  22394. ((this.longestStep = a), y.debug('path contains ' + a + ' meter segment')),
  22395. {
  22396. floor: s,
  22397. camera: l,
  22398. color: h,
  22399. }
  22400. );
  22401. }),
  22402. (n.prototype.makeFloorCurves = function (e, t, i) {
  22403. var n =
  22404. this.player.mode === a.PANORAMA
  22405. ? c.path.waypointIndoorRadius
  22406. : c.path.waypointRadius,
  22407. o = this.pointPathDistance(e) - 2 * n,
  22408. s = e.slice(0),
  22409. l = s[1].clone().sub(s[0]);
  22410. (l.y = 0),
  22411. l.normalize().multiplyScalar(n),
  22412. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  22413. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  22414. (l.y = 0),
  22415. l.normalize().multiplyScalar(n),
  22416. (s[s.length - 1] = new r.Vector3().copy(s[s.length - 1]).add(l));
  22417. var h = new r.CatmullRomCurve3(s),
  22418. u = Math.floor(o / i);
  22419. (u = 4 * Math.floor(u / 4)), (u = Math.max(4, u));
  22420. for (
  22421. var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3(), A = 0;
  22422. A < g.length;
  22423. A += 1
  22424. ) {
  22425. (f = 0), (d = g[A].distanceTo(e[0]));
  22426. for (var y = 1; y < e.length; y += 1)
  22427. v.copy(g[A]).sub(e[y]), (v.y *= 4), (p = v.length()), p < d && (f = y);
  22428. m.push(t[f]);
  22429. }
  22430. return {
  22431. distance: o,
  22432. points: g,
  22433. colors: m,
  22434. };
  22435. }),
  22436. (n.prototype.makeCameraCurvePoints = function (e, t) {
  22437. var i = this.pointPathDistance(e),
  22438. n = new r.CatmullRomCurve3(e);
  22439. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)));
  22440. }),
  22441. (n.prototype.makeCameraCurveTangents = function (e, t) {
  22442. var i = this.pointPathDistance(e),
  22443. n = new r.CatmullRomCurve3(e),
  22444. o = Math.max(2, Math.floor(i / t));
  22445. o || (o = 5);
  22446. for (var a = [], s = 0; s <= o; s++) a.push(n.getTangentAt(s / o));
  22447. return a;
  22448. }),
  22449. (n.prototype.setPathHulls = function (e) {
  22450. var t = this.makePathHulls(e);
  22451. (this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color);
  22452. }),
  22453. (n.prototype.setFloorCurves = function () {
  22454. var e = this.makeFloorCurves(
  22455. this.floorHull,
  22456. this.colorHull,
  22457. this.brushPrefs.paveStep
  22458. );
  22459. (this.floorPathDistance = e.distance),
  22460. (this.floorCurvePoints = e.points),
  22461. (this.floorCurveColors = e.colors);
  22462. }),
  22463. (n.prototype.setCameraCurvePoints = function () {
  22464. this.camCurvePoints = this.makeCameraCurvePoints(
  22465. this.cameraHull,
  22466. c.warp.stepFactor * this.brushPrefs.paveStep
  22467. );
  22468. }),
  22469. (n.prototype.chooseWarpPath = function (e) {
  22470. var t,
  22471. i,
  22472. n,
  22473. o = this.playerControls.cameras[a.PANORAMA];
  22474. if (this.player.currentPano === this.warpDestPano || !e)
  22475. return (this.warpPathPoints = null), (this.warpLength = 0), !1;
  22476. (this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22477. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  22478. ? (y.debug('warp path to unreachable node'),
  22479. (t = this.warpDestPano.position.clone().sub(o.position)),
  22480. (i = t.clone().negate()),
  22481. t.multiplyScalar(0.15).add(o.position),
  22482. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  22483. (t.y = o.position.y),
  22484. (i.y = this.warpDestPano.position.y),
  22485. (n = new r.CubicBezierCurve3(
  22486. o.position.clone(),
  22487. t,
  22488. i,
  22489. this.warpDestPano.position.clone()
  22490. )),
  22491. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  22492. : (y.debug(
  22493. 'follow warp path (path distance was ' +
  22494. this.nodes.length +
  22495. ' nodes, ' +
  22496. this.floorPathDistance +
  22497. ')'
  22498. ),
  22499. this.setCameraCurvePoints(),
  22500. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  22501. (this.warpLength = 0),
  22502. (this.warpPathLengths = [0]);
  22503. for (
  22504. var s = new r.Vector3(),
  22505. l = new r.Vector3(),
  22506. h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  22507. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)),
  22508. d = 1;
  22509. d < this.warpPathPoints.length;
  22510. d += 1
  22511. ) {
  22512. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  22513. var p = s.length();
  22514. s.y *= c.warp.climbEffort;
  22515. var f = s.length() / p;
  22516. if (d > 1) {
  22517. s.setY(0).normalize(),
  22518. l
  22519. .copy(this.warpPathPoints[d - 2])
  22520. .sub(this.warpPathPoints[d - 1])
  22521. .setY(0)
  22522. .normalize();
  22523. var g = Math.min(1, s.dot(l)),
  22524. m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  22525. f = Math.max(m, f);
  22526. }
  22527. (this.warpLength += p * f), (this.warpPathLengths[d] = this.warpLength);
  22528. }
  22529. return !0;
  22530. }),
  22531. (n.prototype.drawPathRibbon = function (e, t) {
  22532. this.bunnyObj.visible = c.warp.showBunny;
  22533. for (
  22534. var i = 0.6 * c.path.ribbonWidth * 0.5,
  22535. n = new r.Vector3(),
  22536. o = new r.Vector3(0, this.pathHeight(), 0),
  22537. l = new r.Geometry(),
  22538. h = new r.Vector3(),
  22539. u = 0;
  22540. u < e.length;
  22541. u += 1
  22542. ) {
  22543. h.copy(e[u]),
  22544. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  22545. h.normalize(),
  22546. n.crossVectors(h, A.UP),
  22547. n.multiplyScalar(i);
  22548. var d = new r.Vector3().copy(e[u]).add(o);
  22549. d.sub(n),
  22550. l.vertices.push(d),
  22551. (d = new r.Vector3().copy(e[u]).add(o)),
  22552. d.add(n),
  22553. l.vertices.push(d);
  22554. }
  22555. var p,
  22556. f = 0;
  22557. for (u = 0; u < e.length - 1; u += 1) {
  22558. var g = 2 * u,
  22559. v = f;
  22560. f += e[u + 1].distanceTo(e[u]);
  22561. var y = f,
  22562. C = t[u],
  22563. I = t[u + 1];
  22564. (p = new r.Face3(g, g + 1, g + 2)),
  22565. (p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)]),
  22566. l.faces.push(p),
  22567. l.faceVertexUvs[0].push([
  22568. new r.Vector2(0, v),
  22569. new r.Vector2(1, v),
  22570. new r.Vector2(0, y),
  22571. ]),
  22572. (p = new r.Face3(g + 2, g + 1, g + 3)),
  22573. (p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)]),
  22574. l.faces.push(p),
  22575. l.faceVertexUvs[0].push([
  22576. new r.Vector2(0, y),
  22577. new r.Vector2(1, v),
  22578. new r.Vector2(1, y),
  22579. ]);
  22580. }
  22581. l.computeFaceNormals(), l.computeVertexNormals();
  22582. var E, b;
  22583. this.player.mode === a.PANORAMA
  22584. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  22585. (b.map.value = w.path),
  22586. (b.opacity.value = 0),
  22587. b.color.value.set(c.path.color),
  22588. (E = new r.RawShaderMaterial({
  22589. side: r.DoubleSide,
  22590. depthWrite: !1,
  22591. transparent: !0,
  22592. vertexShader: m.ribbon.vertexShader,
  22593. fragmentShader: m.ribbon.fragmentShader,
  22594. uniforms: b,
  22595. name: 'ribbonT',
  22596. opacity: 0,
  22597. })))
  22598. : (E = new r.MeshBasicMaterial({
  22599. color: 16777215,
  22600. side: r.DoubleSide,
  22601. name: 'ribbonOut',
  22602. vertexColors: r.VertexColors,
  22603. }));
  22604. var _ = new r.Mesh(l, E);
  22605. return (
  22606. (_.name = 'ribbon'),
  22607. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  22608. _
  22609. );
  22610. }),
  22611. (n.prototype.drawPathPavement = function (e) {
  22612. for (
  22613. var t,
  22614. i = 0.25,
  22615. n = new r.Vector3(),
  22616. o = new r.Geometry(),
  22617. s = new r.Vector3(),
  22618. l = 0;
  22619. l < e.length;
  22620. l += 1
  22621. )
  22622. s.copy(e[l]),
  22623. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  22624. s.normalize(),
  22625. n.crossVectors(s, A.UP),
  22626. n.multiplyScalar(this.brushPrefs.paveWidth),
  22627. (t = new r.Vector3().copy(e[l])),
  22628. t.sub(n),
  22629. o.vertices.push(t),
  22630. o.vertices.push(new r.Vector3().copy(e[l])),
  22631. (t = new r.Vector3().copy(e[l])),
  22632. t.add(n),
  22633. o.vertices.push(t);
  22634. var h, u, d;
  22635. for (l = 0; l < e.length - 1; l += 1)
  22636. (h = 3 * l + 1),
  22637. (u = l * i),
  22638. (d = u + i),
  22639. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  22640. o.faceVertexUvs[0].push([
  22641. new r.Vector2(0, u),
  22642. new r.Vector2(0.5, u),
  22643. new r.Vector2(0.5, d),
  22644. ]),
  22645. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  22646. o.faceVertexUvs[0].push([
  22647. new r.Vector2(0.5, d),
  22648. new r.Vector2(0, d),
  22649. new r.Vector2(0, u),
  22650. ]),
  22651. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  22652. o.faceVertexUvs[0].push([
  22653. new r.Vector2(0.5, d),
  22654. new r.Vector2(0.5, u),
  22655. new r.Vector2(1, u),
  22656. ]),
  22657. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  22658. o.faceVertexUvs[0].push([
  22659. new r.Vector2(0.5, d),
  22660. new r.Vector2(1, u),
  22661. new r.Vector2(1, d),
  22662. ]);
  22663. var p =
  22664. this.player.mode === a.PANORAMA
  22665. ? new r.MeshBasicMaterial({
  22666. color: c.path.color,
  22667. side: r.DoubleSide,
  22668. transparent: !0,
  22669. depthWrite: !1,
  22670. opacity: 0,
  22671. name: 'paveT',
  22672. map: w.path,
  22673. })
  22674. : new r.MeshBasicMaterial({
  22675. color: c.path.color,
  22676. side: r.DoubleSide,
  22677. transparent: !0,
  22678. depthWrite: !1,
  22679. opacity: 1,
  22680. name: 'paveO',
  22681. map: w.path,
  22682. });
  22683. return new r.Mesh(o, p);
  22684. }),
  22685. (n.prototype.hintPrefs = {
  22686. rad: 0.18,
  22687. width: 0.0125,
  22688. depth: 0.0625,
  22689. setBack: -0.04,
  22690. markRad: 0.25,
  22691. markInnerRad: 0.16,
  22692. }),
  22693. (n.prototype.makeWaypointObj = function (e, t) {
  22694. var i = new r.Geometry(),
  22695. n =
  22696. this.player.mode === a.PANORAMA
  22697. ? c.path.waypointIndoorRadius
  22698. : c.path.waypointRadius,
  22699. o = this.pathHeight();
  22700. i.vertices.push(
  22701. new r.Vector3(-n, o, n),
  22702. new r.Vector3(-n, o, -n),
  22703. new r.Vector3(n, o, -n),
  22704. new r.Vector3(n, o, n)
  22705. ),
  22706. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  22707. i.faceVertexUvs[0].push([
  22708. new r.Vector2(0, 0),
  22709. new r.Vector2(1, 0),
  22710. new r.Vector2(1, 1),
  22711. ]),
  22712. i.faceVertexUvs[0].push([
  22713. new r.Vector2(1, 1),
  22714. new r.Vector2(0, 1),
  22715. new r.Vector2(0, 0),
  22716. ]);
  22717. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  22718. (s.map.value = e), (s.opacity.value = 0), s.color.value.set(c.path.color);
  22719. var l = {
  22720. side: r.DoubleSide,
  22721. depthWrite: !1,
  22722. transparent: !0,
  22723. vertexShader: m.waypoint.vertexShader,
  22724. fragmentShader: m.waypoint.fragmentShader,
  22725. uniforms: s,
  22726. name: 'waypoint',
  22727. opacity: 0,
  22728. };
  22729. this.player.mode !== a.PANORAMA && ((l.depthTest = !1), (l.name = 'wayPtOut'));
  22730. var h = new r.RawShaderMaterial(l),
  22731. u = new r.Mesh(i, h);
  22732. return (u.name = t), u;
  22733. }),
  22734. (n.prototype.makeStartMarker = function (e, t) {
  22735. var i = new r.Vector3().copy(t[1]).sub(t[0]);
  22736. (i.y = 0), i.normalize();
  22737. var n = Math.acos(i.x),
  22738. o = this.makeWaypointObj(w.pathStart, 'Start');
  22739. return o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o;
  22740. }),
  22741. (n.prototype.makeEndMarker = function (e) {
  22742. var t = this.makeWaypointObj(w.pathEnd, 'End'),
  22743. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  22744. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  22745. return (
  22746. i < n
  22747. ? t.material.uniforms.color.value.set(c.path.colorUp)
  22748. : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  22749. t.position.copy(e),
  22750. t
  22751. );
  22752. }),
  22753. (n.prototype.pathClean = function (e) {
  22754. if (e) {
  22755. for (var t in e.children) this.pathClean(e.children[t]);
  22756. e.geometry && e.geometry.dispose(), e.material && e.material.dispose();
  22757. }
  22758. }),
  22759. (n.prototype.discardPathObject = function () {
  22760. if (this.obj3d) {
  22761. var e = this.obj3d.parent;
  22762. e && e.remove(this.obj3d), this.pathClean(this.obj3d);
  22763. }
  22764. (this.obj3d = null), this.popInCpm();
  22765. }),
  22766. (n.prototype.discardSlow = function () {
  22767. if (this.obj3d) {
  22768. if (this.player.mode !== a.PANORAMA) return void this.discardPathObject();
  22769. for (
  22770. var e,
  22771. t = this,
  22772. i = 0,
  22773. n = function () {
  22774. this.discardPathObject();
  22775. }.bind(this),
  22776. r = 0;
  22777. r < t.obj3d.children.length;
  22778. r += 1
  22779. )
  22780. (e = t.obj3d.children[r]),
  22781. void 0 !== e.material &&
  22782. e.material.transparent === !0 &&
  22783. (void 0 !== e.material.uniforms
  22784. ? p.start(
  22785. u.property(e.material.uniforms.opacity, 'value', 0),
  22786. c.path.fadeOutTime,
  22787. n,
  22788. 0,
  22789. d[c.warp.blendEasing]
  22790. )
  22791. : p.start(
  22792. u.property(e.material, 'opacity', 0),
  22793. c.path.fadeOutTime,
  22794. n,
  22795. 0,
  22796. d[c.warp.blendEasing]
  22797. ),
  22798. (i += 1),
  22799. (n = null));
  22800. 0 === i && this.discardPathObject(),
  22801. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3);
  22802. }
  22803. }),
  22804. (n.prototype.appearSlow = function () {
  22805. var e,
  22806. t = this;
  22807. this.fadeOutCpm(c.path.fadeInTime);
  22808. for (
  22809. var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0;
  22810. n < t.obj3d.children.length;
  22811. n += 1
  22812. )
  22813. (e = t.obj3d.children[n]),
  22814. void 0 !== e.material &&
  22815. e.material.transparent === !0 &&
  22816. (void 0 !== e.material.uniforms
  22817. ? p.start(
  22818. u.property(e.material.uniforms.opacity, 'value', i),
  22819. c.path.fadeInTime,
  22820. null,
  22821. 0,
  22822. d[c.warp.blendEasing]
  22823. )
  22824. : p.start(
  22825. u.property(e.material, 'opacity', i),
  22826. c.path.fadeInTime,
  22827. null,
  22828. 0,
  22829. d[c.warp.blendEasing]
  22830. ));
  22831. }),
  22832. (n.prototype.update = function () {
  22833. this.obj3d && this.obj3d.updateMatrixWorld();
  22834. }),
  22835. (n.prototype.calcBurnsAmount = function (e) {
  22836. //计算导览点旋转角
  22837. var t = r.Math.degToRad(c.warp.burnsAngle);
  22838. if (this.player.mode === a.PANORAMA) {
  22839. var i = this.burnsDir * t;
  22840. if (this.upcomingTransType === l.BLACK) return i;
  22841. var n = e;
  22842. if (null === n) return y.warn('Transition request for non-highlight'), i;
  22843. var o = this.getHeroDescriptorByHeroIndex(n);
  22844. if (null === o) return i;
  22845. if (!o.isPano()) return i;
  22846. var s = this.getHeroPano(o),
  22847. h = this.playerControls.cameras[a.PANORAMA],
  22848. u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize(),
  22849. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  22850. p = function (e) {
  22851. var i = Math.acos(Math.min(1, e.dot(u))),
  22852. n = new r.Vector3().crossVectors(u, e);
  22853. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y);
  22854. };
  22855. if (s === this.player.currentPano)
  22856. return (i = p(
  22857. A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize()
  22858. ));
  22859. var f = this.findShortestPath(this.player.currentPano, s);
  22860. if (void 0 === f || null === f || f.length < 1)
  22861. return y.debug('Empty path ahead...'), i;
  22862. var g = this.makePathHulls(f),
  22863. m = new r.CatmullRomCurve3(g.camera),
  22864. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength());
  22865. return (i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize()));
  22866. }
  22867. return this.player.mode === a.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir;
  22868. }),
  22869. (n.prototype.waitNextStep = function (e, t, time) {
  22870. //xzw 改时间
  22871. var i = time == void 0 ? c.warp.tourStepDelay : time;
  22872. i == void 0 &&
  22873. (i =
  22874. this.lastTransType === l.BLACK
  22875. ? b.tourStepDelaySlideShow
  22876. : b.tourStepDelayDefault);
  22877. var n = new r.Euler(),
  22878. o = new r.Vector3();
  22879. y.debug('Starting wait: ' + (void 0 !== t));
  22880. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem); //this.model.heroLocations[this.director.currentItem[0]]
  22881. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  22882. h = function () {
  22883. this.endWarpState(),
  22884. this.player.mode === a.DOLLHOUSE &&
  22885. (this.playerControls.cameras[
  22886. a.DOLLHOUSE
  22887. ].controls.rotationAcceleration.x = 0),
  22888. t && t();
  22889. }.bind(this),
  22890. u = function (e, t) {
  22891. if (this.warpInterrupted) return h(), !0;
  22892. var r = t || 1e3 / 60;
  22893. if (c.warp.doBurns && !currentLocation.dontRot)
  22894. if (this.player.mode === a.PANORAMA) {
  22895. var l = this.playerControls.cameras[a.PANORAMA];
  22896. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  22897. var u = i == 0 ? s : (r * s) / i;
  22898. u = Math.sign(u) * Math.max(u, 0.0001); //add 如果音频长的话,使旋转可见,否则以为停住了
  22899. (n.y += u),
  22900. o.set(0, 0, -1),
  22901. o.applyEuler(n),
  22902. o.add(l.position),
  22903. l.controls.lookAt(o),
  22904. l.controls.lookVector.copy(o),
  22905. l.lookAt(o);
  22906. } else
  22907. this.player.mode === a.DOLLHOUSE
  22908. ? (this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s)
  22909. : (this.playerControls.controls[a.FLOORPLAN].absoluteScale *= 0.9996);
  22910. }.bind(this);
  22911. this.startWarpState(), p.start(u, i, h, 0, d.easeInOutQuad, 'wait');
  22912. }),
  22913. (n.prototype.warpToNonPano = function (e) {
  22914. if (
  22915. (this.discardPathObject(),
  22916. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE ||
  22917. this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)
  22918. ) {
  22919. var t = function () {
  22920. e && e();
  22921. }.bind(this);
  22922. this.player.flyToNewMode({
  22923. mode: this.warpDestHeroLoc.cameraMode,
  22924. duration: c.warp.outsideTime,
  22925. warpDest: this.warpDestHeroLoc,
  22926. callback: t,
  22927. force: !0,
  22928. });
  22929. } else y.warn('no warp destination!!!'), e && e();
  22930. }),
  22931. (n.prototype._resetWarpShaderParams = function (e) {
  22932. //
  22933. this.player.mode === a.PANORAMA &&
  22934. (void 0 !== e.material.uniforms.blackout &&
  22935. (e.material.uniforms.blackout.value = 0),
  22936. void 0 !== e.material.uniforms.modelAlpha &&
  22937. (e.material.uniforms.modelAlpha.value = 0));
  22938. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  22939. delete e.material.defines.newBlack;
  22940. e.material.needsUpdate = true
  22941. } */
  22942. }),
  22943. (n.prototype._clearWarpShading = function () {
  22944. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  22945. this._resetWarpShaderParams(e[t]), (e[t].visible = !0);
  22946. this._resetWarpShaderParams(this.model.skybox);
  22947. }),
  22948. (n.prototype._warpStopFlying = function () {
  22949. (this.activeTransType = null), this.placeCpm();
  22950. }),
  22951. (n.prototype._wrapupTravelOnlyBits = function () {
  22952. this._warpStopFlying(),
  22953. this.warpPathPoints &&
  22954. (this.player.currentPano.exit(),
  22955. this.warpDestPano.enter(),
  22956. (this.player.currentPano = this.warpDestPano)),
  22957. this.player.spider.draw(),
  22958. this.placeCpm();
  22959. }),
  22960. (n.prototype._wrapupTravel = function (e) {
  22961. this._wrapupTravelOnlyBits(), this.warpCameraAim(e);
  22962. }),
  22963. (n.prototype._wrapupWarpShading = function (e) {
  22964. this._clearWarpShading(), this._wrapupTravel(e);
  22965. }),
  22966. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  22967. t !== I.END && this._clearWarpShading(),
  22968. this._wrapupTravelOnlyBits(),
  22969. (this.upcomingTransType = null),
  22970. e && e();
  22971. }),
  22972. (n.prototype._warpCameraAim = function (e, t) {
  22973. //到每个片段终点时转向终点朝向。
  22974. var i = this.warpDestHeroLoc.quaternion,
  22975. n = this.playerControls.cameras[a.PANORAMA],
  22976. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  22977. s = new r.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize(),
  22978. l = s.dot(o),
  22979. u = r.Math.radToDeg(Math.acos(l)),
  22980. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder),
  22981. g = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  22982. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder);
  22983. (m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y));
  22984. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  22985. A = new r.Vector3(),
  22986. C = function (e, t) {
  22987. return (
  22988. !!this.warpInterrupted ||
  22989. ((v.x = g.x + e * m.x),
  22990. (v.y = g.y + e * m.y),
  22991. (v.z = g.z + e * m.z),
  22992. A.set(0, 0, -1),
  22993. A.applyEuler(v),
  22994. A.add(n.position),
  22995. n.controls.lookAt(A),
  22996. n.controls.lookVector.copy(A),
  22997. void n.lookAt(A))
  22998. );
  22999. }.bind(this);
  23000. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  23001. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  23002. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  23003. ):
  23004. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  23005. ,void (t && t())
  23006. ) */
  23007. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  23008. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e);
  23009. return u > c.warp.minRotation
  23010. ? p.start(C, e, t, 0, d[c.warp.movementEasing])
  23011. : (y.info(
  23012. 'Aim angle only is ' + u.toPrecision(3) + ' degrees, skipping explicit re-aim'
  23013. ),
  23014. void (t && t()));
  23015. }),
  23016. (n.prototype._warpBendAim = function (e, t, i, n) {
  23017. var o = n || 0,
  23018. s = this.playerControls.cameras[a.PANORAMA],
  23019. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23020. this.warpDestHeroLoc.quaternion,
  23021. c.warp.eOrder
  23022. ),
  23023. u = new r.Euler().setFromQuaternion(s.quaternion, c.warp.eOrder),
  23024. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder);
  23025. f.y = h.constrainedTurn(f.y);
  23026. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  23027. (f.x = g * Math.sign(f.x)),
  23028. (g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g)),
  23029. (this.burnsDir = Math.sign(f.y)),
  23030. (g *= Math.sign(f.y)),
  23031. (f.y = g);
  23032. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  23033. v = new r.Vector3(),
  23034. A = function (e, t) {
  23035. if (e < 0.5) (m.x = u.x + e * f.x), (m.y = u.y + e * f.y), (m.z = u.z + e * f.z);
  23036. else {
  23037. var i = (1 - e) * c.warp.softBendEnd;
  23038. (m.x = l.x - i * f.x), (m.y = l.y - i * f.y), (m.z = l.z - i * f.z);
  23039. }
  23040. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position);
  23041. s.controls.lookAt(v), s.controls.lookVector.copy(v), s.lookAt(v);
  23042. }.bind(this);
  23043. if (window.DATA.momentTourBlackNewType) {
  23044. A(1);
  23045. } else return p.start(A, t, i, o, d[c.warp.movementEasing]);
  23046. }),
  23047. (n.prototype._warpStepCameraAim = function (e, t, i) {
  23048. var n = this.playerControls.cameras[a.PANORAMA],
  23049. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23050. this.warpDestHeroLoc.quaternion,
  23051. c.warp.eOrder
  23052. ),
  23053. s = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23054. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder);
  23055. (l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y));
  23056. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  23057. f = new r.Vector3(),
  23058. g = function (e, t) {
  23059. e < 0.5 ? u.copy(s) : u.copy(o),
  23060. f.set(0, 0, -1),
  23061. f.applyEuler(u),
  23062. f.add(n.position),
  23063. n.controls.lookAt(f),
  23064. n.controls.lookVector.copy(f),
  23065. n.lookAt(f);
  23066. }.bind(this);
  23067. return p.start(g, t, i, 0, d[c.warp.movementEasing]);
  23068. }),
  23069. (n.prototype.setBurnsDir = function () {
  23070. var e = this.playerControls.cameras[a.PANORAMA],
  23071. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23072. this.warpDestHeroLoc.quaternion,
  23073. c.warp.eOrder
  23074. ),
  23075. i = new r.Euler().setFromQuaternion(e.quaternion, c.warp.eOrder),
  23076. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder);
  23077. (n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y));
  23078. }),
  23079. (n.prototype.stepWarpPath = function (firstPos, e) {
  23080. var i = this.playerControls.cameras[a.PANORAMA];
  23081. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos;
  23082. if (!n) {
  23083. return i.position.copy(this.warpDestPano.position), !0;
  23084. }
  23085. /* if (!this.warpPathPoints)
  23086. return i.position.copy(this.warpDestPano.position),
  23087. !0;
  23088. var n = this.warpPathPoints[0] */
  23089. var o = this.warpDestPano.position;
  23090. /* console.log(firstPos)
  23091. console.log(o) */
  23092. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  23093. var s = new r.Vector3();
  23094. e < 0.5
  23095. ? s
  23096. .copy(this.cameraHull[1])
  23097. .sub(n)
  23098. .normalize()
  23099. .multiplyScalar(c.warp.softPushDist * e)
  23100. .add(n)
  23101. : s
  23102. .copy(this.cameraHull[this.cameraHull.length - 2])
  23103. .sub(o)
  23104. .normalize()
  23105. .multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e))
  23106. .add(o),
  23107. i.position.copy(s);
  23108. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o);
  23109. }),
  23110. (n.prototype.interruptAndFastForward = function (e, t) {
  23111. this.warping &&
  23112. ((this.warpInterrupted = !0),
  23113. (this.warpInterruptionBlackoutStyle = e),
  23114. (this.warpInterruptionTravelTime = t),
  23115. (null !== this.warpInterruptionBlackoutStyle &&
  23116. void 0 !== this.warpInterruptionBlackoutStyle) ||
  23117. (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  23118. (null !== this.warpInterruptionTravelTime &&
  23119. void 0 !== this.warpInterruptionTravelTime) ||
  23120. (this.warpInterruptionTravelTime = c.minWarpTime));
  23121. }),
  23122. (n.prototype.warpCameraAim = function (e) {
  23123. var t = c.warp.minWarpTime;
  23124. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime;
  23125. else {
  23126. var i = this.playerControls.cameras[a.PANORAMA],
  23127. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23128. this.warpDestHeroLoc.quaternion,
  23129. c.warp.eOrder
  23130. ),
  23131. o = new r.Euler().setFromQuaternion(i.quaternion, c.warp.eOrder),
  23132. s = new r.Euler(n.x - o.x, n.y - o.y, n.z - o.z, c.warp.eOrder);
  23133. s.y = h.constrainedTurn(s.y);
  23134. var u = (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec);
  23135. t = Math.max(t, u);
  23136. }
  23137. var d = function () {
  23138. this._warpStopFlying(), this.discardSlow(), e && e();
  23139. }.bind(this);
  23140. this._warpCameraAim(t, d);
  23141. }),
  23142. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  23143. this.model.skybox.material.uniforms.blackout.value = n;
  23144. var r = u.uniform(this.model.skybox, 'progress', 1),
  23145. o = u.allUniforms(this.model.chunks, 'progress', 1),
  23146. a = !1,
  23147. s = function () {
  23148. if (this.warpInterrupted) return (a = !0), !0;
  23149. }.bind(this),
  23150. l = function (e, t) {
  23151. return i && a
  23152. ? ((this.model.skybox.material.uniforms.progress.value = 0), !0)
  23153. : void r(e, t);
  23154. }.bind(this),
  23155. h = function (e, t) {
  23156. return i && a ? (o(0), !0) : void o(e, t);
  23157. }.bind(this);
  23158. p.start(s, e, null, t, null, 'safeHaltWatch'),
  23159. p.start(l, e, null, t, d[c.warp.blendEasing], 'skyboxProgress'),
  23160. p.start(h, e, null, t, d[c.warp.blendEasing], 'chunkProgress');
  23161. }),
  23162. (n.prototype.warpTravel_STD = function (e) {
  23163. var t,
  23164. i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength),
  23165. n = this.playerControls.cameras[a.PANORAMA],
  23166. o = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  23167. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  23168. f = new r.Vector3(),
  23169. m = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23170. v = new r.Euler().copy(m),
  23171. C = n.position.clone(),
  23172. E = new r.Matrix4(),
  23173. b = new r.Euler(),
  23174. w = c.warp.minWarpTime;
  23175. (w += this.warpLength * c.warp.timePerMeter),
  23176. c.warp.flySpeed > 0.01 && (w = (1e3 * this.warpLength) / c.warp.flySpeed);
  23177. var _ = !1,
  23178. T = this.warpDestHeroLoc.quaternion,
  23179. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  23180. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  23181. .clone()
  23182. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  23183. .normalize(),
  23184. M = S.dot(x),
  23185. R = r.Math.radToDeg(Math.acos(M)),
  23186. P = function (e) {
  23187. var t = o,
  23188. i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  23189. return i;
  23190. },
  23191. O = function () {
  23192. return (
  23193. E.lookAt(C, t, A.UP),
  23194. s.setFromRotationMatrix(E, c.warp.eOrder),
  23195. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23196. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23197. h.constrainedTurn(b.y)
  23198. );
  23199. }.bind(this),
  23200. L = function (e, t) {
  23201. if (this.warpInterrupted) return (_ = !0), !0;
  23202. }.bind(this),
  23203. D = function (e, t) {
  23204. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(e);
  23205. }.bind(this),
  23206. N = u.allUniforms(this.model.chunks, 'modelAlpha', 1),
  23207. B = function (e, t) {
  23208. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t);
  23209. }.bind(this),
  23210. F = function (e, t) {
  23211. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0;
  23212. if (_) return !0;
  23213. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  23214. n.position.copy(i),
  23215. (C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e));
  23216. }.bind(this),
  23217. V = function (e, n) {
  23218. return this.warpPathPoints
  23219. ? !!_ ||
  23220. void (t = this.interpAlongPath(
  23221. this.warpPathPoints,
  23222. this.warpPathLengths,
  23223. Math.min(e + i, 1)
  23224. ))
  23225. : (y.debug('Lost bunny.'), !0);
  23226. }.bind(this),
  23227. U = function (e, o) {
  23228. if (_) return y.debug('>>>> Walkthrough interupted at t=' + e), !0;
  23229. if (!this.warpPathPoints) return !0;
  23230. var a = this.warpLength * e,
  23231. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  23232. u = r.Math.smoothstep(
  23233. a,
  23234. this.warpLength - this.brushPrefs.lookBlendDist,
  23235. this.warpLength
  23236. );
  23237. c.warp.matchCam && (l *= 1 - u),
  23238. E.lookAt(C, t, A.UP),
  23239. s.setFromRotationMatrix(E, c.warp.eOrder),
  23240. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23241. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23242. (b.y = h.constrainedTurn(b.y)),
  23243. (s.x = m.x + l * b.x),
  23244. (s.y = m.y + l * b.y),
  23245. (s.z = m.z + l * b.z),
  23246. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  23247. (b.y = h.constrainedTurn(b.y));
  23248. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3;
  23249. (b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  23250. (v.x = v.x + b.x * c.warp.turnFriction),
  23251. (v.y = v.y + b.y * c.warp.turnFriction),
  23252. (v.z = v.z + b.z * c.warp.turnFriction),
  23253. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x));
  23254. var p = t.clone().sub(C).normalize();
  23255. if (R < c.warp.maxAimRotation && u > 0) {
  23256. var g = 1 - u;
  23257. (p.x = p.x * g + u * S.x),
  23258. (p.y = p.y * g + u * S.y),
  23259. (p.z = p.z * g + u * S.z),
  23260. p.normalize();
  23261. }
  23262. this.bunnyObj.position.copy(n.position).add(p),
  23263. f.set(0, 0, -1).applyEuler(v).normalize(),
  23264. f.multiplyScalar(8),
  23265. f.add(n.position),
  23266. (e > 1 - i && c.warp.matchCam) ||
  23267. (n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f));
  23268. }.bind(this),
  23269. k = function () {
  23270. _
  23271. ? (this.discardSlow(),
  23272. (this.upcomingTransType = l.BLACK),
  23273. this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, I.BEGINNING, e))
  23274. : this._wrapupWarpShading(e);
  23275. }.bind(this);
  23276. V(0);
  23277. var H =
  23278. c.warp.motionLeadTime +
  23279. (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec);
  23280. w += H;
  23281. var G = H / w;
  23282. this.warpCommonParameters(w, G, !0, I.NONE),
  23283. p.start(L, w, null, 0, null, '_haltWatcher'),
  23284. c.warp.blur > 0 &&
  23285. ((g.blurStrength = c.warp.blur), p.start(D, w, null, G, P, 'blurring')),
  23286. p.start(B, w, null, G, P, 'modelAlpha'),
  23287. p.start(F, w, null, G, d[c.warp.blendEasing], 'followPath'),
  23288. p.start(V, w, null, G, d[c.warp.blendEasing], 'goBunny'),
  23289. p.start(U, w, k, 0, d[c.warp.blendEasing], 'lookAtBunny');
  23290. }),
  23291. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  23292. var r = e || 0;
  23293. (void 0 !== t && null !== t) || (t = c.warp.teleportTime);
  23294. //add
  23295. var done = () => {
  23296. Hot.updateVisibles([this.player.currentPano]); //更新热点显示
  23297. this.player.transitionPos({
  23298. type: 'beforeFlytopano',
  23299. pano: this.player.currentPano,
  23300. dur: 100,
  23301. }); //add
  23302. };
  23303. if (window.DATA.momentTourBlackNewType) {
  23304. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer);
  23305. var camera = this.playerControls.cameras[a.PANORAMA];
  23306. var end = this.warpDestHeroLoc.position;
  23307. camera.position.copy(end);
  23308. setTimeout(() => {
  23309. player.sceneRenderer.effects.transitionMaskPass.stop();
  23310. this.wrapupWarpShadingOnly(n, i);
  23311. done();
  23312. }, t);
  23313. } else {
  23314. var o = function () {
  23315. this.wrapupWarpShadingOnly(n, i);
  23316. done();
  23317. }.bind(this);
  23318. var firstPos = this.player.position.clone(); //add
  23319. p.start(
  23320. this.stepWarpPath.bind(this, firstPos),
  23321. t,
  23322. o,
  23323. r,
  23324. d[c.warp.blendEasing],
  23325. 'stepMotion'
  23326. );
  23327. }
  23328. this.warpCommonParameters(t, r, !1, i);
  23329. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  23330. // 改
  23331. if (window.DATA.momentTourBlackNewType) {
  23332. e.material.uniforms.blackout.value = 5; //i 改
  23333. //e.material.defines.newBlack = ''
  23334. //e.material.needsUpdate = true
  23335. } else {
  23336. e.material.uniforms.blackout.value = i;
  23337. }
  23338. }),
  23339. this._warpBendAim(null, t, null, r);
  23340. }),
  23341. (n.prototype.flightStepWalk = (function (e, t, i) {
  23342. var n = 0.001,
  23343. o = 1,
  23344. a = 1.2,
  23345. s = new r.Vector3(),
  23346. h = new r.Vector3(),
  23347. u = function (e, t) {
  23348. //导览速度
  23349. var i = Math.min(
  23350. this.player.position.distanceTo(e.position),
  23351. c.transition.flytimeMaxDistanceThreshold
  23352. ),
  23353. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  23354. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  23355. h.copy(A.FORWARD),
  23356. this.player.getDirection(h),
  23357. s.copy(t).sub(e.position).normalize();
  23358. var l = s.dot(h),
  23359. u = Math.acos(l),
  23360. d = u / r;
  23361. d > n && ((r *= d / n), u < o && (r *= a));
  23362. return (r / DATA.tourWalkSpeed) * 100; // 改
  23363. };
  23364. return function (e, t, i) {
  23365. if (this.warpInterrupted) i && i();
  23366. else if (this.activeTransType !== l.WALK)
  23367. this._clearWarpShading(),
  23368. this._warpStopFlying(),
  23369. this.player.spider.draw(),
  23370. this.placeCpm(),
  23371. i && i();
  23372. else if (this.player.currentPano !== e) {
  23373. var n = {
  23374. pano: e,
  23375. lookAtPoint: t,
  23376. duration: null,
  23377. maxDistanceOverride: c.warp.walkMaxDist,
  23378. skipWarpingCheck: !1,
  23379. constantMoveSpeed: !0,
  23380. };
  23381. if (e == this.warpDestPano) {
  23382. //到达终点前,放大到终点的zoom
  23383. n.zoomLevel = this.warpDestHeroLoc.zoom;
  23384. }
  23385. (n.duration = u.call(this, e, t)), this.player.nonInterruptingFlyToPano(n, i);
  23386. } else i && i();
  23387. };
  23388. })()),
  23389. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  23390. return this.flightStepWalk.bind(this, e, t, i);
  23391. }),
  23392. (n.prototype.warpTravel_WALK = (function () {
  23393. var e = [];
  23394. return function (t) {
  23395. var i = this.player.model.panos;
  23396. e.length = 0;
  23397. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  23398. var s = this.nodes[a],
  23399. l = i.get(s);
  23400. a === this.nodes.length - 1;
  23401. (o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist),
  23402. (n && o) || (e.push(s), (n = l));
  23403. }
  23404. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  23405. var h = e.length,
  23406. u = i.get(e[h - 1]),
  23407. d = new Array(h + 1);
  23408. d[d.length - 1] = function () {
  23409. t && t();
  23410. }.bind(this);
  23411. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  23412. var g = e[p];
  23413. u = i.get(g);
  23414. var m = new r.Vector3();
  23415. this.getLookAtForWalkingTourNode(e, p, m),
  23416. (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])),
  23417. p--;
  23418. }
  23419. d[0]();
  23420. };
  23421. })()),
  23422. (n.prototype.getLookAtForWalkingTourNode = (function () {
  23423. var e = new r.Vector3(),
  23424. t = new r.Vector3(),
  23425. i = new r.Vector3(),
  23426. n = new r.Vector3(),
  23427. o = new r.Vector3(),
  23428. a = 0.65,
  23429. s = 0.75,
  23430. l = 0.2,
  23431. c = 0.4,
  23432. h = 0.2,
  23433. u = 3;
  23434. return function (r, d, p) {
  23435. var f = r.length;
  23436. if (d >= f) return !1;
  23437. var g = 1,
  23438. m = 1;
  23439. t.set(0, 0, 0), o.set(0, 0, 0);
  23440. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  23441. if (
  23442. ((v = this.player.model.panos.get(r[A])),
  23443. this.getOrientationForWalkingTourNode(r, A, i),
  23444. A === d && e.copy(i),
  23445. n.copy(i),
  23446. A > d)
  23447. ) {
  23448. var y = n.dot(e) < a;
  23449. (g *= y ? l : s), (m *= y ? h : c);
  23450. }
  23451. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m);
  23452. }
  23453. return t.normalize(), p.copy(o), p.add(t), !0;
  23454. };
  23455. })()),
  23456. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  23457. var n = e.length;
  23458. if (t >= n) return !1;
  23459. if (t === n - 1) i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  23460. else {
  23461. var r = this.player.model.panos.get(e[t]),
  23462. o = this.player.model.panos.get(e[t + 1]);
  23463. i.copy(o.position).sub(r.position);
  23464. }
  23465. return i.normalize(), !0;
  23466. }),
  23467. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  23468. if (
  23469. ((this.activeTransType = this.upcomingTransType),
  23470. (this.lastTransType = this.activeTransType),
  23471. (this.upcomingTransType = null),
  23472. !e)
  23473. ) {
  23474. var r = function () {
  23475. this._wrapupTravel(n);
  23476. }.bind(this),
  23477. o = {
  23478. pano: this.warpDestPano,
  23479. lookAtPoint: null,
  23480. duration: null,
  23481. maxDistanceOverride: null,
  23482. skipWarpingCheck: !1,
  23483. };
  23484. return void this.player.flyToPano(o, r);
  23485. }
  23486. this.activeTransType === l.BLACK
  23487. ? this.warpTravel_BLACK(null, i, t, n)
  23488. : this.activeTransType === l.WALK
  23489. ? this.warpTravel_WALK(
  23490. function () {
  23491. this._clearWarpShading(),
  23492. this._warpStopFlying(),
  23493. this.player.spider.draw(),
  23494. this.placeCpm(),
  23495. n && n();
  23496. }.bind(this)
  23497. )
  23498. : this.warpTravel_STD(n);
  23499. }),
  23500. (n.prototype.startWarpState = function () {
  23501. (this.warping = !0),
  23502. (this.warpInterrupted = !1),
  23503. (this.warpInterruptionBlackoutStyle = null),
  23504. (this.warpInterruptionTravelTime = null);
  23505. }),
  23506. (n.prototype.endWarpState = function () {
  23507. this.warping = !1;
  23508. }),
  23509. (n.prototype.warpToPano = function (e, t, i, n) {
  23510. if (this.warping) return void y.warn('Cannot warp when already warping');
  23511. if (
  23512. ((this.upcomingTransType = e),
  23513. (this.activeTransType = null),
  23514. !this.setWarpDestPano())
  23515. )
  23516. return (this.upcomingTransType = null), void this.warpToNonPano(n);
  23517. if (this.player.mode !== a.PANORAMA)
  23518. return (
  23519. (this.upcomingTransType = null),
  23520. this.discardSlow(),
  23521. void this.player.flyToNewMode({
  23522. mode: a.PANORAMA,
  23523. pano: this.warpDestPano,
  23524. duration: c.warp.outsideTime,
  23525. warpDest: this.warpDestHeroLoc,
  23526. callback: n,
  23527. force: !0,
  23528. })
  23529. );
  23530. if (!this.warpDestPano)
  23531. return (
  23532. y.warn('no warp destination, callback dropped'),
  23533. void (this.upcomingTransType = null)
  23534. );
  23535. var r = !(
  23536. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  23537. this.warpDestPano !== this.player.currentPano &&
  23538. this.warpDestPano.position.distanceTo(this.player.currentPano.position) <
  23539. c.warp.nearPanoDist
  23540. ),
  23541. o = this.chooseWarpPath(r);
  23542. if (o && this.upcomingTransType !== l.WALK) {
  23543. var s = function () {
  23544. (this.waitingToWarp = !1), this.warpToPano(e, t, i, n);
  23545. }.bind(this);
  23546. if (
  23547. this.player.checkAndWaitForPanoLoad(
  23548. this.warpDestPano,
  23549. 'high',
  23550. 'low',
  23551. this.player.basePanoSize,
  23552. s
  23553. )
  23554. )
  23555. return void (this.waitingToWarp = !0);
  23556. }
  23557. this.player.currentPano ||
  23558. (y.warn('Arrived at a very strange spot!'),
  23559. (this.player.currentPano = this.warpDestPano),
  23560. this.placeCpm(),
  23561. this.fadeOutCpm(c.path.fadeOutTime),
  23562. this.player.spider.draw()),
  23563. y.debug('Warping to pano ', this.warpDestPano.position),
  23564. this.upcomingTransType !== l.WALK &&
  23565. this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  23566. this.startWarpState();
  23567. var h = function () {
  23568. this.endWarpState(), n && n();
  23569. }.bind(this);
  23570. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h);
  23571. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  23572. }),
  23573. (t.exports = n);
  23574. }.call(this, '/js/objects/ShowPath.js'));
  23575. },
  23576. {
  23577. '../constants': 8,
  23578. '../effects': 16,
  23579. '../enum/BlackoutStyle': 18,
  23580. '../enum/ModelManagerEvents': 33,
  23581. '../enum/PlayerEvents': 40,
  23582. '../enum/RenderOrder': 42,
  23583. '../enum/Vectors': 50,
  23584. '../enum/Viewmode': 51,
  23585. '../enum/WarpStyle': 52,
  23586. '../gui/gui': 65,
  23587. '../model/ModelManager': 140,
  23588. '../objects/Snapshot': 153,
  23589. '../settings': 166,
  23590. '../shaders': 167,
  23591. '../util/easing': 186,
  23592. '../util/lerp': 188,
  23593. '../util/logger': 189,
  23594. '../util/math': 190,
  23595. '../util/texture': 194,
  23596. '../util/transitions': 195,
  23597. three: 217,
  23598. },
  23599. ],
  23600. 152: [
  23601. function (e, t, i) {
  23602. 'use strict';
  23603. function n() {
  23604. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  23605. t = new r.RawShaderMaterial({
  23606. fragmentShader: o.skysphere.fragmentShader,
  23607. vertexShader: o.skysphere.vertexShader,
  23608. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  23609. side: r.BackSide,
  23610. name: 'skysphere',
  23611. });
  23612. (t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t);
  23613. }
  23614. var r = e('three'),
  23615. o = e('../shaders'),
  23616. a = e('../settings');
  23617. (n.prototype = Object.create(r.Mesh.prototype)),
  23618. (n.prototype.constructor = n),
  23619. (t.exports = n);
  23620. },
  23621. {
  23622. '../settings': 166,
  23623. '../shaders': 167,
  23624. three: 217,
  23625. },
  23626. ],
  23627. 153: [
  23628. function (e, t, i) {
  23629. (function (i) {
  23630. 'use strict';
  23631. function n(e) {
  23632. o.call(this, e),
  23633. (this.sid = e.sid), //xzw add
  23634. (this.panoId = e.panoId),
  23635. (this.orthoZoom = e.orthoZoom),
  23636. (this.floorVisibility = e.floorVisibility),
  23637. (this.thumbUrl = e.thumbUrl),
  23638. (this.name = e.name),
  23639. (this.zoom = e.zoom);
  23640. }
  23641. var r = (e('three'), e('../util/logger')),
  23642. o =
  23643. (e('../settings'),
  23644. e('../enum/Viewmode'),
  23645. e('../util/common'),
  23646. e('../util/transitions'),
  23647. e('../util/lerp'),
  23648. e('../util/ajax'),
  23649. e('../util/texture'),
  23650. e('./View'));
  23651. e('events').EventEmitter, new r(i);
  23652. (n.prototype = Object.create(o.prototype)),
  23653. (n.prototype.isPano = function () {
  23654. return this.panoId && '' !== this.panoId && this.panoId != 'outside';
  23655. }),
  23656. (t.exports = n);
  23657. }.call(this, '/js/objects/Snapshot.js'));
  23658. },
  23659. {
  23660. '../enum/Viewmode': 51,
  23661. '../settings': 166,
  23662. '../util/ajax': 181,
  23663. '../util/common': 185,
  23664. '../util/lerp': 188,
  23665. '../util/logger': 189,
  23666. '../util/texture': 194,
  23667. '../util/transitions': 195,
  23668. './View': 154,
  23669. events: 202,
  23670. three: 217,
  23671. },
  23672. ],
  23673. 154: [
  23674. function (e, t, i) {
  23675. (function (i) {
  23676. 'use strict';
  23677. function n(e) {
  23678. (e = e || {}),
  23679. (this.position = new r.Vector3()),
  23680. (this.quaternion = new r.Quaternion()),
  23681. this.update(e);
  23682. }
  23683. var r = e('three'),
  23684. o = e('../util/logger'),
  23685. a =
  23686. (e('../settings'),
  23687. e('../enum/Viewmode'),
  23688. e('../util/common'),
  23689. e('../util/transitions'),
  23690. e('../util/lerp'),
  23691. e('../util/ajax'),
  23692. e('../util/texture'),
  23693. e('events').EventEmitter);
  23694. new o(i);
  23695. (n.prototype = Object.create(a.prototype)),
  23696. (n.prototype.isValid = function () {
  23697. return !!this.cameraMode;
  23698. }),
  23699. (n.prototype.update = function (e) {
  23700. return (
  23701. (this.cameraMode = e.cameraMode || this.cameraMode),
  23702. (this.pano = e.pano || this.pano),
  23703. e.position && this.position.copy(e.position),
  23704. e.quaternion && this.quaternion.copy(e.quaternion),
  23705. this
  23706. );
  23707. }),
  23708. (t.exports = n);
  23709. }.call(this, '/js/objects/View.js'));
  23710. },
  23711. {
  23712. '../enum/Viewmode': 51,
  23713. '../settings': 166,
  23714. '../util/ajax': 181,
  23715. '../util/common': 185,
  23716. '../util/lerp': 188,
  23717. '../util/logger': 189,
  23718. '../util/texture': 194,
  23719. '../util/transitions': 195,
  23720. events: 202,
  23721. three: 217,
  23722. },
  23723. ],
  23724. 155: [
  23725. function (e, t, i) {
  23726. //player.js
  23727. (function (i) {
  23728. 'use strict';
  23729. function n(e) {
  23730. (this.currentPano = null),
  23731. (this.nextPano = null),
  23732. (this.camera = null),
  23733. (this.paused = !1),
  23734. (this.flying = !1),
  23735. (this.sceneIntersectionPlane = null),
  23736. (this.target = new r.Vector3()),
  23737. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  23738. (this.mouseAtMouseDown = new r.Vector2()),
  23739. (this.mouseCouldBeClickToMove = !1),
  23740. (this.mouseLastMoveTime = Date.now()),
  23741. (this.mouseDown = !1),
  23742. (this.mouseDownTimer = null),
  23743. (this.couldBeLongTap = !1),
  23744. (this.containsMouse = !1), //
  23745. (this.isTouchEvent = !1),
  23746. (this.isPanoHover = !1),
  23747. (this.reticule = new a(this)),
  23748. (this.panoMarkers = []),
  23749. (this.spider = new h(this)),
  23750. (this.quaternion = new r.Quaternion()),
  23751. (this.position = new r.Vector3(15, 10, 15)),
  23752. (this.previousState = null),
  23753. (this.lastInsideView = new c()),
  23754. (this.last360View = new c()),
  23755. (this.raycaster = new r.Raycaster()),
  23756. (this.intersect = null),
  23757. (this.lastChangeTime = Date.now()),
  23758. (this.history = new I()),
  23759. (this.cameraControls = null),
  23760. (this.path = null),
  23761. (this.model = null),
  23762. (this.domElement = null),
  23763. (this.cachedPanoCandidates = null),
  23764. (this.basePanoSize = 0),
  23765. (this.standardPanoSize = 0),
  23766. (this.highPanoSize = 0),
  23767. (this.ultraHighPanoSize = 0),
  23768. (this.zoomLevel = 1),
  23769. (this.zooming = 0),
  23770. (this.zoomSpeed = 0.5),
  23771. (this.scrollZoomSpeed = 0.06),
  23772. (this.zoomSpeedAdjust = 0.05),
  23773. (this.defaultZoomIncrement = 0.2),
  23774. (this.baseFov = f.insideFOV),
  23775. (this.zoomFov = this.baseFov),
  23776. (this.zoomEnabled = !0),
  23777. (this.preRenderingEnabled = !1),
  23778. this.setupCustomProperties(e),
  23779. (this.zoomStats = new L());
  23780. window.player = this;
  23781. this.modeTran = '';
  23782. }
  23783. var r = e('three'),
  23784. o = e('./util/logger'),
  23785. a = e('./objects/Reticule'),
  23786. s = e('./objects/Panorama'),
  23787. l = e('./objects/ShowPath'),
  23788. c = e('./objects/View'),
  23789. h = (e('./objects/Snapshot'), e('./objects/NSpider')),
  23790. u = e('./enum/Viewmode'),
  23791. d = (e('./enum/TagStates'), e('./enum/Vectors')),
  23792. p = e('./enum/Keys'),
  23793. f = (e('./enum/AlignmentType'), e('./settings')),
  23794. g = e('./util/common'),
  23795. m = (e('./util/browser'), e('./util/math')),
  23796. v = e('./util/lerp'),
  23797. A = e('./util/easing'),
  23798. y = e('./util/transitions'),
  23799. C = e('events').EventEmitter,
  23800. I = (e('./shaders'), e('./util/history')),
  23801. E = (e('./util/camera'), e('./model/ModelManager'), e('./enum/PathDiscardMode')),
  23802. b = e('./enum/PathDisplayMode'),
  23803. w = e('./enum/PlayerEvents'),
  23804. _ = e('./enum/ControlEvents'),
  23805. T = e('./enum/ModelManagerEvents'),
  23806. x = e('./enum/WarpStyle'),
  23807. S = e('./enum/BlackoutStyle'),
  23808. M = e('./exception/BasicException'),
  23809. R = e('./enum/PanoSizeClass'),
  23810. P = (e('./tile/TileDownloader'), e('./tile/TilePrioritizer')),
  23811. O = (e('./enum/PanoramaEvents'), e('./enum/ZoomEvents')),
  23812. L = e('./util/ZoomStats'),
  23813. D = e('./constants'),
  23814. N = e('./util/common'),
  23815. B = e('./util/cameraLight'),
  23816. //, Hot = e('hot')
  23817. F = new o(i),
  23818. V = Object.freeze({
  23819. FlyToPano: y.getUniqueId(),
  23820. FlyToNewMode: y.getUniqueId(),
  23821. FlyToSameMode: y.getUniqueId(),
  23822. FlyToViewFloor: y.getUniqueId(),
  23823. LookTransition: y.getUniqueId(),
  23824. ZoomTransition: y.getUniqueId(),
  23825. });
  23826. (n.prototype = Object.create(C.prototype)),
  23827. (n.prototype.init = function (e) {
  23828. (this.modelManager = e.modelManager),
  23829. (this.tileDownloader = e.tileDownloader),
  23830. (this.panoRenderer = e.panoRenderer),
  23831. (this.qualityManager = e.qualityManager),
  23832. (this.domElement = e.container),
  23833. (this.camera = e.camera),
  23834. (this.tagManager = e.tagManager),
  23835. (this.cameraControls = e.controls),
  23836. (this.path = new l(e.director, this, e.controls)),
  23837. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  23838. (this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD)),
  23839. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  23840. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH)),
  23841. (this.tileDownloader.processPriorityQueue = !1),
  23842. (this.tileDownloader.tilePrioritizer = new P(
  23843. this.qualityManager,
  23844. this.basePanoSize,
  23845. this.standardPanoSize,
  23846. this.highPanoSize,
  23847. this.ultraHighPanoSize
  23848. )),
  23849. this.bindEvents(e.container),
  23850. this.updateModel();
  23851. });
  23852. //xzw add: 截图
  23853. function dataURLtoBlob(dataurl) {
  23854. var arr = dataurl.split(','),
  23855. mime = arr[0].match(/:(.*?);/)[1],
  23856. bstr = atob(arr[1]),
  23857. n = bstr.length,
  23858. u8arr = new Uint8Array(n);
  23859. while (n--) {
  23860. u8arr[n] = bstr.charCodeAt(n);
  23861. }
  23862. return new Blob([u8arr], { type: mime });
  23863. }
  23864. n.prototype.screenShot = function (o) {
  23865. if (this.flying || this.flyingToTag) return;
  23866. var R = this.sceneRenderer;
  23867. R.updateScreenSize(o);
  23868. for (var i in this.model.panos.index) {
  23869. if (!this.model.panos.index[i].marker) continue;
  23870. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  23871. this.model.panos.index[i].marker.visible = false;
  23872. }
  23873. for (var i in this.model.hots) {
  23874. this.model.hots[i].mesh.visible = false;
  23875. }
  23876. this.reticule.visible = false;
  23877. this.reticule.forceUnvisible = true;
  23878. this.path.currentPanoMarker.mesh.visible = false;
  23879. setTimeout(
  23880. function () {
  23881. //因resize效用没办法立即生效(原因未知),故而延后
  23882. R.renderer.clear(true, true, true);
  23883. R.renderer.render(R.scene, R.camera);
  23884. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9);
  23885. o.f && o.f(imgData);
  23886. R.updateScreenSize({ resize: true });
  23887. this.reticule.visible = true;
  23888. for (var i in this.model.hots) {
  23889. this.model.hots[i].mesh.visible = true;
  23890. }
  23891. for (var i in this.model.panos.index) {
  23892. this.model.panos.index[i].marker.visible =
  23893. this.model.panos.index[i].marker.forceHide;
  23894. }
  23895. this.path.currentPanoMarker.mesh.visible = true;
  23896. R.renderer.render(R.scene, R.camera);
  23897. }.bind(this),
  23898. 30
  23899. ); //这个数字不能太小
  23900. };
  23901. var scaleImg = e('scaleImg');
  23902. var ResizeImg = function (img, option) {
  23903. var img2; //不能直接改img 否则可能触发第二次img.onload
  23904. var compress = function (ratio, type) {
  23905. var image = img2 || img;
  23906. var c = document.createElement('canvas');
  23907. c.width = image.width;
  23908. c.height = image.height;
  23909. var ctx = c.getContext('2d');
  23910. ctx.drawImage(image, 0, 0, image.width, image.height);
  23911. img2 = scaleImg(ratio /* option.maxSize/oldSize */, c, type /* option.type||"png" */); //最大不能超过0.8M
  23912. };
  23913. var reCom = function () {
  23914. //如果有了img2 就只需要img2 否则创造新的img2
  23915. var image = img2 || img;
  23916. var blob = dataURLtoBlob(image.src);
  23917. if (option.maxWeight && blob.size > option.maxWeight) {
  23918. compress(option.maxWeight / blob.size, 'jpeg');
  23919. blob = dataURLtoBlob(image.src);
  23920. }
  23921. if (!img2) {
  23922. img2 = new Image();
  23923. }
  23924. img2.base64Src = image.src;
  23925. img2.src = window.URL.createObjectURL(blob);
  23926. };
  23927. var oldSize = Math.max(img.width, img.height);
  23928. if (option.toType != 'png') {
  23929. //不是非要png的话
  23930. if (option.oldType == 'jpeg') {
  23931. //jpeg先判断尺寸,然后是尺寸
  23932. if (oldSize > option.maxSize) {
  23933. compress(option.maxSize / oldSize, 'jpeg');
  23934. }
  23935. reCom();
  23936. } else if (option.oldType == 'png') {
  23937. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  23938. if (option.maxWeight && option.weight > option.maxWeight) {
  23939. //如果一开始大小不大就不压缩 还是png
  23940. compress(oldSize > option.maxSize ? option.maxSize / oldSize : 1, 'jpeg');
  23941. reCom();
  23942. }
  23943. }
  23944. } else {
  23945. //?貌似png会越压缩越大?
  23946. }
  23947. return img2 || img;
  23948. };
  23949. var _fixType = function (type) {
  23950. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  23951. var r = type.match(/png|jpeg|bmp|gif/)[0];
  23952. return 'image/' + r;
  23953. };
  23954. var saveFile = function (data, filename) {
  23955. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  23956. save_link.href = data;
  23957. save_link.download = filename;
  23958. var event = document.createEvent('MouseEvents');
  23959. event.initMouseEvent(
  23960. 'click',
  23961. true,
  23962. false,
  23963. window,
  23964. 0,
  23965. 0,
  23966. 0,
  23967. 0,
  23968. 0,
  23969. false,
  23970. false,
  23971. false,
  23972. false,
  23973. 0,
  23974. null
  23975. );
  23976. save_link.dispatchEvent(event);
  23977. };
  23978. (n.prototype.getWrapShot = function () {
  23979. //获取导览点截图/初始画面和信息
  23980. var info = this.getSnapAngleInfo();
  23981. var str = ',{\r\t' + info;
  23982. var arg = arguments[0];
  23983. this.screenShot({
  23984. width: g_snapShotWidth * 4,
  23985. height: g_snapShotHeight * 4,
  23986. type: 'image/jpeg',
  23987. f: function (imgData) {
  23988. if (arg && arg.__callback) {
  23989. return arg.__callback(imgData, info);
  23990. }
  23991. var img = new Image();
  23992. img.src = imgData;
  23993. img.onload = function () {
  23994. var img2 = ResizeImg(this, { maxSize: g_snapShotWidth, oldType: 'jpeg' }); //暂定缩略图大小
  23995. img2.src.replace(_fixType('image/jpeg'), 'image/octet-stream');
  23996. var filename = 'snap' + new Date().getTime();
  23997. saveFile(img2.src, filename + '.jpg');
  23998. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",';
  23999. str += '\r\t"sid":"' + filename + '",';
  24000. str += '\r\t"name":"' + filename + '"\r}';
  24001. logData(str);
  24002. };
  24003. },
  24004. });
  24005. }),
  24006. (n.prototype.getSnapAngleInfo = function () {
  24007. var info = {};
  24008. var str = '"metadata":{';
  24009. var q = this.camera.quaternion.clone();
  24010. switch (this.mode) {
  24011. case 'panorama':
  24012. info.scan_id = this.currentPano.id;
  24013. str += '"scan_id":"' + this.currentPano.id + '",';
  24014. break;
  24015. case 'floorplan':
  24016. info.camera_mode = 1;
  24017. q = new r.Quaternion().setFromAxisAngle(
  24018. new r.Vector3(0, 1, 0),
  24019. r.Math.degToRad(90)
  24020. );
  24021. q.multiply(this.camera.quaternion);
  24022. str += '"camera_mode":1,';
  24023. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  24024. str +=
  24025. '"ortho_zoom":' +
  24026. m.toPrecision(this.cameraControls.activeControl.currentScale, 4) +
  24027. ',';
  24028. break;
  24029. case 'dollhouse':
  24030. info.camera_mode = 2;
  24031. str += '"camera_mode":2,';
  24032. break;
  24033. }
  24034. info.camera_position = m.toPrecision(this.camera.position.toArray(), 4);
  24035. console.log(info.camera_position);
  24036. if (window.screenSta === 'tour') {
  24037. // fyz 导览截屏需要做额外的
  24038. /**fyz 对相机截屏的角度进行校对 */
  24039. var out = new r.Quaternion(q.x, q.y, q.z, q.w);
  24040. out.multiply(
  24041. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate()
  24042. );
  24043. out.x *= -1;
  24044. out.w *= -1;
  24045. info.camera_quaternion = m.toPrecision(out.toArray(), 4);
  24046. } else {
  24047. info.camera_quaternion = m.toPrecision(q.toArray(), 4);
  24048. }
  24049. info.zoom = this.zoomLevel;
  24050. console.log(info.camera_quaternion);
  24051. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  24052. // fyz 扩展编辑页面, 加上导览点缩放值
  24053. str +=
  24054. '"camera_position":[' +
  24055. info.camera_position +
  24056. '],"camera_quaternion":[' +
  24057. info.camera_quaternion +
  24058. '], "zoom":' +
  24059. info.zoom +
  24060. '}';
  24061. return str;
  24062. });
  24063. //------end
  24064. (n.prototype.setupCustomProperties = function (e) {
  24065. var t = e || u.PANORAMA;
  24066. Object.defineProperty(this, 'mode', {
  24067. get: function () {
  24068. return t;
  24069. },
  24070. set: function (e) {
  24071. var i = t;
  24072. (t = e), this.onModeUpdated(i, t);
  24073. },
  24074. });
  24075. }),
  24076. (n.prototype.isInMode = function () {
  24077. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0;
  24078. return !1;
  24079. }),
  24080. (n.prototype.isOutsideMode = function (e) {
  24081. return (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN;
  24082. }),
  24083. (n.prototype.is360View = function (e, t) {
  24084. return e === u.PANORAMA && t && !t.isAligned();
  24085. }),
  24086. (n.prototype.setScene = function (e) {
  24087. (this.sceneIntersectionPlane = e.plane),
  24088. this.path.setScene(e),
  24089. this.moveReticuleToScene(e);
  24090. }),
  24091. (n.prototype.moveReticuleToScene = function (e) {
  24092. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  24093. e.add(this.reticule);
  24094. }),
  24095. (n.prototype.updateModel = function () {
  24096. function e(e, t, n) {
  24097. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y);
  24098. }
  24099. function t(e, t) {
  24100. if (this.mode === u.DOLLHOUSE) {
  24101. var n = e ? this.model.center.y : (n = t.center.y);
  24102. i.call(this, n);
  24103. }
  24104. }
  24105. function i(e) {
  24106. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  24107. i = this.cameraControls.controls[u.DOLLHOUSE],
  24108. n = t.position.y + (e - i.target.y),
  24109. r = f.showFloorDuration + f.showFloorDelay;
  24110. y.start(
  24111. v.property(i.target, 'y', e),
  24112. r,
  24113. null,
  24114. f.flydown.movementDelay,
  24115. A[f.flydown.movementEasing],
  24116. null,
  24117. V.FlyToViewFloor
  24118. ),
  24119. y.start(
  24120. v.property(t.position, 'y', n),
  24121. r,
  24122. null,
  24123. f.flydown.movementDelay,
  24124. A[f.flydown.movementEasing],
  24125. null,
  24126. V.FlyToViewFloor
  24127. );
  24128. }
  24129. (this.model = this.modelManager.getActiveModel()),
  24130. this.model.on('floor.changed', e.bind(this)),
  24131. this.model.on('allfloors.toggled', t.bind(this)),
  24132. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  24133. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  24134. var e2 = this;
  24135. this.model.panos.list.forEach(function (a) {
  24136. a.vrMarker.addEventListener('click', function () {
  24137. e2.flyToPano({
  24138. pano: a,
  24139. });
  24140. });
  24141. });
  24142. /********************************************************************************************************************************************/
  24143. this.model.addHighMapCube(); //add
  24144. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model));
  24145. }),
  24146. (n.prototype.updateModelDependentData = function () {
  24147. this.cameraControls.setModelForControls(this.model),
  24148. this.getPanoMarkersFromModel(this.model);
  24149. }),
  24150. (n.prototype.onModelChanged = function () {
  24151. this.updateModel(), this.updateModelDependentData();
  24152. }),
  24153. (n.prototype.getPanoMarkersFromModel = function (e) {
  24154. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  24155. return t.marker ? e.concat(t.marker) : e;
  24156. }, []);
  24157. }),
  24158. (n.prototype.handleControlMove = function (e) {
  24159. this.emit(w.Move, e);
  24160. }),
  24161. (n.prototype.handleControlInputStart = function (e) {
  24162. this.emit(w.InputStart, e);
  24163. }),
  24164. (n.prototype.onModeUpdated = function (e, t) {
  24165. this.cameraControls.activateControls(t), this.emit(w.ModeChanged, e, t);
  24166. }),
  24167. (n.prototype.isWarping = function () {
  24168. //是否导览缓慢走向某个点
  24169. return this.path.warping;
  24170. }),
  24171. (n.prototype.isWaitingToWarp = function () {
  24172. return this.path.waitingToWarp;
  24173. }),
  24174. (n.prototype.getLabelScaleFactor = function () {
  24175. if (this.isOutsideMode()) {
  24176. var e = 10,
  24177. t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  24178. return t;
  24179. }
  24180. return 0.5;
  24181. }),
  24182. /* n.prototype.changeMusic = function() {//xzw add
  24183. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  24184. } */
  24185. (n.prototype.bindEvents = function (e) {
  24186. e !== document && e.setAttribute('tabindex', -1),
  24187. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  24188. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  24189. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  24190. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  24191. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  24192. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  24193. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  24194. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  24195. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  24196. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  24197. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  24198. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  24199. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  24200. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  24201. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  24202. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  24203. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  24204. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  24205. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  24206. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)), //xzw add
  24207. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  24208. // lzb
  24209. window.getSeft && getSeft(this);
  24210. }),
  24211. (n.prototype.onMouseDown = function (e) {
  24212. e.currentTarget !== document && e.currentTarget.focus(),
  24213. 0 === e.button &&
  24214. (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  24215. this.updateIntersect());
  24216. }),
  24217. (n.prototype.onMouseMove = function (e) {
  24218. (this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1);
  24219. }),
  24220. (n.prototype.onMouseOver = function (e) {
  24221. (this.containsMouse = !0),
  24222. !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1);
  24223. }),
  24224. (n.prototype.onMouseOut = function (e) {
  24225. this.containsMouse = !1;
  24226. }),
  24227. (n.prototype.onMouseUp = function (e) {
  24228. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  24229. }),
  24230. (n.prototype.onTouchStart = function (e) {
  24231. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  24232. this.couldBeLongTap = !0;
  24233. var t = g.average(e.changedTouches, 'clientX'),
  24234. i = g.average(e.changedTouches, 'clientY');
  24235. this.handleInputStart.call(this, t, i, !0),
  24236. (this.mouseDownTimer = setTimeout(
  24237. function () {
  24238. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0);
  24239. }.bind(this),
  24240. f.input.longTapThreshold
  24241. ));
  24242. }
  24243. }),
  24244. (n.prototype.onTouchMove = function (e) {
  24245. var t = g.average(e.changedTouches, 'clientX'),
  24246. i = g.average(e.changedTouches, 'clientY');
  24247. this.handleInputMove.call(this, t, i, !0);
  24248. }),
  24249. (n.prototype.onTouchEnd = function (e) {
  24250. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  24251. (this.couldBeLongTap = !1), this.updateIntersect();
  24252. var t = g.average(e.changedTouches, 'clientX'),
  24253. i = g.average(e.changedTouches, 'clientY');
  24254. this.handleInputEnd.call(this, t, i, !0);
  24255. }
  24256. //add
  24257. if (this.intersectHot) this.intersectHot.setHoverState(false);
  24258. this.intersectHot = null;
  24259. Hot.mobileAutoPlay(this);
  24260. }),
  24261. (n.prototype.onPointerDown = function (e) {
  24262. return (
  24263. e.currentTarget !== document && e.currentTarget.focus(),
  24264. this.mouseDown || 'mouse' === e.pointerType
  24265. ? this.onMouseDown(e)
  24266. : ((this.couldBeLongTap = !0),
  24267. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  24268. void (this.mouseDownTimer = setTimeout(
  24269. function () {
  24270. this.updateIntersect(),
  24271. this.handleInputEnd.call(this, e.clientX, e.clientY, !0);
  24272. }.bind(this),
  24273. f.input.longTapThreshold
  24274. )))
  24275. );
  24276. }),
  24277. (n.prototype.onPointerMove = function (e) {
  24278. 'mouse' !== e.pointerType
  24279. ? this.handleInputMove.call(this, e.clientX, e.clientY, !0)
  24280. : this.onMouseMove(e);
  24281. }),
  24282. (n.prototype.onPointerUp = function (e) {
  24283. return this.mouseDown && 'mouse' !== e.pointerType
  24284. ? (clearTimeout(this.mouseDownTimer),
  24285. (this.couldBeLongTap = !1),
  24286. this.updateIntersect(),
  24287. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  24288. : this.onMouseUp(e);
  24289. }),
  24290. (n.prototype.onPointerOut = function (e) {
  24291. this.mouseDown = !1;
  24292. }),
  24293. (n.prototype.onPointerCancel = function (e) {
  24294. this.mouseDown = !1;
  24295. }),
  24296. (n.prototype.onKeyDown = function (e) {
  24297. var t = function () {
  24298. this.cameraControls.activeControl &&
  24299. this.cameraControls.activeControl.emit(_.Move, 'key');
  24300. }.bind(this),
  24301. i = e.which;
  24302. switch (i) {
  24303. case p.F:
  24304. t(), this.changeFloor(-1);
  24305. break;
  24306. case p.R:
  24307. t(), this.changeFloor(1);
  24308. }
  24309. if (this.mode === u.PANORAMA)
  24310. switch (i) {
  24311. case p.UPARROW:
  24312. case p.W:
  24313. this.flyLocalDirection(d.FORWARD.clone());
  24314. break;
  24315. case p.DOWNARROW:
  24316. case p.S:
  24317. this.flyLocalDirection(d.BACK.clone());
  24318. break;
  24319. case p.A:
  24320. this.flyLocalDirection(d.LEFT.clone());
  24321. break;
  24322. case p.D:
  24323. this.flyLocalDirection(d.RIGHT.clone());
  24324. }
  24325. }),
  24326. (n.prototype.handleScrollPinchZoom = (function () {
  24327. return function (e) {
  24328. var t = e,
  24329. i = this.zoomLevel;
  24330. this.zoomBy(t),
  24331. this.currentPano &&
  24332. this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id);
  24333. };
  24334. })()),
  24335. (n.prototype.handleControlPinch = function (e) {
  24336. f.zoom.enabled
  24337. ? this.handleScrollPinchZoom(1 - e)
  24338. : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize());
  24339. }),
  24340. (n.prototype.handleControlScroll = function (e) {
  24341. f.zoom.enabled
  24342. ? (e > 0 ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed),
  24343. 0 !== e && this.handleScrollPinchZoom(e))
  24344. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize());
  24345. }),
  24346. (n.prototype.handleInputStart = function (e, t, i) {
  24347. //许钟文加
  24348. var pad = this.handelPadding(e, t);
  24349. e = pad.x;
  24350. t = pad.y;
  24351. (this.isTouchEvent = i),
  24352. m.convertScreenPositionToNDC(e, t, this.mouse),
  24353. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  24354. (this.mouseCouldBeClickToMove = !0),
  24355. (this.mouseDown = !0);
  24356. Hot.mobileAutoPlay(this);
  24357. }),
  24358. (n.prototype.handelPadding = function (x, y) {
  24359. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  24360. if (!this.pad)
  24361. this.pad = {
  24362. x: dom.getOffset('left', $('#player')[0]),
  24363. y: dom.getOffset('top', $('#player')[0]),
  24364. };
  24365. return {
  24366. x: x - this.pad.x,
  24367. y: y - this.pad.y,
  24368. };
  24369. });
  24370. (n.prototype.handleInputMove = function (e, t, i) {
  24371. //许钟文加
  24372. var pad = this.handelPadding(e, t);
  24373. e = pad.x;
  24374. t = pad.y;
  24375. (this.isTouchEvent = i),
  24376. m.convertScreenPositionToNDC(e, t, this.mouse),
  24377. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC &&
  24378. ((this.mouseCouldBeClickToMove = !1),
  24379. (this.couldBeLongTap = !1),
  24380. clearTimeout(this.mouseDownTimer)),
  24381. (this.mouseLastMoveTime = Date.now()),
  24382. this.reticule.move(e, t, i);
  24383. }),
  24384. (n.prototype.handleInputEnd = function (e, t, i) {
  24385. //xzw
  24386. if (
  24387. ((this.isTouchEvent = i),
  24388. (this.mouseDown = !1),
  24389. this.cameraControls.controls[u.PANORAMA].emit('interaction.direct'),
  24390. !i && this.couldBeLongTap)
  24391. )
  24392. return !0;
  24393. if (this.handleLongTap()) return !0;
  24394. if (this.mouseCouldBeClickToMove) {
  24395. if (this.flying)
  24396. return (
  24397. this.path.activeTransType === x.WALK &&
  24398. this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  24399. !0
  24400. );
  24401. //add----
  24402. if (this.checkHotClick())
  24403. //add
  24404. return !0;
  24405. if (this.hoveringPlane) {
  24406. this.clickOverlay(this.hoveringPlane);
  24407. return;
  24408. }
  24409. if (
  24410. (this.cameraControls.activeControl &&
  24411. this.cameraControls.activeControl.emit(
  24412. _.Move,
  24413. this.isTouchEvent ? 'touch' : 'mouse'
  24414. ),
  24415. this.history.invalidate(),
  24416. this.intersect)
  24417. )
  24418. return this.flyToPanoClosestToMouse();
  24419. if (this.mode === u.PANORAMA) {
  24420. var n = this.closestPanoInDirection(this.getMouseDirection());
  24421. return n
  24422. ? this.flyToPano({
  24423. pano: n,
  24424. })
  24425. : this.bump(this.getMouseDirection());
  24426. }
  24427. }
  24428. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode);
  24429. }),
  24430. (n.prototype.handleLongTap = function () {
  24431. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  24432. return (
  24433. this.cameraControls.activeControl &&
  24434. this.cameraControls.activeControl.emit(_.LongTap, 'touch'),
  24435. !0
  24436. );
  24437. }),
  24438. (n.prototype.checktagClick = function () {
  24439. if (this.tagManager.intersectTag) {
  24440. var e = this.isTouchEvent,
  24441. t = this.tagManager.clickedOnTag(e, this);
  24442. return e || t || y.cancelById(V.LookTransition), !0;
  24443. }
  24444. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1;
  24445. }),
  24446. (n.prototype.rankedtagInDirection = function (e, t) {
  24447. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t);
  24448. }),
  24449. (n.prototype.start = function (e) {
  24450. //-------------------
  24451. //-------------------
  24452. var t = e.mode,
  24453. i = e.pano,
  24454. n = e.position,
  24455. rr = e.quaternion,
  24456. o = e.tag,
  24457. a = e.quickstart,
  24458. s = $.Deferred();
  24459. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews();
  24460. var l = this.is360View(t, i);
  24461. return (
  24462. !this.model.outsideAllowed() || l || a
  24463. ? this.startInside(i, n, rr, o, s)
  24464. : this.startOutside(e, s),
  24465. s.done(
  24466. function (e) {
  24467. this.emit(w.Ready, l, e, o);
  24468. }.bind(this)
  24469. ),
  24470. s.promise()
  24471. );
  24472. }),
  24473. (n.prototype.startOutside = function (e, t) {
  24474. var i = e.mode,
  24475. n = e.pano,
  24476. r = e.position,
  24477. o = e.quaternion,
  24478. a = e.zoom,
  24479. s = e.floorVisibility,
  24480. l = e.tag;
  24481. this.emit(w.StartOutside, f[i].transitionTime),
  24482. this.isOutsideMode(i)
  24483. ? (this.model.warpDestFloors(s, !0),
  24484. y.cancelById(V.FlyToViewFloor),
  24485. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  24486. t.resolve(!1))
  24487. : this.startInsideWithFlyin(n, r, o, l, t);
  24488. }),
  24489. (n.prototype.startInside = function (e, t, i, n, r) {
  24490. (r = r || $.Deferred()), (this.currentPano = e);
  24491. window.bus.dispatchEvent({ type: 'playerAndModelReady' });
  24492. this.ready = true;
  24493. var o = e && !e.isAligned();
  24494. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  24495. var a = this.startInside.bind(this, e, t, i, n, r);
  24496. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return;
  24497. }
  24498. //add
  24499. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 });
  24500. //this.updateHotVisible()
  24501. Hot.updateVisibles([this.currentPano]);
  24502. this.modeTran = 'panorama-panorama';
  24503. return (
  24504. (this.mode = u.PANORAMA),
  24505. e.floor.enter(this.mode),
  24506. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  24507. this.switchCameraMode(this.mode, i),
  24508. this.emit(w.StartInside, o),
  24509. r.resolve(!0),
  24510. r
  24511. );
  24512. }),
  24513. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  24514. if (((r = r || $.Deferred()), this.dollhouseMode(), !e))
  24515. return (
  24516. F.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'),
  24517. r.resolve(!1),
  24518. r
  24519. );
  24520. t = t || e.position;
  24521. var o = i || this.cameraControls.activeControl.camera.quaternion,
  24522. a = e.position;
  24523. return (
  24524. this.fitDollhouse(a, t, o),
  24525. setTimeout(
  24526. function (t) {
  24527. this.cameraControls.activeControl &&
  24528. (this.cameraControls.activeControl.maxDistance = t);
  24529. var n = {
  24530. mode: u.PANORAMA,
  24531. pano: e,
  24532. quaternion: i,
  24533. callback: function () {
  24534. this.emit(w.FlyinFinished), r.resolve(!0);
  24535. }.bind(this),
  24536. };
  24537. this.flyToNewMode(n);
  24538. }.bind(this, this.cameraControls.activeControl.maxDistance),
  24539. f.startupFlyinDelay
  24540. ),
  24541. r
  24542. );
  24543. }),
  24544. (n.prototype.checkAndWaitForPanoLoad = (function () {
  24545. var e = {},
  24546. t = {},
  24547. i = 5e3,
  24548. n = function () {
  24549. for (var n in e)
  24550. if (e.hasOwnProperty(n) && e[n]) {
  24551. var r = performance.now() - t[n];
  24552. if (r < i) return !0;
  24553. }
  24554. return !1;
  24555. };
  24556. return function (r, o, a, s, l, c, h, u, d, p) {
  24557. if (n()) return !0;
  24558. var f = function (t, i, n) {
  24559. N.delayOneFrame(
  24560. function () {
  24561. (e[t] = !1), l && l(i, n);
  24562. }.bind(this)
  24563. );
  24564. }.bind(this, r.id),
  24565. g = function (t, i) {
  24566. N.delayOneFrame(
  24567. function () {
  24568. (e[t] = !1), c && c(i);
  24569. }.bind(this)
  24570. );
  24571. }.bind(this, r.id);
  24572. try {
  24573. return (
  24574. (null !== u && void 0 !== u) || (u = !0),
  24575. this.model.supportsTiles
  24576. ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p))
  24577. : (e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u)),
  24578. e[r.id] && (t[r.id] = performance.now()),
  24579. e[r.id]
  24580. );
  24581. } catch (n) {
  24582. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n);
  24583. }
  24584. };
  24585. })()),
  24586. (n.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  24587. if (!e)
  24588. throw new M(
  24589. 'Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.'
  24590. );
  24591. return (
  24592. r &&
  24593. this.model.waitForLoad(e, function () {
  24594. return e.isLoaded(i);
  24595. }),
  24596. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  24597. );
  24598. }),
  24599. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  24600. var e = new r.Vector3();
  24601. return function (t, i, n, r, o, a, s, l) {
  24602. if (!t)
  24603. throw new M(
  24604. 'Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.'
  24605. );
  24606. return (
  24607. e.copy(d.FORWARD),
  24608. this.getDirection(e),
  24609. !t.isLoaded(i) &&
  24610. (a &&
  24611. this.model.waitForLoad(t, function () {
  24612. return t.isLoaded(i);
  24613. }),
  24614. t
  24615. .loadTiledPano(i, e, null, s, l)
  24616. .done(
  24617. function (e, t) {
  24618. n && n(e, t);
  24619. }.bind(this)
  24620. )
  24621. .fail(
  24622. function (e) {
  24623. r && r(e);
  24624. }.bind(this)
  24625. )
  24626. .progress(
  24627. function (e, t, i) {
  24628. o && o(e, t, i);
  24629. }.bind(this)
  24630. ),
  24631. !0)
  24632. );
  24633. };
  24634. })()),
  24635. (n.prototype.switchCameraMode = function (e, t) {
  24636. var i = this.cameraControls.controls[e],
  24637. n = i.camera;
  24638. switch (e) {
  24639. case u.PANORAMA:
  24640. n.position.copy(this.currentPano.position);
  24641. var o = t
  24642. ? d.FORWARD.clone().applyQuaternion(t)
  24643. : this.getDirection().setY(0).normalize();
  24644. i.lookAt(o.add(n.position));
  24645. break;
  24646. case u.DOLLHOUSE:
  24647. /* var a = this.position.clone();
  24648. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  24649. n.position.copy(a),
  24650. i.target.copy(this.target.clone().setY(this.model.center.y));
  24651. break; */
  24652. //for多楼层 且 让模型刚好适应屏幕
  24653. var box = this.model.boundingBox.clone();
  24654. box.applyMatrix4(this.camera.matrixWorld); //将 boundingbox、也就是模型, 转换到当前相机朝向
  24655. var boxSize = box.size(); //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  24656. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  24657. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2)); //根据上面获得的参数得到target到相机的距离
  24658. //console.log(boxSize.x,distance, boxSize.length() / 2)
  24659. distance += boxSize.length() / 2; //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  24660. if (this.mode === u.PANORAMA) {
  24661. i.target.copy(this.model.center);
  24662. var vec = this.getDirection().negate().setY(1).normalize(); //获得朝向
  24663. } else {
  24664. i.target.copy(this.target.clone().setY(this.model.center.y));
  24665. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize();
  24666. }
  24667. vec.multiplyScalar(distance);
  24668. n.position.copy(i.target.clone().add(vec));
  24669. break;
  24670. case u.FLOORPLAN:
  24671. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  24672. i.target.copy(this.model.center).setY(0),
  24673. i.zoomToContain(this.model.size),
  24674. i.rotateToView(this.model.size, this.getDirection());
  24675. }
  24676. i.update(0);
  24677. }),
  24678. (n.prototype.update = (function () {
  24679. var e = (new r.Vector3(), {}),
  24680. t = [];
  24681. return function (i) {
  24682. this.updatePersistentZooming(i),
  24683. this.updateFromControls(i),
  24684. this.getCurrentNodePanos(t);
  24685. if (this.hasChanged(e)) {
  24686. (this.lastChangeTime = Date.now()),
  24687. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  24688. this.emit(w.ViewChanged, e),
  24689. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point);
  24690. }
  24691. if (e.cameraChanged2) {
  24692. //变化要更大些
  24693. }
  24694. if (e.cameraChanged) {
  24695. this.mode == 'panorama' &&
  24696. window.cad &&
  24697. cad.setSign(
  24698. { x: this.position.x, y: this.position.z },
  24699. this.cameraControls.controls.panorama.lon
  24700. );
  24701. /* for(var i in this.model.hots){
  24702. this.model.hots[i].updateTitle(this)
  24703. } */
  24704. Hot.updateHots();
  24705. }
  24706. this.model.supportsTiles &&
  24707. (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  24708. this.updatePreRendering(t),
  24709. this.reticule.update(),
  24710. this.path.update(),
  24711. this.spider.update(),
  24712. this.cachedPanoCandidates &&
  24713. f.navigation.panoScores &&
  24714. this.model.panos.showPanoScores(this.cachedPanoCandidates),
  24715. this.updateControlLocks(),
  24716. this.model.supportsTiles && this.updateZoomPano();
  24717. };
  24718. })()),
  24719. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  24720. var lastMode, lastPano;
  24721. return function(){
  24722. var mode = this.mode;
  24723. var pano = mode == "panorama" ? this.currentPano : "";
  24724. if(mode != "panorama" || pano != lastPano){
  24725. overlay.noBlock = null
  24726. }
  24727. this.overlayGroup.children.forEach((overlay)=>{
  24728. if(overlay.overlayType == "video" ){
  24729. var matrix = overlay.plane.matrixWorld;
  24730. var inSight = false;
  24731. var cameraDir = this.getDirection();
  24732. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  24733. var vertexes = []
  24734. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  24735. for(let i=0; i<4; i++){
  24736. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  24737. vertexes.push(vertex)
  24738. if(overlay.noBlock == null){
  24739. if(!m.ifShelter(vertex)){
  24740. overlay.noBlock = true
  24741. }
  24742. inSight = true; break;
  24743. }else{
  24744. overlay.noBlock = true
  24745. }
  24746. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  24747. inSight = true; break;
  24748. }
  24749. }
  24750. }
  24751. overlay.inSight = inSight
  24752. if(!inSight)overlay.plane.material.map.image.pause()
  24753. else overlay.plane.material.map.image.play()//maybe fail
  24754. }
  24755. })
  24756. lastMode = mode, lastPano = pano
  24757. }
  24758. }() */
  24759. (n.prototype.updatePersistentZooming = function (e) {
  24760. 1 === this.zooming
  24761. ? this.zoomBy(1 + this.zoomSpeed * e)
  24762. : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e);
  24763. }),
  24764. (n.prototype.updateControlLocks = function () {
  24765. this.currentPano &&
  24766. this.model.supportsTiles &&
  24767. (this.cameraControls.controls[u.PANORAMA].locked =
  24768. !this.currentPano.highestFullTileRenderOpCompleted &&
  24769. this.currentPano.lockUntilRenderingComplete);
  24770. }),
  24771. (n.prototype.updatePanoRenderer = (function () {
  24772. var e = new r.Vector3();
  24773. return function (t) {
  24774. var i = this.nextPano || this.currentPano;
  24775. this.panoRenderer.hasQueuedTiles() &&
  24776. i &&
  24777. (e.copy(d.FORWARD), this.getDirection(e), this.panoRenderer.updateDirection(e));
  24778. };
  24779. })()),
  24780. (n.prototype.cleanupInactivePanos = (function () {
  24781. var e = [],
  24782. t = [];
  24783. return function () {
  24784. (e.length = 0),
  24785. e.push(this.currentPano),
  24786. this.nextPano && e.push(this.nextPano),
  24787. (t.length = 0);
  24788. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  24789. t.push(this.panoRenderer.activePanos[i]);
  24790. for (var n = 0; n < t.length; n++) {
  24791. for (var r = t[n], o = !0, a = 0; a < e.length; a++) r.id === e[a].id && (o = !1);
  24792. o && r.exit();
  24793. }
  24794. };
  24795. })()),
  24796. (n.prototype.updatePreRendering = (function () {
  24797. var e = {};
  24798. return function (t) {
  24799. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  24800. var i = this.nextPano || this.currentPano;
  24801. if (i && t && t.length > 1) {
  24802. var n = t.findIndex(function (e) {
  24803. if (e.id === i.id) return !0;
  24804. });
  24805. if (n >= 0 && n + 1 < t.length) {
  24806. var r = t[n + 1];
  24807. r.isLoaded(this.basePanoSize) ||
  24808. e[r.id] ||
  24809. (window.setTimeout(
  24810. function (t) {
  24811. this.checkAndWaitForPanoLoad(
  24812. t,
  24813. 'high',
  24814. 'low',
  24815. this.basePanoSize,
  24816. null,
  24817. null,
  24818. null,
  24819. !1,
  24820. !1,
  24821. !1
  24822. ),
  24823. window.setTimeout(
  24824. function (t) {
  24825. e[t.id] = !1;
  24826. }.bind(this, t),
  24827. f.tiling.panoPreRenderRepeatDelay
  24828. );
  24829. }.bind(this, r),
  24830. f.tiling.panoPreRenderDelay
  24831. ),
  24832. (e[r.id] = !0));
  24833. }
  24834. }
  24835. }
  24836. };
  24837. })()),
  24838. (n.prototype.enablePreRendering = function () {
  24839. this.preRenderingEnabled = !0;
  24840. }),
  24841. (n.prototype.disablePreRendering = function () {
  24842. (this.preRenderingEnabled = !1), this.cleanupInactivePanos();
  24843. }),
  24844. (n.prototype.updateTileDownloader = (function () {
  24845. var e = new r.Vector3();
  24846. return function (t) {
  24847. var i = this.nextPano || this.currentPano;
  24848. i &&
  24849. (e.copy(d.FORWARD),
  24850. this.getDirection(e),
  24851. this.tileDownloader.tilePrioritizer.updateCriteria(
  24852. i,
  24853. this.position,
  24854. e,
  24855. t.length > 0 ? t : null
  24856. ),
  24857. (this.tileDownloader.processPriorityQueue = !0));
  24858. };
  24859. })()),
  24860. (n.prototype.updateFromControls = function (e) {
  24861. (null !== e && void 0 !== e) || (e = 0),
  24862. this.cameraControls.activeControl &&
  24863. (this.cameraControls.activeControl.update(e),
  24864. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  24865. this.position.copy(this.cameraControls.activeControl.camera.position),
  24866. this.target.copy(this.cameraControls.activeControl.target),
  24867. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  24868. this.camera.projectionMatrix.copy(
  24869. this.cameraControls.activeControl.camera.projectionMatrix
  24870. )),
  24871. this.camera.position.copy(this.position),
  24872. this.camera.quaternion.copy(this.quaternion),
  24873. this.camera.updateMatrix(),
  24874. this.camera.updateMatrixWorld();
  24875. }),
  24876. (n.prototype.hasChanged = function (e) {
  24877. /* if (!this.previousState)
  24878. return this.previousState = {
  24879. allFloorsVisible: this.model.allFloorsVisible,
  24880. position: this.position.clone(),
  24881. quaternion: this.quaternion.clone(),
  24882. mouse: this.mouse.clone(),
  24883. labelScaleFactor: this.getLabelScaleFactor(),
  24884. currentFloor: this.model.currentFloor,
  24885. projectionMatrix: this.camera.projectionMatrix.clone(),
  24886. worldMatrix: this.camera.matrixWorld.clone(),
  24887. mode: this.mode,
  24888. modelPosition: this.model.position.clone(),
  24889. modelCenter: this.model.center.clone(),
  24890. zoomLevel: this.zoomLevel
  24891. },
  24892. !0;
  24893. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  24894. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  24895. e.moved = !this.position.equals(this.previousState.position),
  24896. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  24897. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  24898. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  24899. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  24900. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  24901. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  24902. e.modeChanged = this.mode !== this.previousState.mode,
  24903. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  24904. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  24905. e.nextPanoActive = null !== this.nextPano,
  24906. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  24907. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  24908. this.previousState.position.copy(this.position),
  24909. this.previousState.quaternion.copy(this.quaternion),
  24910. this.previousState.mouse.copy(this.mouse),
  24911. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  24912. this.previousState.currentFloor = this.model.currentFloor,
  24913. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  24914. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  24915. this.previousState.mode = this.mode,
  24916. this.previousState.modelPosition.copy(this.model.position),
  24917. this.previousState.modelCenter.copy(this.model.center),
  24918. this.previousState.zoomLevel = this.zoomLevel,
  24919. !t */
  24920. if (!this.previousState) {
  24921. this.previousState = {
  24922. allFloorsVisible: this.model.allFloorsVisible,
  24923. position: this.position.clone(),
  24924. quaternion: this.quaternion.clone(),
  24925. mouse: this.mouse.clone(),
  24926. //labelScaleFactor: this.getLabelScaleFactor(),
  24927. currentFloor: this.model.currentFloor,
  24928. projectionMatrix: this.camera.projectionMatrix.clone(),
  24929. worldMatrix: this.camera.matrixWorld.clone(),
  24930. mode: this.mode,
  24931. modelPosition: this.model.position.clone(),
  24932. modelCenter: this.model.center.clone(),
  24933. zoomLevel: this.zoomLevel,
  24934. };
  24935. e.cameraChanged = e.cameraChanged2 = true;
  24936. return !0;
  24937. }
  24938. //许钟文改 分成相机是否改变cameraChanged 和其他
  24939. var a =
  24940. this.position.equals(this.previousState.position) &&
  24941. this.quaternion.equals(this.previousState.quaternion) &&
  24942. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  24943. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  24944. this.mode === this.previousState.mode &&
  24945. this.zoomLevel === this.previousState.zoomLevel &&
  24946. this.model.center.equals(this.previousState.modelCenter) &&
  24947. this.model.position.equals(this.previousState.modelPosition);
  24948. var t =
  24949. a &&
  24950. this.mouse.equals(this.previousState.mouse) &&
  24951. this.model.allFloorsVisible ===
  24952. this.previousState
  24953. .allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  24954. this.model.currentFloor === this.previousState.currentFloor &&
  24955. null === this.nextPano;
  24956. e.cameraChanged = !a;
  24957. if (e.cameraChanged) {
  24958. //
  24959. e.cameraChanged2 =
  24960. !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) ||
  24961. !MathLight.closeTo(this.position, this.previousState.position, 4) ||
  24962. !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix);
  24963. } else e.cameraChanged2 = false;
  24964. (e.allFloorsVisible =
  24965. this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  24966. (e.moved = !this.position.equals(this.previousState.position)),
  24967. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  24968. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  24969. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  24970. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  24971. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(
  24972. this.previousState.projectionMatrix
  24973. )),
  24974. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(
  24975. this.previousState.worldMatrix
  24976. )),
  24977. (e.modeChanged = this.mode !== this.previousState.mode),
  24978. (e.modelPositionChanged = !this.model.position.equals(
  24979. this.previousState.modelPosition
  24980. )),
  24981. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  24982. (e.nextPanoActive = null !== this.nextPano),
  24983. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel),
  24984. (this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  24985. this.previousState.position.copy(this.position),
  24986. this.previousState.quaternion.copy(this.quaternion),
  24987. this.previousState.mouse.copy(this.mouse),
  24988. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  24989. (this.previousState.currentFloor = this.model.currentFloor),
  24990. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  24991. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  24992. (this.previousState.mode = this.mode),
  24993. this.previousState.modelPosition.copy(this.model.position),
  24994. this.previousState.modelCenter.copy(this.model.center),
  24995. (this.previousState.zoomLevel = this.zoomLevel);
  24996. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  24997. return !t;
  24998. }),
  24999. (n.prototype.updateIntersect = function () {
  25000. var e = this.flying || this.isWarping(),
  25001. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  25002. i = y.getById(V.LookTransition),
  25003. n = !(e || t || this.isTouchEvent || (i.length && i[0].running));
  25004. {
  25005. //clear:
  25006. if (this.intersectHot) this.intersectHot.setHoverState(false);
  25007. this.intersectHot = null;
  25008. $('#player').css('cursor', '');
  25009. }
  25010. var deal = () => {
  25011. if (this.intersect && this.intersect.object.visible) {
  25012. if ('hotSprite' == this.intersect.object.type) {
  25013. this.intersectHot = this.intersect.object;
  25014. while (!(this.intersectHot instanceof Hot)) {
  25015. this.intersectHot = this.intersectHot.parent;
  25016. }
  25017. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass(
  25018. 'active'
  25019. );
  25020. this.intersectHot.setHoverState(true);
  25021. }
  25022. }
  25023. };
  25024. if (this.model.hotGroup) {
  25025. var hots = this.model.hotGroup.children.filter(
  25026. (e) =>
  25027. e.info.actionType.examine ||
  25028. e.info.actionType.fastTran ||
  25029. e.info.actionType.openHot ||
  25030. e.info.actionType.playAndPause
  25031. );
  25032. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  25033. if (this.intersect) {
  25034. deal();
  25035. this.intersectHot && $('#player').css('cursor', 'pointer');
  25036. }
  25037. }
  25038. (this.intersect = this.getMouseIntersect()),
  25039. this.intersect && this.updateClosestPano(this.intersect),
  25040. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  25041. ? (this.reticule.updatePosition(this.position, this.intersect),
  25042. f.navigation.panoScores &&
  25043. !f.navigation.mouseDirection &&
  25044. this.closestPanoInDirection(this.getDirection()))
  25045. : this.reticule.hide();
  25046. }),
  25047. (n.prototype.checkHotClick = function () {
  25048. if (this.intersectHot) {
  25049. if (
  25050. this.intersectHot.texType == 'video' &&
  25051. this.intersectHot.info.actionType.playAndPause
  25052. ) {
  25053. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser);
  25054. }
  25055. this.intersectHot.examine(this);
  25056. return true;
  25057. }
  25058. }),
  25059. (n.prototype.getMouseDirection = function (e) {
  25060. e = e || this.mouse;
  25061. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  25062. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera);
  25063. return i.sub(t).normalize();
  25064. }),
  25065. (n.prototype.hoverOverlay = function (mesh) {
  25066. if (!mesh) {
  25067. this.hoveringPlane = null;
  25068. $('#player').css('cursor', this.currentCursor || '');
  25069. } else {
  25070. var overlay = mesh.parent;
  25071. $('#player').css('cursor', 'pointer');
  25072. this.hoveringPlane = overlay;
  25073. return true;
  25074. }
  25075. }),
  25076. (n.prototype.clickOverlay = function (overlay) {
  25077. if (this.openOverlay && !overlay) return;
  25078. var plane = overlay.plane;
  25079. /* if(overlay.overlayType == "video"){
  25080. if(plane.material.map.image.paused) plane.material.map.image.play()
  25081. else plane.material.map.image.pause()
  25082. } */
  25083. if (overlay.overlayType == 'video') {
  25084. overlay.switchPlay(!!overlay.pausedByUser);
  25085. }
  25086. /* if(window.EditOverlay &&EditOverlay.editing){
  25087. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  25088. $('#overlayProp').removeClass('atRight').removeClass('hide')
  25089. EditOverlay.endAddPlane();
  25090. EditOverlay.updateOverlayPanel(overlay)
  25091. EditOverlay.controlSelectOverlay(overlay)
  25092. return;
  25093. } */
  25094. }),
  25095. (n.prototype.getMouseIntersect = function (e, t) {
  25096. //xzw change
  25097. (e = e || this.mouse.clone()),
  25098. (t =
  25099. t ||
  25100. this.model.floors.reduce(
  25101. function (e, t) {
  25102. return t.hidden ? e : e.concat(t.collider.children);
  25103. },
  25104. this.mode === u.PANORAMA ? this.panoMarkers : []
  25105. ));
  25106. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  25107. this.raycaster.set(i, this.getMouseDirection(e));
  25108. var n = this.raycaster.intersectObjects(t, true); //add true
  25109. var o = n[0];
  25110. if (o) {
  25111. o.face &&
  25112. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  25113. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  25114. this.currentPano
  25115. ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height)
  25116. : (o.onFloor = o.point.y < this.position.y - 0.5),
  25117. (o.horizontal = 0.8 < o.normal.y));
  25118. return o;
  25119. }
  25120. }),
  25121. (n.prototype.updateClosestPano = function (e) {
  25122. var t = [s.filters.isPanoAligned()];
  25123. if (this.mode === u.PANORAMA) {
  25124. if (!this.currentPano) return;
  25125. t.push(s.filters.not(this.currentPano)),
  25126. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  25127. t.push(
  25128. s.filters.inFloorDirection(
  25129. this.currentPano.floorPosition,
  25130. this.getDirection(),
  25131. 0.25
  25132. )
  25133. ),
  25134. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  25135. t.push(s.filters.isNotBehindNormal(e.point, e.normal));
  25136. } else {
  25137. t.push(s.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor); //add
  25138. this.mode !== u.FLOORPLAN &&
  25139. t.push(s.filters.inDirection(this.position, this.getDirection(), 0.25));
  25140. }
  25141. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  25142. i !== this.closestPano
  25143. ? (i && (this.isPanoHover = !0),
  25144. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  25145. (this.closestPano = i))
  25146. : (this.isPanoHover = !1);
  25147. }),
  25148. (n.prototype.dollhouseMode = function (e, t) {
  25149. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  25150. (this.mode = u.DOLLHOUSE),
  25151. this.cameraControls.controls[u.DOLLHOUSE].reset();
  25152. var i = new r.Vector3(this.model.center.x, 0, this.model.center.z),
  25153. n = new r.Vector3(15, 10, 15);
  25154. if (e && t) {
  25155. var o = d.FORWARD.clone().applyQuaternion(t),
  25156. a = this.model.center.clone().sub(e),
  25157. s = a.dot(o);
  25158. s > 0
  25159. ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e))
  25160. : F.warn(
  25161. "Tried to initiate dollhouse mode that wasn't looking at the model",
  25162. e,
  25163. t
  25164. );
  25165. }
  25166. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  25167. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  25168. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  25169. this.updateFromControls(),
  25170. (this.model.alpha = 1),
  25171. (this.model.skybox.material.uniforms.opacity.value = 0);
  25172. }),
  25173. (n.prototype.insideMode = function (e, t) {
  25174. var i = $.Deferred(),
  25175. n = t || null;
  25176. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  25177. var r = [s.filters.isPanoAligned()];
  25178. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  25179. (e =
  25180. e ||
  25181. this.currentPano ||
  25182. this.model.panos.find(r, [
  25183. s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target),
  25184. ])),
  25185. this.flyToNewMode({
  25186. mode: u.PANORAMA,
  25187. pano: e,
  25188. callback: n,
  25189. })
  25190. .done(i.resolve.bind(i))
  25191. .fail(i.reject.bind(i));
  25192. } else {
  25193. var o =
  25194. this.mode === u.PANORAMA
  25195. ? 'Already in panorama mode'
  25196. : 'Cannot change mode during mode transition';
  25197. i.reject(o);
  25198. }
  25199. return i.promise();
  25200. }),
  25201. (n.prototype.fitDollhouse = function (e, t, i) {
  25202. //许钟文改 飞入前寻找和初始视角最合适的位置
  25203. //if(urlHasValue('oldEntry')){
  25204. //搬自一代。
  25205. var maxY = this.model.boundingBox.max.y;
  25206. var n = d.FORWARD.clone().applyQuaternion(i),
  25207. i = n.clone().add(e);
  25208. this.cameraControls.activeControl.target.copy(i),
  25209. this.cameraControls.activeControl.camera.position
  25210. .set(0, maxY * 2.4, 0)
  25211. .add(e)
  25212. .add(n.multiplyScalar(-10));
  25213. //return;
  25214. /* //this.camera.position.copy(this.model.center);
  25215. //this.camera.updateMatrixWorld()
  25216. this.switchCameraMode("dollhouse", i) */
  25217. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  25218. //直接用一代的这个 效果和二代几乎一样,且不会甩
  25219. /* var n = d.FORWARD.clone().applyQuaternion(i);
  25220. this.cameraControls.activeControl.target.copy(n).add(e);
  25221. var o = d.RIGHT.clone().applyQuaternion(i)
  25222. , a = d.UP.clone()
  25223. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  25224. , l = this.model.boundingBox.max.clone()
  25225. , c = this.model.boundingBox.min.clone()
  25226. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  25227. , u = 0
  25228. , p = 0
  25229. , g = 0;
  25230. h.forEach(function(e, t, i) {
  25231. var n = Math.abs(e.dot(o))
  25232. , r = e.dot(s);
  25233. n > u && (u = n,
  25234. p = r),
  25235. r > g && (g = r)
  25236. });
  25237. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  25238. , v = s.clone().multiplyScalar(p).add(t)
  25239. , A = s.clone().multiplyScalar(g).add(t);
  25240. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  25241. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  25242. p = Math.max(p, 10),
  25243. g = Math.max(g, 10);
  25244. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  25245. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  25246. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  25247. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  25248. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  25249. */
  25250. }),
  25251. (n.prototype.floorplanMode = function (e, t, i) {
  25252. this.mode = u.FLOORPLAN;
  25253. var n = this.cameraControls.controls[u.FLOORPLAN];
  25254. n.reset();
  25255. var r = e ? e : this.model.center;
  25256. if (
  25257. (n.target.copy(r).setY(0),
  25258. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  25259. i
  25260. ? ((n.currentScale = i / ($('#player').width() / $('#player').height())),
  25261. (n.absoluteScale = n.currentScale))
  25262. : n.zoomToContain(this.model.size),
  25263. t)
  25264. ) {
  25265. var o = d.LEFT.clone().applyQuaternion(t);
  25266. n.rotateLeft(-Math.atan2(o.x, o.z));
  25267. } else n.rotateToView(this.model.size, this.getDirection());
  25268. n.update(0);
  25269. }),
  25270. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  25271. return (e.skipWarpingCheck = !0), this.flyToPano(e, t);
  25272. }),
  25273. (n.prototype.updateMarkerVisi = function () {
  25274. //加
  25275. if (this.mode != 'panorama') return;
  25276. this.model.panos.list.forEach((pano) => {
  25277. if (!pano.marker) return;
  25278. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  25279. });
  25280. }),
  25281. /* n.prototype.updateHotVisible = function(pano){
  25282. var hots = this.model.hots;
  25283. pano = pano || this.currentPano;
  25284. for (var index in hots){
  25285. var visible;
  25286. if(this.mode != "panorama"){
  25287. visible = true;
  25288. }else{
  25289. //hots[index].mesh.material.depthTest = false;
  25290. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  25291. }
  25292. hots[index].mesh.visible = visible;
  25293. }
  25294. } */
  25295. (n.prototype.flyToPano = function (e, t) {
  25296. var i = e.pano,
  25297. aim = e.lookAtPoint,
  25298. aimQua = e.quaternion, //ADD
  25299. o = e.duration,
  25300. a = e.aimDuration,
  25301. s = e.maxDistanceOverride,
  25302. l = e.skipWarpingCheck,
  25303. c = e.constantMoveSpeed,
  25304. h = null,
  25305. p = null;
  25306. if (aim) {
  25307. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP);
  25308. aimQua = new r.Quaternion().setFromRotationMatrix(_);
  25309. } else aimQua = aimQua;
  25310. var zoomLevel = e.zoomLevel || 1; //add
  25311. if (this.flying) return t && t(e);
  25312. window.specialScene &&
  25313. specialScene.special().specifySpot &&
  25314. specialScene.special().specifySpot(i);
  25315. if (
  25316. this.isWarping() &&
  25317. !l &&
  25318. (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD)
  25319. )
  25320. return F.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1;
  25321. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  25322. var m;
  25323. void this.flyToNewMode({
  25324. mode: u.PANORAMA,
  25325. pano: i,
  25326. duration: o,
  25327. quaternion: aimQua,
  25328. callback: t,
  25329. });
  25330. }
  25331. if (
  25332. !i ||
  25333. ((h = g.deepExtend(e)),
  25334. (p = function () {
  25335. N.delayOneFrame(
  25336. function () {
  25337. this.flyToPano(h, t);
  25338. }.bind(this)
  25339. );
  25340. }.bind(this)),
  25341. !this.checkAndWaitForPanoLoad(i, 'high', 'low', this.basePanoSize, p))
  25342. ) {
  25343. var C = function (e) {
  25344. t && t(e);
  25345. }.bind(this);
  25346. this.currentPano ||
  25347. ((this.currentPano = i),
  25348. this.path.placeCpm(),
  25349. this.path.fadeOutCpm(f.path.fadeOutTime),
  25350. this.spider.draw());
  25351. var I = o;
  25352. if ('number' != typeof o) {
  25353. var E = s || f.transition.flytimeMaxDistanceThreshold;
  25354. I =
  25355. Math.min(this.currentPano.position.distanceTo(i.position), E) *
  25356. f.transition.flytimeDistanceMultiplier +
  25357. f.transition.flyTime;
  25358. }
  25359. if (
  25360. (f.transition.flySpeed > 0.01 &&
  25361. (I =
  25362. (1e3 * this.currentPano.position.distanceTo(i.position)) /
  25363. f.transition.flySpeed),
  25364. zoomLevel !== this.zoomLevel)
  25365. )
  25366. switch (f.zoom.transitionStyle) {
  25367. case 1:
  25368. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  25369. break;
  25370. case 2:
  25371. return (
  25372. (h = g.deepExtend(e)),
  25373. (p = this.flyToPano.bind(this, h, t)),
  25374. void this.smoothZoomFovTo(
  25375. null,
  25376. zoomLevel,
  25377. f.zoom.restoreTime * (this.zoomLevel - 1),
  25378. p
  25379. )
  25380. );
  25381. }
  25382. if (aimQua) {
  25383. y.cancelById(V.LookTransition), (I *= f.transition.aimSlowFactor);
  25384. var b = this.cameraControls.activeControl.camera.quaternion.clone(),
  25385. S = b.clone(),
  25386. M = new r.Vector3();
  25387. if (i === this.currentPano) {
  25388. var R = d.FORWARD.clone().applyQuaternion(b),
  25389. P = d.FORWARD.clone().applyQuaternion(aimQua),
  25390. O = R.angleTo(P);
  25391. return (
  25392. (void 0 !== a && null !== a) ||
  25393. (a = ((1 * Math.sqrt(O)) / f.tags.navigate.rotateSpeedFactor) * 1e3),
  25394. void y.start(
  25395. function (e) {
  25396. S.copy(b),
  25397. v.quaternion(S, aimQua)(e),
  25398. M.copy(d.FORWARD)
  25399. .applyQuaternion(S)
  25400. .add(this.cameraControls.activeControl.camera.position),
  25401. this.cameraControls.activeControl.lookAt(M);
  25402. }.bind(this),
  25403. a,
  25404. C,
  25405. 0,
  25406. A[f.transition.movementEasing],
  25407. null,
  25408. V.LookTransition
  25409. )
  25410. );
  25411. }
  25412. }
  25413. if (i === this.currentPano) return void C();
  25414. this.flying = !0;
  25415. var L = this.position.clone(),
  25416. D = this.currentPano;
  25417. F.debug('Flying to pano ', i.position),
  25418. this.emit(w.PanoChosen, this.currentPano, i),
  25419. this.emit(w.FlyingStarted, i.position, L, i, D);
  25420. //---------before fly--------------- add
  25421. //this.updateHotVisible(i); //更新热点显示
  25422. this.transitionPos({ type: 'beforeFlytopano', pano: i, dur: I }); //add
  25423. Hot.updateVisibles([this.currentPano, i]);
  25424. //地标变化
  25425. if (this.model.floorLogos) {
  25426. this.model.changefloorLogoOpa({ index: 0, opa: 0, dur: p, delay: 0.7 }); //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  25427. this.model.floorLogos[1].position.copy(
  25428. i.floorPosition.clone().sub(this.model.position)
  25429. );
  25430. //this.model.adjustfloorLogoHeight();
  25431. this.model.floorLogos[1].material.opacity = 0; //uniforms.opacity.value = 0;
  25432. this.model.floorLogos[1].visible = true;
  25433. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }); //this.model.floorLogoShow(1,250);
  25434. }
  25435. //=======================================
  25436. this.nextPano = i;
  25437. let beginTran = () => {
  25438. aimQua &&
  25439. y.start(
  25440. function (e) {
  25441. S.copy(b),
  25442. v.quaternion(S, aimQua)(e),
  25443. M.copy(d.FORWARD)
  25444. .applyQuaternion(S)
  25445. .add(this.cameraControls.activeControl.camera.position),
  25446. this.cameraControls.activeControl.lookAt(M);
  25447. }.bind(this),
  25448. I,
  25449. null,
  25450. 0,
  25451. A[f.transition.movementEasing],
  25452. null,
  25453. V.LookTransition
  25454. );
  25455. var B = c ? null : A[f.transition.movementEasing];
  25456. y.start(
  25457. v.uniform(this.model.skybox, 'progress', 1),
  25458. I,
  25459. null,
  25460. 0,
  25461. A[f.transition.blendEasing],
  25462. 'skyFly',
  25463. V.FlyToPano
  25464. ),
  25465. y.start(
  25466. v.allUniforms(this.model.chunks, 'progress', 1),
  25467. I,
  25468. null,
  25469. 0,
  25470. A[f.transition.blendEasing],
  25471. 'chunkFly',
  25472. V.FlyToPano
  25473. ),
  25474. y.start(
  25475. v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position),
  25476. I,
  25477. function (e) {
  25478. (this.flying = !1),
  25479. this.currentPano !== i && this.currentPano.exit(),
  25480. i.enter(),
  25481. (this.currentPano = i),
  25482. (this.nextPano = null),
  25483. this.path.placeCpm(),
  25484. this.path.fadeOutCpm(f.path.fadeOutTime),
  25485. this.spider.draw(),
  25486. this.emit(w.FlyingEnded, i.position, L, i, D),
  25487. this.updateMarkerVisi(), //add
  25488. C(e);
  25489. //add:
  25490. if (this.mode == 'panorama') {
  25491. if (this.model.floorLogos) {
  25492. this.model.floorLogos[0].position.copy(
  25493. this.model.floorLogos[1].position
  25494. );
  25495. //this.model.adjustfloorLogoHeight()
  25496. this.model.changefloorLogoOpa({ index: 0, opa: 1, dur: 0 }); //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  25497. this.model.floorLogos[1].visible = false;
  25498. }
  25499. this.model.fadePanoMarkers(); //add
  25500. Hot.updateVisibles([this.currentPano]); //add
  25501. }
  25502. }.bind(this),
  25503. 0,
  25504. B,
  25505. 'camFly',
  25506. V.FlyToPano
  25507. );
  25508. };
  25509. if (!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024) {
  25510. setTimeout(() => {
  25511. beginTran();
  25512. }, 16); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  25513. } else {
  25514. beginTran();
  25515. }
  25516. }
  25517. }),
  25518. (n.prototype.warpToPano = function (o = {}) {});
  25519. n.prototype.blackToPano = function (o = {}) {
  25520. //add 瞬间过渡
  25521. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  25522. if (this.flying || this.isWarping()) return;
  25523. let oldPos = this.position.clone();
  25524. let oldPano = this.currentPano;
  25525. let pano = o.pano || this.model.panos.index[o.panoId];
  25526. this.path.warpDestPano = pano;
  25527. var retry = () => {
  25528. (this.waitingToWarp = !1), this.blackToPano(o);
  25529. };
  25530. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry))
  25531. return void (this.waitingToWarp = !0);
  25532. this.emit('pano.chosen', oldPano, pano);
  25533. this.flying = true;
  25534. this.nextPano = pano; //提前加载高清图片
  25535. this.path.warpDestHeroLoc = {
  25536. panoId: o.panoId,
  25537. position: pano.position,
  25538. quaternion: o.quaternion || this.quaternion.clone(),
  25539. };
  25540. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  25541. pano != this.currentPano && this.currentPano.exit();
  25542. pano.enter();
  25543. this.currentPano = pano;
  25544. this.emit('flying.ended', pano.position, oldPos, pano, oldPano);
  25545. this.flying = false;
  25546. this.nextPano = null;
  25547. this.updateMarkerVisi(); //add
  25548. });
  25549. };
  25550. window._transitionPosId = 9999;
  25551. n.prototype.transitionPos = function (o = {}) {
  25552. //渐变overlay和热点的位置
  25553. y.cancelById(_transitionPosId);
  25554. var begin = function (object, pos, qua, scale) {
  25555. if (pos) {
  25556. if (!same(object.position, pos, 0.01)) {
  25557. y.start(
  25558. v.vector(object.position, pos),
  25559. o.dur,
  25560. (e) => {},
  25561. 0,
  25562. A[f.transition.movementEasing],
  25563. 'transitionPos',
  25564. _transitionPosId
  25565. );
  25566. }
  25567. if (qua && !same(object.quaternion, qua, 1e-6)) {
  25568. y.start(
  25569. v.quaternion(object.quaternion, qua),
  25570. o.dur,
  25571. (e) => {},
  25572. 0,
  25573. A[f.transition.movementEasing],
  25574. 'transitionPos',
  25575. _transitionPosId
  25576. );
  25577. }
  25578. if (scale && !same(object.scale, scale, 0.001)) {
  25579. y.start(
  25580. v.vector(object.scale, scale),
  25581. o.dur,
  25582. (e) => {},
  25583. 0,
  25584. A[f.transition.movementEasing],
  25585. 'transitionPos',
  25586. _transitionPosId
  25587. );
  25588. }
  25589. }
  25590. };
  25591. var same = function (vec1, vec2, diff) {
  25592. var s =
  25593. Math.abs(vec1.x - vec2.x) < diff &&
  25594. Math.abs(vec1.y - vec2.y) < diff &&
  25595. Math.abs(vec1.z - vec2.z) < diff;
  25596. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff;
  25597. return s;
  25598. };
  25599. var sid = o.pano != void 0 ? o.pano.id : 'outside';
  25600. for (let i in this.model.hots) {
  25601. //是否判断visible?
  25602. var hot = this.model.hots[i];
  25603. var panoData = hot.info.transformAtPanos[sid];
  25604. var useCustom = !panoData;
  25605. //if(hot.usingTransformData || !useCustom){
  25606. var pos = useCustom ? hot.info.position : panoData.pos;
  25607. begin(hot, pos /* , qua */);
  25608. //}
  25609. }
  25610. };
  25611. window._tranOutsideFocus = 4399;
  25612. n.prototype.focusPoint = function (o = {}) {
  25613. //当在外时,聚焦相机到这一点
  25614. console.log('focusPoint');
  25615. if (this.mode == 'floorplan') {
  25616. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8); //可视范围
  25617. var control = this.cameraControls.controls.floorplan;
  25618. var absoluteScale = control.getDefaultAbsoluteScale(modelSize);
  25619. var currentScale = control.absoluteScale;
  25620. var currentTarget = control.target.clone();
  25621. y.cancelById(window._tranOutsideFocus, true);
  25622. y.start(
  25623. function (progress) {
  25624. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress);
  25625. control.target = o.aim
  25626. .clone()
  25627. .multiplyScalar(progress)
  25628. .add(currentTarget.clone().multiplyScalar(1 - progress));
  25629. control.camera.position.copy(control.target.clone().add(control.offset)); //维持角度
  25630. }.bind(this),
  25631. o.dur || 600,
  25632. null /* cancelFuc */,
  25633. 0,
  25634. A[f.transition.movementEasing],
  25635. 'outsideFocus',
  25636. window._tranOutsideFocus,
  25637. null /* cancelFuc */
  25638. );
  25639. } else if (player.mode == 'dollhouse') {
  25640. var control = player.cameraControls.controls.dollhouse;
  25641. var radius = o.radius || 8;
  25642. var currentTarget = control.target.clone();
  25643. var dir = control.offset.clone().normalize();
  25644. var currentRadius = control.offset.length();
  25645. y.cancelById(window._tranOutsideFocus, true);
  25646. y.start(
  25647. function (progress) {
  25648. control.target = o.aim
  25649. .clone()
  25650. .multiplyScalar(progress)
  25651. .add(currentTarget.clone().multiplyScalar(1 - progress));
  25652. let radius_ = radius * progress + currentRadius * (1 - progress);
  25653. control.camera.position.copy(
  25654. control.target.clone().add(dir.clone().multiplyScalar(radius_))
  25655. );
  25656. }.bind(this),
  25657. o.dur || 600,
  25658. null /* cancelFuc */,
  25659. 0,
  25660. A[f.transition.movementEasing],
  25661. 'outsideFocus',
  25662. window._tranOutsideFocus,
  25663. null /* cancelFuc */
  25664. );
  25665. } else if (this.mode == 'panorama') {
  25666. this.flyToPano({
  25667. lookAtPoint: o.aim.clone(),
  25668. pano: this.currentPano,
  25669. aimDuration: o.dur || 600,
  25670. });
  25671. }
  25672. };
  25673. /*
  25674. 切换到某个模式后再执行函数
  25675. */
  25676. n.prototype.FlyToMode = function (mode, f1, duration) {
  25677. var f2;
  25678. if (this.mode == mode) {
  25679. f1 && f1();
  25680. } else {
  25681. f2 = f1;
  25682. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  25683. //正飞向其他模式,就要先飞完再飞进来然后执行
  25684. this.afterCModeFuc = function () {
  25685. /* objects.gui.modeChange[mode](null, {
  25686. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  25687. }); */
  25688. this.afterCModeFuc = f2;
  25689. this.flyToNewMode({
  25690. mode: mode,
  25691. pano: mode == 'panorama' && this.currentPano,
  25692. //callback : f2
  25693. });
  25694. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  25695. }.bind(this);
  25696. } else {
  25697. if (this.afterCModeFuc)
  25698. console.log('已经有afterCModeFuc了!!!!!!!!!!!!!!!');
  25699. this.afterCModeFuc = f2; //飞入后执行
  25700. try {
  25701. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  25702. this.flyToNewMode({
  25703. mode: mode,
  25704. pano: mode == 'panorama' && this.currentPano,
  25705. duration: duration,
  25706. });
  25707. } catch (e) {
  25708. console.log('FlyToMode遇到问题?');
  25709. }
  25710. }
  25711. }
  25712. };
  25713. (n.prototype.fastForwardActivePanoFlight = function (e) {
  25714. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1;
  25715. y.adjustSpeed(V.FlyToPano, e);
  25716. y.adjustSpeed(V.LookTransition, e);
  25717. }),
  25718. (n.prototype.flyToPanoClosestToMouse = function () {
  25719. if (
  25720. (Date.now() - this.mouseLastMoveTime > 50 &&
  25721. ((this.intersect = this.getMouseIntersect()),
  25722. this.intersect && this.updateClosestPano(this.intersect)),
  25723. this.closestPano)
  25724. )
  25725. return this.flyToPano({
  25726. pano: this.closestPano,
  25727. });
  25728. var e = this.getMouseDirection();
  25729. this.flyDirection(e) ||
  25730. this.flyToPano({
  25731. pano: this.currentPano,
  25732. });
  25733. }),
  25734. (n.prototype.flyLocalDirection = function (e) {
  25735. var t = this.getDirection(e),
  25736. i = 1 === e.z ? 0.4 : 0.75,
  25737. n = 1 === Math.abs(e.x);
  25738. return this.flyDirection(t, i, n);
  25739. }),
  25740. (n.prototype.flyDirection = function (e, t, i) {
  25741. Hot.closePopup(); //xzw add
  25742. var n = $.Deferred();
  25743. this.history.invalidate();
  25744. var r = this.closestPanoInDirection(e, t, i);
  25745. return (
  25746. r
  25747. ? this.flyToPano(
  25748. {
  25749. pano: r,
  25750. },
  25751. n.resolve.bind(n, !0)
  25752. )
  25753. : (this.bump(e), n.resolve(!1)),
  25754. n.promise()
  25755. );
  25756. }),
  25757. (n.prototype.closestPanoInDirection = function (e, t, i) {
  25758. return this.rankedPanoInDirection(0, e, t, i);
  25759. }),
  25760. (n.prototype.rankedPanoInDirection = (function () {
  25761. var e = {
  25762. pano: null,
  25763. candidates: [],
  25764. };
  25765. return function (t, i, n, r) {
  25766. t || (t = 0), (n = void 0 !== n ? n : 0.75);
  25767. var o = r ? 'angle' : 'direction';
  25768. return (
  25769. this.model.panos.findRankedByScore(
  25770. t,
  25771. [
  25772. s.filters.isPanoAligned(),
  25773. s.filters.not(this.currentPano),
  25774. s.filters.isNeighbourPanoTo(this.currentPano),
  25775. s.filters.inPanoDirection(this.position, i, n),
  25776. ],
  25777. [
  25778. s.scoreFunctions.distanceSquared(this.currentPano),
  25779. s.scoreFunctions[o](this.position, i),
  25780. ],
  25781. e
  25782. ),
  25783. (this.cachedPanoCandidates = e.candidates),
  25784. e.pano
  25785. );
  25786. };
  25787. })()),
  25788. (n.prototype.bump = function (e) {
  25789. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  25790. var t,
  25791. i,
  25792. n,
  25793. r = f.transition,
  25794. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  25795. a = this.camera.getWorldDirection().dot(e),
  25796. s = Math.abs(a) > 0.5;
  25797. if (s)
  25798. (t = function () {
  25799. y.start(
  25800. v.property(
  25801. this.cameraControls.cameras[u.PANORAMA],
  25802. 'zoom',
  25803. a > 0 ? 1.04 : 0.96
  25804. ),
  25805. o,
  25806. i,
  25807. 0,
  25808. A.easeInOutSine,
  25809. 'bumpZStart'
  25810. );
  25811. }.bind(this)),
  25812. (i = function () {
  25813. y.start(
  25814. v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', 1),
  25815. 5 * o,
  25816. n,
  25817. 0,
  25818. A.easeInOutSine,
  25819. 'bumpZRelax'
  25820. );
  25821. }.bind(this));
  25822. else {
  25823. var l = this.camera.position.clone(),
  25824. c = e.clone();
  25825. this.raycaster.set(l, c);
  25826. var h = this.model.floors.reduce(function (e, t) {
  25827. return e.concat(t.collider.children);
  25828. }, []),
  25829. d = this.raycaster.intersectObjects(h),
  25830. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  25831. g = l.clone().add(c.multiplyScalar(p));
  25832. (t = function () {
  25833. y.start(
  25834. v.vector(this.cameraControls.cameras[u.PANORAMA].position, g),
  25835. o,
  25836. i,
  25837. 0,
  25838. A.easeInOutSine,
  25839. 'bumpTStart'
  25840. );
  25841. }.bind(this)),
  25842. (i = function () {
  25843. y.start(
  25844. v.vector(this.cameraControls.cameras[u.PANORAMA].position, l),
  25845. 5 * o,
  25846. n,
  25847. 0,
  25848. A.easeInOutSine,
  25849. 'bumpTRelax'
  25850. );
  25851. }.bind(this));
  25852. }
  25853. (n = function () {
  25854. this.flying = !1;
  25855. }.bind(this)),
  25856. (this.flying = !0),
  25857. t();
  25858. }
  25859. }),
  25860. (n.prototype.changeFloor = function (e) {
  25861. if (!this.is360View(this.mode, this.currentPano))
  25862. if (this.mode === u.PANORAMA) {
  25863. var t = this.history.reversePano(e);
  25864. t && t.isAligned()
  25865. ? this.flyToPano({
  25866. pano: t,
  25867. })
  25868. : this.changeFloorByScore(e);
  25869. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor);
  25870. }),
  25871. (n.prototype.changeFloorByScore = (function () {
  25872. var e = {
  25873. pano: null,
  25874. candidates: [],
  25875. };
  25876. return function (t) {
  25877. var i = this.model.nextFloor(t);
  25878. return i
  25879. ? (this.model.panos.lowestByScore(
  25880. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  25881. [
  25882. s.scoreFunctions.distance(this.currentPano),
  25883. s.scoreFunctions.direction(this.position, new r.Vector3(0, t, 0)),
  25884. s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5),
  25885. ],
  25886. e
  25887. ),
  25888. void (e.pano
  25889. ? ((this.cachedPanoCandidates = e.candidates),
  25890. this.history.push(t, this.currentPano),
  25891. this.flyToPano({
  25892. pano: e.pano,
  25893. }))
  25894. : F.warn('No pano found on selected floor, not moving there.')))
  25895. : void F.debug('player.changeFloor(' + t + '): no such floor');
  25896. };
  25897. })()),
  25898. (n.prototype.gotoFloor = function (e) {
  25899. var t = e - this.model.currentFloor.floorIndex;
  25900. this.changeFloor(t);
  25901. }),
  25902. (n.prototype.getDirection = function (e) {
  25903. return (
  25904. (e = e ? e : new r.Vector3().copy(d.FORWARD)),
  25905. e.applyQuaternion(this.camera.quaternion)
  25906. );
  25907. }),
  25908. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  25909. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING))
  25910. return F.warn('should not be transitioning here'), n && n(!1), o.reject().promise();
  25911. var a = i || !1,
  25912. s = i ? i.position : this.position,
  25913. l = this.position.clone(),
  25914. c = this.currentPano;
  25915. if (
  25916. (F.debug('New pose in mode ' + this.mode),
  25917. !e ||
  25918. ((retryCallback = function () {
  25919. N.delayOneFrame(
  25920. function () {
  25921. this.flyToSameMode(e, t, i, n, o);
  25922. }.bind(this)
  25923. );
  25924. }.bind(this)),
  25925. !this.checkAndWaitForPanoLoad(
  25926. e,
  25927. 'high',
  25928. 'low',
  25929. this.basePanoSize,
  25930. retryCallback
  25931. )))
  25932. ) {
  25933. var h = function () {
  25934. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0);
  25935. }.bind(this),
  25936. d = f[this.mode],
  25937. p = void 0 !== t ? t : d.transitionTime,
  25938. g = new r.Vector3(),
  25939. C = new r.Vector3();
  25940. if ((this.emit(w.FlyingStarted, s, l, e, c), this.mode === u.PANORAMA))
  25941. F.warn('we should not be here for panorama views');
  25942. else if (this.mode === u.DOLLHOUSE)
  25943. if (a) {
  25944. var I = new r.Vector3(0, 1, 0);
  25945. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  25946. this.model.warpDestFloors(i.floorVisibility),
  25947. C.copy(i.position);
  25948. var E = new r.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  25949. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  25950. _ = b.intersectObjects(this.model.colliders),
  25951. T = 3;
  25952. _.length
  25953. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  25954. : (g.copy(E).multiplyScalar(3).add(C),
  25955. F.debug(
  25956. 'Tried to restore dollhouse mode that did not intersect...',
  25957. i.position,
  25958. i.quaternion
  25959. ));
  25960. var x = new r.Matrix4().lookAt(C, g, I),
  25961. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  25962. M = g.distanceTo(C),
  25963. R = new r.Matrix4().lookAt(
  25964. this.cameraControls.cameras[u.DOLLHOUSE].position,
  25965. this.cameraControls.controls[u.DOLLHOUSE].target,
  25966. I
  25967. ),
  25968. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  25969. O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(
  25970. this.cameraControls.controls[u.DOLLHOUSE].target
  25971. );
  25972. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  25973. var L = new r.Euler(S.x - P.x, S.y - P.y, S.z - P.z, f.warp.eOrder);
  25974. (L.y =
  25975. L.y > Math.PI
  25976. ? (L.y -= 2 * Math.PI)
  25977. : L.y < -Math.PI
  25978. ? (L.y += 2 * Math.PI)
  25979. : L.y),
  25980. (this.path.burnsDir = Math.sign(L.y));
  25981. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  25982. B = new r.Vector3();
  25983. y.start(
  25984. v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g),
  25985. p,
  25986. null,
  25987. f.flydown.movementDelay,
  25988. A[f.flydown.movementEasing],
  25989. null,
  25990. V.FlyToSameMode
  25991. ),
  25992. y.start(
  25993. function (e, t) {
  25994. (D.x = P.x + e * L.x), (D.y = P.y + e * L.y), (D.z = P.z + e * L.z);
  25995. var i = O + e * (M - O);
  25996. B.set(0, 0, i)
  25997. .applyEuler(D)
  25998. .add(this.cameraControls.controls[u.DOLLHOUSE].target),
  25999. this.cameraControls.cameras[u.DOLLHOUSE].position
  26000. .copy(B)
  26001. .add(this.model.position);
  26002. }.bind(this),
  26003. p,
  26004. null,
  26005. f.flydown.movementDelay,
  26006. A[f.flydown.movementEasing],
  26007. null,
  26008. V.FlyToSameMode
  26009. ),
  26010. y.start(
  26011. function (e, t) {
  26012. this.cameraControls.controls[u.DOLLHOUSE].update(),
  26013. this.quaternion.copy(
  26014. this.cameraControls.cameras[u.DOLLHOUSE].quaternion
  26015. ),
  26016. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position);
  26017. }.bind(this),
  26018. p,
  26019. null,
  26020. f.flydown.movementDelay,
  26021. A[f.flydown.movementEasing],
  26022. null,
  26023. V.FlyToSameMode
  26024. );
  26025. } else F.warn('invalid warp destination in flyToSameMode()? ignore it then');
  26026. else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), i)) {
  26027. this.model.warpDestFloors(i.floorVisibility);
  26028. var U = this.cameraControls.cameras[u.FLOORPLAN],
  26029. k = this.cameraControls.controls[u.FLOORPLAN],
  26030. H = k.target.clone(),
  26031. G = i.position.clone().sub(H),
  26032. z = U.position.clone().sub(k.target),
  26033. W = z.length(),
  26034. j = new r.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  26035. Y = Math.atan2(k.offset.x, k.offset.z),
  26036. X = Math.atan2(j.x, j.z),
  26037. Z = k.absoluteScale,
  26038. q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  26039. y.start(
  26040. function (e, t) {
  26041. k.target.copy(G).multiplyScalar(e).add(H);
  26042. var i = Y + (X - Y) * e;
  26043. (k.offset.x = W * Math.sin(i)),
  26044. (k.offset.z = W * Math.cos(i)),
  26045. U.position.copy(k.target).add(k.offset),
  26046. (k.absoluteScale = Z + e * (q - Z)),
  26047. k.update(),
  26048. this.quaternion.copy(U.quaternion),
  26049. this.position.copy(U.position),
  26050. this.target.copy(k.target),
  26051. this.camera.projectionMatrix.copy(U.projectionMatrix);
  26052. }.bind(this),
  26053. p,
  26054. null,
  26055. 0,
  26056. A[f.flydown.movementEasing],
  26057. null,
  26058. V.FlyToSameMode
  26059. );
  26060. } else F.info('flyToSameMode() funny floorplan view? skipping');
  26061. return (
  26062. y.setTimeout(
  26063. function (e) {
  26064. (this.mode = e), h(), o.resolve(!0);
  26065. }.bind(this, this.mode),
  26066. p,
  26067. V.FlyToSameMode
  26068. ),
  26069. (this.mode = u.TRANSITIONING),
  26070. o.promise()
  26071. );
  26072. }
  26073. }),
  26074. (n.prototype.flyToNewMode = function (e, t) {
  26075. Hot.closePopup(); //xzw add
  26076. e = e || {};
  26077. var i = e.mode,
  26078. n = e.pano,
  26079. o = e.duration,
  26080. a = e.warpDest,
  26081. s = e.callback,
  26082. l = e.force,
  26083. c = e.quaternion;
  26084. if (((t = t || $.Deferred()), this.isWarping()))
  26085. return (
  26086. F.warn('Player.flyToNewMode() -> Cannot fly when warping'),
  26087. s && s(!1),
  26088. t.reject('Cannot change mode during tour transition').promise()
  26089. );
  26090. if (this.mode === u.TRANSITIONING)
  26091. return s && s(!1), t.reject('Cannot change mode during mode transition').promise();
  26092. if (i === this.mode)
  26093. return l
  26094. ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  26095. t.promise())
  26096. : (s && s(!1), t.reject('Already in ' + i + ' mode').promise());
  26097. var h = a || !1;
  26098. F.debug('Switching mode to ' + i);
  26099. var d = function () {
  26100. N.delayOneFrame(
  26101. function () {
  26102. this.flyToNewMode(e, t);
  26103. }.bind(this)
  26104. );
  26105. }.bind(this);
  26106. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, d))
  26107. return t.promise();
  26108. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  26109. return (
  26110. F.info('Waiting for model textures to be loaded before going out to dollhouse'),
  26111. this.model.waitForLoad(
  26112. this.model,
  26113. function () {
  26114. return this.model.meshTexturesLoaded;
  26115. }.bind(this)
  26116. ),
  26117. this.model.loadMeshTextures().done(d),
  26118. t.promise()
  26119. );
  26120. this.history.invalidate(), this.updateLastView();
  26121. var p = this.mode,
  26122. C = this.cameraControls.cameras[i];
  26123. e = g.deepExtend({}, f[i], f[p + '-' + i]);
  26124. var I = void 0 !== o ? o : e.transitionTime;
  26125. this.emit(w.ModeChanging, p, i, n, I),
  26126. n && (this.currentPano = n),
  26127. this.switchCameraMode(i, c),
  26128. y.cancelById(V.LookTransition);
  26129. //before fly---------------------
  26130. this.modeTran = p + '-' + i; //add
  26131. if (this.mode == 'panorama') {
  26132. if (this.model.floorLogos) {
  26133. this.model.floorLogos[0].visible = false;
  26134. this.model.floorLogos[1].visible = false;
  26135. }
  26136. }
  26137. if (i == 'panorama') {
  26138. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: I }); //add
  26139. } else {
  26140. this.transitionPos({ type: 'beforeFlyOut', dur: I / 2 }); //add
  26141. }
  26142. window.bus.dispatchEvent({ type: 'playerAndModelReady' });
  26143. this.ready = true;
  26144. //------------------------------------
  26145. var beginTran = () => {
  26146. var _ = new r.Vector3().copy(this.position);
  26147. if (i === u.PANORAMA) {
  26148. this.emit(w.PanoChosen, n, n),
  26149. setTimeout(
  26150. function () {
  26151. n.floor.enter(i);
  26152. }.bind(this),
  26153. I / 2
  26154. ),
  26155. this.path.fadeOutCpm(f.path.fadeOutTime);
  26156. if (this.model.floorLogos) {
  26157. this.model.floorLogos[0].position.copy(
  26158. n.floorPosition.clone().sub(this.model.position)
  26159. ); //改
  26160. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position); //for floorIcon position
  26161. }
  26162. } else if (i === u.DOLLHOUSE) {
  26163. if (
  26164. (h && (this.model.stayPut = !0),
  26165. a
  26166. ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  26167. this.model.warpDestFloors(a.floorVisibility))
  26168. : this.model.toggleAllFloors(!0),
  26169. this.path.placeCpm(),
  26170. this.path.fadeInCpm(f.path.fadeInTime),
  26171. h)
  26172. ) {
  26173. var T = new r.Vector3(this.model.center.x, 0, this.model.center.z);
  26174. _.set(15, 10, 15);
  26175. var M = new r.Vector3(0, 0, -1).applyQuaternion(a.quaternion),
  26176. R = new r.Raycaster(a.position.clone(), M.clone(), 0, 1 / 0),
  26177. P = R.intersectObjects([this.sceneIntersectionPlane]);
  26178. P.length
  26179. ? (T.copy(P[0].point),
  26180. _.copy(a.position),
  26181. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  26182. 0.75 * _.distanceTo(T),
  26183. !0
  26184. ))
  26185. : (F.warn(
  26186. 'Tried to restore dollhouse mode that did not intersect...',
  26187. a.position,
  26188. a.quaternion
  26189. ),
  26190. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  26191. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  26192. _.add(this.model.position),
  26193. C.position.copy(_),
  26194. this.cameraControls.controls[u.DOLLHOUSE].update();
  26195. }
  26196. } else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), a)) {
  26197. this.model.warpDestFloors(a.floorVisibility);
  26198. var O = this.cameraControls.cameras[u.FLOORPLAN],
  26199. L = this.cameraControls.controls[u.FLOORPLAN],
  26200. D = O.position.clone().sub(L.target),
  26201. B = new r.Vector3(-1, 0, 0).applyQuaternion(a.quaternion).normalize(),
  26202. U = Math.atan2(B.x, B.z);
  26203. L.target.copy(a.position);
  26204. var k = D.length();
  26205. (L.offset.x = k * Math.sin(U)),
  26206. (L.offset.y = 0),
  26207. (L.offset.z = k * Math.cos(U)),
  26208. O.position.copy(L.target).add(L.offset);
  26209. L.target.clone().sub(C.position);
  26210. C.quaternion.copy(a.quaternion),
  26211. (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)),
  26212. (L.absoluteScale = L.currentScale),
  26213. L.update();
  26214. } else this.model.currentFloor.enter(i);
  26215. var H = this.currentPano,
  26216. G = this.position.clone();
  26217. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  26218. (this.flying = !0),
  26219. this.isOutsideMode(i) && this.is360View(p, H)
  26220. ? (h ||
  26221. i !== u.DOLLHOUSE ||
  26222. (C.position.set(15, 10, 15),
  26223. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  26224. C.controls.update()),
  26225. (e.blackoutStyle = S.FADEIN),
  26226. (I = f.show360Views.transitionTime),
  26227. this.fade360View(I, C, e))
  26228. : this.isOutsideMode(p) && this.is360View(i, n)
  26229. ? (h && this.switchCameraMode(i, h.quaternion),
  26230. (this.mode = i),
  26231. this.path && this.path.popOutCpm(),
  26232. (e.blackoutStyle = S.END),
  26233. (I = f.show360Views.transitionTime),
  26234. this.fade360View(I, C, e))
  26235. : (y.start(
  26236. v.property(this.model, 'alpha', e.modelAlpha, null),
  26237. I * e.modelAlphaLength,
  26238. null,
  26239. e.modelAlphaDelay,
  26240. null,
  26241. V.FlyToNewMode
  26242. ),
  26243. y.start(
  26244. v.vector(this.position, C.position),
  26245. I,
  26246. null,
  26247. f.flydown.movementDelay,
  26248. A[f.flydown.movementEasing],
  26249. null,
  26250. V.FlyToNewMode
  26251. ),
  26252. y.start(
  26253. v.quaternion(this.quaternion, C.quaternion),
  26254. I * e.rotationDuration,
  26255. null,
  26256. e.rotationDelay,
  26257. A[f.flydown.rotationEasing],
  26258. null,
  26259. V.FlyToNewMode
  26260. ),
  26261. y.start(
  26262. v.matrix4(this.camera.projectionMatrix, C.projectionMatrix),
  26263. I * e.cameraMatrixDuration,
  26264. null,
  26265. e.cameraMatrixDelay,
  26266. e.cameraMatrixEase,
  26267. null,
  26268. V.FlyToNewMode
  26269. ),
  26270. y.start(
  26271. v.uniform(this.model.skybox, 'opacity', e.skyboxOpacity),
  26272. I * e.skyboxOpacityLength,
  26273. null,
  26274. e.skyboxOpacityDelay,
  26275. null,
  26276. V.FlyToNewMode
  26277. ),
  26278. y.start(
  26279. v.property(this.reticule.material.uniforms.opacity, 'value', 0),
  26280. I,
  26281. null,
  26282. V.FlyToNewMode
  26283. )),
  26284. y.setTimeout(
  26285. function () {
  26286. (this.flying = !1),
  26287. p === u.PANORAMA && i !== u.PANORAMA
  26288. ? this.currentPano.exit()
  26289. : p !== u.PANORAMA &&
  26290. i === u.PANORAMA &&
  26291. (this.currentPano !== H && H.exit(),
  26292. this.currentPano.enter(),
  26293. this.path.placeCpm(),
  26294. this.path.fadeOutCpm(f.path.fadeOutTime),
  26295. this.spider.draw()),
  26296. p === u.DOLLHOUSE &&
  26297. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  26298. (this.mode = i),
  26299. this.emit(w.FlyingEnded, _, G, this.currentPano, H);
  26300. //add:
  26301. this.updateMarkerVisi();
  26302. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  26303. this.mode == u.PANORAMA &&
  26304. this.model.floorLogos &&
  26305. (this.model.changefloorLogoOpa({ index: 0, from: 0, opa: 1, dur: 150 }), //this.model.floorLogoShow(0,150);
  26306. (this.model.floorLogos[0].visible = true));
  26307. if (this.afterCModeFuc) {
  26308. //手动加的函数
  26309. var cf = this.afterCModeFuc;
  26310. this.afterCModeFuc = null; //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  26311. cf();
  26312. }
  26313. if (this.mode == u.PANORAMA) {
  26314. Hot.updateVisibles([this.currentPano]);
  26315. this.model.fadePanoMarkers();
  26316. } else {
  26317. Hot.updateVisibles(true);
  26318. this.model.hotGroup.children.forEach((overlay) => {
  26319. if (overlay.animateInfo) {
  26320. GifTexDeal.start(overlay.animation);
  26321. }
  26322. });
  26323. }
  26324. h && p !== u.PANORAMA && i === u.PANORAMA
  26325. ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s)
  26326. : (s && s(), t.resolve());
  26327. }.bind(this),
  26328. I,
  26329. V.FlyToNewMode
  26330. );
  26331. };
  26332. if (
  26333. i == 'panorama' &&
  26334. !this.model.supportsTiles &&
  26335. n.getSkyboxTexture().image[0].width > 1024
  26336. ) {
  26337. setTimeout(() => {
  26338. beginTran();
  26339. }, 16); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  26340. } else {
  26341. beginTran();
  26342. }
  26343. this.mode = u.TRANSITIONING;
  26344. //p == "panorama" && this.updateHotVisible(),
  26345. return t.promise();
  26346. }),
  26347. (n.prototype.fade360View = function (e, t, i) {
  26348. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  26349. $(this.domElement).fadeOut(
  26350. 0.5 * e,
  26351. function () {
  26352. (this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  26353. (this.model.alpha = i.modelAlpha),
  26354. this.position.copy(t.position),
  26355. this.quaternion.copy(t.quaternion),
  26356. this.camera.projectionMatrix.copy(t.projectionMatrix),
  26357. $(this.domElement).fadeIn(0.5 * e);
  26358. }.bind(this)
  26359. );
  26360. }),
  26361. (n.prototype.findDefaultViews = function () {
  26362. this.findDefaultView(this.lastInsideView, !0),
  26363. this.findDefaultView(this.last360View, !1);
  26364. }),
  26365. (n.prototype.findDefaultView = function (e, t) {
  26366. var i,
  26367. n = this.model.heroLocations,
  26368. r = this.model.panos,
  26369. o = n.findIndex(function (e) {
  26370. if (e.cameraMode !== u.PANORAMA) return !1;
  26371. var i = r.get(e.panoId);
  26372. return i && i.isAligned() === t;
  26373. });
  26374. o >= 0
  26375. ? ((i = r.get(n[o].panoId)),
  26376. e.update({
  26377. cameraMode: u.PANORAMA,
  26378. pano: i,
  26379. position: n[o].position,
  26380. quaternion: n[o].quaternion,
  26381. }))
  26382. : ((o = r.list.findIndex(function (e) {
  26383. return e.isAligned() === t;
  26384. })),
  26385. o >= 0
  26386. ? ((i = r.list[o]),
  26387. e.update({
  26388. cameraMode: u.PANORAMA,
  26389. pano: i,
  26390. position: i.position,
  26391. }))
  26392. : F.warn('There are no', t ? 'inside' : '360º', 'views in this model'));
  26393. }),
  26394. (n.prototype.updateLastView = function () {
  26395. if (this.mode === u.PANORAMA) {
  26396. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  26397. e.update({
  26398. pano: this.currentPano,
  26399. position: this.position,
  26400. quaternion: this.quaternion,
  26401. });
  26402. }
  26403. }),
  26404. (n.prototype.goToLastView = function (e, t) {
  26405. var i = $.Deferred(),
  26406. n = i.resolve.bind(i),
  26407. r = i.reject.bind(i),
  26408. o = e ? this.lastInsideView : this.last360View;
  26409. return (
  26410. this.isInMode(u.PANORAMA) &&
  26411. this.currentPano.isAligned() !== e &&
  26412. this.updateLastView(),
  26413. this.isInMode(u.PANORAMA)
  26414. ? (this.path && this.path.popOutCpm(),
  26415. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r))
  26416. : this.isOutsideMode() &&
  26417. this.flyToNewMode({
  26418. mode: o.cameraMode,
  26419. pano: o.pano,
  26420. quaternion: o.quaternion,
  26421. callback: t,
  26422. })
  26423. .done(n)
  26424. .fail(r),
  26425. i.promise()
  26426. );
  26427. }),
  26428. (n.prototype.fadeToView = function (e, t, i, n) {
  26429. var r = $.Deferred(),
  26430. o = r.resolve.bind(r),
  26431. a = r.reject.bind(r);
  26432. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano))
  26433. return (
  26434. F.warn('Tried to fade to an illegal view', t.cameraMode),
  26435. a('Cannot go to illegal view'),
  26436. r.promise()
  26437. );
  26438. var s =
  26439. (f[t.cameraMode],
  26440. function () {
  26441. $(this.domElement).fadeIn(0.5 * i), n && n(), o();
  26442. }.bind(this)),
  26443. l = e ? S.FADEIN : S.END;
  26444. return (
  26445. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  26446. $(this.domElement).fadeOut(
  26447. 0.5 * i,
  26448. function () {
  26449. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  26450. t.cameraMode === u.PANORAMA
  26451. ? this.flyToPano(
  26452. {
  26453. pano: t.pano,
  26454. lookAtPoint: d.FORWARD.clone()
  26455. .applyQuaternion(t.quaternion)
  26456. .add(t.pano.position),
  26457. duration: 0,
  26458. },
  26459. s
  26460. )
  26461. : this.flyToNewMode({
  26462. mode: t.cameraMode,
  26463. quaternion: t.quaternion,
  26464. duration: 0,
  26465. callback: s,
  26466. });
  26467. }.bind(this)
  26468. ),
  26469. r.promise()
  26470. );
  26471. }),
  26472. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  26473. if (
  26474. (this.cameraControls.activeControl &&
  26475. (this.cameraControls.activeControl.enabled = !1),
  26476. this.flying)
  26477. )
  26478. return F.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1;
  26479. (null !== e && void 0 !== e) || (e = b.Show), this.history.invalidate();
  26480. e !== b.Retain
  26481. ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK)
  26482. : (i = this.path.upcomingTransType);
  26483. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  26484. return (
  26485. this.emit(w.WarpStarted, a, i, n, r),
  26486. (n = n || S.MIDDLE),
  26487. this.path.warpToPano(
  26488. i,
  26489. n,
  26490. r,
  26491. function () {
  26492. t === E.Slow
  26493. ? this.path.discardSlow()
  26494. : t === E.Standard && this.path.discardPathObject(),
  26495. this.emit(w.WarpEnded, i),
  26496. this.cameraControls.activeControl &&
  26497. (this.cameraControls.activeControl.enabled = !0),
  26498. o && o();
  26499. }.bind(this)
  26500. ),
  26501. e === b.Hide && this.path.discardPathObject(),
  26502. !0
  26503. );
  26504. }),
  26505. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  26506. return this.path.setWarpDestinationByPanoId(e, t)
  26507. ? this.startWarp(i, n, r, o, a, s)
  26508. : (F.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'),
  26509. s && s(),
  26510. !1);
  26511. }),
  26512. (n.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  26513. return this.path.setWarpDestinationByHeroIndex(e)
  26514. ? this.startWarp(t, i, n, r, o, a)
  26515. : (F.warn(
  26516. 'Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26517. ),
  26518. a && a(),
  26519. !1);
  26520. }),
  26521. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  26522. return this.warpToPanoById(e.id, t, i, n, r, o, a, s);
  26523. }),
  26524. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  26525. return this.path.setWarpDestinationByHeroIndex(e)
  26526. ? (this.path.warpToNonPano(t), !0)
  26527. : (F.warn(
  26528. 'Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26529. ),
  26530. t && t(),
  26531. !1);
  26532. }),
  26533. (n.prototype.aimTourCamera = function (e, t, i, n) {
  26534. return (
  26535. F.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'),
  26536. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  26537. );
  26538. }),
  26539. (n.prototype.showPathToHeroLocation = function (e) {
  26540. this.path.setWarpDestinationByHeroIndex(e) &&
  26541. this.path.brushToWarpPano(x.STD, x.BLACK);
  26542. }),
  26543. (n.prototype.tourInterlude = function (e, t) {
  26544. this.history.invalidate();
  26545. this.path.discardSlow();
  26546. //xzw:
  26547. var defaultRotTime = DATA.tourRotTime * 1000;
  26548. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200; //预估时间假设每个item飞的时间(如果距离远就少了)
  26549. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem);
  26550. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]];
  26551. //zeg 标注一下
  26552. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  26553. var rotTime;
  26554. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  26555. var restChildCount = currentLocation0.heroLocations
  26556. ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1
  26557. : 0;
  26558. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music;
  26559. if (hasMusic) {
  26560. var audioObj = SoundManager.list.find((e) => e.name == 'tour');
  26561. var current = audioObj.audio.currentTime * 1e3; // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  26562. rotTime = currentLocation0.musicInfo.time - current;
  26563. if (restChildCount) {
  26564. //如果当前folder中还有剩下的item,平分一下时间
  26565. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1);
  26566. }
  26567. } else {
  26568. rotTime = defaultRotTime;
  26569. }
  26570. rotTime = Math.max(0, rotTime);
  26571. Log(
  26572. 'rotTime ' +
  26573. rotTime +
  26574. ' at item ' +
  26575. this.director.currentItem +
  26576. (hasMusic
  26577. ? ',musicCurrentTime:' +
  26578. current +
  26579. '音乐总长:' +
  26580. currentLocation0.musicInfo.time
  26581. : ''),
  26582. '#E8E'
  26583. );
  26584. } else {
  26585. rotTime = currentLocation.rotTime * 1000;
  26586. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem, '#E8E');
  26587. }
  26588. this.path.waitNextStep(
  26589. e,
  26590. function () {
  26591. t && t();
  26592. }.bind(this),
  26593. rotTime
  26594. );
  26595. }),
  26596. (n.prototype.stopInterlude = function () {
  26597. this.interruptAndFastForward(null, 0);
  26598. }),
  26599. (n.prototype.interruptAndFastForward = function (e, t) {
  26600. //Log('interruptAndFastForward' , '#f00')
  26601. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  26602. this.flying && this.emit(w.FlyingInterrupted),
  26603. this.path.interruptAndFastForward(e, t);
  26604. }),
  26605. (n.prototype.setSize = function (e, t) {
  26606. var i = e / t;
  26607. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  26608. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  26609. n > f.insideFOVMax
  26610. ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t))
  26611. : (this.baseFov = f.insideFOV);
  26612. for (var r in this.cameraControls.cameras) {
  26613. var o = this.cameraControls.cameras[r];
  26614. (o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i);
  26615. }
  26616. }),
  26617. (n.prototype.toJSON = function () {
  26618. var e = {};
  26619. return this.cameraControls.activeControl
  26620. ? ((e = this.cameraControls.activeControl.toJSON()),
  26621. (e.camera_mode = u.toInt(this.mode)),
  26622. this.isOutsideMode()
  26623. ? this.model.allFloorsVisible
  26624. ? (e.floor_visibility = [])
  26625. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  26626. return e.hidden ? 0 : 1;
  26627. }))
  26628. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  26629. e)
  26630. : e;
  26631. }),
  26632. (n.prototype.getCurrentNodePanos = function (e) {
  26633. this.model.panos.map;
  26634. if (((e.length = 0), this.path.nodes.length)) {
  26635. var momentTour = this.director.getMomentTour(this.director.destinationItem);
  26636. if (momentTour == 'black') {
  26637. //改 upcomingPanos如果是black的只需要起点和终点
  26638. if (this.path.nodes.length) {
  26639. e.push(this.model.panos.get(this.path.nodes[0]));
  26640. }
  26641. if (this.path.nodes.length > 1) {
  26642. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length - 1]));
  26643. }
  26644. } else {
  26645. for (var t = 0; t < this.path.nodes.length; t++) {
  26646. var i = this.path.nodes[t];
  26647. e.push(this.model.panos.get(i));
  26648. }
  26649. }
  26650. }
  26651. }),
  26652. (n.prototype.zoomIncrementally = function (e) {
  26653. var t = this.zoomLevel;
  26654. this.zoomTo(this.zoomLevel + e),
  26655. t !== this.zoomLevel &&
  26656. this.currentPano &&
  26657. this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id);
  26658. }),
  26659. (n.prototype.zoomInIncrementally = function (e) {
  26660. (e = e || this.defaultZoomIncrement), this.zoomIncrementally(e);
  26661. }),
  26662. (n.prototype.zoomOutIncrementally = function (e) {
  26663. (e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e);
  26664. }),
  26665. (n.prototype.zoomBy = function (e) {
  26666. this.zoomTo(this.zoomLevel * e);
  26667. }),
  26668. (n.prototype.zoomIn = function () {
  26669. this.zoomBy(1 + this.zoomSpeed);
  26670. }),
  26671. (n.prototype.zoomOut = function () {
  26672. this.zoomBy(1 - this.zoomSpeed);
  26673. }),
  26674. (n.prototype.zoomTo = function (e, t) {
  26675. if (t || (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)) {
  26676. if (
  26677. (e < f.zoom.min && (e = f.zoom.min),
  26678. e > f.zoom.max && (e = f.zoom.max),
  26679. e > this.zoomLevel
  26680. ? (this.emit(O.ZoomIn), e === f.zoom.max && this.emit(O.ZoomMax))
  26681. : e < this.zoomLevel &&
  26682. (this.emit(O.ZoomOut), e === f.zoom.min && this.emit(O.ZoomMin)),
  26683. this.cameraControls.activeControl)
  26684. ) {
  26685. var i = this.cameraControls.activeControl.camera;
  26686. (this.zoomLevel = e),
  26687. (i.fov = this.baseFov * (1 / this.zoomLevel)),
  26688. i.updateProjectionMatrix(),
  26689. (this.zoomFov = i.fov);
  26690. }
  26691. }
  26692. }),
  26693. (n.prototype.increaseZoomSpeed = function () {
  26694. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust);
  26695. }),
  26696. (n.prototype.decreaseZoomSpeed = function () {
  26697. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust);
  26698. }),
  26699. (n.prototype.clampZoomSpeed = function (e) {
  26700. return e < 0 ? 0 : e;
  26701. }),
  26702. (n.prototype.activatePersistentZooming = function (e) {
  26703. this.zooming = e ? 1 : -1;
  26704. }),
  26705. (n.prototype.deactivatePersistentZooming = function () {
  26706. this.zooming = 0;
  26707. }),
  26708. (n.prototype.zoomDefault = function () {
  26709. this.zoomTo(1, !0);
  26710. }),
  26711. (window.fovTranId = 333); //add
  26712. n.prototype.smoothZoomToDefault = function (e, t) {
  26713. y.cancelById(window.fovTranId);
  26714. var i,
  26715. n = this.zoomLevel,
  26716. r = function (e) {
  26717. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0);
  26718. }.bind(this),
  26719. o = function () {
  26720. this.zoomDefault(), t && window.setTimeout(t, 50);
  26721. }.bind(this);
  26722. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId);
  26723. };
  26724. (n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  26725. //add
  26726. y.cancelById(window.fovTranId);
  26727. console.log('smoothZoomFovTo ' + zoomLevel);
  26728. var i,
  26729. n = this.zoomLevel,
  26730. aimLevel = zoomLevel || this.baseFov / fov;
  26731. if (n == aimLevel) return;
  26732. var fun = function (e) {
  26733. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0);
  26734. }.bind(this);
  26735. y.start(
  26736. fun,
  26737. dur,
  26738. callback,
  26739. null,
  26740. 0,
  26741. A[f.transition.blendEasing],
  26742. null,
  26743. window.fovTranId
  26744. );
  26745. }),
  26746. /* n.prototype.updateZoomPano = function() {
  26747. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  26748. var e = this.currentPano;
  26749. if (e) {
  26750. var t = this.zoomLevel > f.zoom.activationThreshold
  26751. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  26752. , n = !i && !this.isWarping()
  26753. , r = t //&& n ; // 允许flying状态下加载4K图
  26754. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  26755. this.panoRenderer.setZoomingActive(r, e, !0);
  26756. var o = function(e, t) {
  26757. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  26758. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  26759. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  26760. e.setZoomed(t)
  26761. }
  26762. .bind(this);
  26763. r && !e.zoomed ? (o(e, !0),
  26764. this.panoRenderer. (function() {
  26765. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  26766. r && o(e, !0)
  26767. }
  26768. .bind(this))) : !t && e.zoomed && o(e, !1)
  26769. }
  26770. }
  26771. }, */
  26772. (n.prototype.updateZoomPano = function () {
  26773. if (
  26774. !this.panoRenderer.zoomPanoRenderingDisabled &&
  26775. this.mode === u.PANORAMA &&
  26776. this.currentPano
  26777. ) {
  26778. let navTileClass = this.qualityManager.getNavZoomClass();
  26779. let tileClass = this.qualityManager.getMaxZoomClass();
  26780. let levelThreshold1 = navTileClass == '1k' ? 1.3 : 1.8,
  26781. levelThreshold2 = 2; //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  26782. var t = this.zoomLevel > levelThreshold1,
  26783. i = this.flying && this.nextPano && this.nextPano !== this.currentPano,
  26784. n = !i && !this.isWarping(),
  26785. r = t; //&& n ; // 允许flying状态下加载4K图
  26786. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  26787. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  26788. var o = function (pano, ifZoom) {
  26789. this.panoRenderer.resetRenderStatus(
  26790. pano.id,
  26791. !1,
  26792. !0,
  26793. this.qualityManager.getMaxNavPanoSize()
  26794. ),
  26795. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  26796. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  26797. pano.setZoomed(ifZoom);
  26798. }.bind(this);
  26799. let zoomLevelRes = this.qualityManager.zoomLevelResolution;
  26800. if (r && (!this.currentPano.zoomed || (zoomLevelRes && zoomLevelRes != '4k'))) {
  26801. //needZoom
  26802. this.currentPano.zoomed || o(this.currentPano, !0);
  26803. if (
  26804. navTileClass == '1k' &&
  26805. tileClass != '1k' &&
  26806. this.zoomLevel < levelThreshold2
  26807. ) {
  26808. this.panoRenderer.enableHighQuality(
  26809. function () {
  26810. //开启2k
  26811. if (tileClass != '4k') {
  26812. o(this.currentPano, !0);
  26813. }
  26814. }.bind(this)
  26815. );
  26816. } else {
  26817. this.panoRenderer.enableUltraHighQualityMode(
  26818. function () {
  26819. //开启4k getMaxZoomPanoSize
  26820. this.qualityManager.useUltraHighResolutionPanos &&
  26821. !f.zoom.overridemax &&
  26822. (f.zoom.max = D.ultraHighQualityMaxZoom);
  26823. o(this.currentPano, !0);
  26824. }.bind(this)
  26825. );
  26826. }
  26827. } else {
  26828. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  26829. }
  26830. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  26831. if (r && navTileClass == '1k' && tileClass == '4k') {
  26832. //目前只有手机端navTileClass == '1k'
  26833. var change = (zoomedFlag) => {
  26834. this.qualityManager.updateMaximums(); //更新maxZoomPanoSize
  26835. this.panoRenderer.setupZoomRenderTarget(); //更新renderTarget
  26836. //this.currentPano.setZoomed(t);//更新uniforms贴图
  26837. };
  26838. this.qualityManager.zoomLevelResolution =
  26839. this.zoomLevel >= levelThreshold2
  26840. ? '4k'
  26841. : this.zoomLevel > levelThreshold1
  26842. ? '2k'
  26843. : '1k';
  26844. if (this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2) {
  26845. //1k/2k-4k
  26846. change();
  26847. o(this.currentPano, t);
  26848. } else if (
  26849. this.oldZoomLevel <= levelThreshold1 &&
  26850. this.zoomLevel > levelThreshold1
  26851. ) {
  26852. //1k-2k
  26853. change();
  26854. } else if (
  26855. this.oldZoomLevel > levelThreshold2 &&
  26856. this.zoomLevel <= levelThreshold2
  26857. ) {
  26858. //4k-2k/1k
  26859. change();
  26860. o(this.currentPano, t);
  26861. } else if (
  26862. this.oldZoomLevel > levelThreshold1 &&
  26863. this.zoomLevel <= levelThreshold1
  26864. ) {
  26865. //2k-1k
  26866. change();
  26867. }
  26868. this.oldZoomLevel = this.zoomLevel;
  26869. }
  26870. }
  26871. });
  26872. (n.prototype.checkHasNeighbor = function (pano) {
  26873. //add
  26874. for (var i in pano.neighbourPanos) {
  26875. if (i == pano.id) continue;
  26876. if (pano.neighbourPanos[i]) {
  26877. return true;
  26878. }
  26879. }
  26880. }),
  26881. (t.exports = n);
  26882. }.call(this, '/js/player.js'));
  26883. },
  26884. {
  26885. './constants': 8,
  26886. './enum/AlignmentType': 17,
  26887. './enum/BlackoutStyle': 18,
  26888. './enum/ControlEvents': 21,
  26889. './enum/Keys': 30,
  26890. './enum/ModelManagerEvents': 33,
  26891. './enum/PanoSizeClass': 36,
  26892. './enum/PanoramaEvents': 37,
  26893. './enum/PathDiscardMode': 38,
  26894. './enum/PathDisplayMode': 39,
  26895. './enum/PlayerEvents': 40,
  26896. './enum/TagStates': 44,
  26897. './enum/Vectors': 50,
  26898. './enum/Viewmode': 51,
  26899. './enum/WarpStyle': 52,
  26900. './enum/ZoomEvents': 53,
  26901. './exception/BasicException': 55,
  26902. './model/ModelManager': 140,
  26903. './objects/NSpider': 147,
  26904. './objects/Panorama': 148,
  26905. './objects/Reticule': 149,
  26906. './objects/ShowPath': 151,
  26907. './objects/Snapshot': 153,
  26908. './objects/View': 154,
  26909. './settings': 166,
  26910. './shaders': 167,
  26911. './tile/TileDownloader': 171,
  26912. './tile/TilePrioritizer': 172,
  26913. './util/ZoomStats': 179,
  26914. './util/browser': 182,
  26915. './util/camera': 183,
  26916. './util/cameraLight': 184,
  26917. './util/common': 185,
  26918. './util/easing': 186,
  26919. './util/history': 187,
  26920. './util/lerp': 188,
  26921. './util/logger': 189,
  26922. './util/math': 190,
  26923. './util/transitions': 195,
  26924. hot: 'hot',
  26925. scaleImg: 'scaleImg',
  26926. events: 202,
  26927. three: 217,
  26928. },
  26929. ],
  26930. scaleImg: [
  26931. function (t, e) {
  26932. // xzw
  26933. var OUTPUT = e;
  26934. (function () {
  26935. function t(t, a, i, r) {
  26936. function h() {
  26937. (B = 'object' == typeof i ? i : a.src || r ? u : document.createElement('canvas')),
  26938. (B.width = s),
  26939. (B.height = f),
  26940. (G = B.getContext('2d'));
  26941. }
  26942. function n(t) {
  26943. if (t) {
  26944. var e,
  26945. a = G.getImageData(0, 0, s, f),
  26946. i = a.data;
  26947. for (e = 0; at > e; e += 4)
  26948. (i[e] = (t[e] * it) | 0),
  26949. (i[e + 1] = (t[e + 1] * it) | 0),
  26950. (i[e + 2] = (t[e + 2] * it) | 0),
  26951. (i[e + 3] = (t[e + 3] * it) | 0);
  26952. return delete t, a;
  26953. }
  26954. return G.getImageData(0, 0, s, f);
  26955. }
  26956. function o(t, e, a, i, r) {
  26957. return (
  26958. 0.5 * (i - e + (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) * t) * t + a
  26959. );
  26960. }
  26961. a || ((a = t.input), (i = t.output), (r = t.inputRemovable), t.scale && (t = t.scale));
  26962. var u, d;
  26963. if (a.src)
  26964. if (((u = document.createElement('canvas')), null != a.naturalWidth))
  26965. (u.width = a.naturalWidth), (u.height = a.naturalHeight);
  26966. else if (null != a.runtimeStyle) {
  26967. var l = a.runtimeStyle,
  26968. c = l.width,
  26969. g = l.height;
  26970. (l.width = 'auto'),
  26971. (l.height = 'auto'),
  26972. (u.width = a.width),
  26973. (u.height = a.height),
  26974. (l.width = c),
  26975. (l.height = g);
  26976. } else {
  26977. var c = a.width,
  26978. g = a.height;
  26979. a.removeAttribute && (a.removeAttribute('width'), a.removeAttribute('height')),
  26980. (u.width = a.width),
  26981. (u.height = a.height),
  26982. (a.width = c),
  26983. (a.height = g);
  26984. }
  26985. else u = a;
  26986. (d = u.getContext('2d')), a.src && d.drawImage(a, 0, 0);
  26987. var s,
  26988. f,
  26989. m = u.width,
  26990. w = u.height,
  26991. p = d.getImageData(0, 0, m, w).data;
  26992. if (!m || !w) return !1;
  26993. (a.src || r) && u.clearRect(0, 0, m, w),
  26994. 'object' == typeof t
  26995. ? t.width
  26996. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  26997. : ((s = (m * t.scaleX + 0.5) | 0), (f = (w * t.scaleY + 0.5) | 0))
  26998. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0));
  26999. var v,
  27000. b,
  27001. y,
  27002. x,
  27003. D,
  27004. I,
  27005. A,
  27006. j,
  27007. R,
  27008. k,
  27009. C,
  27010. E,
  27011. F,
  27012. L,
  27013. S,
  27014. U,
  27015. W,
  27016. H,
  27017. alpha,
  27018. X,
  27019. Y,
  27020. q,
  27021. z,
  27022. B,
  27023. G,
  27024. J,
  27025. K,
  27026. M,
  27027. N,
  27028. O,
  27029. P,
  27030. Q,
  27031. T,
  27032. V,
  27033. Z,
  27034. $ = s << 2,
  27035. _ = m << 2,
  27036. tt = 0,
  27037. et = 0,
  27038. at = $ * f,
  27039. it = 255.99 / 255,
  27040. rt = s / m,
  27041. ht = f / w,
  27042. nt = rt * ht;
  27043. if (rt > 1 || ht > 1)
  27044. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  27045. for (
  27046. b = x / ht,
  27047. R = 0 | b,
  27048. q = b - R,
  27049. N = R * _,
  27050. M = 1 > R ? N : N - _,
  27051. w - 2 > R ? ((O = N + _), (P = (R + 2) * _)) : (O = P = R > w - 2 ? N : N + _),
  27052. y = 0;
  27053. s > y;
  27054. y++, et += 4
  27055. )
  27056. (v = y / rt),
  27057. (j = 0 | v),
  27058. (z = v - j),
  27059. (T = j << 2),
  27060. (Q = 1 > j ? T : T - 4),
  27061. m - 2 > j ? ((V = T + 4), (Z = T + 8)) : (V = Z = j > m - 2 ? T : T + 4),
  27062. (H =
  27063. (o(
  27064. q,
  27065. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27066. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27067. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27068. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27069. ) *
  27070. it) |
  27071. 0),
  27072. ++Q,
  27073. ++T,
  27074. ++V,
  27075. ++Z,
  27076. (X =
  27077. (o(
  27078. q,
  27079. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27080. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27081. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27082. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27083. ) *
  27084. it) |
  27085. 0),
  27086. ++Q,
  27087. ++T,
  27088. ++V,
  27089. ++Z,
  27090. (Y =
  27091. (o(
  27092. q,
  27093. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27094. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27095. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27096. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27097. ) *
  27098. it) |
  27099. 0),
  27100. ++Q,
  27101. ++T,
  27102. ++V,
  27103. ++Z,
  27104. (alpha =
  27105. (o(
  27106. q,
  27107. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27108. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27109. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27110. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27111. ) *
  27112. it) |
  27113. 0),
  27114. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  27115. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  27116. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  27117. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0);
  27118. else {
  27119. if (e.Float32Array) W = new Float32Array(at);
  27120. else for (W = [], et = 0; at > et; ++et) W[et] = 0;
  27121. for (b = 0; w > b; b++)
  27122. for (
  27123. x = b * ht,
  27124. A = 0 | x,
  27125. D = A * $,
  27126. U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1,
  27127. U && ((F = A + 1 - x), (L = x + ht - A - 1)),
  27128. v = 0;
  27129. m > v;
  27130. v++, tt += 4
  27131. )
  27132. switch (
  27133. ((y = v * rt),
  27134. (I = 0 | y),
  27135. (et = D + (I << 2)),
  27136. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  27137. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  27138. (H = p[tt]),
  27139. (X = p[tt + 1]),
  27140. (Y = p[tt + 2]),
  27141. (alpha = p[tt + 3]),
  27142. S + U)
  27143. ) {
  27144. case 0:
  27145. (W[et] += H * nt),
  27146. (W[et + 1] += X * nt),
  27147. (W[et + 2] += Y * nt),
  27148. (W[et + 3] += alpha * nt);
  27149. break;
  27150. case 1:
  27151. (k = C * ht),
  27152. (W[et] += H * k),
  27153. (W[et + 1] += X * k),
  27154. (W[et + 2] += Y * k),
  27155. (W[et + 3] += alpha * k),
  27156. (k = E * ht),
  27157. (W[et + 4] += H * k),
  27158. (W[et + 5] += X * k),
  27159. (W[et + 6] += Y * k),
  27160. (W[et + 7] += alpha * k);
  27161. break;
  27162. case 2:
  27163. (k = rt * F),
  27164. (W[et] += H * k),
  27165. (W[et + 1] += X * k),
  27166. (W[et + 2] += Y * k),
  27167. (W[et + 3] += alpha * k),
  27168. (k = rt * L),
  27169. (et += $),
  27170. (W[et] += H * k),
  27171. (W[et + 1] += X * k),
  27172. (W[et + 2] += Y * k),
  27173. (W[et + 3] += alpha * k);
  27174. break;
  27175. default:
  27176. (k = C * F),
  27177. (W[et] += H * k),
  27178. (W[et + 1] += X * k),
  27179. (W[et + 2] += Y * k),
  27180. (W[et + 3] += alpha * k),
  27181. (k = E * F),
  27182. (W[et + 4] += H * k),
  27183. (W[et + 5] += X * k),
  27184. (W[et + 6] += Y * k),
  27185. (W[et + 7] += alpha * k),
  27186. (k = C * L),
  27187. (et += $),
  27188. (W[et] += H * k),
  27189. (W[et + 1] += X * k),
  27190. (W[et + 2] += Y * k),
  27191. (W[et + 3] += alpha * k),
  27192. (k = E * L),
  27193. (W[et + 4] += H * k),
  27194. (W[et + 5] += X * k),
  27195. (W[et + 6] += Y * k),
  27196. (W[et + 7] += alpha * k);
  27197. }
  27198. delete p, h(), (J = n(W));
  27199. }
  27200. if ((G.putImageData(J, 0, 0), 'string' == typeof i)) {
  27201. if ('png' === i || 'jpeg' === i) {
  27202. var ot;
  27203. return (
  27204. (ot = r && a.src ? a : new Image()),
  27205. (ot.width = s),
  27206. (ot.height = f),
  27207. (ot.src = B.toDataURL('image/' + i, 0.85)),
  27208. ot
  27209. );
  27210. }
  27211. if ('png-src' === i || 'jpeg-src' === i)
  27212. return B.toDataURL('image/' + i.split('-')[0], 0.85);
  27213. }
  27214. return B;
  27215. }
  27216. var e = this;
  27217. 'undefined' != typeof exports
  27218. ? ('undefined' != typeof module && module.exports && (exports = module.exports = t),
  27219. (exports.scale = t))
  27220. : (c = t);
  27221. }.call(this));
  27222. OUTPUT.exports = c;
  27223. },
  27224. {},
  27225. ],
  27226. 156: [
  27227. function (e, t, i) {
  27228. (function (i) {
  27229. 'use strict';
  27230. function n(e, t) {
  27231. (this.model = e),
  27232. (this.panos = e.panos),
  27233. (this.player = t),
  27234. (this.imagePanos = this.listImagePanos()),
  27235. (this.retryMinimumTime = 1e4);
  27236. }
  27237. var r = (e('three'), e('./enum/Viewmode')),
  27238. o = (e('./settings'), e('./objects/Panorama')),
  27239. a = e('./util/logger'),
  27240. s = new a(i);
  27241. (n.prototype.start = function () {
  27242. this.loadNextPano(
  27243. function (e) {
  27244. e
  27245. ? this.start()
  27246. : (s.debug(
  27247. 'No suitable pano loaded, waiting a little while before looking again'
  27248. ),
  27249. setTimeout(
  27250. function () {
  27251. this.start();
  27252. }.bind(this),
  27253. 1e3
  27254. ));
  27255. }.bind(this)
  27256. );
  27257. }),
  27258. (n.prototype.validLoadTarget = function (e) {
  27259. return (
  27260. e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  27261. );
  27262. }),
  27263. (n.prototype.listImagePanos = function () {
  27264. var e = [],
  27265. t = this;
  27266. return (
  27267. this.model.images.forEach(function (i) {
  27268. if (i.metadata && i.metadata.scan_id) {
  27269. var n = t.model.panos.get(i.metadata.scan_id);
  27270. n && !n.isLoaded('high') && e.push(n);
  27271. }
  27272. }),
  27273. e
  27274. );
  27275. }),
  27276. (n.prototype.nextNotLoadedImage = function () {
  27277. for (; this.imagePanos.length > 0; ) {
  27278. var e = this.imagePanos[0];
  27279. if (!e.isLoaded('high')) return e;
  27280. this.imagePanos.shift();
  27281. }
  27282. return null;
  27283. }),
  27284. (n.prototype.loadNextPano = function (e) {
  27285. var t,
  27286. i,
  27287. n = this.model.waitQueue.filter(function (e) {
  27288. return e.object instanceof o;
  27289. });
  27290. n.length > 0
  27291. ? ((t = n[0].object),
  27292. s.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  27293. : this.validLoadTarget(this.player.currentPano)
  27294. ? ((t = this.player.currentPano),
  27295. s.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  27296. : this.validLoadTarget(this.player.closestPano)
  27297. ? ((t = this.player.closestPano),
  27298. s.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  27299. : this.validLoadTarget(this.nextNotLoadedImage())
  27300. ? ((i = 'high'),
  27301. (t = this.imagePanos[0]),
  27302. s.debug('Overrode pano selection: Highlight image ' + t.id))
  27303. : this.player.mode === r.PANORAMA &&
  27304. ((t = this.panos.lowestByScore(
  27305. [
  27306. this.validLoadTarget.bind(this),
  27307. o.filters.isNeighbourPanoTo(this.player.currentPano),
  27308. ],
  27309. [
  27310. o.scoreFunctions.distance(this.player.currentPano),
  27311. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  27312. o.scoreFunctions.inFieldOfView(
  27313. this.player.position,
  27314. this.player.getDirection()
  27315. ),
  27316. ]
  27317. )),
  27318. t && s.debug('Normal pano selection: neighbor ' + t.id)),
  27319. t
  27320. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  27321. s.debug('Preloading ' + i + '-res pano ' + t.id),
  27322. t
  27323. .loadCube(i)
  27324. .done(e)
  27325. .fail(function () {
  27326. s.warn(
  27327. 'Failed preloading pano',
  27328. t.id,
  27329. ', marking it as failed and forgetting it for a while'
  27330. ),
  27331. e();
  27332. }))
  27333. : e && e(null);
  27334. }),
  27335. (t.exports = n);
  27336. }.call(this, '/js/preloaders.js'));
  27337. },
  27338. {
  27339. './enum/Viewmode': 51,
  27340. './objects/Panorama': 148,
  27341. './settings': 166,
  27342. './util/logger': 189,
  27343. three: 217,
  27344. },
  27345. ],
  27346. 157: [
  27347. function (e, t, i) {
  27348. (function (i) {
  27349. 'use strict';
  27350. function n(e, t, i, n, r) {
  27351. (this.qualityManager = e),
  27352. (this.scene = t),
  27353. (this.camera = i),
  27354. (this.container = r),
  27355. (this.controls = n),
  27356. (this.controls.enabled = !0),
  27357. (this.controls.locked = !0),
  27358. (this.quickstartCamera = n.camera),
  27359. (this.quickstartCamera.fov = h.clampVFOV(
  27360. a.insideFOV,
  27361. a.insideFOVMax,
  27362. $('#player').width(),
  27363. $('#player').height()
  27364. )),
  27365. (this.skybox = null);
  27366. }
  27367. var r = e('three'),
  27368. o = e('../util/logger'),
  27369. a = e('../constants'),
  27370. s =
  27371. (e('../util/transitions'),
  27372. e('../util/lerp'),
  27373. e('../util/easing'),
  27374. e('../enum/Vectors')),
  27375. l = e('../enum/PanoSizeClass'),
  27376. c = (e('../materials/ModelTextureMaterial'), e('../materials/CubemapMaterial')),
  27377. h =
  27378. (e('../cameras/PanoramaCamera'),
  27379. e('../controls/PanoramaControls'),
  27380. e('../tile/TileUtils'),
  27381. e('../util/camera'),
  27382. e('../util/cameraLight')),
  27383. u = (e('../util/browser'), e('../settings'), e('../gui/helpManager'), new o(i));
  27384. (n.prototype.load = function (e) {
  27385. e.pano.shouldRedrawOnBaseLoaded = !0;
  27386. var t,
  27387. i,
  27388. n = this,
  27389. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  27390. o = r.clone().negate();
  27391. this.controls.lookAt(r.add(this.quickstartCamera.position));
  27392. var a = this.qualityManager.getPanoSize(l.BASE),
  27393. c = this.qualityManager.getPanoSize(l.STANDARD);
  27394. if (e.pano.tiled) {
  27395. u.warn('Loading startPano, TILED', e.pano.id);
  27396. var d = h.getHFOVForCamera(
  27397. this.quickstartCamera,
  27398. $('#player').width(),
  27399. $('#player').height()
  27400. ),
  27401. p = this.quickstartCamera.fov;
  27402. u.warn(
  27403. 'Quickstart loading tiles in frustum: [horizontal FOV: ' +
  27404. d +
  27405. ', vertical FOV: ' +
  27406. p +
  27407. ']'
  27408. ),
  27409. (t = e.pano.loadTiledPano(
  27410. c,
  27411. r,
  27412. {
  27413. hFov: d,
  27414. vFov: p,
  27415. },
  27416. !1,
  27417. !1,
  27418. !0
  27419. )),
  27420. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0));
  27421. } else u.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'));
  27422. return $.when(t).then(
  27423. function () {
  27424. n.init(e.pano, e.quaternion),
  27425. e.pano.tiled
  27426. ? i.done(
  27427. function () {
  27428. (e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1);
  27429. }.bind(this)
  27430. )
  27431. : (this.controls.locked = !1);
  27432. }.bind(this)
  27433. );
  27434. }),
  27435. (n.prototype.init = function (e, t) {
  27436. u.info('Quickstart done loading, adding scene objects'),
  27437. (e.lockUntilRenderingComplete = !0),
  27438. (this.skybox = new r.Mesh(
  27439. new r.CubeGeometry(1, 1, 1),
  27440. new c({
  27441. side: r.BackSide,
  27442. })
  27443. )),
  27444. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  27445. this.skybox.quaternion.copy(e.quaternion),
  27446. this.scene.add(this.skybox),
  27447. $(this.container).show();
  27448. }),
  27449. (n.prototype.update = function (e) {
  27450. this.controls.update(e), this.camera.copy(this.quickstartCamera);
  27451. }),
  27452. (n.prototype.setSize = function (e, t) {
  27453. this.quickstartCamera.updateAspect(e / t);
  27454. }),
  27455. (n.prototype.destroy = function () {
  27456. this.scene.remove(this.skybox);
  27457. }),
  27458. (t.exports = n);
  27459. }.call(this, '/js/scene/QuickstartManager.js'));
  27460. },
  27461. {
  27462. '../cameras/PanoramaCamera': 7,
  27463. '../constants': 8,
  27464. '../controls/PanoramaControls': 13,
  27465. '../enum/PanoSizeClass': 36,
  27466. '../enum/Vectors': 50,
  27467. '../gui/helpManager': 68,
  27468. '../materials/CubemapMaterial': 117,
  27469. '../materials/ModelTextureMaterial': 118,
  27470. '../settings': 166,
  27471. '../tile/TileUtils': 174,
  27472. '../util/browser': 182,
  27473. '../util/camera': 183,
  27474. '../util/cameraLight': 184,
  27475. '../util/easing': 186,
  27476. '../util/lerp': 188,
  27477. '../util/logger': 189,
  27478. '../util/transitions': 195,
  27479. three: 217,
  27480. },
  27481. ],
  27482. 158: [
  27483. function (e, t, i) {
  27484. 'use strict';
  27485. function n(e, t, i) {
  27486. (this.scene = e),
  27487. (this.camera = t),
  27488. (this.renderer = null),
  27489. (this.effects = i),
  27490. (this.animateCallback = null),
  27491. (this.composer = null),
  27492. (this.qualityManager = null),
  27493. (e.renderWidth = 0),
  27494. (e.renderHeight = 0),
  27495. (this.updateClock = new r.Clock()),
  27496. (this.components = []),
  27497. (this.updateListeners = []),
  27498. (this.resizeListeners = []),
  27499. (this.forceUpdateSize = !1),
  27500. (this.started = !1),
  27501. (this.textures = {}),
  27502. (this.suspendedObjects = []);
  27503. }
  27504. var r = e('three'),
  27505. o = e('../shaders'),
  27506. a = e('../enum/SceneRendererEvents'),
  27507. s = e('../enum/GLTextureType'),
  27508. l = e('../enum/GLCubeFaces'),
  27509. c = e('../exception/BasicException'),
  27510. h = e('../exception/RendererCreationException'),
  27511. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  27512. m = e('../util/browser'),
  27513. /**************************************************************************************************************************************************/
  27514. u = e('../settings'),
  27515. d = e('events').EventEmitter;
  27516. (window.requestAnimationFrame =
  27517. window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  27518. (n.prototype = Object.create(d.prototype)),
  27519. (n.prototype.addComponent = function (e) {
  27520. this.components.push(e),
  27521. e.update && this.updateListeners.push(e),
  27522. e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0));
  27523. }),
  27524. (n.prototype.removeComponent = function (e) {
  27525. var t = function (t) {
  27526. return t !== e;
  27527. };
  27528. (this.components = this.components.filter(t)),
  27529. (this.updateListeners = this.updateListeners.filter(t)),
  27530. (this.resizeListeners = this.resizeListeners.filter(t));
  27531. }),
  27532. (n.prototype.start = function (e) {
  27533. if (this.started) throw new c("Can't start SceneRenderer, already started");
  27534. this.createContext(e),
  27535. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  27536. m.isMobile() && this.boluoVrInit(),
  27537. /*******************************************************************************************************************************/
  27538. this.initComposer(),
  27539. (this.started = !0),
  27540. (p = p.bind(this))();
  27541. }),
  27542. (n.prototype.createContext = function (e) {
  27543. var transparent = !!(settings.transparentBg || settings.bgImg);
  27544. try {
  27545. (this.renderer = new r.WebGLRenderer({
  27546. antialias: !m.isMobile(),
  27547. alpha: transparent,
  27548. })),
  27549. (this.renderer.autoClear = !0),
  27550. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  27551. this.renderer.setSize($('#player').width(), $('#player').height(), false), //改
  27552. transparent && this.renderer.setClearColor(0x000000, 0); //透明
  27553. this.emit(a.ContextCreated);
  27554. } catch (e) {
  27555. throw new h('Unable to create a WebGL rendering context');
  27556. }
  27557. u.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement);
  27558. /* window.stats = new Stats();
  27559. e.appendChild( stats.dom ); */
  27560. }),
  27561. (n.prototype.overrideTextures = function () {
  27562. var e = this.renderer.context,
  27563. t = 0,
  27564. i = e.createTexture;
  27565. e.createTexture = function () {
  27566. var n = i.call(e);
  27567. return (n.id = t++), (this.textures[n.id] = n), n;
  27568. }.bind(this);
  27569. var n = e.texImage2D;
  27570. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  27571. var d,
  27572. p = this.getTextureTypeFromTarget(e, t);
  27573. (d =
  27574. p === s.TextureCube
  27575. ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP)
  27576. : e.getParameter(e.TEXTURE_BINDING_2D)),
  27577. void 0 !== c
  27578. ? n.call(e, t, i, r, o, a, l, c, h, u)
  27579. : ((c = o),
  27580. (h = a),
  27581. (u = l),
  27582. (o = u.naturalWidth),
  27583. (a = u.naturalHeight),
  27584. n.call(e, t, i, r, c, h, u));
  27585. var f = this.textures[d.id];
  27586. (f.width = p === s.TextureCube ? 6 * o : o), (f.height = a);
  27587. }.bind(this);
  27588. var r = e.deleteTexture;
  27589. e.deleteTexture = function (t) {
  27590. delete this.textures[t.id], r.call(e, t);
  27591. }.bind(this);
  27592. }),
  27593. (n.prototype.updateTextureMemory = (function () {
  27594. var e = null;
  27595. return function () {
  27596. var t = 0;
  27597. for (var i in this.textures) {
  27598. var n = this.textures[i];
  27599. n.width && n.height && (t += n.width * n.height * 4);
  27600. }
  27601. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t);
  27602. };
  27603. })()),
  27604. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  27605. switch (t) {
  27606. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  27607. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  27608. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  27609. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27610. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  27611. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27612. return s.TextureCube;
  27613. case e.TEXTURE_2D:
  27614. return s.Texture2D;
  27615. default:
  27616. return null;
  27617. }
  27618. }),
  27619. (n.prototype.initComposer = function () {
  27620. (this.composer = new r.EffectComposer(this.renderer)),
  27621. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  27622. //this.composer.addPass(this.effects.hblurPass),
  27623. //this.composer.addPass(this.effects.vblurPass)
  27624. this.composer.addPass(this.effects.transitionMaskPass); //add
  27625. }),
  27626. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  27627. (this.renderWidth = e),
  27628. (this.renderHeight = t),
  27629. (this.effects.aspect = e / t),
  27630. /* this.renderer.setSize(e, t), -----MP */
  27631. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  27632. this.composer.setSize(e, t);
  27633. for (var i = 0; i < this.resizeListeners.length; i++)
  27634. this.resizeListeners[i].setSize(e, t);
  27635. }),
  27636. (n.prototype.render = function () {
  27637. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  27638. this.effects.transitionMaskPass.enabled
  27639. ? this.composer.render()
  27640. : this.renderer.render(this.scene, this.camera);
  27641. });
  27642. /******************************************************************************************************徐世廷**********************************************************************/
  27643. var vrPermission = {};
  27644. var vrPermissionCallBack = function (info1, info2) {
  27645. if (info1 == 'reset') {
  27646. vrPermission = {};
  27647. } else {
  27648. vrPermission[info1] = info2;
  27649. if (
  27650. Object.keys(vrPermission).length == 2 &&
  27651. (vrPermission.deviceMotion != 'granted' ||
  27652. vrPermission.deviceOrientation != 'granted')
  27653. ) {
  27654. alert(
  27655. '运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。'
  27656. );
  27657. }
  27658. }
  27659. };
  27660. (n.prototype.boluoVrInit = function () {
  27661. console.log('boluoVrInit');
  27662. //webxr.init(this.renderer)
  27663. (this.isHuawei5X = m.detectHUAWEI5X()),
  27664. (this.oldRenderer = this.renderer),
  27665. (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera));
  27666. window.panoCamera = this.camera;
  27667. var a = this;
  27668. (window._vrEnabled = !1),
  27669. Object.defineProperty(window, 'vrEnabled', {
  27670. get: function () {
  27671. return window._vrEnabled;
  27672. },
  27673. set: function (b) {
  27674. //if(webxr.xrType)return webxr.enterVR()
  27675. b = !!b;
  27676. b
  27677. ? ((a.renderer = a.newRenderer),
  27678. window.vrMarkers.forEach(function (a) {
  27679. a.visible = !0;
  27680. }))
  27681. : ((a.renderer = a.oldRenderer),
  27682. window.vrMarkers.forEach(function (a) {
  27683. a.visible = !1;
  27684. })),
  27685. (a.cursor.visible = b),
  27686. a.setSize(window.innerWidth, window.innerHeight),
  27687. (window._vrEnabled = b);
  27688. if (b) {
  27689. setTimeout(function () {
  27690. console.log('orientEnable' + window.orientEnable);
  27691. if (window.vrEnabled && !window.orientEnable) {
  27692. //很可能没能触发陀螺仪事件
  27693. if (m.detectIOS() /* && m.detectSafari() */) {
  27694. var b = m.iosVersion(); //{major: 10, minor: 3, patch: 1}
  27695. console.log('开始获取权限 major' + b.major);
  27696. if (b.major == 12 && b.minor >= 2) {
  27697. if (browser.detectSafari())
  27698. alert(
  27699. '浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。'
  27700. );
  27701. else {
  27702. //app??
  27703. alert(
  27704. '浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。'
  27705. );
  27706. }
  27707. } else if (b.major >= 13) {
  27708. if (!window.location.href.includes('https://')) {
  27709. console.log('需要https');
  27710. alert('当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。');
  27711. return;
  27712. }
  27713. var hasFailed =
  27714. window.vrPermission &&
  27715. (window.vrPermission.deviceMotion != 'granted' ||
  27716. window.vrPermission.deviceOrientation != 'granted');
  27717. setTimeout(
  27718. () => {
  27719. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  27720. if (!window.vrEnabled || window.orientEnable) return;
  27721. vrPermissionCallBack('reset');
  27722. console.log(window.DeviceMotionEvent);
  27723. if (
  27724. window.DeviceMotionEvent &&
  27725. window.DeviceMotionEvent.requestPermission &&
  27726. typeof window.DeviceMotionEvent.requestPermission === 'function'
  27727. ) {
  27728. console.log('开始获取权限1');
  27729. ///注意:需要https 本地服务器permissionState会得到denied
  27730. window.DeviceMotionEvent.requestPermission()
  27731. .then((permissionState) => {
  27732. console.log('permissionState1: ' + permissionState);
  27733. vrPermissionCallBack('deviceMotion', permissionState);
  27734. })
  27735. .catch(function (e) {
  27736. vrPermissionCallBack('deviceMotion', false);
  27737. console.log(e);
  27738. });
  27739. } else {
  27740. console.log('window.DeviceMotionEvent undefined');
  27741. vrPermissionCallBack('deviceMotion', false);
  27742. }
  27743. if (
  27744. window.DeviceOrientationEvent &&
  27745. window.DeviceOrientationEvent.requestPermission &&
  27746. typeof window.DeviceOrientationEvent.requestPermission ===
  27747. 'function'
  27748. ) {
  27749. console.log('开始获取权限2');
  27750. window.DeviceOrientationEvent.requestPermission()
  27751. .then((permissionState) => {
  27752. console.log('permissionState2: ' + permissionState);
  27753. vrPermissionCallBack('deviceOrientation', permissionState);
  27754. })
  27755. .catch(function (e) {
  27756. vrPermissionCallBack('deviceOrientation', false);
  27757. console.log(e);
  27758. });
  27759. } else {
  27760. console.log('window.DeviceOrientationEvent undefined');
  27761. vrPermissionCallBack('deviceOrientation', false);
  27762. }
  27763. },
  27764. hasFailed ? 0 : 150
  27765. );
  27766. /* /* setTimeout(function(){
  27767. if(settings.vrEnabled && !window.orientEnable){
  27768. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  27769. }
  27770. },4000) */
  27771. } else console.log('陀螺仪未能启用 ios ' + b.major + '.' + b.minor);
  27772. } else {
  27773. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  27774. }
  27775. } else {
  27776. //已经触发了
  27777. }
  27778. }, 200);
  27779. }
  27780. },
  27781. }),
  27782. this.createCursor(0.5, !1, 1, 16777215, 0);
  27783. var b = {
  27784. setSize: function (b, c) {
  27785. a.camera.aspect = b / c;
  27786. },
  27787. };
  27788. this.resizeListeners.push(b), this.vrLoadingInit();
  27789. }),
  27790. (n.prototype.vrLoadingInit = function () {
  27791. var a = function (camera) {
  27792. var a = this,
  27793. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  27794. c = new r.MeshBasicMaterial({
  27795. color: 4967932,
  27796. side: r.DoubleSide,
  27797. }),
  27798. d = new r.Mesh(b, c);
  27799. (this.mesh = d),
  27800. (d.position.z = -2),
  27801. d.scale.set(0.08, 0.08, 0.08),
  27802. (d.visible = !1),
  27803. camera.add(d),
  27804. //window.player.camera.add(d),
  27805. (a.enabled = !1),
  27806. (this.update = function (b) {
  27807. 1 == a.enabled && (d.rotation.z += 15 * b);
  27808. });
  27809. },
  27810. a = new a(this.camera);
  27811. (window.Loading = a), this.updateListeners.push(a);
  27812. }),
  27813. (n.prototype.createCursor = function (a, b, c, d, e) {
  27814. var g,
  27815. h = new r.SpriteMaterial({
  27816. opacity: c,
  27817. color: d,
  27818. transparent: b,
  27819. map: this.boluoGetTexture('images/cursor.png'),
  27820. needsUpdate: !0,
  27821. side: r.DoubleSide,
  27822. });
  27823. (h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  27824. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  27825. (h.depthTest = !1),
  27826. (h.blending = r.AdditiveBlending),
  27827. (g = new r.Sprite(h)),
  27828. // g.scale.set(a, a, a),
  27829. g.scale.set(0.3, 0.3, 0.3);
  27830. (g.position.z = -2),
  27831. (g.visible = !1),
  27832. (g.name = 'cursor'),
  27833. this.camera.add(g),
  27834. this.scene.add(this.camera),
  27835. (this.cursor = g);
  27836. var i = new this.CursorAnimation(this.scene, g, this.camera);
  27837. (this.cursor.triggerTargetEvent = i.triggerTargetEvent), this.updateListeners.push(i);
  27838. }),
  27839. (window.orientEnable = 0); //是否能触发deviceorientation
  27840. (n.prototype.CursorAnimation = function (a, b, c) {
  27841. function d() {
  27842. g.orient = r.Math.degToRad(window.orientation || 0);
  27843. }
  27844. function e(a) {
  27845. if (!window.vrEnabled && window.orientEnable) return;
  27846. window.orientEnable || (window.orientEnable = 1);
  27847. var b = r.Math.degToRad(a.alpha),
  27848. c = r.Math.degToRad(a.beta),
  27849. d = r.Math.degToRad(a.gamma);
  27850. if (
  27851. (this.isHuawei5X
  27852. ? (-1e3 === g.alpha && (g.alpha = b),
  27853. -1e3 === g.beta && (g.beta = c),
  27854. -1e3 === g.gamma && (g.gamma = d),
  27855. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  27856. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  27857. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  27858. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  27859. n.vrDebug)
  27860. ) {
  27861. $('#info-device-orientation').css('display', 'block');
  27862. var e = '';
  27863. (e += 'alpha=(' + g.alpha + ')<BR/>'),
  27864. (e += 'beta=(' + g.beta + ')<BR/>'),
  27865. (e += 'gamma=' + g.gamma + '<BR/>'),
  27866. (document.getElementById('info-device-orientation').innerHTML = e);
  27867. }
  27868. }
  27869. (this.cursor = b),
  27870. (this.raycaster = new r.Raycaster()),
  27871. (this.targetEventObj = {}),
  27872. (this.type = 1),
  27873. (this.tweenFlag = !0);
  27874. var g = this;
  27875. (this.target = c),
  27876. console.log(c.uuid),
  27877. (this.euler = new r.Euler()),
  27878. (this.q0 = new r.Quaternion()),
  27879. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  27880. (this.zee = new r.Vector3(0, 0, 1)),
  27881. (this.alpha = -1e3),
  27882. (this.beta = -1e3),
  27883. (this.gamma = -1e3),
  27884. (this.orient = r.Math.degToRad(window.orientation || 0)),
  27885. window.addEventListener('orientationchange', d),
  27886. window.addEventListener('deviceorientation', e),
  27887. (this.setObjectQuaternion = function (a, b, d, e, f) {
  27888. g.euler.set(d, b, -e, 'YXZ'),
  27889. a.setFromEuler(g.euler),
  27890. a.multiply(g.q1),
  27891. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  27892. c.updateMatrixWorld();
  27893. }),
  27894. parent !== window &&
  27895. window.addEventListener('message', function (a) {
  27896. var b = JSON.parse(a.data),
  27897. c = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H');
  27898. b &&
  27899. b.alpha &&
  27900. b.beta &&
  27901. b.gamma &&
  27902. (function (a) {
  27903. var c = r.Math.degToRad(b.alpha),
  27904. d = r.Math.degToRad(b.beta),
  27905. e = r.Math.degToRad(b.gamma);
  27906. a
  27907. ? (-1e3 === g.alpha && (g.alpha = c),
  27908. -1e3 === g.beta && (g.beta = d),
  27909. -1e3 === g.gamma && (g.gamma = e),
  27910. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  27911. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  27912. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  27913. : ((g.alpha = c), (g.beta = d), (g.gamma = e));
  27914. })(c);
  27915. }),
  27916. (this.update = function (a) {
  27917. TWEEN.update();
  27918. if (window.ifTest && window.vrEnabled)
  27919. this.triggerTargetEvent(); //测试时不根据陀螺仪来转向
  27920. else
  27921. window.vrEnabled &&
  27922. (this.setObjectQuaternion(
  27923. this.target.quaternion,
  27924. this.alpha,
  27925. this.beta,
  27926. this.gamma,
  27927. this.orient
  27928. ),
  27929. this.triggerTargetEvent());
  27930. }),
  27931. (this.triggerTargetEvent = function () {
  27932. var a = this.choseObj(),
  27933. b = a ? a.object : void 0;
  27934. (this.targetEventObj.currentObj = b),
  27935. b !== this.targetEventObj.lastObj &&
  27936. (b && this.autoCursorPosition(a),
  27937. 1 === this.type
  27938. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  27939. b &&
  27940. b.enabled &&
  27941. this.startAnimate(
  27942. function () {
  27943. this.clickCallback(b);
  27944. }.bind(this)
  27945. ))
  27946. : this.type,
  27947. (this.targetEventObj.lastObj = b));
  27948. }),
  27949. (this.choseObj = function () {
  27950. this.raycaster.setFromCamera(
  27951. {
  27952. x: 0,
  27953. y: 0,
  27954. },
  27955. c
  27956. );
  27957. var a = (this.raycaster.ray, window.vrMarkers),
  27958. b = this.raycaster.intersectObjects(a);
  27959. if (b.length > 0) return b[0];
  27960. }),
  27961. (this.clickCallback = function (a) {
  27962. this.runTHREEAction(a, 'onclick');
  27963. }),
  27964. (this.runTHREEAction = function (a, b) {
  27965. switch (b) {
  27966. case 'onclick':
  27967. a._listeners &&
  27968. a._listeners.click &&
  27969. a._listeners.click.forEach(function (a) {
  27970. a();
  27971. });
  27972. break;
  27973. case 'onhover':
  27974. a._listeners &&
  27975. a._listeners.hover &&
  27976. a._listeners.hover.forEach(function (a) {
  27977. a();
  27978. });
  27979. break;
  27980. case 'onout':
  27981. a._listeners &&
  27982. a._listeners.out &&
  27983. a._listeners.out.forEach(function (a) {
  27984. a();
  27985. });
  27986. }
  27987. }),
  27988. (this.startAnimate = function (a) {
  27989. this.tweenFlag && this.initAnimation(a);
  27990. }),
  27991. (this.initAnimation = function (a) {
  27992. var b = this,
  27993. c = this.cursor.material.map.offset,
  27994. d = function (a) {
  27995. return Math.floor(17 * a) / 17;
  27996. };
  27997. (b.tweenFlag = !1),
  27998. (this.cursorAnimate = new TWEEN.Tween(c)
  27999. .to(
  28000. {
  28001. x: 1,
  28002. },
  28003. 1e3
  28004. )
  28005. .onStart(function () {
  28006. b.tweenFlag = !1;
  28007. })
  28008. .onStop(function () {
  28009. (b.tweenFlag = !0), (this.x = 0), (c.x = 0);
  28010. })
  28011. .onUpdate(function () {})
  28012. .onComplete(function () {
  28013. a(),
  28014. (c.x = 0),
  28015. setTimeout(function () {
  28016. b.tweenFlag = !0;
  28017. }, 1500);
  28018. })),
  28019. this.cursorAnimate.easing(d),
  28020. this.cursorAnimate.start();
  28021. }),
  28022. (this.autoCursorPosition = function (a) {
  28023. // var b = Math.abs(a.distance - 10);
  28024. // this.cursor.position.z = -b,
  28025. // b /= 10;
  28026. // alert(b);
  28027. // this.cursor.scale.set(b, b, b)
  28028. this.cursor.scale.set(0.3, 0.3, 0.3);
  28029. });
  28030. }),
  28031. (n.prototype.vrRenderer = function (a, b, c) {
  28032. var d = new b.vrCamera(c);
  28033. (d.bananaAspect = 0.8), this.width, this.height;
  28034. var b = this;
  28035. (this.setSize = function (c, d) {
  28036. a.setSize.call(this, c, d), (b.width = c), (b.height = d);
  28037. }),
  28038. (this.render = function (b, c, e, f) {
  28039. window.cameraQua = c.quaternion.clone();
  28040. var g, h;
  28041. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f);
  28042. if ('PerspectiveCamera' === c.type)
  28043. (g = d.cameraL),
  28044. (h = d.cameraR),
  28045. b.updateMatrixWorld(),
  28046. null === c.parent && c.updateMatrixWorld(),
  28047. d.vrCameraUpdate(c);
  28048. else {
  28049. if ('OrthographicCamera' !== c.type)
  28050. return DEBUG && console.error('Unsupported renderer: ', c.type);
  28051. g = h = c;
  28052. }
  28053. a.setScissorTest(!0),
  28054. a.setScissor(0, 0, this.width / 2, this.height),
  28055. a.setViewport(0, 0, this.width / 2, this.height),
  28056. a.render.call(this, b, g, e, f),
  28057. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  28058. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  28059. a.render.call(this, b, h, e, f),
  28060. a.setScissorTest(!1);
  28061. }),
  28062. (this.__proto__ = {
  28063. __proto__: a,
  28064. });
  28065. }),
  28066. (n.prototype.vrCamera = function (a) {
  28067. (this.type = 'StereoCamera'),
  28068. (this._aspect = 1),
  28069. (this._overlap = 0.064),
  28070. (this.cameraL = new r.PerspectiveCamera()),
  28071. this.cameraL.layers.enable(1),
  28072. (this.cameraL.near = 0.01), //xzw add
  28073. (this.cameraL.matrixAutoUpdate = !1),
  28074. (this.cameraR = new r.PerspectiveCamera()),
  28075. this.cameraR.layers.enable(2),
  28076. (this.cameraR.near = 0.01), //xzw add
  28077. (this.cameraR.matrixAutoUpdate = !1),
  28078. (this.eyeRight = new r.Matrix4()),
  28079. (this.eyeLeft = new r.Matrix4()),
  28080. (this.vrCameraNeedsUpdate = !0),
  28081. (window.vrCameraL = this.cameraL); // fyz 记录vr相机
  28082. Object.defineProperty(this, 'bananaAspect', {
  28083. get: function () {
  28084. return this._aspect;
  28085. },
  28086. set: function (a) {
  28087. this._aspect !== a && (this.vrCameraNeedsUpdate = !0), (this._aspect = a);
  28088. },
  28089. }),
  28090. Object.defineProperty(this, 'overlap', {
  28091. get: function () {
  28092. return this._overlap;
  28093. },
  28094. set: function (a) {
  28095. this._overlap !== a && (this.vrCameraNeedsUpdate = !0), (this._overlap = a);
  28096. },
  28097. }),
  28098. (this.vrCameraUpdate = function (a) {
  28099. this.vrCameraNeedsUpdate = true;
  28100. if (
  28101. ((this.vrCameraNeedsUpdate =
  28102. this.vrCameraNeedsUpdate ||
  28103. this.bananaFov !== a.fov ||
  28104. this.bananaReal_aspect !== a.aspect * this.bananaAspect ||
  28105. this.bananaNear !== a.near ||
  28106. this.bananaFar !== a.far),
  28107. this.vrCameraNeedsUpdate)
  28108. ) {
  28109. (this.vrCameraNeedsUpdate = !1),
  28110. //console.debug("vrCameraUpdate"),
  28111. (this.bananaFocus = a.focus),
  28112. (this.bananaFov = a.fov),
  28113. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  28114. (this.bananaNear = a.near),
  28115. (this.bananaFar = a.far),
  28116. //console.debug(a.aspect),
  28117. (this.bananaFocus = 10);
  28118. var b,
  28119. c,
  28120. d = a.projectionMatrix.clone(),
  28121. e = this.overlap / 2,
  28122. f = (e * this.bananaNear) / this.bananaFocus,
  28123. g = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5);
  28124. (this.eyeLeft.elements[12] = -e),
  28125. (this.eyeRight.elements[12] = e),
  28126. (b = -g * this.bananaReal_aspect + f),
  28127. (c = g * this.bananaReal_aspect + f),
  28128. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28129. (d.elements[8] = (c + b) / (c - b)),
  28130. this.cameraL.projectionMatrix.copy(d),
  28131. (b = -g * this.bananaReal_aspect - f),
  28132. (c = g * this.bananaReal_aspect - f),
  28133. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28134. (d.elements[8] = (c + b) / (c - b)),
  28135. this.cameraR.projectionMatrix.copy(d);
  28136. }
  28137. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  28138. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight);
  28139. });
  28140. }),
  28141. (n.prototype.boluoGetTexture = function (a) {
  28142. var b = new r.TextureLoader();
  28143. return (b.crossOrigin = 'anonymous'), b.load(a);
  28144. });
  28145. /* let webxr = {
  28146. init(renderer) {
  28147. this.renderer = renderer
  28148. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  28149. renderer.xr.enabled = true
  28150. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  28151. //pico firefox
  28152. var mode = 'immersive-vr'
  28153. navigator.xr
  28154. .isSessionSupported(mode)
  28155. .then(supported => {
  28156. if (!supported) {
  28157. this.xrNotFound('isSessionSupported not supported')
  28158. } else {
  28159. this.xrType = 'xr' //showEnterXR();
  28160. }
  28161. })
  28162. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  28163. } else if ('getVRDisplays' in navigator) {
  28164. //pico 的vr browser是这个
  28165. console.log('getVRDisplays')
  28166. let setDevice = device => {
  28167. this.xrType = 'vr'
  28168. this.device = device
  28169. this.renderer.xr.setDevice(device) //新版是renderer.vr
  28170. }
  28171. window.addEventListener(
  28172. 'vrdisplayconnect',
  28173. function (event) {
  28174. setDevice(event.display)
  28175. },
  28176. false
  28177. )
  28178. window.addEventListener(
  28179. 'vrdisplaydisconnect',
  28180. function ( ) {
  28181. console.log('vrdisplaydisconnect')
  28182. window.bus.dispatchEvent({type:'exitWebXR'})
  28183. },
  28184. false
  28185. )
  28186. window.addEventListener(
  28187. 'vrdisplaypresentchange',
  28188. function (event) {
  28189. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  28190. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  28191. },
  28192. false
  28193. )
  28194. window.addEventListener(
  28195. 'vrdisplayactivate',
  28196. function (event) {
  28197. event.display.requestPresent([{ source: this.renderer.domElement }])
  28198. },
  28199. false
  28200. )
  28201. navigator
  28202. .getVRDisplays()
  28203. .then(function (displays) {
  28204. if (displays.length > 0) {
  28205. setDevice(displays[0])
  28206. } else {
  28207. this.xrNotFound('no displays')
  28208. }
  28209. })
  28210. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  28211. } else {
  28212. this.xrNotFound('xr not supported')
  28213. }
  28214. },
  28215. enterVR() {
  28216. if (!this.xrType) return //不支持
  28217. console.log('enterVR', this.xrType)
  28218. if (this.xrType == 'vr') {
  28219. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  28220. } else if (this.xrType == 'xr') {
  28221. if (this.currentSession == void 0) {
  28222. console.log('this.currentSession == void 0 ')
  28223. function getXRSessionInit(mode, options) {
  28224. var space = (options || {}).referenceSpaceType || 'local-floor'
  28225. var sessionInit = (options && options.sessionInit) || {}
  28226. // Nothing to do for default features.
  28227. if (space == 'viewer') return sessionInit
  28228. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  28229. // If the user already specified the space as an optional or required feature, don't do anything.
  28230. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  28231. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  28232. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  28233. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  28234. // request it later.
  28235. var newInit = Object.assign({}, sessionInit)
  28236. newInit.requiredFeatures = [space]
  28237. if (sessionInit.requiredFeatures) {
  28238. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  28239. }
  28240. return newInit
  28241. }
  28242. let onSessionEnded = ( ) => {
  28243. console.log('onSessionEnded')
  28244. this.currentSession.removeEventListener('end', onSessionEnded)
  28245. setTimeout(()=>{
  28246. this.renderer.xr.setSession(null)
  28247. this.currentSession = null
  28248. window.bus.dispatchEvent({type:'exitWebXR'})
  28249. },1)//延迟原因:先使THREE里的onSessionEnded执行
  28250. }
  28251. let onSessionStarted = session => {
  28252. console.log('onSessionStarted')
  28253. session.addEventListener('end', onSessionEnded)
  28254. this.renderer.xr.setSession(session)
  28255. this.currentSession = session
  28256. }
  28257. var mode = 'immersive-vr'
  28258. var sessionInit = getXRSessionInit(mode)
  28259. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  28260. } else {
  28261. console.log('this.currentSession.end()', this.currentSession)
  28262. this.currentSession.end()
  28263. }
  28264. }
  28265. },
  28266. xrNotFound(text) {
  28267. console.log('xrNotFound:', text)
  28268. },
  28269. } */
  28270. /***********************************************************************************************************************************************************************************/
  28271. (n.prototype.updateScreenSize = (function () {
  28272. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  28273. var W, H; //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  28274. return function (o) {
  28275. var render = false;
  28276. var ratio;
  28277. var w, h; //记录应当render的大小
  28278. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  28279. (w = o.width), (h = o.height), (render = true), (ratio = 1);
  28280. } else {
  28281. w = $('#player').width();
  28282. h = $('#player').height();
  28283. o && o.resize && ((W = this.renderWidth), (H = this.renderHeight));
  28284. (w !== W || h !== H || this.forceUpdateSize) &&
  28285. ((W = w), (H = h), (render = true), (ratio = window.devicePixelRatio));
  28286. }
  28287. if (render) {
  28288. this.setSize(w, h, ratio);
  28289. this.forceUpdateSize = !1;
  28290. }
  28291. };
  28292. })()),
  28293. (n.prototype.updateComponents = function () {
  28294. for (
  28295. var e = Math.min(1, this.updateClock.getDelta()), t = 0;
  28296. t < this.updateListeners.length;
  28297. t++
  28298. )
  28299. this.updateListeners[t].update(e);
  28300. }),
  28301. (n.prototype.suspend = function () {
  28302. (this.started = !1),
  28303. (this.suspendedObjects = this.scene.children.map(
  28304. function (e) {
  28305. return this.scene.remove(e), e;
  28306. }.bind(this)
  28307. )),
  28308. this.render();
  28309. }),
  28310. (n.prototype.resume = function () {
  28311. this.suspendedObjects.forEach(
  28312. function (e) {
  28313. this.scene.add(e);
  28314. }.bind(this)
  28315. ),
  28316. (this.suspendedObjects = []),
  28317. (this.started = !0),
  28318. p();
  28319. });
  28320. var p = function () {
  28321. this.started &&
  28322. (window.requestAnimationFrame(p),
  28323. this.updateScreenSize(), // fyz resize
  28324. this.updateComponents(),
  28325. this.updateTextureMemory(),
  28326. this.render(),
  28327. window.stats && (window.fps = stats.update()),
  28328. this.emit(a.AfterRender));
  28329. };
  28330. (n.prototype.getImageData = (function () {
  28331. var e = document.createElement('canvas'),
  28332. t = e.getContext('2d');
  28333. return function (i, n, r) {
  28334. return (
  28335. (e.width === n && e.height === r) || ((e.width = n), (e.height = r)),
  28336. t.drawImage(i, 0, 0, n, r),
  28337. t.getImageData(0, 0, n, r)
  28338. );
  28339. };
  28340. })()),
  28341. (n.prototype.initSizedTexture2D = function (e, t, i) {
  28342. var n = this.renderer,
  28343. o = n.context,
  28344. a = n.state,
  28345. s = new r.Texture(null);
  28346. (s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i);
  28347. var l = n.paramThreeToGL(s.format),
  28348. c = n.paramThreeToGL(s.type),
  28349. h = n.properties.get(s),
  28350. u = o.createTexture();
  28351. a.bindTexture(o.TEXTURE_2D, u),
  28352. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  28353. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  28354. (s.wrapS = t),
  28355. (s.wrapT = t);
  28356. var d = n.paramThreeToGL(t);
  28357. return (
  28358. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  28359. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  28360. i
  28361. ? ((s.magFilter = r.LinearFilter),
  28362. (s.minFilter = r.LinearMipMapLinearFilter),
  28363. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28364. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  28365. o.generateMipmap(o.TEXTURE_2D))
  28366. : ((s.magFilter = r.LinearFilter),
  28367. (s.minFilter = r.LinearFilter),
  28368. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28369. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  28370. a.bindTexture(o.TEXTURE_2D, null),
  28371. (h.__webglTexture = u),
  28372. s
  28373. );
  28374. }),
  28375. (n.prototype.initSizedCubeMap = function (e, t) {
  28376. var i = this.renderer,
  28377. n = i.context,
  28378. o = i.state,
  28379. a = new r.CubeTexture([null, null, null, null, null, null]);
  28380. (a.flipY = !1), (a.generateMipmaps = t);
  28381. var s = i.paramThreeToGL(a.format),
  28382. l = i.paramThreeToGL(a.type),
  28383. c = i.properties.get(a),
  28384. h = n.createTexture();
  28385. o.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  28386. for (var u = 0; u < 6; u++)
  28387. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  28388. return (
  28389. t
  28390. ? ((a.magFilter = r.LinearFilter),
  28391. (a.minFilter = r.LinearMipMapLinearFilter),
  28392. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28393. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  28394. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  28395. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  28396. : ((a.magFilter = r.LinearFilter),
  28397. (a.minFilter = r.LinearFilter),
  28398. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28399. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  28400. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  28401. (c.__image__webglTextureCube = h),
  28402. a
  28403. );
  28404. }),
  28405. (n.prototype.deallocateCubeTexture = function (e) {
  28406. var t = this.renderer,
  28407. i = t.context,
  28408. n = t.properties.get(e);
  28409. i.deleteTexture(n.__image__webglTextureCube);
  28410. }),
  28411. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  28412. var a = this.renderer,
  28413. s = a.context,
  28414. l = a.state,
  28415. c = a.properties.get(t);
  28416. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  28417. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28418. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  28419. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  28420. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  28421. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  28422. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  28423. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  28424. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  28425. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  28426. l.bindTexture(s.TEXTURE_2D, null);
  28427. }),
  28428. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  28429. var s = this.renderer,
  28430. l = s.context,
  28431. c = s.state,
  28432. h = s.properties.get(t);
  28433. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  28434. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28435. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  28436. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  28437. c.bindTexture(l.TEXTURE_CUBE_MAP, null);
  28438. }),
  28439. (n.prototype.rebuildMipMaps2D = function (e) {
  28440. var t = this.renderer,
  28441. i = t.context,
  28442. n = t.state;
  28443. t.properties.get(e);
  28444. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null);
  28445. }),
  28446. (n.prototype.rebuildMipMaps3D = function (e) {
  28447. var t = this.renderer,
  28448. i = t.context,
  28449. n = t.state,
  28450. r = t.properties.get(e);
  28451. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  28452. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  28453. n.bindTexture(i.TEXTURE_CUBE_MAP, null);
  28454. }),
  28455. (n.prototype.renderToCubeMap = (function () {
  28456. var e = !1,
  28457. t = null,
  28458. i = null,
  28459. n = null,
  28460. a = null,
  28461. s = null,
  28462. l = 1;
  28463. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  28464. var _ = this.renderer;
  28465. _.context;
  28466. e ||
  28467. ((i = new r.OrthographicCamera(l / -2, l / 2, l / 2, l / -2, -200, 200)),
  28468. (i.position.z = 150),
  28469. (t = new r.Scene()),
  28470. t.add(i),
  28471. (n = new r.ShaderMaterial({
  28472. uniforms: {
  28473. tDiffuse: {
  28474. type: 't',
  28475. value: null,
  28476. },
  28477. alpha: {
  28478. type: 'f',
  28479. value: 1,
  28480. },
  28481. },
  28482. vertexShader: o.basicTextured.vertexShader,
  28483. fragmentShader: o.basicTextured.fragmentShader,
  28484. depthWrite: !1,
  28485. depthTest: !1,
  28486. side: r.DoubleSide,
  28487. })),
  28488. (a = new r.PlaneBufferGeometry(l, l)),
  28489. (s = new r.Mesh(a, n)),
  28490. (s.position.z = 0),
  28491. t.add(s),
  28492. (e = !0));
  28493. var T = a.getAttribute('uv');
  28494. T.setDynamic(!0), (T.needsUpdate = !0);
  28495. var x = T.array,
  28496. S = p / u,
  28497. M = f / d,
  28498. R = g / u,
  28499. P = m / d;
  28500. (x[0] = S),
  28501. (x[1] = M + P),
  28502. (x[2] = S + R),
  28503. (x[3] = M + P),
  28504. (x[4] = S),
  28505. (x[5] = M),
  28506. (x[6] = S + R),
  28507. (x[7] = M);
  28508. var O = a.getAttribute('position');
  28509. O.setDynamic(!0), (O.needsUpdate = !0);
  28510. var L = O.array,
  28511. D = v / h.width - l / 2,
  28512. N = A / h.height - l / 2,
  28513. B = y / h.width,
  28514. F = C / h.height;
  28515. (L[0] = D),
  28516. (L[1] = N + F),
  28517. (L[3] = D + B),
  28518. (L[4] = N + F),
  28519. (L[6] = D),
  28520. (L[7] = N),
  28521. (L[9] = D + B),
  28522. (L[10] = N);
  28523. this.renderer.properties.get(c);
  28524. (n.uniforms.tDiffuse.value = c),
  28525. (n.blending = E || r.NoBlending),
  28526. (n.transparent = !!b),
  28527. (void 0 !== w && null !== w) || (w = 1),
  28528. (n.uniforms.alpha.value = w),
  28529. (n.needUpdate = !0),
  28530. (h.activeCubeFace = I),
  28531. h.viewport.set(0, 0, h.width, h.height);
  28532. var V = this.renderer.autoClear;
  28533. (this.renderer.autoClear = !1),
  28534. this.renderer.render(t, i, h, !1),
  28535. (this.renderer.autoClear = V);
  28536. };
  28537. })()),
  28538. (n.prototype.copyCubeMap = (function () {
  28539. var e = !1,
  28540. t = null,
  28541. i = null,
  28542. a = null,
  28543. s = null,
  28544. l = null,
  28545. c = new r.Euler();
  28546. new r.Vector3();
  28547. return function (h, u, d, p, f, g, m, v, A) {
  28548. if (f > this.qualityManager.maxRenderTargetSize) return; //add
  28549. this.renderer;
  28550. if (!e) {
  28551. var y = 2;
  28552. (i = new r.OrthographicCamera(y / -2, y / 2, y / 2, y / -2, 0, 200)),
  28553. i.position.set(0, 0, 0),
  28554. (t = new r.Scene()),
  28555. t.add(i),
  28556. (a = new r.ShaderMaterial({
  28557. uniforms: {
  28558. tDiffuse: {
  28559. type: 't',
  28560. value: null,
  28561. },
  28562. alpha: {
  28563. type: 'f',
  28564. value: 1,
  28565. },
  28566. },
  28567. vertexShader: o.copyCubeMap.vertexShader,
  28568. fragmentShader: o.copyCubeMap.fragmentShader,
  28569. depthWrite: !1,
  28570. depthTest: !1,
  28571. side: r.DoubleSide,
  28572. })),
  28573. (s = new r.BoxGeometry(y, y, y)),
  28574. (l = new r.Mesh(s, a)),
  28575. t.add(l),
  28576. (e = !0);
  28577. }
  28578. for (var C = 0; C < 6; C++)
  28579. n.getCubeOrientationForCubeFace(C, c),
  28580. l.rotation.copy(c),
  28581. (l.matrixWorldNeedsUpdate = !0),
  28582. l.updateMatrixWorld(),
  28583. (a.uniforms.tDiffuse.value = h),
  28584. (a.blending = m || r.NoBlending),
  28585. (a.transparent = !!v),
  28586. (void 0 !== A && null !== A) || (A = 1),
  28587. (a.uniforms.alpha.value = A),
  28588. (a.needUpdate = !0),
  28589. (u.activeCubeFace = C),
  28590. u.viewport.set(0, 0, f, g),
  28591. this.renderer.render(t, i, u, !1);
  28592. };
  28593. })()),
  28594. (n.getLookAtForCubeFace = function (e, t) {
  28595. switch (e) {
  28596. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28597. t.set(1, 0, 0);
  28598. break;
  28599. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28600. t.set(-1, 0, 0);
  28601. break;
  28602. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28603. t.set(0, 1, 0);
  28604. break;
  28605. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28606. t.set(0, -1, 0);
  28607. break;
  28608. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28609. t.set(0, 0, 1);
  28610. break;
  28611. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28612. t.set(0, 0, -1);
  28613. }
  28614. }),
  28615. (n.getCubeOrientationForCubeFace = function (e, t) {
  28616. switch (e) {
  28617. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28618. t.set(0, -Math.PI / 2, 0);
  28619. break;
  28620. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28621. t.set(0, Math.PI / 2, 0);
  28622. break;
  28623. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28624. t.set(Math.PI / 2, Math.PI, 0);
  28625. break;
  28626. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28627. t.set(-Math.PI / 2, Math.PI, 0);
  28628. break;
  28629. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28630. t.set(0, -Math.PI, 0);
  28631. break;
  28632. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28633. t.set(0, 0, 0);
  28634. }
  28635. }),
  28636. (t.exports = n);
  28637. },
  28638. {
  28639. '../enum/GLCubeFaces': 25,
  28640. '../enum/GLTextureType': 26,
  28641. '../enum/SceneRendererEvents': 43,
  28642. '../exception/BasicException': 55,
  28643. '../exception/RendererCreationException': 57,
  28644. '../settings': 166,
  28645. '../shaders': 167,
  28646. /********************************************************************fyz改 from徐世廷**********************************************************************/
  28647. '../util/browser': 182,
  28648. /************************************************************************************************************************************************/
  28649. events: 202,
  28650. three: 217,
  28651. },
  28652. ],
  28653. 159: [
  28654. function (e, t, i) {
  28655. 'use strict';
  28656. function n(e) {
  28657. (this.messenger = new a(e)), (this.clientKey = null);
  28658. }
  28659. var r = e('../util/ajax'),
  28660. o = e('./PostMessageType'),
  28661. a = e('./postmessage'),
  28662. s = e('./VersionInfo'),
  28663. l = e('events').EventEmitter,
  28664. c = window.location.origin + '/api/v1/user/';
  28665. (n.prototype = Object.create(l.prototype)),
  28666. (n.prototype.bindEvents = function () {
  28667. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this));
  28668. }),
  28669. (n.prototype.waitForConnection = function () {
  28670. var e = new Promise(
  28671. function (e, t) {
  28672. this.messenger.on(
  28673. o.CONNECT,
  28674. function (i) {
  28675. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind());
  28676. }.bind(this)
  28677. );
  28678. }.bind(this)
  28679. );
  28680. return e;
  28681. }),
  28682. (n.prototype.onConnectionReceived = function (e) {
  28683. return (
  28684. this.messenger.setTarget(e.source, e.origin),
  28685. this.verifyConnection(e).then(
  28686. function (t, i) {
  28687. this.messenger.send({
  28688. type: o.ACCEPT,
  28689. toId: e.fromId,
  28690. warning: i,
  28691. }),
  28692. (this.clientKey = t),
  28693. this.messenger.removeAllListeners(o.CONNECT),
  28694. this.bindEvents();
  28695. }.bind(this),
  28696. function (t) {
  28697. this.messenger.send({
  28698. type: o.REJECT,
  28699. toId: e.fromId,
  28700. reason: t,
  28701. }),
  28702. this.messenger.setTarget();
  28703. }.bind(this)
  28704. )
  28705. );
  28706. }),
  28707. (n.prototype.verifyConnection = function (e) {
  28708. return new Promise(function (t, i) {
  28709. var n;
  28710. if (s.isDeprecated(e.sdkVersion)) n = '这个版本正在被弃用';
  28711. else if (!s.isSupported(e.sdkVersion)) return i('不支持此版本的SDK');
  28712. var o = {
  28713. cache: !1,
  28714. headers: {
  28715. 'X-port-Application-Key': e.applicationKey,
  28716. 'X-port-Referrer': e.origin,
  28717. },
  28718. };
  28719. r.get(c, o)
  28720. .done(t.bind(this, e.applicationKey, n))
  28721. .fail(i.bind(this, 'key/referrer mismatch'));
  28722. });
  28723. }),
  28724. (n.prototype.onMessageReceived = function (e) {
  28725. if (this.validateClientApplicationKey(e.applicationKey)) {
  28726. var t = this;
  28727. (e.onDone = function (i) {
  28728. (i.toId = e.fromId), (i.uid = e.uid), (i.type = o.RESPONSE), t.messenger.send(i);
  28729. }),
  28730. this.emit(o.ACTION, e);
  28731. }
  28732. }),
  28733. (n.prototype.validateClientApplicationKey = function (e) {
  28734. return this.clientKey === e;
  28735. }),
  28736. (n.prototype.sendEvent = function (e, t) {
  28737. this.messenger.send({
  28738. type: o.EVENT,
  28739. eventType: e,
  28740. eventData: t,
  28741. });
  28742. }),
  28743. (t.exports = n);
  28744. },
  28745. {
  28746. '../util/ajax': 181,
  28747. './PostMessageType': 160,
  28748. './VersionInfo': 163,
  28749. './postmessage': 165,
  28750. events: 202,
  28751. },
  28752. ],
  28753. 160: [
  28754. function (e, t, i) {
  28755. 'use strict';
  28756. t.exports = Object.freeze({
  28757. CONNECT: 'postmessage.connect',
  28758. ACCEPT: 'postmessage.accept',
  28759. REJECT: 'postmessage.reject',
  28760. ACTION: 'postmessage.action',
  28761. RESPONSE: 'postmessage.response',
  28762. EVENT: 'postmessage.event',
  28763. });
  28764. },
  28765. {},
  28766. ],
  28767. 161: [
  28768. function (e, t, i) {
  28769. 'use strict';
  28770. t.exports = Object.freeze({
  28771. MOVE: 'sdk.move',
  28772. ENTER_PANO: 'sdk.enterpano',
  28773. MODEL_LOADED: 'sdk.modelloaded',
  28774. });
  28775. },
  28776. {},
  28777. ],
  28778. 162: [
  28779. function (e, t, i) {
  28780. 'use strict';
  28781. t.exports = Object.freeze({
  28782. FLY: 'transition.fly',
  28783. FADEOUT: 'transition.fade',
  28784. INSTANT: 'transition.instant',
  28785. });
  28786. },
  28787. {},
  28788. ],
  28789. 163: [
  28790. function (e, t, i) {
  28791. 'use strict';
  28792. t.exports = {
  28793. current: '1.0',
  28794. supported: ['1.0'],
  28795. deprecated: [],
  28796. isSupported: function (e) {
  28797. return this.supported.indexOf(e) !== -1;
  28798. },
  28799. isDeprecated: function (e) {
  28800. return this.deprecated.indexOf(e) !== -1;
  28801. },
  28802. isValid: function (e) {
  28803. return this.isSupported(e) || this.isDeprecated(e);
  28804. },
  28805. };
  28806. },
  28807. {},
  28808. ],
  28809. 164: [
  28810. function (e, t, i) {
  28811. (function (i) {
  28812. 'use strict';
  28813. function n(e, t, i) {
  28814. e && (e = e.toLowerCase().trim());
  28815. var n = new I.UP.clone(),
  28816. r = Math.PI / 3,
  28817. o = Math.PI / 2;
  28818. switch (e) {
  28819. case 'left':
  28820. i.copy(t), i.applyAxisAngle(n, o);
  28821. break;
  28822. case 'right':
  28823. i.copy(t), i.applyAxisAngle(n, -o);
  28824. break;
  28825. case 'forwardleft':
  28826. i.copy(t), i.applyAxisAngle(n, r);
  28827. break;
  28828. case 'forwardright':
  28829. i.copy(t), i.applyAxisAngle(n, -r);
  28830. break;
  28831. case 'forward':
  28832. default:
  28833. i.copy(t);
  28834. }
  28835. return i;
  28836. }
  28837. function r(e, t) {
  28838. if (e) {
  28839. var i = {
  28840. pano: e,
  28841. lookAtPoint: null,
  28842. duration: null,
  28843. maxDistanceOverride: null,
  28844. skipWarpingCheck: !1,
  28845. };
  28846. this.player.flyToPano(i, function () {
  28847. t &&
  28848. t({
  28849. success: !0,
  28850. message: 'Transition complete.',
  28851. });
  28852. });
  28853. } else
  28854. R.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  28855. t &&
  28856. t({
  28857. success: !1,
  28858. error: 'Unable to find pano.',
  28859. });
  28860. }
  28861. function o(e, t) {
  28862. var i = this.findRankedPano(e, t);
  28863. return i >= 0
  28864. ? this.handleToObject[i]
  28865. : (R.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null);
  28866. }
  28867. function a(e, t) {
  28868. var i = this.findRankedtag(e, t);
  28869. return i >= 0
  28870. ? this.handleToObject[i]
  28871. : (R.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null);
  28872. }
  28873. function s(e, t) {
  28874. t.copy(I.FORWARD), e.getDirection(t);
  28875. }
  28876. function l(e) {
  28877. function t(e) {
  28878. var t = new c.Euler().setFromQuaternion(e.quaternion, 'YXZ');
  28879. return {
  28880. x: c.Math.radToDeg(t._x),
  28881. y: c.Math.radToDeg(t._y),
  28882. z: c.Math.radToDeg(t._z),
  28883. };
  28884. }
  28885. var i = function (e) {
  28886. return e.alignmentType !== m.ALIGNED
  28887. ? null
  28888. : {
  28889. x: e.position.x,
  28890. y: e.position.y,
  28891. z: e.position.z,
  28892. };
  28893. };
  28894. return {
  28895. panos: e.panos.list.map(function (n) {
  28896. var r = y.getCubemapUrls(e.urls, n.id, 'high')[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  28897. return {
  28898. uuid: n.id,
  28899. aligned: n.alignmentType === m.ALIGNED,
  28900. neighbourUUIDs: n.neighbourUUIDs.slice(),
  28901. position: i(n),
  28902. rotation: t(n),
  28903. thumbnail: r,
  28904. };
  28905. }),
  28906. };
  28907. }
  28908. var c = e('three'),
  28909. h = e('./ApiHost'),
  28910. u = e('../util/logger'),
  28911. d = e('../util/common'),
  28912. p = e('../util/math'),
  28913. f = e('../enum/ModelManagerEvents'),
  28914. g = e('./PostMessageType'),
  28915. m = e('../enum/AlignmentType'),
  28916. v = e('../enum/Direction'),
  28917. A = e('./TransitionStyles'),
  28918. y = e('../util/panorama'),
  28919. C = e('../enum/GLCubeFaces'),
  28920. I = e('../enum/Vectors'),
  28921. E = e('../enum/Viewmode'),
  28922. b = e('../enum/WarpStyle'),
  28923. w = (e('../enum/Keys'), e('../enum/PlayerEvents')),
  28924. _ = e('../sdk/SdkEvents'),
  28925. I = e('../enum/Vectors'),
  28926. T = e('../enum/ControlEvents'),
  28927. x = e('../enum/RenderLayers'),
  28928. S = (e('../constants'), e('../settings')),
  28929. M = e('../lib/jpeg_encoder'),
  28930. R = new u(i),
  28931. P = (function () {
  28932. var e = function e() {
  28933. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  28934. e.player.getDirection(e.playerDirection),
  28935. e.projectVectors();
  28936. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  28937. if (((e.angleTravelled += Math.abs(t)), e.angleTravelled >= Math.abs(e.angle))) {
  28938. if (((e.active = !1), e.onDone)) {
  28939. var i = e.onDone;
  28940. i();
  28941. }
  28942. } else e.lastFacingDirection.copy(e.playerDirection), window.setTimeout(e, 4);
  28943. };
  28944. return (
  28945. (e.active = !1),
  28946. (e.angle = 0),
  28947. (e.angleTravelled = 0),
  28948. (e.playerDirection = new c.Vector3()),
  28949. (e.lastFacingDirection = new c.Vector3()),
  28950. (e.onDone = null),
  28951. (e.player = null),
  28952. (e.start = function (t, i, n, r) {
  28953. (e.active = !0),
  28954. t && i && (i = 0),
  28955. (e.angle = t || i),
  28956. (e.xAngle = t),
  28957. (e.yAngle = i),
  28958. (e.angleTravelled = 0),
  28959. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  28960. n.getDirection(e.playerDirection),
  28961. e.lastFacingDirection.copy(e.playerDirection),
  28962. e.projectVectors(),
  28963. (e.onDone = r),
  28964. (e.player = n),
  28965. e();
  28966. }),
  28967. (e.projectVectors = function () {
  28968. e.xAngle &&
  28969. (e.playerDirection.projectOnPlane(I.UP),
  28970. e.lastFacingDirection.projectOnPlane(I.UP));
  28971. }),
  28972. e
  28973. );
  28974. })(),
  28975. O = (function () {
  28976. var e = new c.Vector3();
  28977. return function (t) {
  28978. t
  28979. ? (e.copy(t.position),
  28980. e.add(t.discPosition),
  28981. p.projectPositionToCanvas(e, this.player.camera, e),
  28982. this.click(e.x, e.y))
  28983. : R.warn('Showcase -> clicktagObject: Unable to find tag.');
  28984. };
  28985. })(),
  28986. L = function () {
  28987. return this.player.mode === E.PANORAMA
  28988. ? S.insideLookLimitUp
  28989. : this.player.mode === E.DOLLHOUSE
  28990. ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle)
  28991. : null;
  28992. },
  28993. D = function () {
  28994. return this.player.mode === E.PANORAMA
  28995. ? S.insideLookLimitDown
  28996. : this.player.mode === E.DOLLHOUSE
  28997. ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle)
  28998. : null;
  28999. },
  29000. N = (function (e) {
  29001. var t = new c.Vector3();
  29002. return function (e) {
  29003. var i = this.player.getDirection();
  29004. t.copy(i);
  29005. var n = t.y;
  29006. (t.y = 0), t.normalize();
  29007. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  29008. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  29009. return (
  29010. 0 !== e &&
  29011. R.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'),
  29012. 0
  29013. );
  29014. this.player.mode === E.DOLLHOUSE && (r = -r);
  29015. var o = L.call(this) - 0.1,
  29016. a = D.call(this) + 0.1,
  29017. s = r + e;
  29018. s > o ? (s = o) : s < a && (s = a);
  29019. var l = s - r;
  29020. return e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l;
  29021. };
  29022. })(),
  29023. B = (function () {
  29024. var e = new c.Euler();
  29025. return function (t) {
  29026. return (
  29027. e.setFromQuaternion(t.quaternion, 'YXZ'),
  29028. {
  29029. position: {
  29030. x: t.position.x,
  29031. y: t.position.y,
  29032. z: t.position.z,
  29033. },
  29034. rotation: {
  29035. x: c.Math.radToDeg(e.x),
  29036. y: c.Math.radToDeg(e.y),
  29037. z: 0,
  29038. },
  29039. pano: t.currentPano ? t.currentPano.id : null,
  29040. mode: t.mode,
  29041. }
  29042. );
  29043. };
  29044. })(),
  29045. F = null;
  29046. t.exports = {
  29047. init: function (e, t, i, n, r) {
  29048. V.init(e, t, i, r),
  29049. (F = new Promise(
  29050. function (e, t) {
  29051. i.on(w.Ready, function () {
  29052. e();
  29053. });
  29054. }.bind(this)
  29055. ));
  29056. var o = new h(window),
  29057. a = o.waitForConnection();
  29058. a.then(function (e) {
  29059. o.on(g.ACTION, V.onMessageReceive.bind(V));
  29060. });
  29061. var s = (function () {
  29062. var e = Date.now();
  29063. return function () {
  29064. if (!(Date.now() - e < 100)) {
  29065. var t = B(i);
  29066. o.sendEvent(_.MOVE, {
  29067. state: t,
  29068. }),
  29069. (e = Date.now());
  29070. }
  29071. };
  29072. })();
  29073. i.on(w.Move, s),
  29074. i.on(w.ViewChanged, s),
  29075. n.on(f.ActiveModelChanged, function (e) {
  29076. function t(e) {
  29077. var t,
  29078. i = e.newPano.id;
  29079. e.oldPano && (t = e.oldPano.id),
  29080. i !== t &&
  29081. o.sendEvent(_.ENTER_PANO, {
  29082. oldPano: t,
  29083. newPano: i,
  29084. });
  29085. }
  29086. var i = e.model,
  29087. n = e.oldModel;
  29088. (V.model = i),
  29089. a.then(function () {
  29090. o.sendEvent(_.MODEL_LOADED, {
  29091. metadata: l(i),
  29092. });
  29093. }),
  29094. n &&
  29095. n.panos.forEach(function (e) {
  29096. e.removeEventListener('enter', t);
  29097. }),
  29098. i.panos.forEach(function (e) {
  29099. e.on('enter', t);
  29100. });
  29101. });
  29102. },
  29103. };
  29104. var V = {
  29105. director: null,
  29106. player: null,
  29107. controls: null,
  29108. sceneRenderer: null,
  29109. model: null,
  29110. init: function (e, t, i, n) {
  29111. (this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n);
  29112. },
  29113. handleToObject: {},
  29114. objectToHandle: {},
  29115. handleCount: 0,
  29116. onMessageReceive: function (e) {
  29117. if (e) {
  29118. var t = e.targetFunction,
  29119. i = e.params,
  29120. n = e.onDone;
  29121. t && this[t] && this[t](i, n);
  29122. }
  29123. },
  29124. waitForInit: function (e, t) {
  29125. F.then(
  29126. t.bind({
  29127. success: !0,
  29128. message: 'Init complete.',
  29129. })
  29130. );
  29131. },
  29132. moveToPano: (function (e, t) {
  29133. var i = new c.Euler(0, 0, 0, 'YXZ'),
  29134. n = new c.Quaternion();
  29135. return function (e, t) {
  29136. var r = e.pano,
  29137. o = e.rotation,
  29138. a = e.transition;
  29139. if (!this.model)
  29140. return t({
  29141. success: !1,
  29142. error: 'The model has not been loaded yet',
  29143. });
  29144. var s = this.model.panos.get(r);
  29145. if (!s)
  29146. return t({
  29147. success: !1,
  29148. error: r + ' does not exist in this model',
  29149. });
  29150. if (!o)
  29151. return t({
  29152. sucess: !1,
  29153. erorr: o + ' is not a valid rotation',
  29154. });
  29155. i.set(
  29156. c.Math.degToRad(o.x || 0),
  29157. c.Math.degToRad(o.y || 0),
  29158. c.Math.degToRad(o.z || 0),
  29159. 'YXZ'
  29160. ),
  29161. console.log(o.z);
  29162. var l = {
  29163. success: !0,
  29164. message: r,
  29165. };
  29166. if (a === A.FADEOUT)
  29167. n.setFromEuler(i),
  29168. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  29169. else {
  29170. var h, u;
  29171. a === A.INSTANT && ((h = 0), (u = 0));
  29172. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  29173. this.player.flyToPano(
  29174. {
  29175. pano: s,
  29176. lookAtPoint: d,
  29177. duration: h,
  29178. aimDuration: u,
  29179. },
  29180. t.bind(this, l)
  29181. );
  29182. }
  29183. };
  29184. })(),
  29185. moveInDirection: function (e, t) {
  29186. var i = e.direction;
  29187. return 'undefined' == typeof v[i]
  29188. ? (R.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  29189. void (
  29190. t &&
  29191. t({
  29192. success: !1,
  29193. error: 'Invalid direction.',
  29194. })
  29195. ))
  29196. : void this.player.flyLocalDirection(I[i].clone()).then(function (e) {
  29197. t(
  29198. e
  29199. ? {
  29200. success: !0,
  29201. message: 'moved ' + i,
  29202. }
  29203. : {
  29204. success: !1,
  29205. error: 'Cannot move in direction: ' + i,
  29206. }
  29207. );
  29208. });
  29209. },
  29210. getPose: function (e, t) {
  29211. this.player.camera.position,
  29212. new c.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ');
  29213. return t({
  29214. success: !0,
  29215. message: B(this.player),
  29216. });
  29217. },
  29218. takeScreenShot: (function () {
  29219. var e = new c.PerspectiveCamera(),
  29220. t = new c.WebGLRenderTarget();
  29221. return function (i, n) {
  29222. if (!i.resolution)
  29223. return n({
  29224. success: !1,
  29225. error: 'An invalid resolution was specified',
  29226. });
  29227. if (i.resolution.width === -1 || i.resolution.height === -1) {
  29228. var r = this.sceneRenderer.renderer.getSize();
  29229. (i.resolution.width = r.width), (i.resolution.height = r.height);
  29230. }
  29231. e.layers.set(x.DEFAULT),
  29232. i.visibleObjects &&
  29233. (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  29234. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  29235. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  29236. var o = i.resolution.width,
  29237. a = i.resolution.height,
  29238. s = o / a;
  29239. e.position.copy(this.sceneRenderer.camera.position),
  29240. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  29241. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  29242. (e.projectionMatrix.elements[0] =
  29243. this.player.camera.projectionMatrix.elements[5] / s),
  29244. t.setSize(o, a),
  29245. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  29246. var l = new Uint8Array(o * a * 4);
  29247. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  29248. var c = M.encode(
  29249. {
  29250. data: l,
  29251. width: o,
  29252. height: a,
  29253. heading: 180,
  29254. pitch: 0,
  29255. },
  29256. {
  29257. quality: 75,
  29258. flipY: !0,
  29259. }
  29260. ),
  29261. h = 'data:image/jpg;base64,' + d.uint8ToBase64(c.data);
  29262. n({
  29263. success: !0,
  29264. message: h,
  29265. });
  29266. };
  29267. })(),
  29268. findRankedPano: (function (e, t) {
  29269. var i = new c.Vector3(),
  29270. r = new c.Vector3();
  29271. return function (e, t) {
  29272. s(this.player, r), n(t, r, i);
  29273. var o = this.player.rankedPanoInDirection(e, i);
  29274. if (o) {
  29275. var a = this.objectToHandle[o.id];
  29276. return (
  29277. a ||
  29278. ((this.objectToHandle[o.id] = a = this.handleCount++),
  29279. (this.handleToObject[a] = o)),
  29280. a
  29281. );
  29282. }
  29283. return R.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1;
  29284. };
  29285. })(),
  29286. findRankedtag: (function (e, t) {
  29287. var i = new c.Vector3(),
  29288. r = new c.Vector3();
  29289. return function (e, t) {
  29290. s(this.player, r), n(t, r, i);
  29291. var o = this.player.rankedtagInDirection(e, i);
  29292. if (o) {
  29293. var a = this.objectToHandle[o.sid];
  29294. return (
  29295. a ||
  29296. ((this.objectToHandle[o.sid] = a = this.handleCount++),
  29297. (this.handleToObject[a] = o)),
  29298. a
  29299. );
  29300. }
  29301. return R.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1;
  29302. };
  29303. })(),
  29304. clickNearesttag: function (e) {
  29305. this.clickRankedtag(0, e);
  29306. },
  29307. clickRankedtag: function (e, t) {
  29308. var i = a.call(this, e, t);
  29309. i && O.call(this, i);
  29310. },
  29311. clickNearestPano: function (e, t) {
  29312. this.clickRankedPano(0, e, t);
  29313. },
  29314. clickRankedPano: function (e, t, i) {
  29315. var n = o.call(this, e, t);
  29316. n ? r.call(this, n, i) : i(null);
  29317. },
  29318. clickPano: function (e, t) {
  29319. var i = this.handleTable[e];
  29320. i ? r.call(this, i, t) : t(null);
  29321. },
  29322. rotateDirection: (function () {
  29323. return function (e, t) {
  29324. var i = e.direction,
  29325. n = e.angle;
  29326. if (!P.active) {
  29327. var r = 0,
  29328. o = 0,
  29329. a = 0,
  29330. s = 0;
  29331. if (!n || isNaN(n))
  29332. return (
  29333. R.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  29334. void (
  29335. t &&
  29336. t({
  29337. success: !1,
  29338. error: 'Invalid rotation angle.',
  29339. })
  29340. )
  29341. );
  29342. if (this.player.mode === E.TRANSITIONING)
  29343. return (
  29344. R.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  29345. void (
  29346. t &&
  29347. t({
  29348. success: !1,
  29349. error: 'Cannot rotate while transitioning',
  29350. })
  29351. )
  29352. );
  29353. if (i === v.RIGHT || i === v.LEFT)
  29354. i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n);
  29355. else {
  29356. if (i !== v.UP && i !== v.DOWN)
  29357. return (
  29358. R.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  29359. void (
  29360. t &&
  29361. t({
  29362. success: !1,
  29363. error: 'Invalid direction for rotation.',
  29364. })
  29365. )
  29366. );
  29367. if (this.player.mode === E.FLOORPLAN)
  29368. return (
  29369. R.warn(
  29370. 'Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'
  29371. ),
  29372. void (
  29373. t &&
  29374. t({
  29375. success: !1,
  29376. error: 'Cannot rotate ' + i + ' in floorplan mode',
  29377. })
  29378. )
  29379. );
  29380. if ((i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n))
  29381. return (
  29382. R.warn(
  29383. 'Showcase -> rotateDirection: Already at maximum rotation in direction: ' +
  29384. i
  29385. ),
  29386. void (
  29387. t &&
  29388. t({
  29389. success: !1,
  29390. error: 'Already at maximum rotation in direction: ' + i,
  29391. })
  29392. )
  29393. );
  29394. (o = n > 0 ? 1 : -1), (s = n);
  29395. }
  29396. var l = n;
  29397. (n = c.Math.degToRad(n)), (a = c.Math.degToRad(a)), (s = c.Math.degToRad(s));
  29398. var h = this.controls.activeControl,
  29399. u = function () {
  29400. h.stopRotating(!0),
  29401. t &&
  29402. t({
  29403. success: !0,
  29404. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction,
  29405. });
  29406. };
  29407. h.startRotating(r, o), P.start(a, s, this.player, u);
  29408. }
  29409. };
  29410. })(),
  29411. rotate: (function () {
  29412. var e = new c.Vector3(),
  29413. t = new c.Vector3();
  29414. return function (i, n) {
  29415. var r = i.xAngle,
  29416. o = i.yAngle;
  29417. if (!P.active) {
  29418. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  29419. return (
  29420. R.warn('Showcase -> rotate: Invalid rotation angle.'),
  29421. void (
  29422. n &&
  29423. n({
  29424. success: !1,
  29425. error: 'Invalid rotation angle.',
  29426. })
  29427. )
  29428. );
  29429. if (this.player.mode === E.TRANSITIONING)
  29430. return (
  29431. R.warn('Automation -> rotate: Cannot rotate while transitioning'),
  29432. void (
  29433. n &&
  29434. n({
  29435. success: !1,
  29436. error: 'Cannot rotate while transitioning',
  29437. })
  29438. )
  29439. );
  29440. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0);
  29441. var a = o;
  29442. (o = N.call(this, o)), (r = -r);
  29443. var s = a > 0 ? 'UP' : 'DOWN';
  29444. if (!r && a && !o)
  29445. return (
  29446. R.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + s),
  29447. void (
  29448. n &&
  29449. n({
  29450. success: !1,
  29451. error: 'Already at maximum rotation in direction: ' + s,
  29452. })
  29453. )
  29454. );
  29455. a > o &&
  29456. R.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + s);
  29457. var l = o;
  29458. (o = c.Math.degToRad(o)),
  29459. (r = c.Math.degToRad(r)),
  29460. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29461. this.player.getDirection(e),
  29462. t.copy(e).applyAxisAngle(I.UP, r),
  29463. t.applyAxisAngle(I.RIGHT, o);
  29464. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  29465. u = o > 0 ? 1 : o < 0 ? -1 : 0;
  29466. Math.abs(r) > Math.abs(o)
  29467. ? (u *= Math.abs(o / r))
  29468. : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  29469. var d = this.controls.activeControl,
  29470. p = function () {
  29471. d.stopRotating(!0),
  29472. n &&
  29473. n({
  29474. success: !0,
  29475. message:
  29476. 'Rotated ' +
  29477. i.xAngle.toFixed(2) +
  29478. '° horizontally, ' +
  29479. l.toFixed(2) +
  29480. '° vertically',
  29481. });
  29482. };
  29483. d.startRotating(h, u), P.start(r, o, this.player, p);
  29484. }
  29485. };
  29486. })(),
  29487. panCamera: function (e, t) {
  29488. function i(e) {
  29489. switch (
  29490. (r.removeAllListeners(T.AutoPanComplete),
  29491. r.removeAllListeners(T.AutoPanInterrupt),
  29492. r.removeAllListeners(T.AutoPanClamped),
  29493. e)
  29494. ) {
  29495. case T.AutoPanInterrupt:
  29496. t({
  29497. success: !0,
  29498. message: 'Camera panning interrupted.',
  29499. });
  29500. break;
  29501. case T.AutoPanClamped:
  29502. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  29503. if (
  29504. Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 &&
  29505. Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01
  29506. )
  29507. return void t({
  29508. success: !1,
  29509. error: 'Already at edge of current model bounds.',
  29510. });
  29511. var i = 'The view point is outside the bounds for the current model. ';
  29512. (i += 'The view point was clamped to ' + o(r.target.x, r.target.z)),
  29513. console.warn(i);
  29514. }
  29515. case T.AutoPanComplete:
  29516. t({
  29517. success: !0,
  29518. message:
  29519. 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z),
  29520. });
  29521. }
  29522. }
  29523. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  29524. return t({
  29525. success: !1,
  29526. error: 'Camera panning is not available in the current mode: ' + this.player.mode,
  29527. });
  29528. var n = e.position,
  29529. r = this.player.control;
  29530. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0);
  29531. var o = function (e, t) {
  29532. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')';
  29533. };
  29534. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  29535. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  29536. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped));
  29537. },
  29538. click: function (e, t) {
  29539. var i = e.x,
  29540. n = e.y,
  29541. r = e.percentage;
  29542. r === !0 &&
  29543. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29544. this.player.handleInputStart(i, n),
  29545. this.player.updateIntersect(),
  29546. this.player.handleInputEnd(i, n);
  29547. },
  29548. mouseOver: function (e, t) {
  29549. var i = e.x,
  29550. n = e.y,
  29551. r = e.percentage;
  29552. r === !0 &&
  29553. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29554. this.player.handleInputMove(i, n),
  29555. this.player.updateIntersect();
  29556. },
  29557. moveToMode: function (e, t) {
  29558. function i(e) {
  29559. t(
  29560. e
  29561. ? {
  29562. success: !1,
  29563. error: 'Failed to load new mode: ' + e,
  29564. }
  29565. : {
  29566. success: !0,
  29567. message: 'Moved to new mode: ' + n,
  29568. }
  29569. );
  29570. }
  29571. var n = e.mode;
  29572. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  29573. ? this.director.changeMode(n).then(
  29574. function () {
  29575. i();
  29576. },
  29577. function (e) {
  29578. i(e);
  29579. }
  29580. )
  29581. : t({
  29582. success: !1,
  29583. error: 'Invalid mode selection',
  29584. });
  29585. },
  29586. };
  29587. }.call(this, '/js/sdk/automation.js'));
  29588. },
  29589. {
  29590. '../constants': 8,
  29591. '../enum/AlignmentType': 17,
  29592. '../enum/ControlEvents': 21,
  29593. '../enum/Direction': 22,
  29594. '../enum/GLCubeFaces': 25,
  29595. '../enum/Keys': 30,
  29596. '../enum/ModelManagerEvents': 33,
  29597. '../enum/PlayerEvents': 40,
  29598. '../enum/RenderLayers': 41,
  29599. '../enum/Vectors': 50,
  29600. '../enum/Viewmode': 51,
  29601. '../enum/WarpStyle': 52,
  29602. '../lib/jpeg_encoder': 94,
  29603. '../sdk/SdkEvents': 161,
  29604. '../settings': 166,
  29605. '../util/common': 185,
  29606. '../util/logger': 189,
  29607. '../util/math': 190,
  29608. '../util/panorama': 191,
  29609. './ApiHost': 159,
  29610. './PostMessageType': 160,
  29611. './TransitionStyles': 162,
  29612. three: 217,
  29613. },
  29614. ],
  29615. 165: [
  29616. function (e, t, i) {
  29617. 'use strict';
  29618. function n(e) {
  29619. (this.sourceWindow = e),
  29620. (this.targetWindow = null),
  29621. (this.targetOrigin = null),
  29622. (this.id = Math.floor(1e5 * Math.random())),
  29623. this.bindEvents();
  29624. }
  29625. var r = e('./PostMessageType'),
  29626. o = e('events').EventEmitter;
  29627. (n.prototype = Object.create(o.prototype)),
  29628. (n.prototype.bindEvents = function () {
  29629. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this));
  29630. }),
  29631. (n.prototype.setTarget = function (e, t) {
  29632. (this.targetWindow = e), (this.targetOrigin = t);
  29633. }),
  29634. (n.prototype.onPostmessageReceived = function (e) {
  29635. var t = e.origin || e.originalEvent.origin,
  29636. i = e.source;
  29637. switch (e.data.type) {
  29638. case r.CONNECT:
  29639. break;
  29640. case r.RESPONSE:
  29641. if (this.id !== e.data.toId) return;
  29642. default:
  29643. if (!this.validateMessageOrigin(t)) return;
  29644. }
  29645. var n = e.data;
  29646. (n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n);
  29647. }),
  29648. (n.prototype.validateMessageOrigin = function (e) {
  29649. return '*' === this.targetOrigin || e === this.targetOrigin;
  29650. }),
  29651. (n.prototype.send = function (e) {
  29652. this.targetWindow &&
  29653. this.targetOrigin &&
  29654. ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin));
  29655. }),
  29656. (t.exports = n);
  29657. },
  29658. {
  29659. './PostMessageType': 160,
  29660. events: 202,
  29661. },
  29662. ],
  29663. 166: [
  29664. function (e, t, i) {
  29665. 'use strict';
  29666. var n = e('three'),
  29667. r = e('./util/browser'),
  29668. o = e('./enum/Viewmode'),
  29669. a = e('./enum/VROption'),
  29670. s = e('./enum/Colors'),
  29671. l = e('./enum/WarpStyle'),
  29672. c = e('./util/easing'),
  29673. h = e('./util/common'),
  29674. u = e('./util/showcase'),
  29675. d = e('./constants'),
  29676. p = {
  29677. debug: !1,
  29678. version: '2.25.6-0-gd87e5b1',
  29679. languageTag: r.valueFromHash('lang', null),
  29680. pageTitle: '四维虚拟漫游',
  29681. authorizationHeader: u.getAuthorizationHeader(),
  29682. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  29683. logLevel: r.valueFromHash('log', 2),
  29684. skyboxRadius: 2500,
  29685. modelBoundsPadding: 5,
  29686. showNeighbors: !1,
  29687. brand: r.valueFromHash('brand', !0),
  29688. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  29689. startHighlights: r.valueFromHash('hl', -1),
  29690. specialEdition: r.valueFromHash('bn', 0),
  29691. useWheel: r.valueFromHash('wh', !0),
  29692. crossOrigin: 'anonymous',
  29693. fancierTransition: !1,
  29694. wireframe: !1,
  29695. skyboxWireframe: !1,
  29696. modelAlpha: 1,
  29697. highlightPanoSelection: !1,
  29698. showSweeps: !0,
  29699. showSkyboxes: !1,
  29700. showMesh: !0,
  29701. showFloors: !1,
  29702. showFloorDuration: 300,
  29703. showFloorDelay: 300,
  29704. hideFloorDuration: 300,
  29705. hideFloorDelay: 0,
  29706. reticuleOpacityTransitionTime: 250,
  29707. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  29708. markerOpacityTransitionTime: 500,
  29709. guiAnimationSpeed: 250,
  29710. highlightAnimationDuration: 500,
  29711. modelComponentLoadSpinnerDelay: 150,
  29712. captureErrors: !1,
  29713. maxMobileTextures: 6,
  29714. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  29715. startupFlyinDelay: 3e3,
  29716. dollhouseDefault: {
  29717. minDistance: 15,
  29718. maxDistance: 50,
  29719. minPolarAngle: n.Math.degToRad(10),
  29720. maxPolarAngle: n.Math.degToRad(90),
  29721. },
  29722. hideReticuleTimeout: 1e3,
  29723. analytics: {
  29724. inactivityThreshold: 30,
  29725. sessionTrackingRate: 0.15,
  29726. maxTrackedErrors: 20,
  29727. sessionDurationPingFrequency: 10,
  29728. sessionDurationTimeout: 15,
  29729. },
  29730. flydown: {
  29731. movementEasing: 'easeInOutQuad',
  29732. movementDelay: 0.001,
  29733. rotationEasing: 'easeInOutQuad',
  29734. rotationDelay: 0.5,
  29735. modelTextureDelay: 0.75,
  29736. skyboxDelay: 0.75,
  29737. },
  29738. transition: {
  29739. flySpeed: 0.001,
  29740. flyTime: 750,
  29741. flytimeMaxDistanceThreshold: 5,
  29742. flytimeDistanceMultiplier: 150,
  29743. aimTime: 1500,
  29744. aimSlowFactor: 1.5,
  29745. blur: 0.8,
  29746. movementEasing: 'easeInOutQuad',
  29747. blendEasing: 'easeInOutQuad',
  29748. fastForwardFactor: 4, //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  29749. },
  29750. show360Views: {
  29751. enabled: !0,
  29752. transitionTime: 1e3,
  29753. },
  29754. quickstart: {
  29755. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  29756. animation: 1400,
  29757. showTextDelay: 500,
  29758. fadeOutDelay: 3e3,
  29759. fovChange: 10,
  29760. },
  29761. appConfig: {
  29762. webvr_version: null,
  29763. segment_key: null,
  29764. embedly_key: null,
  29765. branch_key: null,
  29766. keen_write_key: null,
  29767. keen_project_id: null,
  29768. },
  29769. vr: {
  29770. enabled: !0,
  29771. allowWebVR: !1,
  29772. option: r.valueFromHash('vr', a.CONTEXTUAL),
  29773. },
  29774. share: {
  29775. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0),
  29776. },
  29777. input: {
  29778. longTapThreshold: 200,
  29779. moveToleranceNDC: 0.01, //.08,
  29780. touchMoveThreshold: 25,
  29781. },
  29782. help: {
  29783. modalStayDuration: 600,
  29784. },
  29785. immersive: {
  29786. timeToShowAgain: 1250,
  29787. uiStayDuration: 600,
  29788. },
  29789. tourInteraction: {
  29790. disabled: '0' === r.valueFromHash('tourcta', null),
  29791. showPauseButton: 1e3,
  29792. showModal: 1500,
  29793. allowNextClick: 200,
  29794. largeModal: '1' === r.valueFromHash('tourcta', null),
  29795. smallModal: '2' === r.valueFromHash('tourcta', null),
  29796. },
  29797. labels: {
  29798. enabled: !1,
  29799. hideUntilStart: !0,
  29800. fadeInDuration: 250,
  29801. fadeInDelay: 250,
  29802. fadeOutDuration: 250,
  29803. fadeOutDelay: 0,
  29804. zoomHideThreshhold: {
  29805. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  29806. desktop: 2,
  29807. },
  29808. zoomTruncateThreshhold: {
  29809. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  29810. desktop: 0.85,
  29811. },
  29812. minLengthForTruncate: 16,
  29813. truncateLength: 12,
  29814. truncateSuffix: '...',
  29815. },
  29816. tags: {
  29817. enabled: r.valueFromHash('mt', 1),
  29818. startup: {
  29819. hideUntilStart: !0,
  29820. fadeInDuration: 500,
  29821. fadeInDelay: 100,
  29822. },
  29823. visibility: {
  29824. anyDistance: !0,
  29825. visibleDistance: 8,
  29826. cameraClearance: 0.1,
  29827. alphaTestLevel: 0.05,
  29828. hideViaFloor: !0,
  29829. hideOffScreenDisc: !1,
  29830. hideOffScreenObject: !1,
  29831. },
  29832. disc: {
  29833. opacity: 1,
  29834. disabledOpacity: 0.5,
  29835. scale: {
  29836. nearBound: 1.5,
  29837. farBound: 4.8,
  29838. linkFarBound: !1,
  29839. linkPercent: 40,
  29840. maxSize: 80,
  29841. minSize: 40,
  29842. baseViewportSize: 800,
  29843. responsiveness: 100,
  29844. },
  29845. },
  29846. pole: {
  29847. enabled: !0,
  29848. height: 0.5,
  29849. width: 2,
  29850. opacity: 0.5,
  29851. color: 'white',
  29852. },
  29853. navigate: {
  29854. nearestPano: !0,
  29855. lineOfSight: !0,
  29856. reactivate: !0,
  29857. aimAt: 'disc',
  29858. tiltTolerance: 25,
  29859. rotateSpeedFactor: 0.6,
  29860. },
  29861. },
  29862. path: {
  29863. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  29864. colorUp: s._desat(s.newBlue, 0.5),
  29865. colorDown: s._darken(s.newBlue, 0.35),
  29866. opacity: 0.5,
  29867. style: 'ribbon',
  29868. height: 0.025,
  29869. ribbonWidth: 0.24,
  29870. outsideHeight: 0.5,
  29871. waypointRadius: 0.5,
  29872. waypointIndoorRadius: 0.24,
  29873. waypointPulse: 1e3,
  29874. typ: l.BLACK,
  29875. meshFree: r.valueFromHash('mf', 1),
  29876. mapGuides: r.valueFromHash('guides', !0),
  29877. fadeInTime: 400,
  29878. fadeOutTime: 300,
  29879. },
  29880. warp: {
  29881. nearPanoDist: 0.1,
  29882. matchCam: !1,
  29883. blur: 0.33,
  29884. fastTime: 1500,
  29885. teleportTime: 1500, //瞬间过渡的时间
  29886. flytimeDistanceMultiplier: 150, //add
  29887. flyTime: 750, //add
  29888. outsideTime: 2e3,
  29889. lookAheadMax: 0.3,
  29890. lookAheadDist: 2.5,
  29891. softPushDist: 0.37,
  29892. softPushEnd: 0.3,
  29893. softBendAngle: 8,
  29894. softBendTilt: 4,
  29895. softBendEnd: 0.3,
  29896. doBurns: true, //r.valueFromHash("kb", !0),
  29897. burnsAngle: 8, //导览在每个点停留时的旋转角度
  29898. minBurnsAngle: 35,
  29899. minDownAngle: -35,
  29900. maxTurnPerSec: 280,
  29901. maxAimPerSec: 35,
  29902. minRotation: 12,
  29903. maxAimRotation: 33.2,
  29904. turnFriction: 0.2,
  29905. flySpeed: 0.01,
  29906. minWarpTime: 1200,
  29907. warpInterruptionRedirectTime: 500,
  29908. tourStepDelay: r.valueFromHash('st', 0),
  29909. walkDelay: 0,
  29910. walkMaxDist: 50,
  29911. walkMinDist: 0.8,
  29912. walkSlideShowThreshhold: 3000,
  29913. walkExtraPanosDistance: 0.4,
  29914. timePerMeter: 1200,
  29915. motionLeadTime: 5000,
  29916. movementEasing: 'easeInOutQuad',
  29917. blendEasing: 'easeInOutQuad',
  29918. showBunny: !1,
  29919. loop: r.valueFromHash('lp', !1),
  29920. auto: r.valueFromHash('ts', -1),
  29921. eOrder: 'YXZ', //"YXZ",
  29922. stepFactor: 0.25,
  29923. brakeStrength: 2,
  29924. minBrakeAngle: 0.1,
  29925. maxBrakeAngle: 1.8,
  29926. climbEffort: 4,
  29927. },
  29928. rotationFriction: 0.05,
  29929. rotationAccelerationInside: 4.5,
  29930. rotationAccelerationOutside: 0.15,
  29931. rotationAfterMoveMultiplier: 40,
  29932. rotationAfterMoveHistoryCount: 5,
  29933. panFriction: 0.09,
  29934. panAccelerationOutside: 60,
  29935. onload: r.valueFromHash('onload', o.PANORAMA),
  29936. zoomNearLimit: 0.1,
  29937. zoomFarLimit: 50,
  29938. navigation: {
  29939. panoScores: !1,
  29940. mouseDirection: !0,
  29941. filterStrictness: 0.75,
  29942. angleFactor: -30,
  29943. directionFactor: 10,
  29944. distanceFactor: -1,
  29945. optionalityFactor: 3,
  29946. },
  29947. sdkInit: !1,
  29948. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  29949. console: r.valueFromHash('console', !1),
  29950. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  29951. panoramaNeighbourMaxDistance: 5,
  29952. panoFloorClickRadius: 0.35,
  29953. showScreenshotLocations: !1,
  29954. showAxis: !1,
  29955. showNeighbourRaycasts: !1,
  29956. colorMarkerOnLoad: !1,
  29957. colorMarkerByFloor: !1,
  29958. tiling: {
  29959. panoPreRenderRepeatDelay: 2500,
  29960. panoPreRenderDelay: 500,
  29961. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  29962. tilingFlagNames: ['usetiles', 'tiles'],
  29963. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  29964. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  29965. overlayStyle: r.valueFromHash('tileoverlay', 0),
  29966. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  29967. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  29968. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 1 /* 2 */),
  29969. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  29970. customCompression: r.valueFromHash('tilecustcomp', 0),
  29971. // mobileHighQualityOverride: !1,
  29972. mobileHighQualityOverride: 1,
  29973. allowUltraHighResolution: true,
  29974. },
  29975. zoom: {
  29976. enabled: true,
  29977. forceOff: r.valueFromHash('nozoom', 0),
  29978. overridemax: r.valueFromHash('maxzoom', null),
  29979. overridemin: r.valueFromHash('minzoom', null),
  29980. max: d.highQualityMaxZoom,
  29981. min: 1,
  29982. transitionStyle: r.valueFromHash('zoomtrans', 1),
  29983. activationThreshold: 1.1,
  29984. restoreTime: 500,
  29985. },
  29986. profiling: {
  29987. enabled: r.valueFromHash('mem', !1),
  29988. },
  29989. };
  29990. (p = h.deepExtend(p, d, {
  29991. insideFOV: r.valueFromHash('fov', d.insideFOV),
  29992. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  29993. panorama: {
  29994. transitionTime: 1e3,
  29995. modelAlpha: 0,
  29996. modelAlphaDelay: p.flydown.modelTextureDelay,
  29997. modelAlphaLength: 1,
  29998. skyboxOpacity: 1,
  29999. skyboxOpacityDelay: p.flydown.skyboxDelay,
  30000. skyboxOpacityLength: 0.9,
  30001. fovLength: 1,
  30002. fovDelay: 0,
  30003. cameraMatrixDuration: 0.8,
  30004. cameraMatrixDelay: 0,
  30005. cameraMatrixEase: c.easeInCubic,
  30006. reticuleOpacity: 1,
  30007. markerOpacity: 0.3,
  30008. markerOpacityOnHover: 1,
  30009. },
  30010. dollhouse: {
  30011. transitionTime: 1e3,
  30012. modelAlpha: 1,
  30013. modelAlphaDelay: 0,
  30014. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30015. skyboxOpacity: 0,
  30016. skyboxOpacityDelay: 0,
  30017. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30018. fovLength: 1,
  30019. fovDelay: 0,
  30020. cameraMatrixDuration: 0.8,
  30021. cameraMatrixDelay: 0.3,
  30022. cameraMatrixEase: c.easeInCubic,
  30023. reticuleOpacity: 1,
  30024. markerOpacity: 0,
  30025. markerOpacityOnHover: 0,
  30026. },
  30027. floorplan: {
  30028. transitionTime: 1e3,
  30029. modelAlpha: 1,
  30030. modelAlphaDelay: 0,
  30031. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30032. skyboxOpacity: 0,
  30033. skyboxOpacityDelay: 0,
  30034. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30035. fovLength: 1,
  30036. fovDelay: 0,
  30037. cameraMatrixDuration: 0.5,
  30038. cameraMatrixDelay: 0,
  30039. cameraMatrixEase: c.easeOutCubic,
  30040. reticuleOpacity: 1,
  30041. markerOpacity: 0,
  30042. markerOpacityOnHover: 0,
  30043. cameraHeight: 50,
  30044. },
  30045. transitioning: {
  30046. reticuleOpacity: 0,
  30047. markerOpacity: 0.3,
  30048. markerOpacityOnHover: 1,
  30049. },
  30050. 'floorplan-dollhouse': {
  30051. rotationDelay: 0,
  30052. rotationDuration: 1,
  30053. },
  30054. 'floorplan-panorama': {
  30055. rotationDelay: 0.5,
  30056. rotationDuration: 1,
  30057. },
  30058. 'dollhouse-panorama': {
  30059. rotationDelay: 0.5,
  30060. rotationDuration: 1,
  30061. },
  30062. 'dollhouse-floorplan': {
  30063. rotationDelay: 0,
  30064. rotationDuration: 1,
  30065. cameraMatrixDuration: 1.05,
  30066. cameraMatrixDelay: 0.5,
  30067. },
  30068. 'panorama-dollhouse': {
  30069. rotationDelay: 0,
  30070. rotationDuration: 0.5,
  30071. },
  30072. 'panorama-floorplan': {
  30073. transitionTime: 1500,
  30074. rotationDelay: 0,
  30075. rotationDuration: 0.5,
  30076. },
  30077. })),
  30078. p.path.meshFree && (p.path.typ = l.WALK),
  30079. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  30080. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  30081. (window._settings = t.exports = p);
  30082. },
  30083. {
  30084. './constants': 8,
  30085. './enum/Colors': 19,
  30086. './enum/VROption': 47,
  30087. './enum/Viewmode': 51,
  30088. './enum/WarpStyle': 52,
  30089. './util/browser': 182,
  30090. './util/common': 185,
  30091. './util/easing': 186,
  30092. './util/showcase': 193,
  30093. three: 217,
  30094. },
  30095. ],
  30096. 167: [
  30097. function (e, t, i) {
  30098. 'use strict';
  30099. var n = e('three'),
  30100. r = e('./settings'),
  30101. o =
  30102. 'precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n',
  30103. a =
  30104. 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n';
  30105. t.exports = {
  30106. basicTextured: {
  30107. uniforms: {
  30108. tDiffuse: {
  30109. type: 't',
  30110. value: null,
  30111. },
  30112. alpha: {
  30113. type: 'f',
  30114. value: 1,
  30115. },
  30116. },
  30117. vertexShader:
  30118. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30119. fragmentShader:
  30120. 'varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}',
  30121. },
  30122. copyCubeMap: {
  30123. uniforms: {
  30124. tDiffuse: {
  30125. type: 't',
  30126. value: null,
  30127. },
  30128. alpha: {
  30129. type: 'f',
  30130. value: 1,
  30131. },
  30132. },
  30133. vertexShader:
  30134. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30135. fragmentShader:
  30136. 'varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}',
  30137. },
  30138. cube: {
  30139. uniforms: {
  30140. map: {
  30141. type: 't',
  30142. value: null,
  30143. },
  30144. opacity: {
  30145. type: 'f',
  30146. value: 1,
  30147. },
  30148. },
  30149. vertexShader:
  30150. o +
  30151. 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  30152. fragmentShader:
  30153. a +
  30154. 'uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n',
  30155. },
  30156. model: {
  30157. uniforms: {
  30158. map: {
  30159. type: 't',
  30160. value: null,
  30161. },
  30162. modelAlpha: {
  30163. type: 'f',
  30164. value: r.modelAlpha,
  30165. },
  30166. opacity: {
  30167. type: 'f',
  30168. value: 1,
  30169. },
  30170. progress: {
  30171. type: 'f',
  30172. value: 0,
  30173. },
  30174. blackout: {
  30175. type: 'i',
  30176. value: 0,
  30177. },
  30178. pano0Map: {
  30179. type: 't',
  30180. value: null,
  30181. },
  30182. pano0Position: {
  30183. type: 'v3',
  30184. value: new n.Vector3(),
  30185. },
  30186. pano0Matrix: {
  30187. type: 'm4',
  30188. value: new n.Matrix4(),
  30189. },
  30190. pano1Map: {
  30191. type: 't',
  30192. value: null,
  30193. },
  30194. pano1Position: {
  30195. type: 'v3',
  30196. value: new n.Vector3(),
  30197. },
  30198. pano1Matrix: {
  30199. type: 'm4',
  30200. value: new n.Matrix4(),
  30201. },
  30202. },
  30203. vertexShader:
  30204. o +
  30205. `uniform vec3 pano0Position;
  30206. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  30207. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  30208. varying vec3 vWorldPosition0;
  30209. varying vec3 vWorldPosition1;
  30210. uniform int blackout;
  30211. void main() {
  30212. vUv = uv;
  30213. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  30214. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  30215. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  30216. vWorldPosition0.x *= -1.0;
  30217. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  30218. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  30219. vWorldPosition1.x *= -1.0;
  30220. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  30221. }`,
  30222. fragmentShader:
  30223. a +
  30224. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  30225. uniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\n
  30226. void main() {
  30227. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  30228. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  30229. vec4 colorFromPanos;
  30230. if (blackout == 5){//add for TransitionPass
  30231. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  30232. }else{
  30233. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  30234. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  30235. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  30236. else if (blackout == 1) {
  30237. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  30238. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  30239. }
  30240. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  30241. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  30242. }
  30243. //#ifdef useModelMap //起不了作用为啥
  30244. if(modelAlpha>0.0){
  30245. vec4 colorFromTexture = texture2D( map, vUv );
  30246. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  30247. }
  30248. //#endif
  30249. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  30250. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  30251. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  30252. }`,
  30253. },
  30254. hot: {
  30255. uniforms: {
  30256. color: {
  30257. type: 'c',
  30258. value: new n.Color(0xff2200),
  30259. },
  30260. opac: {
  30261. type: 'f',
  30262. value: 0,
  30263. },
  30264. texture1: {
  30265. type: 't',
  30266. value: null,
  30267. },
  30268. texture2: {
  30269. type: 't',
  30270. value: null,
  30271. },
  30272. },
  30273. vertexShader:
  30274. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30275. fragmentShader:
  30276. 'varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n',
  30277. },
  30278. modelOutside: {
  30279. uniforms: {
  30280. map: {
  30281. type: 't',
  30282. value: null,
  30283. },
  30284. opacity: {
  30285. type: 'f',
  30286. value: 1,
  30287. },
  30288. },
  30289. vertexShader:
  30290. o +
  30291. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30292. fragmentShader:
  30293. a +
  30294. 'uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n',
  30295. },
  30296. ribbon: {
  30297. uniforms: {
  30298. map: {
  30299. type: 't',
  30300. value: null,
  30301. },
  30302. opacity: {
  30303. type: 'f',
  30304. value: 1,
  30305. },
  30306. color: {
  30307. type: 'c',
  30308. value: new n.Color(r.path.color),
  30309. },
  30310. },
  30311. vertexShader:
  30312. o +
  30313. 'varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n',
  30314. fragmentShader:
  30315. a +
  30316. 'uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n',
  30317. },
  30318. waypoint: {
  30319. uniforms: {
  30320. map: {
  30321. type: 't',
  30322. value: null,
  30323. },
  30324. opacity: {
  30325. type: 'f',
  30326. value: 1,
  30327. },
  30328. pulse: {
  30329. type: 'f',
  30330. value: 1,
  30331. },
  30332. nearFade: {
  30333. type: 'v2',
  30334. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius),
  30335. },
  30336. color: {
  30337. type: 'c',
  30338. value: new n.Color(r.reticuleColor),
  30339. },
  30340. },
  30341. vertexShader:
  30342. o +
  30343. 'varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n',
  30344. fragmentShader:
  30345. a +
  30346. 'uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n',
  30347. },
  30348. modelDebug: {
  30349. uniforms: {
  30350. map: {
  30351. type: 't',
  30352. value: null,
  30353. },
  30354. modelAlpha: {
  30355. type: 'f',
  30356. value: r.modelAlpha,
  30357. },
  30358. depthmapRatio: {
  30359. type: 'f',
  30360. value: 0,
  30361. },
  30362. opacity: {
  30363. type: 'f',
  30364. value: 1,
  30365. },
  30366. progress: {
  30367. type: 'f',
  30368. value: 0,
  30369. },
  30370. considerOcclusion: {
  30371. type: 'i',
  30372. value: r.fancierTransition,
  30373. },
  30374. highlightPanoSelection: {
  30375. type: 'i',
  30376. value: 0,
  30377. },
  30378. useThirdPano: {
  30379. type: 'i',
  30380. value: r.useThirdPano,
  30381. },
  30382. pano0Map: {
  30383. type: 't',
  30384. value: null,
  30385. },
  30386. pano0Depth: {
  30387. type: 't',
  30388. value: null,
  30389. },
  30390. pano0Position: {
  30391. type: 'v3',
  30392. value: new n.Vector3(),
  30393. },
  30394. pano0Matrix: {
  30395. type: 'm4',
  30396. value: new n.Matrix4(),
  30397. },
  30398. pano0Weight: {
  30399. type: 'f',
  30400. value: r.transition.pano0Weight,
  30401. },
  30402. pano1Map: {
  30403. type: 't',
  30404. value: null,
  30405. },
  30406. pano1Depth: {
  30407. type: 't',
  30408. value: null,
  30409. },
  30410. pano1Position: {
  30411. type: 'v3',
  30412. value: new n.Vector3(),
  30413. },
  30414. pano1Matrix: {
  30415. type: 'm4',
  30416. value: new n.Matrix4(),
  30417. },
  30418. pano1Weight: {
  30419. type: 'f',
  30420. value: r.transition.pano1Weight,
  30421. },
  30422. pano2Map: {
  30423. type: 't',
  30424. value: null,
  30425. },
  30426. pano2Depth: {
  30427. type: 't',
  30428. value: null,
  30429. },
  30430. pano2Position: {
  30431. type: 'v3',
  30432. value: new n.Vector3(),
  30433. },
  30434. pano2Matrix: {
  30435. type: 'm4',
  30436. value: new n.Matrix4(),
  30437. },
  30438. pano2Weight: {
  30439. type: 'f',
  30440. value: r.transition.pano2Weight,
  30441. },
  30442. },
  30443. vertexShader:
  30444. o +
  30445. 'uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30446. fragmentShader:
  30447. a +
  30448. 'uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n',
  30449. },
  30450. customDepth: {
  30451. uniforms: {
  30452. panoPosition: {
  30453. type: 'v3',
  30454. value: new n.Vector3(),
  30455. },
  30456. },
  30457. vertexShader:
  30458. o +
  30459. 'varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30460. fragmentShader:
  30461. a +
  30462. 'uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n',
  30463. },
  30464. skysphere: {
  30465. uniforms: {
  30466. radius: {
  30467. type: 'f',
  30468. value: 0,
  30469. },
  30470. },
  30471. vertexShader:
  30472. o +
  30473. 'varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30474. fragmentShader:
  30475. a +
  30476. 'varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n',
  30477. },
  30478. tagDisc: {
  30479. uniforms: {
  30480. opacity: {
  30481. type: 'f',
  30482. value: 0,
  30483. },
  30484. color: {
  30485. type: 'c',
  30486. value: new n.Color(),
  30487. },
  30488. bg: {
  30489. type: 't',
  30490. value: null,
  30491. },
  30492. mask: {
  30493. type: 't',
  30494. value: null,
  30495. },
  30496. },
  30497. vertexShader:
  30498. o +
  30499. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30500. fragmentShader:
  30501. a +
  30502. 'uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n',
  30503. },
  30504. };
  30505. },
  30506. {
  30507. './settings': 166,
  30508. three: 217,
  30509. },
  30510. ],
  30511. 168: [
  30512. function (e, t, i) {
  30513. (function (i) {
  30514. 'use strict';
  30515. var n = e('three'),
  30516. r = (e('url'), e('./util/ajax')),
  30517. o = e('./settings'),
  30518. a = e('./util/logger'),
  30519. s = e('./util/math'),
  30520. l = e('./util/showcase'),
  30521. c = e('./objects/Panorama'),
  30522. h = new a(i),
  30523. u = e('./model/Model'),
  30524. d = e('./shaders'),
  30525. p = e('./util/transitions'),
  30526. f = e('./objects/Chunk'),
  30527. g = e('./objects/Reticule'),
  30528. m = e('./objects/Skybox'),
  30529. v = e('./objects/Floor'),
  30530. A = e('./cameras/DollhouseCamera'),
  30531. y = e('./cameras/FloorplanCamera'),
  30532. C = e('./cameras/PanoramaCamera'),
  30533. I = e('./controls/DollhouseControls'),
  30534. E = e('./controls/FloorplanControls'),
  30535. b = e('./controls/PanoramaControls');
  30536. (n.ImageUtils.crossOrigin = o.crossOrigin),
  30537. (t.exports = {
  30538. shaders: d,
  30539. transitions: p,
  30540. Model: u,
  30541. Chunk: f,
  30542. Floor: v,
  30543. Skybox: m,
  30544. Reticule: g,
  30545. Panorama: c,
  30546. DollhouseCamera: A,
  30547. FloorplanCamera: y,
  30548. PanoramaCamera: C,
  30549. DollhouseControls: I,
  30550. FloorplanControls: E,
  30551. PanoramaControls: b,
  30552. getModel: function (e) {
  30553. if (!e.url) throw 'getModel(): missing parameter "url"';
  30554. e.autoload = void 0 === e.autoload || e.autoload;
  30555. var t = l.parseSidUrl(e.url);
  30556. (e.urlBase = t.urlBase), (e.urlModel = t.urlModel), (e.urlFiles = t.urlFiles);
  30557. var i = this._getPlatformError();
  30558. return i
  30559. ? $.Deferred().reject(i).promise()
  30560. : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)));
  30561. },
  30562. _getPlatformError: function () {
  30563. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  30564. ? 'webgl-unsupported'
  30565. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  30566. ? 'webgl-ios'
  30567. : Modernizr.webgl
  30568. ? null
  30569. : 'webgl-unsupported';
  30570. },
  30571. _loadModel: function () {
  30572. return r
  30573. .get(this.options.urlModel, {
  30574. responseType: 'json',
  30575. prefetchFrom: 'model',
  30576. auth: l.getAuthorizationHeader(),
  30577. })
  30578. .then(null, function () {
  30579. return (
  30580. h.warn('Model loading failed at initial metadata load'), 'loading-failed'
  30581. );
  30582. });
  30583. },
  30584. _buildModel: function (e) {
  30585. e = l.normalizeModeldata(e, s);
  30586. var t = new u(this.options, e);
  30587. return this.options.autoload ? t.load(!0) : $.when(t);
  30588. },
  30589. });
  30590. }.call(this, '/js/showcase.js'));
  30591. },
  30592. {
  30593. './cameras/DollhouseCamera': 5,
  30594. './cameras/FloorplanCamera': 6,
  30595. './cameras/PanoramaCamera': 7,
  30596. './controls/DollhouseControls': 10,
  30597. './controls/FloorplanControls': 11,
  30598. './controls/PanoramaControls': 13,
  30599. './model/Model': 139,
  30600. './objects/Chunk': 144,
  30601. './objects/Floor': 146,
  30602. './objects/Panorama': 148,
  30603. './objects/Reticule': 149,
  30604. './objects/Skybox': 152,
  30605. './settings': 166,
  30606. './shaders': 167,
  30607. './util/ajax': 181,
  30608. './util/logger': 189,
  30609. './util/math': 190,
  30610. './util/showcase': 193,
  30611. './util/transitions': 195,
  30612. three: 217,
  30613. url: 208,
  30614. },
  30615. ],
  30616. 169: [
  30617. function (e, t, i) {
  30618. 'use strict';
  30619. function n() {
  30620. var e = {
  30621. renderTarget: null,
  30622. inUse: !1,
  30623. size: -1,
  30624. pano: null,
  30625. };
  30626. return e;
  30627. }
  30628. function r(e) {
  30629. M.push(e);
  30630. }
  30631. function o(e) {
  30632. var t = n();
  30633. return (t.inUse = !0), (t.size = e), r(t), t;
  30634. }
  30635. function a(e) {
  30636. for (var t = 0; t < M.length; t++) {
  30637. var i = M[t];
  30638. if (!i.inUse && i.size === e) return (i.inUse = !0), i;
  30639. }
  30640. return null;
  30641. }
  30642. function s(e) {
  30643. for (var t = 0; t < M.length; t++) {
  30644. var i = M[t];
  30645. if (i.renderTarget === e) return (i.inUse = !1), !0;
  30646. }
  30647. return !1;
  30648. }
  30649. function l() {
  30650. (this.tileDirectory = {}),
  30651. (this.activeRenderTargetDescriptors = {}),
  30652. (this.activePanos = []),
  30653. (this.panoLODDescriptors = {}),
  30654. (this.panoDescriptors = {}),
  30655. (this.tileTrees = {}),
  30656. (this.sceneRenderer = null),
  30657. (this.tileDownloader = null),
  30658. (this.forceQueue = []),
  30659. (this.uploadQueues = {}),
  30660. (this.uploadInterval = null),
  30661. (this.uploadIntervalCancelled = !1),
  30662. (this.usingTileOverlay = !1),
  30663. (this.overlayTilesLoaded = !1),
  30664. (this.overlayTileBase = null),
  30665. (this.overlayTilesBasic = {}),
  30666. (this.overlayTilesEnhanced = {}),
  30667. (this.zoomRenderTarget = null),
  30668. (this.zoomPano = null),
  30669. (this.zoomingActive = !1),
  30670. (this.zoomPanoId = null),
  30671. (this.zoomPanoRenderingDisabled = !1),
  30672. (this.direction = new h.Vector3()),
  30673. (this.initTime = -1),
  30674. (this.maxBaseUploadsPerFrame = x),
  30675. (this.maxNonBaseUploadsPerFrame = T);
  30676. }
  30677. function c() {
  30678. this.uploadIntervalCancelled ||
  30679. (this.overlayTilesLoaded || !this.usingTileOverlay
  30680. ? ((b = !0),
  30681. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  30682. this.peekNextFromUploadQueue()
  30683. ? this.refreshUploadInterval(w)
  30684. : (this.uploadInterval = null))
  30685. : this.refreshUploadInterval(this.uploadIntervalDelay));
  30686. }
  30687. /* function c() {
  30688. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  30689. this.updateUploadQueue(1, 2),
  30690. w = 18,
  30691. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  30692. } */
  30693. var h = e('three'),
  30694. u = e('../exception/BasicException'),
  30695. d = e('../settings'),
  30696. p = e('../enum/PanoSizeClass'),
  30697. f = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  30698. g = e('../enum/SceneRendererEvents'),
  30699. m = e('../enum/TileDownloaderEvents'),
  30700. v = e('../enum/Vectors'),
  30701. A = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  30702. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  30703. C = e('./TileUtils'),
  30704. p = e('../enum/PanoSizeClass'),
  30705. I = (e('../util/browser'), e('../util/panorama')),
  30706. E = e('events').EventEmitter,
  30707. b = !1,
  30708. w = d.tiling.uploadIntervalDelay,
  30709. _ = d.tiling.initialIntervalDelay,
  30710. T = d.tiling.maxNonBaseUploadsPerFrame,
  30711. x = d.tiling.maxBaseUploadsPerFrame,
  30712. S = {
  30713. Base: 0,
  30714. Remaining: 1,
  30715. },
  30716. M = [];
  30717. (l.prototype = Object.create(E.prototype)),
  30718. (l.prototype.init = function (e, t, i) {
  30719. (this.sceneRenderer = e),
  30720. (this.tileDownloader = t),
  30721. (this.qualityManager = i),
  30722. this.bindEvents(),
  30723. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  30724. (this.initTime = performance.now());
  30725. }),
  30726. (l.prototype.getActivePanoTextures = function (e) {
  30727. e = e || [];
  30728. for (var t = 0; t < M.length; t++) {
  30729. var i = M[t];
  30730. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture);
  30731. }
  30732. }),
  30733. (l.prototype.hasQueuedTiles = function () {
  30734. var e = this.peekNextFromUploadQueue();
  30735. return null !== e && void 0 !== e;
  30736. }),
  30737. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  30738. return this.activeRenderTargetDescriptors[e];
  30739. }),
  30740. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  30741. this.activeRenderTargetDescriptors[e] = t;
  30742. }),
  30743. (l.prototype.loadOverlayTiles = function () {
  30744. if (0 !== d.tiling.overlayStyle) {
  30745. var e = 0,
  30746. t = function (t, n, r) {
  30747. (t = n
  30748. ? (t[n] = this.sceneRenderer.initSizedTexture2D(
  30749. C.TILE_SIZE,
  30750. h.ClampToEdgeWrapping
  30751. ))
  30752. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(
  30753. C.TILE_SIZE,
  30754. h.ClampToEdgeWrapping
  30755. ))),
  30756. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  30757. e++,
  30758. e === i.length && (this.overlayTilesLoaded = !0);
  30759. }.bind(this),
  30760. i = [
  30761. ['images/outlineBase.png', t.bind(this, this.overlayTileBase, null)],
  30762. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 256)],
  30763. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 512)],
  30764. ['images/outlineBasic1024.png', t.bind(this, this.overlayTilesBasic, 1024)],
  30765. ['images/outlineBasic2048.png', t.bind(this, this.overlayTilesBasic, 2048)],
  30766. ['images/outlineBasic4096.png', t.bind(this, this.overlayTilesBasic, 4096)],
  30767. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 256)],
  30768. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 512)],
  30769. ['images/outlineEnhanced1024.png', t.bind(this, this.overlayTilesEnhanced, 1024)],
  30770. ['images/outlineEnhanced2048.png', t.bind(this, this.overlayTilesEnhanced, 2048)],
  30771. ['images/outlineEnhanced4096.png', t.bind(this, this.overlayTilesEnhanced, 4096)],
  30772. ];
  30773. i.forEach(
  30774. function (e) {
  30775. this.tileDownloader.loadImage(e[0], 0, e[1]);
  30776. }.bind(this)
  30777. ),
  30778. (this.usingTileOverlay = !0);
  30779. } else this.usingTileOverlay = !1;
  30780. }),
  30781. (l.prototype.bindEvents = function () {
  30782. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this));
  30783. }),
  30784. (l.prototype.setupZoomRenderTarget = (function () {
  30785. var targets = {};
  30786. return function () {
  30787. if (
  30788. this.qualityManager.maxRenderTargetSize == '2k' &&
  30789. this.qualityManager.getMaxNavPanoSize() == '2k'
  30790. )
  30791. return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  30792. if (
  30793. this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()
  30794. ) {
  30795. if (
  30796. this.zoomRenderTarget &&
  30797. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()
  30798. )
  30799. return;
  30800. var e = this.zoomRenderTarget;
  30801. var size = this.qualityManager.getMaxZoomPanoSize();
  30802. if (size > this.qualityManager.maxRenderTargetSize) {
  30803. return;
  30804. }
  30805. if (targets[size]) {
  30806. this.zoomRenderTarget = targets[size];
  30807. } else {
  30808. this.zoomRenderTarget = this.initTiledPano(size, false); //放大后不使用抗锯齿,否则消耗更多内存
  30809. targets[size] = this.zoomRenderTarget;
  30810. }
  30811. if (e) {
  30812. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  30813. var t = e.width,
  30814. i = this.zoomRenderTarget.width;
  30815. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  30816. e.texture.dispose(),
  30817. (e.texture.loaded = !1),
  30818. (e.texture.version = 0),
  30819. this.sceneRenderer.deallocateCubeTexture(e.texture),
  30820. (e.texture = null);
  30821. }
  30822. this.zoomPanoRenderingDisabled = !1;
  30823. } else this.zoomPanoRenderingDisabled = !0;
  30824. };
  30825. })()),
  30826. (l.prototype.enableHighQuality = function (e) {
  30827. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  30828. if (!this.qualityManager.highQualityModeStarted) {
  30829. this.setupZoomRenderTarget();
  30830. e();
  30831. this.qualityManager.highQualityModeStarted = true;
  30832. }
  30833. }),
  30834. (l.prototype.enableUltraHighQualityMode = function (e) {
  30835. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  30836. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  30837. this.tileDownloader.testDownload(
  30838. t,
  30839. C.TILE_SIZE,
  30840. function (t) {
  30841. t &&
  30842. (this.qualityManager.enableUltraHighQualityMode(),
  30843. this.setupZoomRenderTarget(),
  30844. e());
  30845. }.bind(this)
  30846. );
  30847. }
  30848. }),
  30849. (l.prototype.activateTiledPano = function (e, t, i) {
  30850. i && this.clearAllQueuedUploads();
  30851. for (var n = 0; n < C.FACES_PER_PANO; n++)
  30852. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  30853. this.linkAllTilesAndNodes(e);
  30854. var r = this.getActiveRenderTargetDescriptor(e.id),
  30855. l = t;
  30856. if (
  30857. (l > this.qualityManager.getMaxNavPanoSize() &&
  30858. (l = this.qualityManager.getMaxNavPanoSize()),
  30859. !r || l !== r.size)
  30860. ) {
  30861. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  30862. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */);
  30863. (r = o(c.width)), (r.renderTarget = c);
  30864. }
  30865. (r.pano = e),
  30866. this.resetPanoDescriptor(e.id),
  30867. this.resetPanoLODDescriptors(e.id),
  30868. this.resetRenderStatus(e.id, !0, !0);
  30869. }
  30870. this.setActiveRenderTargetDescriptor(e.id, r);
  30871. var h = i ? 0 : 1;
  30872. return this.updateActivePanos(e, h), r.renderTarget;
  30873. }),
  30874. (l.prototype.deactivateTiledPano = function (e) {
  30875. var t = this.getActiveRenderTargetDescriptor(e.id);
  30876. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  30877. this.setActiveRenderTargetDescriptor(e.id, null);
  30878. var i = this.getUploadQueueForPano(e.id);
  30879. this.clearUploadQueue(i), this.updateActivePanos();
  30880. }),
  30881. (l.prototype.updateActivePanos = (function () {
  30882. var e = [];
  30883. return function (t, i) {
  30884. e.length = 0;
  30885. for (var n = 0; n < this.activePanos.length; n++) {
  30886. t && e.length === i && e.push(t);
  30887. var r = this.activePanos[n],
  30888. o = this.getActiveRenderTargetDescriptor(r.id);
  30889. (t && r.id === t.id) || !this.isRenderTargetDescriptorValid(o) || e.push(r);
  30890. }
  30891. t && i >= e.length && e.push(t),
  30892. (this.activePanos.length = 0),
  30893. this.activePanos.push.apply(this.activePanos, e);
  30894. };
  30895. })()),
  30896. (l.prototype.getActivePanoCount = function () {
  30897. return this.activePanos.length;
  30898. }),
  30899. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  30900. var r = null;
  30901. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  30902. for (
  30903. var o = function (e, n, r, o) {
  30904. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1);
  30905. },
  30906. a = 0;
  30907. a < C.FACES_PER_PANO;
  30908. a++
  30909. ) {
  30910. var s = this.getTileTree(e, a);
  30911. s.breadthFirst({
  30912. callback: o.bind(this, a),
  30913. minLevel: r,
  30914. });
  30915. }
  30916. }),
  30917. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  30918. for (
  30919. var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  30920. i = function (e, t, i, n) {
  30921. (t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered);
  30922. },
  30923. n = 0;
  30924. n < C.FACES_PER_PANO;
  30925. n++
  30926. ) {
  30927. var r = this.getTileTree(e, n);
  30928. r.breadthFirst({
  30929. callback: i.bind(this, n),
  30930. maxLevel: t,
  30931. });
  30932. }
  30933. }),
  30934. (l.prototype.renderPanoTiles = (function () {
  30935. var e = [];
  30936. return function (t, i, n, r) {
  30937. (this.zoomRenderTarget &&
  30938. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) ||
  30939. this.zoomPanoRenderingDisabled ||
  30940. this.setupZoomRenderTarget(),
  30941. (i = i || this.direction || v.FORWARD);
  30942. var o = this.getActiveRenderTargetDescriptor(t);
  30943. if (!this.isRenderTargetDescriptorValid(o))
  30944. throw new u(
  30945. 'PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.'
  30946. );
  30947. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  30948. var s = this.getTileTree(t, a);
  30949. (e.length = 0),
  30950. s.breadthFirst({
  30951. saveVisited: e,
  30952. });
  30953. for (var l = 0; l < e.length; l++) {
  30954. var c = e[l];
  30955. this.queueTileUpload(c.tile, !1, r || (0 === l && n));
  30956. }
  30957. }
  30958. this.updateDirection(i);
  30959. };
  30960. })()),
  30961. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  30962. return e && e.renderTarget;
  30963. }),
  30964. (l.prototype.isPanoActive = function (e) {
  30965. var t = this.getActiveRenderTargetDescriptor(e);
  30966. return this.isRenderTargetDescriptorValid(t);
  30967. }),
  30968. (l.prototype.isPanoZoomed = function (e) {
  30969. return this.zoomingActive && this.zoomPanoId === e;
  30970. }),
  30971. (l.prototype.initTileTree = function (e, t, i) {
  30972. var n = this.tileTrees[e];
  30973. n || ((n = []), (this.tileTrees[e] = n));
  30974. var r = n[t];
  30975. if (!r) {
  30976. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  30977. (r = new A(C.TILE_SIZE, o)), (n[t] = r);
  30978. }
  30979. }),
  30980. (l.prototype.getTileTree = function (e, t) {
  30981. var i = this.tileTrees[e];
  30982. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!');
  30983. var n = i[t];
  30984. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!');
  30985. return n;
  30986. }),
  30987. (l.prototype.initTiledPano = function (e, antialias) {
  30988. var i = this.sceneRenderer.renderer,
  30989. n =
  30990. (i.context,
  30991. new h.WebGLRenderTargetCube(e, e, {
  30992. stencilBuffer: !1,
  30993. })),
  30994. r = new h.CubeTexture([]);
  30995. (n.texture = r),
  30996. (r.image = [null, null, null, null, null, null]),
  30997. (r.flipY = !0),
  30998. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  30999. antialias
  31000. ? ((r.generateMipmaps = !0),
  31001. (r.magFilter = h.LinearFilter),
  31002. (r.minFilter = h.LinearMipMapLinearFilter))
  31003. : ((r.generateMipmaps = !1),
  31004. (r.magFilter = h.LinearFilter),
  31005. (r.minFilter = h.LinearFilter)),
  31006. (r.format = h.RGBAFormat),
  31007. i.setRenderTarget(n),
  31008. i.setRenderTarget(null);
  31009. var o = i.properties.get(r);
  31010. return (o.__image__webglTextureCube = o.__webglTexture), n;
  31011. }),
  31012. (l.prototype.getUploadQueueForPano = function (e) {
  31013. var t = this.uploadQueues[e];
  31014. return t || ((t = []), (this.uploadQueues[e] = t)), t;
  31015. }),
  31016. (l.prototype.isTileUploaded = function (e) {
  31017. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded;
  31018. }),
  31019. (l.prototype.setUploaded = function (e, t) {
  31020. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t);
  31021. }),
  31022. (l.prototype.queueTileUpload = function (e, t, i) {
  31023. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  31024. if (
  31025. this.isRenderTargetDescriptorValid(n) &&
  31026. e.downloaded &&
  31027. !this.isTileUploaded(e) &&
  31028. (!e.uploadQueued || i) &&
  31029. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31030. ) {
  31031. var r = this.getUploadQueueForPano(e.panoId);
  31032. i
  31033. ? this.uploadTile(e, !1)
  31034. : (this.shoulPushToFrontOfQueue(e)
  31035. ? this.forceQueue.push(e)
  31036. : t && this.direction
  31037. ? y.insertSortedPanoTile(r, e, n.pano, this.direction)
  31038. : r.push(e),
  31039. (e.uploadQueued = !0),
  31040. this.uploadInterval ||
  31041. this.uploadIntervalCancelled ||
  31042. this.refreshUploadInterval(0));
  31043. }
  31044. }),
  31045. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  31046. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize);
  31047. }),
  31048. (l.prototype.getTopUploadQueue = function () {
  31049. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  31050. for (var n = 0; n < this.activePanos.length; n++)
  31051. if (
  31052. ((e = this.activePanos[n]), (t = this.getUploadQueueForPano(e.id)), t.length > 0)
  31053. )
  31054. switch (i) {
  31055. case S.Base:
  31056. if (0 === t[0].level) return t;
  31057. break;
  31058. case S.Remaining:
  31059. return t;
  31060. }
  31061. return null;
  31062. }),
  31063. (l.prototype.getNextFromUploadQueue = (function () {
  31064. var e = function (e) {
  31065. var t = e.shift();
  31066. return (t.uploadQueued = !1), t;
  31067. };
  31068. return function () {
  31069. if (this.forceQueue.length > 0) return e(this.forceQueue);
  31070. var t = this.getTopUploadQueue();
  31071. return t && t.length > 0 ? e(t) : null;
  31072. };
  31073. })()),
  31074. (l.prototype.peekNextFromUploadQueue = function () {
  31075. if (this.forceQueue.length > 0) return this.forceQueue[0];
  31076. var e = this.getTopUploadQueue();
  31077. return e && e.length > 0 ? e[0] : null;
  31078. }),
  31079. (l.prototype.clearAllQueuedUploads = function () {
  31080. this.clearAllUploadQueues(null, 0);
  31081. }),
  31082. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  31083. this.clearAllUploadQueues(e, 0);
  31084. }),
  31085. (l.prototype.clearAllUploadQueues = function (e, t) {
  31086. if (e)
  31087. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  31088. this.clearUploadQueue(this.forceQueue, t, e);
  31089. else {
  31090. for (var i = 0; i < this.activePanos.length; i++) {
  31091. var n = this.activePanos[i];
  31092. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t);
  31093. }
  31094. this.clearUploadQueue(this.forceQueue, t);
  31095. }
  31096. }),
  31097. (l.prototype.clearUploadQueue = function (e, t, i) {
  31098. (void 0 !== t && null !== t) || (t = 0);
  31099. for (var n = 0; n < e.length; ) {
  31100. var r = e[n];
  31101. (!i || (i && i === r.tile.panoId)) && r.level >= t
  31102. ? ((r.uploadQueued = !1), e.splice(n, 1))
  31103. : n++;
  31104. }
  31105. }),
  31106. (l.prototype.refreshUploadInterval = (function () {
  31107. var e = null;
  31108. return function (t) {
  31109. this.uploadIntervalCancelled ||
  31110. (e || (e = c.bind(this)),
  31111. (null !== t && void 0 !== t) || (t = w),
  31112. b || (t = _),
  31113. (this.uploadInterval = window.setTimeout(e, t)),
  31114. (this.uploadIntervalDelay = t));
  31115. };
  31116. })()),
  31117. (l.prototype.update = (function () {
  31118. var e = performance.now(),
  31119. t = 0;
  31120. return function () {
  31121. (this.uploadIntervalCancelled = !0),
  31122. window.clearTimeout(this.uploadInterval),
  31123. (this.uploadInterval = null);
  31124. var i = performance.now() - e;
  31125. !(i > w || 0 === t) ||
  31126. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  31127. (this.updateUploadQueue(
  31128. this.maxNonBaseUploadsPerFrame,
  31129. this.maxBaseUploadsPerFrame
  31130. ),
  31131. (e = performance.now())),
  31132. t++;
  31133. };
  31134. })()),
  31135. (l.prototype.updateUploadQueue = function (e, t) {
  31136. e || (e = 1);
  31137. for (var i = 0, n = 0; ; ) {
  31138. if (n >= t || i >= e) break;
  31139. var r = this.getNextFromUploadQueue();
  31140. if (!r) break;
  31141. if (
  31142. (0 !== r.level ? i++ : n++,
  31143. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31144. ) {
  31145. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  31146. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload);
  31147. }
  31148. }
  31149. }),
  31150. (l.prototype.updateDirection = function (e) {
  31151. if ((e = e || this.direction)) {
  31152. this.direction = e;
  31153. for (var t = 0; t < this.activePanos.length; t++) {
  31154. var i = this.activePanos[t],
  31155. n = this.getUploadQueueForPano(i.id);
  31156. y.sortPanoTiles(n, i, this.direction);
  31157. }
  31158. }
  31159. }),
  31160. (l.prototype.uploadTile = (function () {
  31161. var e = {},
  31162. t = (new h.Vector4(), d.tiling.overlayStyle);
  31163. //var failHistory = {};
  31164. return function (i, n) {
  31165. var r = i.panoId,
  31166. o = i.image,
  31167. a = i.tileSize,
  31168. s = i.panoSize,
  31169. l = i.tileIndex,
  31170. c = (i.faceTileIndex, i.totalTiles),
  31171. u = (i.face, i.tileX),
  31172. d = i.tileY,
  31173. p = !0,
  31174. g = !1,
  31175. m = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  31176. v = this.getActiveRenderTargetDescriptor(r),
  31177. A = v.renderTarget,
  31178. y = v.size;
  31179. if (
  31180. (this.isPanoZoomed(r) && ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  31181. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  31182. n ||
  31183. (this.anyUploaded(i.node) && ((p = !1), (g = !0)),
  31184. this.isTileUploaded(i) && ((p = !1), (g = !1))),
  31185. p)
  31186. ) {
  31187. /* if(failHistory[''+r+s+l]){
  31188. console.log('uploadTile retry', r, s, l)
  31189. }
  31190. console.log('uploadTile 成功', r, s, l)
  31191. */
  31192. var C = u * a,
  31193. I = d * a,
  31194. E = (a / s) * y,
  31195. b = (C / s) * y,
  31196. w = (I / s) * y;
  31197. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  31198. //var _ = e[a];
  31199. //-------------
  31200. if (s > this.qualityManager.maxRenderTargetSize) {
  31201. //4096 改
  31202. var _ = this.sceneRenderer.initSizedTexture2D(a, THREE.ClampToEdgeWrapping);
  31203. var loaded = player.model.isHighMapLoaded(i.cubeFace, u, d);
  31204. } else {
  31205. var _ = e[a];
  31206. }
  31207. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a);
  31208. if (s > this.qualityManager.maxRenderTargetSize) {
  31209. loaded || player.model.updateHighMap(_, i.cubeFace, u, d);
  31210. } else {
  31211. if (1 === t || 2 === t) {
  31212. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  31213. this.sceneRenderer.renderToCubeMap(
  31214. _,
  31215. A,
  31216. a,
  31217. a,
  31218. 0,
  31219. 0,
  31220. a,
  31221. a,
  31222. b,
  31223. w,
  31224. E,
  31225. E,
  31226. i.cubeFace
  31227. ),
  31228. this.sceneRenderer.renderToCubeMap(
  31229. T[s],
  31230. A,
  31231. a,
  31232. a,
  31233. 0,
  31234. 0,
  31235. a,
  31236. a,
  31237. b,
  31238. w,
  31239. E,
  31240. E,
  31241. i.cubeFace,
  31242. h.NormalBlending,
  31243. !0,
  31244. 0.5
  31245. );
  31246. } else
  31247. this.sceneRenderer.renderToCubeMap(
  31248. _,
  31249. A,
  31250. a,
  31251. a,
  31252. 0,
  31253. 0,
  31254. a,
  31255. a,
  31256. b,
  31257. w,
  31258. E,
  31259. E,
  31260. i.cubeFace
  31261. );
  31262. }
  31263. m.uploadCount++,
  31264. this.emit(f.TileRenderSuccess, r, s, l, c),
  31265. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  31266. this.setUploaded(i, !0),
  31267. this.addCoverageForNode(i.node);
  31268. } else {
  31269. this.setUploaded(i, !1);
  31270. //console.log('uploadTile 失败', r, s, l)
  31271. //failHistory[''+r+s+l] = true;
  31272. }
  31273. return (
  31274. i.uploadAttempted ||
  31275. (m.uploadAttempts++, this.emit(f.TileUploadAttempted, r, s, l, c)),
  31276. (i.uploadAttempted = !0),
  31277. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  31278. g
  31279. );
  31280. };
  31281. })()),
  31282. (l.prototype.linkTileAndNode = function (e, t) {
  31283. (t.tile = e), (e.node = t);
  31284. }),
  31285. (l.prototype.linkAllTilesAndNodes = function (e) {
  31286. for (
  31287. var t = function (t, i, n, r, o) {
  31288. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  31289. this.linkTileAndNode(a, n);
  31290. },
  31291. i = 0;
  31292. i < C.FACES_PER_PANO;
  31293. i++
  31294. ) {
  31295. var n = this.getTileTree(e.id, i);
  31296. n.breadthFirst({
  31297. callback: t.bind(this, n, i),
  31298. });
  31299. }
  31300. }),
  31301. (l.prototype.anyUploaded = function (e) {
  31302. if (!e) return !1;
  31303. if (e.tile && this.isTileUploaded(e.tile)) return !0;
  31304. if (e.children)
  31305. for (var t = 0; t < e.children.length; t++) {
  31306. var i = e.children[t];
  31307. if (this.anyUploaded(i)) return !0;
  31308. }
  31309. return !1;
  31310. }),
  31311. (l.prototype.setNodeCovered = function (e, t) {
  31312. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t);
  31313. }),
  31314. (l.prototype.isNodeCovered = function (e) {
  31315. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered);
  31316. }),
  31317. (l.prototype.addCoverageForNode = function (e) {
  31318. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  31319. var t = e.parent;
  31320. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0);
  31321. }
  31322. }),
  31323. (l.prototype.calcFullCoverage = function (e) {
  31324. var t = !1;
  31325. if (e.children)
  31326. for (var i = 0; i < e.children.length; i++) {
  31327. var n = e.children[i];
  31328. t = t || this.calcFullCoverage(n);
  31329. }
  31330. e.covered = e.tile.uploaded || t;
  31331. }),
  31332. (l.prototype.nodeSubcovered = function (e) {
  31333. if (!e.children) return !1;
  31334. for (var t = 0; t < e.children.length; t++)
  31335. if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1;
  31336. return !0;
  31337. }),
  31338. (l.prototype.resetPanoDescriptor = function (e) {
  31339. this.getPanoDescriptor(e);
  31340. }),
  31341. (l.prototype.getPanoDescriptor = function (e) {
  31342. var t = this.panoDescriptors[e];
  31343. return t || ((t = {}), (this.panoDescriptors[e] = t)), t;
  31344. }),
  31345. (l.prototype.resetPanoLODDescriptors = function (e) {
  31346. var t = this.getPanoLODDescriptors(e);
  31347. for (var i in t)
  31348. if (t.hasOwnProperty(i)) {
  31349. var n = t[i];
  31350. (n.uploadCount = 0), (n.uploadAttempts = 0);
  31351. }
  31352. }),
  31353. (l.prototype.getPanoLODDescriptor = function (e, t) {
  31354. var i = this.getPanoLODDescriptors(e),
  31355. n = i[t];
  31356. return (
  31357. n ||
  31358. ((n = {
  31359. uploadCount: 0,
  31360. uploadAttempts: 0,
  31361. }),
  31362. (i[t] = n)),
  31363. n
  31364. );
  31365. }),
  31366. (l.prototype.getPanoLODDescriptors = function (e) {
  31367. var t = this.panoLODDescriptors[e];
  31368. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t;
  31369. }),
  31370. (l.prototype.onTileDownloaded = function (e) {
  31371. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  31372. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  31373. if (
  31374. ((i.downloaded = !0),
  31375. (i.image = e.image),
  31376. (i.panoSize = e.panoSize),
  31377. (i.tileX = e.tileX),
  31378. (i.tileY = e.tileY),
  31379. (i.totalTiles = e.totalTiles),
  31380. (i.tileIndex = e.tileIndex),
  31381. (i.faceTileIndex = e.faceTileIndex),
  31382. (i.face = e.face),
  31383. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  31384. (i.panoId = e.panoId),
  31385. (i.tileSize = e.tileSize),
  31386. (i.direction = new h.Vector3().copy(e.direction)),
  31387. (i.node = null),
  31388. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  31389. this.isPanoActive(i.panoId))
  31390. ) {
  31391. var n = this.getTileTree(i.panoId, i.face),
  31392. r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  31393. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0);
  31394. }
  31395. }),
  31396. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  31397. var r = this.tileDirectory[e];
  31398. r || ((r = {}), (this.tileDirectory[e] = r));
  31399. var o = 16384 * t + 1024 * i + n,
  31400. a = r[o];
  31401. return (
  31402. a ||
  31403. ((a = {
  31404. downloaded: !1,
  31405. uploaded: !1,
  31406. zoomUploaded: !1,
  31407. }),
  31408. (r[o] = a)),
  31409. (a._key = e + ':' + t + ':' + i + ':' + n),
  31410. (a._tileKey = o),
  31411. a
  31412. );
  31413. }),
  31414. (l.prototype.setZoomingActive = function (e, t, i) {
  31415. this.zoomPanoRenderingDisabled ||
  31416. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  31417. ((this.zoomingActive = e),
  31418. (this.zoomPanoId = t.id),
  31419. this.zoomingActive &&
  31420. (this.zoomPanoId !== t.id || i) &&
  31421. this.updateZoomedPanoFromBase(t));
  31422. }),
  31423. (l.prototype.updateZoomedPanoFromBase = function (e) {
  31424. if (!this.zoomPanoRenderingDisabled) {
  31425. var t = this.getActiveRenderTargetDescriptor(e.id);
  31426. if (t && t.renderTarget) {
  31427. var i = Math.min(
  31428. this.qualityManager.maxRenderTargetSize,
  31429. this.qualityManager.getMaxZoomPanoSize()
  31430. ), //this.qualityManager.getMaxZoomPanoSize()
  31431. n = t.renderTarget,
  31432. r = t.size;
  31433. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  31434. this.copyBaseRenderStatusToZoomed(e.id);
  31435. }
  31436. }
  31437. }),
  31438. (t.exports = l);
  31439. },
  31440. {
  31441. '../enum/GLCubeFaces': 25,
  31442. '../enum/PanoRendererEvents': 35,
  31443. '../enum/PanoSizeClass': 36,
  31444. '../enum/SceneRendererEvents': 43,
  31445. '../enum/TileDownloaderEvents': 45,
  31446. '../enum/Vectors': 50,
  31447. '../exception/BasicException': 55,
  31448. '../objects/Panorama': 148,
  31449. '../settings': 166,
  31450. '../util/browser': 182,
  31451. '../util/panorama': 191,
  31452. './TileDownloader': 171,
  31453. './TilePrioritizer': 172,
  31454. './TileTree': 173,
  31455. './TileUtils': 174,
  31456. events: 202,
  31457. three: 217,
  31458. },
  31459. ],
  31460. 170: [
  31461. function (e, t, i) {
  31462. 'use strict';
  31463. function n(e, t, i) {
  31464. (this.maxNavPanoSize = -1),
  31465. (this.maxZoomPanoSize = -1),
  31466. (this.devicePixelDensity = e),
  31467. (this.deviceScreenSize = t),
  31468. (this.clientBandwidth = i),
  31469. (this.panoSizeClassMap = {}),
  31470. (this.useHighResolutionPanos = !0),
  31471. (this.useUltraHighResolutionPanos = !1),
  31472. (this.modelHasUltraHighPanos = !1);
  31473. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096; //add
  31474. }
  31475. var r = e('../enum/PanoSizeClass'),
  31476. o = e('../settings'),
  31477. a = e('../util/browser'),
  31478. s = e('../constants'),
  31479. l = e('../util/showcase'),
  31480. c = e('../enum/ModelManagerEvents');
  31481. (n.prototype.init = function (e) {
  31482. this.buildPanoSizeClassMap(
  31483. this.devicePixelDensity,
  31484. this.deviceScreenSize,
  31485. this.clientBandwidth
  31486. ),
  31487. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  31488. (this.highSize = this.getPanoSize(r.HIGH)),
  31489. (this.standardSize = this.getPanoSize(r.STANDARD)),
  31490. (this.baseSize = this.getPanoSize(r.BASE)),
  31491. o.tiling.maxZoomPanoQuality &&
  31492. this.ultraHighSize <= o.tiling.maxZoomPanoQuality &&
  31493. (o.tiling.allowUltraHighResolution = !0),
  31494. (this.highQualityThreshold = a.valueFromHash(
  31495. 'threshold2k',
  31496. s.windowHeightHighQualityThreshold
  31497. )),
  31498. this.updateMaximums(),
  31499. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this));
  31500. }),
  31501. (n.prototype.updateFromModel = function (e) {
  31502. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e);
  31503. }),
  31504. (n.prototype.updateHighResolutionSettings = function (e) {
  31505. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  31506. l.modelDataPromisesTiles(e.data)
  31507. ? (this.useHighResolutionPanos = !0)
  31508. : (this.useHighResolutionPanos = !1),
  31509. //this.useHighResolutionPanos = !0;
  31510. //----------------------e n d -----------------------------------------------------------------
  31511. this.updateMaximums();
  31512. }),
  31513. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  31514. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos
  31515. ? (this.useUltraHighResolutionPanos = !0)
  31516. : (this.useUltraHighResolutionPanos = !1),
  31517. this.updateMaximums();
  31518. }),
  31519. (n.prototype.enableUltraHighQualityMode = function () {
  31520. (this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null);
  31521. }),
  31522. (n.prototype.ultraHighQualityModeEnabled = function () {
  31523. return this.modelHasUltraHighPanos;
  31524. }),
  31525. (n.prototype.onModelChanged = function (e) {
  31526. this.updateFromModel(e.model), this.updateMaximums();
  31527. }),
  31528. (n.prototype.updateMaximums = function () {
  31529. (this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  31530. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  31531. this.maxZoomPanoSize < this.maxNavPanoSize &&
  31532. (this.maxNavPanoSize = this.maxZoomPanoSize);
  31533. }),
  31534. (n.prototype.buildPanoSizeClassMap = function () {
  31535. (this.panoSizeClassMap[r.BASE] = 512),
  31536. (this.panoSizeClassMap[r.STANDARD] = 1024),
  31537. (this.panoSizeClassMap[r.HIGH] = 2048),
  31538. (this.panoSizeClassMap[r.ULTRAHIGH] = 4096);
  31539. }),
  31540. (n.prototype.getPanoSize = function (e) {
  31541. return this.panoSizeClassMap[e];
  31542. }),
  31543. (n.prototype.getMaxPossiblePanoSize = function () {
  31544. return this.getPanoSize(r.ULTRAHIGH);
  31545. }),
  31546. (n.prototype.getMaxPanoSize = function () {
  31547. return this.maxZoomPanoSize;
  31548. }),
  31549. (n.prototype.getMaxNavPanoSize = function () {
  31550. return this.maxNavPanoSize;
  31551. }),
  31552. (n.prototype.getMaxZoomPanoSize = function () {
  31553. return this.maxZoomPanoSize;
  31554. }),
  31555. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  31556. if(settings.mobileNavHigh)return r.HIGH //改
  31557. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  31558. } */
  31559. (n.prototype.detectDevice = function () {
  31560. //add
  31561. if (a.isMobile()) {
  31562. let area = $('#player').width() * $('#player').height();
  31563. if (area < 768 * 1024) {
  31564. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  31565. return 'mobile';
  31566. } else {
  31567. return 'bigMobile';
  31568. }
  31569. } else {
  31570. return 'pc';
  31571. }
  31572. });
  31573. (n.prototype.detectMaxNavPanoSizeClass = function () {
  31574. //xzw 改
  31575. switch (this.getNavZoomClass()) {
  31576. case '1k':
  31577. return r.STANDARD;
  31578. break;
  31579. case '2k':
  31580. default:
  31581. return r.HIGH;
  31582. case '4k': //虽然这种暂不支持
  31583. return r.ULTRAHIGH;
  31584. }
  31585. }),
  31586. (n.prototype.detectMaxNavPanoSize = function () {
  31587. var e = this.detectMaxNavPanoSizeClass();
  31588. return this.getPanoSize(e);
  31589. }),
  31590. (n.prototype.getMaxZoomClass = function () {
  31591. //add
  31592. let type = this.detectDevice();
  31593. let setting = settings.tileClass[type]; //见manage.js的settings
  31594. return setting.max;
  31595. });
  31596. (n.prototype.getNavZoomClass = function () {
  31597. //add
  31598. let type = this.detectDevice();
  31599. let setting = settings.tileClass[type];
  31600. return setting.nav;
  31601. }),
  31602. (n.prototype.detectMaxZoomPanoSize = function () {
  31603. //获取当前zoomRenderTarget应下载的最高级别
  31604. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  31605. if (this.zoomLevelResolution) {
  31606. //有三个级别
  31607. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  31608. return this.getPanoSize(r.ULTRAHIGH);
  31609. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  31610. return this.getPanoSize(r.STANDARD);
  31611. } else {
  31612. return this.getPanoSize(r.HIGH);
  31613. }
  31614. } else {
  31615. let tileClass = this.getMaxZoomClass();
  31616. if (tileClass == '1k') return this.getPanoSize(r.STANDARD);
  31617. if (tileClass == '4k' && this.useUltraHighResolutionPanos) {
  31618. return this.getPanoSize(r.ULTRAHIGH);
  31619. } else {
  31620. //'2k'
  31621. return this.getPanoSize(r.HIGH);
  31622. }
  31623. }
  31624. }),
  31625. /* n.prototype.detectMaxZoomPanoSize = function() {
  31626. return this.useHighResolutionPanos ? a.isMobile() ? o.tiling.mobileHighQualityOverride ? this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD) : this.useUltraHighResolutionPanos ? this.getPanoSize(r.ULTRAHIGH) : this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD)
  31627. } */
  31628. (t.exports = n);
  31629. },
  31630. {
  31631. '../constants': 8,
  31632. '../enum/ModelManagerEvents': 33,
  31633. '../enum/PanoSizeClass': 36,
  31634. '../settings': 166,
  31635. '../util/browser': 182,
  31636. '../util/showcase': 193,
  31637. },
  31638. ],
  31639. 171: [
  31640. function (e, t, i) {
  31641. (function (i) {
  31642. 'use strict';
  31643. function n(e) {
  31644. (this.panos = null),
  31645. (this.retryMinimumTime = 1e4),
  31646. (this.urls = null),
  31647. (this.panoLoadCallbacks = {}),
  31648. (this.downloadDescriptors = {}),
  31649. (this.priorityQueue = []),
  31650. (this.forceQueue = []),
  31651. (this.activeDownloads = []),
  31652. (this.qualityManager = null),
  31653. (this.tilePrioritizer = null),
  31654. (this.refreshInterval = null),
  31655. (this.processPriorityQueue = !1),
  31656. (this.concurrentDownloads = e.concurrentDownloads || 1),
  31657. (this.downloadTestResults = {});
  31658. }
  31659. var r = e('three'),
  31660. o = (e('../enum/Viewmode'), e('../settings')),
  31661. a = (e('../objects/Panorama'), e('../util/logger')),
  31662. s =
  31663. (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/TileDownloaderEvents')),
  31664. l = e('./TilePrioritizer'),
  31665. c = e('./TileUtils'),
  31666. h = (e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  31667. u = e('../util/panorama'),
  31668. d = e('../util/ajax'),
  31669. p = e('../ab'),
  31670. f = e('events').EventEmitter,
  31671. g =
  31672. (new a(i),
  31673. Object.freeze({
  31674. Testing: 1,
  31675. Success: 2,
  31676. Fail: 3,
  31677. }));
  31678. (n.prototype = Object.create(f.prototype)),
  31679. (n.IDLE_REFRESH_DELAY = 500),
  31680. (n.ACTIVE_REFRESH_DELAY = 16),
  31681. (n.DOWNLOAD_RETRIES = 4),
  31682. (n.prototype.init = function (e) {
  31683. this.qualityManager = e;
  31684. }),
  31685. (n.prototype.setUrls = function (e) {
  31686. this.urls = e;
  31687. }),
  31688. (n.prototype.setPanoData = function (e, t, i) {
  31689. (this.panos = e), (this.imagePanos = t), (this.panoGroupId = i);
  31690. }),
  31691. (n.prototype.start = function () {
  31692. this.refreshUpdateInterval(0);
  31693. }),
  31694. (n.prototype.stop = function () {
  31695. window.cancel(this.refreshInterval);
  31696. }),
  31697. (n.prototype.refreshUpdateInterval = function (e) {
  31698. e || (e = 0),
  31699. (this.refreshInterval = window.setTimeout(
  31700. function () {
  31701. var e = this.update();
  31702. e
  31703. ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY)
  31704. : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY);
  31705. }.bind(this),
  31706. e
  31707. ));
  31708. }),
  31709. (n.prototype.update = function () {
  31710. var e = this.forceQueue.length > 0;
  31711. return (
  31712. this.processQueueForDownloading(this.forceQueue),
  31713. this.processPriorityQueue &&
  31714. (this.queuePrioritizedTilesForPanos(this.panos),
  31715. this.priorityQueue.length > 0 && (e = !0),
  31716. this.processQueueForDownloading(this.priorityQueue)),
  31717. e
  31718. );
  31719. }),
  31720. (n.prototype.forceQueueTilesForPano = (function () {
  31721. var e = [],
  31722. t = [];
  31723. return function (i, n, r, o, a, s) {
  31724. e.length = 0;
  31725. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  31726. var p = u[d];
  31727. (p.status !== h.None && p.status !== h.Queued) || e.push(p);
  31728. }
  31729. if (r && e.length > 0) {
  31730. l.sortPanoTiles(e, i, r),
  31731. (t.length = 0),
  31732. c.matchingTilesInDirection(i, n, r, o, a, t);
  31733. for (
  31734. var f = 0,
  31735. g = function (e) {
  31736. return e.face === m.face && e.faceTileIndex === m.faceTileIndex;
  31737. };
  31738. f < e.length;
  31739. ) {
  31740. var m = e[f],
  31741. v = t.findIndex(g);
  31742. v < 0 ? e.splice(f, 1) : f++;
  31743. }
  31744. }
  31745. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A]);
  31746. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  31747. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  31748. s && this.processQueueForDownloading(this.forceQueue, !0);
  31749. };
  31750. })()),
  31751. (n.prototype.clearForceQueue = function () {
  31752. this.clearQueue(this.forceQueue);
  31753. }),
  31754. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  31755. this.tilePrioritizer &&
  31756. (this.clearQueue(this.priorityQueue),
  31757. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  31758. this.clearFromQueue(this.priorityQueue, h.None, !0),
  31759. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued));
  31760. }),
  31761. (n.prototype.clearQueue = function (e) {
  31762. this.setStatusForAllDescriptors(e, h.None), (e.length = 0);
  31763. }),
  31764. (n.prototype.clearFromQueue = function (e, t, i) {
  31765. for (var n = 0; n < e.length; n++) {
  31766. var r = e[n];
  31767. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null);
  31768. }
  31769. }),
  31770. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  31771. for (var i = 0; i < e.length; i++) {
  31772. var n = e[i];
  31773. n && (n.status = t);
  31774. }
  31775. }),
  31776. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  31777. for (var i = 0; i < e.length; i++) {
  31778. var n = e[i];
  31779. n && (n.status !== t ? (n.status = t) : (e[i] = null));
  31780. }
  31781. }),
  31782. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  31783. var i = this.getAllTileDownloadDescriptorsForPano(e),
  31784. n = i[t];
  31785. return (
  31786. n ||
  31787. ((n = this.buildDownloadDescriptorArray(t)),
  31788. (i[t] = n),
  31789. this.initTileDownloadDescriptors(n, e, t)),
  31790. n
  31791. );
  31792. }),
  31793. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  31794. var t = this.downloadDescriptors[e.id];
  31795. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t;
  31796. }),
  31797. (n.prototype.processQueueForDownloading = function (e, t) {
  31798. if (
  31799. (this.cleanupActiveDownloads(),
  31800. this.activeDownloads.length < this.concurrentDownloads || t)
  31801. )
  31802. for (
  31803. var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length,
  31804. n = 0,
  31805. r = 0;
  31806. n < i && e.length > 0;
  31807. r++
  31808. ) {
  31809. var o = e.shift();
  31810. o && (this.startDownload(o), n++);
  31811. }
  31812. }),
  31813. (n.prototype.testDownload = function (e, t, i) {
  31814. var n = this.downloadTestResults[e];
  31815. if (n) return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  31816. this.downloadTestResults[e] = g.Testing;
  31817. var r = this.panos.list[0],
  31818. o = this.getTileUrl(r.id, e, t, 0),
  31819. a = function (t) {
  31820. (this.downloadTestResults[e] = g.Success), i(!0);
  31821. }.bind(this),
  31822. s = function () {
  31823. (this.downloadTestResults[e] = g.Fail), i(!1);
  31824. }.bind(this);
  31825. this.loadImage(o, 0, a, s);
  31826. }),
  31827. (n.prototype.startDownload = function (e) {
  31828. e.status = h.Downloading;
  31829. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  31830. this.activeDownloads.push(e),
  31831. this.loadImage(
  31832. t,
  31833. n.DOWNLOAD_RETRIES,
  31834. this.downloadComplete.bind(this, e),
  31835. this.downloadFailed.bind(this, e)
  31836. );
  31837. }),
  31838. (n.prototype.downloadFailed = function (e, t) {}),
  31839. (n.prototype.downloadComplete = function (e, t) {
  31840. if (e.panoGroupId === this.panoGroupId) {
  31841. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  31842. (e.status = h.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  31843. var n = {
  31844. panoId: e.pano.id,
  31845. image: t,
  31846. tileSize: e.tileSize,
  31847. panoSize: e.panoSize,
  31848. tileIndex: e.tileIndex,
  31849. faceTileIndex: e.faceTileIndex,
  31850. totalTiles: e.totalTiles,
  31851. face: e.face,
  31852. tileX: e.tileX,
  31853. tileY: e.tileY,
  31854. direction: e.direction,
  31855. };
  31856. (e.image = t),
  31857. this.emit(s.TileDownloadSuccess, n),
  31858. this.isPanoDownloaded(e.pano, e.panoSize) &&
  31859. ((n = {
  31860. panoId: e.pano.id,
  31861. tileSize: e.tileSize,
  31862. panoSize: e.panoSize,
  31863. }),
  31864. this.emit(s.PanoDownloadComplete, n),
  31865. i && i.onLoad && i.onLoad(e.pano, e.panoSize));
  31866. }
  31867. }),
  31868. (n.prototype.cleanupActiveDownloads = (function () {
  31869. var e = [];
  31870. return function () {
  31871. e.length = 0;
  31872. for (var t = 0; t < this.activeDownloads.length; t++) {
  31873. var i = this.activeDownloads[t];
  31874. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i);
  31875. }
  31876. (this.activeDownloads.length = 0),
  31877. this.activeDownloads.push.apply(this.activeDownloads, e);
  31878. };
  31879. })()),
  31880. (n.prototype.isPanoDownloaded = function (e, t) {
  31881. var i = this.getTileDownloadDescriptors(e, t);
  31882. if (i.length <= 0) return !1;
  31883. for (var n = 0; n < i.length; n++) {
  31884. var r = i[n];
  31885. if (r.status !== h.Downloaded) return !1;
  31886. }
  31887. return !0;
  31888. }),
  31889. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  31890. var o = e.id + ':' + this.qualityManager.getPanoSize(t);
  31891. this.panoLoadCallbacks[o] = {
  31892. onLoad: i,
  31893. onFail: n,
  31894. onProgress: r,
  31895. };
  31896. }),
  31897. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  31898. var i = e.id + ':' + t;
  31899. return this.panoLoadCallbacks[i];
  31900. }),
  31901. (n.prototype.buildDownloadDescriptorArray = function (e) {
  31902. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  31903. var r = this.buildDownloadDescriptor();
  31904. i.push(r);
  31905. }
  31906. return i;
  31907. }),
  31908. (n.prototype.buildDownloadDescriptor = function () {
  31909. var e = {
  31910. panoGroupId: null,
  31911. pano: null,
  31912. panoSize: -1,
  31913. tileSize: -1,
  31914. tileIndex: -1,
  31915. totalTiles: -1,
  31916. faceTileIndex: -1,
  31917. status: h.None,
  31918. url: null,
  31919. image: null,
  31920. direction: new r.Vector3(),
  31921. face: -1,
  31922. cubeFace: -1,
  31923. tileX: -1,
  31924. tileY: -1,
  31925. };
  31926. return e;
  31927. }),
  31928. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  31929. for (var n = 0; n < e.length; n++) {
  31930. var r = e[n];
  31931. this.initTileDownloadDescriptor(r, t, i, n);
  31932. }
  31933. }),
  31934. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  31935. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  31936. (e.face = c.getFaceForTile(i, n)),
  31937. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  31938. (e.panoGroupId = this.panoGroupId),
  31939. (e.pano = t),
  31940. (e.panoSize = i),
  31941. (e.tileSize = r),
  31942. (e.tileIndex = n),
  31943. (e.totalTiles = c.getTileCountForSize(i)),
  31944. (e.status = h.None),
  31945. (e.image = null),
  31946. c.getTileLocation(e.panoSize, e.tileIndex, e),
  31947. c.getTileVector(
  31948. e.panoSize,
  31949. e.tileSize,
  31950. e.cubeFace,
  31951. e.tileX,
  31952. e.tileY,
  31953. c.LocationOnTile.Center,
  31954. 0,
  31955. e.direction
  31956. );
  31957. }),
  31958. (n.prototype.getTileUrl = (function () {
  31959. var e = {
  31960. 256: '256',
  31961. 512: '512',
  31962. 1024: '1k',
  31963. 2048: '2k',
  31964. 4096: '4k',
  31965. },
  31966. t = {
  31967. face: -1,
  31968. faceTileIndex: -1,
  31969. tileX: -1,
  31970. tileY: -1,
  31971. };
  31972. return function (i, n, r, a) {
  31973. c.getTileLocation(n, a, t);
  31974. var s = Math.floor(n / r),
  31975. l = s * s,
  31976. h = Math.floor(a / l),
  31977. u = '';
  31978. 1 === o.tiling.customCompression && (u = '_' + o.tiling['q' + e[n]]);
  31979. var d = this.urls.get(
  31980. 'tiles/' +
  31981. i +
  31982. '/' +
  31983. e[n] +
  31984. u +
  31985. '_face' +
  31986. h +
  31987. '_' +
  31988. t.tileX +
  31989. '_' +
  31990. t.tileY +
  31991. '.jpg'
  31992. );
  31993. return (d = p.changeIfTileGenerating(d));
  31994. };
  31995. })()),
  31996. (n.prototype.loadImage = function (e, t, i, n) {
  31997. d.getImage(e, t)
  31998. .then(function (e) {
  31999. i(e);
  32000. })
  32001. .fail(n);
  32002. }),
  32003. (t.exports = n);
  32004. }.call(this, '/js/tile/TileDownloader.js'));
  32005. },
  32006. {
  32007. '../ab': 3,
  32008. '../enum/DownloadStatus': 24,
  32009. '../enum/GLCubeFaces': 25,
  32010. '../enum/PanoSizeClass': 36,
  32011. '../enum/TileDownloaderEvents': 45,
  32012. '../enum/Vectors': 50,
  32013. '../enum/Viewmode': 51,
  32014. '../objects/Panorama': 148,
  32015. '../settings': 166,
  32016. '../util/ajax': 181,
  32017. '../util/logger': 189,
  32018. '../util/panorama': 191,
  32019. './TilePrioritizer': 172,
  32020. './TileUtils': 174,
  32021. events: 202,
  32022. three: 217,
  32023. },
  32024. ],
  32025. 172: [
  32026. function (e, t, i) {
  32027. (function (i) {
  32028. 'use strict';
  32029. function n(e, t, i, o, a) {
  32030. (this.qualityManager = e),
  32031. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  32032. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  32033. (this.baseSize = t),
  32034. (this.standardSize = i),
  32035. (this.highSize = o),
  32036. (this.ultraHighSize = a),
  32037. (this.priorityCriteria = new n.PriorityCriteria(
  32038. null,
  32039. new r.Vector3(0, 0, 0),
  32040. new r.Vector3(0, 0, -1),
  32041. new r.Vector3(0, 0, -1)
  32042. ));
  32043. }
  32044. var r = e('three'),
  32045. o =
  32046. (e('../enum/Viewmode'), e('../settings'), e('../settings'), e('../objects/Panorama')),
  32047. a = e('../util/logger'),
  32048. s =
  32049. (e('../enum/Vectors'),
  32050. e('../enum/PanoSizeClass'),
  32051. e('../enum/ModelManagerEvents'),
  32052. e('../enum/GLCubeFaces'),
  32053. e('../enum/DownloadStatus')),
  32054. l = (e('../util/browser'), e('./TileUtils')),
  32055. c = e('../util/math'),
  32056. h =
  32057. (e('events').EventEmitter,
  32058. new a(i),
  32059. Object.freeze({
  32060. None: 0,
  32061. DirectionalFOV: 1,
  32062. }));
  32063. (n.PriorityCriteria = function (e, t, i, n, o) {
  32064. (this.pano = e),
  32065. (this.cameraPosition = new r.Vector3().copy(t)),
  32066. (this.cameraDir = new r.Vector3().copy(i)),
  32067. (this.panoSpaceDir = new r.Vector3().copy(n)),
  32068. (this.upcomingPanos = o),
  32069. (this.copy = function (e) {
  32070. (this.pano = e.pano),
  32071. this.cameraPosition.copy(e.cameraPosition),
  32072. this.cameraDir.copy(e.cameraDir),
  32073. this.panoSpaceDir.copy(e.panoSpaceDir),
  32074. (this.upcomingPanos = o);
  32075. }),
  32076. (this.zoomingActive = !1);
  32077. }),
  32078. (n.DIRECTIONAL_FOV = 180),
  32079. (n.DIRECTIONAL_FOV_NARROW = 120),
  32080. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  32081. (n.MAX_SCORED_PANOS_TOADD = 2),
  32082. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  32083. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  32084. (n.appendQueue = function (e, t) {
  32085. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i]);
  32086. }),
  32087. (n.prototype.updateCriteria = function (e, t, i, n) {
  32088. (this.priorityCriteria.pano = e),
  32089. this.priorityCriteria.cameraPosition.copy(t),
  32090. this.priorityCriteria.cameraDir.copy(i),
  32091. (this.priorityCriteria.upcomingPanos = n),
  32092. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  32093. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize());
  32094. }),
  32095. (n.prototype.filterAndPrioritize = (function () {
  32096. var e = [],
  32097. t = [],
  32098. i = [];
  32099. return function (r, o, a) {
  32100. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  32101. this.populateScoredPanos(
  32102. this.priorityCriteria.pano,
  32103. o,
  32104. t,
  32105. this.priorityCriteria.cameraDir,
  32106. n.MAX_SCORED_PANOS_TOCONSIDER
  32107. );
  32108. var s = this.baseSize,
  32109. l = this.standardSize,
  32110. c = this.highSize,
  32111. h = this.ultraHighSize;
  32112. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  32113. this.priorityCriteria.upcomingPanos &&
  32114. this.queueTilesForPanos(
  32115. r,
  32116. this.priorityCriteria.upcomingPanos,
  32117. a,
  32118. s,
  32119. n.MAX_UPCOMING_PANOS_TOADD
  32120. ),
  32121. this.priorityCriteria.upcomingPanos &&
  32122. this.queueTilesForPanos(
  32123. r,
  32124. this.priorityCriteria.upcomingPanos,
  32125. a,
  32126. 1024,
  32127. n.MAX_UPCOMING_PANOS_TOADD
  32128. ), //更清晰些
  32129. (i.length = 0),
  32130. this.canDownloadSize(l) &&
  32131. this.queueTilesInDirectionForPano(
  32132. i,
  32133. a,
  32134. this.priorityCriteria.pano,
  32135. l,
  32136. this.priorityCriteria.cameraPosition,
  32137. this.priorityCriteria.cameraDir,
  32138. n.DIRECTIONAL_FOV_NARROW
  32139. ),
  32140. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32141. n.appendQueue(r, i),
  32142. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  32143. (i.length = 0),
  32144. this.canDownloadSize(c) &&
  32145. this.queueTilesInDirectionForPano(
  32146. i,
  32147. a,
  32148. this.priorityCriteria.pano,
  32149. c,
  32150. this.priorityCriteria.cameraPosition,
  32151. this.priorityCriteria.cameraDir,
  32152. n.DIRECTIONAL_FOV_NARROW
  32153. ),
  32154. this.canDownloadSize(h) &&
  32155. this.queueTilesInDirectionForPano(
  32156. i,
  32157. a,
  32158. this.priorityCriteria.pano,
  32159. h,
  32160. this.priorityCriteria.cameraPosition,
  32161. this.priorityCriteria.cameraDir,
  32162. n.DIRECTIONAL_FOV_NARROW
  32163. ),
  32164. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32165. n.appendQueue(r, i),
  32166. (i.length = 0),
  32167. this.canDownloadSize(l) &&
  32168. this.queueTilesInDirectionForPano(
  32169. i,
  32170. a,
  32171. this.priorityCriteria.pano,
  32172. l,
  32173. this.priorityCriteria.cameraPosition,
  32174. this.priorityCriteria.cameraDir,
  32175. n.DIRECTIONAL_FOV
  32176. ),
  32177. this.canDownloadSize(c) &&
  32178. this.queueTilesInDirectionForPano(
  32179. i,
  32180. a,
  32181. this.priorityCriteria.pano,
  32182. c,
  32183. this.priorityCriteria.cameraPosition,
  32184. this.priorityCriteria.cameraDir,
  32185. n.DIRECTIONAL_FOV
  32186. ),
  32187. this.canDownloadSize(h) &&
  32188. this.queueTilesInDirectionForPano(
  32189. i,
  32190. a,
  32191. this.priorityCriteria.pano,
  32192. h,
  32193. this.priorityCriteria.cameraPosition,
  32194. this.priorityCriteria.cameraDir,
  32195. n.DIRECTIONAL_FOV
  32196. ),
  32197. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32198. n.appendQueue(r, i),
  32199. this.queueTilesForPanos(r, e, a, s);
  32200. };
  32201. })()),
  32202. (n.prototype.canDownloadSize = function (e) {
  32203. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive);
  32204. }),
  32205. (n.prototype.populateNeighborPanos = function (e, t, i) {
  32206. (i = i || []), (i.length = 0);
  32207. var n = t.getNeighbours(e);
  32208. for (var r in n)
  32209. if (n.hasOwnProperty(r)) {
  32210. var o = t.get(r);
  32211. i.push(o);
  32212. }
  32213. return i;
  32214. }),
  32215. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  32216. (i = i || []), (i.length = 0);
  32217. var s = [
  32218. o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS),
  32219. o.filters.not(e),
  32220. ],
  32221. l = [
  32222. o.scoreFunctions.distanceSquared(e),
  32223. o.scoreFunctions.direction(e.position, r),
  32224. ],
  32225. c = t.sortByScore(s, l);
  32226. if (c)
  32227. for (var h = 0; h < c.length && h < a; h++) {
  32228. var u = c[h].item;
  32229. i.push(u);
  32230. }
  32231. return i;
  32232. }),
  32233. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  32234. for (var o = 0, a = 0; a < t.length; a++) {
  32235. var s = t[a],
  32236. l = this.queueTilesForPano(e, i, s, n);
  32237. if (((o += l > 0 ? 1 : 0), r && o >= r)) break;
  32238. }
  32239. return o;
  32240. }),
  32241. (n.prototype.queueTilesForPano = (function () {
  32242. var e = {
  32243. filter: h.None,
  32244. };
  32245. return function (t, i, n, r) {
  32246. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e);
  32247. };
  32248. })()),
  32249. (n.prototype.queueTilesForPanosInDirection = (function () {
  32250. var e = new r.Vector3();
  32251. return function (t, i, n, r, o, a, s, l) {
  32252. for (var h = 0, u = 0; u < n.length; u++) {
  32253. var d = n[u];
  32254. e.copy(d.position), e.sub(o), e.normalize();
  32255. var p = Math.max(Math.min(a.dot(e), 1), -1),
  32256. f = c.getFOVDotThreshold(s);
  32257. if (p >= f) {
  32258. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  32259. if (((h += g > 0 ? 1 : 0), l && h >= l)) break;
  32260. }
  32261. }
  32262. return h;
  32263. };
  32264. })()),
  32265. (n.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  32266. for (var l = 0, c = 0; c < i.length; c++) {
  32267. var h = i[c],
  32268. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  32269. if (((l += u > 0 ? 1 : 0), s && l >= s)) break;
  32270. }
  32271. return l;
  32272. }),
  32273. (n.prototype.queueTilesInDirectionForPano = (function () {
  32274. var e = {
  32275. filter: h.DirectionalFOV,
  32276. direction: new r.Vector3(),
  32277. fov: 60,
  32278. },
  32279. t = new r.Vector3();
  32280. return function (i, n, r, o, a, s, c) {
  32281. return (
  32282. t.copy(s),
  32283. l.getRelativeDirection(r.quaternion, t),
  32284. e.direction.copy(t),
  32285. (e.fov = c),
  32286. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  32287. );
  32288. };
  32289. })()),
  32290. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  32291. var e = [];
  32292. return function (t, i, n, r, o) {
  32293. var a = i.getTileDownloadDescriptors(n, r);
  32294. (e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o);
  32295. for (var s = 0, l = 0; l < e.length; l++) {
  32296. var c = e[l];
  32297. c && (t.push(c), s++);
  32298. }
  32299. return s;
  32300. };
  32301. })()),
  32302. (n.prototype.filterTileDownloadDescriptors = (function () {
  32303. new r.Vector3();
  32304. return function (e, t, i, n) {
  32305. var r, o;
  32306. switch (n.filter) {
  32307. case h.DirectionalFOV:
  32308. for (r = 0; r < t.length; r++)
  32309. (o = t[r]),
  32310. l.isTileWithinFOV(
  32311. o.panoSize,
  32312. o.tileSize,
  32313. o.face,
  32314. o.tileX,
  32315. o.tileY,
  32316. n.direction,
  32317. n.fov
  32318. ) && i.push(o);
  32319. break;
  32320. default:
  32321. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o);
  32322. }
  32323. for (r = 0; r < i.length; r++)
  32324. (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null);
  32325. };
  32326. })()),
  32327. (n.prototype.canIncludeDescriptor = function (e) {
  32328. return e.status !== s.Downloading && e.status !== s.Downloaded;
  32329. }),
  32330. (n.prototype.canIncludePano = function (e, t) {
  32331. return !e.isLoaded(t);
  32332. }),
  32333. (n.getFOVDotThreshold = function (e) {
  32334. return Math.cos(r.Math.degToRad(e / 2));
  32335. });
  32336. var u = (function () {
  32337. var e = function e(t, i) {
  32338. var n = e._panoSpaceDir,
  32339. r = e._fovThreshold,
  32340. o = e._fovThresholdNarrow,
  32341. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  32342. s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  32343. return (
  32344. (t._dot = a),
  32345. (i._dot = s),
  32346. a >= r && s < r
  32347. ? -1
  32348. : a < r && s >= r
  32349. ? 1
  32350. : a >= o && s < o
  32351. ? -1
  32352. : a < o && s >= o
  32353. ? 1
  32354. : t.panoSize > i.panoSize
  32355. ? 1
  32356. : i.panoSize > t.panoSize
  32357. ? -1
  32358. : -(a - s)
  32359. );
  32360. };
  32361. return (
  32362. (e._panoSpaceDir = new r.Vector3()),
  32363. (e._fovThreshold = -1),
  32364. (e._fovThresholdNarrow = -1),
  32365. e
  32366. );
  32367. })();
  32368. (n.sortPanoTiles = function (e, t, i) {
  32369. u._panoSpaceDir.copy(i),
  32370. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  32371. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32372. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  32373. e.sort(u);
  32374. }),
  32375. (n.insertSortedPanoTile = function (e, t, i, r) {
  32376. u._panoSpaceDir.copy(r),
  32377. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  32378. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32379. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV));
  32380. for (var o = -1, a = 0; a < e.length; a++) {
  32381. var s = u(t, e[a]);
  32382. if (s <= 0) {
  32383. o = a;
  32384. break;
  32385. }
  32386. }
  32387. if (o === -1) e[e.length] = t;
  32388. else {
  32389. for (var h = e.length; h > o; h--) e[h] = e[h - 1];
  32390. e[o] = t;
  32391. }
  32392. }),
  32393. (n.prototype.setZoomingActive = function (e) {
  32394. e !== this.zoomingActive && (this.zoomingActive = e);
  32395. }),
  32396. (t.exports = n);
  32397. }.call(this, '/js/tile/TilePrioritizer.js'));
  32398. },
  32399. {
  32400. '../enum/DownloadStatus': 24,
  32401. '../enum/GLCubeFaces': 25,
  32402. '../enum/ModelManagerEvents': 33,
  32403. '../enum/PanoSizeClass': 36,
  32404. '../enum/Vectors': 50,
  32405. '../enum/Viewmode': 51,
  32406. '../objects/Panorama': 148,
  32407. '../settings': 166,
  32408. '../util/browser': 182,
  32409. '../util/logger': 189,
  32410. '../util/math': 190,
  32411. './TileUtils': 174,
  32412. events: 202,
  32413. three: 217,
  32414. },
  32415. ],
  32416. 173: [
  32417. function (e, t, i) {
  32418. 'use strict';
  32419. function n(e, t) {
  32420. (this.levels = t), (this.tileSize = e), (this.root = null), (this.allNodes = []), a(this);
  32421. }
  32422. function r(e, t) {
  32423. (this.tree = e), (this.parent = t), (this.children = []), (this.id = ++u);
  32424. }
  32425. function o(e, t, i, r, a, s, l, h) {
  32426. if (e) {
  32427. l = l || n.TraversalType.PreOrder;
  32428. var u = r * c + i;
  32429. if (
  32430. (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r), s && s.push(e)),
  32431. e.children && 0 !== e.children.length)
  32432. ) {
  32433. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  32434. for (var g = 0; g < c; g++)
  32435. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  32436. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r), s && s.push(e));
  32437. }
  32438. }
  32439. }
  32440. function a(e) {
  32441. e.root = s(e, null, 0);
  32442. }
  32443. function s(e, t, i) {
  32444. if (i > e.levels) return null;
  32445. var n = new r(e, t);
  32446. e.allNodes.push(n);
  32447. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1);
  32448. return n;
  32449. }
  32450. function l(e, t, i, n, r) {
  32451. if (!e) return null;
  32452. if (0 === i) return e;
  32453. if (!e.children || 0 === e.children.length) return null;
  32454. var o = Math.pow(c, i),
  32455. a = o / c,
  32456. s = n % a,
  32457. h = r % a,
  32458. u = Math.floor(r / a),
  32459. d = Math.floor(n / a),
  32460. p = u * c + d,
  32461. f = e.children[p];
  32462. return l(f, t + 1, i - 1, s, h);
  32463. }
  32464. var c =
  32465. (e('three'),
  32466. e('./TileUtils'),
  32467. e('../objects/Panorama'),
  32468. e('../util/panorama'),
  32469. e('events').EventEmitter,
  32470. 2),
  32471. h = c * c;
  32472. n.TraversalType = Object.freeze({
  32473. PreOrder: 0,
  32474. PostOrder: 1,
  32475. });
  32476. var u = 0;
  32477. (n.getLevelCountForSize = function (e, t) {
  32478. var i = 0;
  32479. for (t < e && (t = e); ; ) {
  32480. if (((t /= c), t < e)) break;
  32481. i++;
  32482. }
  32483. return i;
  32484. }),
  32485. (n.getSizeForLevel = function (e, t) {
  32486. return Math.pow(c, t) * e;
  32487. }),
  32488. (n.prototype.getSubNode = function (e, t, i) {
  32489. (!t || e < this.tileSize) && (t = 0),
  32490. (!i || e < this.tileSize) && (i = 0),
  32491. e < this.tileSize && (e = this.tileSize);
  32492. var r = n.getLevelCountForSize(this.tileSize, e),
  32493. o = l(this.root, 0, r, t, i);
  32494. return o;
  32495. }),
  32496. (n.prototype.breadthFirst = function (e) {
  32497. e = e || {};
  32498. var t = !!e.nullLevelEnd,
  32499. i = e.maxLevel,
  32500. n = e.minLevel,
  32501. r = e.callback,
  32502. o = e.saveVisited,
  32503. a = [],
  32504. s = {},
  32505. l = 0,
  32506. c = 0;
  32507. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i); ) {
  32508. var h = a.shift();
  32509. if (h === s)
  32510. (!n || l >= n) && (r && t && r(null), o && t && o.push(null)),
  32511. a.length > 0 && a.push(s),
  32512. l++,
  32513. (c = 0);
  32514. else {
  32515. if (h.children)
  32516. for (var u = 0; u < h.children.length; u++) {
  32517. var d = h.children[u];
  32518. d && a.push(h.children[u]);
  32519. }
  32520. var p = this.getFaceIndexFromNode(h);
  32521. (!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++;
  32522. }
  32523. }
  32524. }),
  32525. (n.prototype.getFaceIndexFromNode = function (e) {
  32526. if (!e) return -1;
  32527. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  32528. var o = i.parent;
  32529. if (!o) break;
  32530. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s);
  32531. var l = a % c,
  32532. h = Math.floor(a / c);
  32533. (n = l * t + n), (r = h * t + r), (t *= c), (i = o);
  32534. }
  32535. return r * t + n;
  32536. }),
  32537. (n.prototype.depthFirst = function (e, t, i) {
  32538. o(this.root, 0, 0, 0, e, t, i, this.tileSize);
  32539. }),
  32540. (t.exports = n);
  32541. },
  32542. {
  32543. '../objects/Panorama': 148,
  32544. '../util/panorama': 191,
  32545. './TileUtils': 174,
  32546. events: 202,
  32547. three: 217,
  32548. },
  32549. ],
  32550. 174: [
  32551. function (e, t, i) {
  32552. 'use strict';
  32553. var n = e('../enum/GLCubeFaces'),
  32554. r = e('../util/MathLight'),
  32555. o = {};
  32556. (o.TILE_SIZE = 512),
  32557. (o.FACES_PER_PANO = 6),
  32558. (o.LocationOnTile = {
  32559. Center: 0,
  32560. UpperLeft: 1,
  32561. UpperRight: 2,
  32562. LowerRight: 3,
  32563. LowerLeft: 4,
  32564. }),
  32565. (o.getTileVector = (function () {
  32566. return function (e, t, i, a, s, l, c, h) {
  32567. l = l || o.LocationOnTile.Center;
  32568. var u = e / t,
  32569. d = a / u;
  32570. s = -s + (u - 1);
  32571. var p = s / u,
  32572. f = t / e,
  32573. g = 2 * f,
  32574. m = g / 2,
  32575. v = 2 * d - 1 + m,
  32576. A = 2 * p - 1 + m;
  32577. switch (l) {
  32578. case o.LocationOnTile.UpperLeft:
  32579. (v -= m), (A += m), (v += c * g);
  32580. break;
  32581. case o.LocationOnTile.UpperRight:
  32582. (v += m), (A += m), (A -= c * g);
  32583. break;
  32584. case o.LocationOnTile.LowerRight:
  32585. (v += m), (A -= m), (v -= c * g);
  32586. break;
  32587. case o.LocationOnTile.LowerLeft:
  32588. (v -= m), (A -= m), (A += c * g);
  32589. break;
  32590. case o.LocationOnTile.Center:
  32591. }
  32592. switch (i) {
  32593. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  32594. r.setVector(h, -1, A, -v);
  32595. break;
  32596. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  32597. r.setVector(h, 1, A, v);
  32598. break;
  32599. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  32600. r.setVector(h, -v, 1, -A);
  32601. break;
  32602. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  32603. r.setVector(h, -v, -1, A);
  32604. break;
  32605. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  32606. r.setVector(h, -v, A, 1);
  32607. break;
  32608. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  32609. r.setVector(h, v, A, -1);
  32610. }
  32611. r.normalize(h);
  32612. };
  32613. })()),
  32614. (o.getFaceForTile = function (e, t) {
  32615. var i = o.TILE_SIZE;
  32616. e < o.TILE_SIZE && (i = e);
  32617. var n = Math.floor(e / i),
  32618. r = n * n;
  32619. return Math.floor(t / r);
  32620. }),
  32621. (o.getTileLocation = function (e, t, i) {
  32622. var n = o.TILE_SIZE;
  32623. e < o.TILE_SIZE && (n = e);
  32624. var r = o.getFaceForTile(e, t),
  32625. a = Math.floor(e / n),
  32626. s = a * a,
  32627. l = t - r * s;
  32628. (i.tileX = l % a), (i.tileY = Math.floor(l / a)), (i.face = r), (i.faceTileIndex = l);
  32629. }),
  32630. (o.getTileCountForSize = function (e) {
  32631. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO;
  32632. var t = Math.floor(e / o.TILE_SIZE),
  32633. i = t * t,
  32634. n = i * o.FACES_PER_PANO;
  32635. return n;
  32636. }),
  32637. (o.getRelativeDirection = (function () {
  32638. var e = new r.Matrix4(),
  32639. t = new r.Quaternion();
  32640. return function (i, n) {
  32641. t.copy(i),
  32642. t.inverse(),
  32643. e.makeRotationFromQuaternion(t),
  32644. e.applyToVector3(n),
  32645. r.normalize(n);
  32646. };
  32647. })()),
  32648. (o.matchingTilesInDirection = (function () {
  32649. var e = new r.Vector3(),
  32650. t = new r.Vector3(0, 0, -1),
  32651. i = new r.Quaternion(),
  32652. n = function (e, t) {
  32653. e.push({
  32654. face: t.face,
  32655. faceTileIndex: t.faceTileIndex,
  32656. tileX: t.tileX,
  32657. tileY: t.tileY,
  32658. });
  32659. },
  32660. a = (function () {
  32661. var e = {
  32662. face: -1,
  32663. faceTileIndex: -1,
  32664. tileX: -1,
  32665. tileY: -1,
  32666. };
  32667. return function (t, i, r) {
  32668. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  32669. o.getTileLocation(t, l, e), (i && !i(e)) || (s++, r && n(r, e));
  32670. return s;
  32671. };
  32672. })();
  32673. return function (n, s, l, c, h, u) {
  32674. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  32675. o.getTileCountForSize(s);
  32676. if (!c && !h) return a(s, null, u);
  32677. var p = !!h;
  32678. if (
  32679. ((h = h || c),
  32680. (h = Math.max(0, Math.min(h, 360))),
  32681. (c = Math.max(0, Math.min(c, 360))),
  32682. r.copyVector(l, e),
  32683. o.getRelativeDirection(n.quaternion, e),
  32684. p)
  32685. ) {
  32686. i.setFromUnitVectors(e, t);
  32687. var f = function (e) {
  32688. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h);
  32689. };
  32690. return a(s, f, u);
  32691. }
  32692. var g = function (t) {
  32693. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c);
  32694. };
  32695. return a(s, g, u);
  32696. };
  32697. })()),
  32698. (o.isTileWithinFrustum = (function () {
  32699. var e = new r.Vector3(),
  32700. t = 1e-5;
  32701. return function (i, n, a, s, l, c, h, u) {
  32702. for (
  32703. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  32704. p = -d,
  32705. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  32706. g = -f,
  32707. m = o.mapFaceToCubemapFace(a),
  32708. v = 0,
  32709. A = 0,
  32710. y = 0,
  32711. C = 0,
  32712. I = 0,
  32713. E = 0,
  32714. b = o.LocationOnTile.Center;
  32715. b <= o.LocationOnTile.LowerLeft;
  32716. b++
  32717. )
  32718. if (
  32719. (o.getTileVector(i, n, m, s, l, b, 0, e),
  32720. r.applyQuaternionToVector(c, e),
  32721. e.z >= -t)
  32722. )
  32723. I++;
  32724. else {
  32725. var w = -1 / e.z,
  32726. _ = e.x * w,
  32727. T = e.y * w;
  32728. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++;
  32729. }
  32730. return A !== E && v !== E && y !== E && C !== E;
  32731. };
  32732. })()),
  32733. (o.isTileWithinFOV = (function () {
  32734. var e = new r.Vector3(),
  32735. t = new r.Vector3(0, 1, 0),
  32736. i = new r.Vector3(1, 0, 0);
  32737. return function (n, a, s, l, c, h, u) {
  32738. var d = o.mapFaceToCubemapFace(s);
  32739. if (
  32740. (r.cross(h, t, i),
  32741. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  32742. o.isWithinFOV(e, h, u, null))
  32743. )
  32744. return !0;
  32745. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  32746. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  32747. if ((o.getTileVector(n, a, d, l, c, v, g, e), o.isWithinFOV(e, h, u, null)))
  32748. return !0;
  32749. g += p;
  32750. }
  32751. return !1;
  32752. };
  32753. })()),
  32754. (o.isWithinFOV = (function () {
  32755. var e = new r.Vector3(),
  32756. t = new r.Vector3();
  32757. return function (i, n, o, a) {
  32758. if ((r.copyVector(i, t), a)) {
  32759. r.copyVector(a, e), r.normalize(e);
  32760. var s = r.dot(e, i);
  32761. (e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e);
  32762. }
  32763. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  32764. c = Math.cos(l),
  32765. h = r.dot(t, n);
  32766. return h >= c;
  32767. };
  32768. })()),
  32769. (o.mapFaceToCubemapFace = (function () {
  32770. var e = {
  32771. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  32772. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  32773. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  32774. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  32775. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  32776. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  32777. };
  32778. return function (t) {
  32779. return e[t];
  32780. };
  32781. })()),
  32782. (t.exports = o);
  32783. },
  32784. {
  32785. '../enum/GLCubeFaces': 25,
  32786. '../util/MathLight': 176,
  32787. },
  32788. ],
  32789. 175: [
  32790. function (e, t, i) {
  32791. (function (i) {
  32792. 'use strict';
  32793. function n() {
  32794. (this.list = []),
  32795. (this.index = {}),
  32796. Object.defineProperty(this, 'length', {
  32797. get: function () {
  32798. return this.list.length;
  32799. },
  32800. });
  32801. }
  32802. var r = (e('./common'), e('./logger'));
  32803. new r(i);
  32804. (n.prototype.forEach = function (e) {
  32805. this.list.forEach(e);
  32806. }),
  32807. (n.prototype.add = function (e) {
  32808. this.list.push(e), (this.index[this.getIndex(e)] = e);
  32809. }),
  32810. (n.prototype.getIndex = function (e) {
  32811. throw new Error('IndexedCollection.getIndex not implemented in subclass.');
  32812. }),
  32813. (n.prototype.extend = function (e) {
  32814. for (var t = 0; t < e.length; t++) this.add(e[t]);
  32815. }),
  32816. (n.prototype.get = function (e) {
  32817. return this.index[e];
  32818. }),
  32819. (n.prototype.first = function () {
  32820. return this.list[0];
  32821. }),
  32822. (n.prototype.last = function () {
  32823. return this.list[this.list.length - 1];
  32824. }),
  32825. (n.prototype.reIndex = function () {
  32826. this.index = {};
  32827. var e = this;
  32828. this.forEach(function (t) {
  32829. e.index[e.getIndex(t)] = t;
  32830. });
  32831. }),
  32832. (n.prototype.filter = function (e) {
  32833. var t = this.list.filter(e);
  32834. return this.reIndex(), t;
  32835. }),
  32836. (n.prototype.reduce = function (e, t) {
  32837. return this.list.reduce(e, t);
  32838. }),
  32839. (n.prototype.sort = function (e) {
  32840. return this.list.sort(e);
  32841. }),
  32842. (n.prototype.indexOf = function (e) {
  32843. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t;
  32844. return -1;
  32845. }),
  32846. (t.exports = n);
  32847. }.call(this, '/js/util/IndexedCollection.js'));
  32848. },
  32849. {
  32850. './common': 185,
  32851. './logger': 189,
  32852. },
  32853. ],
  32854. 176: [
  32855. function (e, t, i) {
  32856. 'use strict';
  32857. var n = e('../constants'),
  32858. r = {};
  32859. (r.RADIANS_PER_DEGREE = Math.PI / 180),
  32860. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  32861. (r.Vector3 = function (e, t, i) {
  32862. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  32863. }),
  32864. (r.Matrix4 = function () {
  32865. (this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  32866. arguments.length > 0 &&
  32867. console.error(
  32868. 'MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  32869. );
  32870. }),
  32871. (r.Matrix4.prototype = {
  32872. identity: function () {
  32873. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
  32874. },
  32875. copy: function (e) {
  32876. return this.elements.set(e.elements), this;
  32877. },
  32878. applyToVector3: function (e) {
  32879. var t = e.x,
  32880. i = e.y,
  32881. n = e.z,
  32882. r = this.elements;
  32883. return (
  32884. (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  32885. (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  32886. (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  32887. this
  32888. );
  32889. },
  32890. getInverse: function (e, t) {
  32891. var i = this.elements,
  32892. n = e.elements,
  32893. r = n[0],
  32894. o = n[1],
  32895. a = n[2],
  32896. s = n[3],
  32897. l = n[4],
  32898. c = n[5],
  32899. h = n[6],
  32900. u = n[7],
  32901. d = n[8],
  32902. p = n[9],
  32903. f = n[10],
  32904. g = n[11],
  32905. m = n[12],
  32906. v = n[13],
  32907. A = n[14],
  32908. y = n[15],
  32909. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  32910. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  32911. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  32912. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  32913. w = r * C + o * I + a * E + s * b;
  32914. if (0 === w) {
  32915. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  32916. if (t) throw new Error(_);
  32917. return console.warn(_), this.identity();
  32918. }
  32919. var T = 1 / w;
  32920. return (
  32921. (i[0] = C * T),
  32922. (i[1] =
  32923. (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T),
  32924. (i[2] =
  32925. (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T),
  32926. (i[3] =
  32927. (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  32928. (i[4] = I * T),
  32929. (i[5] =
  32930. (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T),
  32931. (i[6] =
  32932. (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T),
  32933. (i[7] =
  32934. (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  32935. (i[8] = E * T),
  32936. (i[9] =
  32937. (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T),
  32938. (i[10] =
  32939. (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T),
  32940. (i[11] =
  32941. (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  32942. (i[12] = b * T),
  32943. (i[13] =
  32944. (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T),
  32945. (i[14] =
  32946. (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T),
  32947. (i[15] =
  32948. (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  32949. this
  32950. );
  32951. },
  32952. makeRotationFromQuaternion: function (e) {
  32953. var t = this.elements,
  32954. i = e.x,
  32955. n = e.y,
  32956. r = e.z,
  32957. o = e.w,
  32958. a = i + i,
  32959. s = n + n,
  32960. l = r + r,
  32961. c = i * a,
  32962. h = i * s,
  32963. u = i * l,
  32964. d = n * s,
  32965. p = n * l,
  32966. f = r * l,
  32967. g = o * a,
  32968. m = o * s,
  32969. v = o * l;
  32970. return (
  32971. (t[0] = 1 - (d + f)),
  32972. (t[4] = h - v),
  32973. (t[8] = u + m),
  32974. (t[1] = h + v),
  32975. (t[5] = 1 - (c + f)),
  32976. (t[9] = p - g),
  32977. (t[2] = u - m),
  32978. (t[6] = p + g),
  32979. (t[10] = 1 - (c + d)),
  32980. (t[3] = 0),
  32981. (t[7] = 0),
  32982. (t[11] = 0),
  32983. (t[12] = 0),
  32984. (t[13] = 0),
  32985. (t[14] = 0),
  32986. (t[15] = 1),
  32987. this
  32988. );
  32989. },
  32990. }),
  32991. (r.Quaternion = function (e, t, i, n) {
  32992. (this._x = e || 0),
  32993. (this._y = t || 0),
  32994. (this._z = i || 0),
  32995. (this._w = void 0 !== n ? n : 1);
  32996. }),
  32997. (r.Quaternion.prototype = {
  32998. get x() {
  32999. return this._x;
  33000. },
  33001. set x(e) {
  33002. this._x = e;
  33003. },
  33004. get y() {
  33005. return this._y;
  33006. },
  33007. set y(e) {
  33008. this._y = e;
  33009. },
  33010. get z() {
  33011. return this._z;
  33012. },
  33013. set z(e) {
  33014. this._z = e;
  33015. },
  33016. get w() {
  33017. return this._w;
  33018. },
  33019. set w(e) {
  33020. this._w = e;
  33021. },
  33022. copy: function (e) {
  33023. (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w);
  33024. },
  33025. inverse: function () {
  33026. return this.conjugate().normalize();
  33027. },
  33028. conjugate: function () {
  33029. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this;
  33030. },
  33031. length: function () {
  33032. return Math.sqrt(
  33033. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  33034. );
  33035. },
  33036. normalize: function () {
  33037. var e = this.length();
  33038. return (
  33039. 0 === e
  33040. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  33041. : ((e = 1 / e),
  33042. (this._x = this._x * e),
  33043. (this._y = this._y * e),
  33044. (this._z = this._z * e),
  33045. (this._w = this._w * e)),
  33046. this
  33047. );
  33048. },
  33049. setFromAxisAngle: function (e, t) {
  33050. var i = t / 2,
  33051. n = Math.sin(i);
  33052. return (
  33053. (this._x = e.x * n),
  33054. (this._y = e.y * n),
  33055. (this._z = e.z * n),
  33056. (this._w = Math.cos(i)),
  33057. this
  33058. );
  33059. },
  33060. setFromUnitVectors: (function () {
  33061. var e,
  33062. t,
  33063. i = 1e-6;
  33064. return function (n, o) {
  33065. return (
  33066. void 0 === e && (e = new r.Vector3()),
  33067. (t = r.dot(n, o) + 1),
  33068. t < i
  33069. ? ((t = 0),
  33070. Math.abs(n.x) > Math.abs(n.z)
  33071. ? r.setVector(e, -n.y, n.x, 0)
  33072. : r.setVector(e, 0, -n.z, n.y))
  33073. : r.cross(n, o, e),
  33074. (this._x = e.x),
  33075. (this._y = e.y),
  33076. (this._z = e.z),
  33077. (this._w = t),
  33078. this.normalize()
  33079. );
  33080. };
  33081. })(),
  33082. multiply: function (e) {
  33083. return this.multiplyQuaternions(this, e);
  33084. },
  33085. premultiply: function (e) {
  33086. return this.multiplyQuaternions(e, this);
  33087. },
  33088. multiplyQuaternions: function (e, t) {
  33089. var i = e._x,
  33090. n = e._y,
  33091. r = e._z,
  33092. o = e._w,
  33093. a = t._x,
  33094. s = t._y,
  33095. l = t._z,
  33096. c = t._w;
  33097. return (
  33098. (this._x = i * c + o * a + n * l - r * s),
  33099. (this._y = n * c + o * s + r * a - i * l),
  33100. (this._z = r * c + o * l + i * s - n * a),
  33101. (this._w = o * c - i * a - n * s - r * l),
  33102. this
  33103. );
  33104. },
  33105. }),
  33106. (r.convertWorkshopVector = function (e) {
  33107. return new r.Vector3(-e.x, e.y, e.z);
  33108. }),
  33109. (r.convertWorkshopQuaternion = function (e) {
  33110. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  33111. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  33112. );
  33113. });
  33114. (r.convertWorkshopOrthoZoom = function (e) {
  33115. //xzw
  33116. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  33117. return e === -1
  33118. ? -1
  33119. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  33120. g_snapShotHeight;
  33121. }),
  33122. (r.convertWorkshopPanoramaQuaternion = function (e) {
  33123. return new r.Quaternion(e.x, -e.y, -e.z, e.w)
  33124. .normalize()
  33125. .multiply(
  33126. new r.Quaternion().setFromAxisAngle(
  33127. new r.Vector3(0, 1, 0),
  33128. 270 * r.RADIANS_PER_DEGREE
  33129. )
  33130. );
  33131. }),
  33132. (r.normalize = function (e) {
  33133. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  33134. i = Math.sqrt(t);
  33135. (e.x /= i), (e.y /= i), (e.z /= i);
  33136. }),
  33137. (r.dot = function (e, t) {
  33138. return e.x * t.x + e.y * t.y + e.z * t.z;
  33139. }),
  33140. (r.cross = function (e, t, i) {
  33141. var n = e.x,
  33142. r = e.y,
  33143. o = e.z;
  33144. (i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x);
  33145. }),
  33146. (r.setVector = function (e, t, i, n) {
  33147. (e.x = t), (e.y = i), (e.z = n);
  33148. }),
  33149. (r.copyVector = function (e, t) {
  33150. (t.x = e.x), (t.y = e.y), (t.z = e.z);
  33151. }),
  33152. (r.addVector = function (e, t) {
  33153. (e.x += t.x), (e.y += t.y), (e.z += t.z);
  33154. }),
  33155. (r.subVector = function (e, t) {
  33156. (e.x -= t.x), (e.y -= t.y), (e.z -= t.z);
  33157. }),
  33158. (r.applyQuaternionToVector = function (e, t) {
  33159. var i = t.x,
  33160. n = t.y,
  33161. r = t.z,
  33162. o = e.x,
  33163. a = e.y,
  33164. s = e.z,
  33165. l = e.w,
  33166. c = l * i + a * r - s * n,
  33167. h = l * n + s * i - o * r,
  33168. u = l * r + o * n - a * i,
  33169. d = -o * i - a * n - s * r;
  33170. (t.x = c * l + d * -o + h * -s - u * -a),
  33171. (t.y = h * l + d * -a + u * -o - c * -s),
  33172. (t.z = u * l + d * -s + c * -a - h * -o);
  33173. }),
  33174. (r.angleBetweenVectors = function (e, t) {
  33175. return Math.acos(r.dot(e, t));
  33176. }),
  33177. (t.exports = r);
  33178. },
  33179. {
  33180. '../constants': 8,
  33181. },
  33182. ],
  33183. 177: [
  33184. function (e, t, i) {
  33185. (function (i) {
  33186. 'use strict';
  33187. function n(e) {
  33188. (this.cache = null), (this.expires = 0);
  33189. }
  33190. function r() {
  33191. (this.baseUrl = null), (this.cache = null), (this.expires = 0);
  33192. }
  33193. function o() {
  33194. (this.baseUrl = null), (this.expires = 0);
  33195. }
  33196. function a(e) {
  33197. (this.initialLoadingPromise = null),
  33198. (this.endpoint = e + '?type=3'),
  33199. (this.urlContainer = null),
  33200. (this.authorizationHeader = h.getAuthorizationHeader()),
  33201. (this.containerClasses = [o, r, n]);
  33202. }
  33203. var s = e('./ajax'),
  33204. l = e('./logger'),
  33205. c = e('../constants'),
  33206. h = e('./showcase'),
  33207. u = (e('../ab'), new l(i));
  33208. (n.prototype = {
  33209. version: 1,
  33210. validate: function (e) {
  33211. return 'catalog.json' in e && Object.keys(e).length > 0;
  33212. },
  33213. update: function (e) {
  33214. return (
  33215. (this.cache = e),
  33216. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33217. $.when()
  33218. );
  33219. },
  33220. get: function (e) {
  33221. return this.cache[e];
  33222. },
  33223. }),
  33224. (r.prototype = {
  33225. version: 2,
  33226. validate: function (e) {
  33227. return 'catalog.json' in e && 'base.url' in e && Object.keys(e).length > 1;
  33228. },
  33229. update: function (e) {
  33230. return (
  33231. (this.baseUrl = e['base.url']),
  33232. (this.cache = e),
  33233. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33234. $.when()
  33235. );
  33236. },
  33237. get: function (e) {
  33238. var t = this.cache[e];
  33239. return t ? this.baseUrl.replace('{{filename}}', e) + t : null;
  33240. },
  33241. }),
  33242. (o.prototype = {
  33243. version: 3,
  33244. validate: function (e) {
  33245. return (
  33246. e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  33247. );
  33248. },
  33249. update: function (e) {
  33250. return (
  33251. (this.baseUrl = e.templates[0]),
  33252. e.expires
  33253. ? (this.expires = 1e3 * e.expires)
  33254. : (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33255. $.when()
  33256. );
  33257. },
  33258. get: function (e) {
  33259. return this.baseUrl.replace('{{filename}}', e);
  33260. },
  33261. }),
  33262. (a.prototype = {
  33263. init: function () {
  33264. return this.initialLoadingPromise
  33265. ? this.initialLoadingPromise
  33266. : (setInterval(
  33267. function () {
  33268. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  33269. Date.now() + c.signedUrlRefreshBuffer > e &&
  33270. (u.debug('Refreshing urls...'),
  33271. this.refresh()
  33272. .done(function () {
  33273. u.debug('Refreshed');
  33274. })
  33275. .fail(function () {
  33276. u.error('Failed url refresh, urls might go stale soon');
  33277. }));
  33278. }.bind(this),
  33279. c.signedUrlCheckInterval
  33280. ),
  33281. (this.initialLoadingPromise = this.refresh()),
  33282. this.initialLoadingPromise);
  33283. },
  33284. refresh: function (e) {
  33285. //已经在someData.js里加载过了 不用再加载file了吧
  33286. e = e || {};
  33287. /*var t = void 0 === e.cache || e.cache;
  33288. return s.get( this.endpoint , { //file
  33289. responseType: "json",
  33290. prefetchFrom: t ? "files" : null,
  33291. cache: t,
  33292. auth: this.authorizationHeader
  33293. }).then(function(e) {
  33294. if (this.urlContainer && this.urlContainer.validate(e))
  33295. return this.urlContainer.update(e);
  33296. for (var i = 0; i < this.containerClasses.length; i++) {
  33297. var n = this.containerClasses[i]
  33298. , r = new n;
  33299. if (r.validate(e))
  33300. return u.info("Using urls version " + r.version),
  33301. this.urlContainer = r,
  33302. this.urlContainer.update(e)
  33303. }
  33304. return t ? this.refresh({
  33305. cache: !1
  33306. }) : $.Deferred().reject("missing-urls")
  33307. }
  33308. .bind(this), function(e) {
  33309. return "loading-failed"
  33310. }) */
  33311. return $.Deferred().resolve();
  33312. },
  33313. get: function (e) {
  33314. //return this.urlContainer.get(e)
  33315. return window.DATA.files.templates[0].replace('{{filename}}', e);
  33316. },
  33317. }),
  33318. (t.exports = a);
  33319. }.call(this, '/js/util/ModelUrls.js'));
  33320. },
  33321. {
  33322. '../ab': 3,
  33323. '../constants': 8,
  33324. './ajax': 181,
  33325. './logger': 189,
  33326. './showcase': 193,
  33327. },
  33328. ],
  33329. 178: [
  33330. function (e, t, i) {
  33331. (function (i) {
  33332. 'use strict';
  33333. function n() {
  33334. u.call(this), (this.neighbourMap = {}), (this.map = null);
  33335. }
  33336. var r = e('three'),
  33337. o = e('./common'),
  33338. a = e('../settings'),
  33339. s = e('../objects/Panorama'),
  33340. a = e('../settings'),
  33341. l = e('./aStar'),
  33342. c = e('./logger'),
  33343. h = new c(i),
  33344. u = e('./IndexedCollection'),
  33345. d = e('./transitions');
  33346. o.inherit(n, u),
  33347. (n.prototype.getIndex = function (e) {
  33348. return e.id;
  33349. }),
  33350. (n.prototype.find = function (e, t) {
  33351. var i = o.filterAll(this.list, e);
  33352. return 0 === i.length
  33353. ? null
  33354. : (t &&
  33355. t.forEach(function (e) {
  33356. i = o.stableSort(i, e);
  33357. }),
  33358. i[0]);
  33359. }),
  33360. /* n.prototype.sortByScore = function(e, t) {
  33361. var i = o.filterAll(this.list, e);
  33362. return 0 === i.length ? null : i = i.map(function(e) {
  33363. return {
  33364. pano: e,
  33365. score: t.reduce(function(t, i) {
  33366. return t + i(e)
  33367. }, 0)
  33368. }
  33369. }).sort(function(e, t) {
  33370. return t.score - e.score;
  33371. })
  33372. } */
  33373. (n.prototype.sortByScore = function (request, rank) {
  33374. return common.sortByScore(this.list, request, rank);
  33375. }),
  33376. (n.prototype.lowestByScore = function (e, t, i) {
  33377. return this.findRankedByScore(0, e, t, i);
  33378. }),
  33379. (n.prototype.findRankedByScore = function (e, t, i, n) {
  33380. n && ((n.candidates = null), (n.pano = null)), e || (e = 0);
  33381. var r = this.sortByScore(t, i);
  33382. return !r || 0 === r.length || e >= r.length
  33383. ? null
  33384. : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item);
  33385. }),
  33386. (n.prototype.showPanoScores = function (e) {
  33387. this.list.forEach(function (e) {
  33388. e.removeTextSprite();
  33389. });
  33390. var t = 6344768;
  33391. e.forEach(function (e) {
  33392. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055);
  33393. });
  33394. }),
  33395. (n.prototype.isNeighbour = function (e, t) {
  33396. return this.neighbourMap[e.id][t.id];
  33397. }),
  33398. (n.prototype.getNeighbours = function (e) {
  33399. return this.neighbourMap[e.id];
  33400. }),
  33401. (n.prototype.setNeighbour = function (e, t, i) {
  33402. return (
  33403. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  33404. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  33405. (this.neighbourMap[e.id][e.id] = !0),
  33406. (this.neighbourMap[t.id][t.id] = !0),
  33407. (this.neighbourMap[e.id][t.id] = i),
  33408. (this.neighbourMap[t.id][e.id] = i),
  33409. this.neighbourMap[e.id]
  33410. );
  33411. }),
  33412. (n.prototype.findClosest = function (e, t) {
  33413. var i = [s.filters.isPanoAligned()];
  33414. return (
  33415. t && i.push(s.filters.inDirection(e, t, 0.75)),
  33416. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  33417. );
  33418. }),
  33419. (n.prototype.dualNeighbors = function (e, t) {
  33420. var i,
  33421. n = [];
  33422. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i);
  33423. return n;
  33424. }),
  33425. (n.prototype.populate_path_graph = function () {
  33426. var e,
  33427. t,
  33428. i,
  33429. n,
  33430. o,
  33431. a,
  33432. s,
  33433. l,
  33434. c = Date.now(),
  33435. u = {},
  33436. d = 0,
  33437. p = new r.Vector3(0, 0, 0),
  33438. f = 0,
  33439. g = 0;
  33440. for (e = 0; e < this.list.length; e += 1) {
  33441. (o = this.list[e]),
  33442. (s = {}),
  33443. (l = !1),
  33444. (i = o.neighbourPanos || o.findNeighourPanos());
  33445. for (t in i)
  33446. if (i[t]) {
  33447. (a = this.index[t]), p.copy(o.floorPosition), p.sub(a.floorPosition);
  33448. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  33449. v = (Math.abs(p.y) / Math.max(m, 0.01), Math.max(0, Math.abs(p.y) - 0.2));
  33450. v > 0
  33451. ? ((f += 1),
  33452. (v = Math.pow(4 * v, 2)),
  33453. (m = Math.pow(m, 2)),
  33454. (n = Math.sqrt(v * v + m * m)))
  33455. : ((g += 1), (n = p.length())),
  33456. (s[a.id] = n),
  33457. (l = !0);
  33458. }
  33459. l ? (u[o.id] = s) : (d += 1);
  33460. }
  33461. (this.map = u),
  33462. h.info('graph ready in ' + (Date.now() - c) + 'ms, ' + d + ' had no neighbors');
  33463. }),
  33464. (n.prototype.aStarSearch = function (e, t) {
  33465. var i = Date.now(),
  33466. n = new l({
  33467. start: e,
  33468. isEnd: function (e) {
  33469. return e === t;
  33470. },
  33471. neighbor: function (e) {
  33472. var t = e.neighbourPanos || e.findNeighourPanos(),
  33473. i = [];
  33474. for (var n in t) t[n] && i.push(this.index[n]); //add: t[n] &&
  33475. return i;
  33476. }.bind(this),
  33477. distance: function (e, t) {
  33478. var i = this.map[e.id],
  33479. n = i[t.id];
  33480. return n;
  33481. }.bind(this),
  33482. heuristic: function (e, t) {
  33483. return 1;
  33484. }.bind(this),
  33485. hash: function (e) {
  33486. return e.id;
  33487. },
  33488. timeout: 5e3,
  33489. });
  33490. if ((h.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status))
  33491. return h.debug('Did not find A* path from ' + e + ' to ' + t), null;
  33492. h.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps');
  33493. var r = [];
  33494. return (
  33495. n.path.forEach(function (e) {
  33496. r.push(e.id);
  33497. }),
  33498. r
  33499. );
  33500. }),
  33501. (n.prototype.includeNodesNearPath = (function () {
  33502. var e = new r.Vector3(),
  33503. t = new r.Vector3(),
  33504. i = new r.Vector3(),
  33505. n = new r.Vector3(),
  33506. o = new r.Vector3(),
  33507. a = new r.Vector3(),
  33508. s = new r.Vector3(),
  33509. l = new r.Vector3(),
  33510. c = [],
  33511. h = new r.Vector3(),
  33512. u = new r.Vector3();
  33513. return function (r, d) {
  33514. if (r)
  33515. for (
  33516. var p = function (e, t, i) {
  33517. return o.copy(t).sub(e), o.dot(i);
  33518. },
  33519. f = function (e, t) {
  33520. return p(h, e.position, i) - p(h, t.position, i);
  33521. },
  33522. g = 0;
  33523. g < r.length - 1;
  33524. ) {
  33525. var m = r[g],
  33526. v = r[g + 1],
  33527. A = this.index[m],
  33528. y = this.index[v];
  33529. h.copy(A.position),
  33530. u.copy(y.position),
  33531. (c.length = 0),
  33532. e.copy(u).sub(h),
  33533. i.copy(e).normalize();
  33534. for (var C = 0; C < this.list.length; C++) {
  33535. var I = this.list[C];
  33536. o.copy(I.position).sub(h);
  33537. var E = o.dot(i);
  33538. if (E > 0) {
  33539. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s);
  33540. var b = a.length();
  33541. if (b < d) {
  33542. t.copy(e).negate(), n.copy(t).normalize(), l.copy(I.position).sub(u);
  33543. var w = l.dot(n);
  33544. w > 0 && c.push(I);
  33545. }
  33546. }
  33547. }
  33548. if (c.length > 0) {
  33549. c.sort(f);
  33550. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  33551. r[_] = r[_ - c.length];
  33552. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id;
  33553. }
  33554. g += c.length + 1;
  33555. }
  33556. };
  33557. })()),
  33558. /* n.prototype.fadeMarkerOpacity = function(e, t) {
  33559. var i = void 0 === e ? a.panorama.markerOpacity : e
  33560. , n = this.list.findIndex(function(e) {
  33561. return e.marker
  33562. });
  33563. if (!(n < 0)) {
  33564. var r = this.list[n].marker.material.opacity;
  33565. if (r !== e) {
  33566. var o = i - r;
  33567. d.trigger({
  33568. func: function(e, t) {
  33569. var i = r + e * o;
  33570. this.forEach(function(e) {
  33571. e.marker && (e.marker.material.opacity = i)
  33572. })
  33573. }
  33574. .bind(this),
  33575. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  33576. name: "_fpm"
  33577. })
  33578. }
  33579. }
  33580. } */
  33581. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  33582. d.cancelById('fadeMarkerOpacity');
  33583. var n = this.list.findIndex(function (e) {
  33584. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  33585. return e.marker;
  33586. });
  33587. if (n < 0) {
  33588. //logger.info('marker findIndex<0')
  33589. return;
  33590. }
  33591. var group;
  33592. var tran = function (list, index) {
  33593. list.member = list.member.filter(function (m) {
  33594. return m.marker && m.marker.material.opacity != list.toOp;
  33595. });
  33596. transitions.trigger({
  33597. func: function (e, t) {
  33598. //e:0-1
  33599. list.member.forEach(function (m) {
  33600. var o = m.marker.oldOpacity;
  33601. var i = o + e * (list.toOp - o);
  33602. m.marker && (m.marker.material.opacity = i);
  33603. });
  33604. }.bind(this),
  33605. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  33606. name: '_fpm_' + index,
  33607. id: 'fadeMarkerOpacity',
  33608. });
  33609. };
  33610. this.forEach(function (e) {
  33611. //先记录旧的opacity
  33612. e.marker && (e.marker.oldOpacity = e.marker.material.opacity);
  33613. });
  33614. group = gr;
  33615. /* if (e > 0 && gr) {
  33616. group = gr
  33617. } else {
  33618. group = [
  33619. {
  33620. member: this.list,
  33621. toOp: 0,
  33622. },
  33623. ]
  33624. } */
  33625. for (var i = 0; i < group.length; i++) {
  33626. tran(group[i], i);
  33627. }
  33628. }),
  33629. (t.exports = n);
  33630. }.call(this, '/js/util/PanoramaCollection.js'));
  33631. },
  33632. {
  33633. '../objects/Panorama': 148,
  33634. '../settings': 166,
  33635. './IndexedCollection': 175,
  33636. './aStar': 180,
  33637. './common': 185,
  33638. './logger': 189,
  33639. './transitions': 195,
  33640. three: 217,
  33641. },
  33642. ],
  33643. 179: [
  33644. function (e, t, i) {
  33645. 'use strict';
  33646. function n() {
  33647. (this.actionSequence = []), (this.actionSequenceInProgress = !1);
  33648. }
  33649. function r(e, t, i, n) {
  33650. s.trackAlways('zoom_' + e, {
  33651. from: t,
  33652. to: i,
  33653. pano: n,
  33654. });
  33655. }
  33656. function o(e, t) {
  33657. r('initial', 1, e, t);
  33658. }
  33659. function a(e, t, i) {
  33660. r('followup', e, t, i);
  33661. }
  33662. var s = e('../analytics');
  33663. (n.prototype.reset = function (e) {
  33664. (this.actionSequenceInProgress = !1), (this.actionSequence.length = 0);
  33665. }),
  33666. (n.prototype.addZoomAction = (function () {
  33667. var e = null,
  33668. t = null,
  33669. i = !1,
  33670. n = function () {
  33671. if (((e = null), this.actionSequence.length > 0)) {
  33672. var i = this.actionSequence[0].start,
  33673. n = this.actionSequence[this.actionSequence.length - 1].end;
  33674. 1 === i ? o(n, t) : a(i, n, t);
  33675. }
  33676. this.reset();
  33677. };
  33678. return function (r, o, a) {
  33679. if (r !== o) {
  33680. i || ((n = n.bind(this)), (i = !0)),
  33681. e && (window.clearTimeout(e), (e = null)),
  33682. (a === t && this.actionSequenceInProgress) || (this.reset(), (t = a)),
  33683. (this.actionSequenceInProgress = !0);
  33684. var s = {
  33685. start: r,
  33686. end: o,
  33687. };
  33688. this.actionSequence.push(s), (e = window.setTimeout(n, 150));
  33689. }
  33690. };
  33691. })()),
  33692. (t.exports = n);
  33693. },
  33694. {
  33695. '../analytics': 4,
  33696. },
  33697. ],
  33698. 180: [
  33699. function (e, t, i) {
  33700. 'use strict';
  33701. function n(e) {
  33702. void 0 === e.timeout && (e.timeout = 1 / 0);
  33703. var t = e.hash || o,
  33704. i = {
  33705. data: e.start,
  33706. g: 0,
  33707. h: e.heuristic(e.start),
  33708. },
  33709. n = i;
  33710. i.f = i.h;
  33711. var h = new s(),
  33712. u = new l(a),
  33713. d = c();
  33714. u.push(i), d.set(t(i.data), i);
  33715. for (var p = new Date(); u.size(); ) {
  33716. if (new Date() - p > e.timeout)
  33717. return {
  33718. status: 'timeout',
  33719. cost: n.g,
  33720. path: r(n),
  33721. };
  33722. var f = u.pop();
  33723. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  33724. return {
  33725. status: 'success',
  33726. cost: f.g,
  33727. path: r(f),
  33728. };
  33729. h.add(t(f.data));
  33730. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  33731. var v = g[m];
  33732. if (!h.contains(t(v))) {
  33733. var A = f.g + e.distance(f.data, v),
  33734. y = d.get(t(v)),
  33735. C = !1;
  33736. if (void 0 === y)
  33737. (y = {
  33738. data: v,
  33739. }),
  33740. d.set(t(v), y);
  33741. else {
  33742. if (y.g < A) continue;
  33743. C = !0;
  33744. }
  33745. (y.parent = f),
  33746. (y.g = A),
  33747. (y.h = e.heuristic(v)),
  33748. (y.f = A + y.h),
  33749. y.h < n.h && (n = y),
  33750. C ? u.heapify() : u.push(y);
  33751. }
  33752. }
  33753. }
  33754. return {
  33755. status: 'noPath',
  33756. cost: n.g,
  33757. path: r(n),
  33758. };
  33759. }
  33760. function r(e) {
  33761. if (void 0 !== e.parent) {
  33762. var t = r(e.parent);
  33763. return t.push(e.data), t;
  33764. }
  33765. return [e.data];
  33766. }
  33767. function o(e) {
  33768. return e.toString();
  33769. }
  33770. function a(e, t) {
  33771. return e.f - t.f;
  33772. }
  33773. var s = e('Set'),
  33774. l = e('heap'),
  33775. c = e('dict');
  33776. t.exports = n;
  33777. },
  33778. {
  33779. Set: 196,
  33780. dict: 210,
  33781. heap: 211,
  33782. },
  33783. ],
  33784. 181: [
  33785. function (e, t, i) {
  33786. (function (i) {
  33787. 'use strict';
  33788. function n(e, t, i) {
  33789. var n = new XMLHttpRequest();
  33790. if (i && 'withCredentials' in n) n.open(e, t, i);
  33791. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()), n.open(e, t);
  33792. else {
  33793. if (i) throw 'Browser does not support CORS!';
  33794. n.open(e, t);
  33795. }
  33796. return n;
  33797. }
  33798. function r(e, t, i) {
  33799. function o() {
  33800. u.warn('Retrying ', t),
  33801. r(e, t, i)
  33802. .done(c.resolve.bind(c))
  33803. .progress(c.notify.bind(c))
  33804. .fail(c.reject.bind(c));
  33805. }
  33806. function a(e, t) {
  33807. var i = e.response;
  33808. if ('json' === t && 'object' != typeof i)
  33809. try {
  33810. i = JSON.parse(e.responseText);
  33811. } catch (e) {
  33812. return void c.reject({
  33813. error: 'Failed parsing JSON',
  33814. });
  33815. }
  33816. else if ('image/jpeg' === t) {
  33817. var n = new Uint8Array(e.response),
  33818. r = new Blob([n], {
  33819. type: 'image/jpeg',
  33820. }),
  33821. o = URL.createObjectURL(r);
  33822. (i = new Image()),
  33823. (i.src = o),
  33824. (i.crossOrigin = 'Anonymous'),
  33825. (i.onload = function () {
  33826. URL.revokeObjectURL(o);
  33827. });
  33828. }
  33829. return i;
  33830. }
  33831. var s = n(e, t, !1);
  33832. if (
  33833. ((i = i || {}),
  33834. (i.retries = void 0 !== i.retries ? i.retries : 0),
  33835. (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()),
  33836. i.responseType)
  33837. )
  33838. if (['arraybuffer', 'text', 'json'].indexOf(i.responseType) > -1)
  33839. s.responseType = i.responseType;
  33840. else {
  33841. if ('image/jpeg' !== i.responseType)
  33842. throw new Error(
  33843. 'reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'
  33844. );
  33845. s.responseType = 'arraybuffer';
  33846. }
  33847. if (
  33848. ('json' === i.responseType && s.setRequestHeader('Accept', 'application/json'),
  33849. i.auth && s.setRequestHeader('Authorization', i.auth),
  33850. 'object' == typeof i.data &&
  33851. ((i.data = JSON.stringify(i.data)),
  33852. s.setRequestHeader('Content-Type', 'application/json')),
  33853. 'object' == typeof i.headers)
  33854. )
  33855. for (var l in i.headers) s.setRequestHeader(l, i.headers[l]);
  33856. var c = $.Deferred();
  33857. return (
  33858. (s.onreadystatechange = function (e) {
  33859. if (4 === this.readyState)
  33860. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  33861. i.retries++, setTimeout(o, 1e3);
  33862. else if (200 === this.status) {
  33863. var t = a(this, i.responseType);
  33864. c.resolve(t);
  33865. } else c.reject(this);
  33866. }),
  33867. (s.onprogress = function (e) {
  33868. c.notify(e);
  33869. }),
  33870. s.send(i.data),
  33871. c.promise()
  33872. );
  33873. }
  33874. function o(e) {
  33875. return Object.keys(e)
  33876. .sort()
  33877. .map(function (t) {
  33878. return {
  33879. key: t,
  33880. value: e[t],
  33881. };
  33882. });
  33883. }
  33884. function a(e, t) {
  33885. var i = t.responseType || null,
  33886. n = t.auth || null,
  33887. r = t.prefetchFrom || null,
  33888. a = e + '__' + i + '__' + n + '__' + r;
  33889. return (
  33890. t.headers &&
  33891. o(t.headers).forEach(function (e) {
  33892. a += '__' + e.key + ':' + e.value;
  33893. }),
  33894. a
  33895. );
  33896. }
  33897. function s(e, t) {
  33898. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null;
  33899. }
  33900. function l(e, t, i) {
  33901. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i);
  33902. }
  33903. var c = e('./logger'),
  33904. h = e('../ab'),
  33905. u = new c(i);
  33906. (window.URL = window.URL || window.webkitURL),
  33907. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  33908. (window.DATA = window.DATA || {}),
  33909. /* setTimeout(function() {//MP-- xzw delete
  33910. window.MP_REQUEST_CACHE = null,
  33911. window.DATA = {}
  33912. }, 6e4),
  33913. window.onpageshow = function(e) {
  33914. e.persisted && (window.MP_REQUEST_CACHE = null,
  33915. window.DATA = {})
  33916. } */
  33917. (t.exports = {
  33918. get: function (e, t) {
  33919. t = t || {};
  33920. var i = void 0 === t.cache || t.cache;
  33921. if (i) {
  33922. var n = s(e, t);
  33923. if (n) return n;
  33924. }
  33925. var o;
  33926. return (
  33927. (o =
  33928. t.prefetchFrom && window.DATA[t.prefetchFrom]
  33929. ? $.when(window.DATA[t.prefetchFrom])
  33930. : r('GET', e, t)),
  33931. i && l(e, t, o),
  33932. o
  33933. );
  33934. },
  33935. post: function (e, t) {
  33936. return r('POST', e, t);
  33937. },
  33938. patch: function (e, t) {
  33939. return r('PATCH', e, t);
  33940. },
  33941. getImage: function (e, t) {
  33942. function i() {
  33943. u.warn('Retrying ', e),
  33944. o
  33945. .getImage(e, t - 1)
  33946. .done(n.resolve.bind(n))
  33947. .progress(n.notify.bind(n))
  33948. .fail(n.reject.bind(n));
  33949. }
  33950. var n = $.Deferred(),
  33951. r = new Image(),
  33952. o = this;
  33953. return (
  33954. (e = h.changeIfImageOptimzing(e)),
  33955. (null !== t && void 0 !== t) || (t = 3),
  33956. (r.onerror = function () {
  33957. t > 0 ? setTimeout(i, 1e3) : n.reject();
  33958. }),
  33959. (r.onload = function () {
  33960. n.resolve(r);
  33961. }),
  33962. (r.crossOrigin = 'anonymous'),
  33963. (r.src = e),
  33964. n
  33965. );
  33966. },
  33967. });
  33968. }.call(this, '/js/util/ajax.js'));
  33969. },
  33970. {
  33971. '../ab': 3,
  33972. './logger': 189,
  33973. },
  33974. ],
  33975. 182: [
  33976. function (e, t, i) {
  33977. 'use strict';
  33978. function n(e, t) {
  33979. var i = window.navigator.userAgent,
  33980. n = i.match(e);
  33981. return (
  33982. (n = n ? n[1].split(t) : []),
  33983. {
  33984. major: parseInt(n[0]) || 0,
  33985. minor: parseInt(n[1]) || 0,
  33986. patch: parseInt(n[2]) || 0,
  33987. }
  33988. );
  33989. }
  33990. var r = e('../exception/DeviceMismatchException');
  33991. t.exports = {
  33992. supportsFullscreen: function () {
  33993. return (
  33994. document.fullscreenEnabled ||
  33995. document.mozFullscreenEnabled ||
  33996. document.mozFullScreenEnabled ||
  33997. document.webkitFullscreenEnabled ||
  33998. document.msFullscreenEnabled
  33999. );
  34000. },
  34001. isPointerLocked: function () {
  34002. return (
  34003. document.pointerLockElement ||
  34004. document.mozPointerLockElement ||
  34005. document.webkitPointerLockElement
  34006. );
  34007. },
  34008. requestFullscreen: function (e, t) {
  34009. e.requestFullscreen
  34010. ? e.requestFullscreen()
  34011. : e.mozRequestFullScreen
  34012. ? e.mozRequestFullScreen()
  34013. : e.webkitRequestFullscreen
  34014. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  34015. : e.msRequestFullscreen && e.msRequestFullscreen(),
  34016. t &&
  34017. $(document).on(
  34018. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34019. browser.requestPointerLock
  34020. );
  34021. },
  34022. requestPointerLock: function () {
  34023. var e;
  34024. if (document.fullscreenElement) e = document.fullscreenElement();
  34025. else if (document.mozFullscreenElement) e = document.mozFullscreenElement();
  34026. else if (document.mozFullScreenElement) e = document.mozFullScreenElement();
  34027. else {
  34028. if (!document.webkitFullscreenElement) return;
  34029. e = document.webkitFullscreenElement();
  34030. }
  34031. (e.requestPointerLock =
  34032. e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  34033. e.requestPointerLock(),
  34034. $(document).off(
  34035. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34036. this
  34037. );
  34038. },
  34039. exitPointerLock: function () {
  34040. (document.exitPointerLock =
  34041. document.exitPointerLock ||
  34042. document.mozExitPointerLock ||
  34043. document.webkitExitPointerLock),
  34044. document.exitPointerLock();
  34045. },
  34046. exitFullscreen: function () {
  34047. document.exitFullscreen
  34048. ? document.exitFullscreen()
  34049. : document.msExitFullscreen
  34050. ? document.msExitFullscreen()
  34051. : document.mozCancelFullScreen
  34052. ? document.mozCancelFullScreen()
  34053. : document.webkitExitFullscreen && document.webkitExitFullscreen();
  34054. },
  34055. details: function () {
  34056. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)');
  34057. return e
  34058. ? {
  34059. name: e[1],
  34060. version: parseInt(e[2]),
  34061. platform: navigator.platform,
  34062. }
  34063. : {};
  34064. },
  34065. is: function (e) {
  34066. return this.details() && this.details().name === e;
  34067. },
  34068. inIframe: function () {
  34069. return window.parent !== window;
  34070. },
  34071. aspectRatio: function () {
  34072. var e = $('#player').width() / $('#player').height();
  34073. return isFinite(e) ? e : 0;
  34074. },
  34075. userAgent: function () {
  34076. return window.navigator.userAgent;
  34077. },
  34078. isLandscape: function () {
  34079. return this.isMobile && this.aspectRatio() > 1;
  34080. },
  34081. isSmallScreen: function () {
  34082. var e = screen.width / window.devicePixelRatio;
  34083. return e < 240;
  34084. },
  34085. detectIE: function () {
  34086. var e = window.navigator.userAgent,
  34087. t = e.indexOf('MSIE ');
  34088. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
  34089. },
  34090. detectSafari: function () {
  34091. var e = window.navigator.userAgent,
  34092. t = e.indexOf('Safari');
  34093. return t !== -1 && !this.detectChrome();
  34094. },
  34095. detectFirefox: function () {
  34096. var e = window.navigator.userAgent;
  34097. return e.indexOf('Firefox') !== -1;
  34098. },
  34099. detectChrome: function () {
  34100. var e = window.navigator.userAgent;
  34101. return e.indexOf('Chrome') !== -1 && !this.detectOpera();
  34102. },
  34103. detectOpera: function () {
  34104. var e = window.navigator.userAgent;
  34105. return e.indexOf('OPR') !== -1;
  34106. },
  34107. detectIOS: function () {
  34108. return this.detectIPhone() || this.detectIPad() || this.detectIPod();
  34109. },
  34110. detectIPad: function () {
  34111. var e = window.navigator.userAgent,
  34112. t = /iPad/;
  34113. return t.test(e);
  34114. },
  34115. detectIPod: function () {
  34116. var e = window.navigator.userAgent,
  34117. t = /iPod/;
  34118. return t.test(e);
  34119. },
  34120. detectIPhone: function () {
  34121. var e = window.navigator.userAgent,
  34122. t = /iPhone/;
  34123. return t.test(e);
  34124. },
  34125. detectAndroid: function () {
  34126. var e = window.navigator.userAgent;
  34127. return e.indexOf('Android') !== -1;
  34128. },
  34129. detectAndroidMobile: function () {
  34130. var e = window.navigator.userAgent;
  34131. return this.detectAndroid() && e.indexOf('Mobile') !== -1;
  34132. },
  34133. detectSamsungNative: function () {
  34134. var e = window.navigator.userAgent;
  34135. return (
  34136. e.indexOf('SM-G900H') !== -1 ||
  34137. e.indexOf('GT-I9500') !== -1 ||
  34138. e.indexOf('SM-N900') !== -1
  34139. );
  34140. },
  34141. detectSamsungS6: function () {
  34142. var e = window.navigator.userAgent;
  34143. return e.indexOf('SM-G92') !== -1;
  34144. },
  34145. /************************************************************fyz改from徐世廷*************************************************************/
  34146. detectHUAWEI5X: function () {
  34147. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H');
  34148. },
  34149. /*******************************************************************************************************************************/
  34150. detectWebVR: function () {
  34151. return !(!window.navigator.getVRDisplays || !window.VRDisplay);
  34152. },
  34153. getVRDisplay: function () {
  34154. var e = $.Deferred();
  34155. return this.detectWebVR()
  34156. ? (navigator.getVRDisplays().then(function (t) {
  34157. t.length >= 1 && e.resolve(t[0]), e.reject(null);
  34158. }),
  34159. e)
  34160. : e.reject(null);
  34161. },
  34162. iosVersion: function () {
  34163. if (!this.detectIOS()) throw new r('Did not detect an iDevice');
  34164. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  34165. t = '_';
  34166. return n(e, t);
  34167. },
  34168. androidVersion: function () {
  34169. if (!this.detectAndroid()) throw new r('Did not detect an Android based device');
  34170. var e = /Android ((?:\d+\.?){1,3})/,
  34171. t = '.';
  34172. return n(e, t);
  34173. },
  34174. valueFromCookie: function (e, t) {
  34175. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie);
  34176. if (!i) return t;
  34177. var n = i[1];
  34178. return 'boolean' == typeof t
  34179. ? 'true' === n || '1' === n
  34180. : 'number' == typeof t
  34181. ? parseFloat(n)
  34182. : n;
  34183. },
  34184. valueFromHash: function (e, t) {
  34185. var i = new RegExp('[#&?]' + e + '=([^#&?]*)'),
  34186. n = i.exec(window.location.href);
  34187. if (!n) return t;
  34188. var r = n[1];
  34189. return 'boolean' == typeof t
  34190. ? 'true' === r || '1' === r
  34191. : 'number' == typeof t
  34192. ? parseFloat(r)
  34193. : window.decodeURIComponent(r);
  34194. },
  34195. };
  34196. Object.assign(window.browser, t.exports);
  34197. t.exports = window.browser;
  34198. },
  34199. {
  34200. '../exception/DeviceMismatchException': 56,
  34201. },
  34202. ],
  34203. 183: [
  34204. function (e, t, i) {
  34205. (function (i) {
  34206. 'use strict';
  34207. function n(e, t) {
  34208. var i = r(t);
  34209. var replaceAll = function (str, f, e) {
  34210. //f全部替换成e
  34211. var reg = new RegExp(f, 'g'); //创建正则RegExp对象
  34212. return str.replace(reg, e);
  34213. };
  34214. var urlFirstView = c.valueFromHash('firstView');
  34215. if (urlFirstView) {
  34216. try {
  34217. urlFirstView = replaceAll(urlFirstView, 'pano:', '"pano":"');
  34218. urlFirstView = replaceAll(urlFirstView, ',qua:', '","qua":[');
  34219. urlFirstView = '{' + urlFirstView + ']}';
  34220. let info = JSON.parse(urlFirstView);
  34221. i.pano = t.index[info.pano]; //panos.get(info.pano)
  34222. if (!i.pano) {
  34223. urlFirstView = false;
  34224. console.error('检测到firstView但是 找不到该pano');
  34225. } else {
  34226. i.quaternion = new THREE.Quaternion().fromArray(info.qua);
  34227. i.zoom = -1;
  34228. i.mode = 'panorama';
  34229. i.setByUrl = true;
  34230. }
  34231. } catch (e) {
  34232. urlFirstView = false;
  34233. console.error('检测到firstView但是解析出错' + e);
  34234. }
  34235. }
  34236. if (Object.keys(i).length > 0) return i;
  34237. if (e.heroImage) i = o(e, t);
  34238. else if (window.DATA.camera_start) {
  34239. var n = window.DATA.camera_start;
  34240. try {
  34241. Object.keys(n).length > 0 &&
  34242. !l.isEmptyQuaternion(n.camera.quaternion) &&
  34243. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  34244. (i.position = n.camera.position),
  34245. //i.quaternion = n.camera.quaternion,
  34246. (i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion)), //xzw
  34247. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  34248. n.pano &&
  34249. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  34250. d.debug('Using camera_start'),
  34251. d.debug('Modeldata pano: ', i.pano.quaternion),
  34252. d.debug('Camera start pano: ', n.pano.quaternion)),
  34253. i.mode !== h.PANORAMA &&
  34254. (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  34255. } catch (e) {
  34256. d.warn(e.message);
  34257. if (i.mode == 'panorama' && !i.pano) i.pano = t.list[0];
  34258. }
  34259. }
  34260. if (
  34261. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  34262. i.mode === h.MESH &&
  34263. i.position &&
  34264. ((i.mode = h.PANORAMA),
  34265. (i.pano = t.findClosest(i.position)),
  34266. (i.quaternion = i.pano.quaternion)),
  34267. 0 === Object.keys(i).length)
  34268. ) {
  34269. var a = t.list[0];
  34270. a &&
  34271. ((i.mode = h.PANORAMA),
  34272. (i.pano = a),
  34273. (i.position = a.position),
  34274. (i.quaternion = a.quaternion),
  34275. d.info('Starting at 1st pano ' + a.id));
  34276. }
  34277. return (i.mode = i.mode || h.DOLLHOUSE), i;
  34278. }
  34279. function r(e) {
  34280. var t = c.valueFromHash('start', ''),
  34281. i = {};
  34282. if ('' !== t) {
  34283. d.debug('Start override found in parameters, trying to parse...'), (i = a(t) || {});
  34284. var n = c.valueFromHash('tag', null);
  34285. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId));
  34286. }
  34287. return i;
  34288. }
  34289. function o(e, t) {
  34290. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {};
  34291. var i = {},
  34292. n = e.heroImage.metadata;
  34293. d.debug('Using start position from thumbnail image'),
  34294. (i.position = n.camera_position),
  34295. (i.quaternion = n.camera_quaternion);
  34296. try {
  34297. (i.mode = h.convertWorkshopModeInt(n.camera_mode)),
  34298. i.mode === h.PANORAMA
  34299. ? (i.pano = t.get(n.scan_id))
  34300. : (i.floorVisibility = n.floor_visibility);
  34301. } catch (e) {
  34302. d.debug(e.message);
  34303. }
  34304. return i;
  34305. }
  34306. function a(e) {
  34307. return s.deserialize(e);
  34308. }
  34309. var s = e('../controls/serializer'),
  34310. l = e('../util/math'),
  34311. c = e('./browser'),
  34312. h = e('../enum/Viewmode'),
  34313. u = e('../util/logger'),
  34314. th = e('three'), //xzw
  34315. d = new u(i);
  34316. t.exports = {
  34317. getStartCameraOptions: n,
  34318. };
  34319. }.call(this, '/js/util/camera.js'));
  34320. },
  34321. {
  34322. '../controls/serializer': 14,
  34323. '../enum/Viewmode': 51,
  34324. '../util/logger': 189,
  34325. '../util/math': 190,
  34326. './browser': 182,
  34327. three: 217,
  34328. },
  34329. ],
  34330. 184: [
  34331. function (e, t, i) {
  34332. 'use strict';
  34333. function n(e, t, i) {
  34334. return o(e.fov, t, i);
  34335. }
  34336. var r = e('./MathLight'),
  34337. o = function (e, t, i) {
  34338. var n = t,
  34339. o = i,
  34340. a =
  34341. 2 *
  34342. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) *
  34343. r.DEGREES_PER_RADIAN;
  34344. return a;
  34345. },
  34346. a = function (e, t, i) {
  34347. var n = t,
  34348. o = i,
  34349. a =
  34350. 2 *
  34351. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) *
  34352. r.DEGREES_PER_RADIAN;
  34353. return a;
  34354. },
  34355. s = function (e, t, i, n) {
  34356. var r = o(e, i, n);
  34357. return r > t ? a(t, i, n) : e;
  34358. };
  34359. t.exports = {
  34360. clampVFOV: s,
  34361. getHFOVForCamera: n,
  34362. getHFOVFromVFOV: o,
  34363. getVFOVFromHFOV: a,
  34364. };
  34365. window.MathLight = t.exports;
  34366. MathLight.closeTo = function (e1, e2, precision) {
  34367. //xzw add 判断e1,e2是否接近
  34368. var prec = Math.pow(10, -(precision || 4));
  34369. var s1 =
  34370. Math.abs(e1.x - e2.x) < prec &&
  34371. Math.abs(e1.y - e2.y) < prec &&
  34372. Math.abs(e1.z - e2.z) < prec;
  34373. if (e1.w) {
  34374. return s1 && Math.abs(e1.w - e2.w) < prec;
  34375. } else return s1;
  34376. };
  34377. },
  34378. {
  34379. './MathLight': 176,
  34380. },
  34381. ],
  34382. 185: [
  34383. function (e, t, i) {
  34384. 'use strict';
  34385. var n = e('three');
  34386. (t.exports = {
  34387. delayOneFrame: function (e) {
  34388. window.setTimeout(e, 1);
  34389. },
  34390. normalizeUrl: function (e) {
  34391. return e.replace('https://', 'http://');
  34392. },
  34393. domainFromUrl: function (e) {
  34394. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  34395. return t ? t[3] : e;
  34396. },
  34397. average: function (e, t) {
  34398. if (0 === e.length) return null;
  34399. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  34400. var o = t ? e[r][t] : e[r];
  34401. (i += o), n++;
  34402. }
  34403. return i / n;
  34404. },
  34405. countUnique: function (e) {
  34406. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0);
  34407. return Object.keys(t).length;
  34408. },
  34409. averageVectors: function (e, t) {
  34410. var i = new n.Vector3();
  34411. if (0 === e.length) return i;
  34412. for (var r = 0, o = 0; o < e.length; o++) {
  34413. var a = t ? e[o][t] : e[o];
  34414. i.add(a), r++;
  34415. }
  34416. return i.divideScalar(r);
  34417. },
  34418. equalLists: function (e, t) {
  34419. if (e.length !== t.length) return !1;
  34420. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1;
  34421. return !0;
  34422. },
  34423. lowerMedian: function (e, t) {
  34424. if (0 === e.length) return null;
  34425. (t = t || 2),
  34426. e.sort(function (e, t) {
  34427. return e - t;
  34428. });
  34429. var i = Math.floor(e.length / t);
  34430. return e[i];
  34431. },
  34432. stableSort: function (e, t) {
  34433. return e
  34434. .map(function (e, t) {
  34435. return {
  34436. value: e,
  34437. index: t,
  34438. };
  34439. })
  34440. .sort(function (e, i) {
  34441. var n = t(e.value, i.value);
  34442. return 0 !== n ? n : e.index - i.index;
  34443. })
  34444. .map(function (e) {
  34445. return e.value;
  34446. });
  34447. },
  34448. filterAll: function (e, t) {
  34449. return e.filter(function (e) {
  34450. return t.every(function (t) {
  34451. return t(e);
  34452. });
  34453. });
  34454. },
  34455. formatDate: function (e) {
  34456. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-');
  34457. },
  34458. formatDatetime: function (e) {
  34459. return [
  34460. e.getFullYear(),
  34461. e.getMonth() + 1,
  34462. e.getDate(),
  34463. e.getHours(),
  34464. e.getMinutes(),
  34465. ].join('-');
  34466. },
  34467. randomString: function (e) {
  34468. for (
  34469. var t = '',
  34470. i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
  34471. n = 0;
  34472. n < e;
  34473. n++
  34474. )
  34475. t += i.charAt(Math.floor(Math.random() * i.length));
  34476. return t;
  34477. },
  34478. uint8ToBase64: function (e, t) {
  34479. (t && 'number' == typeof t) || (t = 8192);
  34480. for (var i = [], n = 0; n < e.length; n += t)
  34481. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  34482. return btoa(i.join(''));
  34483. },
  34484. uuid4: function e(t) {
  34485. return t
  34486. ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16)
  34487. : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e);
  34488. },
  34489. nth: function (e) {
  34490. return (
  34491. (e %= 10), 1 === e ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  34492. );
  34493. },
  34494. extendObject: function (e, t) {
  34495. return (
  34496. Object.keys(t).forEach(function (i) {
  34497. e[i] = t[i];
  34498. }),
  34499. e
  34500. );
  34501. },
  34502. deepExtend: function e(t) {
  34503. t = t || {};
  34504. for (var i = 1; i < arguments.length; i++) {
  34505. var n = arguments[i];
  34506. if (n)
  34507. for (var r in n)
  34508. n.hasOwnProperty(r) &&
  34509. ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]));
  34510. }
  34511. return t;
  34512. },
  34513. inherit: function (e, t) {
  34514. (e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e);
  34515. },
  34516. extend: function (e, t) {
  34517. for (var i in t.prototype) e.prototype[i] = t.prototype[i];
  34518. },
  34519. getFileNameFromUrl: function (url) {
  34520. return url.split('/').pop();
  34521. },
  34522. }),
  34523. (Math.sign = function (e) {
  34524. return e < 0 ? -1 : 1;
  34525. });
  34526. window.common = t.exports;
  34527. expandCommon(common);
  34528. },
  34529. {
  34530. three: 217,
  34531. },
  34532. ],
  34533. 186: [
  34534. function (e, t, i) {
  34535. 'use strict';
  34536. var n = {};
  34537. (n.linearTween = function (e, t, i, n) {
  34538. return (i * e) / n + t;
  34539. }),
  34540. (n.easeInQuad = function (e, t, i, n) {
  34541. return (e /= n), i * e * e + t;
  34542. }),
  34543. (n.easeOutQuad = function (e, t, i, n) {
  34544. return (e /= n), -i * e * (e - 2) + t;
  34545. }),
  34546. (n.easeInOutQuad = function (e, t, i, n) {
  34547. return (
  34548. (e /= n / 2), e < 1 ? (i / 2) * e * e + t : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  34549. );
  34550. }),
  34551. (n.easeInCubic = function (e, t, i, n) {
  34552. return (e /= n), i * e * e * e + t;
  34553. }),
  34554. (n.easeOutCubic = function (e, t, i, n) {
  34555. return (e /= n), e--, i * (e * e * e + 1) + t;
  34556. }),
  34557. (n.easeInOutCubic = function (e, t, i, n) {
  34558. return (
  34559. (e /= n / 2),
  34560. e < 1 ? (i / 2) * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  34561. );
  34562. }),
  34563. (n.easeInQuart = function (e, t, i, n) {
  34564. return (e /= n), i * e * e * e * e + t;
  34565. }),
  34566. (n.easeOutQuart = function (e, t, i, n) {
  34567. return (e /= n), e--, -i * (e * e * e * e - 1) + t;
  34568. }),
  34569. (n.easeInOutQuart = function (e, t, i, n) {
  34570. return (
  34571. (e /= n / 2),
  34572. e < 1 ? (i / 2) * e * e * e * e + t : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  34573. );
  34574. }),
  34575. (n.easeInQuint = function (e, t, i, n) {
  34576. return (e /= n), i * e * e * e * e * e + t;
  34577. }),
  34578. (n.easeOutQuint = function (e, t, i, n) {
  34579. return (e /= n), e--, i * (e * e * e * e * e + 1) + t;
  34580. }),
  34581. (n.easeInOutQuint = function (e, t, i, n) {
  34582. return (
  34583. (e /= n / 2),
  34584. e < 1
  34585. ? (i / 2) * e * e * e * e * e + t
  34586. : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  34587. );
  34588. }),
  34589. (n.easeInSine = function (e, t, i, n) {
  34590. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t;
  34591. }),
  34592. (n.easeOutSine = function (e, t, i, n) {
  34593. return i * Math.sin((e / n) * (Math.PI / 2)) + t;
  34594. }),
  34595. (n.easeInOutSine = function (e, t, i, n) {
  34596. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t;
  34597. }),
  34598. (n.easeInExpo = function (e, t, i, n) {
  34599. return i * Math.pow(2, 10 * (e / n - 1)) + t;
  34600. }),
  34601. (n.easeOutExpo = function (e, t, i, n) {
  34602. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t;
  34603. }),
  34604. (n.easeInOutExpo = function (e, t, i, n) {
  34605. return (
  34606. (e /= n / 2),
  34607. e < 1
  34608. ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t
  34609. : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  34610. );
  34611. }),
  34612. (n.easeInCirc = function (e, t, i, n) {
  34613. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t;
  34614. }),
  34615. (n.easeOutCirc = function (e, t, i, n) {
  34616. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t;
  34617. }),
  34618. (n.easeInOutCirc = function (e, t, i, n) {
  34619. return (
  34620. (e /= n / 2),
  34621. e < 1
  34622. ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t
  34623. : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  34624. );
  34625. }),
  34626. (n.easeInElastic = function (e, t, i, n) {
  34627. var r = 1.70158,
  34628. o = 0,
  34629. a = i;
  34630. return 0 === e
  34631. ? t
  34632. : 1 === (e /= n)
  34633. ? t + i
  34634. : (o || (o = 0.3 * n),
  34635. a < Math.abs(i)
  34636. ? ((a = i), (r = o / 4))
  34637. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34638. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  34639. t);
  34640. }),
  34641. (n.easeOutElastic = function (e, t, i, n) {
  34642. var r = 1.70158,
  34643. o = 0,
  34644. a = i;
  34645. return 0 === e
  34646. ? t
  34647. : 1 === (e /= n)
  34648. ? t + i
  34649. : (o || (o = 0.3 * n),
  34650. a < Math.abs(i)
  34651. ? ((a = i), (r = o / 4))
  34652. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34653. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t);
  34654. }),
  34655. (n.easeInOutElastic = function (e, t, i, n) {
  34656. var r = 1.70158,
  34657. o = 0,
  34658. a = i;
  34659. return 0 === e
  34660. ? t
  34661. : 2 === (e /= n / 2)
  34662. ? t + i
  34663. : (o || (o = n * (0.3 * 1.5)),
  34664. a < Math.abs(i)
  34665. ? ((a = i), (r = o / 4))
  34666. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34667. e < 1
  34668. ? -0.5 *
  34669. (a *
  34670. Math.pow(2, 10 * (e -= 1)) *
  34671. Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  34672. t
  34673. : a *
  34674. Math.pow(2, -10 * (e -= 1)) *
  34675. Math.sin(((e * n - r) * (2 * Math.PI)) / o) *
  34676. 0.5 +
  34677. i +
  34678. t);
  34679. }),
  34680. (n.easeInBack = function (e, t, i, n, r) {
  34681. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t;
  34682. }),
  34683. (n.easeOutBack = function (e, t, i, n, r) {
  34684. return (
  34685. void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  34686. );
  34687. }),
  34688. (n.easeInOutBack = function (e, t, i, n, r) {
  34689. return (
  34690. void 0 === r && (r = 1.70158),
  34691. (e /= n / 2) < 1
  34692. ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t
  34693. : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  34694. );
  34695. }),
  34696. (n.easeOutBounce = function (e, t, i, n) {
  34697. return (e /= n) < 1 / 2.75
  34698. ? i * (7.5625 * e * e) + t
  34699. : e < 2 / 2.75
  34700. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  34701. : e < 2.5 / 2.75
  34702. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  34703. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
  34704. }),
  34705. (n.easeInBounce = function (e, t, i, r) {
  34706. return i - n.easeOutBounce(r - e, 0, i, r) + t;
  34707. }),
  34708. (n.easeInOutBounce = function (e, t, i, r) {
  34709. return e < r / 2
  34710. ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t
  34711. : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t;
  34712. }),
  34713. (t.exports = n);
  34714. window.easing = n;
  34715. },
  34716. {},
  34717. ],
  34718. 187: [
  34719. function (e, t, i) {
  34720. 'use strict';
  34721. function n() {
  34722. (this.events = []), (this.valid = !1);
  34723. }
  34724. var r = e('../enum/Joystick');
  34725. (n.prototype.push = function (e, t) {
  34726. this.events.push({
  34727. direction: e,
  34728. pano: t,
  34729. }),
  34730. (this.valid = !0);
  34731. }),
  34732. (n.prototype.pop = function (e) {
  34733. var t = this.events.pop();
  34734. return this.events.length < 1 && (this.valid = !1), t;
  34735. }),
  34736. (n.prototype.peek = function () {
  34737. return this.events.length
  34738. ? this.events[this.events.length - 1]
  34739. : {
  34740. direction: null,
  34741. pano: null,
  34742. };
  34743. }),
  34744. (n.prototype.invalidate = function () {
  34745. (this.events = []), (this.valid = !1);
  34746. }),
  34747. (n.prototype.reversePano = function (e) {
  34748. if (!this.valid) return null;
  34749. var t = this.peek();
  34750. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null;
  34751. }),
  34752. (t.exports = n);
  34753. },
  34754. {
  34755. '../enum/Joystick': 29,
  34756. },
  34757. ],
  34758. 188: [
  34759. function (e, t, i) {
  34760. 'use strict';
  34761. window.lerp = t.exports = {
  34762. vector: function (e, t) {
  34763. var i = e.clone();
  34764. return (
  34765. (t = t.clone()),
  34766. function (n) {
  34767. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n);
  34768. }
  34769. );
  34770. },
  34771. quaternion: function (e, t) {
  34772. var i = e.clone();
  34773. return function (n) {
  34774. e.copy(i).slerp(t, n);
  34775. };
  34776. },
  34777. property: function (e, t, i, n) {
  34778. var r = e[t];
  34779. return function (o) {
  34780. (e[t] = r * (1 - o) + i * o), n && n(e[t]);
  34781. };
  34782. },
  34783. uniform: function (e, t, i) {
  34784. var n = e.material.uniforms[t].value;
  34785. return function (r) {
  34786. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r);
  34787. };
  34788. },
  34789. matrix4: function (e, t) {
  34790. var i = e.clone();
  34791. return function (n) {
  34792. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  34793. r[s] = o[s] * (1 - n) + a[s] * n;
  34794. };
  34795. },
  34796. allUniforms: function (e, t, i) {
  34797. var n = e.map(
  34798. function (e) {
  34799. return this.uniform(e, t, i);
  34800. }.bind(this)
  34801. );
  34802. return function (e) {
  34803. n.forEach(function (t) {
  34804. t(e);
  34805. });
  34806. };
  34807. },
  34808. };
  34809. },
  34810. {},
  34811. ],
  34812. 189: [
  34813. function (e, t, i) {
  34814. 'use strict';
  34815. function n(e) {
  34816. var t,
  34817. i,
  34818. o,
  34819. a,
  34820. s = e.split('/'),
  34821. l = '[' + s[s.length - 1].replace('.js', '') + ']',
  34822. c = {};
  34823. if (n.consoleEnabled) {
  34824. var h = function (e) {
  34825. $('#debug-console').append('<p>' + e + '</p>'),
  34826. ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight);
  34827. };
  34828. (t = function (e) {
  34829. h(Array.prototype.slice.call(arguments).join(' '));
  34830. }),
  34831. (i = function (e) {
  34832. h(Array.prototype.slice.call(arguments).join(' '));
  34833. }),
  34834. (o = function (e) {
  34835. h('WARN: ' + Array.prototype.slice.call(arguments).join(' '));
  34836. }),
  34837. (a = function (e) {
  34838. h('ERROR: ' + Array.prototype.slice.call(arguments).join(' '));
  34839. });
  34840. } else
  34841. console.log
  34842. ? ((t = console.log),
  34843. (i = console.info ? console.info : console.log),
  34844. (o = console.warn ? console.warn : console.log),
  34845. (a = console.error ? console.error : console.log))
  34846. : (t = i = o = a = function () {});
  34847. var u = function (e) {
  34848. return [l, n.timestamp()].concat(Array.prototype.slice.call(e));
  34849. },
  34850. d = function (t, i) {
  34851. if (r) {
  34852. var o = Array.prototype.slice.call(t).join(' ');
  34853. r.captureMessage(o, {
  34854. level: i,
  34855. path: e,
  34856. timestamp: n.timestamp(),
  34857. });
  34858. }
  34859. },
  34860. p = function (t, i) {
  34861. if (r) {
  34862. var o = Array.prototype.slice.call(t).join(' ');
  34863. r.captureException(new Error(o), {
  34864. level: i,
  34865. path: e,
  34866. timestamp: n.timestamp(),
  34867. });
  34868. }
  34869. };
  34870. return {
  34871. debug: function () {
  34872. n.level >= n.levels.debug && t.apply(console, u(arguments));
  34873. },
  34874. info: function () {
  34875. n.level >= n.levels.info && i.apply(console, u(arguments));
  34876. },
  34877. warn: function () {
  34878. d(arguments, 'warn'), n.level >= n.levels.warn && o.apply(console, u(arguments));
  34879. },
  34880. error: function () {
  34881. p(arguments, 'error'), n.level >= n.levels.error && a.apply(console, u(arguments));
  34882. },
  34883. v3str: function (e, t) {
  34884. var i = void 0 === t ? 2 : t;
  34885. return (
  34886. '(' +
  34887. e.x.toPrecision(i) +
  34888. ', ' +
  34889. e.y.toPrecision(i) +
  34890. ', ' +
  34891. e.z.toPrecision(i) +
  34892. ')'
  34893. );
  34894. },
  34895. eulstr: function (e, t) {
  34896. var i = void 0 === t ? 2 : t;
  34897. return (
  34898. '(' +
  34899. THREE.Math.radToDeg(e.x).toPrecision(i) +
  34900. ', ' +
  34901. THREE.Math.radToDeg(e.y).toPrecision(i) +
  34902. ', ' +
  34903. THREE.Math.radToDeg(e.z).toPrecision(i) +
  34904. ' "' +
  34905. e.order +
  34906. '")'
  34907. );
  34908. },
  34909. time: function (e) {
  34910. n.level >= n.levels.debug && (c[e] = Date.now());
  34911. },
  34912. timeEnd: function (e) {
  34913. if (n.level >= n.levels.debug) {
  34914. var t = c[e];
  34915. if (!t) return;
  34916. var i = (Date.now() - t) / 1e3;
  34917. this.debug(e, i + 's');
  34918. }
  34919. },
  34920. };
  34921. }
  34922. var r = window.Raven;
  34923. (n.timestamp = function () {
  34924. return (Date.now() - window.navigationStart) / 1e3 + 's';
  34925. }),
  34926. (n.levels = {
  34927. debug: 3,
  34928. info: 2,
  34929. warn: 1,
  34930. error: 0,
  34931. }),
  34932. (n.level = n.levels.info),
  34933. (t.exports = n);
  34934. },
  34935. {},
  34936. ],
  34937. 190: [
  34938. function (e, t, i) {
  34939. 'use strict';
  34940. var n = e('three'),
  34941. r = e('../enum/GLCubeFaces'),
  34942. o = e('../constants');
  34943. t.exports = {
  34944. convertVisionVector: function (e) {
  34945. return new n.Vector3(e.x, e.z, -e.y);
  34946. },
  34947. convertVisionQuaternion: function (e) {
  34948. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(
  34949. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90))
  34950. );
  34951. },
  34952. convertWorkshopVector: function (e) {
  34953. return new n.Vector3(-e.x, e.y, e.z);
  34954. },
  34955. convertWorkshopQuaternion: function (e) {
  34956. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  34957. new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  34958. );
  34959. },
  34960. convertWorkshopPanoramaQuaternion: function (e) {
  34961. return new n.Quaternion(e.x, -e.y, -e.z, e.w)
  34962. .normalize()
  34963. .multiply(
  34964. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270))
  34965. );
  34966. },
  34967. convertWorkshopOrthoZoom: function (e) {
  34968. // xzw
  34969. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  34970. //return e;
  34971. return e === -1
  34972. ? -1
  34973. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  34974. g_snapShotHeight;
  34975. },
  34976. toPrecision: function (e, t) {
  34977. //xzw change
  34978. var f = function (e, t) {
  34979. var i = Math.pow(10, t);
  34980. return Math.round(e * i) / i;
  34981. };
  34982. if (e instanceof Array) {
  34983. for (var s = 0; s < e.length; s++) {
  34984. e[s] = f(e[s], t);
  34985. }
  34986. return e;
  34987. } else return f(e, t);
  34988. },
  34989. isEmptyQuaternion: function (e) {
  34990. return (
  34991. 0 === Math.abs(e.x) &&
  34992. 0 === Math.abs(e.y) &&
  34993. 0 === Math.abs(e.z) &&
  34994. 0 === Math.abs(e.w)
  34995. );
  34996. },
  34997. projectPositionToCanvas: function (e, t, i) {
  34998. (i = i || new n.Vector3()), i.copy(e);
  34999. var r = 0.5 * $('#player').width(),
  35000. o = 0.5 * $('#player').height();
  35001. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i;
  35002. },
  35003. convertScreenPositionToNDC: function (e, t, i) {
  35004. return (
  35005. (i = i || new n.Vector2()),
  35006. (i.x = (e / $('#player').width()) * 2 - 1),
  35007. (i.y = 2 * -(t / $('#player').height()) + 1),
  35008. i
  35009. );
  35010. },
  35011. constrainedTurn: function (e) {
  35012. var t = e % (2 * Math.PI);
  35013. return (t = t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t);
  35014. },
  35015. getFOVDotThreshold: function (e) {
  35016. return Math.cos(n.Math.degToRad(e / 2));
  35017. },
  35018. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  35019. switch (e) {
  35020. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  35021. i.set(1, t.y, t.x);
  35022. break;
  35023. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  35024. i.set(-1, t.y, -t.x);
  35025. break;
  35026. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  35027. i.set(-t.x, 1, -t.y);
  35028. break;
  35029. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  35030. i.set(-t.x, -1, t.y);
  35031. break;
  35032. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  35033. i.set(-t.x, t.y, 1);
  35034. break;
  35035. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  35036. i.set(t.x, t.y, -1);
  35037. }
  35038. n && i.normalize();
  35039. },
  35040. //add:
  35041. getPos2d: function (point, camera, dom) {
  35042. var camera = camera;
  35043. var dom = dom;
  35044. var pos = point.clone().project(camera); //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  35045. var x, y;
  35046. x = ((pos.x + 1) / 2) * dom.clientWidth;
  35047. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  35048. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0;
  35049. return {
  35050. pos: new THREE.Vector2(x, y),
  35051. vector: pos,
  35052. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  35053. inSight: inSight, //在屏幕范围内可见
  35054. };
  35055. },
  35056. getDirByLonLat: function (lon, lat) {
  35057. var dir = new THREE.Vector3();
  35058. var phi = THREE.Math.degToRad(90 - lat);
  35059. var theta = THREE.Math.degToRad(lon);
  35060. dir.x = Math.sin(phi) * Math.cos(theta);
  35061. dir.y = Math.cos(phi);
  35062. dir.z = Math.sin(phi) * Math.sin(theta);
  35063. return dir.negate();
  35064. },
  35065. };
  35066. window.math = t.exports;
  35067. },
  35068. {
  35069. '../constants': 8,
  35070. '../enum/GLCubeFaces': 25,
  35071. three: 217,
  35072. },
  35073. ],
  35074. 191: [
  35075. function (e, t, i) {
  35076. 'use strict';
  35077. function n(e, t, i) {
  35078. return a.map(
  35079. function (n, o) {
  35080. return e.get('pan/' + i + '/' + t + '_skybox' + r(n) + '.jpg');
  35081. }.bind(this)
  35082. );
  35083. }
  35084. function r(e) {
  35085. return s[e];
  35086. }
  35087. var o = e('../enum/GLCubeFaces'),
  35088. a = [0, 1, 2, 3, 4, 5],
  35089. s = {
  35090. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  35091. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  35092. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  35093. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  35094. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  35095. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  35096. };
  35097. t.exports = {
  35098. mapFaceToCubemapFace: r,
  35099. getCubemapUrls: n,
  35100. };
  35101. },
  35102. {
  35103. '../enum/GLCubeFaces': 25,
  35104. },
  35105. ],
  35106. 192: [
  35107. function (e, t, i) {
  35108. 'use strict';
  35109. t.exports = {
  35110. captureErrors: function (e, t, i) {
  35111. if ('Raven' in window) {
  35112. Raven.config(e, t).install(), i && Raven.setTagsContext(i);
  35113. var n = console.warn,
  35114. r = console.error;
  35115. (console.warn = function () {
  35116. var e = Array.prototype.slice.call(arguments);
  35117. Raven.captureMessage(e.join(' '), {
  35118. level: 'warning',
  35119. }),
  35120. n.apply(console, e);
  35121. }),
  35122. (console.error = function () {
  35123. var e = Array.prototype.slice.call(arguments);
  35124. Raven.captureException(new Error(e.join(' ')), {
  35125. level: 'error',
  35126. }),
  35127. r.apply(console, e);
  35128. });
  35129. } else console.error('Raven not found, not capturing errors.');
  35130. },
  35131. };
  35132. },
  35133. {},
  35134. ],
  35135. 193: [
  35136. function (e, t, i) {
  35137. (function (i) {
  35138. 'use strict';
  35139. var n = e('./browser'),
  35140. r = e('../constants'),
  35141. o = e('url'),
  35142. a = e('./logger'),
  35143. ss = e('three'),
  35144. s = new a(i),
  35145. l = {
  35146. getAuthorizationHeader: function () {
  35147. var e = n.valueFromHash('auth');
  35148. if (e) return e.replace(',', ' ');
  35149. var t = n.valueFromCookie('token');
  35150. return t ? 'Token ' + t : null;
  35151. },
  35152. parseSidUrl: function (e) {
  35153. var t, i;
  35154. t = g_Prefix;
  35155. if (((e = e || ''), e.match(/^https?/))) {
  35156. var n = o.parse(e);
  35157. (t = g_Prefix), (i = e);
  35158. } else {
  35159. //xzw 原先的不能用
  35160. //t = window.location.protocol + "//" + window.location.host, //MP
  35161. t = g_Prefix;
  35162. //i = t + "/api/player/models/" + e; //MP
  35163. i = t + 'data/' + e;
  35164. }
  35165. return {
  35166. urlBase: t,
  35167. urlModel: i,
  35168. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  35169. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb'),
  35170. };
  35171. },
  35172. getModelIDFromQueryString: function () {
  35173. return n.valueFromHash('model') || n.valueFromHash('m');
  35174. },
  35175. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  35176. e = JSON.parse(JSON.stringify(e));
  35177. var i = null;
  35178. if (e.images.forEach(function(n) {
  35179. if(!n.metadata) return;
  35180. if ("string" == typeof n.metadata)
  35181. try {
  35182. n.metadata = JSON.parse(n.metadata)
  35183. } catch (e) {
  35184. s.warn("Unable to parse image metadata"),
  35185. n.metadata = null
  35186. }
  35187. else{
  35188. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  35189. }
  35190. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  35191. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  35192. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  35193. }else{
  35194. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35195. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  35196. n.metadata.zoom = n.metadata.zoom || 1;
  35197. }
  35198. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  35199. }),
  35200. //icon初始视角的:
  35201. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  35202. var n = {};
  35203. n.pano = {
  35204. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35205. position: t.convertWorkshopVector(i.scan_position),
  35206. uuid: i.scan_id
  35207. },
  35208. n.camera = {
  35209. quaternion: i.camera_quaternion,
  35210. position: i.camera_position
  35211. },
  35212. e.startPano = n
  35213. }
  35214. return e
  35215. },
  35216. */
  35217. normalizeModeldata: function (e, t) {
  35218. //xzw 修改导览images数据
  35219. e = JSON.parse(JSON.stringify(e));
  35220. var i = null;
  35221. var deal = function (n) {
  35222. if (!n.metadata) return;
  35223. if ('string' == typeof n.metadata)
  35224. try {
  35225. n.metadata = JSON.parse(n.metadata);
  35226. } catch (e) {
  35227. s.warn('Unable to parse image metadata'), (n.metadata = null);
  35228. }
  35229. else {
  35230. 'object' == typeof n.metadata &&
  35231. s.debug('image.metadata already a JSON object');
  35232. }
  35233. if (n.metadata.camera_position instanceof Array) {
  35234. //xzw 改的格式
  35235. n.metadata.camera_position = new ss.Vector3().fromArray(
  35236. n.metadata.camera_position
  35237. );
  35238. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(
  35239. n.metadata.camera_quaternion
  35240. );
  35241. } else {
  35242. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position);
  35243. n.metadata.camera_quaternion = new ss.Quaternion().copy(
  35244. n.metadata.camera_quaternion
  35245. );
  35246. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35247. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  35248. }
  35249. !i && e.icon && e.icon === n.sid && (i = n.metadata);
  35250. };
  35251. //改
  35252. e.images.forEach((info) => {
  35253. if (info.locations) {
  35254. info.locations.forEach((a) => deal(a));
  35255. } else {
  35256. deal(info);
  35257. }
  35258. });
  35259. //icon初始视角的:
  35260. if (
  35261. i &&
  35262. i.camera_quaternion &&
  35263. i.camera_position &&
  35264. i.scan_position &&
  35265. i.scan_quaternion
  35266. ) {
  35267. var n = {};
  35268. (n.pano = {
  35269. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35270. position: t.convertWorkshopVector(i.scan_position),
  35271. uuid: i.scan_id,
  35272. }),
  35273. (n.camera = {
  35274. quaternion: i.camera_quaternion,
  35275. position: i.camera_position,
  35276. }),
  35277. (e.startPano = n);
  35278. }
  35279. return e;
  35280. },
  35281. visionVersionToInt: (function () {
  35282. var e = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''));
  35283. return function (t) {
  35284. if (!t) throw new Error('Vision version is required');
  35285. var i = e.exec(t);
  35286. if (null === i) throw new Error('String is not a vision version: ' + t);
  35287. return parseInt(i[1]);
  35288. };
  35289. })(),
  35290. modelDataPromisesTiles: function (e) {
  35291. var vision_version = e.vision_version || window.DATA.vision_version;
  35292. if (vision_version)
  35293. try {
  35294. return (
  35295. l.visionVersionToInt(vision_version) >=
  35296. l.visionVersionToInt(r.visionTilingStartVersion)
  35297. );
  35298. } catch (t) {
  35299. s.warn('Invalid vision version: ' + vision_version);
  35300. }
  35301. // var t = e.created ? new Date(e.created) : null;
  35302. // return t && t >= r.visionTilingStartDate
  35303. return false;
  35304. },
  35305. };
  35306. t.exports = l;
  35307. }.call(this, '/js/util/showcase.js'));
  35308. },
  35309. {
  35310. '../constants': 8,
  35311. './browser': 182,
  35312. './logger': 189,
  35313. three: 217,
  35314. url: 208,
  35315. },
  35316. ],
  35317. 194: [
  35318. function (e, t, i) {
  35319. 'use strict';
  35320. var n = e('../util/ajax'),
  35321. r = e('three'),
  35322. o = e('../settings'),
  35323. a = {};
  35324. t.exports = {
  35325. load: function (e, t, i) {
  35326. var s = a[e];
  35327. return s
  35328. ? (t &&
  35329. setTimeout(function () {
  35330. t(s);
  35331. }, 1),
  35332. s)
  35333. : ((s = new r.Texture()),
  35334. o.minimalMemoryMode &&
  35335. ((s.minFilter = r.LinearFilter),
  35336. (s.magFilter = r.LinearFilter),
  35337. (s.generateMipmaps = !1)),
  35338. (s.sourceFile = e),
  35339. (a[e] = s),
  35340. n
  35341. .getImage(e)
  35342. .then(function (e) {
  35343. (s.image = e), (s.needsUpdate = !0), t && t(s);
  35344. })
  35345. .fail(i),
  35346. s);
  35347. },
  35348. loadBase64: function (e, t) {
  35349. t = t || 'png';
  35350. var i = new r.Texture();
  35351. return (
  35352. (i.image = document.createElement('img')),
  35353. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  35354. o.minimalMemoryMode &&
  35355. ((i.minFilter = r.LinearFilter),
  35356. (i.magFilter = r.LinearFilter),
  35357. (i.generateMipmaps = !1)),
  35358. (i.needsUpdate = !0),
  35359. i
  35360. );
  35361. },
  35362. isLoaded: function (e) {
  35363. return !!a[e];
  35364. },
  35365. };
  35366. window.Texture = t.exports;
  35367. },
  35368. {
  35369. '../settings': 166,
  35370. '../util/ajax': 181,
  35371. three: 217,
  35372. },
  35373. ],
  35374. 195: [
  35375. function (e, t, i) {
  35376. 'use strict';
  35377. var n = e('./easing');
  35378. window.transitions = t.exports = {
  35379. globalDone: null,
  35380. funcs: [],
  35381. counter: 0,
  35382. uniqueID: 0,
  35383. start: function (e, t, i, r, o, a, s) {
  35384. return (
  35385. (r = r || 0),
  35386. this.funcs.push({
  35387. func: e,
  35388. current: -r * Math.abs(t),
  35389. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  35390. done: i,
  35391. easing: o || n.linearTween,
  35392. cycling: t < 0,
  35393. running: !0,
  35394. debug: r < 0,
  35395. name: a || 'T' + this.counter,
  35396. id: void 0 === s ? this.counter : s,
  35397. paused: !1,
  35398. }),
  35399. e(0, 16),
  35400. (this.counter += 1),
  35401. e
  35402. );
  35403. },
  35404. trigger: function (e) {
  35405. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  35406. i = e.func || function () {},
  35407. r = void 0 === e.duration ? 0 : e.duration;
  35408. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  35409. var o = e.done || null,
  35410. a = e.easing || n.linearTween,
  35411. s = e.name || 'R' + this.counter,
  35412. l = void 0 === e.id ? this.counter : e.id;
  35413. return this.start(i, r, o, t, a, s, l);
  35414. },
  35415. setTimeout: function (e, t, i) {
  35416. var n = void 0 === i ? this.counter : i;
  35417. return this.trigger({
  35418. done: e,
  35419. duration: void 0 === t ? 0 : t,
  35420. name: 'O' + this.counter,
  35421. id: n,
  35422. });
  35423. },
  35424. pause: function () {
  35425. this.paused = !0;
  35426. },
  35427. resume: function () {
  35428. this.paused = !1;
  35429. },
  35430. update: function (e) {
  35431. this.funcs.forEach(function (t) {
  35432. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  35433. if (t.current >= t.duration && !t.cycling) {
  35434. var i = t.easing(1, 0, 1, 1);
  35435. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1);
  35436. } else {
  35437. var n = t.easing((t.current % t.duration) / t.duration, 0, 1, 1),
  35438. r = t.func(n, 1e3 * e) || !1;
  35439. r && (t.done && t.done(), (t.running = !1));
  35440. }
  35441. });
  35442. var t = this.funcs.length;
  35443. this.funcs = this.funcs.filter(function (e) {
  35444. return e.running;
  35445. });
  35446. var i = this.funcs.length;
  35447. if (t > 0 && 0 === i && this.globalDone) {
  35448. var n = this.globalDone;
  35449. (this.globalDone = null), n();
  35450. }
  35451. },
  35452. adjustSpeed: function (e, t) {
  35453. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  35454. var r = i[n];
  35455. (r.duration /= t), (r.current /= t);
  35456. }
  35457. },
  35458. getById: function (e) {
  35459. return this.funcs.filter(function (t) {
  35460. return e === t.id;
  35461. });
  35462. },
  35463. get: function (e) {
  35464. for (var t = 0; t < this.funcs.length; t += 1)
  35465. if (this.funcs[t].func === e) return this.funcs[t];
  35466. return null;
  35467. },
  35468. isRunning: function (e) {
  35469. var t = this.get(e);
  35470. return null !== t && t.running;
  35471. },
  35472. countActive: function () {
  35473. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running;
  35474. return e;
  35475. },
  35476. listActive: function () {
  35477. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  35478. this.funcs[t].running && e.push(this.funcs[t].name);
  35479. return e;
  35480. },
  35481. done: function (e) {
  35482. this.globalDone = e;
  35483. },
  35484. cancelById: function (e) {
  35485. var t = void 0 === e ? 0 : e;
  35486. this.funcs = this.funcs.filter(function (e) {
  35487. return e.id !== t;
  35488. });
  35489. },
  35490. cancel: function (e) {
  35491. this.funcs = this.funcs.filter(function (t) {
  35492. return t.func !== e;
  35493. });
  35494. },
  35495. getUniqueId: function () {
  35496. return (this.uniqueID -= 1), this.uniqueID;
  35497. },
  35498. };
  35499. },
  35500. {
  35501. './easing': 186,
  35502. },
  35503. ],
  35504. 196: [
  35505. function (e, t, i) {
  35506. function n(e) {
  35507. if (
  35508. ((this.set = {}),
  35509. (this.infContains = function () {
  35510. return !0;
  35511. }),
  35512. 'object' == typeof e)
  35513. )
  35514. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0;
  35515. else this.set = e;
  35516. else if ('function' == typeof e) this.infContains = e;
  35517. else if ('undefined' != typeof e)
  35518. throw new Error('set must be either an array or an object.');
  35519. }
  35520. (t.exports = n),
  35521. (n.prototype.contains = function (e) {
  35522. return !!this.set[e];
  35523. }),
  35524. (n.prototype.has = n.prototype.contains),
  35525. (n.prototype.add = function (e) {
  35526. if (1 == arguments.length) this.set[e] = !0;
  35527. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0;
  35528. }),
  35529. (n.prototype.addAll = function (e) {
  35530. if ('object' != typeof e && !(e instanceof Array))
  35531. throw new Error('arr must be an array.');
  35532. for (var t = 0; t < e.length; t++) this.add(e[t]);
  35533. }),
  35534. (n.prototype.remove = function (e) {
  35535. if (1 == arguments.length) delete this.set[e];
  35536. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]];
  35537. }),
  35538. (n.prototype.delete = n.prototype.remove),
  35539. (n.prototype.clear = function () {
  35540. this.set = {};
  35541. }),
  35542. (n.prototype.size = function () {
  35543. return Object.keys(this.set).length;
  35544. }),
  35545. (n.prototype.toString = function () {
  35546. return '{' + Object.keys(this.set).toString() + '}';
  35547. }),
  35548. (n.prototype.toArray = function () {
  35549. return 'undefined' == typeof this.set ? [] : Object.keys(this.set);
  35550. }),
  35551. (n.prototype['*values'] = n.prototype.toArray);
  35552. },
  35553. {},
  35554. ],
  35555. 197: [function (e, t, i) {}, {}],
  35556. 198: [
  35557. function (e, t, i) {
  35558. (function (t) {
  35559. 'use strict';
  35560. function n() {
  35561. try {
  35562. var e = new Uint8Array(1);
  35563. return (
  35564. (e.__proto__ = {
  35565. __proto__: Uint8Array.prototype,
  35566. foo: function () {
  35567. return 42;
  35568. },
  35569. }),
  35570. 42 === e.foo() &&
  35571. 'function' == typeof e.subarray &&
  35572. 0 === e.subarray(1, 1).byteLength
  35573. );
  35574. } catch (e) {
  35575. return !1;
  35576. }
  35577. }
  35578. function r() {
  35579. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
  35580. }
  35581. function o(e, t) {
  35582. if (r() < t) throw new RangeError('Invalid typed array length');
  35583. return (
  35584. a.TYPED_ARRAY_SUPPORT
  35585. ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype))
  35586. : (null === e && (e = new a(t)), (e.length = t)),
  35587. e
  35588. );
  35589. }
  35590. function a(e, t, i) {
  35591. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a)) return new a(e, t, i);
  35592. if ('number' == typeof e) {
  35593. if ('string' == typeof t)
  35594. throw new Error(
  35595. 'If encoding is specified then the first argument must be a string'
  35596. );
  35597. return h(this, e);
  35598. }
  35599. return s(this, e, t, i);
  35600. }
  35601. function s(e, t, i, n) {
  35602. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number');
  35603. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
  35604. ? p(e, t, i, n)
  35605. : 'string' == typeof t
  35606. ? u(e, t, i)
  35607. : f(e, t);
  35608. }
  35609. function l(e) {
  35610. if ('number' != typeof e) throw new TypeError('"size" argument must be a number');
  35611. if (e < 0) throw new RangeError('"size" argument must not be negative');
  35612. }
  35613. function c(e, t, i, n) {
  35614. return (
  35615. l(t),
  35616. t <= 0
  35617. ? o(e, t)
  35618. : void 0 !== i
  35619. ? 'string' == typeof n
  35620. ? o(e, t).fill(i, n)
  35621. : o(e, t).fill(i)
  35622. : o(e, t)
  35623. );
  35624. }
  35625. function h(e, t) {
  35626. if ((l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT))
  35627. for (var i = 0; i < t; ++i) e[i] = 0;
  35628. return e;
  35629. }
  35630. function u(e, t, i) {
  35631. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !a.isEncoding(i)))
  35632. throw new TypeError('"encoding" must be a valid string encoding');
  35633. var n = 0 | v(t, i);
  35634. e = o(e, n);
  35635. var r = e.write(t, i);
  35636. return r !== n && (e = e.slice(0, r)), e;
  35637. }
  35638. function d(e, t) {
  35639. var i = t.length < 0 ? 0 : 0 | g(t.length);
  35640. e = o(e, i);
  35641. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n];
  35642. return e;
  35643. }
  35644. function p(e, t, i, n) {
  35645. if ((t.byteLength, i < 0 || t.byteLength < i))
  35646. throw new RangeError("'offset' is out of bounds");
  35647. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds");
  35648. return (
  35649. (t =
  35650. void 0 === i && void 0 === n
  35651. ? new Uint8Array(t)
  35652. : void 0 === n
  35653. ? new Uint8Array(t, i)
  35654. : new Uint8Array(t, i, n)),
  35655. a.TYPED_ARRAY_SUPPORT ? ((e = t), (e.__proto__ = a.prototype)) : (e = d(e, t)),
  35656. e
  35657. );
  35658. }
  35659. function f(e, t) {
  35660. if (a.isBuffer(t)) {
  35661. var i = 0 | g(t.length);
  35662. return (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e);
  35663. }
  35664. if (t) {
  35665. if (
  35666. ('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) ||
  35667. 'length' in t
  35668. )
  35669. return 'number' != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  35670. if ('Buffer' === t.type && $(t.data)) return d(e, t.data);
  35671. }
  35672. throw new TypeError(
  35673. 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'
  35674. );
  35675. }
  35676. function g(e) {
  35677. if (e >= r())
  35678. throw new RangeError(
  35679. 'Attempt to allocate Buffer larger than maximum size: 0x' +
  35680. r().toString(16) +
  35681. ' bytes'
  35682. );
  35683. return 0 | e;
  35684. }
  35685. function m(e) {
  35686. return +e != e && (e = 0), a.alloc(+e);
  35687. }
  35688. function v(e, t) {
  35689. if (a.isBuffer(e)) return e.length;
  35690. if (
  35691. 'undefined' != typeof ArrayBuffer &&
  35692. 'function' == typeof ArrayBuffer.isView &&
  35693. (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
  35694. )
  35695. return e.byteLength;
  35696. 'string' != typeof e && (e = '' + e);
  35697. var i = e.length;
  35698. if (0 === i) return 0;
  35699. for (var n = !1; ; )
  35700. switch (t) {
  35701. case 'ascii':
  35702. case 'latin1':
  35703. case 'binary':
  35704. return i;
  35705. case 'utf8':
  35706. case 'utf-8':
  35707. case void 0:
  35708. return j(e).length;
  35709. case 'ucs2':
  35710. case 'ucs-2':
  35711. case 'utf16le':
  35712. case 'utf-16le':
  35713. return 2 * i;
  35714. case 'hex':
  35715. return i >>> 1;
  35716. case 'base64':
  35717. return Z(e).length;
  35718. default:
  35719. if (n) return j(e).length;
  35720. (t = ('' + t).toLowerCase()), (n = !0);
  35721. }
  35722. }
  35723. function A(e, t, i) {
  35724. var n = !1;
  35725. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return '';
  35726. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return '';
  35727. if (((i >>>= 0), (t >>>= 0), i <= t)) return '';
  35728. for (e || (e = 'utf8'); ; )
  35729. switch (e) {
  35730. case 'hex':
  35731. return L(this, t, i);
  35732. case 'utf8':
  35733. case 'utf-8':
  35734. return M(this, t, i);
  35735. case 'ascii':
  35736. return P(this, t, i);
  35737. case 'latin1':
  35738. case 'binary':
  35739. return O(this, t, i);
  35740. case 'base64':
  35741. return S(this, t, i);
  35742. case 'ucs2':
  35743. case 'ucs-2':
  35744. case 'utf16le':
  35745. case 'utf-16le':
  35746. return D(this, t, i);
  35747. default:
  35748. if (n) throw new TypeError('Unknown encoding: ' + e);
  35749. (e = (e + '').toLowerCase()), (n = !0);
  35750. }
  35751. }
  35752. function y(e, t, i) {
  35753. var n = e[t];
  35754. (e[t] = e[i]), (e[i] = n);
  35755. }
  35756. function C(e, t, i, n, r) {
  35757. if (0 === e.length) return -1;
  35758. if (
  35759. ('string' == typeof i
  35760. ? ((n = i), (i = 0))
  35761. : i > 2147483647
  35762. ? (i = 2147483647)
  35763. : i < -2147483648 && (i = -2147483648),
  35764. (i = +i),
  35765. isNaN(i) && (i = r ? 0 : e.length - 1),
  35766. i < 0 && (i = e.length + i),
  35767. i >= e.length)
  35768. ) {
  35769. if (r) return -1;
  35770. i = e.length - 1;
  35771. } else if (i < 0) {
  35772. if (!r) return -1;
  35773. i = 0;
  35774. }
  35775. if (('string' == typeof t && (t = a.from(t, n)), a.isBuffer(t)))
  35776. return 0 === t.length ? -1 : I(e, t, i, n, r);
  35777. if ('number' == typeof t)
  35778. return (
  35779. (t &= 255),
  35780. a.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  35781. ? r
  35782. ? Uint8Array.prototype.indexOf.call(e, t, i)
  35783. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  35784. : I(e, [t], i, n, r)
  35785. );
  35786. throw new TypeError('val must be string, number or Buffer');
  35787. }
  35788. function I(e, t, i, n, r) {
  35789. function o(e, t) {
  35790. return 1 === a ? e[t] : e.readUInt16BE(t * a);
  35791. }
  35792. var a = 1,
  35793. s = e.length,
  35794. l = t.length;
  35795. if (
  35796. void 0 !== n &&
  35797. ((n = String(n).toLowerCase()),
  35798. 'ucs2' === n || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)
  35799. ) {
  35800. if (e.length < 2 || t.length < 2) return -1;
  35801. (a = 2), (s /= 2), (l /= 2), (i /= 2);
  35802. }
  35803. var c;
  35804. if (r) {
  35805. var h = -1;
  35806. for (c = i; c < s; c++)
  35807. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  35808. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a;
  35809. } else h !== -1 && (c -= c - h), (h = -1);
  35810. } else
  35811. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  35812. for (var u = !0, d = 0; d < l; d++)
  35813. if (o(e, c + d) !== o(t, d)) {
  35814. u = !1;
  35815. break;
  35816. }
  35817. if (u) return c;
  35818. }
  35819. return -1;
  35820. }
  35821. function E(e, t, i, n) {
  35822. i = Number(i) || 0;
  35823. var r = e.length - i;
  35824. n ? ((n = Number(n)), n > r && (n = r)) : (n = r);
  35825. var o = t.length;
  35826. if (o % 2 !== 0) throw new TypeError('Invalid hex string');
  35827. n > o / 2 && (n = o / 2);
  35828. for (var a = 0; a < n; ++a) {
  35829. var s = parseInt(t.substr(2 * a, 2), 16);
  35830. if (isNaN(s)) return a;
  35831. e[i + a] = s;
  35832. }
  35833. return a;
  35834. }
  35835. function b(e, t, i, n) {
  35836. return q(j(t, e.length - i), e, i, n);
  35837. }
  35838. function w(e, t, i, n) {
  35839. return q(Y(t), e, i, n);
  35840. }
  35841. function _(e, t, i, n) {
  35842. return w(e, t, i, n);
  35843. }
  35844. function T(e, t, i, n) {
  35845. return q(Z(t), e, i, n);
  35846. }
  35847. function x(e, t, i, n) {
  35848. return q(X(t, e.length - i), e, i, n);
  35849. }
  35850. function S(e, t, i) {
  35851. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i));
  35852. }
  35853. function M(e, t, i) {
  35854. i = Math.min(e.length, i);
  35855. for (var n = [], r = t; r < i; ) {
  35856. var o = e[r],
  35857. a = null,
  35858. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  35859. if (r + s <= i) {
  35860. var l, c, h, u;
  35861. switch (s) {
  35862. case 1:
  35863. o < 128 && (a = o);
  35864. break;
  35865. case 2:
  35866. (l = e[r + 1]),
  35867. 128 === (192 & l) && ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u));
  35868. break;
  35869. case 3:
  35870. (l = e[r + 1]),
  35871. (c = e[r + 2]),
  35872. 128 === (192 & l) &&
  35873. 128 === (192 & c) &&
  35874. ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)),
  35875. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  35876. break;
  35877. case 4:
  35878. (l = e[r + 1]),
  35879. (c = e[r + 2]),
  35880. (h = e[r + 3]),
  35881. 128 === (192 & l) &&
  35882. 128 === (192 & c) &&
  35883. 128 === (192 & h) &&
  35884. ((u = ((15 & o) << 18) | ((63 & l) << 12) | ((63 & c) << 6) | (63 & h)),
  35885. u > 65535 && u < 1114112 && (a = u));
  35886. }
  35887. }
  35888. null === a
  35889. ? ((a = 65533), (s = 1))
  35890. : a > 65535 &&
  35891. ((a -= 65536), n.push(((a >>> 10) & 1023) | 55296), (a = 56320 | (1023 & a))),
  35892. n.push(a),
  35893. (r += s);
  35894. }
  35895. return R(n);
  35896. }
  35897. function R(e) {
  35898. var t = e.length;
  35899. if (t <= ee) return String.fromCharCode.apply(String, e);
  35900. for (var i = '', n = 0; n < t; )
  35901. i += String.fromCharCode.apply(String, e.slice(n, (n += ee)));
  35902. return i;
  35903. }
  35904. function P(e, t, i) {
  35905. var n = '';
  35906. i = Math.min(e.length, i);
  35907. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r]);
  35908. return n;
  35909. }
  35910. function O(e, t, i) {
  35911. var n = '';
  35912. i = Math.min(e.length, i);
  35913. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r]);
  35914. return n;
  35915. }
  35916. function L(e, t, i) {
  35917. var n = e.length;
  35918. (!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n);
  35919. for (var r = '', o = t; o < i; ++o) r += W(e[o]);
  35920. return r;
  35921. }
  35922. function D(e, t, i) {
  35923. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2)
  35924. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  35925. return r;
  35926. }
  35927. function N(e, t, i) {
  35928. if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint');
  35929. if (e + t > i) throw new RangeError('Trying to access beyond buffer length');
  35930. }
  35931. function B(e, t, i, n, r, o) {
  35932. if (!a.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
  35933. if (t > r || t < o) throw new RangeError('"value" argument is out of bounds');
  35934. if (i + n > e.length) throw new RangeError('Index out of range');
  35935. }
  35936. function F(e, t, i, n) {
  35937. t < 0 && (t = 65535 + t + 1);
  35938. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  35939. e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r));
  35940. }
  35941. function V(e, t, i, n) {
  35942. t < 0 && (t = 4294967295 + t + 1);
  35943. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  35944. e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255;
  35945. }
  35946. function U(e, t, i, n, r, o) {
  35947. if (i + n > e.length) throw new RangeError('Index out of range');
  35948. if (i < 0) throw new RangeError('Index out of range');
  35949. }
  35950. function k(e, t, i, n, r) {
  35951. return (
  35952. r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  35953. J.write(e, t, i, n, 23, 4),
  35954. i + 4
  35955. );
  35956. }
  35957. function H(e, t, i, n, r) {
  35958. return (
  35959. r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  35960. J.write(e, t, i, n, 52, 8),
  35961. i + 8
  35962. );
  35963. }
  35964. function G(e) {
  35965. if (((e = z(e).replace(te, '')), e.length < 2)) return '';
  35966. for (; e.length % 4 !== 0; ) e += '=';
  35967. return e;
  35968. }
  35969. function z(e) {
  35970. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '');
  35971. }
  35972. function W(e) {
  35973. return e < 16 ? '0' + e.toString(16) : e.toString(16);
  35974. }
  35975. function j(e, t) {
  35976. t = t || 1 / 0;
  35977. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  35978. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  35979. if (!r) {
  35980. if (i > 56319) {
  35981. (t -= 3) > -1 && o.push(239, 191, 189);
  35982. continue;
  35983. }
  35984. if (a + 1 === n) {
  35985. (t -= 3) > -1 && o.push(239, 191, 189);
  35986. continue;
  35987. }
  35988. r = i;
  35989. continue;
  35990. }
  35991. if (i < 56320) {
  35992. (t -= 3) > -1 && o.push(239, 191, 189), (r = i);
  35993. continue;
  35994. }
  35995. i = (((r - 55296) << 10) | (i - 56320)) + 65536;
  35996. } else r && (t -= 3) > -1 && o.push(239, 191, 189);
  35997. if (((r = null), i < 128)) {
  35998. if ((t -= 1) < 0) break;
  35999. o.push(i);
  36000. } else if (i < 2048) {
  36001. if ((t -= 2) < 0) break;
  36002. o.push((i >> 6) | 192, (63 & i) | 128);
  36003. } else if (i < 65536) {
  36004. if ((t -= 3) < 0) break;
  36005. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128);
  36006. } else {
  36007. if (!(i < 1114112)) throw new Error('Invalid code point');
  36008. if ((t -= 4) < 0) break;
  36009. o.push(
  36010. (i >> 18) | 240,
  36011. ((i >> 12) & 63) | 128,
  36012. ((i >> 6) & 63) | 128,
  36013. (63 & i) | 128
  36014. );
  36015. }
  36016. }
  36017. return o;
  36018. }
  36019. function Y(e) {
  36020. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i));
  36021. return t;
  36022. }
  36023. function X(e, t) {
  36024. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  36025. (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n);
  36026. return o;
  36027. }
  36028. function Z(e) {
  36029. return Q.toByteArray(G(e));
  36030. }
  36031. function q(e, t, i, n) {
  36032. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r];
  36033. return r;
  36034. }
  36035. function K(e) {
  36036. return e !== e;
  36037. }
  36038. var Q = e('base64-js'),
  36039. J = e('ieee754'),
  36040. $ = e('isarray');
  36041. (i.Buffer = a),
  36042. (i.SlowBuffer = m),
  36043. (i.INSPECT_MAX_BYTES = 50),
  36044. (a.TYPED_ARRAY_SUPPORT =
  36045. void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  36046. (i.kMaxLength = r()),
  36047. (a.poolSize = 8192),
  36048. (a._augment = function (e) {
  36049. return (e.__proto__ = a.prototype), e;
  36050. }),
  36051. (a.from = function (e, t, i) {
  36052. return s(null, e, t, i);
  36053. }),
  36054. a.TYPED_ARRAY_SUPPORT &&
  36055. ((a.prototype.__proto__ = Uint8Array.prototype),
  36056. (a.__proto__ = Uint8Array),
  36057. 'undefined' != typeof Symbol &&
  36058. Symbol.species &&
  36059. a[Symbol.species] === a &&
  36060. Object.defineProperty(a, Symbol.species, {
  36061. value: null,
  36062. configurable: !0,
  36063. })),
  36064. (a.alloc = function (e, t, i) {
  36065. return c(null, e, t, i);
  36066. }),
  36067. (a.allocUnsafe = function (e) {
  36068. return h(null, e);
  36069. }),
  36070. (a.allocUnsafeSlow = function (e) {
  36071. return h(null, e);
  36072. }),
  36073. (a.isBuffer = function (e) {
  36074. return !(null == e || !e._isBuffer);
  36075. }),
  36076. (a.compare = function (e, t) {
  36077. if (!a.isBuffer(e) || !a.isBuffer(t))
  36078. throw new TypeError('Arguments must be Buffers');
  36079. if (e === t) return 0;
  36080. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  36081. if (e[r] !== t[r]) {
  36082. (i = e[r]), (n = t[r]);
  36083. break;
  36084. }
  36085. return i < n ? -1 : n < i ? 1 : 0;
  36086. }),
  36087. (a.isEncoding = function (e) {
  36088. switch (String(e).toLowerCase()) {
  36089. case 'hex':
  36090. case 'utf8':
  36091. case 'utf-8':
  36092. case 'ascii':
  36093. case 'latin1':
  36094. case 'binary':
  36095. case 'base64':
  36096. case 'ucs2':
  36097. case 'ucs-2':
  36098. case 'utf16le':
  36099. case 'utf-16le':
  36100. return !0;
  36101. default:
  36102. return !1;
  36103. }
  36104. }),
  36105. (a.concat = function (e, t) {
  36106. if (!$(e)) throw new TypeError('"list" argument must be an Array of Buffers');
  36107. if (0 === e.length) return a.alloc(0);
  36108. var i;
  36109. if (void 0 === t) for (t = 0, i = 0; i < e.length; ++i) t += e[i].length;
  36110. var n = a.allocUnsafe(t),
  36111. r = 0;
  36112. for (i = 0; i < e.length; ++i) {
  36113. var o = e[i];
  36114. if (!a.isBuffer(o))
  36115. throw new TypeError('"list" argument must be an Array of Buffers');
  36116. o.copy(n, r), (r += o.length);
  36117. }
  36118. return n;
  36119. }),
  36120. (a.byteLength = v),
  36121. (a.prototype._isBuffer = !0),
  36122. (a.prototype.swap16 = function () {
  36123. var e = this.length;
  36124. if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits');
  36125. for (var t = 0; t < e; t += 2) y(this, t, t + 1);
  36126. return this;
  36127. }),
  36128. (a.prototype.swap32 = function () {
  36129. var e = this.length;
  36130. if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits');
  36131. for (var t = 0; t < e; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2);
  36132. return this;
  36133. }),
  36134. (a.prototype.swap64 = function () {
  36135. var e = this.length;
  36136. if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits');
  36137. for (var t = 0; t < e; t += 8)
  36138. y(this, t, t + 7),
  36139. y(this, t + 1, t + 6),
  36140. y(this, t + 2, t + 5),
  36141. y(this, t + 3, t + 4);
  36142. return this;
  36143. }),
  36144. (a.prototype.toString = function () {
  36145. var e = 0 | this.length;
  36146. return 0 === e
  36147. ? ''
  36148. : 0 === arguments.length
  36149. ? M(this, 0, e)
  36150. : A.apply(this, arguments);
  36151. }),
  36152. (a.prototype.equals = function (e) {
  36153. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer');
  36154. return this === e || 0 === a.compare(this, e);
  36155. }),
  36156. (a.prototype.inspect = function () {
  36157. var e = '',
  36158. t = i.INSPECT_MAX_BYTES;
  36159. return (
  36160. this.length > 0 &&
  36161. ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')),
  36162. this.length > t && (e += ' ... ')),
  36163. '<Buffer ' + e + '>'
  36164. );
  36165. }),
  36166. (a.prototype.compare = function (e, t, i, n, r) {
  36167. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer');
  36168. if (
  36169. (void 0 === t && (t = 0),
  36170. void 0 === i && (i = e ? e.length : 0),
  36171. void 0 === n && (n = 0),
  36172. void 0 === r && (r = this.length),
  36173. t < 0 || i > e.length || n < 0 || r > this.length)
  36174. )
  36175. throw new RangeError('out of range index');
  36176. if (n >= r && t >= i) return 0;
  36177. if (n >= r) return -1;
  36178. if (t >= i) return 1;
  36179. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e)) return 0;
  36180. for (
  36181. var o = r - n,
  36182. s = i - t,
  36183. l = Math.min(o, s),
  36184. c = this.slice(n, r),
  36185. h = e.slice(t, i),
  36186. u = 0;
  36187. u < l;
  36188. ++u
  36189. )
  36190. if (c[u] !== h[u]) {
  36191. (o = c[u]), (s = h[u]);
  36192. break;
  36193. }
  36194. return o < s ? -1 : s < o ? 1 : 0;
  36195. }),
  36196. (a.prototype.includes = function (e, t, i) {
  36197. return this.indexOf(e, t, i) !== -1;
  36198. }),
  36199. (a.prototype.indexOf = function (e, t, i) {
  36200. return C(this, e, t, i, !0);
  36201. }),
  36202. (a.prototype.lastIndexOf = function (e, t, i) {
  36203. return C(this, e, t, i, !1);
  36204. }),
  36205. (a.prototype.write = function (e, t, i, n) {
  36206. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0);
  36207. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0);
  36208. else {
  36209. if (!isFinite(t))
  36210. throw new Error(
  36211. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  36212. );
  36213. (t |= 0),
  36214. isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0));
  36215. }
  36216. var r = this.length - t;
  36217. if (
  36218. ((void 0 === i || i > r) && (i = r),
  36219. (e.length > 0 && (i < 0 || t < 0)) || t > this.length)
  36220. )
  36221. throw new RangeError('Attempt to write outside buffer bounds');
  36222. n || (n = 'utf8');
  36223. for (var o = !1; ; )
  36224. switch (n) {
  36225. case 'hex':
  36226. return E(this, e, t, i);
  36227. case 'utf8':
  36228. case 'utf-8':
  36229. return b(this, e, t, i);
  36230. case 'ascii':
  36231. return w(this, e, t, i);
  36232. case 'latin1':
  36233. case 'binary':
  36234. return _(this, e, t, i);
  36235. case 'base64':
  36236. return T(this, e, t, i);
  36237. case 'ucs2':
  36238. case 'ucs-2':
  36239. case 'utf16le':
  36240. case 'utf-16le':
  36241. return x(this, e, t, i);
  36242. default:
  36243. if (o) throw new TypeError('Unknown encoding: ' + n);
  36244. (n = ('' + n).toLowerCase()), (o = !0);
  36245. }
  36246. }),
  36247. (a.prototype.toJSON = function () {
  36248. return {
  36249. type: 'Buffer',
  36250. data: Array.prototype.slice.call(this._arr || this, 0),
  36251. };
  36252. });
  36253. var ee = 4096;
  36254. (a.prototype.slice = function (e, t) {
  36255. var i = this.length;
  36256. (e = ~~e),
  36257. (t = void 0 === t ? i : ~~t),
  36258. e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i),
  36259. t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i),
  36260. t < e && (t = e);
  36261. var n;
  36262. if (a.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)), (n.__proto__ = a.prototype);
  36263. else {
  36264. var r = t - e;
  36265. n = new a(r, void 0);
  36266. for (var o = 0; o < r; ++o) n[o] = this[o + e];
  36267. }
  36268. return n;
  36269. }),
  36270. (a.prototype.readUIntLE = function (e, t, i) {
  36271. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36272. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r;
  36273. return n;
  36274. }),
  36275. (a.prototype.readUIntBE = function (e, t, i) {
  36276. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36277. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); ) n += this[e + --t] * r;
  36278. return n;
  36279. }),
  36280. (a.prototype.readUInt8 = function (e, t) {
  36281. return t || N(e, 1, this.length), this[e];
  36282. }),
  36283. (a.prototype.readUInt16LE = function (e, t) {
  36284. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8);
  36285. }),
  36286. (a.prototype.readUInt16BE = function (e, t) {
  36287. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1];
  36288. }),
  36289. (a.prototype.readUInt32LE = function (e, t) {
  36290. return (
  36291. t || N(e, 4, this.length),
  36292. (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  36293. );
  36294. }),
  36295. (a.prototype.readUInt32BE = function (e, t) {
  36296. return (
  36297. t || N(e, 4, this.length),
  36298. 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  36299. );
  36300. }),
  36301. (a.prototype.readIntLE = function (e, t, i) {
  36302. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36303. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r;
  36304. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n;
  36305. }),
  36306. (a.prototype.readIntBE = function (e, t, i) {
  36307. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36308. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  36309. o += this[e + --n] * r;
  36310. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o;
  36311. }),
  36312. (a.prototype.readInt8 = function (e, t) {
  36313. return t || N(e, 1, this.length), 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e];
  36314. }),
  36315. (a.prototype.readInt16LE = function (e, t) {
  36316. t || N(e, 2, this.length);
  36317. var i = this[e] | (this[e + 1] << 8);
  36318. return 32768 & i ? 4294901760 | i : i;
  36319. }),
  36320. (a.prototype.readInt16BE = function (e, t) {
  36321. t || N(e, 2, this.length);
  36322. var i = this[e + 1] | (this[e] << 8);
  36323. return 32768 & i ? 4294901760 | i : i;
  36324. }),
  36325. (a.prototype.readInt32LE = function (e, t) {
  36326. return (
  36327. t || N(e, 4, this.length),
  36328. this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  36329. );
  36330. }),
  36331. (a.prototype.readInt32BE = function (e, t) {
  36332. return (
  36333. t || N(e, 4, this.length),
  36334. (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  36335. );
  36336. }),
  36337. (a.prototype.readFloatLE = function (e, t) {
  36338. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4);
  36339. }),
  36340. (a.prototype.readFloatBE = function (e, t) {
  36341. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4);
  36342. }),
  36343. (a.prototype.readDoubleLE = function (e, t) {
  36344. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8);
  36345. }),
  36346. (a.prototype.readDoubleBE = function (e, t) {
  36347. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8);
  36348. }),
  36349. (a.prototype.writeUIntLE = function (e, t, i, n) {
  36350. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36351. var r = Math.pow(2, 8 * i) - 1;
  36352. B(this, e, t, i, r, 0);
  36353. }
  36354. var o = 1,
  36355. a = 0;
  36356. for (this[t] = 255 & e; ++a < i && (o *= 256); ) this[t + a] = (e / o) & 255;
  36357. return t + i;
  36358. }),
  36359. (a.prototype.writeUIntBE = function (e, t, i, n) {
  36360. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36361. var r = Math.pow(2, 8 * i) - 1;
  36362. B(this, e, t, i, r, 0);
  36363. }
  36364. var o = i - 1,
  36365. a = 1;
  36366. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) this[t + o] = (e / a) & 255;
  36367. return t + i;
  36368. }),
  36369. (a.prototype.writeUInt8 = function (e, t, i) {
  36370. return (
  36371. (e = +e),
  36372. (t |= 0),
  36373. i || B(this, e, t, 1, 255, 0),
  36374. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36375. (this[t] = 255 & e),
  36376. t + 1
  36377. );
  36378. }),
  36379. (a.prototype.writeUInt16LE = function (e, t, i) {
  36380. return (
  36381. (e = +e),
  36382. (t |= 0),
  36383. i || B(this, e, t, 2, 65535, 0),
  36384. a.TYPED_ARRAY_SUPPORT
  36385. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36386. : F(this, e, t, !0),
  36387. t + 2
  36388. );
  36389. }),
  36390. (a.prototype.writeUInt16BE = function (e, t, i) {
  36391. return (
  36392. (e = +e),
  36393. (t |= 0),
  36394. i || B(this, e, t, 2, 65535, 0),
  36395. a.TYPED_ARRAY_SUPPORT
  36396. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36397. : F(this, e, t, !1),
  36398. t + 2
  36399. );
  36400. }),
  36401. (a.prototype.writeUInt32LE = function (e, t, i) {
  36402. return (
  36403. (e = +e),
  36404. (t |= 0),
  36405. i || B(this, e, t, 4, 4294967295, 0),
  36406. a.TYPED_ARRAY_SUPPORT
  36407. ? ((this[t + 3] = e >>> 24),
  36408. (this[t + 2] = e >>> 16),
  36409. (this[t + 1] = e >>> 8),
  36410. (this[t] = 255 & e))
  36411. : V(this, e, t, !0),
  36412. t + 4
  36413. );
  36414. }),
  36415. (a.prototype.writeUInt32BE = function (e, t, i) {
  36416. return (
  36417. (e = +e),
  36418. (t |= 0),
  36419. i || B(this, e, t, 4, 4294967295, 0),
  36420. a.TYPED_ARRAY_SUPPORT
  36421. ? ((this[t] = e >>> 24),
  36422. (this[t + 1] = e >>> 16),
  36423. (this[t + 2] = e >>> 8),
  36424. (this[t + 3] = 255 & e))
  36425. : V(this, e, t, !1),
  36426. t + 4
  36427. );
  36428. }),
  36429. (a.prototype.writeIntLE = function (e, t, i, n) {
  36430. if (((e = +e), (t |= 0), !n)) {
  36431. var r = Math.pow(2, 8 * i - 1);
  36432. B(this, e, t, i, r - 1, -r);
  36433. }
  36434. var o = 0,
  36435. a = 1,
  36436. s = 0;
  36437. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  36438. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  36439. (this[t + o] = (((e / a) >> 0) - s) & 255);
  36440. return t + i;
  36441. }),
  36442. (a.prototype.writeIntBE = function (e, t, i, n) {
  36443. if (((e = +e), (t |= 0), !n)) {
  36444. var r = Math.pow(2, 8 * i - 1);
  36445. B(this, e, t, i, r - 1, -r);
  36446. }
  36447. var o = i - 1,
  36448. a = 1,
  36449. s = 0;
  36450. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  36451. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  36452. (this[t + o] = (((e / a) >> 0) - s) & 255);
  36453. return t + i;
  36454. }),
  36455. (a.prototype.writeInt8 = function (e, t, i) {
  36456. return (
  36457. (e = +e),
  36458. (t |= 0),
  36459. i || B(this, e, t, 1, 127, -128),
  36460. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36461. e < 0 && (e = 255 + e + 1),
  36462. (this[t] = 255 & e),
  36463. t + 1
  36464. );
  36465. }),
  36466. (a.prototype.writeInt16LE = function (e, t, i) {
  36467. return (
  36468. (e = +e),
  36469. (t |= 0),
  36470. i || B(this, e, t, 2, 32767, -32768),
  36471. a.TYPED_ARRAY_SUPPORT
  36472. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36473. : F(this, e, t, !0),
  36474. t + 2
  36475. );
  36476. }),
  36477. (a.prototype.writeInt16BE = function (e, t, i) {
  36478. return (
  36479. (e = +e),
  36480. (t |= 0),
  36481. i || B(this, e, t, 2, 32767, -32768),
  36482. a.TYPED_ARRAY_SUPPORT
  36483. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36484. : F(this, e, t, !1),
  36485. t + 2
  36486. );
  36487. }),
  36488. (a.prototype.writeInt32LE = function (e, t, i) {
  36489. return (
  36490. (e = +e),
  36491. (t |= 0),
  36492. i || B(this, e, t, 4, 2147483647, -2147483648),
  36493. a.TYPED_ARRAY_SUPPORT
  36494. ? ((this[t] = 255 & e),
  36495. (this[t + 1] = e >>> 8),
  36496. (this[t + 2] = e >>> 16),
  36497. (this[t + 3] = e >>> 24))
  36498. : V(this, e, t, !0),
  36499. t + 4
  36500. );
  36501. }),
  36502. (a.prototype.writeInt32BE = function (e, t, i) {
  36503. return (
  36504. (e = +e),
  36505. (t |= 0),
  36506. i || B(this, e, t, 4, 2147483647, -2147483648),
  36507. e < 0 && (e = 4294967295 + e + 1),
  36508. a.TYPED_ARRAY_SUPPORT
  36509. ? ((this[t] = e >>> 24),
  36510. (this[t + 1] = e >>> 16),
  36511. (this[t + 2] = e >>> 8),
  36512. (this[t + 3] = 255 & e))
  36513. : V(this, e, t, !1),
  36514. t + 4
  36515. );
  36516. }),
  36517. (a.prototype.writeFloatLE = function (e, t, i) {
  36518. return k(this, e, t, !0, i);
  36519. }),
  36520. (a.prototype.writeFloatBE = function (e, t, i) {
  36521. return k(this, e, t, !1, i);
  36522. }),
  36523. (a.prototype.writeDoubleLE = function (e, t, i) {
  36524. return H(this, e, t, !0, i);
  36525. }),
  36526. (a.prototype.writeDoubleBE = function (e, t, i) {
  36527. return H(this, e, t, !1, i);
  36528. }),
  36529. (a.prototype.copy = function (e, t, i, n) {
  36530. if (
  36531. (i || (i = 0),
  36532. n || 0 === n || (n = this.length),
  36533. t >= e.length && (t = e.length),
  36534. t || (t = 0),
  36535. n > 0 && n < i && (n = i),
  36536. n === i)
  36537. )
  36538. return 0;
  36539. if (0 === e.length || 0 === this.length) return 0;
  36540. if (t < 0) throw new RangeError('targetStart out of bounds');
  36541. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds');
  36542. if (n < 0) throw new RangeError('sourceEnd out of bounds');
  36543. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i);
  36544. var r,
  36545. o = n - i;
  36546. if (this === e && i < t && t < n) for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i];
  36547. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  36548. for (r = 0; r < o; ++r) e[r + t] = this[r + i];
  36549. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  36550. return o;
  36551. }),
  36552. (a.prototype.fill = function (e, t, i, n) {
  36553. if ('string' == typeof e) {
  36554. if (
  36555. ('string' == typeof t
  36556. ? ((n = t), (t = 0), (i = this.length))
  36557. : 'string' == typeof i && ((n = i), (i = this.length)),
  36558. 1 === e.length)
  36559. ) {
  36560. var r = e.charCodeAt(0);
  36561. r < 256 && (e = r);
  36562. }
  36563. if (void 0 !== n && 'string' != typeof n)
  36564. throw new TypeError('encoding must be a string');
  36565. if ('string' == typeof n && !a.isEncoding(n))
  36566. throw new TypeError('Unknown encoding: ' + n);
  36567. } else 'number' == typeof e && (e &= 255);
  36568. if (t < 0 || this.length < t || this.length < i)
  36569. throw new RangeError('Out of range index');
  36570. if (i <= t) return this;
  36571. (t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), e || (e = 0);
  36572. var o;
  36573. if ('number' == typeof e) for (o = t; o < i; ++o) this[o] = e;
  36574. else {
  36575. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  36576. l = s.length;
  36577. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l];
  36578. }
  36579. return this;
  36580. });
  36581. var te = /[^+\/0-9A-Za-z-_]/g;
  36582. }.call(
  36583. this,
  36584. 'undefined' != typeof global
  36585. ? global
  36586. : 'undefined' != typeof self
  36587. ? self
  36588. : 'undefined' != typeof window
  36589. ? window
  36590. : {}
  36591. ));
  36592. },
  36593. {
  36594. 'base64-js': 199,
  36595. ieee754: 200,
  36596. isarray: 201,
  36597. },
  36598. ],
  36599. 199: [
  36600. function (e, t, i) {
  36601. 'use strict';
  36602. function n(e) {
  36603. var t = e.length;
  36604. if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4');
  36605. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0;
  36606. }
  36607. function r(e) {
  36608. return (3 * e.length) / 4 - n(e);
  36609. }
  36610. function o(e) {
  36611. var t,
  36612. i,
  36613. r,
  36614. o,
  36615. a,
  36616. s,
  36617. l = e.length;
  36618. (a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l);
  36619. var c = 0;
  36620. for (t = 0, i = 0; t < r; t += 4, i += 3)
  36621. (o =
  36622. (h[e.charCodeAt(t)] << 18) |
  36623. (h[e.charCodeAt(t + 1)] << 12) |
  36624. (h[e.charCodeAt(t + 2)] << 6) |
  36625. h[e.charCodeAt(t + 3)]),
  36626. (s[c++] = (o >> 16) & 255),
  36627. (s[c++] = (o >> 8) & 255),
  36628. (s[c++] = 255 & o);
  36629. return (
  36630. 2 === a
  36631. ? ((o = (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)),
  36632. (s[c++] = 255 & o))
  36633. : 1 === a &&
  36634. ((o =
  36635. (h[e.charCodeAt(t)] << 10) |
  36636. (h[e.charCodeAt(t + 1)] << 4) |
  36637. (h[e.charCodeAt(t + 2)] >> 2)),
  36638. (s[c++] = (o >> 8) & 255),
  36639. (s[c++] = 255 & o)),
  36640. s
  36641. );
  36642. }
  36643. function a(e) {
  36644. return c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e];
  36645. }
  36646. function s(e, t, i) {
  36647. for (var n, r = [], o = t; o < i; o += 3)
  36648. (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n));
  36649. return r.join('');
  36650. }
  36651. function l(e) {
  36652. for (
  36653. var t, i = e.length, n = i % 3, r = '', o = [], a = 16383, l = 0, h = i - n;
  36654. l < h;
  36655. l += a
  36656. )
  36657. o.push(s(e, l, l + a > h ? h : l + a));
  36658. return (
  36659. 1 === n
  36660. ? ((t = e[i - 1]), (r += c[t >> 2]), (r += c[(t << 4) & 63]), (r += '=='))
  36661. : 2 === n &&
  36662. ((t = (e[i - 2] << 8) + e[i - 1]),
  36663. (r += c[t >> 10]),
  36664. (r += c[(t >> 4) & 63]),
  36665. (r += c[(t << 2) & 63]),
  36666. (r += '=')),
  36667. o.push(r),
  36668. o.join('')
  36669. );
  36670. }
  36671. (i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l);
  36672. for (
  36673. var c = [],
  36674. h = [],
  36675. u = 'undefined' != typeof Uint8Array ? Uint8Array : Array,
  36676. d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
  36677. p = 0,
  36678. f = d.length;
  36679. p < f;
  36680. ++p
  36681. )
  36682. (c[p] = d[p]), (h[d.charCodeAt(p)] = p);
  36683. (h['-'.charCodeAt(0)] = 62), (h['_'.charCodeAt(0)] = 63);
  36684. },
  36685. {},
  36686. ],
  36687. 200: [
  36688. function (e, t, i) {
  36689. (i.read = function (e, t, i, n, r) {
  36690. var o,
  36691. a,
  36692. s = 8 * r - n - 1,
  36693. l = (1 << s) - 1,
  36694. c = l >> 1,
  36695. h = -7,
  36696. u = i ? r - 1 : 0,
  36697. d = i ? -1 : 1,
  36698. p = e[t + u];
  36699. for (
  36700. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  36701. h > 0;
  36702. o = 256 * o + e[t + u], u += d, h -= 8
  36703. );
  36704. for (
  36705. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  36706. h > 0;
  36707. a = 256 * a + e[t + u], u += d, h -= 8
  36708. );
  36709. if (0 === o) o = 1 - c;
  36710. else {
  36711. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36712. (a += Math.pow(2, n)), (o -= c);
  36713. }
  36714. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  36715. }),
  36716. (i.write = function (e, t, i, n, r, o) {
  36717. var a,
  36718. s,
  36719. l,
  36720. c = 8 * o - r - 1,
  36721. h = (1 << c) - 1,
  36722. u = h >> 1,
  36723. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  36724. p = n ? 0 : o - 1,
  36725. f = n ? 1 : -1,
  36726. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  36727. for (
  36728. t = Math.abs(t),
  36729. isNaN(t) || t === 1 / 0
  36730. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  36731. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  36732. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  36733. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  36734. t * l >= 2 && (a++, (l /= 2)),
  36735. a + u >= h
  36736. ? ((s = 0), (a = h))
  36737. : a + u >= 1
  36738. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  36739. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  36740. r >= 8;
  36741. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  36742. );
  36743. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  36744. e[i + p - f] |= 128 * g;
  36745. });
  36746. },
  36747. {},
  36748. ],
  36749. 201: [
  36750. function (e, t, i) {
  36751. var n = {}.toString;
  36752. t.exports =
  36753. Array.isArray ||
  36754. function (e) {
  36755. return '[object Array]' == n.call(e);
  36756. };
  36757. },
  36758. {},
  36759. ],
  36760. 202: [
  36761. function (e, t, i) {
  36762. function n() {
  36763. (this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0);
  36764. }
  36765. function r(e) {
  36766. return 'function' == typeof e;
  36767. }
  36768. function o(e) {
  36769. return 'number' == typeof e;
  36770. }
  36771. function a(e) {
  36772. return 'object' == typeof e && null !== e;
  36773. }
  36774. function s(e) {
  36775. return void 0 === e;
  36776. }
  36777. (t.exports = n),
  36778. (n.EventEmitter = n),
  36779. (n.prototype._events = void 0),
  36780. (n.prototype._maxListeners = void 0),
  36781. (n.defaultMaxListeners = 10),
  36782. (n.prototype.setMaxListeners = function (e) {
  36783. if (!o(e) || e < 0 || isNaN(e)) throw TypeError('n must be a positive number');
  36784. return (this._maxListeners = e), this;
  36785. }),
  36786. (n.prototype.emit = function (e) {
  36787. var t, i, n, o, l, c;
  36788. if (
  36789. (this._events || (this._events = {}),
  36790. 'error' === e &&
  36791. (!this._events.error || (a(this._events.error) && !this._events.error.length)))
  36792. ) {
  36793. if (((t = arguments[1]), t instanceof Error)) throw t;
  36794. var h = new Error('Uncaught, unspecified "error" event. (' + t + ')');
  36795. throw ((h.context = t), h);
  36796. }
  36797. if (((i = this._events[e]), s(i))) return !1;
  36798. if (r(i))
  36799. switch (arguments.length) {
  36800. case 1:
  36801. i.call(this);
  36802. break;
  36803. case 2:
  36804. i.call(this, arguments[1]);
  36805. break;
  36806. case 3:
  36807. i.call(this, arguments[1], arguments[2]);
  36808. break;
  36809. default:
  36810. (o = Array.prototype.slice.call(arguments, 1)), i.apply(this, o);
  36811. }
  36812. else if (a(i))
  36813. for (
  36814. o = Array.prototype.slice.call(arguments, 1), c = i.slice(), n = c.length, l = 0;
  36815. l < n;
  36816. l++
  36817. )
  36818. c[l].apply(this, o);
  36819. return !0;
  36820. }),
  36821. (n.prototype.addListener = function (e, t) {
  36822. var i;
  36823. if (!r(t)) throw TypeError('listener must be a function');
  36824. return (
  36825. this._events || (this._events = {}),
  36826. this._events.newListener &&
  36827. this.emit('newListener', e, r(t.listener) ? t.listener : t),
  36828. this._events[e]
  36829. ? a(this._events[e])
  36830. ? this._events[e].push(t)
  36831. : (this._events[e] = [this._events[e], t])
  36832. : (this._events[e] = t),
  36833. a(this._events[e]) &&
  36834. !this._events[e].warned &&
  36835. ((i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners),
  36836. i &&
  36837. i > 0 &&
  36838. this._events[e].length > i &&
  36839. ((this._events[e].warned = !0),
  36840. console.error(
  36841. '(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.',
  36842. this._events[e].length
  36843. ),
  36844. 'function' == typeof console.trace && console.trace())),
  36845. this
  36846. );
  36847. }),
  36848. (n.prototype.on = n.prototype.addListener),
  36849. (n.prototype.once = function (e, t) {
  36850. function i() {
  36851. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments));
  36852. }
  36853. if (!r(t)) throw TypeError('listener must be a function');
  36854. var n = !1;
  36855. return (i.listener = t), this.on(e, i), this;
  36856. }),
  36857. (n.prototype.removeListener = function (e, t) {
  36858. var i, n, o, s;
  36859. if (!r(t)) throw TypeError('listener must be a function');
  36860. if (!this._events || !this._events[e]) return this;
  36861. if (
  36862. ((i = this._events[e]),
  36863. (o = i.length),
  36864. (n = -1),
  36865. i === t || (r(i.listener) && i.listener === t))
  36866. )
  36867. delete this._events[e],
  36868. this._events.removeListener && this.emit('removeListener', e, t);
  36869. else if (a(i)) {
  36870. for (s = o; s-- > 0; )
  36871. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  36872. n = s;
  36873. break;
  36874. }
  36875. if (n < 0) return this;
  36876. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1),
  36877. this._events.removeListener && this.emit('removeListener', e, t);
  36878. }
  36879. return this;
  36880. }),
  36881. (n.prototype.removeAllListeners = function (e) {
  36882. var t, i;
  36883. if (!this._events) return this;
  36884. if (!this._events.removeListener)
  36885. return (
  36886. 0 === arguments.length
  36887. ? (this._events = {})
  36888. : this._events[e] && delete this._events[e],
  36889. this
  36890. );
  36891. if (0 === arguments.length) {
  36892. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t);
  36893. return this.removeAllListeners('removeListener'), (this._events = {}), this;
  36894. }
  36895. if (((i = this._events[e]), r(i))) this.removeListener(e, i);
  36896. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1]);
  36897. return delete this._events[e], this;
  36898. }),
  36899. (n.prototype.listeners = function (e) {
  36900. var t;
  36901. return (t =
  36902. this._events && this._events[e]
  36903. ? r(this._events[e])
  36904. ? [this._events[e]]
  36905. : this._events[e].slice()
  36906. : []);
  36907. }),
  36908. (n.prototype.listenerCount = function (e) {
  36909. if (this._events) {
  36910. var t = this._events[e];
  36911. if (r(t)) return 1;
  36912. if (t) return t.length;
  36913. }
  36914. return 0;
  36915. }),
  36916. (n.listenerCount = function (e, t) {
  36917. return e.listenerCount(t);
  36918. });
  36919. },
  36920. {},
  36921. ],
  36922. 203: [
  36923. function (e, t, i) {
  36924. function n() {
  36925. throw new Error('setTimeout has not been defined');
  36926. }
  36927. function r() {
  36928. throw new Error('clearTimeout has not been defined');
  36929. }
  36930. function o(e) {
  36931. if (u === setTimeout) return setTimeout(e, 0);
  36932. if ((u === n || !u) && setTimeout) return (u = setTimeout), setTimeout(e, 0);
  36933. try {
  36934. return u(e, 0);
  36935. } catch (t) {
  36936. try {
  36937. return u.call(null, e, 0);
  36938. } catch (t) {
  36939. return u.call(this, e, 0);
  36940. }
  36941. }
  36942. }
  36943. function a(e) {
  36944. if (d === clearTimeout) return clearTimeout(e);
  36945. if ((d === r || !d) && clearTimeout) return (d = clearTimeout), clearTimeout(e);
  36946. try {
  36947. return d(e);
  36948. } catch (t) {
  36949. try {
  36950. return d.call(null, e);
  36951. } catch (t) {
  36952. return d.call(this, e);
  36953. }
  36954. }
  36955. }
  36956. function s() {
  36957. m && f && ((m = !1), f.length ? (g = f.concat(g)) : (v = -1), g.length && l());
  36958. }
  36959. function l() {
  36960. if (!m) {
  36961. var e = o(s);
  36962. m = !0;
  36963. for (var t = g.length; t; ) {
  36964. for (f = g, g = []; ++v < t; ) f && f[v].run();
  36965. (v = -1), (t = g.length);
  36966. }
  36967. (f = null), (m = !1), a(e);
  36968. }
  36969. }
  36970. function c(e, t) {
  36971. (this.fun = e), (this.array = t);
  36972. }
  36973. function h() {}
  36974. var u,
  36975. d,
  36976. p = (t.exports = {});
  36977. !(function () {
  36978. try {
  36979. u = 'function' == typeof setTimeout ? setTimeout : n;
  36980. } catch (e) {
  36981. u = n;
  36982. }
  36983. try {
  36984. d = 'function' == typeof clearTimeout ? clearTimeout : r;
  36985. } catch (e) {
  36986. d = r;
  36987. }
  36988. })();
  36989. var f,
  36990. g = [],
  36991. m = !1,
  36992. v = -1;
  36993. (p.nextTick = function (e) {
  36994. var t = new Array(arguments.length - 1);
  36995. if (arguments.length > 1)
  36996. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
  36997. g.push(new c(e, t)), 1 !== g.length || m || o(l);
  36998. }),
  36999. (c.prototype.run = function () {
  37000. this.fun.apply(null, this.array);
  37001. }),
  37002. (p.title = 'browser'),
  37003. (p.browser = !0),
  37004. (p.env = {}),
  37005. (p.argv = []),
  37006. (p.version = ''),
  37007. (p.versions = {}),
  37008. (p.on = h),
  37009. (p.addListener = h),
  37010. (p.once = h),
  37011. (p.off = h),
  37012. (p.removeListener = h),
  37013. (p.removeAllListeners = h),
  37014. (p.emit = h),
  37015. (p.binding = function (e) {
  37016. throw new Error('process.binding is not supported');
  37017. }),
  37018. (p.cwd = function () {
  37019. return '/';
  37020. }),
  37021. (p.chdir = function (e) {
  37022. throw new Error('process.chdir is not supported');
  37023. }),
  37024. (p.umask = function () {
  37025. return 0;
  37026. });
  37027. },
  37028. {},
  37029. ],
  37030. 204: [
  37031. function (e, t, i) {
  37032. (function (e) {
  37033. !(function (n) {
  37034. function r(e) {
  37035. throw new RangeError(L[e]);
  37036. }
  37037. function o(e, t) {
  37038. for (var i = e.length, n = []; i--; ) n[i] = t(e[i]);
  37039. return n;
  37040. }
  37041. function a(e, t) {
  37042. var i = e.split('@'),
  37043. n = '';
  37044. i.length > 1 && ((n = i[0] + '@'), (e = i[1])), (e = e.replace(O, '.'));
  37045. var r = e.split('.'),
  37046. a = o(r, t).join('.');
  37047. return n + a;
  37048. }
  37049. function s(e) {
  37050. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  37051. (t = e.charCodeAt(r++)),
  37052. t >= 55296 && t <= 56319 && r < o
  37053. ? ((i = e.charCodeAt(r++)),
  37054. 56320 == (64512 & i)
  37055. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  37056. : (n.push(t), r--))
  37057. : n.push(t);
  37058. return n;
  37059. }
  37060. function l(e) {
  37061. return o(e, function (e) {
  37062. var t = '';
  37063. return (
  37064. e > 65535 &&
  37065. ((e -= 65536), (t += B(((e >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))),
  37066. (t += B(e))
  37067. );
  37068. }).join('');
  37069. }
  37070. function c(e) {
  37071. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E;
  37072. }
  37073. function h(e, t) {
  37074. return e + 22 + 75 * (e < 26) - ((0 != t) << 5);
  37075. }
  37076. function u(e, t, i) {
  37077. var n = 0;
  37078. for (e = i ? N(e / T) : e >> 1, e += N(e / t); e > (D * w) >> 1; n += E) e = N(e / D);
  37079. return N(n + ((D + 1) * e) / (e + _));
  37080. }
  37081. function d(e) {
  37082. var t,
  37083. i,
  37084. n,
  37085. o,
  37086. a,
  37087. s,
  37088. h,
  37089. d,
  37090. p,
  37091. f,
  37092. g = [],
  37093. m = e.length,
  37094. v = 0,
  37095. A = S,
  37096. y = x;
  37097. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n)
  37098. e.charCodeAt(n) >= 128 && r('not-basic'), g.push(e.charCodeAt(n));
  37099. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  37100. for (
  37101. a = v, s = 1, h = E;
  37102. o >= m && r('invalid-input'),
  37103. (d = c(e.charCodeAt(o++))),
  37104. (d >= E || d > N((I - v) / s)) && r('overflow'),
  37105. (v += d * s),
  37106. (p = h <= y ? b : h >= y + w ? w : h - y),
  37107. !(d < p);
  37108. h += E
  37109. )
  37110. (f = E - p), s > N(I / f) && r('overflow'), (s *= f);
  37111. (t = g.length + 1),
  37112. (y = u(v - a, t, 0 == a)),
  37113. N(v / t) > I - A && r('overflow'),
  37114. (A += N(v / t)),
  37115. (v %= t),
  37116. g.splice(v++, 0, A);
  37117. }
  37118. return l(g);
  37119. }
  37120. function p(e) {
  37121. var t,
  37122. i,
  37123. n,
  37124. o,
  37125. a,
  37126. l,
  37127. c,
  37128. d,
  37129. p,
  37130. f,
  37131. g,
  37132. m,
  37133. v,
  37134. A,
  37135. y,
  37136. C = [];
  37137. for (e = s(e), m = e.length, t = S, i = 0, a = x, l = 0; l < m; ++l)
  37138. (g = e[l]), g < 128 && C.push(B(g));
  37139. for (n = o = C.length, o && C.push(M); n < m; ) {
  37140. for (c = I, l = 0; l < m; ++l) (g = e[l]), g >= t && g < c && (c = g);
  37141. for (
  37142. v = n + 1,
  37143. c - t > N((I - i) / v) && r('overflow'),
  37144. i += (c - t) * v,
  37145. t = c,
  37146. l = 0;
  37147. l < m;
  37148. ++l
  37149. )
  37150. if (((g = e[l]), g < t && ++i > I && r('overflow'), g == t)) {
  37151. for (d = i, p = E; (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f); p += E)
  37152. (y = d - f), (A = E - f), C.push(B(h(f + (y % A), 0))), (d = N(y / A));
  37153. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n;
  37154. }
  37155. ++i, ++t;
  37156. }
  37157. return C.join('');
  37158. }
  37159. function f(e) {
  37160. return a(e, function (e) {
  37161. return R.test(e) ? d(e.slice(4).toLowerCase()) : e;
  37162. });
  37163. }
  37164. function g(e) {
  37165. return a(e, function (e) {
  37166. return P.test(e) ? 'xn--' + p(e) : e;
  37167. });
  37168. }
  37169. var m = 'object' == typeof i && i && !i.nodeType && i,
  37170. v = 'object' == typeof t && t && !t.nodeType && t,
  37171. A = 'object' == typeof e && e;
  37172. (A.global !== A && A.window !== A && A.self !== A) || (n = A);
  37173. var y,
  37174. C,
  37175. I = 2147483647,
  37176. E = 36,
  37177. b = 1,
  37178. w = 26,
  37179. _ = 38,
  37180. T = 700,
  37181. x = 72,
  37182. S = 128,
  37183. M = '-',
  37184. R = /^xn--/,
  37185. P = /[^\x20-\x7E]/,
  37186. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  37187. L = {
  37188. overflow: 'Overflow: input needs wider integers to process',
  37189. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  37190. 'invalid-input': 'Invalid input',
  37191. },
  37192. D = E - b,
  37193. N = Math.floor,
  37194. B = String.fromCharCode;
  37195. if (
  37196. ((y = {
  37197. version: '1.4.1',
  37198. ucs2: {
  37199. decode: s,
  37200. encode: l,
  37201. },
  37202. decode: d,
  37203. encode: p,
  37204. toASCII: g,
  37205. toUnicode: f,
  37206. }),
  37207. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  37208. )
  37209. define('punycode', function () {
  37210. return y;
  37211. });
  37212. else if (m && v)
  37213. if (t.exports == m) v.exports = y;
  37214. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C]);
  37215. else n.punycode = y;
  37216. })(this);
  37217. }.call(
  37218. this,
  37219. 'undefined' != typeof global
  37220. ? global
  37221. : 'undefined' != typeof self
  37222. ? self
  37223. : 'undefined' != typeof window
  37224. ? window
  37225. : {}
  37226. ));
  37227. },
  37228. {},
  37229. ],
  37230. 205: [
  37231. function (e, t, i) {
  37232. 'use strict';
  37233. function n(e, t) {
  37234. return Object.prototype.hasOwnProperty.call(e, t);
  37235. }
  37236. t.exports = function (e, t, i, o) {
  37237. (t = t || '&'), (i = i || '=');
  37238. var a = {};
  37239. if ('string' != typeof e || 0 === e.length) return a;
  37240. var s = /\+/g;
  37241. e = e.split(t);
  37242. var l = 1e3;
  37243. o && 'number' == typeof o.maxKeys && (l = o.maxKeys);
  37244. var c = e.length;
  37245. l > 0 && c > l && (c = l);
  37246. for (var h = 0; h < c; ++h) {
  37247. var u,
  37248. d,
  37249. p,
  37250. f,
  37251. g = e[h].replace(s, '%20'),
  37252. m = g.indexOf(i);
  37253. m >= 0 ? ((u = g.substr(0, m)), (d = g.substr(m + 1))) : ((u = g), (d = '')),
  37254. (p = decodeURIComponent(u)),
  37255. (f = decodeURIComponent(d)),
  37256. n(a, p) ? (r(a[p]) ? a[p].push(f) : (a[p] = [a[p], f])) : (a[p] = f);
  37257. }
  37258. return a;
  37259. };
  37260. var r =
  37261. Array.isArray ||
  37262. function (e) {
  37263. return '[object Array]' === Object.prototype.toString.call(e);
  37264. };
  37265. },
  37266. {},
  37267. ],
  37268. 206: [
  37269. function (e, t, i) {
  37270. 'use strict';
  37271. function n(e, t) {
  37272. if (e.map) return e.map(t);
  37273. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n));
  37274. return i;
  37275. }
  37276. var r = function (e) {
  37277. switch (typeof e) {
  37278. case 'string':
  37279. return e;
  37280. case 'boolean':
  37281. return e ? 'true' : 'false';
  37282. case 'number':
  37283. return isFinite(e) ? e : '';
  37284. default:
  37285. return '';
  37286. }
  37287. };
  37288. t.exports = function (e, t, i, s) {
  37289. return (
  37290. (t = t || '&'),
  37291. (i = i || '='),
  37292. null === e && (e = void 0),
  37293. 'object' == typeof e
  37294. ? n(a(e), function (a) {
  37295. var s = encodeURIComponent(r(a)) + i;
  37296. return o(e[a])
  37297. ? n(e[a], function (e) {
  37298. return s + encodeURIComponent(r(e));
  37299. }).join(t)
  37300. : s + encodeURIComponent(r(e[a]));
  37301. }).join(t)
  37302. : s
  37303. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  37304. : ''
  37305. );
  37306. };
  37307. var o =
  37308. Array.isArray ||
  37309. function (e) {
  37310. return '[object Array]' === Object.prototype.toString.call(e);
  37311. },
  37312. a =
  37313. Object.keys ||
  37314. function (e) {
  37315. var t = [];
  37316. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  37317. return t;
  37318. };
  37319. },
  37320. {},
  37321. ],
  37322. 207: [
  37323. function (e, t, i) {
  37324. 'use strict';
  37325. (i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'));
  37326. },
  37327. {
  37328. './decode': 205,
  37329. './encode': 206,
  37330. },
  37331. ],
  37332. 208: [
  37333. function (e, t, i) {
  37334. 'use strict';
  37335. function n() {
  37336. (this.protocol = null),
  37337. (this.slashes = null),
  37338. (this.auth = null),
  37339. (this.host = null),
  37340. (this.port = null),
  37341. (this.hostname = null),
  37342. (this.hash = null),
  37343. (this.search = null),
  37344. (this.query = null),
  37345. (this.pathname = null),
  37346. (this.path = null),
  37347. (this.href = null);
  37348. }
  37349. function r(e, t, i) {
  37350. if (e && c.isObject(e) && e instanceof n) return e;
  37351. var r = new n();
  37352. return r.parse(e, t, i), r;
  37353. }
  37354. function o(e) {
  37355. return (
  37356. c.isString(e) && (e = r(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
  37357. );
  37358. }
  37359. function a(e, t) {
  37360. return r(e, !1, !0).resolve(t);
  37361. }
  37362. function s(e, t) {
  37363. return e ? r(e, !1, !0).resolveObject(t) : t;
  37364. }
  37365. var l = e('punycode'),
  37366. c = e('./util');
  37367. (i.parse = r), (i.resolve = a), (i.resolveObject = s), (i.format = o), (i.Url = n);
  37368. var h = /^([a-z0-9.+-]+:)/i,
  37369. u = /:[0-9]*$/,
  37370. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  37371. p = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  37372. f = ['{', '}', '|', '\\', '^', '`'].concat(p),
  37373. g = ["'"].concat(f),
  37374. m = ['%', '/', '?', ';', '#'].concat(g),
  37375. v = ['/', '?', '#'],
  37376. A = 255,
  37377. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  37378. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  37379. I = {
  37380. javascript: !0,
  37381. 'javascript:': !0,
  37382. },
  37383. E = {
  37384. javascript: !0,
  37385. 'javascript:': !0,
  37386. },
  37387. b = {
  37388. http: !0,
  37389. https: !0,
  37390. ftp: !0,
  37391. gopher: !0,
  37392. file: !0,
  37393. 'http:': !0,
  37394. 'https:': !0,
  37395. 'ftp:': !0,
  37396. 'gopher:': !0,
  37397. 'file:': !0,
  37398. },
  37399. w = e('querystring');
  37400. (n.prototype.parse = function (e, t, i) {
  37401. if (!c.isString(e))
  37402. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  37403. var n = e.indexOf('?'),
  37404. r = n !== -1 && n < e.indexOf('#') ? '?' : '#',
  37405. o = e.split(r),
  37406. a = /\\/g;
  37407. (o[0] = o[0].replace(a, '/')), (e = o.join(r));
  37408. var s = e;
  37409. if (((s = s.trim()), !i && 1 === e.split('#').length)) {
  37410. var u = d.exec(s);
  37411. if (u)
  37412. return (
  37413. (this.path = s),
  37414. (this.href = s),
  37415. (this.pathname = u[1]),
  37416. u[2]
  37417. ? ((this.search = u[2]),
  37418. t
  37419. ? (this.query = w.parse(this.search.substr(1)))
  37420. : (this.query = this.search.substr(1)))
  37421. : t && ((this.search = ''), (this.query = {})),
  37422. this
  37423. );
  37424. }
  37425. var p = h.exec(s);
  37426. if (p) {
  37427. p = p[0];
  37428. var f = p.toLowerCase();
  37429. (this.protocol = f), (s = s.substr(p.length));
  37430. }
  37431. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  37432. var _ = '//' === s.substr(0, 2);
  37433. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0));
  37434. }
  37435. if (!E[p] && (_ || (p && !b[p]))) {
  37436. for (var T = -1, x = 0; x < v.length; x++) {
  37437. var S = s.indexOf(v[x]);
  37438. S !== -1 && (T === -1 || S < T) && (T = S);
  37439. }
  37440. var M, R;
  37441. (R = T === -1 ? s.lastIndexOf('@') : s.lastIndexOf('@', T)),
  37442. R !== -1 &&
  37443. ((M = s.slice(0, R)), (s = s.slice(R + 1)), (this.auth = decodeURIComponent(M))),
  37444. (T = -1);
  37445. for (var x = 0; x < m.length; x++) {
  37446. var S = s.indexOf(m[x]);
  37447. S !== -1 && (T === -1 || S < T) && (T = S);
  37448. }
  37449. T === -1 && (T = s.length),
  37450. (this.host = s.slice(0, T)),
  37451. (s = s.slice(T)),
  37452. this.parseHost(),
  37453. (this.hostname = this.hostname || '');
  37454. var P = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1];
  37455. if (!P)
  37456. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  37457. var D = O[x];
  37458. if (D && !D.match(y)) {
  37459. for (var N = '', B = 0, F = D.length; B < F; B++)
  37460. N += D.charCodeAt(B) > 127 ? 'x' : D[B];
  37461. if (!N.match(y)) {
  37462. var V = O.slice(0, x),
  37463. U = O.slice(x + 1),
  37464. k = D.match(C);
  37465. k && (V.push(k[1]), U.unshift(k[2])),
  37466. U.length && (s = '/' + U.join('.') + s),
  37467. (this.hostname = V.join('.'));
  37468. break;
  37469. }
  37470. }
  37471. }
  37472. this.hostname.length > A
  37473. ? (this.hostname = '')
  37474. : (this.hostname = this.hostname.toLowerCase()),
  37475. P || (this.hostname = l.toASCII(this.hostname));
  37476. var H = this.port ? ':' + this.port : '',
  37477. G = this.hostname || '';
  37478. (this.host = G + H),
  37479. (this.href += this.host),
  37480. P &&
  37481. ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
  37482. '/' !== s[0] && (s = '/' + s));
  37483. }
  37484. if (!I[f])
  37485. for (var x = 0, L = g.length; x < L; x++) {
  37486. var z = g[x];
  37487. if (s.indexOf(z) !== -1) {
  37488. var W = encodeURIComponent(z);
  37489. W === z && (W = escape(z)), (s = s.split(z).join(W));
  37490. }
  37491. }
  37492. var j = s.indexOf('#');
  37493. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)));
  37494. var Y = s.indexOf('?');
  37495. if (
  37496. (Y !== -1
  37497. ? ((this.search = s.substr(Y)),
  37498. (this.query = s.substr(Y + 1)),
  37499. t && (this.query = w.parse(this.query)),
  37500. (s = s.slice(0, Y)))
  37501. : t && ((this.search = ''), (this.query = {})),
  37502. s && (this.pathname = s),
  37503. b[f] && this.hostname && !this.pathname && (this.pathname = '/'),
  37504. this.pathname || this.search)
  37505. ) {
  37506. var H = this.pathname || '',
  37507. X = this.search || '';
  37508. this.path = H + X;
  37509. }
  37510. return (this.href = this.format()), this;
  37511. }),
  37512. (n.prototype.format = function () {
  37513. var e = this.auth || '';
  37514. e && ((e = encodeURIComponent(e)), (e = e.replace(/%3A/i, ':')), (e += '@'));
  37515. var t = this.protocol || '',
  37516. i = this.pathname || '',
  37517. n = this.hash || '',
  37518. r = !1,
  37519. o = '';
  37520. this.host
  37521. ? (r = e + this.host)
  37522. : this.hostname &&
  37523. ((r =
  37524. e +
  37525. (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']')),
  37526. this.port && (r += ':' + this.port)),
  37527. this.query &&
  37528. c.isObject(this.query) &&
  37529. Object.keys(this.query).length &&
  37530. (o = w.stringify(this.query));
  37531. var a = this.search || (o && '?' + o) || '';
  37532. return (
  37533. t && ':' !== t.substr(-1) && (t += ':'),
  37534. this.slashes || ((!t || b[t]) && r !== !1)
  37535. ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i))
  37536. : r || (r = ''),
  37537. n && '#' !== n.charAt(0) && (n = '#' + n),
  37538. a && '?' !== a.charAt(0) && (a = '?' + a),
  37539. (i = i.replace(/[?#]/g, function (e) {
  37540. return encodeURIComponent(e);
  37541. })),
  37542. (a = a.replace('#', '%23')),
  37543. t + r + i + a + n
  37544. );
  37545. }),
  37546. (n.prototype.resolve = function (e) {
  37547. return this.resolveObject(r(e, !1, !0)).format();
  37548. }),
  37549. (n.prototype.resolveObject = function (e) {
  37550. if (c.isString(e)) {
  37551. var t = new n();
  37552. t.parse(e, !1, !0), (e = t);
  37553. }
  37554. for (var i = new n(), r = Object.keys(this), o = 0; o < r.length; o++) {
  37555. var a = r[o];
  37556. i[a] = this[a];
  37557. }
  37558. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i;
  37559. if (e.slashes && !e.protocol) {
  37560. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  37561. var h = s[l];
  37562. 'protocol' !== h && (i[h] = e[h]);
  37563. }
  37564. return (
  37565. b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'),
  37566. (i.href = i.format()),
  37567. i
  37568. );
  37569. }
  37570. if (e.protocol && e.protocol !== i.protocol) {
  37571. if (!b[e.protocol]) {
  37572. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  37573. var p = u[d];
  37574. i[p] = e[p];
  37575. }
  37576. return (i.href = i.format()), i;
  37577. }
  37578. if (((i.protocol = e.protocol), e.host || E[e.protocol])) i.pathname = e.pathname;
  37579. else {
  37580. for (var f = (e.pathname || '').split('/'); f.length && !(e.host = f.shift()); );
  37581. e.host || (e.host = ''),
  37582. e.hostname || (e.hostname = ''),
  37583. '' !== f[0] && f.unshift(''),
  37584. f.length < 2 && f.unshift(''),
  37585. (i.pathname = f.join('/'));
  37586. }
  37587. if (
  37588. ((i.search = e.search),
  37589. (i.query = e.query),
  37590. (i.host = e.host || ''),
  37591. (i.auth = e.auth),
  37592. (i.hostname = e.hostname || e.host),
  37593. (i.port = e.port),
  37594. i.pathname || i.search)
  37595. ) {
  37596. var g = i.pathname || '',
  37597. m = i.search || '';
  37598. i.path = g + m;
  37599. }
  37600. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i;
  37601. }
  37602. var v = i.pathname && '/' === i.pathname.charAt(0),
  37603. A = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  37604. y = A || v || (i.host && e.pathname),
  37605. C = y,
  37606. I = (i.pathname && i.pathname.split('/')) || [],
  37607. f = (e.pathname && e.pathname.split('/')) || [],
  37608. w = i.protocol && !b[i.protocol];
  37609. if (
  37610. (w &&
  37611. ((i.hostname = ''),
  37612. (i.port = null),
  37613. i.host && ('' === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  37614. (i.host = ''),
  37615. e.protocol &&
  37616. ((e.hostname = null),
  37617. (e.port = null),
  37618. e.host && ('' === f[0] ? (f[0] = e.host) : f.unshift(e.host)),
  37619. (e.host = null)),
  37620. (y = y && ('' === f[0] || '' === I[0]))),
  37621. A)
  37622. )
  37623. (i.host = e.host || '' === e.host ? e.host : i.host),
  37624. (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname),
  37625. (i.search = e.search),
  37626. (i.query = e.query),
  37627. (I = f);
  37628. else if (f.length)
  37629. I || (I = []), I.pop(), (I = I.concat(f)), (i.search = e.search), (i.query = e.query);
  37630. else if (!c.isNullOrUndefined(e.search)) {
  37631. if (w) {
  37632. i.hostname = i.host = I.shift();
  37633. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@');
  37634. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  37635. }
  37636. return (
  37637. (i.search = e.search),
  37638. (i.query = e.query),
  37639. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37640. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37641. (i.href = i.format()),
  37642. i
  37643. );
  37644. }
  37645. if (!I.length)
  37646. return (
  37647. (i.pathname = null),
  37648. i.search ? (i.path = '/' + i.search) : (i.path = null),
  37649. (i.href = i.format()),
  37650. i
  37651. );
  37652. for (
  37653. var T = I.slice(-1)[0],
  37654. x = ((i.host || e.host || I.length > 1) && ('.' === T || '..' === T)) || '' === T,
  37655. S = 0,
  37656. M = I.length;
  37657. M >= 0;
  37658. M--
  37659. )
  37660. (T = I[M]),
  37661. '.' === T
  37662. ? I.splice(M, 1)
  37663. : '..' === T
  37664. ? (I.splice(M, 1), S++)
  37665. : S && (I.splice(M, 1), S--);
  37666. if (!y && !C) for (; S--; S) I.unshift('..');
  37667. !y || '' === I[0] || (I[0] && '/' === I[0].charAt(0)) || I.unshift(''),
  37668. x && '/' !== I.join('/').substr(-1) && I.push('');
  37669. var R = '' === I[0] || (I[0] && '/' === I[0].charAt(0));
  37670. if (w) {
  37671. i.hostname = i.host = R ? '' : I.length ? I.shift() : '';
  37672. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@');
  37673. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  37674. }
  37675. return (
  37676. (y = y || (i.host && I.length)),
  37677. y && !R && I.unshift(''),
  37678. I.length ? (i.pathname = I.join('/')) : ((i.pathname = null), (i.path = null)),
  37679. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37680. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37681. (i.auth = e.auth || i.auth),
  37682. (i.slashes = i.slashes || e.slashes),
  37683. (i.href = i.format()),
  37684. i
  37685. );
  37686. }),
  37687. (n.prototype.parseHost = function () {
  37688. var e = this.host,
  37689. t = u.exec(e);
  37690. t &&
  37691. ((t = t[0]),
  37692. ':' !== t && (this.port = t.substr(1)),
  37693. (e = e.substr(0, e.length - t.length))),
  37694. e && (this.hostname = e);
  37695. });
  37696. },
  37697. {
  37698. './util': 209,
  37699. punycode: 204,
  37700. querystring: 207,
  37701. },
  37702. ],
  37703. 209: [
  37704. function (e, t, i) {
  37705. 'use strict';
  37706. t.exports = {
  37707. isString: function (e) {
  37708. return 'string' == typeof e;
  37709. },
  37710. isObject: function (e) {
  37711. return 'object' == typeof e && null !== e;
  37712. },
  37713. isNull: function (e) {
  37714. return null === e;
  37715. },
  37716. isNullOrUndefined: function (e) {
  37717. return null == e;
  37718. },
  37719. };
  37720. },
  37721. {},
  37722. ],
  37723. 210: [
  37724. function (e, t, i) {
  37725. 'use strict';
  37726. function n(e) {
  37727. return l + e;
  37728. }
  37729. function r(e) {
  37730. return e.substring(l.length);
  37731. }
  37732. function o(e, t) {
  37733. for (var i in t)
  37734. Object.defineProperty(e, i, {
  37735. value: t[i],
  37736. configurable: !0,
  37737. writable: !0,
  37738. });
  37739. }
  37740. function a(e) {
  37741. if ('string' != typeof e) throw new TypeError('key must be a string.');
  37742. }
  37743. var s = Object.prototype.hasOwnProperty,
  37744. l = '~';
  37745. t.exports = function (e) {
  37746. var t = Object.create(null),
  37747. i = 0,
  37748. l = {};
  37749. return (
  37750. o(l, {
  37751. get: function (e, i) {
  37752. a(e);
  37753. var r = n(e);
  37754. return r in t ? t[r] : i;
  37755. },
  37756. set: function (e, r) {
  37757. a(e);
  37758. var o = n(e);
  37759. return o in t || ++i, (t[o] = r);
  37760. },
  37761. has: function (e) {
  37762. return a(e), n(e) in t;
  37763. },
  37764. delete: function (e) {
  37765. a(e);
  37766. var r = n(e);
  37767. return r in t && (--i, delete t[r], !0);
  37768. },
  37769. clear: function () {
  37770. (t = Object.create(null)), (i = 0);
  37771. },
  37772. forEach: function (e, i) {
  37773. if ('function' != typeof e) throw new TypeError('`callback` must be a function');
  37774. for (var n in t)
  37775. if (s.call(t, n)) {
  37776. var o = r(n),
  37777. a = t[n];
  37778. e.call(i, a, o, l);
  37779. }
  37780. },
  37781. }),
  37782. Object.defineProperty(l, 'size', {
  37783. get: function () {
  37784. return i;
  37785. },
  37786. configurable: !0,
  37787. }),
  37788. 'object' == typeof e &&
  37789. null !== e &&
  37790. Object.keys(e).forEach(function (t) {
  37791. l.set(t, e[t]);
  37792. }),
  37793. l
  37794. );
  37795. };
  37796. },
  37797. {},
  37798. ],
  37799. 211: [
  37800. function (e, t, i) {
  37801. t.exports = e('./lib/heap');
  37802. },
  37803. {
  37804. './lib/heap': 212,
  37805. },
  37806. ],
  37807. 212: [
  37808. function (e, t, i) {
  37809. (function () {
  37810. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  37811. (r = Math.floor),
  37812. (u = Math.min),
  37813. (n = function (e, t) {
  37814. return e < t ? -1 : e > t ? 1 : 0;
  37815. }),
  37816. (h = function (e, t, i, o, a) {
  37817. var s;
  37818. if ((null == i && (i = 0), null == a && (a = n), i < 0))
  37819. throw new Error('lo must be non-negative');
  37820. for (null == o && (o = e.length); i < o; )
  37821. (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1);
  37822. return [].splice.apply(e, [i, i - i].concat(t)), t;
  37823. }),
  37824. (s = function (e, t, i) {
  37825. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i);
  37826. }),
  37827. (a = function (e, t) {
  37828. var i, r;
  37829. return (
  37830. null == t && (t = n),
  37831. (i = e.pop()),
  37832. e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i),
  37833. r
  37834. );
  37835. }),
  37836. (c = function (e, t, i) {
  37837. var r;
  37838. return null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r;
  37839. }),
  37840. (l = function (e, t, i) {
  37841. var r;
  37842. return (
  37843. null == i && (i = n),
  37844. e.length &&
  37845. i(e[0], t) < 0 &&
  37846. ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)),
  37847. t
  37848. );
  37849. }),
  37850. (o = function (e, t) {
  37851. var i, o, a, s, l, c;
  37852. for (
  37853. null == t && (t = n),
  37854. s = function () {
  37855. c = [];
  37856. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  37857. c.push(t);
  37858. return c;
  37859. }
  37860. .apply(this)
  37861. .reverse(),
  37862. l = [],
  37863. o = 0,
  37864. a = s.length;
  37865. o < a;
  37866. o++
  37867. )
  37868. (i = s[o]), l.push(m(e, i, t));
  37869. return l;
  37870. }),
  37871. (f = function (e, t, i) {
  37872. var r;
  37873. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1))
  37874. return g(e, 0, r, i), m(e, r, i);
  37875. }),
  37876. (d = function (e, t, i) {
  37877. var r, a, s, c, h;
  37878. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length)) return a;
  37879. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++) (r = h[s]), l(a, r, i);
  37880. return a.sort(i).reverse();
  37881. }),
  37882. (p = function (e, t, i) {
  37883. var r, s, l, c, d, p, f, g, m, v;
  37884. if ((null == i && (i = n), 10 * t <= e.length)) {
  37885. if (((c = e.slice(0, t).sort(i)), !c.length)) return c;
  37886. for (l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length; d < f; d++)
  37887. (r = g[d]), i(r, l) < 0 && (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]));
  37888. return c;
  37889. }
  37890. for (
  37891. o(e, i), v = [], s = p = 0, m = u(t, e.length);
  37892. 0 <= m ? p < m : p > m;
  37893. s = 0 <= m ? ++p : --p
  37894. )
  37895. v.push(a(e, i));
  37896. return v;
  37897. }),
  37898. (g = function (e, t, i, r) {
  37899. var o, a, s;
  37900. for (
  37901. null == r && (r = n), o = e[i];
  37902. i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0);
  37903. )
  37904. (e[i] = a), (i = s);
  37905. return (e[i] = o);
  37906. }),
  37907. (m = function (e, t, i) {
  37908. var r, o, a, s, l;
  37909. for (null == i && (i = n), o = e.length, l = t, a = e[t], r = 2 * t + 1; r < o; )
  37910. (s = r + 1),
  37911. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  37912. (e[t] = e[r]),
  37913. (t = r),
  37914. (r = 2 * t + 1);
  37915. return (e[t] = a), g(e, l, t, i);
  37916. }),
  37917. (e = (function () {
  37918. function e(e) {
  37919. (this.cmp = null != e ? e : n), (this.nodes = []);
  37920. }
  37921. return (
  37922. (e.push = s),
  37923. (e.pop = a),
  37924. (e.replace = c),
  37925. (e.pushpop = l),
  37926. (e.heapify = o),
  37927. (e.updateItem = f),
  37928. (e.nlargest = d),
  37929. (e.nsmallest = p),
  37930. (e.prototype.push = function (e) {
  37931. return s(this.nodes, e, this.cmp);
  37932. }),
  37933. (e.prototype.pop = function () {
  37934. return a(this.nodes, this.cmp);
  37935. }),
  37936. (e.prototype.peek = function () {
  37937. return this.nodes[0];
  37938. }),
  37939. (e.prototype.contains = function (e) {
  37940. return this.nodes.indexOf(e) !== -1;
  37941. }),
  37942. (e.prototype.replace = function (e) {
  37943. return c(this.nodes, e, this.cmp);
  37944. }),
  37945. (e.prototype.pushpop = function (e) {
  37946. return l(this.nodes, e, this.cmp);
  37947. }),
  37948. (e.prototype.heapify = function () {
  37949. return o(this.nodes, this.cmp);
  37950. }),
  37951. (e.prototype.updateItem = function (e) {
  37952. return f(this.nodes, e, this.cmp);
  37953. }),
  37954. (e.prototype.clear = function () {
  37955. return (this.nodes = []);
  37956. }),
  37957. (e.prototype.empty = function () {
  37958. return 0 === this.nodes.length;
  37959. }),
  37960. (e.prototype.size = function () {
  37961. return this.nodes.length;
  37962. }),
  37963. (e.prototype.clone = function () {
  37964. var t;
  37965. return (t = new e()), (t.nodes = this.nodes.slice(0)), t;
  37966. }),
  37967. (e.prototype.toArray = function () {
  37968. return this.nodes.slice(0);
  37969. }),
  37970. (e.prototype.insert = e.prototype.push),
  37971. (e.prototype.top = e.prototype.peek),
  37972. (e.prototype.front = e.prototype.peek),
  37973. (e.prototype.has = e.prototype.contains),
  37974. (e.prototype.copy = e.prototype.clone),
  37975. e
  37976. );
  37977. })()),
  37978. (function (e, n) {
  37979. return 'function' == typeof define && define.amd
  37980. ? define([], n)
  37981. : 'object' == typeof i
  37982. ? (t.exports = n())
  37983. : (e.Heap = n());
  37984. })(this, function () {
  37985. return e;
  37986. });
  37987. }.call(this));
  37988. },
  37989. {},
  37990. ],
  37991. 213: [
  37992. function (e, t, i) {
  37993. !(function (e) {
  37994. function i() {}
  37995. function n(e, t) {
  37996. return function () {
  37997. e.apply(t, arguments);
  37998. };
  37999. }
  38000. function r(e) {
  38001. if ('object' != typeof this)
  38002. throw new TypeError('Promises must be constructed via new');
  38003. if ('function' != typeof e) throw new TypeError('not a function');
  38004. (this._state = 0),
  38005. (this._handled = !1),
  38006. (this._value = void 0),
  38007. (this._deferreds = []),
  38008. h(e, this);
  38009. }
  38010. function o(e, t) {
  38011. for (; 3 === e._state; ) e = e._value;
  38012. return 0 === e._state
  38013. ? void e._deferreds.push(t)
  38014. : ((e._handled = !0),
  38015. void r._immediateFn(function () {
  38016. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  38017. if (null === i) return void (1 === e._state ? a : s)(t.promise, e._value);
  38018. var n;
  38019. try {
  38020. n = i(e._value);
  38021. } catch (e) {
  38022. return void s(t.promise, e);
  38023. }
  38024. a(t.promise, n);
  38025. }));
  38026. }
  38027. function a(e, t) {
  38028. try {
  38029. if (t === e) throw new TypeError('A promise cannot be resolved with itself.');
  38030. if (t && ('object' == typeof t || 'function' == typeof t)) {
  38031. var i = t.then;
  38032. if (t instanceof r) return (e._state = 3), (e._value = t), void l(e);
  38033. if ('function' == typeof i) return void h(n(i, t), e);
  38034. }
  38035. (e._state = 1), (e._value = t), l(e);
  38036. } catch (t) {
  38037. s(e, t);
  38038. }
  38039. }
  38040. function s(e, t) {
  38041. (e._state = 2), (e._value = t), l(e);
  38042. }
  38043. function l(e) {
  38044. 2 === e._state &&
  38045. 0 === e._deferreds.length &&
  38046. r._immediateFn(function () {
  38047. e._handled || r._unhandledRejectionFn(e._value);
  38048. });
  38049. for (var t = 0, i = e._deferreds.length; t < i; t++) o(e, e._deferreds[t]);
  38050. e._deferreds = null;
  38051. }
  38052. function c(e, t, i) {
  38053. (this.onFulfilled = 'function' == typeof e ? e : null),
  38054. (this.onRejected = 'function' == typeof t ? t : null),
  38055. (this.promise = i);
  38056. }
  38057. function h(e, t) {
  38058. var i = !1;
  38059. try {
  38060. e(
  38061. function (e) {
  38062. i || ((i = !0), a(t, e));
  38063. },
  38064. function (e) {
  38065. i || ((i = !0), s(t, e));
  38066. }
  38067. );
  38068. } catch (e) {
  38069. if (i) return;
  38070. (i = !0), s(t, e);
  38071. }
  38072. }
  38073. var u = setTimeout;
  38074. (r.prototype.catch = function (e) {
  38075. return this.then(null, e);
  38076. }),
  38077. (r.prototype.then = function (e, t) {
  38078. var n = new this.constructor(i);
  38079. return o(this, new c(e, t, n)), n;
  38080. }),
  38081. (r.all = function (e) {
  38082. var t = Array.prototype.slice.call(e);
  38083. return new r(function (e, i) {
  38084. function n(o, a) {
  38085. try {
  38086. if (a && ('object' == typeof a || 'function' == typeof a)) {
  38087. var s = a.then;
  38088. if ('function' == typeof s)
  38089. return void s.call(
  38090. a,
  38091. function (e) {
  38092. n(o, e);
  38093. },
  38094. i
  38095. );
  38096. }
  38097. (t[o] = a), 0 === --r && e(t);
  38098. } catch (e) {
  38099. i(e);
  38100. }
  38101. }
  38102. if (0 === t.length) return e([]);
  38103. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o]);
  38104. });
  38105. }),
  38106. (r.resolve = function (e) {
  38107. return e && 'object' == typeof e && e.constructor === r
  38108. ? e
  38109. : new r(function (t) {
  38110. t(e);
  38111. });
  38112. }),
  38113. (r.reject = function (e) {
  38114. return new r(function (t, i) {
  38115. i(e);
  38116. });
  38117. }),
  38118. (r.race = function (e) {
  38119. return new r(function (t, i) {
  38120. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i);
  38121. });
  38122. }),
  38123. (r._immediateFn =
  38124. ('function' == typeof setImmediate &&
  38125. function (e) {
  38126. setImmediate(e);
  38127. }) ||
  38128. function (e) {
  38129. u(e, 0);
  38130. }),
  38131. (r._unhandledRejectionFn = function (e) {
  38132. 'undefined' != typeof console &&
  38133. console &&
  38134. console.warn('Possible Unhandled Promise Rejection:', e);
  38135. }),
  38136. (r._setImmediateFn = function (e) {
  38137. r._immediateFn = e;
  38138. }),
  38139. (r._setUnhandledRejectionFn = function (e) {
  38140. r._unhandledRejectionFn = e;
  38141. }),
  38142. 'undefined' != typeof t && t.exports ? (t.exports = r) : e.Promise || (e.Promise = r);
  38143. })(this);
  38144. },
  38145. {},
  38146. ],
  38147. 214: [
  38148. function (e, t, i) {
  38149. (function (i) {
  38150. !(function (i, n) {
  38151. 'function' == typeof define && define.amd
  38152. ? define(['bytebuffer'], n)
  38153. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  38154. ? (t.exports = n(e('bytebuffer'), !0))
  38155. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer));
  38156. })(this, function (t, n) {
  38157. 'use strict';
  38158. var r = {};
  38159. return (
  38160. (r.ByteBuffer = t),
  38161. (r.Long = t.Long || null),
  38162. (r.VERSION = '5.0.1'),
  38163. (r.WIRE_TYPES = {}),
  38164. (r.WIRE_TYPES.VARINT = 0),
  38165. (r.WIRE_TYPES.BITS64 = 1),
  38166. (r.WIRE_TYPES.LDELIM = 2),
  38167. (r.WIRE_TYPES.STARTGROUP = 3),
  38168. (r.WIRE_TYPES.ENDGROUP = 4),
  38169. (r.WIRE_TYPES.BITS32 = 5),
  38170. (r.PACKABLE_WIRE_TYPES = [
  38171. r.WIRE_TYPES.VARINT,
  38172. r.WIRE_TYPES.BITS64,
  38173. r.WIRE_TYPES.BITS32,
  38174. ]),
  38175. (r.TYPES = {
  38176. int32: {
  38177. name: 'int32',
  38178. wireType: r.WIRE_TYPES.VARINT,
  38179. defaultValue: 0,
  38180. },
  38181. uint32: {
  38182. name: 'uint32',
  38183. wireType: r.WIRE_TYPES.VARINT,
  38184. defaultValue: 0,
  38185. },
  38186. sint32: {
  38187. name: 'sint32',
  38188. wireType: r.WIRE_TYPES.VARINT,
  38189. defaultValue: 0,
  38190. },
  38191. int64: {
  38192. name: 'int64',
  38193. wireType: r.WIRE_TYPES.VARINT,
  38194. defaultValue: r.Long ? r.Long.ZERO : void 0,
  38195. },
  38196. uint64: {
  38197. name: 'uint64',
  38198. wireType: r.WIRE_TYPES.VARINT,
  38199. defaultValue: r.Long ? r.Long.UZERO : void 0,
  38200. },
  38201. sint64: {
  38202. name: 'sint64',
  38203. wireType: r.WIRE_TYPES.VARINT,
  38204. defaultValue: r.Long ? r.Long.ZERO : void 0,
  38205. },
  38206. bool: {
  38207. name: 'bool',
  38208. wireType: r.WIRE_TYPES.VARINT,
  38209. defaultValue: !1,
  38210. },
  38211. double: {
  38212. name: 'double',
  38213. wireType: r.WIRE_TYPES.BITS64,
  38214. defaultValue: 0,
  38215. },
  38216. string: {
  38217. name: 'string',
  38218. wireType: r.WIRE_TYPES.LDELIM,
  38219. defaultValue: '',
  38220. },
  38221. bytes: {
  38222. name: 'bytes',
  38223. wireType: r.WIRE_TYPES.LDELIM,
  38224. defaultValue: null,
  38225. },
  38226. fixed32: {
  38227. name: 'fixed32',
  38228. wireType: r.WIRE_TYPES.BITS32,
  38229. defaultValue: 0,
  38230. },
  38231. sfixed32: {
  38232. name: 'sfixed32',
  38233. wireType: r.WIRE_TYPES.BITS32,
  38234. defaultValue: 0,
  38235. },
  38236. fixed64: {
  38237. name: 'fixed64',
  38238. wireType: r.WIRE_TYPES.BITS64,
  38239. defaultValue: r.Long ? r.Long.UZERO : void 0,
  38240. },
  38241. sfixed64: {
  38242. name: 'sfixed64',
  38243. wireType: r.WIRE_TYPES.BITS64,
  38244. defaultValue: r.Long ? r.Long.ZERO : void 0,
  38245. },
  38246. float: {
  38247. name: 'float',
  38248. wireType: r.WIRE_TYPES.BITS32,
  38249. defaultValue: 0,
  38250. },
  38251. enum: {
  38252. name: 'enum',
  38253. wireType: r.WIRE_TYPES.VARINT,
  38254. defaultValue: 0,
  38255. },
  38256. message: {
  38257. name: 'message',
  38258. wireType: r.WIRE_TYPES.LDELIM,
  38259. defaultValue: null,
  38260. },
  38261. group: {
  38262. name: 'group',
  38263. wireType: r.WIRE_TYPES.STARTGROUP,
  38264. defaultValue: null,
  38265. },
  38266. }),
  38267. (r.MAP_KEY_TYPES = [
  38268. r.TYPES.int32,
  38269. r.TYPES.sint32,
  38270. r.TYPES.sfixed32,
  38271. r.TYPES.uint32,
  38272. r.TYPES.fixed32,
  38273. r.TYPES.int64,
  38274. r.TYPES.sint64,
  38275. r.TYPES.sfixed64,
  38276. r.TYPES.uint64,
  38277. r.TYPES.fixed64,
  38278. r.TYPES.bool,
  38279. r.TYPES.string,
  38280. r.TYPES.bytes,
  38281. ]),
  38282. (r.ID_MIN = 1),
  38283. (r.ID_MAX = 536870911),
  38284. (r.convertFieldsToCamelCase = !1),
  38285. (r.populateAccessors = !0),
  38286. (r.populateDefaults = !0),
  38287. (r.Util = (function () {
  38288. var t = {};
  38289. return (
  38290. (t.IS_NODE = !(
  38291. 'object' != typeof i ||
  38292. i + '' != '[object process]' ||
  38293. i.browser
  38294. )),
  38295. (t.XHR = function () {
  38296. for (
  38297. var e = [
  38298. function () {
  38299. return new XMLHttpRequest();
  38300. },
  38301. function () {
  38302. return new ActiveXObject('Msxml2.XMLHTTP');
  38303. },
  38304. function () {
  38305. return new ActiveXObject('Msxml3.XMLHTTP');
  38306. },
  38307. function () {
  38308. return new ActiveXObject('Microsoft.XMLHTTP');
  38309. },
  38310. ],
  38311. t = null,
  38312. i = 0;
  38313. i < e.length;
  38314. i++
  38315. ) {
  38316. try {
  38317. t = e[i]();
  38318. } catch (e) {
  38319. continue;
  38320. }
  38321. break;
  38322. }
  38323. if (!t) throw Error('XMLHttpRequest is not supported');
  38324. return t;
  38325. }),
  38326. (t.fetch = function (i, n) {
  38327. if ((n && 'function' != typeof n && (n = null), t.IS_NODE)) {
  38328. var r = e('fs');
  38329. if (n)
  38330. r.readFile(i, function (e, t) {
  38331. n(e ? null : '' + t);
  38332. });
  38333. else
  38334. try {
  38335. return r.readFileSync(i);
  38336. } catch (e) {
  38337. return null;
  38338. }
  38339. } else {
  38340. var o = t.XHR();
  38341. if (
  38342. (o.open('GET', i, !!n),
  38343. o.setRequestHeader('Accept', 'text/plain'),
  38344. 'function' == typeof o.overrideMimeType && o.overrideMimeType('text/plain'),
  38345. !n)
  38346. )
  38347. return (
  38348. o.send(null),
  38349. 200 == o.status || (0 == o.status && 'string' == typeof o.responseText)
  38350. ? o.responseText
  38351. : null
  38352. );
  38353. if (
  38354. ((o.onreadystatechange = function () {
  38355. 4 == o.readyState &&
  38356. n(
  38357. 200 == o.status ||
  38358. (0 == o.status && 'string' == typeof o.responseText)
  38359. ? o.responseText
  38360. : null
  38361. );
  38362. }),
  38363. 4 == o.readyState)
  38364. )
  38365. return;
  38366. o.send(null);
  38367. }
  38368. }),
  38369. (t.toCamelCase = function (e) {
  38370. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  38371. return t.toUpperCase();
  38372. });
  38373. }),
  38374. t
  38375. );
  38376. })()),
  38377. (r.Lang = {
  38378. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  38379. RULE: /^(?:required|optional|repeated|map)$/,
  38380. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  38381. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  38382. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  38383. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  38384. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  38385. NUMBER:
  38386. /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  38387. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  38388. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  38389. NUMBER_OCT: /^0[0-7]+$/,
  38390. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  38391. BOOL: /^(?:true|false)$/i,
  38392. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38393. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38394. WHITESPACE: /\s/,
  38395. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  38396. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  38397. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  38398. }),
  38399. (r.DotProto = (function (e, t) {
  38400. function i(e, i) {
  38401. var n = -1,
  38402. r = 1;
  38403. if (
  38404. ('-' == e.charAt(0) && ((r = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38405. )
  38406. n = parseInt(e);
  38407. else if (t.NUMBER_HEX.test(e)) n = parseInt(e.substring(2), 16);
  38408. else {
  38409. if (!t.NUMBER_OCT.test(e))
  38410. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e);
  38411. n = parseInt(e.substring(1), 8);
  38412. }
  38413. if (((n = (r * n) | 0), !i && n < 0))
  38414. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e);
  38415. return n;
  38416. }
  38417. function n(e) {
  38418. var i = 1;
  38419. if (
  38420. ('-' == e.charAt(0) && ((i = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38421. )
  38422. return i * parseInt(e, 10);
  38423. if (t.NUMBER_HEX.test(e)) return i * parseInt(e.substring(2), 16);
  38424. if (t.NUMBER_OCT.test(e)) return i * parseInt(e.substring(1), 8);
  38425. if ('inf' === e) return i * (1 / 0);
  38426. if ('nan' === e) return NaN;
  38427. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e);
  38428. throw Error('illegal number value: ' + (i < 0 ? '-' : '') + e);
  38429. }
  38430. function r(e, t, i) {
  38431. 'undefined' == typeof e[t]
  38432. ? (e[t] = i)
  38433. : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i));
  38434. }
  38435. var o = {},
  38436. a = function (e) {
  38437. (this.source = e + ''),
  38438. (this.index = 0),
  38439. (this.line = 1),
  38440. (this.stack = []),
  38441. (this._stringOpen = null);
  38442. },
  38443. s = a.prototype;
  38444. (s._readString = function () {
  38445. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  38446. e.lastIndex = this.index - 1;
  38447. var i = e.exec(this.source);
  38448. if (!i) throw Error('unterminated string');
  38449. return (
  38450. (this.index = e.lastIndex),
  38451. this.stack.push(this._stringOpen),
  38452. (this._stringOpen = null),
  38453. i[1]
  38454. );
  38455. }),
  38456. (s.next = function () {
  38457. if (this.stack.length > 0) return this.stack.shift();
  38458. if (this.index >= this.source.length) return null;
  38459. if (null !== this._stringOpen) return this._readString();
  38460. var e, i, n;
  38461. do {
  38462. for (e = !1; t.WHITESPACE.test((n = this.source.charAt(this.index))); )
  38463. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38464. return null;
  38465. if ('/' === this.source.charAt(this.index))
  38466. if ((++this.index, '/' === this.source.charAt(this.index))) {
  38467. for (; '\n' !== this.source.charAt(++this.index); )
  38468. if (this.index == this.source.length) return null;
  38469. ++this.index, ++this.line, (e = !0);
  38470. } else {
  38471. if ('*' !== (n = this.source.charAt(this.index))) return '/';
  38472. do {
  38473. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38474. return null;
  38475. (i = n), (n = this.source.charAt(this.index));
  38476. } while ('*' !== i || '/' !== n);
  38477. ++this.index, (e = !0);
  38478. }
  38479. } while (e);
  38480. if (this.index === this.source.length) return null;
  38481. var r = this.index;
  38482. t.DELIM.lastIndex = 0;
  38483. var o = t.DELIM.test(this.source.charAt(r++));
  38484. if (!o)
  38485. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); ) ++r;
  38486. var a = this.source.substring(this.index, (this.index = r));
  38487. return ('"' !== a && "'" !== a) || (this._stringOpen = a), a;
  38488. }),
  38489. (s.peek = function () {
  38490. if (0 === this.stack.length) {
  38491. var e = this.next();
  38492. if (null === e) return null;
  38493. this.stack.push(e);
  38494. }
  38495. return this.stack[0];
  38496. }),
  38497. (s.skip = function (e) {
  38498. var t = this.next();
  38499. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected");
  38500. }),
  38501. (s.omit = function (e) {
  38502. return this.peek() === e && (this.next(), !0);
  38503. }),
  38504. (s.toString = function () {
  38505. return (
  38506. 'Tokenizer (' +
  38507. this.index +
  38508. '/' +
  38509. this.source.length +
  38510. ' at line ' +
  38511. this.line +
  38512. ')'
  38513. );
  38514. }),
  38515. (o.Tokenizer = a);
  38516. var l = function (e) {
  38517. (this.tn = new a(e)), (this.proto3 = !1);
  38518. },
  38519. c = l.prototype;
  38520. return (
  38521. (c.parse = function () {
  38522. var e,
  38523. i,
  38524. n = {
  38525. name: '[ROOT]',
  38526. package: null,
  38527. messages: [],
  38528. enums: [],
  38529. imports: [],
  38530. options: {},
  38531. services: [],
  38532. },
  38533. r = !0;
  38534. try {
  38535. for (; (e = this.tn.next()); )
  38536. switch (e) {
  38537. case 'package':
  38538. if (!r || null !== n.package) throw Error("unexpected 'package'");
  38539. if (((e = this.tn.next()), !t.TYPEREF.test(e)))
  38540. throw Error('illegal package name: ' + e);
  38541. this.tn.skip(';'), (n.package = e);
  38542. break;
  38543. case 'import':
  38544. if (!r) throw Error("unexpected 'import'");
  38545. (e = this.tn.peek()),
  38546. ('public' === e || (i = 'weak' === e)) && this.tn.next(),
  38547. (e = this._readString()),
  38548. this.tn.skip(';'),
  38549. i || n.imports.push(e);
  38550. break;
  38551. case 'syntax':
  38552. if (!r) throw Error("unexpected 'syntax'");
  38553. this.tn.skip('='),
  38554. 'proto3' === (n.syntax = this._readString()) && (this.proto3 = !0),
  38555. this.tn.skip(';');
  38556. break;
  38557. case 'message':
  38558. this._parseMessage(n, null), (r = !1);
  38559. break;
  38560. case 'enum':
  38561. this._parseEnum(n), (r = !1);
  38562. break;
  38563. case 'option':
  38564. this._parseOption(n);
  38565. break;
  38566. case 'service':
  38567. this._parseService(n);
  38568. break;
  38569. case 'extend':
  38570. this._parseExtend(n);
  38571. break;
  38572. default:
  38573. throw Error("unexpected '" + e + "'");
  38574. }
  38575. } catch (e) {
  38576. throw (
  38577. ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  38578. );
  38579. }
  38580. return delete n.name, n;
  38581. }),
  38582. (l.parse = function (e) {
  38583. return new l(e).parse();
  38584. }),
  38585. (c._readString = function () {
  38586. var e,
  38587. t,
  38588. i = '';
  38589. do {
  38590. if (((t = this.tn.next()), "'" !== t && '"' !== t))
  38591. throw Error('illegal string delimiter: ' + t);
  38592. (i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek());
  38593. } while ('"' === e || '"' === e);
  38594. return i;
  38595. }),
  38596. (c._readValue = function (e) {
  38597. var i = this.tn.peek();
  38598. if ('"' === i || "'" === i) return this._readString();
  38599. if ((this.tn.next(), t.NUMBER.test(i))) return n(i);
  38600. if (t.BOOL.test(i)) return 'true' === i.toLowerCase();
  38601. if (e && t.TYPEREF.test(i)) return i;
  38602. throw Error('illegal value: ' + i);
  38603. }),
  38604. (c._parseOption = function (e, i) {
  38605. var n = this.tn.next(),
  38606. r = !1;
  38607. if (('(' === n && ((r = !0), (n = this.tn.next())), !t.TYPEREF.test(n)))
  38608. throw Error('illegal option name: ' + n);
  38609. var o = n;
  38610. r &&
  38611. (this.tn.skip(')'),
  38612. (o = '(' + o + ')'),
  38613. (n = this.tn.peek()),
  38614. t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  38615. this.tn.skip('='),
  38616. this._parseOptionValue(e, o),
  38617. i || this.tn.skip(';');
  38618. }),
  38619. (c._parseOptionValue = function (e, i) {
  38620. var n = this.tn.peek();
  38621. if ('{' !== n) r(e.options, i, this._readValue(!0));
  38622. else
  38623. for (this.tn.skip('{'); '}' !== (n = this.tn.next()); ) {
  38624. if (!t.NAME.test(n)) throw Error('illegal option name: ' + i + '.' + n);
  38625. this.tn.omit(':')
  38626. ? r(e.options, i + '.' + n, this._readValue(!0))
  38627. : this._parseOptionValue(e, i + '.' + n);
  38628. }
  38629. }),
  38630. (c._parseService = function (e) {
  38631. var i = this.tn.next();
  38632. if (!t.NAME.test(i))
  38633. throw Error('illegal service name at line ' + this.tn.line + ': ' + i);
  38634. var n = i,
  38635. r = {
  38636. name: n,
  38637. rpc: {},
  38638. options: {},
  38639. };
  38640. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38641. if ('option' === i) this._parseOption(r);
  38642. else {
  38643. if ('rpc' !== i) throw Error('illegal service token: ' + i);
  38644. this._parseServiceRPC(r);
  38645. }
  38646. this.tn.omit(';'), e.services.push(r);
  38647. }),
  38648. (c._parseServiceRPC = function (e) {
  38649. var i = 'rpc',
  38650. n = this.tn.next();
  38651. if (!t.NAME.test(n)) throw Error('illegal rpc service method name: ' + n);
  38652. var r = n,
  38653. o = {
  38654. request: null,
  38655. response: null,
  38656. request_stream: !1,
  38657. response_stream: !1,
  38658. options: {},
  38659. };
  38660. if (
  38661. (this.tn.skip('('),
  38662. (n = this.tn.next()),
  38663. 'stream' === n.toLowerCase() &&
  38664. ((o.request_stream = !0), (n = this.tn.next())),
  38665. !t.TYPEREF.test(n))
  38666. )
  38667. throw Error('illegal rpc service request type: ' + n);
  38668. if (
  38669. ((o.request = n),
  38670. this.tn.skip(')'),
  38671. (n = this.tn.next()),
  38672. 'returns' !== n.toLowerCase())
  38673. )
  38674. throw Error('illegal rpc service request type delimiter: ' + n);
  38675. if (
  38676. (this.tn.skip('('),
  38677. (n = this.tn.next()),
  38678. 'stream' === n.toLowerCase() &&
  38679. ((o.response_stream = !0), (n = this.tn.next())),
  38680. (o.response = n),
  38681. this.tn.skip(')'),
  38682. (n = this.tn.peek()),
  38683. '{' === n)
  38684. ) {
  38685. for (this.tn.next(); '}' !== (n = this.tn.next()); ) {
  38686. if ('option' !== n) throw Error('illegal rpc service token: ' + n);
  38687. this._parseOption(o);
  38688. }
  38689. this.tn.omit(';');
  38690. } else this.tn.skip(';');
  38691. 'undefined' == typeof e[i] && (e[i] = {}), (e[i][r] = o);
  38692. }),
  38693. (c._parseMessage = function (e, n) {
  38694. var r = !!n,
  38695. o = this.tn.next(),
  38696. a = {
  38697. name: '',
  38698. fields: [],
  38699. enums: [],
  38700. messages: [],
  38701. options: {},
  38702. services: [],
  38703. oneofs: {},
  38704. };
  38705. if (!t.NAME.test(o))
  38706. throw Error('illegal ' + (r ? 'group' : 'message') + ' name: ' + o);
  38707. for (
  38708. a.name = o,
  38709. r && (this.tn.skip('='), (n.id = i(this.tn.next())), (a.isGroup = !0)),
  38710. o = this.tn.peek(),
  38711. '[' === o && n && this._parseFieldOptions(n),
  38712. this.tn.skip('{');
  38713. '}' !== (o = this.tn.next());
  38714. )
  38715. if (t.RULE.test(o)) this._parseMessageField(a, o);
  38716. else if ('oneof' === o) this._parseMessageOneOf(a);
  38717. else if ('enum' === o) this._parseEnum(a);
  38718. else if ('message' === o) this._parseMessage(a);
  38719. else if ('option' === o) this._parseOption(a);
  38720. else if ('service' === o) this._parseService(a);
  38721. else if ('extensions' === o) a.extensions = this._parseExtensionRanges();
  38722. else if ('reserved' === o) this._parseIgnored();
  38723. else if ('extend' === o) this._parseExtend(a);
  38724. else {
  38725. if (!t.TYPEREF.test(o)) throw Error('illegal message token: ' + o);
  38726. if (!this.proto3) throw Error('illegal field rule: ' + o);
  38727. this._parseMessageField(a, 'optional', o);
  38728. }
  38729. return this.tn.omit(';'), e.messages.push(a), a;
  38730. }),
  38731. (c._parseIgnored = function () {
  38732. for (; ';' !== this.tn.peek(); ) this.tn.next();
  38733. this.tn.skip(';');
  38734. }),
  38735. (c._parseMessageField = function (e, n, r) {
  38736. if (!t.RULE.test(n)) throw Error('illegal message field rule: ' + n);
  38737. var o,
  38738. a = {
  38739. rule: n,
  38740. type: '',
  38741. name: '',
  38742. options: {},
  38743. id: 0,
  38744. };
  38745. if ('map' === n) {
  38746. if (r) throw Error('illegal type: ' + r);
  38747. if (
  38748. (this.tn.skip('<'),
  38749. (o = this.tn.next()),
  38750. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38751. )
  38752. throw Error('illegal message field type: ' + o);
  38753. if (
  38754. ((a.keytype = o),
  38755. this.tn.skip(','),
  38756. (o = this.tn.next()),
  38757. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38758. )
  38759. throw Error('illegal message field: ' + o);
  38760. if (((a.type = o), this.tn.skip('>'), (o = this.tn.next()), !t.NAME.test(o)))
  38761. throw Error('illegal message field name: ' + o);
  38762. (a.name = o),
  38763. this.tn.skip('='),
  38764. (a.id = i(this.tn.next())),
  38765. (o = this.tn.peek()),
  38766. '[' === o && this._parseFieldOptions(a),
  38767. this.tn.skip(';');
  38768. } else if (
  38769. ((r = 'undefined' != typeof r ? r : this.tn.next()), 'group' === r)
  38770. ) {
  38771. var s = this._parseMessage(e, a);
  38772. if (!/^[A-Z]/.test(s.name)) throw Error('illegal group name: ' + s.name);
  38773. (a.type = s.name), (a.name = s.name.toLowerCase()), this.tn.omit(';');
  38774. } else {
  38775. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  38776. throw Error('illegal message field type: ' + r);
  38777. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o)))
  38778. throw Error('illegal message field name: ' + o);
  38779. (a.name = o),
  38780. this.tn.skip('='),
  38781. (a.id = i(this.tn.next())),
  38782. (o = this.tn.peek()),
  38783. '[' === o && this._parseFieldOptions(a),
  38784. this.tn.skip(';');
  38785. }
  38786. return e.fields.push(a), a;
  38787. }),
  38788. (c._parseMessageOneOf = function (e) {
  38789. var i = this.tn.next();
  38790. if (!t.NAME.test(i)) throw Error('illegal oneof name: ' + i);
  38791. var n,
  38792. r = i,
  38793. o = [];
  38794. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38795. (n = this._parseMessageField(e, 'optional', i)), (n.oneof = r), o.push(n.id);
  38796. this.tn.omit(';'), (e.oneofs[r] = o);
  38797. }),
  38798. (c._parseFieldOptions = function (e) {
  38799. this.tn.skip('[');
  38800. for (var t, i = !0; ']' !== (t = this.tn.peek()); )
  38801. i || this.tn.skip(','), this._parseOption(e, !0), (i = !1);
  38802. this.tn.next();
  38803. }),
  38804. (c._parseEnum = function (e) {
  38805. var n = {
  38806. name: '',
  38807. values: [],
  38808. options: {},
  38809. },
  38810. r = this.tn.next();
  38811. if (!t.NAME.test(r)) throw Error('illegal name: ' + r);
  38812. for (n.name = r, this.tn.skip('{'); '}' !== (r = this.tn.next()); )
  38813. if ('option' === r) this._parseOption(n);
  38814. else {
  38815. if (!t.NAME.test(r)) throw Error('illegal name: ' + r);
  38816. this.tn.skip('=');
  38817. var o = {
  38818. name: r,
  38819. id: i(this.tn.next(), !0),
  38820. };
  38821. (r = this.tn.peek()),
  38822. '[' === r &&
  38823. this._parseFieldOptions({
  38824. options: {},
  38825. }),
  38826. this.tn.skip(';'),
  38827. n.values.push(o);
  38828. }
  38829. this.tn.omit(';'), e.enums.push(n);
  38830. }),
  38831. (c._parseExtensionRanges = function () {
  38832. var t,
  38833. i,
  38834. r,
  38835. o = [];
  38836. do {
  38837. for (i = []; ; ) {
  38838. switch ((t = this.tn.next())) {
  38839. case 'min':
  38840. r = e.ID_MIN;
  38841. break;
  38842. case 'max':
  38843. r = e.ID_MAX;
  38844. break;
  38845. default:
  38846. r = n(t);
  38847. }
  38848. if ((i.push(r), 2 === i.length)) break;
  38849. if ('to' !== this.tn.peek()) {
  38850. i.push(r);
  38851. break;
  38852. }
  38853. this.tn.next();
  38854. }
  38855. o.push(i);
  38856. } while (this.tn.omit(','));
  38857. return this.tn.skip(';'), o;
  38858. }),
  38859. (c._parseExtend = function (e) {
  38860. var i = this.tn.next();
  38861. if (!t.TYPEREF.test(i)) throw Error('illegal extend reference: ' + i);
  38862. var n = {
  38863. ref: i,
  38864. fields: [],
  38865. };
  38866. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38867. if (t.RULE.test(i)) this._parseMessageField(n, i);
  38868. else {
  38869. if (!t.TYPEREF.test(i)) throw Error('illegal extend token: ' + i);
  38870. if (!this.proto3) throw Error('illegal field rule: ' + i);
  38871. this._parseMessageField(n, 'optional', i);
  38872. }
  38873. return this.tn.omit(';'), e.messages.push(n), n;
  38874. }),
  38875. (c.toString = function () {
  38876. return 'Parser at line ' + this.tn.line;
  38877. }),
  38878. (o.Parser = l),
  38879. o
  38880. );
  38881. })(r, r.Lang)),
  38882. (r.Reflect = (function (e) {
  38883. function i(i) {
  38884. if (
  38885. ('string' == typeof i && (i = e.TYPES[i]), 'undefined' == typeof i.defaultValue)
  38886. )
  38887. throw Error('default value for type ' + i.name + ' is not supported');
  38888. return i == e.TYPES.bytes ? new t(0) : i.defaultValue;
  38889. }
  38890. function n(t, i) {
  38891. if (
  38892. t &&
  38893. 'number' == typeof t.low &&
  38894. 'number' == typeof t.high &&
  38895. 'boolean' == typeof t.unsigned &&
  38896. t.low === t.low &&
  38897. t.high === t.high
  38898. )
  38899. return new e.Long(t.low, t.high, 'undefined' == typeof i ? t.unsigned : i);
  38900. if ('string' == typeof t) return e.Long.fromString(t, i || !1, 10);
  38901. if ('number' == typeof t) return e.Long.fromNumber(t, i || !1);
  38902. throw Error('not convertible to Long');
  38903. }
  38904. function r(t, i) {
  38905. var n = i.readVarint32(),
  38906. o = 7 & n,
  38907. a = n >>> 3;
  38908. switch (o) {
  38909. case e.WIRE_TYPES.VARINT:
  38910. do n = i.readUint8();
  38911. while (128 === (128 & n));
  38912. break;
  38913. case e.WIRE_TYPES.BITS64:
  38914. i.offset += 8;
  38915. break;
  38916. case e.WIRE_TYPES.LDELIM:
  38917. (n = i.readVarint32()), (i.offset += n);
  38918. break;
  38919. case e.WIRE_TYPES.STARTGROUP:
  38920. r(a, i);
  38921. break;
  38922. case e.WIRE_TYPES.ENDGROUP:
  38923. if (a === t) return !1;
  38924. throw Error(
  38925. 'Illegal GROUPEND after unknown group: ' + a + ' (' + t + ' expected)'
  38926. );
  38927. case e.WIRE_TYPES.BITS32:
  38928. i.offset += 4;
  38929. break;
  38930. default:
  38931. throw Error('Illegal wire type in unknown group ' + t + ': ' + o);
  38932. }
  38933. return !0;
  38934. }
  38935. var o = {},
  38936. a = function (e, t, i) {
  38937. (this.builder = e), (this.parent = t), (this.name = i), this.className;
  38938. },
  38939. s = a.prototype;
  38940. (s.fqn = function () {
  38941. for (var e = this.name, t = this; ; ) {
  38942. if (((t = t.parent), null == t)) break;
  38943. e = t.name + '.' + e;
  38944. }
  38945. return e;
  38946. }),
  38947. (s.toString = function (e) {
  38948. return (e ? this.className + ' ' : '') + this.fqn();
  38949. }),
  38950. (s.build = function () {
  38951. throw Error(this.toString(!0) + ' cannot be built directly');
  38952. }),
  38953. (o.T = a);
  38954. var l = function (e, t, i, n, r) {
  38955. a.call(this, e, t, i),
  38956. (this.className = 'Namespace'),
  38957. (this.children = []),
  38958. (this.options = n || {}),
  38959. (this.syntax = r || 'proto2');
  38960. },
  38961. c = (l.prototype = Object.create(a.prototype));
  38962. (c.getChildren = function (e) {
  38963. if (((e = e || null), null == e)) return this.children.slice();
  38964. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  38965. this.children[i] instanceof e && t.push(this.children[i]);
  38966. return t;
  38967. }),
  38968. (c.addChild = function (e) {
  38969. var t;
  38970. if ((t = this.getChild(e.name)))
  38971. if (
  38972. t instanceof d.Field &&
  38973. t.name !== t.originalName &&
  38974. null === this.getChild(t.originalName)
  38975. )
  38976. t.name = t.originalName;
  38977. else {
  38978. if (
  38979. !(
  38980. e instanceof d.Field &&
  38981. e.name !== e.originalName &&
  38982. null === this.getChild(e.originalName)
  38983. )
  38984. )
  38985. throw Error(
  38986. 'Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name
  38987. );
  38988. e.name = e.originalName;
  38989. }
  38990. this.children.push(e);
  38991. }),
  38992. (c.getChild = function (e) {
  38993. for (
  38994. var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length;
  38995. i < n;
  38996. ++i
  38997. )
  38998. if (this.children[i][t] === e) return this.children[i];
  38999. return null;
  39000. }),
  39001. (c.resolve = function (e, t) {
  39002. var i = 'string' == typeof e ? e.split('.') : e,
  39003. n = this,
  39004. r = 0;
  39005. if ('' === i[r]) {
  39006. for (; null !== n.parent; ) n = n.parent;
  39007. r++;
  39008. }
  39009. var a;
  39010. do {
  39011. do {
  39012. if (!(n instanceof o.Namespace)) {
  39013. n = null;
  39014. break;
  39015. }
  39016. if (
  39017. ((a = n.getChild(i[r])),
  39018. !a || !(a instanceof o.T) || (t && !(a instanceof o.Namespace)))
  39019. ) {
  39020. n = null;
  39021. break;
  39022. }
  39023. (n = a), r++;
  39024. } while (r < i.length);
  39025. if (null != n) break;
  39026. if (null !== this.parent) return this.parent.resolve(e, t);
  39027. } while (null != n);
  39028. return n;
  39029. }),
  39030. (c.qn = function (e) {
  39031. var t = [],
  39032. i = e;
  39033. do t.unshift(i.name), (i = i.parent);
  39034. while (null !== i);
  39035. for (var n = 1; n <= t.length; n++) {
  39036. var r = t.slice(t.length - n);
  39037. if (e === this.resolve(r, e instanceof o.Namespace)) return r.join('.');
  39038. }
  39039. return e.fqn();
  39040. }),
  39041. (c.build = function () {
  39042. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  39043. (e = i[n]), e instanceof l && (t[e.name] = e.build());
  39044. return (
  39045. Object.defineProperty &&
  39046. Object.defineProperty(t, '$options', {
  39047. value: this.buildOpt(),
  39048. }),
  39049. t
  39050. );
  39051. }),
  39052. (c.buildOpt = function () {
  39053. for (
  39054. var e = {}, t = Object.keys(this.options), i = 0, n = t.length;
  39055. i < n;
  39056. ++i
  39057. ) {
  39058. var r = t[i],
  39059. o = this.options[t[i]];
  39060. e[r] = o;
  39061. }
  39062. return e;
  39063. }),
  39064. (c.getOption = function (e) {
  39065. return 'undefined' == typeof e
  39066. ? this.options
  39067. : 'undefined' != typeof this.options[e]
  39068. ? this.options[e]
  39069. : null;
  39070. }),
  39071. (o.Namespace = l);
  39072. var h = function (t, i, n, r) {
  39073. if (
  39074. ((this.type = t),
  39075. (this.resolvedType = i),
  39076. (this.isMapKey = n),
  39077. (this.syntax = r),
  39078. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  39079. )
  39080. throw Error('Invalid map key type: ' + t.name);
  39081. },
  39082. u = h.prototype;
  39083. (h.defaultFieldValue = i),
  39084. (u.verifyValue = function (i) {
  39085. function r(e, t) {
  39086. throw Error(
  39087. 'Illegal value for ' +
  39088. o.toString(!0) +
  39089. ' of type ' +
  39090. o.type.name +
  39091. ': ' +
  39092. e +
  39093. ' (' +
  39094. t +
  39095. ')'
  39096. );
  39097. }
  39098. var o = this;
  39099. switch (this.type) {
  39100. case e.TYPES.int32:
  39101. case e.TYPES.sint32:
  39102. case e.TYPES.sfixed32:
  39103. return (
  39104. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39105. r(typeof i, 'not an integer'),
  39106. i > 4294967295 ? 0 | i : i
  39107. );
  39108. case e.TYPES.uint32:
  39109. case e.TYPES.fixed32:
  39110. return (
  39111. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39112. r(typeof i, 'not an integer'),
  39113. i < 0 ? i >>> 0 : i
  39114. );
  39115. case e.TYPES.int64:
  39116. case e.TYPES.sint64:
  39117. case e.TYPES.sfixed64:
  39118. if (e.Long)
  39119. try {
  39120. return n(i, !1);
  39121. } catch (e) {
  39122. r(typeof i, e.message);
  39123. }
  39124. else r(typeof i, 'requires Long.js');
  39125. case e.TYPES.uint64:
  39126. case e.TYPES.fixed64:
  39127. if (e.Long)
  39128. try {
  39129. return n(i, !0);
  39130. } catch (e) {
  39131. r(typeof i, e.message);
  39132. }
  39133. else r(typeof i, 'requires Long.js');
  39134. case e.TYPES.bool:
  39135. return 'boolean' != typeof i && r(typeof i, 'not a boolean'), i;
  39136. case e.TYPES.float:
  39137. case e.TYPES.double:
  39138. return 'number' != typeof i && r(typeof i, 'not a number'), i;
  39139. case e.TYPES.string:
  39140. return (
  39141. 'string' == typeof i ||
  39142. (i && i instanceof String) ||
  39143. r(typeof i, 'not a string'),
  39144. '' + i
  39145. );
  39146. case e.TYPES.bytes:
  39147. return t.isByteBuffer(i) ? i : t.wrap(i, 'base64');
  39148. case e.TYPES.enum:
  39149. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  39150. for (l = 0; l < a.length; l++) {
  39151. if (a[l].name == i) return a[l].id;
  39152. if (a[l].id == i) return a[l].id;
  39153. }
  39154. if ('proto3' === this.syntax)
  39155. return (
  39156. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39157. r(typeof i, 'not an integer'),
  39158. (i > 4294967295 || i < 0) && r(typeof i, 'not in range for uint32'),
  39159. i
  39160. );
  39161. r(i, 'not a valid enum value');
  39162. case e.TYPES.group:
  39163. case e.TYPES.message:
  39164. if (
  39165. ((i && 'object' == typeof i) || r(typeof i, 'object expected'),
  39166. i instanceof this.resolvedType.clazz)
  39167. )
  39168. return i;
  39169. if (i instanceof e.Builder.Message) {
  39170. var s = {};
  39171. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l]);
  39172. i = s;
  39173. }
  39174. return new this.resolvedType.clazz(i);
  39175. }
  39176. throw Error(
  39177. '[INTERNAL] Illegal value for ' +
  39178. this.toString(!0) +
  39179. ': ' +
  39180. i +
  39181. ' (undefined type ' +
  39182. this.type +
  39183. ')'
  39184. );
  39185. }),
  39186. (u.calculateLength = function (i, n) {
  39187. if (null === n) return 0;
  39188. var r;
  39189. switch (this.type) {
  39190. case e.TYPES.int32:
  39191. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  39192. case e.TYPES.uint32:
  39193. return t.calculateVarint32(n);
  39194. case e.TYPES.sint32:
  39195. return t.calculateVarint32(t.zigZagEncode32(n));
  39196. case e.TYPES.fixed32:
  39197. case e.TYPES.sfixed32:
  39198. case e.TYPES.float:
  39199. return 4;
  39200. case e.TYPES.int64:
  39201. case e.TYPES.uint64:
  39202. return t.calculateVarint64(n);
  39203. case e.TYPES.sint64:
  39204. return t.calculateVarint64(t.zigZagEncode64(n));
  39205. case e.TYPES.fixed64:
  39206. case e.TYPES.sfixed64:
  39207. return 8;
  39208. case e.TYPES.bool:
  39209. return 1;
  39210. case e.TYPES.enum:
  39211. return t.calculateVarint32(n);
  39212. case e.TYPES.double:
  39213. return 8;
  39214. case e.TYPES.string:
  39215. return (r = t.calculateUTF8Bytes(n)), t.calculateVarint32(r) + r;
  39216. case e.TYPES.bytes:
  39217. if (n.remaining() < 0)
  39218. throw Error(
  39219. 'Illegal value for ' +
  39220. this.toString(!0) +
  39221. ': ' +
  39222. n.remaining() +
  39223. ' bytes remaining'
  39224. );
  39225. return t.calculateVarint32(n.remaining()) + n.remaining();
  39226. case e.TYPES.message:
  39227. return (r = this.resolvedType.calculate(n)), t.calculateVarint32(r) + r;
  39228. case e.TYPES.group:
  39229. return (
  39230. (r = this.resolvedType.calculate(n)),
  39231. r + t.calculateVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  39232. );
  39233. }
  39234. throw Error(
  39235. '[INTERNAL] Illegal value to encode in ' +
  39236. this.toString(!0) +
  39237. ': ' +
  39238. n +
  39239. ' (unknown type)'
  39240. );
  39241. }),
  39242. (u.encodeValue = function (i, n, r) {
  39243. if (null === n) return r;
  39244. switch (this.type) {
  39245. case e.TYPES.int32:
  39246. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  39247. break;
  39248. case e.TYPES.uint32:
  39249. r.writeVarint32(n);
  39250. break;
  39251. case e.TYPES.sint32:
  39252. r.writeVarint32ZigZag(n);
  39253. break;
  39254. case e.TYPES.fixed32:
  39255. r.writeUint32(n);
  39256. break;
  39257. case e.TYPES.sfixed32:
  39258. r.writeInt32(n);
  39259. break;
  39260. case e.TYPES.int64:
  39261. case e.TYPES.uint64:
  39262. r.writeVarint64(n);
  39263. break;
  39264. case e.TYPES.sint64:
  39265. r.writeVarint64ZigZag(n);
  39266. break;
  39267. case e.TYPES.fixed64:
  39268. r.writeUint64(n);
  39269. break;
  39270. case e.TYPES.sfixed64:
  39271. r.writeInt64(n);
  39272. break;
  39273. case e.TYPES.bool:
  39274. 'string' == typeof n
  39275. ? r.writeVarint32('false' === n.toLowerCase() ? 0 : !!n)
  39276. : r.writeVarint32(n ? 1 : 0);
  39277. break;
  39278. case e.TYPES.enum:
  39279. r.writeVarint32(n);
  39280. break;
  39281. case e.TYPES.float:
  39282. r.writeFloat32(n);
  39283. break;
  39284. case e.TYPES.double:
  39285. r.writeFloat64(n);
  39286. break;
  39287. case e.TYPES.string:
  39288. r.writeVString(n);
  39289. break;
  39290. case e.TYPES.bytes:
  39291. if (n.remaining() < 0)
  39292. throw Error(
  39293. 'Illegal value for ' +
  39294. this.toString(!0) +
  39295. ': ' +
  39296. n.remaining() +
  39297. ' bytes remaining'
  39298. );
  39299. var o = n.offset;
  39300. r.writeVarint32(n.remaining()), r.append(n), (n.offset = o);
  39301. break;
  39302. case e.TYPES.message:
  39303. var a = new t().LE();
  39304. this.resolvedType.encode(n, a),
  39305. r.writeVarint32(a.offset),
  39306. r.append(a.flip());
  39307. break;
  39308. case e.TYPES.group:
  39309. this.resolvedType.encode(n, r),
  39310. r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP);
  39311. break;
  39312. default:
  39313. throw Error(
  39314. '[INTERNAL] Illegal value to encode in ' +
  39315. this.toString(!0) +
  39316. ': ' +
  39317. n +
  39318. ' (unknown type)'
  39319. );
  39320. }
  39321. return r;
  39322. }),
  39323. (u.decode = function (t, i, n) {
  39324. if (i != this.type.wireType) throw Error('Unexpected wire type for element');
  39325. var r, o;
  39326. switch (this.type) {
  39327. case e.TYPES.int32:
  39328. return 0 | t.readVarint32();
  39329. case e.TYPES.uint32:
  39330. return t.readVarint32() >>> 0;
  39331. case e.TYPES.sint32:
  39332. return 0 | t.readVarint32ZigZag();
  39333. case e.TYPES.fixed32:
  39334. return t.readUint32() >>> 0;
  39335. case e.TYPES.sfixed32:
  39336. return 0 | t.readInt32();
  39337. case e.TYPES.int64:
  39338. return t.readVarint64();
  39339. case e.TYPES.uint64:
  39340. return t.readVarint64().toUnsigned();
  39341. case e.TYPES.sint64:
  39342. return t.readVarint64ZigZag();
  39343. case e.TYPES.fixed64:
  39344. return t.readUint64();
  39345. case e.TYPES.sfixed64:
  39346. return t.readInt64();
  39347. case e.TYPES.bool:
  39348. return !!t.readVarint32();
  39349. case e.TYPES.enum:
  39350. return t.readVarint32();
  39351. case e.TYPES.float:
  39352. return t.readFloat();
  39353. case e.TYPES.double:
  39354. return t.readDouble();
  39355. case e.TYPES.string:
  39356. return t.readVString();
  39357. case e.TYPES.bytes:
  39358. if (((o = t.readVarint32()), t.remaining() < o))
  39359. throw Error(
  39360. 'Illegal number of bytes for ' +
  39361. this.toString(!0) +
  39362. ': ' +
  39363. o +
  39364. ' required but got only ' +
  39365. t.remaining()
  39366. );
  39367. return (r = t.clone()), (r.limit = r.offset + o), (t.offset += o), r;
  39368. case e.TYPES.message:
  39369. return (o = t.readVarint32()), this.resolvedType.decode(t, o);
  39370. case e.TYPES.group:
  39371. return this.resolvedType.decode(t, -1, n);
  39372. }
  39373. throw Error('[INTERNAL] Illegal decode type');
  39374. }),
  39375. (u.valueFromString = function (i) {
  39376. if (!this.isMapKey)
  39377. throw Error('valueFromString() called on non-map-key element');
  39378. switch (this.type) {
  39379. case e.TYPES.int32:
  39380. case e.TYPES.sint32:
  39381. case e.TYPES.sfixed32:
  39382. case e.TYPES.uint32:
  39383. case e.TYPES.fixed32:
  39384. return this.verifyValue(parseInt(i));
  39385. case e.TYPES.int64:
  39386. case e.TYPES.sint64:
  39387. case e.TYPES.sfixed64:
  39388. case e.TYPES.uint64:
  39389. case e.TYPES.fixed64:
  39390. return this.verifyValue(i);
  39391. case e.TYPES.bool:
  39392. return 'true' === i;
  39393. case e.TYPES.string:
  39394. return this.verifyValue(i);
  39395. case e.TYPES.bytes:
  39396. return t.fromBinary(i);
  39397. }
  39398. }),
  39399. (u.valueToString = function (t) {
  39400. if (!this.isMapKey)
  39401. throw Error('valueToString() called on non-map-key element');
  39402. return this.type === e.TYPES.bytes ? t.toString('binary') : t.toString();
  39403. }),
  39404. (o.Element = h);
  39405. var d = function (e, t, i, n, r, o) {
  39406. l.call(this, e, t, i, n, o),
  39407. (this.className = 'Message'),
  39408. (this.extensions = void 0),
  39409. (this.clazz = null),
  39410. (this.isGroup = !!r),
  39411. (this._fields = null),
  39412. (this._fieldsById = null),
  39413. (this._fieldsByName = null);
  39414. },
  39415. p = (d.prototype = Object.create(l.prototype));
  39416. (p.build = function (i) {
  39417. if (this.clazz && !i) return this.clazz;
  39418. var n = (function (e, i) {
  39419. function n(i, r, o, a) {
  39420. if (null === i || 'object' != typeof i) {
  39421. if (a && a instanceof e.Reflect.Enum) {
  39422. var s = e.Reflect.Enum.getName(a.object, i);
  39423. if (null !== s) return s;
  39424. }
  39425. return i;
  39426. }
  39427. if (t.isByteBuffer(i)) return r ? i.toBase64() : i.toBuffer();
  39428. if (e.Long.isLong(i)) return o ? i.toString() : e.Long.fromValue(i);
  39429. var l;
  39430. if (Array.isArray(i))
  39431. return (
  39432. (l = []),
  39433. i.forEach(function (e, t) {
  39434. l[t] = n(e, r, o, a);
  39435. }),
  39436. l
  39437. );
  39438. if (((l = {}), i instanceof e.Map)) {
  39439. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  39440. l[i.keyElem.valueToString(h.value[0])] = n(
  39441. h.value[1],
  39442. r,
  39443. o,
  39444. i.valueElem.resolvedType
  39445. );
  39446. return l;
  39447. }
  39448. var u = i.$type,
  39449. d = void 0;
  39450. for (var p in i)
  39451. i.hasOwnProperty(p) &&
  39452. (u && (d = u.getChild(p))
  39453. ? (l[p] = n(i[p], r, o, d.resolvedType))
  39454. : (l[p] = n(i[p], r, o)));
  39455. return l;
  39456. }
  39457. var r = i.getChildren(e.Reflect.Message.Field),
  39458. o = i.getChildren(e.Reflect.Message.OneOf),
  39459. a = function (n, s) {
  39460. e.Builder.Message.call(this);
  39461. for (var l = 0, c = o.length; l < c; ++l) this[o[l].name] = null;
  39462. for (l = 0, c = r.length; l < c; ++l) {
  39463. var h = r[l];
  39464. (this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null),
  39465. (!h.required && 'proto3' !== i.syntax) ||
  39466. null === h.defaultValue ||
  39467. (this[h.name] = h.defaultValue);
  39468. }
  39469. if (arguments.length > 0) {
  39470. var u;
  39471. if (
  39472. 1 !== arguments.length ||
  39473. null === n ||
  39474. 'object' != typeof n ||
  39475. !('function' != typeof n.encode || n instanceof a) ||
  39476. Array.isArray(n) ||
  39477. n instanceof e.Map ||
  39478. t.isByteBuffer(n) ||
  39479. n instanceof ArrayBuffer ||
  39480. (e.Long && n instanceof e.Long)
  39481. )
  39482. for (l = 0, c = arguments.length; l < c; ++l)
  39483. 'undefined' != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  39484. else this.$set(n);
  39485. }
  39486. },
  39487. s = (a.prototype = Object.create(e.Builder.Message.prototype));
  39488. (s.add = function (t, n, r) {
  39489. var o = i._fieldsByName[t];
  39490. if (!r) {
  39491. if (!o) throw Error(this + '#' + t + ' is undefined');
  39492. if (!(o instanceof e.Reflect.Message.Field))
  39493. throw Error(this + '#' + t + ' is not a field: ' + o.toString(!0));
  39494. if (!o.repeated) throw Error(this + '#' + t + ' is not a repeated field');
  39495. n = o.verifyValue(n, !0);
  39496. }
  39497. return null === this[t] && (this[t] = []), this[t].push(n), this;
  39498. }),
  39499. (s.$add = s.add),
  39500. (s.set = function (t, n, r) {
  39501. if (t && 'object' == typeof t) {
  39502. r = n;
  39503. for (var o in t)
  39504. t.hasOwnProperty(o) &&
  39505. 'undefined' != typeof (n = t[o]) &&
  39506. this.$set(o, n, r);
  39507. return this;
  39508. }
  39509. var a = i._fieldsByName[t];
  39510. if (r) this[t] = n;
  39511. else {
  39512. if (!a) throw Error(this + '#' + t + ' is not a field: undefined');
  39513. if (!(a instanceof e.Reflect.Message.Field))
  39514. throw Error(this + '#' + t + ' is not a field: ' + a.toString(!0));
  39515. this[a.name] = n = a.verifyValue(n);
  39516. }
  39517. if (a && a.oneof) {
  39518. var s = this[a.oneof.name];
  39519. null !== n
  39520. ? (null !== s && s !== a.name && (this[s] = null),
  39521. (this[a.oneof.name] = a.name))
  39522. : s === t && (this[a.oneof.name] = null);
  39523. }
  39524. return this;
  39525. }),
  39526. (s.$set = s.set),
  39527. (s.get = function (t, n) {
  39528. if (n) return this[t];
  39529. var r = i._fieldsByName[t];
  39530. if (!(r && r instanceof e.Reflect.Message.Field))
  39531. throw Error(this + '#' + t + ' is not a field: undefined');
  39532. if (!(r instanceof e.Reflect.Message.Field))
  39533. throw Error(this + '#' + t + ' is not a field: ' + r.toString(!0));
  39534. return this[r.name];
  39535. }),
  39536. (s.$get = s.get);
  39537. for (var l = 0; l < r.length; l++) {
  39538. var c = r[l];
  39539. c instanceof e.Reflect.Message.ExtensionField ||
  39540. (i.builder.options.populateAccessors &&
  39541. (function (e) {
  39542. var t = e.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  39543. return e.toUpperCase().replace('_', '');
  39544. });
  39545. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  39546. var n = e.originalName.replace(/([A-Z])/g, function (e) {
  39547. return '_' + e;
  39548. }),
  39549. r = function (t, i) {
  39550. return (this[e.name] = i ? t : e.verifyValue(t)), this;
  39551. },
  39552. o = function () {
  39553. return this[e.name];
  39554. };
  39555. null === i.getChild('set' + t) && (s['set' + t] = r),
  39556. null === i.getChild('set_' + n) && (s['set_' + n] = r),
  39557. null === i.getChild('get' + t) && (s['get' + t] = o),
  39558. null === i.getChild('get_' + n) && (s['get_' + n] = o);
  39559. })(c));
  39560. }
  39561. (s.encode = function (e, n) {
  39562. 'boolean' == typeof e && ((n = e), (e = void 0));
  39563. var r = !1;
  39564. e || ((e = new t()), (r = !0));
  39565. var o = e.littleEndian;
  39566. try {
  39567. return i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o);
  39568. } catch (t) {
  39569. throw (e.LE(o), t);
  39570. }
  39571. }),
  39572. (a.encode = function (e, t, i) {
  39573. return new a(e).encode(t, i);
  39574. }),
  39575. (s.calculate = function () {
  39576. return i.calculate(this);
  39577. }),
  39578. (s.encodeDelimited = function (e, n) {
  39579. var r = !1;
  39580. e || ((e = new t()), (r = !0));
  39581. var o = new t().LE();
  39582. return (
  39583. i.encode(this, o, n).flip(),
  39584. e.writeVarint32(o.remaining()),
  39585. e.append(o),
  39586. r ? e.flip() : e
  39587. );
  39588. }),
  39589. (s.encodeAB = function () {
  39590. try {
  39591. return this.encode().toArrayBuffer();
  39592. } catch (e) {
  39593. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e);
  39594. }
  39595. }),
  39596. (s.toArrayBuffer = s.encodeAB),
  39597. (s.encodeNB = function () {
  39598. try {
  39599. return this.encode().toBuffer();
  39600. } catch (e) {
  39601. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e);
  39602. }
  39603. }),
  39604. (s.toBuffer = s.encodeNB),
  39605. (s.encode64 = function () {
  39606. try {
  39607. return this.encode().toBase64();
  39608. } catch (e) {
  39609. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e);
  39610. }
  39611. }),
  39612. (s.toBase64 = s.encode64),
  39613. (s.encodeHex = function () {
  39614. try {
  39615. return this.encode().toHex();
  39616. } catch (e) {
  39617. throw (e.encoded && (e.encoded = e.encoded.toHex()), e);
  39618. }
  39619. }),
  39620. (s.toHex = s.encodeHex),
  39621. (s.toRaw = function (e, t) {
  39622. return n(this, !!e, !!t, this.$type);
  39623. }),
  39624. (s.encodeJSON = function () {
  39625. return JSON.stringify(n(this, !0, !0, this.$type));
  39626. }),
  39627. (a.decode = function (e, n, r) {
  39628. 'string' == typeof n && ((r = n), (n = -1)),
  39629. 'string' == typeof e && (e = t.wrap(e, r ? r : 'base64')),
  39630. (e = t.isByteBuffer(e) ? e : t.wrap(e));
  39631. var o = e.littleEndian;
  39632. try {
  39633. var a = i.decode(e.LE());
  39634. return e.LE(o), a;
  39635. } catch (t) {
  39636. throw (e.LE(o), t);
  39637. }
  39638. }),
  39639. (a.decodeDelimited = function (e, n) {
  39640. if (
  39641. ('string' == typeof e && (e = t.wrap(e, n ? n : 'base64')),
  39642. (e = t.isByteBuffer(e) ? e : t.wrap(e)),
  39643. e.remaining() < 1)
  39644. )
  39645. return null;
  39646. var r = e.offset,
  39647. o = e.readVarint32();
  39648. if (e.remaining() < o) return (e.offset = r), null;
  39649. try {
  39650. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  39651. return (e.offset += o), a;
  39652. } catch (t) {
  39653. throw ((e.offset += o), t);
  39654. }
  39655. }),
  39656. (a.decode64 = function (e) {
  39657. return a.decode(e, 'base64');
  39658. }),
  39659. (a.decodeHex = function (e) {
  39660. return a.decode(e, 'hex');
  39661. }),
  39662. (a.decodeJSON = function (e) {
  39663. return new a(JSON.parse(e));
  39664. }),
  39665. (s.toString = function () {
  39666. return i.toString();
  39667. });
  39668. return (
  39669. Object.defineProperty &&
  39670. (Object.defineProperty(a, '$options', {
  39671. value: i.buildOpt(),
  39672. }),
  39673. Object.defineProperty(s, '$options', {
  39674. value: a.$options,
  39675. }),
  39676. Object.defineProperty(a, '$type', {
  39677. value: i,
  39678. }),
  39679. Object.defineProperty(s, '$type', {
  39680. value: i,
  39681. })),
  39682. a
  39683. );
  39684. })(e, this);
  39685. (this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {});
  39686. for (var r, o = 0, a = this.children.length; o < a; o++)
  39687. if (
  39688. ((r = this.children[o]), r instanceof A || r instanceof d || r instanceof E)
  39689. ) {
  39690. if (n.hasOwnProperty(r.name))
  39691. throw Error(
  39692. 'Illegal reflect child of ' +
  39693. this.toString(!0) +
  39694. ': ' +
  39695. r.toString(!0) +
  39696. " cannot override static property '" +
  39697. r.name +
  39698. "'"
  39699. );
  39700. n[r.name] = r.build();
  39701. } else if (r instanceof d.Field)
  39702. r.build(),
  39703. this._fields.push(r),
  39704. (this._fieldsById[r.id] = r),
  39705. (this._fieldsByName[r.name] = r);
  39706. else if (!(r instanceof d.OneOf || r instanceof I))
  39707. throw Error(
  39708. 'Illegal reflect child of ' +
  39709. this.toString(!0) +
  39710. ': ' +
  39711. this.children[o].toString(!0)
  39712. );
  39713. return (this.clazz = n);
  39714. }),
  39715. (p.encode = function (e, t, i) {
  39716. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  39717. (n = this._fields[a]),
  39718. (r = e[n.name]),
  39719. n.required && null === r
  39720. ? null === o && (o = n)
  39721. : n.encode(i ? r : n.verifyValue(r), t, e);
  39722. if (null !== o) {
  39723. var l = Error(
  39724. 'Missing at least one required field for ' + this.toString(!0) + ': ' + o
  39725. );
  39726. throw ((l.encoded = t), l);
  39727. }
  39728. return t;
  39729. }),
  39730. (p.calculate = function (e) {
  39731. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  39732. if (((t = this._fields[r]), (i = e[t.name]), t.required && null === i))
  39733. throw Error(
  39734. 'Missing at least one required field for ' + this.toString(!0) + ': ' + t
  39735. );
  39736. n += t.calculate(i, e);
  39737. }
  39738. return n;
  39739. }),
  39740. (p.decode = function (t, i, n) {
  39741. i = 'number' == typeof i ? i : -1;
  39742. for (
  39743. var o, a, s, l, c = t.offset, h = new this.clazz();
  39744. t.offset < c + i || (i === -1 && t.remaining() > 0);
  39745. ) {
  39746. if (
  39747. ((o = t.readVarint32()),
  39748. (a = 7 & o),
  39749. (s = o >>> 3),
  39750. a === e.WIRE_TYPES.ENDGROUP)
  39751. ) {
  39752. if (s !== n)
  39753. throw Error(
  39754. 'Illegal group end indicator for ' +
  39755. this.toString(!0) +
  39756. ': ' +
  39757. s +
  39758. ' (' +
  39759. (n ? n + ' expected' : 'not a group') +
  39760. ')'
  39761. );
  39762. break;
  39763. }
  39764. if ((l = this._fieldsById[s])) {
  39765. if (l.repeated && !l.options.packed) h[l.name].push(l.decode(a, t));
  39766. else if (l.map) {
  39767. var u = l.decode(a, t);
  39768. h[l.name].set(u[0], u[1]);
  39769. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  39770. var d = h[l.oneof.name];
  39771. null !== d && d !== l.name && (h[d] = null), (h[l.oneof.name] = l.name);
  39772. }
  39773. } else
  39774. switch (a) {
  39775. case e.WIRE_TYPES.VARINT:
  39776. t.readVarint32();
  39777. break;
  39778. case e.WIRE_TYPES.BITS32:
  39779. t.offset += 4;
  39780. break;
  39781. case e.WIRE_TYPES.BITS64:
  39782. t.offset += 8;
  39783. break;
  39784. case e.WIRE_TYPES.LDELIM:
  39785. var p = t.readVarint32();
  39786. t.offset += p;
  39787. break;
  39788. case e.WIRE_TYPES.STARTGROUP:
  39789. for (; r(s, t); );
  39790. break;
  39791. default:
  39792. throw Error(
  39793. 'Illegal wire type for unknown field ' +
  39794. s +
  39795. ' in ' +
  39796. this.toString(!0) +
  39797. '#decode: ' +
  39798. a
  39799. );
  39800. }
  39801. }
  39802. for (var f = 0, g = this._fields.length; f < g; ++f)
  39803. if (((l = this._fields[f]), null === h[l.name]))
  39804. if ('proto3' === this.syntax) h[l.name] = l.defaultValue;
  39805. else {
  39806. if (l.required) {
  39807. var m = Error(
  39808. 'Missing at least one required field for ' +
  39809. this.toString(!0) +
  39810. ': ' +
  39811. l.name
  39812. );
  39813. throw ((m.decoded = h), m);
  39814. }
  39815. e.populateDefaults &&
  39816. null !== l.defaultValue &&
  39817. (h[l.name] = l.defaultValue);
  39818. }
  39819. return h;
  39820. }),
  39821. (o.Message = d);
  39822. var f = function (t, i, n, r, o, s, l, c, h, u) {
  39823. a.call(this, t, i, s),
  39824. (this.className = 'Message.Field'),
  39825. (this.required = 'required' === n),
  39826. (this.repeated = 'repeated' === n),
  39827. (this.map = 'map' === n),
  39828. (this.keyType = r || null),
  39829. (this.type = o),
  39830. (this.resolvedType = null),
  39831. (this.id = l),
  39832. (this.options = c || {}),
  39833. (this.defaultValue = null),
  39834. (this.oneof = h || null),
  39835. (this.syntax = u || 'proto2'),
  39836. (this.originalName = this.name),
  39837. (this.element = null),
  39838. (this.keyElement = null),
  39839. !this.builder.options.convertFieldsToCamelCase ||
  39840. this instanceof d.ExtensionField ||
  39841. (this.name = e.Util.toCamelCase(this.name));
  39842. },
  39843. g = (f.prototype = Object.create(a.prototype));
  39844. (g.build = function () {
  39845. (this.element = new h(this.type, this.resolvedType, !1, this.syntax)),
  39846. this.map && (this.keyElement = new h(this.keyType, void 0, !0, this.syntax)),
  39847. 'proto3' !== this.syntax || this.repeated || this.map
  39848. ? 'undefined' != typeof this.options.default &&
  39849. (this.defaultValue = this.verifyValue(this.options.default))
  39850. : (this.defaultValue = h.defaultFieldValue(this.type));
  39851. }),
  39852. (g.verifyValue = function (t, i) {
  39853. function n(e, t) {
  39854. throw Error(
  39855. 'Illegal value for ' +
  39856. r.toString(!0) +
  39857. ' of type ' +
  39858. r.type.name +
  39859. ': ' +
  39860. e +
  39861. ' (' +
  39862. t +
  39863. ')'
  39864. );
  39865. }
  39866. i = i || !1;
  39867. var r = this;
  39868. if (null === t)
  39869. return (
  39870. this.required && n(typeof t, 'required'),
  39871. 'proto3' === this.syntax &&
  39872. this.type !== e.TYPES.message &&
  39873. n(typeof t, 'proto3 field without field presence cannot be null'),
  39874. null
  39875. );
  39876. var o;
  39877. if (this.repeated && !i) {
  39878. Array.isArray(t) || (t = [t]);
  39879. var a = [];
  39880. for (o = 0; o < t.length; o++) a.push(this.element.verifyValue(t[o]));
  39881. return a;
  39882. }
  39883. return this.map && !i
  39884. ? t instanceof e.Map
  39885. ? t
  39886. : (t instanceof Object ||
  39887. n(typeof t, 'expected ProtoBuf.Map or raw object for map field'),
  39888. new e.Map(this, t))
  39889. : (!this.repeated && Array.isArray(t) && n(typeof t, 'no array expected'),
  39890. this.element.verifyValue(t));
  39891. }),
  39892. (g.hasWirePresence = function (t, i) {
  39893. if ('proto3' !== this.syntax) return null !== t;
  39894. if (this.oneof && i[this.oneof.name] === this.name) return !0;
  39895. switch (this.type) {
  39896. case e.TYPES.int32:
  39897. case e.TYPES.sint32:
  39898. case e.TYPES.sfixed32:
  39899. case e.TYPES.uint32:
  39900. case e.TYPES.fixed32:
  39901. return 0 !== t;
  39902. case e.TYPES.int64:
  39903. case e.TYPES.sint64:
  39904. case e.TYPES.sfixed64:
  39905. case e.TYPES.uint64:
  39906. case e.TYPES.fixed64:
  39907. return 0 !== t.low || 0 !== t.high;
  39908. case e.TYPES.bool:
  39909. return t;
  39910. case e.TYPES.float:
  39911. case e.TYPES.double:
  39912. return 0 !== t;
  39913. case e.TYPES.string:
  39914. return t.length > 0;
  39915. case e.TYPES.bytes:
  39916. return t.remaining() > 0;
  39917. case e.TYPES.enum:
  39918. return 0 !== t;
  39919. case e.TYPES.message:
  39920. return null !== t;
  39921. default:
  39922. return !0;
  39923. }
  39924. }),
  39925. (g.encode = function (i, n, r) {
  39926. if (null === this.type || 'object' != typeof this.type)
  39927. throw Error(
  39928. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  39929. );
  39930. if (null === i || (this.repeated && 0 == i.length)) return n;
  39931. try {
  39932. if (this.repeated) {
  39933. var o;
  39934. if (
  39935. this.options.packed &&
  39936. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  39937. ) {
  39938. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  39939. n.ensureCapacity((n.offset += 1));
  39940. var a = n.offset;
  39941. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n);
  39942. var s = n.offset - a,
  39943. l = t.calculateVarint32(s);
  39944. if (l > 1) {
  39945. var c = n.slice(a, n.offset);
  39946. (a += l - 1), (n.offset = a), n.append(c);
  39947. }
  39948. n.writeVarint32(s, a - l);
  39949. } else
  39950. for (o = 0; o < i.length; o++)
  39951. n.writeVarint32((this.id << 3) | this.type.wireType),
  39952. this.element.encodeValue(this.id, i[o], n);
  39953. } else
  39954. this.map
  39955. ? i.forEach(function (i, r, o) {
  39956. var a =
  39957. t.calculateVarint32(8 | this.keyType.wireType) +
  39958. this.keyElement.calculateLength(1, r) +
  39959. t.calculateVarint32(16 | this.type.wireType) +
  39960. this.element.calculateLength(2, i);
  39961. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  39962. n.writeVarint32(a),
  39963. n.writeVarint32(8 | this.keyType.wireType),
  39964. this.keyElement.encodeValue(1, r, n),
  39965. n.writeVarint32(16 | this.type.wireType),
  39966. this.element.encodeValue(2, i, n);
  39967. }, this)
  39968. : this.hasWirePresence(i, r) &&
  39969. (n.writeVarint32((this.id << 3) | this.type.wireType),
  39970. this.element.encodeValue(this.id, i, n));
  39971. } catch (e) {
  39972. throw Error(
  39973. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  39974. );
  39975. }
  39976. return n;
  39977. }),
  39978. (g.calculate = function (i, n) {
  39979. if (
  39980. ((i = this.verifyValue(i)),
  39981. null === this.type || 'object' != typeof this.type)
  39982. )
  39983. throw Error(
  39984. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  39985. );
  39986. if (null === i || (this.repeated && 0 == i.length)) return 0;
  39987. var r = 0;
  39988. try {
  39989. if (this.repeated) {
  39990. var o, a;
  39991. if (
  39992. this.options.packed &&
  39993. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  39994. ) {
  39995. for (
  39996. r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  39997. a = 0,
  39998. o = 0;
  39999. o < i.length;
  40000. o++
  40001. )
  40002. a += this.element.calculateLength(this.id, i[o]);
  40003. (r += t.calculateVarint32(a)), (r += a);
  40004. } else
  40005. for (o = 0; o < i.length; o++)
  40006. (r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40007. (r += this.element.calculateLength(this.id, i[o]));
  40008. } else
  40009. this.map
  40010. ? i.forEach(function (i, n, o) {
  40011. var a =
  40012. t.calculateVarint32(8 | this.keyType.wireType) +
  40013. this.keyElement.calculateLength(1, n) +
  40014. t.calculateVarint32(16 | this.type.wireType) +
  40015. this.element.calculateLength(2, i);
  40016. (r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM)),
  40017. (r += t.calculateVarint32(a)),
  40018. (r += a);
  40019. }, this)
  40020. : this.hasWirePresence(i, n) &&
  40021. ((r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40022. (r += this.element.calculateLength(this.id, i)));
  40023. } catch (e) {
  40024. throw Error(
  40025. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  40026. );
  40027. }
  40028. return r;
  40029. }),
  40030. (g.decode = function (t, i, n) {
  40031. var r,
  40032. o,
  40033. a =
  40034. (!this.map && t == this.type.wireType) ||
  40035. (!n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM) ||
  40036. (this.map && t == e.WIRE_TYPES.LDELIM);
  40037. if (!a)
  40038. throw Error(
  40039. 'Illegal wire type for field ' +
  40040. this.toString(!0) +
  40041. ': ' +
  40042. t +
  40043. ' (' +
  40044. this.type.wireType +
  40045. ' expected)'
  40046. );
  40047. if (
  40048. t == e.WIRE_TYPES.LDELIM &&
  40049. this.repeated &&
  40050. this.options.packed &&
  40051. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 &&
  40052. !n
  40053. ) {
  40054. (o = i.readVarint32()), (o = i.offset + o);
  40055. for (var s = []; i.offset < o; )
  40056. s.push(this.decode(this.type.wireType, i, !0));
  40057. return s;
  40058. }
  40059. if (this.map) {
  40060. var l = h.defaultFieldValue(this.keyType);
  40061. if (
  40062. ((r = h.defaultFieldValue(this.type)),
  40063. (o = i.readVarint32()),
  40064. i.remaining() < o)
  40065. )
  40066. throw Error(
  40067. 'Illegal number of bytes for ' +
  40068. this.toString(!0) +
  40069. ': ' +
  40070. o +
  40071. ' required but got only ' +
  40072. i.remaining()
  40073. );
  40074. var c = i.clone();
  40075. for (c.limit = c.offset + o, i.offset += o; c.remaining() > 0; ) {
  40076. var u = c.readVarint32();
  40077. t = 7 & u;
  40078. var d = u >>> 3;
  40079. if (1 === d) l = this.keyElement.decode(c, t, d);
  40080. else {
  40081. if (2 !== d)
  40082. throw Error('Unexpected tag in map field key/value submessage');
  40083. r = this.element.decode(c, t, d);
  40084. }
  40085. }
  40086. return [l, r];
  40087. }
  40088. return this.element.decode(i, t, this.id);
  40089. }),
  40090. (o.Message.Field = f);
  40091. var m = function (e, t, i, n, r, o, a) {
  40092. f.call(this, e, t, i, null, n, r, o, a), this.extension;
  40093. };
  40094. (m.prototype = Object.create(f.prototype)), (o.Message.ExtensionField = m);
  40095. var v = function (e, t, i) {
  40096. a.call(this, e, t, i), (this.fields = []);
  40097. };
  40098. o.Message.OneOf = v;
  40099. var A = function (e, t, i, n, r) {
  40100. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null);
  40101. };
  40102. A.getName = function (e, t) {
  40103. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  40104. if (e[(i = n[r])] === t) return i;
  40105. return null;
  40106. };
  40107. var y = (A.prototype = Object.create(l.prototype));
  40108. (y.build = function (t) {
  40109. if (this.object && !t) return this.object;
  40110. for (
  40111. var i = new e.Builder.Enum(),
  40112. n = this.getChildren(A.Value),
  40113. r = 0,
  40114. o = n.length;
  40115. r < o;
  40116. ++r
  40117. )
  40118. i[n[r].name] = n[r].id;
  40119. return (
  40120. Object.defineProperty &&
  40121. Object.defineProperty(i, '$options', {
  40122. value: this.buildOpt(),
  40123. enumerable: !1,
  40124. }),
  40125. (this.object = i)
  40126. );
  40127. }),
  40128. (o.Enum = A);
  40129. var C = function (e, t, i, n) {
  40130. a.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n);
  40131. };
  40132. (C.prototype = Object.create(a.prototype)), (o.Enum.Value = C);
  40133. var I = function (e, t, i, n) {
  40134. a.call(this, e, t, i), (this.field = n);
  40135. };
  40136. (I.prototype = Object.create(a.prototype)), (o.Extension = I);
  40137. var E = function (e, t, i, n) {
  40138. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null);
  40139. },
  40140. b = (E.prototype = Object.create(l.prototype));
  40141. (b.build = function (i) {
  40142. return this.clazz && !i
  40143. ? this.clazz
  40144. : (this.clazz = (function (e, i) {
  40145. for (
  40146. var n = function (t) {
  40147. e.Builder.Service.call(this),
  40148. (this.rpcImpl =
  40149. t ||
  40150. function (e, t, i) {
  40151. setTimeout(
  40152. i.bind(
  40153. this,
  40154. Error(
  40155. 'Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services'
  40156. )
  40157. ),
  40158. 0
  40159. );
  40160. });
  40161. },
  40162. r = (n.prototype = Object.create(e.Builder.Service.prototype)),
  40163. o = i.getChildren(e.Reflect.Service.RPCMethod),
  40164. a = 0;
  40165. a < o.length;
  40166. a++
  40167. )
  40168. !(function (e) {
  40169. (r[e.name] = function (n, r) {
  40170. try {
  40171. try {
  40172. n = e.resolvedRequestType.clazz.decode(t.wrap(n));
  40173. } catch (e) {
  40174. if (!(e instanceof TypeError)) throw e;
  40175. }
  40176. if (null === n || 'object' != typeof n)
  40177. throw Error('Illegal arguments');
  40178. n instanceof e.resolvedRequestType.clazz ||
  40179. (n = new e.resolvedRequestType.clazz(n)),
  40180. this.rpcImpl(e.fqn(), n, function (t, n) {
  40181. if (t) return void r(t);
  40182. null === n && (n = '');
  40183. try {
  40184. n = e.resolvedResponseType.clazz.decode(n);
  40185. } catch (e) {}
  40186. return n && n instanceof e.resolvedResponseType.clazz
  40187. ? void r(null, n)
  40188. : void r(
  40189. Error(
  40190. 'Illegal response type received in service method ' +
  40191. i.name +
  40192. '#' +
  40193. e.name
  40194. )
  40195. );
  40196. });
  40197. } catch (e) {
  40198. setTimeout(r.bind(this, e), 0);
  40199. }
  40200. }),
  40201. (n[e.name] = function (t, i, r) {
  40202. new n(t)[e.name](i, r);
  40203. }),
  40204. Object.defineProperty &&
  40205. (Object.defineProperty(n[e.name], '$options', {
  40206. value: e.buildOpt(),
  40207. }),
  40208. Object.defineProperty(r[e.name], '$options', {
  40209. value: n[e.name].$options,
  40210. }));
  40211. })(o[a]);
  40212. return (
  40213. Object.defineProperty &&
  40214. (Object.defineProperty(n, '$options', {
  40215. value: i.buildOpt(),
  40216. }),
  40217. Object.defineProperty(r, '$options', {
  40218. value: n.$options,
  40219. }),
  40220. Object.defineProperty(n, '$type', {
  40221. value: i,
  40222. }),
  40223. Object.defineProperty(r, '$type', {
  40224. value: i,
  40225. })),
  40226. n
  40227. );
  40228. })(e, this));
  40229. }),
  40230. (o.Service = E);
  40231. var w = function (e, t, i, n) {
  40232. a.call(this, e, t, i),
  40233. (this.className = 'Service.Method'),
  40234. (this.options = n || {});
  40235. },
  40236. _ = (w.prototype = Object.create(a.prototype));
  40237. (_.buildOpt = c.buildOpt), (o.Service.Method = w);
  40238. var T = function (e, t, i, n, r, o, a, s) {
  40239. w.call(this, e, t, i, s),
  40240. (this.className = 'Service.RPCMethod'),
  40241. (this.requestName = n),
  40242. (this.responseName = r),
  40243. (this.requestStream = o),
  40244. (this.responseStream = a),
  40245. (this.resolvedRequestType = null),
  40246. (this.resolvedResponseType = null);
  40247. };
  40248. return (T.prototype = Object.create(w.prototype)), (o.Service.RPCMethod = T), o;
  40249. })(r)),
  40250. (r.Builder = (function (t, i, n) {
  40251. function r(e) {
  40252. e.messages &&
  40253. e.messages.forEach(function (t) {
  40254. (t.syntax = e.syntax), r(t);
  40255. }),
  40256. e.enums &&
  40257. e.enums.forEach(function (t) {
  40258. t.syntax = e.syntax;
  40259. });
  40260. }
  40261. var o = function (e) {
  40262. (this.ns = new n.Namespace(this, null, '')),
  40263. (this.ptr = this.ns),
  40264. (this.resolved = !1),
  40265. (this.result = null),
  40266. (this.files = {}),
  40267. (this.importRoot = null),
  40268. (this.options = e || {});
  40269. },
  40270. a = o.prototype;
  40271. return (
  40272. (o.isMessage = function (e) {
  40273. return (
  40274. 'string' == typeof e.name &&
  40275. 'undefined' == typeof e.values &&
  40276. 'undefined' == typeof e.rpc
  40277. );
  40278. }),
  40279. (o.isMessageField = function (e) {
  40280. return (
  40281. 'string' == typeof e.rule &&
  40282. 'string' == typeof e.name &&
  40283. 'string' == typeof e.type &&
  40284. 'undefined' != typeof e.id
  40285. );
  40286. }),
  40287. (o.isEnum = function (e) {
  40288. return (
  40289. 'string' == typeof e.name &&
  40290. !(
  40291. 'undefined' == typeof e.values ||
  40292. !Array.isArray(e.values) ||
  40293. 0 === e.values.length
  40294. )
  40295. );
  40296. }),
  40297. (o.isService = function (e) {
  40298. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc);
  40299. }),
  40300. (o.isExtend = function (e) {
  40301. return 'string' == typeof e.ref;
  40302. }),
  40303. (a.reset = function () {
  40304. return (this.ptr = this.ns), this;
  40305. }),
  40306. (a.define = function (e) {
  40307. if ('string' != typeof e || !i.TYPEREF.test(e))
  40308. throw Error('illegal namespace: ' + e);
  40309. return (
  40310. e.split('.').forEach(function (e) {
  40311. var t = this.ptr.getChild(e);
  40312. null === t && this.ptr.addChild((t = new n.Namespace(this, this.ptr, e))),
  40313. (this.ptr = t);
  40314. }, this),
  40315. this
  40316. );
  40317. }),
  40318. (a.create = function (e) {
  40319. if (!e) return this;
  40320. if (Array.isArray(e)) {
  40321. if (0 === e.length) return this;
  40322. e = e.slice();
  40323. } else e = [e];
  40324. for (var i = [e]; i.length > 0; ) {
  40325. if (((e = i.pop()), !Array.isArray(e)))
  40326. throw Error('not a valid namespace: ' + JSON.stringify(e));
  40327. for (; e.length > 0; ) {
  40328. var r = e.shift();
  40329. if (o.isMessage(r)) {
  40330. var a = new n.Message(
  40331. this,
  40332. this.ptr,
  40333. r.name,
  40334. r.options,
  40335. r.isGroup,
  40336. r.syntax
  40337. ),
  40338. s = {};
  40339. r.oneofs &&
  40340. Object.keys(r.oneofs).forEach(function (e) {
  40341. a.addChild((s[e] = new n.Message.OneOf(this, a, e)));
  40342. }, this),
  40343. r.fields &&
  40344. r.fields.forEach(function (e) {
  40345. if (null !== a.getChild(0 | e.id))
  40346. throw Error(
  40347. 'duplicate or invalid field id in ' + a.name + ': ' + e.id
  40348. );
  40349. if (e.options && 'object' != typeof e.options)
  40350. throw Error('illegal field options in ' + a.name + '#' + e.name);
  40351. var t = null;
  40352. if ('string' == typeof e.oneof && !(t = s[e.oneof]))
  40353. throw Error(
  40354. 'illegal oneof in ' + a.name + '#' + e.name + ': ' + e.oneof
  40355. );
  40356. (e = new n.Message.Field(
  40357. this,
  40358. a,
  40359. e.rule,
  40360. e.keytype,
  40361. e.type,
  40362. e.name,
  40363. e.id,
  40364. e.options,
  40365. t,
  40366. r.syntax
  40367. )),
  40368. t && t.fields.push(e),
  40369. a.addChild(e);
  40370. }, this);
  40371. var l = [];
  40372. if (
  40373. (r.enums &&
  40374. r.enums.forEach(function (e) {
  40375. l.push(e);
  40376. }),
  40377. r.messages &&
  40378. r.messages.forEach(function (e) {
  40379. l.push(e);
  40380. }),
  40381. r.services &&
  40382. r.services.forEach(function (e) {
  40383. l.push(e);
  40384. }),
  40385. r.extensions &&
  40386. ('number' == typeof r.extensions[0]
  40387. ? (a.extensions = [r.extensions])
  40388. : (a.extensions = r.extensions)),
  40389. this.ptr.addChild(a),
  40390. l.length > 0)
  40391. ) {
  40392. i.push(e), (e = l), (l = null), (this.ptr = a), (a = null);
  40393. continue;
  40394. }
  40395. l = null;
  40396. } else if (o.isEnum(r))
  40397. (a = new n.Enum(this, this.ptr, r.name, r.options, r.syntax)),
  40398. r.values.forEach(function (e) {
  40399. a.addChild(new n.Enum.Value(this, a, e.name, e.id));
  40400. }, this),
  40401. this.ptr.addChild(a);
  40402. else if (o.isService(r))
  40403. (a = new n.Service(this, this.ptr, r.name, r.options)),
  40404. Object.keys(r.rpc).forEach(function (e) {
  40405. var t = r.rpc[e];
  40406. a.addChild(
  40407. new n.Service.RPCMethod(
  40408. this,
  40409. a,
  40410. e,
  40411. t.request,
  40412. t.response,
  40413. !!t.request_stream,
  40414. !!t.response_stream,
  40415. t.options
  40416. )
  40417. );
  40418. }, this),
  40419. this.ptr.addChild(a);
  40420. else {
  40421. if (!o.isExtend(r))
  40422. throw Error('not a valid definition: ' + JSON.stringify(r));
  40423. if ((a = this.ptr.resolve(r.ref, !0)))
  40424. r.fields.forEach(function (e) {
  40425. if (null !== a.getChild(0 | e.id))
  40426. throw Error(
  40427. 'duplicate extended field id in ' + a.name + ': ' + e.id
  40428. );
  40429. if (a.extensions) {
  40430. var i = !1;
  40431. if (
  40432. (a.extensions.forEach(function (t) {
  40433. e.id >= t[0] && e.id <= t[1] && (i = !0);
  40434. }),
  40435. !i)
  40436. )
  40437. throw Error(
  40438. 'illegal extended field id in ' +
  40439. a.name +
  40440. ': ' +
  40441. e.id +
  40442. ' (not within valid ranges)'
  40443. );
  40444. }
  40445. var r = e.name;
  40446. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  40447. var o = new n.Message.ExtensionField(
  40448. this,
  40449. a,
  40450. e.rule,
  40451. e.type,
  40452. this.ptr.fqn() + '.' + r,
  40453. e.id,
  40454. e.options
  40455. ),
  40456. s = new n.Extension(this, this.ptr, e.name, o);
  40457. (o.extension = s), this.ptr.addChild(s), a.addChild(o);
  40458. }, this);
  40459. else if (!/\.?google\.protobuf\./.test(r.ref))
  40460. throw Error('extended message ' + r.ref + ' is not defined');
  40461. }
  40462. (r = null), (a = null);
  40463. }
  40464. (e = null), (this.ptr = this.ptr.parent);
  40465. }
  40466. return (this.resolved = !1), (this.result = null), this;
  40467. }),
  40468. (a.import = function (i, n) {
  40469. var o = '/';
  40470. if ('string' == typeof n) {
  40471. if ((t.Util.IS_NODE && (n = e('path').resolve(n)), this.files[n] === !0))
  40472. return this.reset();
  40473. this.files[n] = !0;
  40474. } else if ('object' == typeof n) {
  40475. var a = n.root;
  40476. t.Util.IS_NODE && (a = e('path').resolve(a)),
  40477. (a.indexOf('\\') >= 0 || n.file.indexOf('\\') >= 0) && (o = '\\');
  40478. var s = a + o + n.file;
  40479. if (this.files[s] === !0) return this.reset();
  40480. this.files[s] = !0;
  40481. }
  40482. if (i.imports && i.imports.length > 0) {
  40483. var l,
  40484. c = !1;
  40485. 'object' == typeof n
  40486. ? ((this.importRoot = n.root),
  40487. (c = !0),
  40488. (l = this.importRoot),
  40489. (n = n.file),
  40490. (l.indexOf('\\') >= 0 || n.indexOf('\\') >= 0) && (o = '\\'))
  40491. : 'string' == typeof n
  40492. ? this.importRoot
  40493. ? (l = this.importRoot)
  40494. : n.indexOf('/') >= 0
  40495. ? ((l = n.replace(/\/[^\/]*$/, '')), '' === l && (l = '/'))
  40496. : n.indexOf('\\') >= 0
  40497. ? ((l = n.replace(/\\[^\\]*$/, '')), (o = '\\'))
  40498. : (l = '.')
  40499. : (l = null);
  40500. for (var h = 0; h < i.imports.length; h++)
  40501. if ('string' == typeof i.imports[h]) {
  40502. if (!l) throw Error('cannot determine import root');
  40503. var u = i.imports[h];
  40504. if ('google/protobuf/descriptor.proto' === u) continue;
  40505. if (((u = l + o + u), this.files[u] === !0)) continue;
  40506. /\.proto$/i.test(u) &&
  40507. !t.DotProto &&
  40508. (u = u.replace(/\.proto$/, '.json'));
  40509. var d = t.Util.fetch(u);
  40510. if (null === d)
  40511. throw Error(
  40512. "failed to import '" + u + "' in '" + n + "': file not found"
  40513. );
  40514. /\.json$/i.test(u)
  40515. ? this.import(JSON.parse(d + ''), u)
  40516. : this.import(t.DotProto.Parser.parse(d), u);
  40517. } else
  40518. n
  40519. ? /\.(\w+)$/.test(n)
  40520. ? this.import(
  40521. i.imports[h],
  40522. n.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  40523. return t + '_import' + h + '.' + i;
  40524. })
  40525. )
  40526. : this.import(i.imports[h], n + '_import' + h)
  40527. : this.import(i.imports[h]);
  40528. c && (this.importRoot = null);
  40529. }
  40530. i.package && this.define(i.package), i.syntax && r(i);
  40531. var p = this.ptr;
  40532. return (
  40533. i.options &&
  40534. Object.keys(i.options).forEach(function (e) {
  40535. p.options[e] = i.options[e];
  40536. }),
  40537. i.messages && (this.create(i.messages), (this.ptr = p)),
  40538. i.enums && (this.create(i.enums), (this.ptr = p)),
  40539. i.services && (this.create(i.services), (this.ptr = p)),
  40540. i.extends && this.create(i.extends),
  40541. this.reset()
  40542. );
  40543. }),
  40544. (a.resolveAll = function () {
  40545. var e;
  40546. if (null == this.ptr || 'object' == typeof this.ptr.type) return this;
  40547. if (this.ptr instanceof n.Namespace)
  40548. this.ptr.children.forEach(function (e) {
  40549. (this.ptr = e), this.resolveAll();
  40550. }, this);
  40551. else if (this.ptr instanceof n.Message.Field) {
  40552. if (i.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type];
  40553. else {
  40554. if (!i.TYPEREF.test(this.ptr.type))
  40555. throw Error(
  40556. 'illegal type reference in ' +
  40557. this.ptr.toString(!0) +
  40558. ': ' +
  40559. this.ptr.type
  40560. );
  40561. if (
  40562. ((e = (
  40563. this.ptr instanceof n.Message.ExtensionField
  40564. ? this.ptr.extension.parent
  40565. : this.ptr.parent
  40566. ).resolve(this.ptr.type, !0)),
  40567. !e)
  40568. )
  40569. throw Error(
  40570. 'unresolvable type reference in ' +
  40571. this.ptr.toString(!0) +
  40572. ': ' +
  40573. this.ptr.type
  40574. );
  40575. if (((this.ptr.resolvedType = e), e instanceof n.Enum)) {
  40576. if (
  40577. ((this.ptr.type = t.TYPES.enum),
  40578. 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)
  40579. )
  40580. throw Error('proto3 message cannot reference proto2 enum');
  40581. } else {
  40582. if (!(e instanceof n.Message))
  40583. throw Error(
  40584. 'illegal type reference in ' +
  40585. this.ptr.toString(!0) +
  40586. ': ' +
  40587. this.ptr.type
  40588. );
  40589. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message;
  40590. }
  40591. }
  40592. if (this.ptr.map) {
  40593. if (!i.TYPE.test(this.ptr.keyType))
  40594. throw Error(
  40595. 'illegal key type for map field in ' +
  40596. this.ptr.toString(!0) +
  40597. ': ' +
  40598. this.ptr.keyType
  40599. );
  40600. this.ptr.keyType = t.TYPES[this.ptr.keyType];
  40601. }
  40602. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  40603. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  40604. throw Error('illegal service type in ' + this.ptr.toString(!0));
  40605. if (
  40606. ((e = this.ptr.parent.resolve(this.ptr.requestName, !0)),
  40607. !(e && e instanceof t.Reflect.Message))
  40608. )
  40609. throw Error(
  40610. 'Illegal type reference in ' +
  40611. this.ptr.toString(!0) +
  40612. ': ' +
  40613. this.ptr.requestName
  40614. );
  40615. if (
  40616. ((this.ptr.resolvedRequestType = e),
  40617. (e = this.ptr.parent.resolve(this.ptr.responseName, !0)),
  40618. !(e && e instanceof t.Reflect.Message))
  40619. )
  40620. throw Error(
  40621. 'Illegal type reference in ' +
  40622. this.ptr.toString(!0) +
  40623. ': ' +
  40624. this.ptr.responseName
  40625. );
  40626. this.ptr.resolvedResponseType = e;
  40627. } else if (
  40628. !(
  40629. this.ptr instanceof t.Reflect.Message.OneOf ||
  40630. this.ptr instanceof t.Reflect.Extension ||
  40631. this.ptr instanceof t.Reflect.Enum.Value
  40632. )
  40633. )
  40634. throw Error(
  40635. 'illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr
  40636. );
  40637. return this.reset();
  40638. }),
  40639. (a.build = function (e) {
  40640. if (
  40641. (this.reset(),
  40642. this.resolved ||
  40643. (this.resolveAll(), (this.resolved = !0), (this.result = null)),
  40644. null === this.result && (this.result = this.ns.build()),
  40645. !e)
  40646. )
  40647. return this.result;
  40648. for (
  40649. var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0;
  40650. n < t.length;
  40651. n++
  40652. ) {
  40653. if (!i[t[n]]) {
  40654. i = null;
  40655. break;
  40656. }
  40657. i = i[t[n]];
  40658. }
  40659. return i;
  40660. }),
  40661. (a.lookup = function (e, t) {
  40662. return e ? this.ns.resolve(e, t) : this.ns;
  40663. }),
  40664. (a.toString = function () {
  40665. return 'Builder';
  40666. }),
  40667. (o.Message = function () {}),
  40668. (o.Enum = function () {}),
  40669. (o.Service = function () {}),
  40670. o
  40671. );
  40672. })(r, r.Lang, r.Reflect)),
  40673. (r.Map = (function (e, t) {
  40674. function i(e) {
  40675. var t = 0;
  40676. return {
  40677. next: function () {
  40678. return t < e.length
  40679. ? {
  40680. done: !1,
  40681. value: e[t++],
  40682. }
  40683. : {
  40684. done: !0,
  40685. };
  40686. },
  40687. };
  40688. }
  40689. var n = function (e, i) {
  40690. if (!e.map) throw Error('field is not a map');
  40691. if (
  40692. ((this.field = e),
  40693. (this.keyElem = new t.Element(e.keyType, null, !0, e.syntax)),
  40694. (this.valueElem = new t.Element(e.type, e.resolvedType, !1, e.syntax)),
  40695. (this.map = {}),
  40696. Object.defineProperty(this, 'size', {
  40697. get: function () {
  40698. return Object.keys(this.map).length;
  40699. },
  40700. }),
  40701. i)
  40702. )
  40703. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  40704. var o = this.keyElem.valueFromString(n[r]),
  40705. a = this.valueElem.verifyValue(i[n[r]]);
  40706. this.map[this.keyElem.valueToString(o)] = {
  40707. key: o,
  40708. value: a,
  40709. };
  40710. }
  40711. },
  40712. r = n.prototype;
  40713. return (
  40714. (r.clear = function () {
  40715. this.map = {};
  40716. }),
  40717. (r.delete = function (e) {
  40718. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  40719. i = t in this.map;
  40720. return delete this.map[t], i;
  40721. }),
  40722. (r.entries = function () {
  40723. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  40724. t.push([(e = this.map[n[r]]).key, e.value]);
  40725. return i(t);
  40726. }),
  40727. (r.keys = function () {
  40728. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40729. e.push(this.map[t[n]].key);
  40730. return i(e);
  40731. }),
  40732. (r.values = function () {
  40733. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40734. e.push(this.map[t[n]].value);
  40735. return i(e);
  40736. }),
  40737. (r.forEach = function (e, t) {
  40738. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  40739. e.call(t, (i = this.map[n[r]]).value, i.key, this);
  40740. }),
  40741. (r.set = function (e, t) {
  40742. var i = this.keyElem.verifyValue(e),
  40743. n = this.valueElem.verifyValue(t);
  40744. return (
  40745. (this.map[this.keyElem.valueToString(i)] = {
  40746. key: i,
  40747. value: n,
  40748. }),
  40749. this
  40750. );
  40751. }),
  40752. (r.get = function (e) {
  40753. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  40754. if (t in this.map) return this.map[t].value;
  40755. }),
  40756. (r.has = function (e) {
  40757. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  40758. return t in this.map;
  40759. }),
  40760. n
  40761. );
  40762. })(r, r.Reflect)),
  40763. (r.loadProto = function (e, t, i) {
  40764. return (
  40765. ('string' == typeof t ||
  40766. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40767. ((i = t), (t = void 0)),
  40768. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  40769. );
  40770. }),
  40771. (r.protoFromString = r.loadProto),
  40772. (r.loadProtoFile = function (e, t, i) {
  40773. if (
  40774. (t && 'object' == typeof t
  40775. ? ((i = t), (t = null))
  40776. : (t && 'function' == typeof t) || (t = null),
  40777. t)
  40778. )
  40779. return r.Util.fetch(
  40780. 'string' == typeof e ? e : e.root + '/' + e.file,
  40781. function (n) {
  40782. if (null === n) return void t(Error('Failed to fetch file'));
  40783. try {
  40784. t(null, r.loadProto(n, i, e));
  40785. } catch (e) {
  40786. t(e);
  40787. }
  40788. }
  40789. );
  40790. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e);
  40791. return null === n ? null : r.loadProto(n, i, e);
  40792. }),
  40793. (r.protoFromFile = r.loadProtoFile),
  40794. (r.newBuilder = function (e) {
  40795. return (
  40796. (e = e || {}),
  40797. 'undefined' == typeof e.convertFieldsToCamelCase &&
  40798. (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  40799. 'undefined' == typeof e.populateAccessors &&
  40800. (e.populateAccessors = r.populateAccessors),
  40801. new r.Builder(e)
  40802. );
  40803. }),
  40804. (r.loadJson = function (e, t, i) {
  40805. return (
  40806. ('string' == typeof t ||
  40807. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40808. ((i = t), (t = null)),
  40809. (t && 'object' == typeof t) || (t = r.newBuilder()),
  40810. 'string' == typeof e && (e = JSON.parse(e)),
  40811. t.import(e, i),
  40812. t.resolveAll(),
  40813. t
  40814. );
  40815. }),
  40816. (r.loadJsonFile = function (e, t, i) {
  40817. if (
  40818. (t && 'object' == typeof t
  40819. ? ((i = t), (t = null))
  40820. : (t && 'function' == typeof t) || (t = null),
  40821. t)
  40822. )
  40823. return r.Util.fetch(
  40824. 'string' == typeof e ? e : e.root + '/' + e.file,
  40825. function (n) {
  40826. if (null === n) return void t(Error('Failed to fetch file'));
  40827. try {
  40828. t(null, r.loadJson(JSON.parse(n), i, e));
  40829. } catch (e) {
  40830. t(e);
  40831. }
  40832. }
  40833. );
  40834. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e);
  40835. return null === n ? null : r.loadJson(JSON.parse(n), i, e);
  40836. }),
  40837. r
  40838. );
  40839. });
  40840. }.call(this, e('_process')));
  40841. },
  40842. {
  40843. _process: 203,
  40844. bytebuffer: 215,
  40845. fs: 197,
  40846. path: 197,
  40847. },
  40848. ],
  40849. 215: [
  40850. function (e, t, i) {
  40851. !(function (i, n) {
  40852. 'function' == typeof define && define.amd
  40853. ? define(['long'], n)
  40854. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  40855. ? (t.exports = (function () {
  40856. var t;
  40857. try {
  40858. t = e('long');
  40859. } catch (e) {}
  40860. return n(t);
  40861. })())
  40862. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long));
  40863. })(this, function (e) {
  40864. 'use strict';
  40865. function t(e) {
  40866. var t = 0;
  40867. return function () {
  40868. return t < e.length ? e.charCodeAt(t++) : null;
  40869. };
  40870. }
  40871. function i() {
  40872. var e = [],
  40873. t = [];
  40874. return function () {
  40875. return 0 === arguments.length
  40876. ? t.join('') + l.apply(String, e)
  40877. : (e.length + arguments.length > 1024 &&
  40878. (t.push(l.apply(String, e)), (e.length = 0)),
  40879. void Array.prototype.push.apply(e, arguments));
  40880. };
  40881. }
  40882. function n(e, t, i, n, r) {
  40883. var o,
  40884. a,
  40885. s = 8 * r - n - 1,
  40886. l = (1 << s) - 1,
  40887. c = l >> 1,
  40888. h = -7,
  40889. u = i ? r - 1 : 0,
  40890. d = i ? -1 : 1,
  40891. p = e[t + u];
  40892. for (
  40893. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  40894. h > 0;
  40895. o = 256 * o + e[t + u], u += d, h -= 8
  40896. );
  40897. for (
  40898. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  40899. h > 0;
  40900. a = 256 * a + e[t + u], u += d, h -= 8
  40901. );
  40902. if (0 === o) o = 1 - c;
  40903. else {
  40904. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  40905. (a += Math.pow(2, n)), (o -= c);
  40906. }
  40907. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  40908. }
  40909. function r(e, t, i, n, r, o) {
  40910. var a,
  40911. s,
  40912. l,
  40913. c = 8 * o - r - 1,
  40914. h = (1 << c) - 1,
  40915. u = h >> 1,
  40916. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  40917. p = n ? 0 : o - 1,
  40918. f = n ? 1 : -1,
  40919. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  40920. for (
  40921. t = Math.abs(t),
  40922. isNaN(t) || t === 1 / 0
  40923. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  40924. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  40925. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  40926. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  40927. t * l >= 2 && (a++, (l /= 2)),
  40928. a + u >= h
  40929. ? ((s = 0), (a = h))
  40930. : a + u >= 1
  40931. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  40932. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  40933. r >= 8;
  40934. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  40935. );
  40936. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  40937. e[i + p - f] |= 128 * g;
  40938. }
  40939. var o = function (e, t, i) {
  40940. if (
  40941. ('undefined' == typeof e && (e = o.DEFAULT_CAPACITY),
  40942. 'undefined' == typeof t && (t = o.DEFAULT_ENDIAN),
  40943. 'undefined' == typeof i && (i = o.DEFAULT_NOASSERT),
  40944. !i)
  40945. ) {
  40946. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity');
  40947. (t = !!t), (i = !!i);
  40948. }
  40949. (this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  40950. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  40951. (this.offset = 0),
  40952. (this.markedOffset = -1),
  40953. (this.limit = e),
  40954. (this.littleEndian = t),
  40955. (this.noAssert = i);
  40956. };
  40957. (o.VERSION = '5.0.1'),
  40958. (o.LITTLE_ENDIAN = !0),
  40959. (o.BIG_ENDIAN = !1),
  40960. (o.DEFAULT_CAPACITY = 16),
  40961. (o.DEFAULT_ENDIAN = o.BIG_ENDIAN),
  40962. (o.DEFAULT_NOASSERT = !1),
  40963. (o.Long = e || null);
  40964. var a = o.prototype;
  40965. a.__isByteBuffer__,
  40966. Object.defineProperty(a, '__isByteBuffer__', {
  40967. value: !0,
  40968. enumerable: !1,
  40969. configurable: !1,
  40970. });
  40971. var s = new ArrayBuffer(0),
  40972. l = String.fromCharCode;
  40973. (o.accessor = function () {
  40974. return Uint8Array;
  40975. }),
  40976. (o.allocate = function (e, t, i) {
  40977. return new o(e, t, i);
  40978. }),
  40979. (o.concat = function (e, t, i, n) {
  40980. ('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0));
  40981. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  40982. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  40983. (r = e[s].limit - e[s].offset),
  40984. r > 0 && (a += r);
  40985. if (0 === a) return new o(0, i, n);
  40986. var c,
  40987. h = new o(a, i, n);
  40988. for (s = 0; s < l; )
  40989. (c = e[s++]),
  40990. (r = c.limit - c.offset),
  40991. r <= 0 ||
  40992. (h.view.set(c.view.subarray(c.offset, c.limit), h.offset), (h.offset += r));
  40993. return (h.limit = h.offset), (h.offset = 0), h;
  40994. }),
  40995. (o.isByteBuffer = function (e) {
  40996. return (e && e.__isByteBuffer__) === !0;
  40997. }),
  40998. (o.type = function () {
  40999. return ArrayBuffer;
  41000. }),
  41001. (o.wrap = function (e, t, i, n) {
  41002. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  41003. switch (('undefined' == typeof t && (t = 'utf8'), t)) {
  41004. case 'base64':
  41005. return o.fromBase64(e, i);
  41006. case 'hex':
  41007. return o.fromHex(e, i);
  41008. case 'binary':
  41009. return o.fromBinary(e, i);
  41010. case 'utf8':
  41011. return o.fromUTF8(e, i);
  41012. case 'debug':
  41013. return o.fromDebug(e, i);
  41014. default:
  41015. throw Error('Unsupported encoding: ' + t);
  41016. }
  41017. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer');
  41018. var r;
  41019. if (o.isByteBuffer(e)) return (r = a.clone.call(e)), (r.markedOffset = -1), r;
  41020. if (e instanceof Uint8Array)
  41021. (r = new o(0, i, n)),
  41022. e.length > 0 &&
  41023. ((r.buffer = e.buffer),
  41024. (r.offset = e.byteOffset),
  41025. (r.limit = e.byteOffset + e.byteLength),
  41026. (r.view = new Uint8Array(e.buffer)));
  41027. else if (e instanceof ArrayBuffer)
  41028. (r = new o(0, i, n)),
  41029. e.byteLength > 0 &&
  41030. ((r.buffer = e),
  41031. (r.offset = 0),
  41032. (r.limit = e.byteLength),
  41033. (r.view = e.byteLength > 0 ? new Uint8Array(e) : null));
  41034. else {
  41035. if ('[object Array]' !== Object.prototype.toString.call(e))
  41036. throw TypeError('Illegal buffer');
  41037. (r = new o(e.length, i, n)), (r.limit = e.length);
  41038. for (var s = 0; s < e.length; ++s) r.view[s] = e[s];
  41039. }
  41040. return r;
  41041. }),
  41042. (a.writeBitSet = function (e, t) {
  41043. var i = 'undefined' == typeof t;
  41044. if ((i && (t = this.offset), !this.noAssert)) {
  41045. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array');
  41046. if ('number' != typeof t || t % 1 !== 0)
  41047. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41048. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41049. throw RangeError(
  41050. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41051. );
  41052. }
  41053. var n,
  41054. r = t,
  41055. o = e.length,
  41056. a = o >> 3,
  41057. s = 0;
  41058. for (t += this.writeVarint32(o, t); a--; )
  41059. (n =
  41060. (1 & !!e[s++]) |
  41061. ((1 & !!e[s++]) << 1) |
  41062. ((1 & !!e[s++]) << 2) |
  41063. ((1 & !!e[s++]) << 3) |
  41064. ((1 & !!e[s++]) << 4) |
  41065. ((1 & !!e[s++]) << 5) |
  41066. ((1 & !!e[s++]) << 6) |
  41067. ((1 & !!e[s++]) << 7)),
  41068. this.writeByte(n, t++);
  41069. if (s < o) {
  41070. var l = 0;
  41071. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++;
  41072. this.writeByte(n, t++);
  41073. }
  41074. return i ? ((this.offset = t), this) : t - r;
  41075. }),
  41076. (a.readBitSet = function (e) {
  41077. var t = 'undefined' == typeof e;
  41078. t && (e = this.offset);
  41079. var i,
  41080. n = this.readVarint32(e),
  41081. r = n.value,
  41082. o = r >> 3,
  41083. a = 0,
  41084. s = [];
  41085. for (e += n.length; o--; )
  41086. (i = this.readByte(e++)),
  41087. (s[a++] = !!(1 & i)),
  41088. (s[a++] = !!(2 & i)),
  41089. (s[a++] = !!(4 & i)),
  41090. (s[a++] = !!(8 & i)),
  41091. (s[a++] = !!(16 & i)),
  41092. (s[a++] = !!(32 & i)),
  41093. (s[a++] = !!(64 & i)),
  41094. (s[a++] = !!(128 & i));
  41095. if (a < r) {
  41096. var l = 0;
  41097. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1);
  41098. }
  41099. return t && (this.offset = e), s;
  41100. }),
  41101. (a.readBytes = function (e, t) {
  41102. var i = 'undefined' == typeof t;
  41103. if ((i && (t = this.offset), !this.noAssert)) {
  41104. if ('number' != typeof t || t % 1 !== 0)
  41105. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41106. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength))
  41107. throw RangeError(
  41108. 'Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength
  41109. );
  41110. }
  41111. var n = this.slice(t, t + e);
  41112. return i && (this.offset += e), n;
  41113. }),
  41114. (a.writeBytes = a.append),
  41115. (a.writeInt8 = function (e, t) {
  41116. var i = 'undefined' == typeof t;
  41117. if ((i && (t = this.offset), !this.noAssert)) {
  41118. if ('number' != typeof e || e % 1 !== 0)
  41119. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41120. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41121. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41122. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41123. throw RangeError(
  41124. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41125. );
  41126. }
  41127. t += 1;
  41128. var n = this.buffer.byteLength;
  41129. return (
  41130. t > n && this.resize((n *= 2) > t ? n : t),
  41131. (t -= 1),
  41132. (this.view[t] = e),
  41133. i && (this.offset += 1),
  41134. this
  41135. );
  41136. }),
  41137. (a.writeByte = a.writeInt8),
  41138. (a.readInt8 = function (e) {
  41139. var t = 'undefined' == typeof e;
  41140. if ((t && (e = this.offset), !this.noAssert)) {
  41141. if ('number' != typeof e || e % 1 !== 0)
  41142. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41143. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41144. throw RangeError(
  41145. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41146. );
  41147. }
  41148. var i = this.view[e];
  41149. return 128 === (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i;
  41150. }),
  41151. (a.readByte = a.readInt8),
  41152. (a.writeUint8 = function (e, t) {
  41153. var i = 'undefined' == typeof t;
  41154. if ((i && (t = this.offset), !this.noAssert)) {
  41155. if ('number' != typeof e || e % 1 !== 0)
  41156. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41157. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41158. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41159. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41160. throw RangeError(
  41161. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41162. );
  41163. }
  41164. t += 1;
  41165. var n = this.buffer.byteLength;
  41166. return (
  41167. t > n && this.resize((n *= 2) > t ? n : t),
  41168. (t -= 1),
  41169. (this.view[t] = e),
  41170. i && (this.offset += 1),
  41171. this
  41172. );
  41173. }),
  41174. (a.writeUInt8 = a.writeUint8),
  41175. (a.readUint8 = function (e) {
  41176. var t = 'undefined' == typeof e;
  41177. if ((t && (e = this.offset), !this.noAssert)) {
  41178. if ('number' != typeof e || e % 1 !== 0)
  41179. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41180. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41181. throw RangeError(
  41182. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41183. );
  41184. }
  41185. var i = this.view[e];
  41186. return t && (this.offset += 1), i;
  41187. }),
  41188. (a.readUInt8 = a.readUint8),
  41189. (a.writeInt16 = function (e, t) {
  41190. var i = 'undefined' == typeof t;
  41191. if ((i && (t = this.offset), !this.noAssert)) {
  41192. if ('number' != typeof e || e % 1 !== 0)
  41193. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41194. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41195. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41196. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41197. throw RangeError(
  41198. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41199. );
  41200. }
  41201. t += 2;
  41202. var n = this.buffer.byteLength;
  41203. return (
  41204. t > n && this.resize((n *= 2) > t ? n : t),
  41205. (t -= 2),
  41206. this.littleEndian
  41207. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41208. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41209. i && (this.offset += 2),
  41210. this
  41211. );
  41212. }),
  41213. (a.writeShort = a.writeInt16),
  41214. (a.readInt16 = function (e) {
  41215. var t = 'undefined' == typeof e;
  41216. if ((t && (e = this.offset), !this.noAssert)) {
  41217. if ('number' != typeof e || e % 1 !== 0)
  41218. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41219. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41220. throw RangeError(
  41221. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41222. );
  41223. }
  41224. var i = 0;
  41225. return (
  41226. this.littleEndian
  41227. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41228. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41229. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  41230. t && (this.offset += 2),
  41231. i
  41232. );
  41233. }),
  41234. (a.readShort = a.readInt16),
  41235. (a.writeUint16 = function (e, t) {
  41236. var i = 'undefined' == typeof t;
  41237. if ((i && (t = this.offset), !this.noAssert)) {
  41238. if ('number' != typeof e || e % 1 !== 0)
  41239. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41240. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41241. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41242. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41243. throw RangeError(
  41244. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41245. );
  41246. }
  41247. t += 2;
  41248. var n = this.buffer.byteLength;
  41249. return (
  41250. t > n && this.resize((n *= 2) > t ? n : t),
  41251. (t -= 2),
  41252. this.littleEndian
  41253. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41254. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41255. i && (this.offset += 2),
  41256. this
  41257. );
  41258. }),
  41259. (a.writeUInt16 = a.writeUint16),
  41260. (a.readUint16 = function (e) {
  41261. var t = 'undefined' == typeof e;
  41262. if ((t && (e = this.offset), !this.noAssert)) {
  41263. if ('number' != typeof e || e % 1 !== 0)
  41264. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41265. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41266. throw RangeError(
  41267. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41268. );
  41269. }
  41270. var i = 0;
  41271. return (
  41272. this.littleEndian
  41273. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41274. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41275. t && (this.offset += 2),
  41276. i
  41277. );
  41278. }),
  41279. (a.readUInt16 = a.readUint16),
  41280. (a.writeInt32 = function (e, t) {
  41281. var i = 'undefined' == typeof t;
  41282. if ((i && (t = this.offset), !this.noAssert)) {
  41283. if ('number' != typeof e || e % 1 !== 0)
  41284. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41285. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41286. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41287. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41288. throw RangeError(
  41289. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41290. );
  41291. }
  41292. t += 4;
  41293. var n = this.buffer.byteLength;
  41294. return (
  41295. t > n && this.resize((n *= 2) > t ? n : t),
  41296. (t -= 4),
  41297. this.littleEndian
  41298. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41299. (this.view[t + 2] = (e >>> 16) & 255),
  41300. (this.view[t + 1] = (e >>> 8) & 255),
  41301. (this.view[t] = 255 & e))
  41302. : ((this.view[t] = (e >>> 24) & 255),
  41303. (this.view[t + 1] = (e >>> 16) & 255),
  41304. (this.view[t + 2] = (e >>> 8) & 255),
  41305. (this.view[t + 3] = 255 & e)),
  41306. i && (this.offset += 4),
  41307. this
  41308. );
  41309. }),
  41310. (a.writeInt = a.writeInt32),
  41311. (a.readInt32 = function (e) {
  41312. var t = 'undefined' == typeof e;
  41313. if ((t && (e = this.offset), !this.noAssert)) {
  41314. if ('number' != typeof e || e % 1 !== 0)
  41315. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41316. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41317. throw RangeError(
  41318. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41319. );
  41320. }
  41321. var i = 0;
  41322. return (
  41323. this.littleEndian
  41324. ? ((i = this.view[e + 2] << 16),
  41325. (i |= this.view[e + 1] << 8),
  41326. (i |= this.view[e]),
  41327. (i += (this.view[e + 3] << 24) >>> 0))
  41328. : ((i = this.view[e + 1] << 16),
  41329. (i |= this.view[e + 2] << 8),
  41330. (i |= this.view[e + 3]),
  41331. (i += (this.view[e] << 24) >>> 0)),
  41332. (i |= 0),
  41333. t && (this.offset += 4),
  41334. i
  41335. );
  41336. }),
  41337. (a.readInt = a.readInt32),
  41338. (a.writeUint32 = function (e, t) {
  41339. var i = 'undefined' == typeof t;
  41340. if ((i && (t = this.offset), !this.noAssert)) {
  41341. if ('number' != typeof e || e % 1 !== 0)
  41342. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41343. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41344. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41345. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41346. throw RangeError(
  41347. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41348. );
  41349. }
  41350. t += 4;
  41351. var n = this.buffer.byteLength;
  41352. return (
  41353. t > n && this.resize((n *= 2) > t ? n : t),
  41354. (t -= 4),
  41355. this.littleEndian
  41356. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41357. (this.view[t + 2] = (e >>> 16) & 255),
  41358. (this.view[t + 1] = (e >>> 8) & 255),
  41359. (this.view[t] = 255 & e))
  41360. : ((this.view[t] = (e >>> 24) & 255),
  41361. (this.view[t + 1] = (e >>> 16) & 255),
  41362. (this.view[t + 2] = (e >>> 8) & 255),
  41363. (this.view[t + 3] = 255 & e)),
  41364. i && (this.offset += 4),
  41365. this
  41366. );
  41367. }),
  41368. (a.writeUInt32 = a.writeUint32),
  41369. (a.readUint32 = function (e) {
  41370. var t = 'undefined' == typeof e;
  41371. if ((t && (e = this.offset), !this.noAssert)) {
  41372. if ('number' != typeof e || e % 1 !== 0)
  41373. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41374. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41375. throw RangeError(
  41376. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41377. );
  41378. }
  41379. var i = 0;
  41380. return (
  41381. this.littleEndian
  41382. ? ((i = this.view[e + 2] << 16),
  41383. (i |= this.view[e + 1] << 8),
  41384. (i |= this.view[e]),
  41385. (i += (this.view[e + 3] << 24) >>> 0))
  41386. : ((i = this.view[e + 1] << 16),
  41387. (i |= this.view[e + 2] << 8),
  41388. (i |= this.view[e + 3]),
  41389. (i += (this.view[e] << 24) >>> 0)),
  41390. t && (this.offset += 4),
  41391. i
  41392. );
  41393. }),
  41394. (a.readUInt32 = a.readUint32),
  41395. e &&
  41396. ((a.writeInt64 = function (t, i) {
  41397. var n = 'undefined' == typeof i;
  41398. if ((n && (i = this.offset), !this.noAssert)) {
  41399. if ('number' == typeof t) t = e.fromNumber(t);
  41400. else if ('string' == typeof t) t = e.fromString(t);
  41401. else if (!(t && t instanceof e))
  41402. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)');
  41403. if ('number' != typeof i || i % 1 !== 0)
  41404. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41405. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41406. throw RangeError(
  41407. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41408. );
  41409. }
  41410. 'number' == typeof t
  41411. ? (t = e.fromNumber(t))
  41412. : 'string' == typeof t && (t = e.fromString(t)),
  41413. (i += 8);
  41414. var r = this.buffer.byteLength;
  41415. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  41416. var o = t.low,
  41417. a = t.high;
  41418. return (
  41419. this.littleEndian
  41420. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41421. (this.view[i + 2] = (o >>> 16) & 255),
  41422. (this.view[i + 1] = (o >>> 8) & 255),
  41423. (this.view[i] = 255 & o),
  41424. (i += 4),
  41425. (this.view[i + 3] = (a >>> 24) & 255),
  41426. (this.view[i + 2] = (a >>> 16) & 255),
  41427. (this.view[i + 1] = (a >>> 8) & 255),
  41428. (this.view[i] = 255 & a))
  41429. : ((this.view[i] = (a >>> 24) & 255),
  41430. (this.view[i + 1] = (a >>> 16) & 255),
  41431. (this.view[i + 2] = (a >>> 8) & 255),
  41432. (this.view[i + 3] = 255 & a),
  41433. (i += 4),
  41434. (this.view[i] = (o >>> 24) & 255),
  41435. (this.view[i + 1] = (o >>> 16) & 255),
  41436. (this.view[i + 2] = (o >>> 8) & 255),
  41437. (this.view[i + 3] = 255 & o)),
  41438. n && (this.offset += 8),
  41439. this
  41440. );
  41441. }),
  41442. (a.writeLong = a.writeInt64),
  41443. (a.readInt64 = function (t) {
  41444. var i = 'undefined' == typeof t;
  41445. if ((i && (t = this.offset), !this.noAssert)) {
  41446. if ('number' != typeof t || t % 1 !== 0)
  41447. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41448. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41449. throw RangeError(
  41450. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41451. );
  41452. }
  41453. var n = 0,
  41454. r = 0;
  41455. this.littleEndian
  41456. ? ((n = this.view[t + 2] << 16),
  41457. (n |= this.view[t + 1] << 8),
  41458. (n |= this.view[t]),
  41459. (n += (this.view[t + 3] << 24) >>> 0),
  41460. (t += 4),
  41461. (r = this.view[t + 2] << 16),
  41462. (r |= this.view[t + 1] << 8),
  41463. (r |= this.view[t]),
  41464. (r += (this.view[t + 3] << 24) >>> 0))
  41465. : ((r = this.view[t + 1] << 16),
  41466. (r |= this.view[t + 2] << 8),
  41467. (r |= this.view[t + 3]),
  41468. (r += (this.view[t] << 24) >>> 0),
  41469. (t += 4),
  41470. (n = this.view[t + 1] << 16),
  41471. (n |= this.view[t + 2] << 8),
  41472. (n |= this.view[t + 3]),
  41473. (n += (this.view[t] << 24) >>> 0));
  41474. var o = new e(n, r, !1);
  41475. return i && (this.offset += 8), o;
  41476. }),
  41477. (a.readLong = a.readInt64),
  41478. (a.writeUint64 = function (t, i) {
  41479. var n = 'undefined' == typeof i;
  41480. if ((n && (i = this.offset), !this.noAssert)) {
  41481. if ('number' == typeof t) t = e.fromNumber(t);
  41482. else if ('string' == typeof t) t = e.fromString(t);
  41483. else if (!(t && t instanceof e))
  41484. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)');
  41485. if ('number' != typeof i || i % 1 !== 0)
  41486. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41487. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41488. throw RangeError(
  41489. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41490. );
  41491. }
  41492. 'number' == typeof t
  41493. ? (t = e.fromNumber(t))
  41494. : 'string' == typeof t && (t = e.fromString(t)),
  41495. (i += 8);
  41496. var r = this.buffer.byteLength;
  41497. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  41498. var o = t.low,
  41499. a = t.high;
  41500. return (
  41501. this.littleEndian
  41502. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41503. (this.view[i + 2] = (o >>> 16) & 255),
  41504. (this.view[i + 1] = (o >>> 8) & 255),
  41505. (this.view[i] = 255 & o),
  41506. (i += 4),
  41507. (this.view[i + 3] = (a >>> 24) & 255),
  41508. (this.view[i + 2] = (a >>> 16) & 255),
  41509. (this.view[i + 1] = (a >>> 8) & 255),
  41510. (this.view[i] = 255 & a))
  41511. : ((this.view[i] = (a >>> 24) & 255),
  41512. (this.view[i + 1] = (a >>> 16) & 255),
  41513. (this.view[i + 2] = (a >>> 8) & 255),
  41514. (this.view[i + 3] = 255 & a),
  41515. (i += 4),
  41516. (this.view[i] = (o >>> 24) & 255),
  41517. (this.view[i + 1] = (o >>> 16) & 255),
  41518. (this.view[i + 2] = (o >>> 8) & 255),
  41519. (this.view[i + 3] = 255 & o)),
  41520. n && (this.offset += 8),
  41521. this
  41522. );
  41523. }),
  41524. (a.writeUInt64 = a.writeUint64),
  41525. (a.readUint64 = function (t) {
  41526. var i = 'undefined' == typeof t;
  41527. if ((i && (t = this.offset), !this.noAssert)) {
  41528. if ('number' != typeof t || t % 1 !== 0)
  41529. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41530. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41531. throw RangeError(
  41532. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41533. );
  41534. }
  41535. var n = 0,
  41536. r = 0;
  41537. this.littleEndian
  41538. ? ((n = this.view[t + 2] << 16),
  41539. (n |= this.view[t + 1] << 8),
  41540. (n |= this.view[t]),
  41541. (n += (this.view[t + 3] << 24) >>> 0),
  41542. (t += 4),
  41543. (r = this.view[t + 2] << 16),
  41544. (r |= this.view[t + 1] << 8),
  41545. (r |= this.view[t]),
  41546. (r += (this.view[t + 3] << 24) >>> 0))
  41547. : ((r = this.view[t + 1] << 16),
  41548. (r |= this.view[t + 2] << 8),
  41549. (r |= this.view[t + 3]),
  41550. (r += (this.view[t] << 24) >>> 0),
  41551. (t += 4),
  41552. (n = this.view[t + 1] << 16),
  41553. (n |= this.view[t + 2] << 8),
  41554. (n |= this.view[t + 3]),
  41555. (n += (this.view[t] << 24) >>> 0));
  41556. var o = new e(n, r, !0);
  41557. return i && (this.offset += 8), o;
  41558. }),
  41559. (a.readUInt64 = a.readUint64)),
  41560. (a.writeFloat32 = function (e, t) {
  41561. var i = 'undefined' == typeof t;
  41562. if ((i && (t = this.offset), !this.noAssert)) {
  41563. if ('number' != typeof e)
  41564. throw TypeError('Illegal value: ' + e + ' (not a number)');
  41565. if ('number' != typeof t || t % 1 !== 0)
  41566. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41567. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41568. throw RangeError(
  41569. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41570. );
  41571. }
  41572. t += 4;
  41573. var n = this.buffer.byteLength;
  41574. return (
  41575. t > n && this.resize((n *= 2) > t ? n : t),
  41576. (t -= 4),
  41577. r(this.view, e, t, this.littleEndian, 23, 4),
  41578. i && (this.offset += 4),
  41579. this
  41580. );
  41581. }),
  41582. (a.writeFloat = a.writeFloat32),
  41583. (a.readFloat32 = function (e) {
  41584. var t = 'undefined' == typeof e;
  41585. if ((t && (e = this.offset), !this.noAssert)) {
  41586. if ('number' != typeof e || e % 1 !== 0)
  41587. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41588. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41589. throw RangeError(
  41590. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41591. );
  41592. }
  41593. var i = n(this.view, e, this.littleEndian, 23, 4);
  41594. return t && (this.offset += 4), i;
  41595. }),
  41596. (a.readFloat = a.readFloat32),
  41597. (a.writeFloat64 = function (e, t) {
  41598. var i = 'undefined' == typeof t;
  41599. if ((i && (t = this.offset), !this.noAssert)) {
  41600. if ('number' != typeof e)
  41601. throw TypeError('Illegal value: ' + e + ' (not a number)');
  41602. if ('number' != typeof t || t % 1 !== 0)
  41603. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41604. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41605. throw RangeError(
  41606. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41607. );
  41608. }
  41609. t += 8;
  41610. var n = this.buffer.byteLength;
  41611. return (
  41612. t > n && this.resize((n *= 2) > t ? n : t),
  41613. (t -= 8),
  41614. r(this.view, e, t, this.littleEndian, 52, 8),
  41615. i && (this.offset += 8),
  41616. this
  41617. );
  41618. }),
  41619. (a.writeDouble = a.writeFloat64),
  41620. (a.readFloat64 = function (e) {
  41621. var t = 'undefined' == typeof e;
  41622. if ((t && (e = this.offset), !this.noAssert)) {
  41623. if ('number' != typeof e || e % 1 !== 0)
  41624. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41625. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength))
  41626. throw RangeError(
  41627. 'Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength
  41628. );
  41629. }
  41630. var i = n(this.view, e, this.littleEndian, 52, 8);
  41631. return t && (this.offset += 8), i;
  41632. }),
  41633. (a.readDouble = a.readFloat64),
  41634. (o.MAX_VARINT32_BYTES = 5),
  41635. (o.calculateVarint32 = function (e) {
  41636. return (
  41637. (e >>>= 0), e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  41638. );
  41639. }),
  41640. (o.zigZagEncode32 = function (e) {
  41641. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0;
  41642. }),
  41643. (o.zigZagDecode32 = function (e) {
  41644. return ((e >>> 1) ^ -(1 & e)) | 0;
  41645. }),
  41646. (a.writeVarint32 = function (e, t) {
  41647. var i = 'undefined' == typeof t;
  41648. if ((i && (t = this.offset), !this.noAssert)) {
  41649. if ('number' != typeof e || e % 1 !== 0)
  41650. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41651. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41652. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41653. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41654. throw RangeError(
  41655. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41656. );
  41657. }
  41658. var n,
  41659. r = o.calculateVarint32(e);
  41660. t += r;
  41661. var a = this.buffer.byteLength;
  41662. for (t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0; e >= 128; )
  41663. (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7);
  41664. return (this.view[t++] = e), i ? ((this.offset = t), this) : r;
  41665. }),
  41666. (a.writeVarint32ZigZag = function (e, t) {
  41667. return this.writeVarint32(o.zigZagEncode32(e), t);
  41668. }),
  41669. (a.readVarint32 = function (e) {
  41670. var t = 'undefined' == typeof e;
  41671. if ((t && (e = this.offset), !this.noAssert)) {
  41672. if ('number' != typeof e || e % 1 !== 0)
  41673. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41674. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41675. throw RangeError(
  41676. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41677. );
  41678. }
  41679. var i,
  41680. n = 0,
  41681. r = 0;
  41682. do {
  41683. if (!this.noAssert && e > this.limit) {
  41684. var o = Error('Truncated');
  41685. throw ((o.truncated = !0), o);
  41686. }
  41687. (i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n;
  41688. } while (0 !== (128 & i));
  41689. return (
  41690. (r |= 0),
  41691. t
  41692. ? ((this.offset = e), r)
  41693. : {
  41694. value: r,
  41695. length: n,
  41696. }
  41697. );
  41698. }),
  41699. (a.readVarint32ZigZag = function (e) {
  41700. var t = this.readVarint32(e);
  41701. return (
  41702. 'object' == typeof t
  41703. ? (t.value = o.zigZagDecode32(t.value))
  41704. : (t = o.zigZagDecode32(t)),
  41705. t
  41706. );
  41707. }),
  41708. e &&
  41709. ((o.MAX_VARINT64_BYTES = 10),
  41710. (o.calculateVarint64 = function (t) {
  41711. 'number' == typeof t
  41712. ? (t = e.fromNumber(t))
  41713. : 'string' == typeof t && (t = e.fromString(t));
  41714. var i = t.toInt() >>> 0,
  41715. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  41716. r = t.shiftRightUnsigned(56).toInt() >>> 0;
  41717. return 0 == r
  41718. ? 0 == n
  41719. ? i < 16384
  41720. ? i < 128
  41721. ? 1
  41722. : 2
  41723. : i < 1 << 21
  41724. ? 3
  41725. : 4
  41726. : n < 16384
  41727. ? n < 128
  41728. ? 5
  41729. : 6
  41730. : n < 1 << 21
  41731. ? 7
  41732. : 8
  41733. : r < 128
  41734. ? 9
  41735. : 10;
  41736. }),
  41737. (o.zigZagEncode64 = function (t) {
  41738. return (
  41739. 'number' == typeof t
  41740. ? (t = e.fromNumber(t, !1))
  41741. : 'string' == typeof t
  41742. ? (t = e.fromString(t, !1))
  41743. : t.unsigned !== !1 && (t = t.toSigned()),
  41744. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  41745. );
  41746. }),
  41747. (o.zigZagDecode64 = function (t) {
  41748. return (
  41749. 'number' == typeof t
  41750. ? (t = e.fromNumber(t, !1))
  41751. : 'string' == typeof t
  41752. ? (t = e.fromString(t, !1))
  41753. : t.unsigned !== !1 && (t = t.toSigned()),
  41754. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  41755. );
  41756. }),
  41757. (a.writeVarint64 = function (t, i) {
  41758. var n = 'undefined' == typeof i;
  41759. if ((n && (i = this.offset), !this.noAssert)) {
  41760. if ('number' == typeof t) t = e.fromNumber(t);
  41761. else if ('string' == typeof t) t = e.fromString(t);
  41762. else if (!(t && t instanceof e))
  41763. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)');
  41764. if ('number' != typeof i || i % 1 !== 0)
  41765. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41766. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41767. throw RangeError(
  41768. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41769. );
  41770. }
  41771. 'number' == typeof t
  41772. ? (t = e.fromNumber(t, !1))
  41773. : 'string' == typeof t
  41774. ? (t = e.fromString(t, !1))
  41775. : t.unsigned !== !1 && (t = t.toSigned());
  41776. var r = o.calculateVarint64(t),
  41777. a = t.toInt() >>> 0,
  41778. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  41779. l = t.shiftRightUnsigned(56).toInt() >>> 0;
  41780. i += r;
  41781. var c = this.buffer.byteLength;
  41782. switch ((i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)) {
  41783. case 10:
  41784. this.view[i + 9] = (l >>> 7) & 1;
  41785. case 9:
  41786. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  41787. case 8:
  41788. this.view[i + 7] = 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127;
  41789. case 7:
  41790. this.view[i + 6] = 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127;
  41791. case 6:
  41792. this.view[i + 5] = 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127;
  41793. case 5:
  41794. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  41795. case 4:
  41796. this.view[i + 3] = 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127;
  41797. case 3:
  41798. this.view[i + 2] = 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127;
  41799. case 2:
  41800. this.view[i + 1] = 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127;
  41801. case 1:
  41802. this.view[i] = 1 !== r ? 128 | a : 127 & a;
  41803. }
  41804. return n ? ((this.offset += r), this) : r;
  41805. }),
  41806. (a.writeVarint64ZigZag = function (e, t) {
  41807. return this.writeVarint64(o.zigZagEncode64(e), t);
  41808. }),
  41809. (a.readVarint64 = function (t) {
  41810. var i = 'undefined' == typeof t;
  41811. if ((i && (t = this.offset), !this.noAssert)) {
  41812. if ('number' != typeof t || t % 1 !== 0)
  41813. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41814. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength))
  41815. throw RangeError(
  41816. 'Illegal offset: 0 <= ' + t + ' (+1) <= ' + this.buffer.byteLength
  41817. );
  41818. }
  41819. var n = t,
  41820. r = 0,
  41821. o = 0,
  41822. a = 0,
  41823. s = 0;
  41824. if (
  41825. ((s = this.view[t++]),
  41826. (r = 127 & s),
  41827. 128 & s &&
  41828. ((s = this.view[t++]),
  41829. (r |= (127 & s) << 7),
  41830. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41831. ((s = this.view[t++]),
  41832. (r |= (127 & s) << 14),
  41833. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41834. ((s = this.view[t++]),
  41835. (r |= (127 & s) << 21),
  41836. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41837. ((s = this.view[t++]),
  41838. (o = 127 & s),
  41839. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41840. ((s = this.view[t++]),
  41841. (o |= (127 & s) << 7),
  41842. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41843. ((s = this.view[t++]),
  41844. (o |= (127 & s) << 14),
  41845. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41846. ((s = this.view[t++]),
  41847. (o |= (127 & s) << 21),
  41848. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41849. ((s = this.view[t++]),
  41850. (a = 127 & s),
  41851. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41852. ((s = this.view[t++]),
  41853. (a |= (127 & s) << 7),
  41854. 128 & s || (this.noAssert && 'undefined' == typeof s)))))))))))
  41855. )
  41856. throw Error('Buffer overrun');
  41857. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1);
  41858. return i
  41859. ? ((this.offset = t), l)
  41860. : {
  41861. value: l,
  41862. length: t - n,
  41863. };
  41864. }),
  41865. (a.readVarint64ZigZag = function (t) {
  41866. var i = this.readVarint64(t);
  41867. return (
  41868. i && i.value instanceof e
  41869. ? (i.value = o.zigZagDecode64(i.value))
  41870. : (i = o.zigZagDecode64(i)),
  41871. i
  41872. );
  41873. })),
  41874. (a.writeCString = function (e, i) {
  41875. var n = 'undefined' == typeof i;
  41876. n && (i = this.offset);
  41877. var r,
  41878. o = e.length;
  41879. if (!this.noAssert) {
  41880. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  41881. for (r = 0; r < o; ++r)
  41882. if (0 === e.charCodeAt(r))
  41883. throw RangeError('Illegal str: Contains NULL-characters');
  41884. if ('number' != typeof i || i % 1 !== 0)
  41885. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41886. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41887. throw RangeError(
  41888. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41889. );
  41890. }
  41891. (o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1);
  41892. var a = this.buffer.byteLength;
  41893. return (
  41894. i > a && this.resize((a *= 2) > i ? a : i),
  41895. (i -= o + 1),
  41896. h.encodeUTF16toUTF8(
  41897. t(e),
  41898. function (e) {
  41899. this.view[i++] = e;
  41900. }.bind(this)
  41901. ),
  41902. (this.view[i++] = 0),
  41903. n ? ((this.offset = i), this) : o
  41904. );
  41905. }),
  41906. (a.readCString = function (e) {
  41907. var t = 'undefined' == typeof e;
  41908. if ((t && (e = this.offset), !this.noAssert)) {
  41909. if ('number' != typeof e || e % 1 !== 0)
  41910. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41911. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41912. throw RangeError(
  41913. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41914. );
  41915. }
  41916. var n,
  41917. r = e,
  41918. o = -1;
  41919. return (
  41920. h.decodeUTF8toUTF16(
  41921. function () {
  41922. if (0 === o) return null;
  41923. if (e >= this.limit)
  41924. throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit);
  41925. return (o = this.view[e++]), 0 === o ? null : o;
  41926. }.bind(this),
  41927. (n = i()),
  41928. !0
  41929. ),
  41930. t
  41931. ? ((this.offset = e), n())
  41932. : {
  41933. string: n(),
  41934. length: e - r,
  41935. }
  41936. );
  41937. }),
  41938. (a.writeIString = function (e, i) {
  41939. var n = 'undefined' == typeof i;
  41940. if ((n && (i = this.offset), !this.noAssert)) {
  41941. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  41942. if ('number' != typeof i || i % 1 !== 0)
  41943. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41944. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41945. throw RangeError(
  41946. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41947. );
  41948. }
  41949. var r,
  41950. o = i;
  41951. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (i += 4 + r);
  41952. var a = this.buffer.byteLength;
  41953. if (
  41954. (i > a && this.resize((a *= 2) > i ? a : i),
  41955. (i -= 4 + r),
  41956. this.littleEndian
  41957. ? ((this.view[i + 3] = (r >>> 24) & 255),
  41958. (this.view[i + 2] = (r >>> 16) & 255),
  41959. (this.view[i + 1] = (r >>> 8) & 255),
  41960. (this.view[i] = 255 & r))
  41961. : ((this.view[i] = (r >>> 24) & 255),
  41962. (this.view[i + 1] = (r >>> 16) & 255),
  41963. (this.view[i + 2] = (r >>> 8) & 255),
  41964. (this.view[i + 3] = 255 & r)),
  41965. (i += 4),
  41966. h.encodeUTF16toUTF8(
  41967. t(e),
  41968. function (e) {
  41969. this.view[i++] = e;
  41970. }.bind(this)
  41971. ),
  41972. i !== o + 4 + r)
  41973. )
  41974. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + 4 + r));
  41975. return n ? ((this.offset = i), this) : i - o;
  41976. }),
  41977. (a.readIString = function (e) {
  41978. var t = 'undefined' == typeof e;
  41979. if ((t && (e = this.offset), !this.noAssert)) {
  41980. if ('number' != typeof e || e % 1 !== 0)
  41981. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41982. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41983. throw RangeError(
  41984. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41985. );
  41986. }
  41987. var i = e,
  41988. n = this.readUint32(e),
  41989. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4));
  41990. return (
  41991. (e += r.length),
  41992. t
  41993. ? ((this.offset = e), r.string)
  41994. : {
  41995. string: r.string,
  41996. length: e - i,
  41997. }
  41998. );
  41999. }),
  42000. (o.METRICS_CHARS = 'c'),
  42001. (o.METRICS_BYTES = 'b'),
  42002. (a.writeUTF8String = function (e, i) {
  42003. var n = 'undefined' == typeof i;
  42004. if ((n && (i = this.offset), !this.noAssert)) {
  42005. if ('number' != typeof i || i % 1 !== 0)
  42006. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42007. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42008. throw RangeError(
  42009. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42010. );
  42011. }
  42012. var r,
  42013. o = i;
  42014. (r = h.calculateUTF16asUTF8(t(e))[1]), (i += r);
  42015. var a = this.buffer.byteLength;
  42016. return (
  42017. i > a && this.resize((a *= 2) > i ? a : i),
  42018. (i -= r),
  42019. h.encodeUTF16toUTF8(
  42020. t(e),
  42021. function (e) {
  42022. this.view[i++] = e;
  42023. }.bind(this)
  42024. ),
  42025. n ? ((this.offset = i), this) : i - o
  42026. );
  42027. }),
  42028. (a.writeString = a.writeUTF8String),
  42029. (o.calculateUTF8Chars = function (e) {
  42030. return h.calculateUTF16asUTF8(t(e))[0];
  42031. }),
  42032. (o.calculateUTF8Bytes = function (e) {
  42033. return h.calculateUTF16asUTF8(t(e))[1];
  42034. }),
  42035. (o.calculateString = o.calculateUTF8Bytes),
  42036. (a.readUTF8String = function (e, t, n) {
  42037. 'number' == typeof t && ((n = t), (t = void 0));
  42038. var r = 'undefined' == typeof n;
  42039. if (
  42040. (r && (n = this.offset),
  42041. 'undefined' == typeof t && (t = o.METRICS_CHARS),
  42042. !this.noAssert)
  42043. ) {
  42044. if ('number' != typeof e || e % 1 !== 0)
  42045. throw TypeError('Illegal length: ' + e + ' (not an integer)');
  42046. if (((e |= 0), 'number' != typeof n || n % 1 !== 0))
  42047. throw TypeError('Illegal offset: ' + n + ' (not an integer)');
  42048. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength))
  42049. throw RangeError(
  42050. 'Illegal offset: 0 <= ' + n + ' (+0) <= ' + this.buffer.byteLength
  42051. );
  42052. }
  42053. var a,
  42054. s = 0,
  42055. l = n;
  42056. if (t === o.METRICS_CHARS) {
  42057. if (
  42058. ((a = i()),
  42059. h.decodeUTF8(
  42060. function () {
  42061. return s < e && n < this.limit ? this.view[n++] : null;
  42062. }.bind(this),
  42063. function (e) {
  42064. ++s, h.UTF8toUTF16(e, a);
  42065. }
  42066. ),
  42067. s !== e)
  42068. )
  42069. throw RangeError('Illegal range: Truncated data, ' + s + ' == ' + e);
  42070. return r
  42071. ? ((this.offset = n), a())
  42072. : {
  42073. string: a(),
  42074. length: n - l,
  42075. };
  42076. }
  42077. if (t === o.METRICS_BYTES) {
  42078. if (!this.noAssert) {
  42079. if ('number' != typeof n || n % 1 !== 0)
  42080. throw TypeError('Illegal offset: ' + n + ' (not an integer)');
  42081. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength))
  42082. throw RangeError(
  42083. 'Illegal offset: 0 <= ' + n + ' (+' + e + ') <= ' + this.buffer.byteLength
  42084. );
  42085. }
  42086. var c = n + e;
  42087. if (
  42088. (h.decodeUTF8toUTF16(
  42089. function () {
  42090. return n < c ? this.view[n++] : null;
  42091. }.bind(this),
  42092. (a = i()),
  42093. this.noAssert
  42094. ),
  42095. n !== c)
  42096. )
  42097. throw RangeError('Illegal range: Truncated data, ' + n + ' == ' + c);
  42098. return r
  42099. ? ((this.offset = n), a())
  42100. : {
  42101. string: a(),
  42102. length: n - l,
  42103. };
  42104. }
  42105. throw TypeError('Unsupported metrics: ' + t);
  42106. }),
  42107. (a.readString = a.readUTF8String),
  42108. (a.writeVString = function (e, i) {
  42109. var n = 'undefined' == typeof i;
  42110. if ((n && (i = this.offset), !this.noAssert)) {
  42111. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  42112. if ('number' != typeof i || i % 1 !== 0)
  42113. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42114. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42115. throw RangeError(
  42116. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42117. );
  42118. }
  42119. var r,
  42120. a,
  42121. s = i;
  42122. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  42123. (a = o.calculateVarint32(r)),
  42124. (i += a + r);
  42125. var l = this.buffer.byteLength;
  42126. if (
  42127. (i > l && this.resize((l *= 2) > i ? l : i),
  42128. (i -= a + r),
  42129. (i += this.writeVarint32(r, i)),
  42130. h.encodeUTF16toUTF8(
  42131. t(e),
  42132. function (e) {
  42133. this.view[i++] = e;
  42134. }.bind(this)
  42135. ),
  42136. i !== s + r + a)
  42137. )
  42138. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + r + a));
  42139. return n ? ((this.offset = i), this) : i - s;
  42140. }),
  42141. (a.readVString = function (e) {
  42142. var t = 'undefined' == typeof e;
  42143. if ((t && (e = this.offset), !this.noAssert)) {
  42144. if ('number' != typeof e || e % 1 !== 0)
  42145. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  42146. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  42147. throw RangeError(
  42148. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  42149. );
  42150. }
  42151. var i = e,
  42152. n = this.readVarint32(e),
  42153. r = this.readUTF8String(n.value, o.METRICS_BYTES, (e += n.length));
  42154. return (
  42155. (e += r.length),
  42156. t
  42157. ? ((this.offset = e), r.string)
  42158. : {
  42159. string: r.string,
  42160. length: e - i,
  42161. }
  42162. );
  42163. }),
  42164. (a.append = function (e, t, i) {
  42165. ('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0));
  42166. var n = 'undefined' == typeof i;
  42167. if ((n && (i = this.offset), !this.noAssert)) {
  42168. if ('number' != typeof i || i % 1 !== 0)
  42169. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42170. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42171. throw RangeError(
  42172. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42173. );
  42174. }
  42175. e instanceof o || (e = o.wrap(e, t));
  42176. var r = e.limit - e.offset;
  42177. if (r <= 0) return this;
  42178. i += r;
  42179. var a = this.buffer.byteLength;
  42180. return (
  42181. i > a && this.resize((a *= 2) > i ? a : i),
  42182. (i -= r),
  42183. this.view.set(e.view.subarray(e.offset, e.limit), i),
  42184. (e.offset += r),
  42185. n && (this.offset += r),
  42186. this
  42187. );
  42188. }),
  42189. (a.appendTo = function (e, t) {
  42190. return e.append(this, t), this;
  42191. }),
  42192. (a.assert = function (e) {
  42193. return (this.noAssert = !e), this;
  42194. }),
  42195. (a.capacity = function () {
  42196. return this.buffer.byteLength;
  42197. }),
  42198. (a.clear = function () {
  42199. return (
  42200. (this.offset = 0),
  42201. (this.limit = this.buffer.byteLength),
  42202. (this.markedOffset = -1),
  42203. this
  42204. );
  42205. }),
  42206. (a.clone = function (e) {
  42207. var t = new o(0, this.littleEndian, this.noAssert);
  42208. return (
  42209. e
  42210. ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)),
  42211. (t.view = new Uint8Array(t.buffer)))
  42212. : ((t.buffer = this.buffer), (t.view = this.view)),
  42213. (t.offset = this.offset),
  42214. (t.markedOffset = this.markedOffset),
  42215. (t.limit = this.limit),
  42216. t
  42217. );
  42218. }),
  42219. (a.compact = function (e, t) {
  42220. if (
  42221. ('undefined' == typeof e && (e = this.offset),
  42222. 'undefined' == typeof t && (t = this.limit),
  42223. !this.noAssert)
  42224. ) {
  42225. if ('number' != typeof e || e % 1 !== 0)
  42226. throw TypeError('Illegal begin: Not an integer');
  42227. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42228. throw TypeError('Illegal end: Not an integer');
  42229. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42230. throw RangeError(
  42231. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42232. );
  42233. }
  42234. if (0 === e && t === this.buffer.byteLength) return this;
  42235. var i = t - e;
  42236. if (0 === i)
  42237. return (
  42238. (this.buffer = s),
  42239. (this.view = null),
  42240. this.markedOffset >= 0 && (this.markedOffset -= e),
  42241. (this.offset = 0),
  42242. (this.limit = 0),
  42243. this
  42244. );
  42245. var n = new ArrayBuffer(i),
  42246. r = new Uint8Array(n);
  42247. return (
  42248. r.set(this.view.subarray(e, t)),
  42249. (this.buffer = n),
  42250. (this.view = r),
  42251. this.markedOffset >= 0 && (this.markedOffset -= e),
  42252. (this.offset = 0),
  42253. (this.limit = i),
  42254. this
  42255. );
  42256. }),
  42257. (a.copy = function (e, t) {
  42258. if (
  42259. ('undefined' == typeof e && (e = this.offset),
  42260. 'undefined' == typeof t && (t = this.limit),
  42261. !this.noAssert)
  42262. ) {
  42263. if ('number' != typeof e || e % 1 !== 0)
  42264. throw TypeError('Illegal begin: Not an integer');
  42265. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42266. throw TypeError('Illegal end: Not an integer');
  42267. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42268. throw RangeError(
  42269. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42270. );
  42271. }
  42272. if (e === t) return new o(0, this.littleEndian, this.noAssert);
  42273. var i = t - e,
  42274. n = new o(i, this.littleEndian, this.noAssert);
  42275. return (
  42276. (n.offset = 0),
  42277. (n.limit = i),
  42278. n.markedOffset >= 0 && (n.markedOffset -= e),
  42279. this.copyTo(n, 0, e, t),
  42280. n
  42281. );
  42282. }),
  42283. (a.copyTo = function (e, t, i, n) {
  42284. var r, a;
  42285. if (!this.noAssert && !o.isByteBuffer(e))
  42286. throw TypeError('Illegal target: Not a ByteBuffer');
  42287. if (
  42288. ((t = (a = 'undefined' == typeof t) ? e.offset : 0 | t),
  42289. (i = (r = 'undefined' == typeof i) ? this.offset : 0 | i),
  42290. (n = 'undefined' == typeof n ? this.limit : 0 | n),
  42291. t < 0 || t > e.buffer.byteLength)
  42292. )
  42293. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength);
  42294. if (i < 0 || n > this.buffer.byteLength)
  42295. throw RangeError(
  42296. 'Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength
  42297. );
  42298. var s = n - i;
  42299. return 0 === s
  42300. ? e
  42301. : (e.ensureCapacity(t + s),
  42302. e.view.set(this.view.subarray(i, n), t),
  42303. r && (this.offset += s),
  42304. a && (e.offset += s),
  42305. this);
  42306. }),
  42307. (a.ensureCapacity = function (e) {
  42308. var t = this.buffer.byteLength;
  42309. return t < e ? this.resize((t *= 2) > e ? t : e) : this;
  42310. }),
  42311. (a.fill = function (e, t, i) {
  42312. var n = 'undefined' == typeof t;
  42313. if (
  42314. (n && (t = this.offset),
  42315. 'string' == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  42316. 'undefined' == typeof t && (t = this.offset),
  42317. 'undefined' == typeof i && (i = this.limit),
  42318. !this.noAssert)
  42319. ) {
  42320. if ('number' != typeof e || e % 1 !== 0)
  42321. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  42322. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  42323. throw TypeError('Illegal begin: Not an integer');
  42324. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42325. throw TypeError('Illegal end: Not an integer');
  42326. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42327. throw RangeError(
  42328. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42329. );
  42330. }
  42331. if (t >= i) return this;
  42332. for (; t < i; ) this.view[t++] = e;
  42333. return n && (this.offset = t), this;
  42334. }),
  42335. (a.flip = function () {
  42336. return (this.limit = this.offset), (this.offset = 0), this;
  42337. }),
  42338. (a.mark = function (e) {
  42339. if (((e = 'undefined' == typeof e ? this.offset : e), !this.noAssert)) {
  42340. if ('number' != typeof e || e % 1 !== 0)
  42341. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  42342. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength))
  42343. throw RangeError(
  42344. 'Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength
  42345. );
  42346. }
  42347. return (this.markedOffset = e), this;
  42348. }),
  42349. (a.order = function (e) {
  42350. if (!this.noAssert && 'boolean' != typeof e)
  42351. throw TypeError('Illegal littleEndian: Not a boolean');
  42352. return (this.littleEndian = !!e), this;
  42353. }),
  42354. (a.LE = function (e) {
  42355. return (this.littleEndian = 'undefined' == typeof e || !!e), this;
  42356. }),
  42357. (a.BE = function (e) {
  42358. return (this.littleEndian = 'undefined' != typeof e && !e), this;
  42359. }),
  42360. (a.prepend = function (e, t, i) {
  42361. ('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0));
  42362. var n = 'undefined' == typeof i;
  42363. if ((n && (i = this.offset), !this.noAssert)) {
  42364. if ('number' != typeof i || i % 1 !== 0)
  42365. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42366. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42367. throw RangeError(
  42368. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42369. );
  42370. }
  42371. e instanceof o || (e = o.wrap(e, t));
  42372. var r = e.limit - e.offset;
  42373. if (r <= 0) return this;
  42374. var a = r - i;
  42375. if (a > 0) {
  42376. var s = new ArrayBuffer(this.buffer.byteLength + a),
  42377. l = new Uint8Array(s);
  42378. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  42379. (this.buffer = s),
  42380. (this.view = l),
  42381. (this.offset += a),
  42382. this.markedOffset >= 0 && (this.markedOffset += a),
  42383. (this.limit += a),
  42384. (i += a);
  42385. } else {
  42386. new Uint8Array(this.buffer);
  42387. }
  42388. return (
  42389. this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  42390. (e.offset = e.limit),
  42391. n && (this.offset -= r),
  42392. this
  42393. );
  42394. }),
  42395. (a.prependTo = function (e, t) {
  42396. return e.prepend(this, t), this;
  42397. }),
  42398. (a.printDebug = function (e) {
  42399. 'function' != typeof e && (e = console.log.bind(console)),
  42400. e(
  42401. this.toString() +
  42402. '\n-------------------------------------------------------------------\n' +
  42403. this.toDebug(!0)
  42404. );
  42405. }),
  42406. (a.remaining = function () {
  42407. return this.limit - this.offset;
  42408. }),
  42409. (a.reset = function () {
  42410. return (
  42411. this.markedOffset >= 0
  42412. ? ((this.offset = this.markedOffset), (this.markedOffset = -1))
  42413. : (this.offset = 0),
  42414. this
  42415. );
  42416. }),
  42417. (a.resize = function (e) {
  42418. if (!this.noAssert) {
  42419. if ('number' != typeof e || e % 1 !== 0)
  42420. throw TypeError('Illegal capacity: ' + e + ' (not an integer)');
  42421. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity: 0 <= ' + e);
  42422. }
  42423. if (this.buffer.byteLength < e) {
  42424. var t = new ArrayBuffer(e),
  42425. i = new Uint8Array(t);
  42426. i.set(this.view), (this.buffer = t), (this.view = i);
  42427. }
  42428. return this;
  42429. }),
  42430. (a.reverse = function (e, t) {
  42431. if (
  42432. ('undefined' == typeof e && (e = this.offset),
  42433. 'undefined' == typeof t && (t = this.limit),
  42434. !this.noAssert)
  42435. ) {
  42436. if ('number' != typeof e || e % 1 !== 0)
  42437. throw TypeError('Illegal begin: Not an integer');
  42438. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42439. throw TypeError('Illegal end: Not an integer');
  42440. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42441. throw RangeError(
  42442. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42443. );
  42444. }
  42445. return e === t
  42446. ? this
  42447. : (Array.prototype.reverse.call(this.view.subarray(e, t)), this);
  42448. }),
  42449. (a.skip = function (e) {
  42450. if (!this.noAssert) {
  42451. if ('number' != typeof e || e % 1 !== 0)
  42452. throw TypeError('Illegal length: ' + e + ' (not an integer)');
  42453. e |= 0;
  42454. }
  42455. var t = this.offset + e;
  42456. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  42457. throw RangeError(
  42458. 'Illegal length: 0 <= ' +
  42459. this.offset +
  42460. ' + ' +
  42461. e +
  42462. ' <= ' +
  42463. this.buffer.byteLength
  42464. );
  42465. return (this.offset = t), this;
  42466. }),
  42467. (a.slice = function (e, t) {
  42468. if (
  42469. ('undefined' == typeof e && (e = this.offset),
  42470. 'undefined' == typeof t && (t = this.limit),
  42471. !this.noAssert)
  42472. ) {
  42473. if ('number' != typeof e || e % 1 !== 0)
  42474. throw TypeError('Illegal begin: Not an integer');
  42475. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42476. throw TypeError('Illegal end: Not an integer');
  42477. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42478. throw RangeError(
  42479. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42480. );
  42481. }
  42482. var i = this.clone();
  42483. return (i.offset = e), (i.limit = t), i;
  42484. }),
  42485. (a.toBuffer = function (e) {
  42486. var t = this.offset,
  42487. i = this.limit;
  42488. if (!this.noAssert) {
  42489. if ('number' != typeof t || t % 1 !== 0)
  42490. throw TypeError('Illegal offset: Not an integer');
  42491. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42492. throw TypeError('Illegal limit: Not an integer');
  42493. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42494. throw RangeError(
  42495. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42496. );
  42497. }
  42498. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer;
  42499. if (t === i) return s;
  42500. var n = new ArrayBuffer(i - t);
  42501. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n;
  42502. }),
  42503. (a.toArrayBuffer = a.toBuffer),
  42504. (a.toString = function (e, t, i) {
  42505. if ('undefined' == typeof e)
  42506. return (
  42507. 'ByteBufferAB(offset=' +
  42508. this.offset +
  42509. ',markedOffset=' +
  42510. this.markedOffset +
  42511. ',limit=' +
  42512. this.limit +
  42513. ',capacity=' +
  42514. this.capacity() +
  42515. ')'
  42516. );
  42517. switch (('number' == typeof e && ((e = 'utf8'), (t = e), (i = t)), e)) {
  42518. case 'utf8':
  42519. return this.toUTF8(t, i);
  42520. case 'base64':
  42521. return this.toBase64(t, i);
  42522. case 'hex':
  42523. return this.toHex(t, i);
  42524. case 'binary':
  42525. return this.toBinary(t, i);
  42526. case 'debug':
  42527. return this.toDebug();
  42528. case 'columns':
  42529. return this.toColumns();
  42530. default:
  42531. throw Error('Unsupported encoding: ' + e);
  42532. }
  42533. });
  42534. var c = (function () {
  42535. for (
  42536. var e = {},
  42537. t = [
  42538. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
  42539. 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
  42540. 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50,
  42541. 51, 52, 53, 54, 55, 56, 57, 43, 47,
  42542. ],
  42543. i = [],
  42544. n = 0,
  42545. r = t.length;
  42546. n < r;
  42547. ++n
  42548. )
  42549. i[t[n]] = n;
  42550. return (
  42551. (e.encode = function (e, i) {
  42552. for (var n, r; null !== (n = e()); )
  42553. i(t[(n >> 2) & 63]),
  42554. (r = (3 & n) << 4),
  42555. null !== (n = e())
  42556. ? ((r |= (n >> 4) & 15),
  42557. i(t[63 & (r | ((n >> 4) & 15))]),
  42558. (r = (15 & n) << 2),
  42559. null !== (n = e())
  42560. ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n]))
  42561. : (i(t[63 & r]), i(61)))
  42562. : (i(t[63 & r]), i(61), i(61));
  42563. }),
  42564. (e.decode = function (e, t) {
  42565. function n(e) {
  42566. throw Error('Illegal character code: ' + e);
  42567. }
  42568. for (var r, o, a; null !== (r = e()); )
  42569. if (
  42570. ((o = i[r]),
  42571. 'undefined' == typeof o && n(r),
  42572. null !== (r = e()) &&
  42573. ((a = i[r]),
  42574. 'undefined' == typeof a && n(r),
  42575. t(((o << 2) >>> 0) | ((48 & a) >> 4)),
  42576. null !== (r = e())))
  42577. ) {
  42578. if (((o = i[r]), 'undefined' == typeof o)) {
  42579. if (61 === r) break;
  42580. n(r);
  42581. }
  42582. if ((t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)), null !== (r = e()))) {
  42583. if (((a = i[r]), 'undefined' == typeof a)) {
  42584. if (61 === r) break;
  42585. n(r);
  42586. }
  42587. t((((3 & o) << 6) >>> 0) | a);
  42588. }
  42589. }
  42590. }),
  42591. (e.test = function (e) {
  42592. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(
  42593. e
  42594. );
  42595. }),
  42596. e
  42597. );
  42598. })();
  42599. (a.toBase64 = function (e, t) {
  42600. if (
  42601. ('undefined' == typeof e && (e = this.offset),
  42602. 'undefined' == typeof t && (t = this.limit),
  42603. (e |= 0),
  42604. (t |= 0),
  42605. e < 0 || t > this.capacity || e > t)
  42606. )
  42607. throw RangeError('begin, end');
  42608. var n;
  42609. return (
  42610. c.encode(
  42611. function () {
  42612. return e < t ? this.view[e++] : null;
  42613. }.bind(this),
  42614. (n = i())
  42615. ),
  42616. n()
  42617. );
  42618. }),
  42619. (o.fromBase64 = function (e, i) {
  42620. if ('string' != typeof e) throw TypeError('str');
  42621. var n = new o((e.length / 4) * 3, i),
  42622. r = 0;
  42623. return (
  42624. c.decode(t(e), function (e) {
  42625. n.view[r++] = e;
  42626. }),
  42627. (n.limit = r),
  42628. n
  42629. );
  42630. }),
  42631. (o.btoa = function (e) {
  42632. return o.fromBinary(e).toBase64();
  42633. }),
  42634. (o.atob = function (e) {
  42635. return o.fromBase64(e).toBinary();
  42636. }),
  42637. (a.toBinary = function (e, t) {
  42638. if (
  42639. ('undefined' == typeof e && (e = this.offset),
  42640. 'undefined' == typeof t && (t = this.limit),
  42641. (e |= 0),
  42642. (t |= 0),
  42643. e < 0 || t > this.capacity() || e > t)
  42644. )
  42645. throw RangeError('begin, end');
  42646. if (e === t) return '';
  42647. for (var i = [], n = []; e < t; )
  42648. i.push(this.view[e++]),
  42649. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), (i = []));
  42650. return n.join('') + String.fromCharCode.apply(String, i);
  42651. }),
  42652. (o.fromBinary = function (e, t) {
  42653. if ('string' != typeof e) throw TypeError('str');
  42654. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  42655. if (((i = e.charCodeAt(n)), i > 255)) throw RangeError('illegal char code: ' + i);
  42656. a.view[n++] = i;
  42657. }
  42658. return (a.limit = r), a;
  42659. }),
  42660. (a.toDebug = function (e) {
  42661. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  42662. if (
  42663. (i !== -1 &&
  42664. ((t = this.view[i]),
  42665. (r +=
  42666. t < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()),
  42667. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : '.')),
  42668. ++i,
  42669. e && i > 0 && i % 16 === 0 && i !== n)
  42670. ) {
  42671. for (; r.length < 51; ) r += ' ';
  42672. (a += r + o + '\n'), (r = o = '');
  42673. }
  42674. r +=
  42675. i === this.offset && i === this.limit
  42676. ? i === this.markedOffset
  42677. ? '!'
  42678. : '|'
  42679. : i === this.offset
  42680. ? i === this.markedOffset
  42681. ? '['
  42682. : '<'
  42683. : i === this.limit
  42684. ? i === this.markedOffset
  42685. ? ']'
  42686. : '>'
  42687. : i === this.markedOffset
  42688. ? "'"
  42689. : e || (0 !== i && i !== n)
  42690. ? ' '
  42691. : '';
  42692. }
  42693. if (e && ' ' !== r) {
  42694. for (; r.length < 51; ) r += ' ';
  42695. a += r + o + '\n';
  42696. }
  42697. return e ? a : r;
  42698. }),
  42699. (o.fromDebug = function (e, t, i) {
  42700. for (
  42701. var n,
  42702. r,
  42703. a = e.length,
  42704. s = new o(((a + 1) / 3) | 0, t, i),
  42705. l = 0,
  42706. c = 0,
  42707. h = !1,
  42708. u = !1,
  42709. d = !1,
  42710. p = !1,
  42711. f = !1;
  42712. l < a;
  42713. ) {
  42714. switch ((n = e.charAt(l++))) {
  42715. case '!':
  42716. if (!i) {
  42717. if (u || d || p) {
  42718. f = !0;
  42719. break;
  42720. }
  42721. u = d = p = !0;
  42722. }
  42723. (s.offset = s.markedOffset = s.limit = c), (h = !1);
  42724. break;
  42725. case '|':
  42726. if (!i) {
  42727. if (u || p) {
  42728. f = !0;
  42729. break;
  42730. }
  42731. u = p = !0;
  42732. }
  42733. (s.offset = s.limit = c), (h = !1);
  42734. break;
  42735. case '[':
  42736. if (!i) {
  42737. if (u || d) {
  42738. f = !0;
  42739. break;
  42740. }
  42741. u = d = !0;
  42742. }
  42743. (s.offset = s.markedOffset = c), (h = !1);
  42744. break;
  42745. case '<':
  42746. if (!i) {
  42747. if (u) {
  42748. f = !0;
  42749. break;
  42750. }
  42751. u = !0;
  42752. }
  42753. (s.offset = c), (h = !1);
  42754. break;
  42755. case ']':
  42756. if (!i) {
  42757. if (p || d) {
  42758. f = !0;
  42759. break;
  42760. }
  42761. p = d = !0;
  42762. }
  42763. (s.limit = s.markedOffset = c), (h = !1);
  42764. break;
  42765. case '>':
  42766. if (!i) {
  42767. if (p) {
  42768. f = !0;
  42769. break;
  42770. }
  42771. p = !0;
  42772. }
  42773. (s.limit = c), (h = !1);
  42774. break;
  42775. case "'":
  42776. if (!i) {
  42777. if (d) {
  42778. f = !0;
  42779. break;
  42780. }
  42781. d = !0;
  42782. }
  42783. (s.markedOffset = c), (h = !1);
  42784. break;
  42785. case ' ':
  42786. h = !1;
  42787. break;
  42788. default:
  42789. if (!i && h) {
  42790. f = !0;
  42791. break;
  42792. }
  42793. if (
  42794. ((r = parseInt(n + e.charAt(l++), 16)), !i && (isNaN(r) || r < 0 || r > 255))
  42795. )
  42796. throw TypeError('Illegal str: Not a debug encoded string');
  42797. (s.view[c++] = r), (h = !0);
  42798. }
  42799. if (f) throw TypeError('Illegal str: Invalid symbol at ' + l);
  42800. }
  42801. if (!i) {
  42802. if (!u || !p) throw TypeError('Illegal str: Missing offset or limit');
  42803. if (c < s.buffer.byteLength)
  42804. throw TypeError(
  42805. 'Illegal str: Not a debug encoded string (is it hex?) ' + c + ' < ' + a
  42806. );
  42807. }
  42808. return s;
  42809. }),
  42810. (a.toHex = function (e, t) {
  42811. if (
  42812. ((e = 'undefined' == typeof e ? this.offset : e),
  42813. (t = 'undefined' == typeof t ? this.limit : t),
  42814. !this.noAssert)
  42815. ) {
  42816. if ('number' != typeof e || e % 1 !== 0)
  42817. throw TypeError('Illegal begin: Not an integer');
  42818. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42819. throw TypeError('Illegal end: Not an integer');
  42820. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42821. throw RangeError(
  42822. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42823. );
  42824. }
  42825. for (var i, n = new Array(t - e); e < t; )
  42826. (i = this.view[e++]), i < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16));
  42827. return n.join('');
  42828. }),
  42829. (o.fromHex = function (e, t, i) {
  42830. if (!i) {
  42831. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  42832. if (e.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2');
  42833. }
  42834. for (var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0; s < r; s += 2) {
  42835. if (
  42836. ((n = parseInt(e.substring(s, s + 2), 16)),
  42837. !i && (!isFinite(n) || n < 0 || n > 255))
  42838. )
  42839. throw TypeError('Illegal str: Contains non-hex characters');
  42840. a.view[l++] = n;
  42841. }
  42842. return (a.limit = l), a;
  42843. });
  42844. var h = (function () {
  42845. var e = {};
  42846. return (
  42847. (e.MAX_CODEPOINT = 1114111),
  42848. (e.encodeUTF8 = function (e, t) {
  42849. var i = null;
  42850. for (
  42851. 'number' == typeof e &&
  42852. ((i = e),
  42853. (e = function () {
  42854. return null;
  42855. }));
  42856. null !== i || null !== (i = e());
  42857. )
  42858. i < 128
  42859. ? t(127 & i)
  42860. : i < 2048
  42861. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  42862. : i < 65536
  42863. ? (t(((i >> 12) & 15) | 224), t(((i >> 6) & 63) | 128), t((63 & i) | 128))
  42864. : (t(((i >> 18) & 7) | 240),
  42865. t(((i >> 12) & 63) | 128),
  42866. t(((i >> 6) & 63) | 128),
  42867. t((63 & i) | 128)),
  42868. (i = null);
  42869. }),
  42870. (e.decodeUTF8 = function (e, t) {
  42871. for (
  42872. var i,
  42873. n,
  42874. r,
  42875. o,
  42876. a = function (e) {
  42877. e = e.slice(0, e.indexOf(null));
  42878. var t = Error(e.toString());
  42879. throw ((t.name = 'TruncatedError'), (t.bytes = e), t);
  42880. };
  42881. null !== (i = e());
  42882. )
  42883. if (0 === (128 & i)) t(i);
  42884. else if (192 === (224 & i))
  42885. null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n));
  42886. else if (224 === (240 & i))
  42887. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  42888. t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r));
  42889. else {
  42890. if (240 !== (248 & i)) throw RangeError('Illegal starting byte: ' + i);
  42891. (null === (n = e()) || null === (r = e()) || null === (o = e())) &&
  42892. a([i, n, r, o]),
  42893. t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o));
  42894. }
  42895. }),
  42896. (e.UTF16toUTF8 = function (e, t) {
  42897. for (var i, n = null; ; ) {
  42898. if (null === (i = null !== n ? n : e())) break;
  42899. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343
  42900. ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null))
  42901. : t(i);
  42902. }
  42903. null !== n && t(n);
  42904. }),
  42905. (e.UTF8toUTF16 = function (e, t) {
  42906. var i = null;
  42907. for (
  42908. 'number' == typeof e &&
  42909. ((i = e),
  42910. (e = function () {
  42911. return null;
  42912. }));
  42913. null !== i || null !== (i = e());
  42914. )
  42915. i <= 65535 ? t(i) : ((i -= 65536), t((i >> 10) + 55296), t((i % 1024) + 56320)),
  42916. (i = null);
  42917. }),
  42918. (e.encodeUTF16toUTF8 = function (t, i) {
  42919. e.UTF16toUTF8(t, function (t) {
  42920. e.encodeUTF8(t, i);
  42921. });
  42922. }),
  42923. (e.decodeUTF8toUTF16 = function (t, i) {
  42924. e.decodeUTF8(t, function (t) {
  42925. e.UTF8toUTF16(t, i);
  42926. });
  42927. }),
  42928. (e.calculateCodePoint = function (e) {
  42929. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
  42930. }),
  42931. (e.calculateUTF8 = function (e) {
  42932. for (var t, i = 0; null !== (t = e()); )
  42933. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  42934. return i;
  42935. }),
  42936. (e.calculateUTF16asUTF8 = function (t) {
  42937. var i = 0,
  42938. n = 0;
  42939. return (
  42940. e.UTF16toUTF8(t, function (e) {
  42941. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4);
  42942. }),
  42943. [i, n]
  42944. );
  42945. }),
  42946. e
  42947. );
  42948. })();
  42949. return (
  42950. (a.toUTF8 = function (e, t) {
  42951. if (
  42952. ('undefined' == typeof e && (e = this.offset),
  42953. 'undefined' == typeof t && (t = this.limit),
  42954. !this.noAssert)
  42955. ) {
  42956. if ('number' != typeof e || e % 1 !== 0)
  42957. throw TypeError('Illegal begin: Not an integer');
  42958. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42959. throw TypeError('Illegal end: Not an integer');
  42960. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42961. throw RangeError(
  42962. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42963. );
  42964. }
  42965. var n;
  42966. try {
  42967. h.decodeUTF8toUTF16(
  42968. function () {
  42969. return e < t ? this.view[e++] : null;
  42970. }.bind(this),
  42971. (n = i())
  42972. );
  42973. } catch (i) {
  42974. if (e !== t) throw RangeError('Illegal range: Truncated data, ' + e + ' != ' + t);
  42975. }
  42976. return n();
  42977. }),
  42978. (o.fromUTF8 = function (e, i, n) {
  42979. if (!n && 'string' != typeof e) throw TypeError('Illegal str: Not a string');
  42980. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  42981. a = 0;
  42982. return (
  42983. h.encodeUTF16toUTF8(t(e), function (e) {
  42984. r.view[a++] = e;
  42985. }),
  42986. (r.limit = a),
  42987. r
  42988. );
  42989. }),
  42990. o
  42991. );
  42992. });
  42993. },
  42994. {
  42995. long: 216,
  42996. },
  42997. ],
  42998. 216: [
  42999. function (e, t, i) {
  43000. !(function (i, n) {
  43001. 'function' == typeof define && define.amd
  43002. ? define([], n)
  43003. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  43004. ? (t.exports = n())
  43005. : ((i.dcodeIO = i.dcodeIO || {}).Long = n());
  43006. })(this, function () {
  43007. 'use strict';
  43008. function e(e, t, i) {
  43009. (this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i);
  43010. }
  43011. function t(e) {
  43012. return (e && e.__isLong__) === !0;
  43013. }
  43014. function i(e, t) {
  43015. var i, n, o;
  43016. return t
  43017. ? ((e >>>= 0),
  43018. (o = 0 <= e && e < 256) && (n = l[e])
  43019. ? n
  43020. : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  43021. : ((e |= 0),
  43022. (o = -128 <= e && e < 128) && (n = s[e])
  43023. ? n
  43024. : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i));
  43025. }
  43026. function n(e, t) {
  43027. if (isNaN(e) || !isFinite(e)) return t ? m : g;
  43028. if (t) {
  43029. if (e < 0) return m;
  43030. if (e >= d) return I;
  43031. } else {
  43032. if (e <= -p) return E;
  43033. if (e + 1 >= p) return C;
  43034. }
  43035. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t);
  43036. }
  43037. function r(t, i, n) {
  43038. return new e(t, i, n);
  43039. }
  43040. function o(e, t, i) {
  43041. if (0 === e.length) throw Error('empty string');
  43042. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return g;
  43043. if (
  43044. ('number' == typeof t ? ((i = t), (t = !1)) : (t = !!t),
  43045. (i = i || 10),
  43046. i < 2 || 36 < i)
  43047. )
  43048. throw RangeError('radix');
  43049. var r;
  43050. if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen');
  43051. if (0 === r) return o(e.substring(1), t, i).neg();
  43052. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  43053. var h = Math.min(8, e.length - l),
  43054. u = parseInt(e.substring(l, l + h), i);
  43055. if (h < 8) {
  43056. var d = n(c(i, h));
  43057. s = s.mul(d).add(n(u));
  43058. } else (s = s.mul(a)), (s = s.add(n(u)));
  43059. }
  43060. return (s.unsigned = t), s;
  43061. }
  43062. function a(t) {
  43063. return t instanceof e
  43064. ? t
  43065. : 'number' == typeof t
  43066. ? n(t)
  43067. : 'string' == typeof t
  43068. ? o(t)
  43069. : r(t.low, t.high, t.unsigned);
  43070. }
  43071. e.prototype.__isLong__,
  43072. Object.defineProperty(e.prototype, '__isLong__', {
  43073. value: !0,
  43074. enumerable: !1,
  43075. configurable: !1,
  43076. }),
  43077. (e.isLong = t);
  43078. var s = {},
  43079. l = {};
  43080. (e.fromInt = i), (e.fromNumber = n), (e.fromBits = r);
  43081. var c = Math.pow;
  43082. (e.fromString = o), (e.fromValue = a);
  43083. var h = 1 << 24,
  43084. u = 4294967296,
  43085. d = 0x10000000000000000,
  43086. p = d / 2,
  43087. f = i(h),
  43088. g = i(0);
  43089. e.ZERO = g;
  43090. var m = i(0, !0);
  43091. e.UZERO = m;
  43092. var v = i(1);
  43093. e.ONE = v;
  43094. var A = i(1, !0);
  43095. e.UONE = A;
  43096. var y = i(-1);
  43097. e.NEG_ONE = y;
  43098. var C = r(-1, 2147483647, !1);
  43099. e.MAX_VALUE = C;
  43100. var I = r(-1, -1, !0);
  43101. e.MAX_UNSIGNED_VALUE = I;
  43102. var E = r(0, -2147483648, !1);
  43103. e.MIN_VALUE = E;
  43104. var b = e.prototype;
  43105. return (
  43106. (b.toInt = function () {
  43107. return this.unsigned ? this.low >>> 0 : this.low;
  43108. }),
  43109. (b.toNumber = function () {
  43110. return this.unsigned
  43111. ? (this.high >>> 0) * u + (this.low >>> 0)
  43112. : this.high * u + (this.low >>> 0);
  43113. }),
  43114. (b.toString = function (e) {
  43115. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError('radix');
  43116. if (this.isZero()) return '0';
  43117. if (this.isNegative()) {
  43118. if (this.eq(E)) {
  43119. var t = n(e),
  43120. i = this.div(t),
  43121. r = i.mul(t).sub(this);
  43122. return i.toString(e) + r.toInt().toString(e);
  43123. }
  43124. return '-' + this.neg().toString(e);
  43125. }
  43126. for (var o = n(c(e, 6), this.unsigned), a = this, s = ''; ; ) {
  43127. var l = a.div(o),
  43128. h = a.sub(l.mul(o)).toInt() >>> 0,
  43129. u = h.toString(e);
  43130. if (((a = l), a.isZero())) return u + s;
  43131. for (; u.length < 6; ) u = '0' + u;
  43132. s = '' + u + s;
  43133. }
  43134. }),
  43135. (b.getHighBits = function () {
  43136. return this.high;
  43137. }),
  43138. (b.getHighBitsUnsigned = function () {
  43139. return this.high >>> 0;
  43140. }),
  43141. (b.getLowBits = function () {
  43142. return this.low;
  43143. }),
  43144. (b.getLowBitsUnsigned = function () {
  43145. return this.low >>> 0;
  43146. }),
  43147. (b.getNumBitsAbs = function () {
  43148. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  43149. for (
  43150. var e = 0 != this.high ? this.high : this.low, t = 31;
  43151. t > 0 && 0 == (e & (1 << t));
  43152. t--
  43153. );
  43154. return 0 != this.high ? t + 33 : t + 1;
  43155. }),
  43156. (b.isZero = function () {
  43157. return 0 === this.high && 0 === this.low;
  43158. }),
  43159. (b.isNegative = function () {
  43160. return !this.unsigned && this.high < 0;
  43161. }),
  43162. (b.isPositive = function () {
  43163. return this.unsigned || this.high >= 0;
  43164. }),
  43165. (b.isOdd = function () {
  43166. return 1 === (1 & this.low);
  43167. }),
  43168. (b.isEven = function () {
  43169. return 0 === (1 & this.low);
  43170. }),
  43171. (b.equals = function (e) {
  43172. return (
  43173. t(e) || (e = a(e)),
  43174. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) &&
  43175. this.high === e.high &&
  43176. this.low === e.low
  43177. );
  43178. }),
  43179. (b.eq = b.equals),
  43180. (b.notEquals = function (e) {
  43181. return !this.eq(e);
  43182. }),
  43183. (b.neq = b.notEquals),
  43184. (b.lessThan = function (e) {
  43185. return this.comp(e) < 0;
  43186. }),
  43187. (b.lt = b.lessThan),
  43188. (b.lessThanOrEqual = function (e) {
  43189. return this.comp(e) <= 0;
  43190. }),
  43191. (b.lte = b.lessThanOrEqual),
  43192. (b.greaterThan = function (e) {
  43193. return this.comp(e) > 0;
  43194. }),
  43195. (b.gt = b.greaterThan),
  43196. (b.greaterThanOrEqual = function (e) {
  43197. return this.comp(e) >= 0;
  43198. }),
  43199. (b.gte = b.greaterThanOrEqual),
  43200. (b.compare = function (e) {
  43201. if ((t(e) || (e = a(e)), this.eq(e))) return 0;
  43202. var i = this.isNegative(),
  43203. n = e.isNegative();
  43204. return i && !n
  43205. ? -1
  43206. : !i && n
  43207. ? 1
  43208. : this.unsigned
  43209. ? e.high >>> 0 > this.high >>> 0 ||
  43210. (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  43211. ? -1
  43212. : 1
  43213. : this.sub(e).isNegative()
  43214. ? -1
  43215. : 1;
  43216. }),
  43217. (b.comp = b.compare),
  43218. (b.negate = function () {
  43219. return !this.unsigned && this.eq(E) ? E : this.not().add(v);
  43220. }),
  43221. (b.neg = b.negate),
  43222. (b.add = function (e) {
  43223. t(e) || (e = a(e));
  43224. var i = this.high >>> 16,
  43225. n = 65535 & this.high,
  43226. o = this.low >>> 16,
  43227. s = 65535 & this.low,
  43228. l = e.high >>> 16,
  43229. c = 65535 & e.high,
  43230. h = e.low >>> 16,
  43231. u = 65535 & e.low,
  43232. d = 0,
  43233. p = 0,
  43234. f = 0,
  43235. g = 0;
  43236. return (
  43237. (g += s + u),
  43238. (f += g >>> 16),
  43239. (g &= 65535),
  43240. (f += o + h),
  43241. (p += f >>> 16),
  43242. (f &= 65535),
  43243. (p += n + c),
  43244. (d += p >>> 16),
  43245. (p &= 65535),
  43246. (d += i + l),
  43247. (d &= 65535),
  43248. r((f << 16) | g, (d << 16) | p, this.unsigned)
  43249. );
  43250. }),
  43251. (b.subtract = function (e) {
  43252. return t(e) || (e = a(e)), this.add(e.neg());
  43253. }),
  43254. (b.sub = b.subtract),
  43255. (b.multiply = function (e) {
  43256. if (this.isZero()) return g;
  43257. if ((t(e) || (e = a(e)), e.isZero())) return g;
  43258. if (this.eq(E)) return e.isOdd() ? E : g;
  43259. if (e.eq(E)) return this.isOdd() ? E : g;
  43260. if (this.isNegative())
  43261. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  43262. if (e.isNegative()) return this.mul(e.neg()).neg();
  43263. if (this.lt(f) && e.lt(f)) return n(this.toNumber() * e.toNumber(), this.unsigned);
  43264. var i = this.high >>> 16,
  43265. o = 65535 & this.high,
  43266. s = this.low >>> 16,
  43267. l = 65535 & this.low,
  43268. c = e.high >>> 16,
  43269. h = 65535 & e.high,
  43270. u = e.low >>> 16,
  43271. d = 65535 & e.low,
  43272. p = 0,
  43273. m = 0,
  43274. v = 0,
  43275. A = 0;
  43276. return (
  43277. (A += l * d),
  43278. (v += A >>> 16),
  43279. (A &= 65535),
  43280. (v += s * d),
  43281. (m += v >>> 16),
  43282. (v &= 65535),
  43283. (v += l * u),
  43284. (m += v >>> 16),
  43285. (v &= 65535),
  43286. (m += o * d),
  43287. (p += m >>> 16),
  43288. (m &= 65535),
  43289. (m += s * u),
  43290. (p += m >>> 16),
  43291. (m &= 65535),
  43292. (m += l * h),
  43293. (p += m >>> 16),
  43294. (m &= 65535),
  43295. (p += i * d + o * u + s * h + l * c),
  43296. (p &= 65535),
  43297. r((v << 16) | A, (p << 16) | m, this.unsigned)
  43298. );
  43299. }),
  43300. (b.mul = b.multiply),
  43301. (b.divide = function (e) {
  43302. if ((t(e) || (e = a(e)), e.isZero())) throw Error('division by zero');
  43303. if (this.isZero()) return this.unsigned ? m : g;
  43304. var i, r, o;
  43305. if (this.unsigned) {
  43306. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m;
  43307. if (e.gt(this.shru(1))) return A;
  43308. o = m;
  43309. } else {
  43310. if (this.eq(E)) {
  43311. if (e.eq(v) || e.eq(y)) return E;
  43312. if (e.eq(E)) return v;
  43313. var s = this.shr(1);
  43314. return (
  43315. (i = s.div(e).shl(1)),
  43316. i.eq(g)
  43317. ? e.isNegative()
  43318. ? v
  43319. : y
  43320. : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  43321. );
  43322. }
  43323. if (e.eq(E)) return this.unsigned ? m : g;
  43324. if (this.isNegative())
  43325. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  43326. if (e.isNegative()) return this.div(e.neg()).neg();
  43327. o = g;
  43328. }
  43329. for (r = this; r.gte(e); ) {
  43330. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  43331. for (
  43332. var l = Math.ceil(Math.log(i) / Math.LN2),
  43333. h = l <= 48 ? 1 : c(2, l - 48),
  43334. u = n(i),
  43335. d = u.mul(e);
  43336. d.isNegative() || d.gt(r);
  43337. )
  43338. (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e));
  43339. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d));
  43340. }
  43341. return o;
  43342. }),
  43343. (b.div = b.divide),
  43344. (b.modulo = function (e) {
  43345. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e));
  43346. }),
  43347. (b.mod = b.modulo),
  43348. (b.not = function () {
  43349. return r(~this.low, ~this.high, this.unsigned);
  43350. }),
  43351. (b.and = function (e) {
  43352. return t(e) || (e = a(e)), r(this.low & e.low, this.high & e.high, this.unsigned);
  43353. }),
  43354. (b.or = function (e) {
  43355. return t(e) || (e = a(e)), r(this.low | e.low, this.high | e.high, this.unsigned);
  43356. }),
  43357. (b.xor = function (e) {
  43358. return t(e) || (e = a(e)), r(this.low ^ e.low, this.high ^ e.high, this.unsigned);
  43359. }),
  43360. (b.shiftLeft = function (e) {
  43361. return (
  43362. t(e) && (e = e.toInt()),
  43363. 0 === (e &= 63)
  43364. ? this
  43365. : e < 32
  43366. ? r(this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned)
  43367. : r(0, this.low << (e - 32), this.unsigned)
  43368. );
  43369. }),
  43370. (b.shl = b.shiftLeft),
  43371. (b.shiftRight = function (e) {
  43372. return (
  43373. t(e) && (e = e.toInt()),
  43374. 0 === (e &= 63)
  43375. ? this
  43376. : e < 32
  43377. ? r((this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned)
  43378. : r(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned)
  43379. );
  43380. }),
  43381. (b.shr = b.shiftRight),
  43382. (b.shiftRightUnsigned = function (e) {
  43383. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this;
  43384. var i = this.high;
  43385. if (e < 32) {
  43386. var n = this.low;
  43387. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned);
  43388. }
  43389. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> (e - 32), 0, this.unsigned);
  43390. }),
  43391. (b.shru = b.shiftRightUnsigned),
  43392. (b.toSigned = function () {
  43393. return this.unsigned ? r(this.low, this.high, !1) : this;
  43394. }),
  43395. (b.toUnsigned = function () {
  43396. return this.unsigned ? this : r(this.low, this.high, !0);
  43397. }),
  43398. (b.toBytes = function (e) {
  43399. return e ? this.toBytesLE() : this.toBytesBE();
  43400. }),
  43401. (b.toBytesLE = function () {
  43402. var e = this.high,
  43403. t = this.low;
  43404. return [
  43405. 255 & t,
  43406. (t >>> 8) & 255,
  43407. (t >>> 16) & 255,
  43408. (t >>> 24) & 255,
  43409. 255 & e,
  43410. (e >>> 8) & 255,
  43411. (e >>> 16) & 255,
  43412. (e >>> 24) & 255,
  43413. ];
  43414. }),
  43415. (b.toBytesBE = function () {
  43416. var e = this.high,
  43417. t = this.low;
  43418. return [
  43419. (e >>> 24) & 255,
  43420. (e >>> 16) & 255,
  43421. (e >>> 8) & 255,
  43422. 255 & e,
  43423. (t >>> 24) & 255,
  43424. (t >>> 16) & 255,
  43425. (t >>> 8) & 255,
  43426. 255 & t,
  43427. ];
  43428. }),
  43429. e
  43430. );
  43431. });
  43432. },
  43433. {},
  43434. ],
  43435. 217: [
  43436. function (e, t, i) {
  43437. var n = {
  43438. REVISION: '75',
  43439. };
  43440. 'function' == typeof define && define.amd
  43441. ? define('three', n)
  43442. : 'undefined' != typeof i && 'undefined' != typeof t && (t.exports = n),
  43443. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  43444. void 0 === Math.sign &&
  43445. (Math.sign = function (e) {
  43446. return e < 0 ? -1 : e > 0 ? 1 : +e;
  43447. }),
  43448. void 0 === Function.prototype.name &&
  43449. void 0 !== Object.defineProperty &&
  43450. Object.defineProperty(Function.prototype, 'name', {
  43451. get: function () {
  43452. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
  43453. },
  43454. }),
  43455. void 0 === Object.assign &&
  43456. Object.defineProperty(Object, 'assign', {
  43457. writable: !0,
  43458. configurable: !0,
  43459. value: function (e) {
  43460. 'use strict';
  43461. if (void 0 === e || null === e)
  43462. throw new TypeError('Cannot convert first argument to object');
  43463. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  43464. var r = arguments[i];
  43465. if (void 0 !== r && null !== r) {
  43466. r = Object(r);
  43467. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  43468. var l = o[a],
  43469. c = Object.getOwnPropertyDescriptor(r, l);
  43470. void 0 !== c && c.enumerable && (t[l] = r[l]);
  43471. }
  43472. }
  43473. }
  43474. return t;
  43475. },
  43476. }),
  43477. (n.MOUSE = {
  43478. LEFT: 0,
  43479. MIDDLE: 1,
  43480. RIGHT: 2,
  43481. }),
  43482. (n.CullFaceNone = 0),
  43483. (n.CullFaceBack = 1),
  43484. (n.CullFaceFront = 2),
  43485. (n.CullFaceFrontBack = 3),
  43486. (n.FrontFaceDirectionCW = 0),
  43487. (n.FrontFaceDirectionCCW = 1),
  43488. (n.BasicShadowMap = 0),
  43489. (n.PCFShadowMap = 1),
  43490. (n.PCFSoftShadowMap = 2),
  43491. (n.FrontSide = 0),
  43492. (n.BackSide = 1),
  43493. (n.DoubleSide = 2),
  43494. (n.FlatShading = 1),
  43495. (n.SmoothShading = 2),
  43496. (n.NoColors = 0),
  43497. (n.FaceColors = 1),
  43498. (n.VertexColors = 2),
  43499. (n.NoBlending = 0),
  43500. (n.NormalBlending = 1),
  43501. (n.AdditiveBlending = 2),
  43502. (n.SubtractiveBlending = 3),
  43503. (n.MultiplyBlending = 4),
  43504. (n.CustomBlending = 5),
  43505. (n.AddEquation = 100),
  43506. (n.SubtractEquation = 101),
  43507. (n.ReverseSubtractEquation = 102),
  43508. (n.MinEquation = 103),
  43509. (n.MaxEquation = 104),
  43510. (n.ZeroFactor = 200),
  43511. (n.OneFactor = 201),
  43512. (n.SrcColorFactor = 202),
  43513. (n.OneMinusSrcColorFactor = 203),
  43514. (n.SrcAlphaFactor = 204),
  43515. (n.OneMinusSrcAlphaFactor = 205),
  43516. (n.DstAlphaFactor = 206),
  43517. (n.OneMinusDstAlphaFactor = 207),
  43518. (n.DstColorFactor = 208),
  43519. (n.OneMinusDstColorFactor = 209),
  43520. (n.SrcAlphaSaturateFactor = 210),
  43521. (n.NeverDepth = 0),
  43522. (n.AlwaysDepth = 1),
  43523. (n.LessDepth = 2),
  43524. (n.LessEqualDepth = 3),
  43525. (n.EqualDepth = 4),
  43526. (n.GreaterEqualDepth = 5),
  43527. (n.GreaterDepth = 6),
  43528. (n.NotEqualDepth = 7),
  43529. (n.MultiplyOperation = 0),
  43530. (n.MixOperation = 1),
  43531. (n.AddOperation = 2),
  43532. (n.NoToneMapping = 0),
  43533. (n.LinearToneMapping = 1),
  43534. (n.ReinhardToneMapping = 2),
  43535. (n.Uncharted2ToneMapping = 3),
  43536. (n.CineonToneMapping = 4),
  43537. (n.UVMapping = 300),
  43538. (n.CubeReflectionMapping = 301),
  43539. (n.CubeRefractionMapping = 302),
  43540. (n.EquirectangularReflectionMapping = 303),
  43541. (n.EquirectangularRefractionMapping = 304),
  43542. (n.SphericalReflectionMapping = 305),
  43543. (n.CubeUVReflectionMapping = 306),
  43544. (n.CubeUVRefractionMapping = 307),
  43545. (n.RepeatWrapping = 1e3),
  43546. (n.ClampToEdgeWrapping = 1001),
  43547. (n.MirroredRepeatWrapping = 1002),
  43548. (n.NearestFilter = 1003),
  43549. (n.NearestMipMapNearestFilter = 1004),
  43550. (n.NearestMipMapLinearFilter = 1005),
  43551. (n.LinearFilter = 1006),
  43552. (n.LinearMipMapNearestFilter = 1007),
  43553. (n.LinearMipMapLinearFilter = 1008),
  43554. (n.UnsignedByteType = 1009),
  43555. (n.ByteType = 1010),
  43556. (n.ShortType = 1011),
  43557. (n.UnsignedShortType = 1012),
  43558. (n.IntType = 1013),
  43559. (n.UnsignedIntType = 1014),
  43560. (n.FloatType = 1015),
  43561. (n.HalfFloatType = 1025),
  43562. (n.UnsignedShort4444Type = 1016),
  43563. (n.UnsignedShort5551Type = 1017),
  43564. (n.UnsignedShort565Type = 1018),
  43565. (n.AlphaFormat = 1019),
  43566. (n.RGBFormat = 1020),
  43567. (n.RGBAFormat = 1021),
  43568. (n.LuminanceFormat = 1022),
  43569. (n.LuminanceAlphaFormat = 1023),
  43570. (n.RGBEFormat = n.RGBAFormat),
  43571. (n.RGB_S3TC_DXT1_Format = 2001),
  43572. (n.RGBA_S3TC_DXT1_Format = 2002),
  43573. (n.RGBA_S3TC_DXT3_Format = 2003),
  43574. (n.RGBA_S3TC_DXT5_Format = 2004),
  43575. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  43576. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  43577. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  43578. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  43579. (n.RGB_ETC1_Format = 2151),
  43580. (n.LoopOnce = 2200),
  43581. (n.LoopRepeat = 2201),
  43582. (n.LoopPingPong = 2202),
  43583. (n.InterpolateDiscrete = 2300),
  43584. (n.InterpolateLinear = 2301),
  43585. (n.InterpolateSmooth = 2302),
  43586. (n.ZeroCurvatureEnding = 2400),
  43587. (n.ZeroSlopeEnding = 2401),
  43588. (n.WrapAroundEnding = 2402),
  43589. (n.TrianglesDrawMode = 0),
  43590. (n.TriangleStripDrawMode = 1),
  43591. (n.TriangleFanDrawMode = 2),
  43592. (n.LinearEncoding = 3e3),
  43593. (n.sRGBEncoding = 3001),
  43594. (n.GammaEncoding = 3007),
  43595. (n.RGBEEncoding = 3002),
  43596. (n.LogLuvEncoding = 3003),
  43597. (n.RGBM7Encoding = 3004),
  43598. (n.RGBM16Encoding = 3005),
  43599. (n.RGBDEncoding = 3006),
  43600. (n.Color = function (e) {
  43601. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e);
  43602. }),
  43603. (n.Color.prototype = {
  43604. constructor: n.Color,
  43605. r: 1,
  43606. g: 1,
  43607. b: 1,
  43608. set: function (e) {
  43609. return (
  43610. e instanceof n.Color
  43611. ? this.copy(e)
  43612. : 'number' == typeof e
  43613. ? this.setHex(e)
  43614. : 'string' == typeof e && this.setStyle(e),
  43615. this
  43616. );
  43617. },
  43618. setScalar: function (e) {
  43619. (this.r = e), (this.g = e), (this.b = e);
  43620. },
  43621. setHex: function (e) {
  43622. return (
  43623. (e = Math.floor(e)),
  43624. (this.r = ((e >> 16) & 255) / 255),
  43625. (this.g = ((e >> 8) & 255) / 255),
  43626. (this.b = (255 & e) / 255),
  43627. this
  43628. );
  43629. },
  43630. setRGB: function (e, t, i) {
  43631. return (this.r = e), (this.g = t), (this.b = i), this;
  43632. },
  43633. setHSL: (function () {
  43634. function e(e, t, i) {
  43635. return (
  43636. i < 0 && (i += 1),
  43637. i > 1 && (i -= 1),
  43638. i < 1 / 6
  43639. ? e + 6 * (t - e) * i
  43640. : i < 0.5
  43641. ? t
  43642. : i < 2 / 3
  43643. ? e + 6 * (t - e) * (2 / 3 - i)
  43644. : e
  43645. );
  43646. }
  43647. return function (t, i, r) {
  43648. if (
  43649. ((t = n.Math.euclideanModulo(t, 1)),
  43650. (i = n.Math.clamp(i, 0, 1)),
  43651. (r = n.Math.clamp(r, 0, 1)),
  43652. 0 === i)
  43653. )
  43654. this.r = this.g = this.b = r;
  43655. else {
  43656. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  43657. a = 2 * r - o;
  43658. (this.r = e(a, o, t + 1 / 3)),
  43659. (this.g = e(a, o, t)),
  43660. (this.b = e(a, o, t - 1 / 3));
  43661. }
  43662. return this;
  43663. };
  43664. })(),
  43665. setStyle: function (e) {
  43666. function t(t) {
  43667. void 0 !== t &&
  43668. parseFloat(t) < 1 &&
  43669. console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.');
  43670. }
  43671. var i;
  43672. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  43673. var r,
  43674. o = i[1],
  43675. a = i[2];
  43676. switch (o) {
  43677. case 'rgb':
  43678. case 'rgba':
  43679. if (
  43680. (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  43681. )
  43682. return (
  43683. (this.r = Math.min(255, parseInt(r[1], 10)) / 255),
  43684. (this.g = Math.min(255, parseInt(r[2], 10)) / 255),
  43685. (this.b = Math.min(255, parseInt(r[3], 10)) / 255),
  43686. t(r[5]),
  43687. this
  43688. );
  43689. if (
  43690. (r =
  43691. /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43692. a
  43693. ))
  43694. )
  43695. return (
  43696. (this.r = Math.min(100, parseInt(r[1], 10)) / 100),
  43697. (this.g = Math.min(100, parseInt(r[2], 10)) / 100),
  43698. (this.b = Math.min(100, parseInt(r[3], 10)) / 100),
  43699. t(r[5]),
  43700. this
  43701. );
  43702. break;
  43703. case 'hsl':
  43704. case 'hsla':
  43705. if (
  43706. (r =
  43707. /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43708. a
  43709. ))
  43710. ) {
  43711. var s = parseFloat(r[1]) / 360,
  43712. l = parseInt(r[2], 10) / 100,
  43713. c = parseInt(r[3], 10) / 100;
  43714. return t(r[5]), this.setHSL(s, l, c);
  43715. }
  43716. }
  43717. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  43718. var h = i[1],
  43719. u = h.length;
  43720. if (3 === u)
  43721. return (
  43722. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255),
  43723. (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255),
  43724. (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255),
  43725. this
  43726. );
  43727. if (6 === u)
  43728. return (
  43729. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255),
  43730. (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255),
  43731. (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255),
  43732. this
  43733. );
  43734. }
  43735. if (e && e.length > 0) {
  43736. var h = n.ColorKeywords[e];
  43737. void 0 !== h ? this.setHex(h) : console.warn('THREE.Color: Unknown color ' + e);
  43738. }
  43739. return this;
  43740. },
  43741. clone: function () {
  43742. return new this.constructor(this.r, this.g, this.b);
  43743. },
  43744. copy: function (e) {
  43745. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this;
  43746. },
  43747. copyGammaToLinear: function (e, t) {
  43748. return (
  43749. void 0 === t && (t = 2),
  43750. (this.r = Math.pow(e.r, t)),
  43751. (this.g = Math.pow(e.g, t)),
  43752. (this.b = Math.pow(e.b, t)),
  43753. this
  43754. );
  43755. },
  43756. copyLinearToGamma: function (e, t) {
  43757. void 0 === t && (t = 2);
  43758. var i = t > 0 ? 1 / t : 1;
  43759. return (
  43760. (this.r = Math.pow(e.r, i)),
  43761. (this.g = Math.pow(e.g, i)),
  43762. (this.b = Math.pow(e.b, i)),
  43763. this
  43764. );
  43765. },
  43766. convertGammaToLinear: function () {
  43767. var e = this.r,
  43768. t = this.g,
  43769. i = this.b;
  43770. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this;
  43771. },
  43772. convertLinearToGamma: function () {
  43773. return (
  43774. (this.r = Math.sqrt(this.r)),
  43775. (this.g = Math.sqrt(this.g)),
  43776. (this.b = Math.sqrt(this.b)),
  43777. this
  43778. );
  43779. },
  43780. getHex: function () {
  43781. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0);
  43782. },
  43783. getHexString: function () {
  43784. return ('000000' + this.getHex().toString(16)).slice(-6);
  43785. },
  43786. getHSL: function (e) {
  43787. var t,
  43788. i,
  43789. n = e || {
  43790. h: 0,
  43791. s: 0,
  43792. l: 0,
  43793. },
  43794. r = this.r,
  43795. o = this.g,
  43796. a = this.b,
  43797. s = Math.max(r, o, a),
  43798. l = Math.min(r, o, a),
  43799. c = (l + s) / 2;
  43800. if (l === s) (t = 0), (i = 0);
  43801. else {
  43802. var h = s - l;
  43803. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  43804. case r:
  43805. t = (o - a) / h + (o < a ? 6 : 0);
  43806. break;
  43807. case o:
  43808. t = (a - r) / h + 2;
  43809. break;
  43810. case a:
  43811. t = (r - o) / h + 4;
  43812. }
  43813. t /= 6;
  43814. }
  43815. return (n.h = t), (n.s = i), (n.l = c), n;
  43816. },
  43817. getStyle: function () {
  43818. return (
  43819. 'rgb(' +
  43820. ((255 * this.r) | 0) +
  43821. ',' +
  43822. ((255 * this.g) | 0) +
  43823. ',' +
  43824. ((255 * this.b) | 0) +
  43825. ')'
  43826. );
  43827. },
  43828. offsetHSL: function (e, t, i) {
  43829. var n = this.getHSL();
  43830. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this;
  43831. },
  43832. add: function (e) {
  43833. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this;
  43834. },
  43835. addColors: function (e, t) {
  43836. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this;
  43837. },
  43838. addScalar: function (e) {
  43839. return (this.r += e), (this.g += e), (this.b += e), this;
  43840. },
  43841. multiply: function (e) {
  43842. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this;
  43843. },
  43844. multiplyScalar: function (e) {
  43845. return (this.r *= e), (this.g *= e), (this.b *= e), this;
  43846. },
  43847. lerp: function (e, t) {
  43848. return (
  43849. (this.r += (e.r - this.r) * t),
  43850. (this.g += (e.g - this.g) * t),
  43851. (this.b += (e.b - this.b) * t),
  43852. this
  43853. );
  43854. },
  43855. equals: function (e) {
  43856. return e.r === this.r && e.g === this.g && e.b === this.b;
  43857. },
  43858. fromArray: function (e, t) {
  43859. return (
  43860. void 0 === t && (t = 0),
  43861. (this.r = e[t]),
  43862. (this.g = e[t + 1]),
  43863. (this.b = e[t + 2]),
  43864. this
  43865. );
  43866. },
  43867. toArray: function (e, t) {
  43868. return (
  43869. void 0 === e && (e = []),
  43870. void 0 === t && (t = 0),
  43871. (e[t] = this.r),
  43872. (e[t + 1] = this.g),
  43873. (e[t + 2] = this.b),
  43874. e
  43875. );
  43876. },
  43877. }),
  43878. (n.ColorKeywords = {
  43879. aliceblue: 15792383,
  43880. antiquewhite: 16444375,
  43881. aqua: 65535,
  43882. aquamarine: 8388564,
  43883. azure: 15794175,
  43884. beige: 16119260,
  43885. bisque: 16770244,
  43886. black: 0,
  43887. blanchedalmond: 16772045,
  43888. blue: 255,
  43889. blueviolet: 9055202,
  43890. brown: 10824234,
  43891. burlywood: 14596231,
  43892. cadetblue: 6266528,
  43893. chartreuse: 8388352,
  43894. chocolate: 13789470,
  43895. coral: 16744272,
  43896. cornflowerblue: 6591981,
  43897. cornsilk: 16775388,
  43898. crimson: 14423100,
  43899. cyan: 65535,
  43900. darkblue: 139,
  43901. darkcyan: 35723,
  43902. darkgoldenrod: 12092939,
  43903. darkgray: 11119017,
  43904. darkgreen: 25600,
  43905. darkgrey: 11119017,
  43906. darkkhaki: 12433259,
  43907. darkmagenta: 9109643,
  43908. darkolivegreen: 5597999,
  43909. darkorange: 16747520,
  43910. darkorchid: 10040012,
  43911. darkred: 9109504,
  43912. darksalmon: 15308410,
  43913. darkseagreen: 9419919,
  43914. darkslateblue: 4734347,
  43915. darkslategray: 3100495,
  43916. darkslategrey: 3100495,
  43917. darkturquoise: 52945,
  43918. darkviolet: 9699539,
  43919. deeppink: 16716947,
  43920. deepskyblue: 49151,
  43921. dimgray: 6908265,
  43922. dimgrey: 6908265,
  43923. dodgerblue: 2003199,
  43924. firebrick: 11674146,
  43925. floralwhite: 16775920,
  43926. forestgreen: 2263842,
  43927. fuchsia: 16711935,
  43928. gainsboro: 14474460,
  43929. ghostwhite: 16316671,
  43930. gold: 16766720,
  43931. goldenrod: 14329120,
  43932. gray: 8421504,
  43933. green: 32768,
  43934. greenyellow: 11403055,
  43935. grey: 8421504,
  43936. honeydew: 15794160,
  43937. hotpink: 16738740,
  43938. indianred: 13458524,
  43939. indigo: 4915330,
  43940. ivory: 16777200,
  43941. khaki: 15787660,
  43942. lavender: 15132410,
  43943. lavenderblush: 16773365,
  43944. lawngreen: 8190976,
  43945. lemonchiffon: 16775885,
  43946. lightblue: 11393254,
  43947. lightcoral: 15761536,
  43948. lightcyan: 14745599,
  43949. lightgoldenrodyellow: 16448210,
  43950. lightgray: 13882323,
  43951. lightgreen: 9498256,
  43952. lightgrey: 13882323,
  43953. lightpink: 16758465,
  43954. lightsalmon: 16752762,
  43955. lightseagreen: 2142890,
  43956. lightskyblue: 8900346,
  43957. lightslategray: 7833753,
  43958. lightslategrey: 7833753,
  43959. lightsteelblue: 11584734,
  43960. lightyellow: 16777184,
  43961. lime: 65280,
  43962. limegreen: 3329330,
  43963. linen: 16445670,
  43964. magenta: 16711935,
  43965. maroon: 8388608,
  43966. mediumaquamarine: 6737322,
  43967. mediumblue: 205,
  43968. mediumorchid: 12211667,
  43969. mediumpurple: 9662683,
  43970. mediumseagreen: 3978097,
  43971. mediumslateblue: 8087790,
  43972. mediumspringgreen: 64154,
  43973. mediumturquoise: 4772300,
  43974. mediumvioletred: 13047173,
  43975. midnightblue: 1644912,
  43976. mintcream: 16121850,
  43977. mistyrose: 16770273,
  43978. moccasin: 16770229,
  43979. navajowhite: 16768685,
  43980. navy: 128,
  43981. oldlace: 16643558,
  43982. olive: 8421376,
  43983. olivedrab: 7048739,
  43984. orange: 16753920,
  43985. orangered: 16729344,
  43986. orchid: 14315734,
  43987. palegoldenrod: 15657130,
  43988. palegreen: 10025880,
  43989. paleturquoise: 11529966,
  43990. palevioletred: 14381203,
  43991. papayawhip: 16773077,
  43992. peachpuff: 16767673,
  43993. peru: 13468991,
  43994. pink: 16761035,
  43995. plum: 14524637,
  43996. powderblue: 11591910,
  43997. purple: 8388736,
  43998. red: 16711680,
  43999. rosybrown: 12357519,
  44000. royalblue: 4286945,
  44001. saddlebrown: 9127187,
  44002. salmon: 16416882,
  44003. sandybrown: 16032864,
  44004. seagreen: 3050327,
  44005. seashell: 16774638,
  44006. sienna: 10506797,
  44007. silver: 12632256,
  44008. skyblue: 8900331,
  44009. slateblue: 6970061,
  44010. slategray: 7372944,
  44011. slategrey: 7372944,
  44012. snow: 16775930,
  44013. springgreen: 65407,
  44014. steelblue: 4620980,
  44015. tan: 13808780,
  44016. teal: 32896,
  44017. thistle: 14204888,
  44018. tomato: 16737095,
  44019. turquoise: 4251856,
  44020. violet: 15631086,
  44021. wheat: 16113331,
  44022. white: 16777215,
  44023. whitesmoke: 16119285,
  44024. yellow: 16776960,
  44025. yellowgreen: 10145074,
  44026. }),
  44027. (n.Quaternion = function (e, t, i, n) {
  44028. (this._x = e || 0),
  44029. (this._y = t || 0),
  44030. (this._z = i || 0),
  44031. (this._w = void 0 !== n ? n : 1);
  44032. }),
  44033. (n.Quaternion.prototype = {
  44034. constructor: n.Quaternion,
  44035. get x() {
  44036. return this._x;
  44037. },
  44038. set x(e) {
  44039. (this._x = e), this.onChangeCallback();
  44040. },
  44041. get y() {
  44042. return this._y;
  44043. },
  44044. set y(e) {
  44045. (this._y = e), this.onChangeCallback();
  44046. },
  44047. get z() {
  44048. return this._z;
  44049. },
  44050. set z(e) {
  44051. (this._z = e), this.onChangeCallback();
  44052. },
  44053. get w() {
  44054. return this._w;
  44055. },
  44056. set w(e) {
  44057. (this._w = e), this.onChangeCallback();
  44058. },
  44059. set: function (e, t, i, n) {
  44060. return (
  44061. (this._x = e),
  44062. (this._y = t),
  44063. (this._z = i),
  44064. (this._w = n),
  44065. this.onChangeCallback(),
  44066. this
  44067. );
  44068. },
  44069. clone: function () {
  44070. return new this.constructor(this._x, this._y, this._z, this._w);
  44071. },
  44072. copy: function (e) {
  44073. return (
  44074. (this._x = e.x),
  44075. (this._y = e.y),
  44076. (this._z = e.z),
  44077. (this._w = e.w),
  44078. this.onChangeCallback(),
  44079. this
  44080. );
  44081. },
  44082. setFromEuler: function (e, t) {
  44083. if (e instanceof n.Euler == !1)
  44084. throw new Error(
  44085. 'THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  44086. );
  44087. var i = Math.cos(e._x / 2),
  44088. r = Math.cos(e._y / 2),
  44089. o = Math.cos(e._z / 2),
  44090. a = Math.sin(e._x / 2),
  44091. s = Math.sin(e._y / 2),
  44092. l = Math.sin(e._z / 2),
  44093. c = e.order;
  44094. return (
  44095. 'XYZ' === c
  44096. ? ((this._x = a * r * o + i * s * l),
  44097. (this._y = i * s * o - a * r * l),
  44098. (this._z = i * r * l + a * s * o),
  44099. (this._w = i * r * o - a * s * l))
  44100. : 'YXZ' === c
  44101. ? ((this._x = a * r * o + i * s * l),
  44102. (this._y = i * s * o - a * r * l),
  44103. (this._z = i * r * l - a * s * o),
  44104. (this._w = i * r * o + a * s * l))
  44105. : 'ZXY' === c
  44106. ? ((this._x = a * r * o - i * s * l),
  44107. (this._y = i * s * o + a * r * l),
  44108. (this._z = i * r * l + a * s * o),
  44109. (this._w = i * r * o - a * s * l))
  44110. : 'ZYX' === c
  44111. ? ((this._x = a * r * o - i * s * l),
  44112. (this._y = i * s * o + a * r * l),
  44113. (this._z = i * r * l - a * s * o),
  44114. (this._w = i * r * o + a * s * l))
  44115. : 'YZX' === c
  44116. ? ((this._x = a * r * o + i * s * l),
  44117. (this._y = i * s * o + a * r * l),
  44118. (this._z = i * r * l - a * s * o),
  44119. (this._w = i * r * o - a * s * l))
  44120. : 'XZY' === c &&
  44121. ((this._x = a * r * o - i * s * l),
  44122. (this._y = i * s * o - a * r * l),
  44123. (this._z = i * r * l + a * s * o),
  44124. (this._w = i * r * o + a * s * l)),
  44125. t !== !1 && this.onChangeCallback(),
  44126. this
  44127. );
  44128. },
  44129. setFromAxisAngle: function (e, t) {
  44130. var i = t / 2,
  44131. n = Math.sin(i);
  44132. return (
  44133. (this._x = e.x * n),
  44134. (this._y = e.y * n),
  44135. (this._z = e.z * n),
  44136. (this._w = Math.cos(i)),
  44137. this.onChangeCallback(),
  44138. this
  44139. );
  44140. },
  44141. setFromRotationMatrix: function (e) {
  44142. var t,
  44143. i = e.elements,
  44144. n = i[0],
  44145. r = i[4],
  44146. o = i[8],
  44147. a = i[1],
  44148. s = i[5],
  44149. l = i[9],
  44150. c = i[2],
  44151. h = i[6],
  44152. u = i[10],
  44153. d = n + s + u;
  44154. return (
  44155. d > 0
  44156. ? ((t = 0.5 / Math.sqrt(d + 1)),
  44157. (this._w = 0.25 / t),
  44158. (this._x = (h - l) * t),
  44159. (this._y = (o - c) * t),
  44160. (this._z = (a - r) * t))
  44161. : n > s && n > u
  44162. ? ((t = 2 * Math.sqrt(1 + n - s - u)),
  44163. (this._w = (h - l) / t),
  44164. (this._x = 0.25 * t),
  44165. (this._y = (r + a) / t),
  44166. (this._z = (o + c) / t))
  44167. : s > u
  44168. ? ((t = 2 * Math.sqrt(1 + s - n - u)),
  44169. (this._w = (o - c) / t),
  44170. (this._x = (r + a) / t),
  44171. (this._y = 0.25 * t),
  44172. (this._z = (l + h) / t))
  44173. : ((t = 2 * Math.sqrt(1 + u - n - s)),
  44174. (this._w = (a - r) / t),
  44175. (this._x = (o + c) / t),
  44176. (this._y = (l + h) / t),
  44177. (this._z = 0.25 * t)),
  44178. this.onChangeCallback(),
  44179. this
  44180. );
  44181. },
  44182. setFromUnitVectors: (function () {
  44183. var e,
  44184. t,
  44185. i = 1e-6;
  44186. return function (r, o) {
  44187. return (
  44188. void 0 === e && (e = new n.Vector3()),
  44189. (t = r.dot(o) + 1),
  44190. t < i
  44191. ? ((t = 0),
  44192. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y))
  44193. : e.crossVectors(r, o),
  44194. (this._x = e.x),
  44195. (this._y = e.y),
  44196. (this._z = e.z),
  44197. (this._w = t),
  44198. this.normalize(),
  44199. this
  44200. );
  44201. };
  44202. })(),
  44203. inverse: function () {
  44204. return this.conjugate().normalize(), this;
  44205. },
  44206. conjugate: function () {
  44207. return (
  44208. (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  44209. );
  44210. },
  44211. dot: function (e) {
  44212. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
  44213. },
  44214. lengthSq: function () {
  44215. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
  44216. },
  44217. length: function () {
  44218. return Math.sqrt(
  44219. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  44220. );
  44221. },
  44222. normalize: function () {
  44223. var e = this.length();
  44224. return (
  44225. 0 === e
  44226. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  44227. : ((e = 1 / e),
  44228. (this._x = this._x * e),
  44229. (this._y = this._y * e),
  44230. (this._z = this._z * e),
  44231. (this._w = this._w * e)),
  44232. this.onChangeCallback(),
  44233. this
  44234. );
  44235. },
  44236. multiply: function (e, t) {
  44237. return void 0 !== t
  44238. ? (console.warn(
  44239. 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'
  44240. ),
  44241. this.multiplyQuaternions(e, t))
  44242. : this.multiplyQuaternions(this, e);
  44243. },
  44244. multiplyQuaternions: function (e, t) {
  44245. var i = e._x,
  44246. n = e._y,
  44247. r = e._z,
  44248. o = e._w,
  44249. a = t._x,
  44250. s = t._y,
  44251. l = t._z,
  44252. c = t._w;
  44253. return (
  44254. (this._x = i * c + o * a + n * l - r * s),
  44255. (this._y = n * c + o * s + r * a - i * l),
  44256. (this._z = r * c + o * l + i * s - n * a),
  44257. (this._w = o * c - i * a - n * s - r * l),
  44258. this.onChangeCallback(),
  44259. this
  44260. );
  44261. },
  44262. slerp: function (e, t) {
  44263. if (0 === t) return this;
  44264. if (1 === t) return this.copy(e);
  44265. var i = this._x,
  44266. n = this._y,
  44267. r = this._z,
  44268. o = this._w,
  44269. a = o * e._w + i * e._x + n * e._y + r * e._z;
  44270. if (
  44271. (a < 0
  44272. ? ((this._w = -e._w),
  44273. (this._x = -e._x),
  44274. (this._y = -e._y),
  44275. (this._z = -e._z),
  44276. (a = -a))
  44277. : this.copy(e),
  44278. a >= 1)
  44279. )
  44280. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this;
  44281. var s = Math.sqrt(1 - a * a);
  44282. if (Math.abs(s) < 0.001)
  44283. return (
  44284. (this._w = 0.5 * (o + this._w)),
  44285. (this._x = 0.5 * (i + this._x)),
  44286. (this._y = 0.5 * (n + this._y)),
  44287. (this._z = 0.5 * (r + this._z)),
  44288. this
  44289. );
  44290. var l = Math.atan2(s, a),
  44291. c = Math.sin((1 - t) * l) / s,
  44292. h = Math.sin(t * l) / s;
  44293. return (
  44294. (this._w = o * c + this._w * h),
  44295. (this._x = i * c + this._x * h),
  44296. (this._y = n * c + this._y * h),
  44297. (this._z = r * c + this._z * h),
  44298. this.onChangeCallback(),
  44299. this
  44300. );
  44301. },
  44302. equals: function (e) {
  44303. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;
  44304. },
  44305. fromArray: function (e, t) {
  44306. return (
  44307. void 0 === t && (t = 0),
  44308. (this._x = e[t]),
  44309. (this._y = e[t + 1]),
  44310. (this._z = e[t + 2]),
  44311. (this._w = e[t + 3]),
  44312. this.onChangeCallback(),
  44313. this
  44314. );
  44315. },
  44316. toArray: function (e, t) {
  44317. return (
  44318. void 0 === e && (e = []),
  44319. void 0 === t && (t = 0),
  44320. (e[t] = this._x),
  44321. (e[t + 1] = this._y),
  44322. (e[t + 2] = this._z),
  44323. (e[t + 3] = this._w),
  44324. e
  44325. );
  44326. },
  44327. onChange: function (e) {
  44328. return (this.onChangeCallback = e), this;
  44329. },
  44330. onChangeCallback: function () {},
  44331. }),
  44332. Object.assign(n.Quaternion, {
  44333. slerp: function (e, t, i, n) {
  44334. return i.copy(e).slerp(t, n);
  44335. },
  44336. slerpFlat: function (e, t, i, n, r, o, a) {
  44337. var s = i[n + 0],
  44338. l = i[n + 1],
  44339. c = i[n + 2],
  44340. h = i[n + 3],
  44341. u = r[o + 0],
  44342. d = r[o + 1],
  44343. p = r[o + 2],
  44344. f = r[o + 3];
  44345. if (h !== f || s !== u || l !== d || c !== p) {
  44346. var g = 1 - a,
  44347. m = s * u + l * d + c * p + h * f,
  44348. v = m >= 0 ? 1 : -1,
  44349. A = 1 - m * m;
  44350. if (A > Number.EPSILON) {
  44351. var y = Math.sqrt(A),
  44352. C = Math.atan2(y, m * v);
  44353. (g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y);
  44354. }
  44355. var I = a * v;
  44356. if (
  44357. ((s = s * g + u * I),
  44358. (l = l * g + d * I),
  44359. (c = c * g + p * I),
  44360. (h = h * g + f * I),
  44361. g === 1 - a)
  44362. ) {
  44363. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  44364. (s *= E), (l *= E), (c *= E), (h *= E);
  44365. }
  44366. }
  44367. (e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h);
  44368. },
  44369. }),
  44370. (n.Vector2 = function (e, t) {
  44371. (this.x = e || 0), (this.y = t || 0);
  44372. }),
  44373. (n.Vector2.prototype = {
  44374. constructor: n.Vector2,
  44375. get width() {
  44376. return this.x;
  44377. },
  44378. set width(e) {
  44379. this.x = e;
  44380. },
  44381. get height() {
  44382. return this.y;
  44383. },
  44384. set height(e) {
  44385. this.y = e;
  44386. },
  44387. set: function (e, t) {
  44388. return (this.x = e), (this.y = t), this;
  44389. },
  44390. setScalar: function (e) {
  44391. return (this.x = e), (this.y = e), this;
  44392. },
  44393. setX: function (e) {
  44394. return (this.x = e), this;
  44395. },
  44396. setY: function (e) {
  44397. return (this.y = e), this;
  44398. },
  44399. setComponent: function (e, t) {
  44400. switch (e) {
  44401. case 0:
  44402. this.x = t;
  44403. break;
  44404. case 1:
  44405. this.y = t;
  44406. break;
  44407. default:
  44408. throw new Error('index is out of range: ' + e);
  44409. }
  44410. },
  44411. getComponent: function (e) {
  44412. switch (e) {
  44413. case 0:
  44414. return this.x;
  44415. case 1:
  44416. return this.y;
  44417. default:
  44418. throw new Error('index is out of range: ' + e);
  44419. }
  44420. },
  44421. clone: function () {
  44422. return new this.constructor(this.x, this.y);
  44423. },
  44424. copy: function (e) {
  44425. return (this.x = e.x), (this.y = e.y), this;
  44426. },
  44427. add: function (e, t) {
  44428. return void 0 !== t
  44429. ? (console.warn(
  44430. 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44431. ),
  44432. this.addVectors(e, t))
  44433. : ((this.x += e.x), (this.y += e.y), this);
  44434. },
  44435. addScalar: function (e) {
  44436. return (this.x += e), (this.y += e), this;
  44437. },
  44438. addVectors: function (e, t) {
  44439. return (this.x = e.x + t.x), (this.y = e.y + t.y), this;
  44440. },
  44441. addScaledVector: function (e, t) {
  44442. return (this.x += e.x * t), (this.y += e.y * t), this;
  44443. },
  44444. sub: function (e, t) {
  44445. return void 0 !== t
  44446. ? (console.warn(
  44447. 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44448. ),
  44449. this.subVectors(e, t))
  44450. : ((this.x -= e.x), (this.y -= e.y), this);
  44451. },
  44452. subScalar: function (e) {
  44453. return (this.x -= e), (this.y -= e), this;
  44454. },
  44455. subVectors: function (e, t) {
  44456. return (this.x = e.x - t.x), (this.y = e.y - t.y), this;
  44457. },
  44458. multiply: function (e) {
  44459. return (this.x *= e.x), (this.y *= e.y), this;
  44460. },
  44461. multiplyScalar: function (e) {
  44462. return (
  44463. isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  44464. );
  44465. },
  44466. divide: function (e) {
  44467. return (this.x /= e.x), (this.y /= e.y), this;
  44468. },
  44469. divideScalar: function (e) {
  44470. return this.multiplyScalar(1 / e);
  44471. },
  44472. min: function (e) {
  44473. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this;
  44474. },
  44475. max: function (e) {
  44476. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this;
  44477. },
  44478. clamp: function (e, t) {
  44479. return (
  44480. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44481. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44482. this
  44483. );
  44484. },
  44485. clampScalar: (function () {
  44486. var e, t;
  44487. return function (i, r) {
  44488. return (
  44489. void 0 === e && ((e = new n.Vector2()), (t = new n.Vector2())),
  44490. e.set(i, i),
  44491. t.set(r, r),
  44492. this.clamp(e, t)
  44493. );
  44494. };
  44495. })(),
  44496. clampLength: function (e, t) {
  44497. var i = this.length();
  44498. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  44499. },
  44500. floor: function () {
  44501. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this;
  44502. },
  44503. ceil: function () {
  44504. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this;
  44505. },
  44506. round: function () {
  44507. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this;
  44508. },
  44509. roundToZero: function () {
  44510. return (
  44511. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  44512. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  44513. this
  44514. );
  44515. },
  44516. negate: function () {
  44517. return (this.x = -this.x), (this.y = -this.y), this;
  44518. },
  44519. dot: function (e) {
  44520. return this.x * e.x + this.y * e.y;
  44521. },
  44522. lengthSq: function () {
  44523. return this.x * this.x + this.y * this.y;
  44524. },
  44525. length: function () {
  44526. return Math.sqrt(this.x * this.x + this.y * this.y);
  44527. },
  44528. lengthManhattan: function () {
  44529. return Math.abs(this.x) + Math.abs(this.y);
  44530. },
  44531. normalize: function () {
  44532. return this.divideScalar(this.length());
  44533. },
  44534. angle: function () {
  44535. var e = Math.atan2(this.y, this.x);
  44536. return e < 0 && (e += 2 * Math.PI), e;
  44537. },
  44538. distanceTo: function (e) {
  44539. return Math.sqrt(this.distanceToSquared(e));
  44540. },
  44541. distanceToSquared: function (e) {
  44542. var t = this.x - e.x,
  44543. i = this.y - e.y;
  44544. return t * t + i * i;
  44545. },
  44546. setLength: function (e) {
  44547. return this.multiplyScalar(e / this.length());
  44548. },
  44549. lerp: function (e, t) {
  44550. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this;
  44551. },
  44552. lerpVectors: function (e, t, i) {
  44553. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  44554. },
  44555. equals: function (e) {
  44556. return e.x === this.x && e.y === this.y;
  44557. },
  44558. fromArray: function (e, t) {
  44559. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this;
  44560. },
  44561. toArray: function (e, t) {
  44562. return (
  44563. void 0 === e && (e = []),
  44564. void 0 === t && (t = 0),
  44565. (e[t] = this.x),
  44566. (e[t + 1] = this.y),
  44567. e
  44568. );
  44569. },
  44570. fromAttribute: function (e, t, i) {
  44571. return (
  44572. void 0 === i && (i = 0),
  44573. (t = t * e.itemSize + i),
  44574. (this.x = e.array[t]),
  44575. (this.y = e.array[t + 1]),
  44576. this
  44577. );
  44578. },
  44579. rotateAround: function (e, t) {
  44580. var i = Math.cos(t),
  44581. n = Math.sin(t),
  44582. r = this.x - e.x,
  44583. o = this.y - e.y;
  44584. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this;
  44585. },
  44586. }),
  44587. (n.Vector3 = function (e, t, i) {
  44588. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  44589. }),
  44590. (n.Vector3.prototype = {
  44591. constructor: n.Vector3,
  44592. set: function (e, t, i) {
  44593. return (this.x = e), (this.y = t), (this.z = i), this;
  44594. },
  44595. setScalar: function (e) {
  44596. return (this.x = e), (this.y = e), (this.z = e), this;
  44597. },
  44598. setX: function (e) {
  44599. return (this.x = e), this;
  44600. },
  44601. setY: function (e) {
  44602. return (this.y = e), this;
  44603. },
  44604. setZ: function (e) {
  44605. return (this.z = e), this;
  44606. },
  44607. setComponent: function (e, t) {
  44608. switch (e) {
  44609. case 0:
  44610. this.x = t;
  44611. break;
  44612. case 1:
  44613. this.y = t;
  44614. break;
  44615. case 2:
  44616. this.z = t;
  44617. break;
  44618. default:
  44619. throw new Error('index is out of range: ' + e);
  44620. }
  44621. },
  44622. getComponent: function (e) {
  44623. switch (e) {
  44624. case 0:
  44625. return this.x;
  44626. case 1:
  44627. return this.y;
  44628. case 2:
  44629. return this.z;
  44630. default:
  44631. throw new Error('index is out of range: ' + e);
  44632. }
  44633. },
  44634. clone: function () {
  44635. return new this.constructor(this.x, this.y, this.z);
  44636. },
  44637. copy: function (e) {
  44638. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this;
  44639. },
  44640. add: function (e, t) {
  44641. return void 0 !== t
  44642. ? (console.warn(
  44643. 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44644. ),
  44645. this.addVectors(e, t))
  44646. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this);
  44647. },
  44648. addScalar: function (e) {
  44649. return (this.x += e), (this.y += e), (this.z += e), this;
  44650. },
  44651. addVectors: function (e, t) {
  44652. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this;
  44653. },
  44654. addScaledVector: function (e, t) {
  44655. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this;
  44656. },
  44657. sub: function (e, t) {
  44658. return void 0 !== t
  44659. ? (console.warn(
  44660. 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44661. ),
  44662. this.subVectors(e, t))
  44663. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this);
  44664. },
  44665. subScalar: function (e) {
  44666. return (this.x -= e), (this.y -= e), (this.z -= e), this;
  44667. },
  44668. subVectors: function (e, t) {
  44669. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this;
  44670. },
  44671. multiply: function (e, t) {
  44672. return void 0 !== t
  44673. ? (console.warn(
  44674. 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'
  44675. ),
  44676. this.multiplyVectors(e, t))
  44677. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this);
  44678. },
  44679. multiplyScalar: function (e) {
  44680. return (
  44681. isFinite(e)
  44682. ? ((this.x *= e), (this.y *= e), (this.z *= e))
  44683. : ((this.x = 0), (this.y = 0), (this.z = 0)),
  44684. this
  44685. );
  44686. },
  44687. multiplyVectors: function (e, t) {
  44688. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this;
  44689. },
  44690. applyEuler: (function () {
  44691. var e;
  44692. return function (t) {
  44693. return (
  44694. t instanceof n.Euler == !1 &&
  44695. console.error(
  44696. 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'
  44697. ),
  44698. void 0 === e && (e = new n.Quaternion()),
  44699. this.applyQuaternion(e.setFromEuler(t)),
  44700. this
  44701. );
  44702. };
  44703. })(),
  44704. applyAxisAngle: (function () {
  44705. var e;
  44706. return function (t, i) {
  44707. return (
  44708. void 0 === e && (e = new n.Quaternion()),
  44709. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  44710. this
  44711. );
  44712. };
  44713. })(),
  44714. applyMatrix3: function (e) {
  44715. var t = this.x,
  44716. i = this.y,
  44717. n = this.z,
  44718. r = e.elements;
  44719. return (
  44720. (this.x = r[0] * t + r[3] * i + r[6] * n),
  44721. (this.y = r[1] * t + r[4] * i + r[7] * n),
  44722. (this.z = r[2] * t + r[5] * i + r[8] * n),
  44723. this
  44724. );
  44725. },
  44726. applyMatrix4: function (e) {
  44727. var t = this.x,
  44728. i = this.y,
  44729. n = this.z,
  44730. r = e.elements;
  44731. return (
  44732. (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  44733. (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  44734. (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  44735. this
  44736. );
  44737. },
  44738. applyProjection: function (e) {
  44739. var t = this.x,
  44740. i = this.y,
  44741. n = this.z,
  44742. r = e.elements,
  44743. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  44744. return (
  44745. (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o),
  44746. (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o),
  44747. (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o),
  44748. this
  44749. );
  44750. },
  44751. applyQuaternion: function (e) {
  44752. var t = this.x,
  44753. i = this.y,
  44754. n = this.z,
  44755. r = e.x,
  44756. o = e.y,
  44757. a = e.z,
  44758. s = e.w,
  44759. l = s * t + o * n - a * i,
  44760. c = s * i + a * t - r * n,
  44761. h = s * n + r * i - o * t,
  44762. u = -r * t - o * i - a * n;
  44763. return (
  44764. (this.x = l * s + u * -r + c * -a - h * -o),
  44765. (this.y = c * s + u * -o + h * -r - l * -a),
  44766. (this.z = h * s + u * -a + l * -o - c * -r),
  44767. this
  44768. );
  44769. },
  44770. project: (function () {
  44771. var e;
  44772. return function (t) {
  44773. return (
  44774. void 0 === e && (e = new n.Matrix4()),
  44775. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  44776. this.applyProjection(e)
  44777. );
  44778. };
  44779. })(),
  44780. unproject: (function () {
  44781. var e;
  44782. return function (t) {
  44783. return (
  44784. void 0 === e && (e = new n.Matrix4()),
  44785. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  44786. this.applyProjection(e)
  44787. );
  44788. };
  44789. })(),
  44790. transformDirection: function (e) {
  44791. var t = this.x,
  44792. i = this.y,
  44793. n = this.z,
  44794. r = e.elements;
  44795. return (
  44796. (this.x = r[0] * t + r[4] * i + r[8] * n),
  44797. (this.y = r[1] * t + r[5] * i + r[9] * n),
  44798. (this.z = r[2] * t + r[6] * i + r[10] * n),
  44799. this.normalize(),
  44800. this
  44801. );
  44802. },
  44803. divide: function (e) {
  44804. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this;
  44805. },
  44806. divideScalar: function (e) {
  44807. return this.multiplyScalar(1 / e);
  44808. },
  44809. min: function (e) {
  44810. return (
  44811. (this.x = Math.min(this.x, e.x)),
  44812. (this.y = Math.min(this.y, e.y)),
  44813. (this.z = Math.min(this.z, e.z)),
  44814. this
  44815. );
  44816. },
  44817. max: function (e) {
  44818. return (
  44819. (this.x = Math.max(this.x, e.x)),
  44820. (this.y = Math.max(this.y, e.y)),
  44821. (this.z = Math.max(this.z, e.z)),
  44822. this
  44823. );
  44824. },
  44825. clamp: function (e, t) {
  44826. return (
  44827. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44828. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44829. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  44830. this
  44831. );
  44832. },
  44833. clampScalar: (function () {
  44834. var e, t;
  44835. return function (i, r) {
  44836. return (
  44837. void 0 === e && ((e = new n.Vector3()), (t = new n.Vector3())),
  44838. e.set(i, i, i),
  44839. t.set(r, r, r),
  44840. this.clamp(e, t)
  44841. );
  44842. };
  44843. })(),
  44844. clampLength: function (e, t) {
  44845. var i = this.length();
  44846. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  44847. },
  44848. floor: function () {
  44849. return (
  44850. (this.x = Math.floor(this.x)),
  44851. (this.y = Math.floor(this.y)),
  44852. (this.z = Math.floor(this.z)),
  44853. this
  44854. );
  44855. },
  44856. ceil: function () {
  44857. return (
  44858. (this.x = Math.ceil(this.x)),
  44859. (this.y = Math.ceil(this.y)),
  44860. (this.z = Math.ceil(this.z)),
  44861. this
  44862. );
  44863. },
  44864. round: function () {
  44865. return (
  44866. (this.x = Math.round(this.x)),
  44867. (this.y = Math.round(this.y)),
  44868. (this.z = Math.round(this.z)),
  44869. this
  44870. );
  44871. },
  44872. roundToZero: function () {
  44873. return (
  44874. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  44875. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  44876. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  44877. this
  44878. );
  44879. },
  44880. negate: function () {
  44881. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this;
  44882. },
  44883. dot: function (e) {
  44884. return this.x * e.x + this.y * e.y + this.z * e.z;
  44885. },
  44886. lengthSq: function () {
  44887. return this.x * this.x + this.y * this.y + this.z * this.z;
  44888. },
  44889. length: function () {
  44890. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
  44891. },
  44892. lengthManhattan: function () {
  44893. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
  44894. },
  44895. normalize: function () {
  44896. return this.divideScalar(this.length());
  44897. },
  44898. setLength: function (e) {
  44899. return this.multiplyScalar(e / this.length());
  44900. },
  44901. lerp: function (e, t) {
  44902. return (
  44903. (this.x += (e.x - this.x) * t),
  44904. (this.y += (e.y - this.y) * t),
  44905. (this.z += (e.z - this.z) * t),
  44906. this
  44907. );
  44908. },
  44909. lerpVectors: function (e, t, i) {
  44910. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  44911. },
  44912. cross: function (e, t) {
  44913. if (void 0 !== t)
  44914. return (
  44915. console.warn(
  44916. 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'
  44917. ),
  44918. this.crossVectors(e, t)
  44919. );
  44920. var i = this.x,
  44921. n = this.y,
  44922. r = this.z;
  44923. return (
  44924. (this.x = n * e.z - r * e.y),
  44925. (this.y = r * e.x - i * e.z),
  44926. (this.z = i * e.y - n * e.x),
  44927. this
  44928. );
  44929. },
  44930. crossVectors: function (e, t) {
  44931. var i = e.x,
  44932. n = e.y,
  44933. r = e.z,
  44934. o = t.x,
  44935. a = t.y,
  44936. s = t.z;
  44937. return (
  44938. (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  44939. );
  44940. },
  44941. projectOnVector: (function () {
  44942. var e, t;
  44943. return function (i) {
  44944. return (
  44945. void 0 === e && (e = new n.Vector3()),
  44946. e.copy(i).normalize(),
  44947. (t = this.dot(e)),
  44948. this.copy(e).multiplyScalar(t)
  44949. );
  44950. };
  44951. })(),
  44952. projectOnPlane: (function () {
  44953. var e;
  44954. return function (t) {
  44955. return (
  44956. void 0 === e && (e = new n.Vector3()),
  44957. e.copy(this).projectOnVector(t),
  44958. this.sub(e)
  44959. );
  44960. };
  44961. })(),
  44962. reflect: (function () {
  44963. var e;
  44964. return function (t) {
  44965. return (
  44966. void 0 === e && (e = new n.Vector3()),
  44967. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  44968. );
  44969. };
  44970. })(),
  44971. angleTo: function (e) {
  44972. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  44973. return Math.acos(n.Math.clamp(t, -1, 1));
  44974. },
  44975. distanceTo: function (e) {
  44976. return Math.sqrt(this.distanceToSquared(e));
  44977. },
  44978. distanceToSquared: function (e) {
  44979. var t = this.x - e.x,
  44980. i = this.y - e.y,
  44981. n = this.z - e.z;
  44982. return t * t + i * i + n * n;
  44983. },
  44984. setFromSpherical: function (e) {
  44985. var t = Math.sin(e.phi) * e.radius;
  44986. return (
  44987. (this.x = t * Math.sin(e.theta)),
  44988. (this.y = Math.cos(e.phi) * e.radius),
  44989. (this.z = t * Math.cos(e.theta)),
  44990. this
  44991. );
  44992. },
  44993. setFromMatrixPosition: function (e) {
  44994. return this.setFromMatrixColumn(e, 3);
  44995. },
  44996. setFromMatrixScale: function (e) {
  44997. var t = this.setFromMatrixColumn(e, 0).length(),
  44998. i = this.setFromMatrixColumn(e, 1).length(),
  44999. n = this.setFromMatrixColumn(e, 2).length();
  45000. return (this.x = t), (this.y = i), (this.z = n), this;
  45001. },
  45002. setFromMatrixColumn: function (e, t) {
  45003. return (
  45004. 'number' == typeof e &&
  45005. (console.warn(
  45006. 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'
  45007. ),
  45008. (e = arguments[1]),
  45009. (t = arguments[0])),
  45010. this.fromArray(e.elements, 4 * t)
  45011. );
  45012. },
  45013. equals: function (e) {
  45014. return e.x === this.x && e.y === this.y && e.z === this.z;
  45015. },
  45016. fromArray: function (e, t) {
  45017. return (
  45018. void 0 === t && (t = 0),
  45019. (this.x = e[t]),
  45020. (this.y = e[t + 1]),
  45021. (this.z = e[t + 2]),
  45022. this
  45023. );
  45024. },
  45025. toArray: function (e, t) {
  45026. return (
  45027. void 0 === e && (e = []),
  45028. void 0 === t && (t = 0),
  45029. (e[t] = this.x),
  45030. (e[t + 1] = this.y),
  45031. (e[t + 2] = this.z),
  45032. e
  45033. );
  45034. },
  45035. fromAttribute: function (e, t, i) {
  45036. return (
  45037. void 0 === i && (i = 0),
  45038. (t = t * e.itemSize + i),
  45039. (this.x = e.array[t]),
  45040. (this.y = e.array[t + 1]),
  45041. (this.z = e.array[t + 2]),
  45042. this
  45043. );
  45044. },
  45045. }),
  45046. (n.Vector4 = function (e, t, i, n) {
  45047. (this.x = e || 0),
  45048. (this.y = t || 0),
  45049. (this.z = i || 0),
  45050. (this.w = void 0 !== n ? n : 1);
  45051. }),
  45052. (n.Vector4.prototype = {
  45053. constructor: n.Vector4,
  45054. set: function (e, t, i, n) {
  45055. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this;
  45056. },
  45057. setScalar: function (e) {
  45058. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this;
  45059. },
  45060. setX: function (e) {
  45061. return (this.x = e), this;
  45062. },
  45063. setY: function (e) {
  45064. return (this.y = e), this;
  45065. },
  45066. setZ: function (e) {
  45067. return (this.z = e), this;
  45068. },
  45069. setW: function (e) {
  45070. return (this.w = e), this;
  45071. },
  45072. setComponent: function (e, t) {
  45073. switch (e) {
  45074. case 0:
  45075. this.x = t;
  45076. break;
  45077. case 1:
  45078. this.y = t;
  45079. break;
  45080. case 2:
  45081. this.z = t;
  45082. break;
  45083. case 3:
  45084. this.w = t;
  45085. break;
  45086. default:
  45087. throw new Error('index is out of range: ' + e);
  45088. }
  45089. },
  45090. getComponent: function (e) {
  45091. switch (e) {
  45092. case 0:
  45093. return this.x;
  45094. case 1:
  45095. return this.y;
  45096. case 2:
  45097. return this.z;
  45098. case 3:
  45099. return this.w;
  45100. default:
  45101. throw new Error('index is out of range: ' + e);
  45102. }
  45103. },
  45104. clone: function () {
  45105. return new this.constructor(this.x, this.y, this.z, this.w);
  45106. },
  45107. copy: function (e) {
  45108. return (
  45109. (this.x = e.x),
  45110. (this.y = e.y),
  45111. (this.z = e.z),
  45112. (this.w = void 0 !== e.w ? e.w : 1),
  45113. this
  45114. );
  45115. },
  45116. add: function (e, t) {
  45117. return void 0 !== t
  45118. ? (console.warn(
  45119. 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  45120. ),
  45121. this.addVectors(e, t))
  45122. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this);
  45123. },
  45124. addScalar: function (e) {
  45125. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this;
  45126. },
  45127. addVectors: function (e, t) {
  45128. return (
  45129. (this.x = e.x + t.x),
  45130. (this.y = e.y + t.y),
  45131. (this.z = e.z + t.z),
  45132. (this.w = e.w + t.w),
  45133. this
  45134. );
  45135. },
  45136. addScaledVector: function (e, t) {
  45137. return (
  45138. (this.x += e.x * t),
  45139. (this.y += e.y * t),
  45140. (this.z += e.z * t),
  45141. (this.w += e.w * t),
  45142. this
  45143. );
  45144. },
  45145. sub: function (e, t) {
  45146. return void 0 !== t
  45147. ? (console.warn(
  45148. 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  45149. ),
  45150. this.subVectors(e, t))
  45151. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this);
  45152. },
  45153. subScalar: function (e) {
  45154. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this;
  45155. },
  45156. subVectors: function (e, t) {
  45157. return (
  45158. (this.x = e.x - t.x),
  45159. (this.y = e.y - t.y),
  45160. (this.z = e.z - t.z),
  45161. (this.w = e.w - t.w),
  45162. this
  45163. );
  45164. },
  45165. multiplyScalar: function (e) {
  45166. return (
  45167. isFinite(e)
  45168. ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e))
  45169. : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
  45170. this
  45171. );
  45172. },
  45173. applyMatrix4: function (e) {
  45174. var t = this.x,
  45175. i = this.y,
  45176. n = this.z,
  45177. r = this.w,
  45178. o = e.elements;
  45179. return (
  45180. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  45181. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  45182. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  45183. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  45184. this
  45185. );
  45186. },
  45187. divideScalar: function (e) {
  45188. return this.multiplyScalar(1 / e);
  45189. },
  45190. setAxisAngleFromQuaternion: function (e) {
  45191. this.w = 2 * Math.acos(e.w);
  45192. var t = Math.sqrt(1 - e.w * e.w);
  45193. return (
  45194. t < 1e-4
  45195. ? ((this.x = 1), (this.y = 0), (this.z = 0))
  45196. : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)),
  45197. this
  45198. );
  45199. },
  45200. setAxisAngleFromRotationMatrix: function (e) {
  45201. var t,
  45202. i,
  45203. n,
  45204. r,
  45205. o = 0.01,
  45206. a = 0.1,
  45207. s = e.elements,
  45208. l = s[0],
  45209. c = s[4],
  45210. h = s[8],
  45211. u = s[1],
  45212. d = s[5],
  45213. p = s[9],
  45214. f = s[2],
  45215. g = s[6],
  45216. m = s[10];
  45217. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  45218. if (
  45219. Math.abs(c + u) < a &&
  45220. Math.abs(h + f) < a &&
  45221. Math.abs(p + g) < a &&
  45222. Math.abs(l + d + m - 3) < a
  45223. )
  45224. return this.set(1, 0, 0, 0), this;
  45225. t = Math.PI;
  45226. var v = (l + 1) / 2,
  45227. A = (d + 1) / 2,
  45228. y = (m + 1) / 2,
  45229. C = (c + u) / 4,
  45230. I = (h + f) / 4,
  45231. E = (p + g) / 4;
  45232. return (
  45233. v > A && v > y
  45234. ? v < o
  45235. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  45236. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  45237. : A > y
  45238. ? A < o
  45239. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  45240. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  45241. : y < o
  45242. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  45243. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  45244. this.set(i, n, r, t),
  45245. this
  45246. );
  45247. }
  45248. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  45249. return (
  45250. Math.abs(b) < 0.001 && (b = 1),
  45251. (this.x = (g - p) / b),
  45252. (this.y = (h - f) / b),
  45253. (this.z = (u - c) / b),
  45254. (this.w = Math.acos((l + d + m - 1) / 2)),
  45255. this
  45256. );
  45257. },
  45258. min: function (e) {
  45259. return (
  45260. (this.x = Math.min(this.x, e.x)),
  45261. (this.y = Math.min(this.y, e.y)),
  45262. (this.z = Math.min(this.z, e.z)),
  45263. (this.w = Math.min(this.w, e.w)),
  45264. this
  45265. );
  45266. },
  45267. max: function (e) {
  45268. return (
  45269. (this.x = Math.max(this.x, e.x)),
  45270. (this.y = Math.max(this.y, e.y)),
  45271. (this.z = Math.max(this.z, e.z)),
  45272. (this.w = Math.max(this.w, e.w)),
  45273. this
  45274. );
  45275. },
  45276. clamp: function (e, t) {
  45277. return (
  45278. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  45279. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  45280. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  45281. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  45282. this
  45283. );
  45284. },
  45285. clampScalar: (function () {
  45286. var e, t;
  45287. return function (i, r) {
  45288. return (
  45289. void 0 === e && ((e = new n.Vector4()), (t = new n.Vector4())),
  45290. e.set(i, i, i, i),
  45291. t.set(r, r, r, r),
  45292. this.clamp(e, t)
  45293. );
  45294. };
  45295. })(),
  45296. floor: function () {
  45297. return (
  45298. (this.x = Math.floor(this.x)),
  45299. (this.y = Math.floor(this.y)),
  45300. (this.z = Math.floor(this.z)),
  45301. (this.w = Math.floor(this.w)),
  45302. this
  45303. );
  45304. },
  45305. ceil: function () {
  45306. return (
  45307. (this.x = Math.ceil(this.x)),
  45308. (this.y = Math.ceil(this.y)),
  45309. (this.z = Math.ceil(this.z)),
  45310. (this.w = Math.ceil(this.w)),
  45311. this
  45312. );
  45313. },
  45314. round: function () {
  45315. return (
  45316. (this.x = Math.round(this.x)),
  45317. (this.y = Math.round(this.y)),
  45318. (this.z = Math.round(this.z)),
  45319. (this.w = Math.round(this.w)),
  45320. this
  45321. );
  45322. },
  45323. roundToZero: function () {
  45324. return (
  45325. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  45326. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  45327. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  45328. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  45329. this
  45330. );
  45331. },
  45332. negate: function () {
  45333. return (
  45334. (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  45335. );
  45336. },
  45337. dot: function (e) {
  45338. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
  45339. },
  45340. lengthSq: function () {
  45341. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
  45342. },
  45343. length: function () {
  45344. return Math.sqrt(
  45345. this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  45346. );
  45347. },
  45348. lengthManhattan: function () {
  45349. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
  45350. },
  45351. normalize: function () {
  45352. return this.divideScalar(this.length());
  45353. },
  45354. setLength: function (e) {
  45355. return this.multiplyScalar(e / this.length());
  45356. },
  45357. lerp: function (e, t) {
  45358. return (
  45359. (this.x += (e.x - this.x) * t),
  45360. (this.y += (e.y - this.y) * t),
  45361. (this.z += (e.z - this.z) * t),
  45362. (this.w += (e.w - this.w) * t),
  45363. this
  45364. );
  45365. },
  45366. lerpVectors: function (e, t, i) {
  45367. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  45368. },
  45369. equals: function (e) {
  45370. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;
  45371. },
  45372. fromArray: function (e, t) {
  45373. return (
  45374. void 0 === t && (t = 0),
  45375. (this.x = e[t]),
  45376. (this.y = e[t + 1]),
  45377. (this.z = e[t + 2]),
  45378. (this.w = e[t + 3]),
  45379. this
  45380. );
  45381. },
  45382. toArray: function (e, t) {
  45383. return (
  45384. void 0 === e && (e = []),
  45385. void 0 === t && (t = 0),
  45386. (e[t] = this.x),
  45387. (e[t + 1] = this.y),
  45388. (e[t + 2] = this.z),
  45389. (e[t + 3] = this.w),
  45390. e
  45391. );
  45392. },
  45393. fromAttribute: function (e, t, i) {
  45394. return (
  45395. void 0 === i && (i = 0),
  45396. (t = t * e.itemSize + i),
  45397. (this.x = e.array[t]),
  45398. (this.y = e.array[t + 1]),
  45399. (this.z = e.array[t + 2]),
  45400. (this.w = e.array[t + 3]),
  45401. this
  45402. );
  45403. },
  45404. }),
  45405. (n.Euler = function (e, t, i, r) {
  45406. (this._x = e || 0),
  45407. (this._y = t || 0),
  45408. (this._z = i || 0),
  45409. (this._order = r || n.Euler.DefaultOrder);
  45410. }),
  45411. (n.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  45412. (n.Euler.DefaultOrder = 'XYZ'),
  45413. (n.Euler.prototype = {
  45414. constructor: n.Euler,
  45415. get x() {
  45416. return this._x;
  45417. },
  45418. set x(e) {
  45419. (this._x = e), this.onChangeCallback();
  45420. },
  45421. get y() {
  45422. return this._y;
  45423. },
  45424. set y(e) {
  45425. (this._y = e), this.onChangeCallback();
  45426. },
  45427. get z() {
  45428. return this._z;
  45429. },
  45430. set z(e) {
  45431. (this._z = e), this.onChangeCallback();
  45432. },
  45433. get order() {
  45434. return this._order;
  45435. },
  45436. set order(e) {
  45437. (this._order = e), this.onChangeCallback();
  45438. },
  45439. set: function (e, t, i, n) {
  45440. return (
  45441. (this._x = e),
  45442. (this._y = t),
  45443. (this._z = i),
  45444. (this._order = n || this._order),
  45445. this.onChangeCallback(),
  45446. this
  45447. );
  45448. },
  45449. clone: function () {
  45450. return new this.constructor(this._x, this._y, this._z, this._order);
  45451. },
  45452. copy: function (e) {
  45453. return (
  45454. (this._x = e._x),
  45455. (this._y = e._y),
  45456. (this._z = e._z),
  45457. (this._order = e._order),
  45458. this.onChangeCallback(),
  45459. this
  45460. );
  45461. },
  45462. setFromRotationMatrix: function (e, t, i) {
  45463. var r = n.Math.clamp,
  45464. o = e.elements,
  45465. a = o[0],
  45466. s = o[4],
  45467. l = o[8],
  45468. c = o[1],
  45469. h = o[5],
  45470. u = o[9],
  45471. d = o[2],
  45472. p = o[6],
  45473. f = o[10];
  45474. return (
  45475. (t = t || this._order),
  45476. 'XYZ' === t
  45477. ? ((this._y = Math.asin(r(l, -1, 1))),
  45478. Math.abs(l) < 0.99999
  45479. ? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-s, a)))
  45480. : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  45481. : 'YXZ' === t
  45482. ? ((this._x = Math.asin(-r(u, -1, 1))),
  45483. Math.abs(u) < 0.99999
  45484. ? ((this._y = Math.atan2(l, f)), (this._z = Math.atan2(c, h)))
  45485. : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  45486. : 'ZXY' === t
  45487. ? ((this._x = Math.asin(r(p, -1, 1))),
  45488. Math.abs(p) < 0.99999
  45489. ? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-s, h)))
  45490. : ((this._y = 0), (this._z = Math.atan2(c, a))))
  45491. : 'ZYX' === t
  45492. ? ((this._y = Math.asin(-r(d, -1, 1))),
  45493. Math.abs(d) < 0.99999
  45494. ? ((this._x = Math.atan2(p, f)), (this._z = Math.atan2(c, a)))
  45495. : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  45496. : 'YZX' === t
  45497. ? ((this._z = Math.asin(r(c, -1, 1))),
  45498. Math.abs(c) < 0.99999
  45499. ? ((this._x = Math.atan2(-u, h)), (this._y = Math.atan2(-d, a)))
  45500. : ((this._x = 0), (this._y = Math.atan2(l, f))))
  45501. : 'XZY' === t
  45502. ? ((this._z = Math.asin(-r(s, -1, 1))),
  45503. Math.abs(s) < 0.99999
  45504. ? ((this._x = Math.atan2(p, h)), (this._y = Math.atan2(l, a)))
  45505. : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  45506. : console.warn(
  45507. 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t
  45508. ),
  45509. (this._order = t),
  45510. i !== !1 && this.onChangeCallback(),
  45511. this
  45512. );
  45513. },
  45514. setFromQuaternion: (function () {
  45515. var e;
  45516. return function (t, i, r) {
  45517. return (
  45518. void 0 === e && (e = new n.Matrix4()),
  45519. e.makeRotationFromQuaternion(t),
  45520. this.setFromRotationMatrix(e, i, r),
  45521. this
  45522. );
  45523. };
  45524. })(),
  45525. setFromVector3: function (e, t) {
  45526. return this.set(e.x, e.y, e.z, t || this._order);
  45527. },
  45528. reorder: (function () {
  45529. var e = new n.Quaternion();
  45530. return function (t) {
  45531. e.setFromEuler(this), this.setFromQuaternion(e, t);
  45532. };
  45533. })(),
  45534. equals: function (e) {
  45535. return (
  45536. e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  45537. );
  45538. },
  45539. fromArray: function (e) {
  45540. return (
  45541. (this._x = e[0]),
  45542. (this._y = e[1]),
  45543. (this._z = e[2]),
  45544. void 0 !== e[3] && (this._order = e[3]),
  45545. this.onChangeCallback(),
  45546. this
  45547. );
  45548. },
  45549. toArray: function (e, t) {
  45550. return (
  45551. void 0 === e && (e = []),
  45552. void 0 === t && (t = 0),
  45553. (e[t] = this._x),
  45554. (e[t + 1] = this._y),
  45555. (e[t + 2] = this._z),
  45556. (e[t + 3] = this._order),
  45557. e
  45558. );
  45559. },
  45560. toVector3: function (e) {
  45561. return e
  45562. ? e.set(this._x, this._y, this._z)
  45563. : new n.Vector3(this._x, this._y, this._z);
  45564. },
  45565. onChange: function (e) {
  45566. return (this.onChangeCallback = e), this;
  45567. },
  45568. onChangeCallback: function () {},
  45569. }),
  45570. (n.Line3 = function (e, t) {
  45571. (this.start = void 0 !== e ? e : new n.Vector3()),
  45572. (this.end = void 0 !== t ? t : new n.Vector3());
  45573. }),
  45574. (n.Line3.prototype = {
  45575. constructor: n.Line3,
  45576. set: function (e, t) {
  45577. return this.start.copy(e), this.end.copy(t), this;
  45578. },
  45579. clone: function () {
  45580. return new this.constructor().copy(this);
  45581. },
  45582. copy: function (e) {
  45583. return this.start.copy(e.start), this.end.copy(e.end), this;
  45584. },
  45585. center: function (e) {
  45586. var t = e || new n.Vector3();
  45587. return t.addVectors(this.start, this.end).multiplyScalar(0.5);
  45588. },
  45589. delta: function (e) {
  45590. var t = e || new n.Vector3();
  45591. return t.subVectors(this.end, this.start);
  45592. },
  45593. distanceSq: function () {
  45594. return this.start.distanceToSquared(this.end);
  45595. },
  45596. distance: function () {
  45597. return this.start.distanceTo(this.end);
  45598. },
  45599. at: function (e, t) {
  45600. var i = t || new n.Vector3();
  45601. return this.delta(i).multiplyScalar(e).add(this.start);
  45602. },
  45603. closestPointToPointParameter: (function () {
  45604. var e = new n.Vector3(),
  45605. t = new n.Vector3();
  45606. return function (i, r) {
  45607. e.subVectors(i, this.start), t.subVectors(this.end, this.start);
  45608. var o = t.dot(t),
  45609. a = t.dot(e),
  45610. s = a / o;
  45611. return r && (s = n.Math.clamp(s, 0, 1)), s;
  45612. };
  45613. })(),
  45614. closestPointToPoint: function (e, t, i) {
  45615. var r = this.closestPointToPointParameter(e, t),
  45616. o = i || new n.Vector3();
  45617. return this.delta(o).multiplyScalar(r).add(this.start);
  45618. },
  45619. applyMatrix4: function (e) {
  45620. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this;
  45621. },
  45622. equals: function (e) {
  45623. return e.start.equals(this.start) && e.end.equals(this.end);
  45624. },
  45625. }),
  45626. (n.Box2 = function (e, t) {
  45627. (this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))),
  45628. (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)));
  45629. }),
  45630. (n.Box2.prototype = {
  45631. constructor: n.Box2,
  45632. set: function (e, t) {
  45633. return this.min.copy(e), this.max.copy(t), this;
  45634. },
  45635. setFromPoints: function (e) {
  45636. this.makeEmpty();
  45637. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]);
  45638. return this;
  45639. },
  45640. setFromCenterAndSize: (function () {
  45641. var e = new n.Vector2();
  45642. return function (t, i) {
  45643. var n = e.copy(i).multiplyScalar(0.5);
  45644. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  45645. };
  45646. })(),
  45647. clone: function () {
  45648. return new this.constructor().copy(this);
  45649. },
  45650. copy: function (e) {
  45651. return this.min.copy(e.min), this.max.copy(e.max), this;
  45652. },
  45653. makeEmpty: function () {
  45654. return (
  45655. (this.min.x = this.min.y = +(1 / 0)), (this.max.x = this.max.y = -(1 / 0)), this
  45656. );
  45657. },
  45658. isEmpty: function () {
  45659. return this.max.x < this.min.x || this.max.y < this.min.y;
  45660. },
  45661. center: function (e) {
  45662. var t = e || new n.Vector2();
  45663. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  45664. },
  45665. size: function (e) {
  45666. var t = e || new n.Vector2();
  45667. return t.subVectors(this.max, this.min);
  45668. },
  45669. expandByPoint: function (e) {
  45670. return this.min.min(e), this.max.max(e), this;
  45671. },
  45672. expandByVector: function (e) {
  45673. return this.min.sub(e), this.max.add(e), this;
  45674. },
  45675. expandByScalar: function (e) {
  45676. return this.min.addScalar(-e), this.max.addScalar(e), this;
  45677. },
  45678. containsPoint: function (e) {
  45679. return !(
  45680. e.x < this.min.x ||
  45681. e.x > this.max.x ||
  45682. e.y < this.min.y ||
  45683. e.y > this.max.y
  45684. );
  45685. },
  45686. containsBox: function (e) {
  45687. return (
  45688. this.min.x <= e.min.x &&
  45689. e.max.x <= this.max.x &&
  45690. this.min.y <= e.min.y &&
  45691. e.max.y <= this.max.y
  45692. );
  45693. },
  45694. getParameter: function (e, t) {
  45695. var i = t || new n.Vector2();
  45696. return i.set(
  45697. (e.x - this.min.x) / (this.max.x - this.min.x),
  45698. (e.y - this.min.y) / (this.max.y - this.min.y)
  45699. );
  45700. },
  45701. intersectsBox: function (e) {
  45702. return !(
  45703. e.max.x < this.min.x ||
  45704. e.min.x > this.max.x ||
  45705. e.max.y < this.min.y ||
  45706. e.min.y > this.max.y
  45707. );
  45708. },
  45709. clampPoint: function (e, t) {
  45710. var i = t || new n.Vector2();
  45711. return i.copy(e).clamp(this.min, this.max);
  45712. },
  45713. distanceToPoint: (function () {
  45714. var e = new n.Vector2();
  45715. return function (t) {
  45716. var i = e.copy(t).clamp(this.min, this.max);
  45717. return i.sub(t).length();
  45718. };
  45719. })(),
  45720. intersect: function (e) {
  45721. return this.min.max(e.min), this.max.min(e.max), this;
  45722. },
  45723. union: function (e) {
  45724. return this.min.min(e.min), this.max.max(e.max), this;
  45725. },
  45726. translate: function (e) {
  45727. return this.min.add(e), this.max.add(e), this;
  45728. },
  45729. equals: function (e) {
  45730. return e.min.equals(this.min) && e.max.equals(this.max);
  45731. },
  45732. }),
  45733. (n.Box3 = function (e, t) {
  45734. (this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))),
  45735. (this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)));
  45736. }),
  45737. (n.Box3.prototype = {
  45738. constructor: n.Box3,
  45739. set: function (e, t) {
  45740. return this.min.copy(e), this.max.copy(t), this;
  45741. },
  45742. setFromArray: function (e) {
  45743. this.makeEmpty();
  45744. for (
  45745. var t = +(1 / 0),
  45746. i = +(1 / 0),
  45747. n = +(1 / 0),
  45748. r = -(1 / 0),
  45749. o = -(1 / 0),
  45750. a = -(1 / 0),
  45751. s = 0,
  45752. l = e.length;
  45753. s < l;
  45754. s += 3
  45755. ) {
  45756. var c = e[s],
  45757. h = e[s + 1],
  45758. u = e[s + 2];
  45759. c < t && (t = c),
  45760. h < i && (i = h),
  45761. u < n && (n = u),
  45762. c > r && (r = c),
  45763. h > o && (o = h),
  45764. u > a && (a = u);
  45765. }
  45766. this.min.set(t, i, n), this.max.set(r, o, a);
  45767. },
  45768. setFromPoints: function (e) {
  45769. this.makeEmpty();
  45770. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]);
  45771. return this;
  45772. },
  45773. setFromCenterAndSize: (function () {
  45774. var e = new n.Vector3();
  45775. return function (t, i) {
  45776. var n = e.copy(i).multiplyScalar(0.5);
  45777. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  45778. };
  45779. })(),
  45780. setFromObject: (function () {
  45781. var e;
  45782. return function (t) {
  45783. void 0 === e && (e = new n.Box3());
  45784. var i = this;
  45785. return (
  45786. this.makeEmpty(),
  45787. t.updateMatrixWorld(!0),
  45788. t.traverse(function (t) {
  45789. var n = t.geometry;
  45790. void 0 !== n &&
  45791. (null === n.boundingBox && n.computeBoundingBox(),
  45792. n.boundingBox.isEmpty() === !1 &&
  45793. (e.copy(n.boundingBox), e.applyMatrix4(t.matrixWorld), i.union(e)));
  45794. }),
  45795. this
  45796. );
  45797. };
  45798. })(),
  45799. clone: function () {
  45800. return new this.constructor().copy(this);
  45801. },
  45802. copy: function (e) {
  45803. return this.min.copy(e.min), this.max.copy(e.max), this;
  45804. },
  45805. makeEmpty: function () {
  45806. return (
  45807. (this.min.x = this.min.y = this.min.z = +(1 / 0)),
  45808. (this.max.x = this.max.y = this.max.z = -(1 / 0)),
  45809. this
  45810. );
  45811. },
  45812. isEmpty: function () {
  45813. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
  45814. },
  45815. center: function (e) {
  45816. var t = e || new n.Vector3();
  45817. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  45818. },
  45819. size: function (e) {
  45820. var t = e || new n.Vector3();
  45821. return t.subVectors(this.max, this.min);
  45822. },
  45823. expandByPoint: function (e) {
  45824. return this.min.min(e), this.max.max(e), this;
  45825. },
  45826. expandByVector: function (e) {
  45827. return this.min.sub(e), this.max.add(e), this;
  45828. },
  45829. expandByScalar: function (e) {
  45830. return this.min.addScalar(-e), this.max.addScalar(e), this;
  45831. },
  45832. containsPoint: function (e) {
  45833. return !(
  45834. e.x < this.min.x ||
  45835. e.x > this.max.x ||
  45836. e.y < this.min.y ||
  45837. e.y > this.max.y ||
  45838. e.z < this.min.z ||
  45839. e.z > this.max.z
  45840. );
  45841. },
  45842. containsBox: function (e) {
  45843. return (
  45844. this.min.x <= e.min.x &&
  45845. e.max.x <= this.max.x &&
  45846. this.min.y <= e.min.y &&
  45847. e.max.y <= this.max.y &&
  45848. this.min.z <= e.min.z &&
  45849. e.max.z <= this.max.z
  45850. );
  45851. },
  45852. getParameter: function (e, t) {
  45853. var i = t || new n.Vector3();
  45854. return i.set(
  45855. (e.x - this.min.x) / (this.max.x - this.min.x),
  45856. (e.y - this.min.y) / (this.max.y - this.min.y),
  45857. (e.z - this.min.z) / (this.max.z - this.min.z)
  45858. );
  45859. },
  45860. intersectsBox: function (e) {
  45861. return !(
  45862. e.max.x < this.min.x ||
  45863. e.min.x > this.max.x ||
  45864. e.max.y < this.min.y ||
  45865. e.min.y > this.max.y ||
  45866. e.max.z < this.min.z ||
  45867. e.min.z > this.max.z
  45868. );
  45869. },
  45870. intersectsSphere: (function () {
  45871. var e;
  45872. return function (t) {
  45873. return (
  45874. void 0 === e && (e = new n.Vector3()),
  45875. this.clampPoint(t.center, e),
  45876. e.distanceToSquared(t.center) <= t.radius * t.radius
  45877. );
  45878. };
  45879. })(),
  45880. intersectsPlane: function (e) {
  45881. var t, i;
  45882. return (
  45883. e.normal.x > 0
  45884. ? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x))
  45885. : ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
  45886. e.normal.y > 0
  45887. ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y))
  45888. : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  45889. e.normal.z > 0
  45890. ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z))
  45891. : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  45892. t <= e.constant && i >= e.constant
  45893. );
  45894. },
  45895. clampPoint: function (e, t) {
  45896. var i = t || new n.Vector3();
  45897. return i.copy(e).clamp(this.min, this.max);
  45898. },
  45899. distanceToPoint: (function () {
  45900. var e = new n.Vector3();
  45901. return function (t) {
  45902. var i = e.copy(t).clamp(this.min, this.max);
  45903. return i.sub(t).length();
  45904. };
  45905. })(),
  45906. getBoundingSphere: (function () {
  45907. var e = new n.Vector3();
  45908. return function (t) {
  45909. var i = t || new n.Sphere();
  45910. return (i.center = this.center()), (i.radius = 0.5 * this.size(e).length()), i;
  45911. };
  45912. })(),
  45913. intersect: function (e) {
  45914. return this.min.max(e.min), this.max.min(e.max), this;
  45915. },
  45916. union: function (e) {
  45917. return this.min.min(e.min), this.max.max(e.max), this;
  45918. },
  45919. applyMatrix4: (function () {
  45920. var e = [
  45921. new n.Vector3(),
  45922. new n.Vector3(),
  45923. new n.Vector3(),
  45924. new n.Vector3(),
  45925. new n.Vector3(),
  45926. new n.Vector3(),
  45927. new n.Vector3(),
  45928. new n.Vector3(),
  45929. ];
  45930. return function (t) {
  45931. return (
  45932. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  45933. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  45934. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  45935. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  45936. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  45937. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  45938. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  45939. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  45940. this.makeEmpty(),
  45941. this.setFromPoints(e),
  45942. this
  45943. );
  45944. };
  45945. })(),
  45946. translate: function (e) {
  45947. return this.min.add(e), this.max.add(e), this;
  45948. },
  45949. equals: function (e) {
  45950. return e.min.equals(this.min) && e.max.equals(this.max);
  45951. },
  45952. }),
  45953. (n.Matrix3 = function () {
  45954. (this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
  45955. arguments.length > 0 &&
  45956. console.error(
  45957. 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.'
  45958. );
  45959. }),
  45960. (n.Matrix3.prototype = {
  45961. constructor: n.Matrix3,
  45962. set: function (e, t, i, n, r, o, a, s, l) {
  45963. var c = this.elements;
  45964. return (
  45965. (c[0] = e),
  45966. (c[1] = n),
  45967. (c[2] = a),
  45968. (c[3] = t),
  45969. (c[4] = r),
  45970. (c[5] = s),
  45971. (c[6] = i),
  45972. (c[7] = o),
  45973. (c[8] = l),
  45974. this
  45975. );
  45976. },
  45977. identity: function () {
  45978. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
  45979. },
  45980. clone: function () {
  45981. return new this.constructor().fromArray(this.elements);
  45982. },
  45983. copy: function (e) {
  45984. var t = e.elements;
  45985. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this;
  45986. },
  45987. setFromMatrix4: function (e) {
  45988. var t = e.elements;
  45989. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this;
  45990. },
  45991. applyToVector3Array: (function () {
  45992. var e;
  45993. return function (t, i, r) {
  45994. void 0 === e && (e = new n.Vector3()),
  45995. void 0 === i && (i = 0),
  45996. void 0 === r && (r = t.length);
  45997. for (var o = 0, a = i; o < r; o += 3, a += 3)
  45998. e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a);
  45999. return t;
  46000. };
  46001. })(),
  46002. applyToBuffer: (function () {
  46003. var e;
  46004. return function (t, i, r) {
  46005. void 0 === e && (e = new n.Vector3()),
  46006. void 0 === i && (i = 0),
  46007. void 0 === r && (r = t.length / t.itemSize);
  46008. for (var o = 0, a = i; o < r; o++, a++)
  46009. (e.x = t.getX(a)),
  46010. (e.y = t.getY(a)),
  46011. (e.z = t.getZ(a)),
  46012. e.applyMatrix3(this),
  46013. t.setXYZ(e.x, e.y, e.z);
  46014. return t;
  46015. };
  46016. })(),
  46017. multiplyScalar: function (e) {
  46018. var t = this.elements;
  46019. return (
  46020. (t[0] *= e),
  46021. (t[3] *= e),
  46022. (t[6] *= e),
  46023. (t[1] *= e),
  46024. (t[4] *= e),
  46025. (t[7] *= e),
  46026. (t[2] *= e),
  46027. (t[5] *= e),
  46028. (t[8] *= e),
  46029. this
  46030. );
  46031. },
  46032. determinant: function () {
  46033. var e = this.elements,
  46034. t = e[0],
  46035. i = e[1],
  46036. n = e[2],
  46037. r = e[3],
  46038. o = e[4],
  46039. a = e[5],
  46040. s = e[6],
  46041. l = e[7],
  46042. c = e[8];
  46043. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s;
  46044. },
  46045. getInverse: function (e, t) {
  46046. e instanceof n.Matrix4 &&
  46047. console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.');
  46048. var i = e.elements,
  46049. r = this.elements,
  46050. o = i[0],
  46051. a = i[1],
  46052. s = i[2],
  46053. l = i[3],
  46054. c = i[4],
  46055. h = i[5],
  46056. u = i[6],
  46057. d = i[7],
  46058. p = i[8],
  46059. f = p * c - h * d,
  46060. g = h * u - p * l,
  46061. m = d * l - c * u,
  46062. v = o * f + a * g + s * m;
  46063. if (0 === v) {
  46064. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  46065. if (t) throw new Error(A);
  46066. return console.warn(A), this.identity();
  46067. }
  46068. return (
  46069. (r[0] = f),
  46070. (r[1] = s * d - p * a),
  46071. (r[2] = h * a - s * c),
  46072. (r[3] = g),
  46073. (r[4] = p * o - s * u),
  46074. (r[5] = s * l - h * o),
  46075. (r[6] = m),
  46076. (r[7] = a * u - d * o),
  46077. (r[8] = c * o - a * l),
  46078. this.multiplyScalar(1 / v)
  46079. );
  46080. },
  46081. transpose: function () {
  46082. var e,
  46083. t = this.elements;
  46084. return (
  46085. (e = t[1]),
  46086. (t[1] = t[3]),
  46087. (t[3] = e),
  46088. (e = t[2]),
  46089. (t[2] = t[6]),
  46090. (t[6] = e),
  46091. (e = t[5]),
  46092. (t[5] = t[7]),
  46093. (t[7] = e),
  46094. this
  46095. );
  46096. },
  46097. flattenToArrayOffset: function (e, t) {
  46098. var i = this.elements;
  46099. return (
  46100. (e[t] = i[0]),
  46101. (e[t + 1] = i[1]),
  46102. (e[t + 2] = i[2]),
  46103. (e[t + 3] = i[3]),
  46104. (e[t + 4] = i[4]),
  46105. (e[t + 5] = i[5]),
  46106. (e[t + 6] = i[6]),
  46107. (e[t + 7] = i[7]),
  46108. (e[t + 8] = i[8]),
  46109. e
  46110. );
  46111. },
  46112. getNormalMatrix: function (e) {
  46113. return this.setFromMatrix4(e).getInverse(this).transpose();
  46114. },
  46115. transposeIntoArray: function (e) {
  46116. var t = this.elements;
  46117. return (
  46118. (e[0] = t[0]),
  46119. (e[1] = t[3]),
  46120. (e[2] = t[6]),
  46121. (e[3] = t[1]),
  46122. (e[4] = t[4]),
  46123. (e[5] = t[7]),
  46124. (e[6] = t[2]),
  46125. (e[7] = t[5]),
  46126. (e[8] = t[8]),
  46127. this
  46128. );
  46129. },
  46130. fromArray: function (e) {
  46131. return this.elements.set(e), this;
  46132. },
  46133. toArray: function () {
  46134. var e = this.elements;
  46135. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]];
  46136. },
  46137. }),
  46138. (n.Matrix4 = function () {
  46139. (this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  46140. arguments.length > 0 &&
  46141. console.error(
  46142. 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  46143. );
  46144. }),
  46145. (n.Matrix4.prototype = {
  46146. constructor: n.Matrix4,
  46147. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  46148. var m = this.elements;
  46149. return (
  46150. (m[0] = e),
  46151. (m[4] = t),
  46152. (m[8] = i),
  46153. (m[12] = n),
  46154. (m[1] = r),
  46155. (m[5] = o),
  46156. (m[9] = a),
  46157. (m[13] = s),
  46158. (m[2] = l),
  46159. (m[6] = c),
  46160. (m[10] = h),
  46161. (m[14] = u),
  46162. (m[3] = d),
  46163. (m[7] = p),
  46164. (m[11] = f),
  46165. (m[15] = g),
  46166. this
  46167. );
  46168. },
  46169. identity: function () {
  46170. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
  46171. },
  46172. clone: function () {
  46173. return new n.Matrix4().fromArray(this.elements);
  46174. },
  46175. copy: function (e) {
  46176. return this.elements.set(e.elements), this;
  46177. },
  46178. copyPosition: function (e) {
  46179. var t = this.elements,
  46180. i = e.elements;
  46181. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this;
  46182. },
  46183. extractBasis: function (e, t, i) {
  46184. return (
  46185. e.setFromMatrixColumn(this, 0),
  46186. t.setFromMatrixColumn(this, 1),
  46187. i.setFromMatrixColumn(this, 2),
  46188. this
  46189. );
  46190. },
  46191. makeBasis: function (e, t, i) {
  46192. return (
  46193. this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1), this
  46194. );
  46195. },
  46196. extractRotation: (function () {
  46197. var e;
  46198. return function (t) {
  46199. void 0 === e && (e = new n.Vector3());
  46200. var i = this.elements,
  46201. r = t.elements,
  46202. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  46203. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  46204. s = 1 / e.setFromMatrixColumn(t, 2).length();
  46205. return (
  46206. (i[0] = r[0] * o),
  46207. (i[1] = r[1] * o),
  46208. (i[2] = r[2] * o),
  46209. (i[4] = r[4] * a),
  46210. (i[5] = r[5] * a),
  46211. (i[6] = r[6] * a),
  46212. (i[8] = r[8] * s),
  46213. (i[9] = r[9] * s),
  46214. (i[10] = r[10] * s),
  46215. this
  46216. );
  46217. };
  46218. })(),
  46219. makeRotationFromEuler: function (e) {
  46220. e instanceof n.Euler == !1 &&
  46221. console.error(
  46222. 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  46223. );
  46224. var t = this.elements,
  46225. i = e.x,
  46226. r = e.y,
  46227. o = e.z,
  46228. a = Math.cos(i),
  46229. s = Math.sin(i),
  46230. l = Math.cos(r),
  46231. c = Math.sin(r),
  46232. h = Math.cos(o),
  46233. u = Math.sin(o);
  46234. if ('XYZ' === e.order) {
  46235. var d = a * h,
  46236. p = a * u,
  46237. f = s * h,
  46238. g = s * u;
  46239. (t[0] = l * h),
  46240. (t[4] = -l * u),
  46241. (t[8] = c),
  46242. (t[1] = p + f * c),
  46243. (t[5] = d - g * c),
  46244. (t[9] = -s * l),
  46245. (t[2] = g - d * c),
  46246. (t[6] = f + p * c),
  46247. (t[10] = a * l);
  46248. } else if ('YXZ' === e.order) {
  46249. var m = l * h,
  46250. v = l * u,
  46251. A = c * h,
  46252. y = c * u;
  46253. (t[0] = m + y * s),
  46254. (t[4] = A * s - v),
  46255. (t[8] = a * c),
  46256. (t[1] = a * u),
  46257. (t[5] = a * h),
  46258. (t[9] = -s),
  46259. (t[2] = v * s - A),
  46260. (t[6] = y + m * s),
  46261. (t[10] = a * l);
  46262. } else if ('ZXY' === e.order) {
  46263. var m = l * h,
  46264. v = l * u,
  46265. A = c * h,
  46266. y = c * u;
  46267. (t[0] = m - y * s),
  46268. (t[4] = -a * u),
  46269. (t[8] = A + v * s),
  46270. (t[1] = v + A * s),
  46271. (t[5] = a * h),
  46272. (t[9] = y - m * s),
  46273. (t[2] = -a * c),
  46274. (t[6] = s),
  46275. (t[10] = a * l);
  46276. } else if ('ZYX' === e.order) {
  46277. var d = a * h,
  46278. p = a * u,
  46279. f = s * h,
  46280. g = s * u;
  46281. (t[0] = l * h),
  46282. (t[4] = f * c - p),
  46283. (t[8] = d * c + g),
  46284. (t[1] = l * u),
  46285. (t[5] = g * c + d),
  46286. (t[9] = p * c - f),
  46287. (t[2] = -c),
  46288. (t[6] = s * l),
  46289. (t[10] = a * l);
  46290. } else if ('YZX' === e.order) {
  46291. var C = a * l,
  46292. I = a * c,
  46293. E = s * l,
  46294. b = s * c;
  46295. (t[0] = l * h),
  46296. (t[4] = b - C * u),
  46297. (t[8] = E * u + I),
  46298. (t[1] = u),
  46299. (t[5] = a * h),
  46300. (t[9] = -s * h),
  46301. (t[2] = -c * h),
  46302. (t[6] = I * u + E),
  46303. (t[10] = C - b * u);
  46304. } else if ('XZY' === e.order) {
  46305. var C = a * l,
  46306. I = a * c,
  46307. E = s * l,
  46308. b = s * c;
  46309. (t[0] = l * h),
  46310. (t[4] = -u),
  46311. (t[8] = c * h),
  46312. (t[1] = C * u + b),
  46313. (t[5] = a * h),
  46314. (t[9] = I * u - E),
  46315. (t[2] = E * u - I),
  46316. (t[6] = s * h),
  46317. (t[10] = b * u + C);
  46318. }
  46319. return (
  46320. (t[3] = 0),
  46321. (t[7] = 0),
  46322. (t[11] = 0),
  46323. (t[12] = 0),
  46324. (t[13] = 0),
  46325. (t[14] = 0),
  46326. (t[15] = 1),
  46327. this
  46328. );
  46329. },
  46330. makeRotationFromQuaternion: function (e) {
  46331. var t = this.elements,
  46332. i = e.x,
  46333. n = e.y,
  46334. r = e.z,
  46335. o = e.w,
  46336. a = i + i,
  46337. s = n + n,
  46338. l = r + r,
  46339. c = i * a,
  46340. h = i * s,
  46341. u = i * l,
  46342. d = n * s,
  46343. p = n * l,
  46344. f = r * l,
  46345. g = o * a,
  46346. m = o * s,
  46347. v = o * l;
  46348. return (
  46349. (t[0] = 1 - (d + f)),
  46350. (t[4] = h - v),
  46351. (t[8] = u + m),
  46352. (t[1] = h + v),
  46353. (t[5] = 1 - (c + f)),
  46354. (t[9] = p - g),
  46355. (t[2] = u - m),
  46356. (t[6] = p + g),
  46357. (t[10] = 1 - (c + d)),
  46358. (t[3] = 0),
  46359. (t[7] = 0),
  46360. (t[11] = 0),
  46361. (t[12] = 0),
  46362. (t[13] = 0),
  46363. (t[14] = 0),
  46364. (t[15] = 1),
  46365. this
  46366. );
  46367. },
  46368. lookAt: (function () {
  46369. var e, t, i;
  46370. return function (r, o, a) {
  46371. void 0 === e && (e = new n.Vector3()),
  46372. void 0 === t && (t = new n.Vector3()),
  46373. void 0 === i && (i = new n.Vector3());
  46374. var s = this.elements;
  46375. return (
  46376. i.subVectors(r, o).normalize(),
  46377. 0 === i.lengthSq() && (i.z = 1),
  46378. e.crossVectors(a, i).normalize(),
  46379. 0 === e.lengthSq() && ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  46380. t.crossVectors(i, e),
  46381. (s[0] = e.x),
  46382. (s[4] = t.x),
  46383. (s[8] = i.x),
  46384. (s[1] = e.y),
  46385. (s[5] = t.y),
  46386. (s[9] = i.y),
  46387. (s[2] = e.z),
  46388. (s[6] = t.z),
  46389. (s[10] = i.z),
  46390. this
  46391. );
  46392. };
  46393. })(),
  46394. multiply: function (e, t) {
  46395. return void 0 !== t
  46396. ? (console.warn(
  46397. 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'
  46398. ),
  46399. this.multiplyMatrices(e, t))
  46400. : this.multiplyMatrices(this, e);
  46401. },
  46402. multiplyMatrices: function (e, t) {
  46403. var i = e.elements,
  46404. n = t.elements,
  46405. r = this.elements,
  46406. o = i[0],
  46407. a = i[4],
  46408. s = i[8],
  46409. l = i[12],
  46410. c = i[1],
  46411. h = i[5],
  46412. u = i[9],
  46413. d = i[13],
  46414. p = i[2],
  46415. f = i[6],
  46416. g = i[10],
  46417. m = i[14],
  46418. v = i[3],
  46419. A = i[7],
  46420. y = i[11],
  46421. C = i[15],
  46422. I = n[0],
  46423. E = n[4],
  46424. b = n[8],
  46425. w = n[12],
  46426. _ = n[1],
  46427. T = n[5],
  46428. x = n[9],
  46429. S = n[13],
  46430. M = n[2],
  46431. R = n[6],
  46432. P = n[10],
  46433. O = n[14],
  46434. L = n[3],
  46435. D = n[7],
  46436. N = n[11],
  46437. B = n[15];
  46438. return (
  46439. (r[0] = o * I + a * _ + s * M + l * L),
  46440. (r[4] = o * E + a * T + s * R + l * D),
  46441. (r[8] = o * b + a * x + s * P + l * N),
  46442. (r[12] = o * w + a * S + s * O + l * B),
  46443. (r[1] = c * I + h * _ + u * M + d * L),
  46444. (r[5] = c * E + h * T + u * R + d * D),
  46445. (r[9] = c * b + h * x + u * P + d * N),
  46446. (r[13] = c * w + h * S + u * O + d * B),
  46447. (r[2] = p * I + f * _ + g * M + m * L),
  46448. (r[6] = p * E + f * T + g * R + m * D),
  46449. (r[10] = p * b + f * x + g * P + m * N),
  46450. (r[14] = p * w + f * S + g * O + m * B),
  46451. (r[3] = v * I + A * _ + y * M + C * L),
  46452. (r[7] = v * E + A * T + y * R + C * D),
  46453. (r[11] = v * b + A * x + y * P + C * N),
  46454. (r[15] = v * w + A * S + y * O + C * B),
  46455. this
  46456. );
  46457. },
  46458. multiplyToArray: function (e, t, i) {
  46459. var n = this.elements;
  46460. return (
  46461. this.multiplyMatrices(e, t),
  46462. (i[0] = n[0]),
  46463. (i[1] = n[1]),
  46464. (i[2] = n[2]),
  46465. (i[3] = n[3]),
  46466. (i[4] = n[4]),
  46467. (i[5] = n[5]),
  46468. (i[6] = n[6]),
  46469. (i[7] = n[7]),
  46470. (i[8] = n[8]),
  46471. (i[9] = n[9]),
  46472. (i[10] = n[10]),
  46473. (i[11] = n[11]),
  46474. (i[12] = n[12]),
  46475. (i[13] = n[13]),
  46476. (i[14] = n[14]),
  46477. (i[15] = n[15]),
  46478. this
  46479. );
  46480. },
  46481. multiplyScalar: function (e) {
  46482. var t = this.elements;
  46483. return (
  46484. (t[0] *= e),
  46485. (t[4] *= e),
  46486. (t[8] *= e),
  46487. (t[12] *= e),
  46488. (t[1] *= e),
  46489. (t[5] *= e),
  46490. (t[9] *= e),
  46491. (t[13] *= e),
  46492. (t[2] *= e),
  46493. (t[6] *= e),
  46494. (t[10] *= e),
  46495. (t[14] *= e),
  46496. (t[3] *= e),
  46497. (t[7] *= e),
  46498. (t[11] *= e),
  46499. (t[15] *= e),
  46500. this
  46501. );
  46502. },
  46503. applyToVector3Array: (function () {
  46504. var e;
  46505. return function (t, i, r) {
  46506. void 0 === e && (e = new n.Vector3()),
  46507. void 0 === i && (i = 0),
  46508. void 0 === r && (r = t.length);
  46509. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46510. e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a);
  46511. return t;
  46512. };
  46513. })(),
  46514. applyToBuffer: (function () {
  46515. var e;
  46516. return function (t, i, r) {
  46517. void 0 === e && (e = new n.Vector3()),
  46518. void 0 === i && (i = 0),
  46519. void 0 === r && (r = t.length / t.itemSize);
  46520. for (var o = 0, a = i; o < r; o++, a++)
  46521. (e.x = t.getX(a)),
  46522. (e.y = t.getY(a)),
  46523. (e.z = t.getZ(a)),
  46524. e.applyMatrix4(this),
  46525. t.setXYZ(e.x, e.y, e.z);
  46526. return t;
  46527. };
  46528. })(),
  46529. determinant: function () {
  46530. var e = this.elements,
  46531. t = e[0],
  46532. i = e[4],
  46533. n = e[8],
  46534. r = e[12],
  46535. o = e[1],
  46536. a = e[5],
  46537. s = e[9],
  46538. l = e[13],
  46539. c = e[2],
  46540. h = e[6],
  46541. u = e[10],
  46542. d = e[14],
  46543. p = e[3],
  46544. f = e[7],
  46545. g = e[11],
  46546. m = e[15];
  46547. return (
  46548. p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  46549. f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  46550. g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  46551. m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  46552. );
  46553. },
  46554. transpose: function () {
  46555. var e,
  46556. t = this.elements;
  46557. return (
  46558. (e = t[1]),
  46559. (t[1] = t[4]),
  46560. (t[4] = e),
  46561. (e = t[2]),
  46562. (t[2] = t[8]),
  46563. (t[8] = e),
  46564. (e = t[6]),
  46565. (t[6] = t[9]),
  46566. (t[9] = e),
  46567. (e = t[3]),
  46568. (t[3] = t[12]),
  46569. (t[12] = e),
  46570. (e = t[7]),
  46571. (t[7] = t[13]),
  46572. (t[13] = e),
  46573. (e = t[11]),
  46574. (t[11] = t[14]),
  46575. (t[14] = e),
  46576. this
  46577. );
  46578. },
  46579. flattenToArrayOffset: function (e, t) {
  46580. var i = this.elements;
  46581. return (
  46582. (e[t] = i[0]),
  46583. (e[t + 1] = i[1]),
  46584. (e[t + 2] = i[2]),
  46585. (e[t + 3] = i[3]),
  46586. (e[t + 4] = i[4]),
  46587. (e[t + 5] = i[5]),
  46588. (e[t + 6] = i[6]),
  46589. (e[t + 7] = i[7]),
  46590. (e[t + 8] = i[8]),
  46591. (e[t + 9] = i[9]),
  46592. (e[t + 10] = i[10]),
  46593. (e[t + 11] = i[11]),
  46594. (e[t + 12] = i[12]),
  46595. (e[t + 13] = i[13]),
  46596. (e[t + 14] = i[14]),
  46597. (e[t + 15] = i[15]),
  46598. e
  46599. );
  46600. },
  46601. getPosition: (function () {
  46602. var e;
  46603. return function () {
  46604. return (
  46605. void 0 === e && (e = new n.Vector3()),
  46606. console.warn(
  46607. 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'
  46608. ),
  46609. e.setFromMatrixColumn(this, 3)
  46610. );
  46611. };
  46612. })(),
  46613. setPosition: function (e) {
  46614. var t = this.elements;
  46615. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this;
  46616. },
  46617. getInverse: function (e, t) {
  46618. var i = this.elements,
  46619. n = e.elements,
  46620. r = n[0],
  46621. o = n[1],
  46622. a = n[2],
  46623. s = n[3],
  46624. l = n[4],
  46625. c = n[5],
  46626. h = n[6],
  46627. u = n[7],
  46628. d = n[8],
  46629. p = n[9],
  46630. f = n[10],
  46631. g = n[11],
  46632. m = n[12],
  46633. v = n[13],
  46634. A = n[14],
  46635. y = n[15],
  46636. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  46637. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  46638. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  46639. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  46640. w = r * C + o * I + a * E + s * b;
  46641. if (0 === w) {
  46642. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  46643. if (t) throw new Error(_);
  46644. return console.warn(_), this.identity();
  46645. }
  46646. return (
  46647. (i[0] = C),
  46648. (i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y),
  46649. (i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y),
  46650. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  46651. (i[4] = I),
  46652. (i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y),
  46653. (i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y),
  46654. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  46655. (i[8] = E),
  46656. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y),
  46657. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y),
  46658. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  46659. (i[12] = b),
  46660. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A),
  46661. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A),
  46662. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  46663. this.multiplyScalar(1 / w)
  46664. );
  46665. },
  46666. scale: function (e) {
  46667. var t = this.elements,
  46668. i = e.x,
  46669. n = e.y,
  46670. r = e.z;
  46671. return (
  46672. (t[0] *= i),
  46673. (t[4] *= n),
  46674. (t[8] *= r),
  46675. (t[1] *= i),
  46676. (t[5] *= n),
  46677. (t[9] *= r),
  46678. (t[2] *= i),
  46679. (t[6] *= n),
  46680. (t[10] *= r),
  46681. (t[3] *= i),
  46682. (t[7] *= n),
  46683. (t[11] *= r),
  46684. this
  46685. );
  46686. },
  46687. getMaxScaleOnAxis: function () {
  46688. var e = this.elements,
  46689. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  46690. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  46691. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  46692. return Math.sqrt(Math.max(t, i, n));
  46693. },
  46694. makeTranslation: function (e, t, i) {
  46695. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this;
  46696. },
  46697. makeRotationX: function (e) {
  46698. var t = Math.cos(e),
  46699. i = Math.sin(e);
  46700. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this;
  46701. },
  46702. makeRotationY: function (e) {
  46703. var t = Math.cos(e),
  46704. i = Math.sin(e);
  46705. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this;
  46706. },
  46707. makeRotationZ: function (e) {
  46708. var t = Math.cos(e),
  46709. i = Math.sin(e);
  46710. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
  46711. },
  46712. makeRotationAxis: function (e, t) {
  46713. var i = Math.cos(t),
  46714. n = Math.sin(t),
  46715. r = 1 - i,
  46716. o = e.x,
  46717. a = e.y,
  46718. s = e.z,
  46719. l = r * o,
  46720. c = r * a;
  46721. return (
  46722. this.set(
  46723. l * o + i,
  46724. l * a - n * s,
  46725. l * s + n * a,
  46726. 0,
  46727. l * a + n * s,
  46728. c * a + i,
  46729. c * s - n * o,
  46730. 0,
  46731. l * s - n * a,
  46732. c * s + n * o,
  46733. r * s * s + i,
  46734. 0,
  46735. 0,
  46736. 0,
  46737. 0,
  46738. 1
  46739. ),
  46740. this
  46741. );
  46742. },
  46743. makeScale: function (e, t, i) {
  46744. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this;
  46745. },
  46746. compose: function (e, t, i) {
  46747. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this;
  46748. },
  46749. decompose: (function () {
  46750. var e, t;
  46751. return function (i, r, o) {
  46752. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Matrix4());
  46753. var a = this.elements,
  46754. s = e.set(a[0], a[1], a[2]).length(),
  46755. l = e.set(a[4], a[5], a[6]).length(),
  46756. c = e.set(a[8], a[9], a[10]).length(),
  46757. h = this.determinant();
  46758. h < 0 && (s = -s),
  46759. (i.x = a[12]),
  46760. (i.y = a[13]),
  46761. (i.z = a[14]),
  46762. t.elements.set(this.elements);
  46763. var u = 1 / s,
  46764. d = 1 / l,
  46765. p = 1 / c;
  46766. return (
  46767. (t.elements[0] *= u),
  46768. (t.elements[1] *= u),
  46769. (t.elements[2] *= u),
  46770. (t.elements[4] *= d),
  46771. (t.elements[5] *= d),
  46772. (t.elements[6] *= d),
  46773. (t.elements[8] *= p),
  46774. (t.elements[9] *= p),
  46775. (t.elements[10] *= p),
  46776. r.setFromRotationMatrix(t),
  46777. (o.x = s),
  46778. (o.y = l),
  46779. (o.z = c),
  46780. this
  46781. );
  46782. };
  46783. })(),
  46784. makeFrustum: function (e, t, i, n, r, o) {
  46785. var a = this.elements,
  46786. s = (2 * r) / (t - e),
  46787. l = (2 * r) / (n - i),
  46788. c = (t + e) / (t - e),
  46789. h = (n + i) / (n - i),
  46790. u = -(o + r) / (o - r),
  46791. d = (-2 * o * r) / (o - r);
  46792. return (
  46793. (a[0] = s),
  46794. (a[4] = 0),
  46795. (a[8] = c),
  46796. (a[12] = 0),
  46797. (a[1] = 0),
  46798. (a[5] = l),
  46799. (a[9] = h),
  46800. (a[13] = 0),
  46801. (a[2] = 0),
  46802. (a[6] = 0),
  46803. (a[10] = u),
  46804. (a[14] = d),
  46805. (a[3] = 0),
  46806. (a[7] = 0),
  46807. (a[11] = -1),
  46808. (a[15] = 0),
  46809. this
  46810. );
  46811. },
  46812. makePerspective: function (e, t, i, r) {
  46813. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  46814. a = -o,
  46815. s = a * t,
  46816. l = o * t;
  46817. return this.makeFrustum(s, l, a, o, i, r);
  46818. },
  46819. makeOrthographic: function (e, t, i, n, r, o) {
  46820. var a = this.elements,
  46821. s = 1 / (t - e),
  46822. l = 1 / (i - n),
  46823. c = 1 / (o - r),
  46824. h = (t + e) * s,
  46825. u = (i + n) * l,
  46826. d = (o + r) * c;
  46827. return (
  46828. (a[0] = 2 * s),
  46829. (a[4] = 0),
  46830. (a[8] = 0),
  46831. (a[12] = -h),
  46832. (a[1] = 0),
  46833. (a[5] = 2 * l),
  46834. (a[9] = 0),
  46835. (a[13] = -u),
  46836. (a[2] = 0),
  46837. (a[6] = 0),
  46838. (a[10] = -2 * c),
  46839. (a[14] = -d),
  46840. (a[3] = 0),
  46841. (a[7] = 0),
  46842. (a[11] = 0),
  46843. (a[15] = 1),
  46844. this
  46845. );
  46846. },
  46847. equals: function (e) {
  46848. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  46849. if (t[n] !== i[n]) return !1;
  46850. return !0;
  46851. },
  46852. fromArray: function (e) {
  46853. return this.elements.set(e), this;
  46854. },
  46855. toArray: function () {
  46856. var e = this.elements;
  46857. return [
  46858. e[0],
  46859. e[1],
  46860. e[2],
  46861. e[3],
  46862. e[4],
  46863. e[5],
  46864. e[6],
  46865. e[7],
  46866. e[8],
  46867. e[9],
  46868. e[10],
  46869. e[11],
  46870. e[12],
  46871. e[13],
  46872. e[14],
  46873. e[15],
  46874. ];
  46875. },
  46876. }),
  46877. (n.Ray = function (e, t) {
  46878. (this.origin = void 0 !== e ? e : new n.Vector3()),
  46879. (this.direction = void 0 !== t ? t : new n.Vector3());
  46880. }),
  46881. (n.Ray.prototype = {
  46882. constructor: n.Ray,
  46883. set: function (e, t) {
  46884. return this.origin.copy(e), this.direction.copy(t), this;
  46885. },
  46886. clone: function () {
  46887. return new this.constructor().copy(this);
  46888. },
  46889. copy: function (e) {
  46890. return this.origin.copy(e.origin), this.direction.copy(e.direction), this;
  46891. },
  46892. at: function (e, t) {
  46893. var i = t || new n.Vector3();
  46894. return i.copy(this.direction).multiplyScalar(e).add(this.origin);
  46895. },
  46896. lookAt: function (e) {
  46897. this.direction.copy(e).sub(this.origin).normalize();
  46898. },
  46899. recast: (function () {
  46900. var e = new n.Vector3();
  46901. return function (t) {
  46902. return this.origin.copy(this.at(t, e)), this;
  46903. };
  46904. })(),
  46905. closestPointToPoint: function (e, t) {
  46906. var i = t || new n.Vector3();
  46907. i.subVectors(e, this.origin);
  46908. var r = i.dot(this.direction);
  46909. return r < 0
  46910. ? i.copy(this.origin)
  46911. : i.copy(this.direction).multiplyScalar(r).add(this.origin);
  46912. },
  46913. distanceToPoint: function (e) {
  46914. return Math.sqrt(this.distanceSqToPoint(e));
  46915. },
  46916. distanceSqToPoint: (function () {
  46917. var e = new n.Vector3();
  46918. return function (t) {
  46919. var i = e.subVectors(t, this.origin).dot(this.direction);
  46920. return i < 0
  46921. ? this.origin.distanceToSquared(t)
  46922. : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  46923. e.distanceToSquared(t));
  46924. };
  46925. })(),
  46926. distanceSqToSegment: (function () {
  46927. var e = new n.Vector3(),
  46928. t = new n.Vector3(),
  46929. i = new n.Vector3();
  46930. return function (n, r, o, a) {
  46931. e.copy(n).add(r).multiplyScalar(0.5),
  46932. t.copy(r).sub(n).normalize(),
  46933. i.copy(this.origin).sub(e);
  46934. var s,
  46935. l,
  46936. c,
  46937. h,
  46938. u = 0.5 * n.distanceTo(r),
  46939. d = -this.direction.dot(t),
  46940. p = i.dot(this.direction),
  46941. f = -i.dot(t),
  46942. g = i.lengthSq(),
  46943. m = Math.abs(1 - d * d);
  46944. if (m > 0)
  46945. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  46946. if (l >= -h)
  46947. if (l <= h) {
  46948. var v = 1 / m;
  46949. (s *= v),
  46950. (l *= v),
  46951. (c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g);
  46952. } else
  46953. (l = u),
  46954. (s = Math.max(0, -(d * l + p))),
  46955. (c = -s * s + l * (l + 2 * f) + g);
  46956. else
  46957. (l = -u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g);
  46958. else
  46959. l <= -h
  46960. ? ((s = Math.max(0, -(-d * u + p))),
  46961. (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)),
  46962. (c = -s * s + l * (l + 2 * f) + g))
  46963. : l <= h
  46964. ? ((s = 0), (l = Math.min(Math.max(-u, -f), u)), (c = l * (l + 2 * f) + g))
  46965. : ((s = Math.max(0, -(d * u + p))),
  46966. (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)),
  46967. (c = -s * s + l * (l + 2 * f) + g));
  46968. else
  46969. (l = d > 0 ? -u : u),
  46970. (s = Math.max(0, -(d * l + p))),
  46971. (c = -s * s + l * (l + 2 * f) + g);
  46972. return (
  46973. o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  46974. a && a.copy(t).multiplyScalar(l).add(e),
  46975. c
  46976. );
  46977. };
  46978. })(),
  46979. intersectSphere: (function () {
  46980. var e = new n.Vector3();
  46981. return function (t, i) {
  46982. e.subVectors(t.center, this.origin);
  46983. var n = e.dot(this.direction),
  46984. r = e.dot(e) - n * n,
  46985. o = t.radius * t.radius;
  46986. if (r > o) return null;
  46987. var a = Math.sqrt(o - r),
  46988. s = n - a,
  46989. l = n + a;
  46990. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i);
  46991. };
  46992. })(),
  46993. intersectsSphere: function (e) {
  46994. return this.distanceToPoint(e.center) <= e.radius;
  46995. },
  46996. distanceToPlane: function (e) {
  46997. var t = e.normal.dot(this.direction);
  46998. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  46999. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  47000. return i >= 0 ? i : null;
  47001. },
  47002. intersectPlane: function (e, t) {
  47003. var i = this.distanceToPlane(e);
  47004. return null === i ? null : this.at(i, t);
  47005. },
  47006. intersectsPlane: function (e) {
  47007. var t = e.distanceToPoint(this.origin);
  47008. if (0 === t) return !0;
  47009. var i = e.normal.dot(this.direction);
  47010. return i * t < 0;
  47011. },
  47012. intersectBox: function (e, t) {
  47013. var i,
  47014. n,
  47015. r,
  47016. o,
  47017. a,
  47018. s,
  47019. l = 1 / this.direction.x,
  47020. c = 1 / this.direction.y,
  47021. h = 1 / this.direction.z,
  47022. u = this.origin;
  47023. return (
  47024. l >= 0
  47025. ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l))
  47026. : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  47027. c >= 0
  47028. ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c))
  47029. : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  47030. i > o || r > n
  47031. ? null
  47032. : ((r > i || i !== i) && (i = r),
  47033. (o < n || n !== n) && (n = o),
  47034. h >= 0
  47035. ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h))
  47036. : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  47037. i > s || a > n
  47038. ? null
  47039. : ((a > i || i !== i) && (i = a),
  47040. (s < n || n !== n) && (n = s),
  47041. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  47042. );
  47043. },
  47044. intersectsBox: (function () {
  47045. var e = new n.Vector3();
  47046. return function (t) {
  47047. return null !== this.intersectBox(t, e);
  47048. };
  47049. })(),
  47050. intersectTriangle: (function () {
  47051. var e = new n.Vector3(),
  47052. t = new n.Vector3(),
  47053. i = new n.Vector3(),
  47054. r = new n.Vector3();
  47055. return function (n, o, a, s, l) {
  47056. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i);
  47057. var c,
  47058. h = this.direction.dot(r);
  47059. if (h > 0) {
  47060. if (s) return null;
  47061. c = 1;
  47062. } else {
  47063. if (!(h < 0)) return null;
  47064. (c = -1), (h = -h);
  47065. }
  47066. e.subVectors(this.origin, n);
  47067. var u = c * this.direction.dot(i.crossVectors(e, i));
  47068. if (u < 0) return null;
  47069. var d = c * this.direction.dot(t.cross(e));
  47070. if (d < 0) return null;
  47071. if (u + d > h) return null;
  47072. var p = -c * e.dot(r);
  47073. return p < 0 ? null : this.at(p / h, l);
  47074. };
  47075. })(),
  47076. applyMatrix4: function (e) {
  47077. return (
  47078. this.direction.add(this.origin).applyMatrix4(e),
  47079. this.origin.applyMatrix4(e),
  47080. this.direction.sub(this.origin),
  47081. this.direction.normalize(),
  47082. this
  47083. );
  47084. },
  47085. equals: function (e) {
  47086. return e.origin.equals(this.origin) && e.direction.equals(this.direction);
  47087. },
  47088. }),
  47089. (n.Sphere = function (e, t) {
  47090. (this.center = void 0 !== e ? e : new n.Vector3()),
  47091. (this.radius = void 0 !== t ? t : 0);
  47092. }),
  47093. (n.Sphere.prototype = {
  47094. constructor: n.Sphere,
  47095. set: function (e, t) {
  47096. return this.center.copy(e), (this.radius = t), this;
  47097. },
  47098. setFromPoints: (function () {
  47099. var e = new n.Box3();
  47100. return function (t, i) {
  47101. var n = this.center;
  47102. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  47103. for (var r = 0, o = 0, a = t.length; o < a; o++)
  47104. r = Math.max(r, n.distanceToSquared(t[o]));
  47105. return (this.radius = Math.sqrt(r)), this;
  47106. };
  47107. })(),
  47108. clone: function () {
  47109. return new this.constructor().copy(this);
  47110. },
  47111. copy: function (e) {
  47112. return this.center.copy(e.center), (this.radius = e.radius), this;
  47113. },
  47114. empty: function () {
  47115. return this.radius <= 0;
  47116. },
  47117. containsPoint: function (e) {
  47118. return e.distanceToSquared(this.center) <= this.radius * this.radius;
  47119. },
  47120. distanceToPoint: function (e) {
  47121. return e.distanceTo(this.center) - this.radius;
  47122. },
  47123. intersectsSphere: function (e) {
  47124. var t = this.radius + e.radius;
  47125. return e.center.distanceToSquared(this.center) <= t * t;
  47126. },
  47127. intersectsBox: function (e) {
  47128. return e.intersectsSphere(this);
  47129. },
  47130. intersectsPlane: function (e) {
  47131. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius;
  47132. },
  47133. clampPoint: function (e, t) {
  47134. var i = this.center.distanceToSquared(e),
  47135. r = t || new n.Vector3();
  47136. return (
  47137. r.copy(e),
  47138. i > this.radius * this.radius &&
  47139. (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)),
  47140. r
  47141. );
  47142. },
  47143. getBoundingBox: function (e) {
  47144. var t = e || new n.Box3();
  47145. return t.set(this.center, this.center), t.expandByScalar(this.radius), t;
  47146. },
  47147. applyMatrix4: function (e) {
  47148. return (
  47149. this.center.applyMatrix4(e),
  47150. (this.radius = this.radius * e.getMaxScaleOnAxis()),
  47151. this
  47152. );
  47153. },
  47154. translate: function (e) {
  47155. return this.center.add(e), this;
  47156. },
  47157. equals: function (e) {
  47158. return e.center.equals(this.center) && e.radius === this.radius;
  47159. },
  47160. }),
  47161. (n.Frustum = function (e, t, i, r, o, a) {
  47162. this.planes = [
  47163. void 0 !== e ? e : new n.Plane(),
  47164. void 0 !== t ? t : new n.Plane(),
  47165. void 0 !== i ? i : new n.Plane(),
  47166. void 0 !== r ? r : new n.Plane(),
  47167. void 0 !== o ? o : new n.Plane(),
  47168. void 0 !== a ? a : new n.Plane(),
  47169. ];
  47170. }),
  47171. (n.Frustum.prototype = {
  47172. constructor: n.Frustum,
  47173. set: function (e, t, i, n, r, o) {
  47174. var a = this.planes;
  47175. return (
  47176. a[0].copy(e),
  47177. a[1].copy(t),
  47178. a[2].copy(i),
  47179. a[3].copy(n),
  47180. a[4].copy(r),
  47181. a[5].copy(o),
  47182. this
  47183. );
  47184. },
  47185. clone: function () {
  47186. return new this.constructor().copy(this);
  47187. },
  47188. copy: function (e) {
  47189. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i]);
  47190. return this;
  47191. },
  47192. setFromMatrix: function (e) {
  47193. var t = this.planes,
  47194. i = e.elements,
  47195. n = i[0],
  47196. r = i[1],
  47197. o = i[2],
  47198. a = i[3],
  47199. s = i[4],
  47200. l = i[5],
  47201. c = i[6],
  47202. h = i[7],
  47203. u = i[8],
  47204. d = i[9],
  47205. p = i[10],
  47206. f = i[11],
  47207. g = i[12],
  47208. m = i[13],
  47209. v = i[14],
  47210. A = i[15];
  47211. return (
  47212. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  47213. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  47214. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  47215. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  47216. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  47217. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  47218. this
  47219. );
  47220. },
  47221. intersectsObject: (function () {
  47222. var e = new n.Sphere();
  47223. return function (t) {
  47224. var i = t.geometry;
  47225. return (
  47226. null === i.boundingSphere && i.computeBoundingSphere(),
  47227. e.copy(i.boundingSphere),
  47228. e.applyMatrix4(t.matrixWorld),
  47229. this.intersectsSphere(e)
  47230. );
  47231. };
  47232. })(),
  47233. intersectsSphere: function (e) {
  47234. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  47235. var o = t[r].distanceToPoint(i);
  47236. if (o < n) return !1;
  47237. }
  47238. return !0;
  47239. },
  47240. intersectsBox: (function () {
  47241. var e = new n.Vector3(),
  47242. t = new n.Vector3();
  47243. return function (i) {
  47244. for (var n = this.planes, r = 0; r < 6; r++) {
  47245. var o = n[r];
  47246. (e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  47247. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  47248. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  47249. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  47250. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  47251. (t.z = o.normal.z > 0 ? i.max.z : i.min.z);
  47252. var a = o.distanceToPoint(e),
  47253. s = o.distanceToPoint(t);
  47254. if (a < 0 && s < 0) return !1;
  47255. }
  47256. return !0;
  47257. };
  47258. })(),
  47259. containsPoint: function (e) {
  47260. for (var t = this.planes, i = 0; i < 6; i++)
  47261. if (t[i].distanceToPoint(e) < 0) return !1;
  47262. return !0;
  47263. },
  47264. }),
  47265. (n.Plane = function (e, t) {
  47266. (this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)),
  47267. (this.constant = void 0 !== t ? t : 0);
  47268. }),
  47269. (n.Plane.prototype = {
  47270. constructor: n.Plane,
  47271. set: function (e, t) {
  47272. return this.normal.copy(e), (this.constant = t), this;
  47273. },
  47274. setComponents: function (e, t, i, n) {
  47275. return this.normal.set(e, t, i), (this.constant = n), this;
  47276. },
  47277. setFromNormalAndCoplanarPoint: function (e, t) {
  47278. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this;
  47279. },
  47280. setFromCoplanarPoints: (function () {
  47281. var e = new n.Vector3(),
  47282. t = new n.Vector3();
  47283. return function (i, n, r) {
  47284. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  47285. return this.setFromNormalAndCoplanarPoint(o, i), this;
  47286. };
  47287. })(),
  47288. clone: function () {
  47289. return new this.constructor().copy(this);
  47290. },
  47291. copy: function (e) {
  47292. return this.normal.copy(e.normal), (this.constant = e.constant), this;
  47293. },
  47294. normalize: function () {
  47295. var e = 1 / this.normal.length();
  47296. return this.normal.multiplyScalar(e), (this.constant *= e), this;
  47297. },
  47298. negate: function () {
  47299. return (this.constant *= -1), this.normal.negate(), this;
  47300. },
  47301. distanceToPoint: function (e) {
  47302. return this.normal.dot(e) + this.constant;
  47303. },
  47304. distanceToSphere: function (e) {
  47305. return this.distanceToPoint(e.center) - e.radius;
  47306. },
  47307. projectPoint: function (e, t) {
  47308. return this.orthoPoint(e, t).sub(e).negate();
  47309. },
  47310. orthoPoint: function (e, t) {
  47311. var i = this.distanceToPoint(e),
  47312. r = t || new n.Vector3();
  47313. return r.copy(this.normal).multiplyScalar(i);
  47314. },
  47315. intersectLine: (function () {
  47316. var e = new n.Vector3();
  47317. return function (t, i) {
  47318. var r = i || new n.Vector3(),
  47319. o = t.delta(e),
  47320. a = this.normal.dot(o);
  47321. if (0 !== a) {
  47322. var s = -(t.start.dot(this.normal) + this.constant) / a;
  47323. if (!(s < 0 || s > 1)) return r.copy(o).multiplyScalar(s).add(t.start);
  47324. } else if (0 === this.distanceToPoint(t.start)) return r.copy(t.start);
  47325. };
  47326. })(),
  47327. intersectsLine: function (e) {
  47328. var t = this.distanceToPoint(e.start),
  47329. i = this.distanceToPoint(e.end);
  47330. return (t < 0 && i > 0) || (i < 0 && t > 0);
  47331. },
  47332. intersectsBox: function (e) {
  47333. return e.intersectsPlane(this);
  47334. },
  47335. intersectsSphere: function (e) {
  47336. return e.intersectsPlane(this);
  47337. },
  47338. coplanarPoint: function (e) {
  47339. var t = e || new n.Vector3();
  47340. return t.copy(this.normal).multiplyScalar(-this.constant);
  47341. },
  47342. applyMatrix4: (function () {
  47343. var e = new n.Vector3(),
  47344. t = new n.Vector3(),
  47345. i = new n.Matrix3();
  47346. return function (n, r) {
  47347. var o = r || i.getNormalMatrix(n),
  47348. a = e.copy(this.normal).applyMatrix3(o),
  47349. s = this.coplanarPoint(t);
  47350. return s.applyMatrix4(n), this.setFromNormalAndCoplanarPoint(a, s), this;
  47351. };
  47352. })(),
  47353. translate: function (e) {
  47354. return (this.constant = this.constant - e.dot(this.normal)), this;
  47355. },
  47356. equals: function (e) {
  47357. return e.normal.equals(this.normal) && e.constant === this.constant;
  47358. },
  47359. }),
  47360. (n.Spherical = function (e, t, i) {
  47361. return (
  47362. (this.radius = void 0 !== e ? e : 1),
  47363. (this.phi = void 0 !== t ? t : 0),
  47364. (this.theta = void 0 !== i ? i : 0),
  47365. this
  47366. );
  47367. }),
  47368. (n.Spherical.prototype = {
  47369. constructor: n.Spherical,
  47370. set: function (e, t, i) {
  47371. (this.radius = e), (this.phi = t), (this.theta = i);
  47372. },
  47373. clone: function () {
  47374. return new this.constructor().copy(this);
  47375. },
  47376. copy: function (e) {
  47377. return (
  47378. this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  47379. );
  47380. },
  47381. makeSafe: function () {
  47382. var e = 1e-6;
  47383. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi));
  47384. },
  47385. setFromVector3: function (e) {
  47386. return (
  47387. (this.radius = e.length()),
  47388. 0 === this.radius
  47389. ? ((this.theta = 0), (this.phi = 0))
  47390. : ((this.theta = Math.atan2(e.x, e.z)),
  47391. (this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1)))),
  47392. this
  47393. );
  47394. },
  47395. }),
  47396. (n.Math = {
  47397. generateUUID: (function () {
  47398. var e,
  47399. t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
  47400. i = new Array(36),
  47401. n = 0;
  47402. return function () {
  47403. for (var r = 0; r < 36; r++)
  47404. 8 === r || 13 === r || 18 === r || 23 === r
  47405. ? (i[r] = '-')
  47406. : 14 === r
  47407. ? (i[r] = '4')
  47408. : (n <= 2 && (n = (33554432 + 16777216 * Math.random()) | 0),
  47409. (e = 15 & n),
  47410. (n >>= 4),
  47411. (i[r] = t[19 === r ? (3 & e) | 8 : e]));
  47412. return i.join('');
  47413. };
  47414. })(),
  47415. clamp: function (e, t, i) {
  47416. return Math.max(t, Math.min(i, e));
  47417. },
  47418. euclideanModulo: function (e, t) {
  47419. return ((e % t) + t) % t;
  47420. },
  47421. mapLinear: function (e, t, i, n, r) {
  47422. return n + ((e - t) * (r - n)) / (i - t);
  47423. },
  47424. smoothstep: function (e, t, i) {
  47425. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e));
  47426. },
  47427. smootherstep: function (e, t, i) {
  47428. return e <= t
  47429. ? 0
  47430. : e >= i
  47431. ? 1
  47432. : ((e = (e - t) / (i - t)), e * e * e * (e * (6 * e - 15) + 10));
  47433. },
  47434. random16: function () {
  47435. return (
  47436. console.warn(
  47437. 'THREE.Math.random16() has been deprecated. Use Math.random() instead.'
  47438. ),
  47439. Math.random()
  47440. );
  47441. },
  47442. randInt: function (e, t) {
  47443. return e + Math.floor(Math.random() * (t - e + 1));
  47444. },
  47445. randFloat: function (e, t) {
  47446. return e + Math.random() * (t - e);
  47447. },
  47448. randFloatSpread: function (e) {
  47449. return e * (0.5 - Math.random());
  47450. },
  47451. degToRad: (function () {
  47452. var e = Math.PI / 180;
  47453. return function (t) {
  47454. return t * e;
  47455. };
  47456. })(),
  47457. radToDeg: (function () {
  47458. var e = 180 / Math.PI;
  47459. return function (t) {
  47460. return t * e;
  47461. };
  47462. })(),
  47463. isPowerOfTwo: function (e) {
  47464. return 0 === (e & (e - 1)) && 0 !== e;
  47465. },
  47466. nearestPowerOfTwo: function (e) {
  47467. return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
  47468. },
  47469. nextPowerOfTwo: function (e) {
  47470. return (
  47471. e--,
  47472. (e |= e >> 1),
  47473. (e |= e >> 2),
  47474. (e |= e >> 4),
  47475. (e |= e >> 8),
  47476. (e |= e >> 16),
  47477. e++,
  47478. e
  47479. );
  47480. },
  47481. }),
  47482. (n.Spline = function (e) {
  47483. function t(e, t, i, n, r, o, a) {
  47484. var s = 0.5 * (i - e),
  47485. l = 0.5 * (n - t);
  47486. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t;
  47487. }
  47488. this.points = e;
  47489. var i,
  47490. r,
  47491. o,
  47492. a,
  47493. s,
  47494. l,
  47495. c,
  47496. h,
  47497. u,
  47498. d = [],
  47499. p = {
  47500. x: 0,
  47501. y: 0,
  47502. z: 0,
  47503. };
  47504. (this.initFromArray = function (e) {
  47505. this.points = [];
  47506. for (var t = 0; t < e.length; t++)
  47507. this.points[t] = {
  47508. x: e[t][0],
  47509. y: e[t][1],
  47510. z: e[t][2],
  47511. };
  47512. }),
  47513. (this.getPoint = function (e) {
  47514. return (
  47515. (i = (this.points.length - 1) * e),
  47516. (r = Math.floor(i)),
  47517. (o = i - r),
  47518. (d[0] = 0 === r ? r : r - 1),
  47519. (d[1] = r),
  47520. (d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1),
  47521. (d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2),
  47522. (l = this.points[d[0]]),
  47523. (c = this.points[d[1]]),
  47524. (h = this.points[d[2]]),
  47525. (u = this.points[d[3]]),
  47526. (a = o * o),
  47527. (s = o * a),
  47528. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  47529. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  47530. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  47531. p
  47532. );
  47533. }),
  47534. (this.getControlPointsArray = function () {
  47535. var e,
  47536. t,
  47537. i = this.points.length,
  47538. n = [];
  47539. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z]);
  47540. return n;
  47541. }),
  47542. (this.getLength = function (e) {
  47543. var t,
  47544. i,
  47545. r,
  47546. o,
  47547. a = 0,
  47548. s = 0,
  47549. l = 0,
  47550. c = new n.Vector3(),
  47551. h = new n.Vector3(),
  47552. u = [],
  47553. d = 0;
  47554. for (
  47555. u[0] = 0,
  47556. e || (e = 100),
  47557. r = this.points.length * e,
  47558. c.copy(this.points[0]),
  47559. t = 1;
  47560. t < r;
  47561. t++
  47562. )
  47563. (i = t / r),
  47564. (o = this.getPoint(i)),
  47565. h.copy(o),
  47566. (d += h.distanceTo(c)),
  47567. c.copy(o),
  47568. (a = (this.points.length - 1) * i),
  47569. (s = Math.floor(a)),
  47570. s !== l && ((u[s] = d), (l = s));
  47571. return (
  47572. (u[u.length] = d),
  47573. {
  47574. chunks: u,
  47575. total: d,
  47576. }
  47577. );
  47578. }),
  47579. (this.reparametrizeByArcLength = function (e) {
  47580. var t,
  47581. i,
  47582. r,
  47583. o,
  47584. a,
  47585. s,
  47586. l,
  47587. c,
  47588. h = [],
  47589. u = new n.Vector3(),
  47590. d = this.getLength();
  47591. for (h.push(u.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  47592. for (
  47593. s = d.chunks[t] - d.chunks[t - 1],
  47594. l = Math.ceil((e * s) / d.total),
  47595. o = (t - 1) / (this.points.length - 1),
  47596. a = t / (this.points.length - 1),
  47597. i = 1;
  47598. i < l - 1;
  47599. i++
  47600. )
  47601. (r = o + i * (1 / l) * (a - o)),
  47602. (c = this.getPoint(r)),
  47603. h.push(u.copy(c).clone());
  47604. h.push(u.copy(this.points[t]).clone());
  47605. }
  47606. this.points = h;
  47607. });
  47608. }),
  47609. (n.Triangle = function (e, t, i) {
  47610. (this.a = void 0 !== e ? e : new n.Vector3()),
  47611. (this.b = void 0 !== t ? t : new n.Vector3()),
  47612. (this.c = void 0 !== i ? i : new n.Vector3());
  47613. }),
  47614. (n.Triangle.normal = (function () {
  47615. var e = new n.Vector3();
  47616. return function (t, i, r, o) {
  47617. var a = o || new n.Vector3();
  47618. a.subVectors(r, i), e.subVectors(t, i), a.cross(e);
  47619. var s = a.lengthSq();
  47620. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0);
  47621. };
  47622. })()),
  47623. (n.Triangle.barycoordFromPoint = (function () {
  47624. var e = new n.Vector3(),
  47625. t = new n.Vector3(),
  47626. i = new n.Vector3();
  47627. return function (r, o, a, s, l) {
  47628. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o);
  47629. var c = e.dot(e),
  47630. h = e.dot(t),
  47631. u = e.dot(i),
  47632. d = t.dot(t),
  47633. p = t.dot(i),
  47634. f = c * d - h * h,
  47635. g = l || new n.Vector3();
  47636. if (0 === f) return g.set(-2, -1, -1);
  47637. var m = 1 / f,
  47638. v = (d * u - h * p) * m,
  47639. A = (c * p - h * u) * m;
  47640. return g.set(1 - v - A, A, v);
  47641. };
  47642. })()),
  47643. (n.Triangle.containsPoint = (function () {
  47644. var e = new n.Vector3();
  47645. return function (t, i, r, o) {
  47646. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  47647. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1;
  47648. };
  47649. })()),
  47650. (n.Triangle.prototype = {
  47651. constructor: n.Triangle,
  47652. set: function (e, t, i) {
  47653. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this;
  47654. },
  47655. setFromPointsAndIndices: function (e, t, i, n) {
  47656. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this;
  47657. },
  47658. clone: function () {
  47659. return new this.constructor().copy(this);
  47660. },
  47661. copy: function (e) {
  47662. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
  47663. },
  47664. area: (function () {
  47665. var e = new n.Vector3(),
  47666. t = new n.Vector3();
  47667. return function () {
  47668. return (
  47669. e.subVectors(this.c, this.b),
  47670. t.subVectors(this.a, this.b),
  47671. 0.5 * e.cross(t).length()
  47672. );
  47673. };
  47674. })(),
  47675. midpoint: function (e) {
  47676. var t = e || new n.Vector3();
  47677. return t
  47678. .addVectors(this.a, this.b)
  47679. .add(this.c)
  47680. .multiplyScalar(1 / 3);
  47681. },
  47682. normal: function (e) {
  47683. return n.Triangle.normal(this.a, this.b, this.c, e);
  47684. },
  47685. plane: function (e) {
  47686. var t = e || new n.Plane();
  47687. return t.setFromCoplanarPoints(this.a, this.b, this.c);
  47688. },
  47689. barycoordFromPoint: function (e, t) {
  47690. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t);
  47691. },
  47692. containsPoint: function (e) {
  47693. return n.Triangle.containsPoint(e, this.a, this.b, this.c);
  47694. },
  47695. equals: function (e) {
  47696. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
  47697. },
  47698. }),
  47699. (n.Interpolant = function (e, t, i, n) {
  47700. (this.parameterPositions = e),
  47701. (this._cachedIndex = 0),
  47702. (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)),
  47703. (this.sampleValues = t),
  47704. (this.valueSize = i);
  47705. }),
  47706. (n.Interpolant.prototype = {
  47707. constructor: n.Interpolant,
  47708. evaluate: function (e) {
  47709. var t = this.parameterPositions,
  47710. i = this._cachedIndex,
  47711. n = t[i],
  47712. r = t[i - 1];
  47713. e: {
  47714. t: {
  47715. var o;
  47716. i: {
  47717. n: if (!(e < n)) {
  47718. for (var a = i + 2; ; ) {
  47719. if (void 0 === n) {
  47720. if (e < r) break n;
  47721. return (
  47722. (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  47723. );
  47724. }
  47725. if (i === a) break;
  47726. if (((r = n), (n = t[++i]), e < n)) break t;
  47727. }
  47728. o = t.length;
  47729. break i;
  47730. }
  47731. {
  47732. if (e >= r) break e;
  47733. var s = t[1];
  47734. e < s && ((i = 2), (r = s));
  47735. for (var a = i - 2; ; ) {
  47736. if (void 0 === r)
  47737. return (this._cachedIndex = 0), this.beforeStart_(0, e, n);
  47738. if (i === a) break;
  47739. if (((n = r), (r = t[--i - 1]), e >= r)) break t;
  47740. }
  47741. (o = i), (i = 0);
  47742. }
  47743. }
  47744. for (; i < o; ) {
  47745. var l = (i + o) >>> 1;
  47746. e < t[l] ? (o = l) : (i = l + 1);
  47747. }
  47748. if (((n = t[i]), (r = t[i - 1]), void 0 === r))
  47749. return (this._cachedIndex = 0), this.beforeStart_(0, e, n);
  47750. if (void 0 === n)
  47751. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e);
  47752. }
  47753. (this._cachedIndex = i), this.intervalChanged_(i, r, n);
  47754. }
  47755. return this.interpolate_(i, r, e, n);
  47756. },
  47757. settings: null,
  47758. DefaultSettings_: {},
  47759. getSettings_: function () {
  47760. return this.settings || this.DefaultSettings_;
  47761. },
  47762. copySampleValue_: function (e) {
  47763. for (
  47764. var t = this.resultBuffer,
  47765. i = this.sampleValues,
  47766. n = this.valueSize,
  47767. r = e * n,
  47768. o = 0;
  47769. o !== n;
  47770. ++o
  47771. )
  47772. t[o] = i[r + o];
  47773. return t;
  47774. },
  47775. interpolate_: function (e, t, i, n) {
  47776. throw new Error('call to abstract method');
  47777. },
  47778. intervalChanged_: function (e, t, i) {},
  47779. }),
  47780. Object.assign(n.Interpolant.prototype, {
  47781. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  47782. afterEnd_: n.Interpolant.prototype.copySampleValue_,
  47783. }),
  47784. (n.CubicInterpolant = function (e, t, i, r) {
  47785. n.Interpolant.call(this, e, t, i, r),
  47786. (this._weightPrev = -0),
  47787. (this._offsetPrev = -0),
  47788. (this._weightNext = -0),
  47789. (this._offsetNext = -0);
  47790. }),
  47791. (n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47792. constructor: n.CubicInterpolant,
  47793. DefaultSettings_: {
  47794. endingStart: n.ZeroCurvatureEnding,
  47795. endingEnd: n.ZeroCurvatureEnding,
  47796. },
  47797. intervalChanged_: function (e, t, i) {
  47798. var r = this.parameterPositions,
  47799. o = e - 2,
  47800. a = e + 1,
  47801. s = r[o],
  47802. l = r[a];
  47803. if (void 0 === s)
  47804. switch (this.getSettings_().endingStart) {
  47805. case n.ZeroSlopeEnding:
  47806. (o = e), (s = 2 * t - i);
  47807. break;
  47808. case n.WrapAroundEnding:
  47809. (o = r.length - 2), (s = t + r[o] - r[o + 1]);
  47810. break;
  47811. default:
  47812. (o = e), (s = i);
  47813. }
  47814. if (void 0 === l)
  47815. switch (this.getSettings_().endingEnd) {
  47816. case n.ZeroSlopeEnding:
  47817. (a = e), (l = 2 * i - t);
  47818. break;
  47819. case n.WrapAroundEnding:
  47820. (a = 1), (l = i + r[1] - r[0]);
  47821. break;
  47822. default:
  47823. (a = e - 1), (l = t);
  47824. }
  47825. var c = 0.5 * (i - t),
  47826. h = this.valueSize;
  47827. (this._weightPrev = c / (t - s)),
  47828. (this._weightNext = c / (l - i)),
  47829. (this._offsetPrev = o * h),
  47830. (this._offsetNext = a * h);
  47831. },
  47832. interpolate_: function (e, t, i, n) {
  47833. for (
  47834. var r = this.resultBuffer,
  47835. o = this.sampleValues,
  47836. a = this.valueSize,
  47837. s = e * a,
  47838. l = s - a,
  47839. c = this._offsetPrev,
  47840. h = this._offsetNext,
  47841. u = this._weightPrev,
  47842. d = this._weightNext,
  47843. p = (i - t) / (n - t),
  47844. f = p * p,
  47845. g = f * p,
  47846. m = -u * g + 2 * u * f - u * p,
  47847. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  47848. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  47849. y = d * g - d * f,
  47850. C = 0;
  47851. C !== a;
  47852. ++C
  47853. )
  47854. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  47855. return r;
  47856. },
  47857. })),
  47858. (n.DiscreteInterpolant = function (e, t, i, r) {
  47859. n.Interpolant.call(this, e, t, i, r);
  47860. }),
  47861. (n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47862. constructor: n.DiscreteInterpolant,
  47863. interpolate_: function (e, t, i, n) {
  47864. return this.copySampleValue_(e - 1);
  47865. },
  47866. })),
  47867. (n.LinearInterpolant = function (e, t, i, r) {
  47868. n.Interpolant.call(this, e, t, i, r);
  47869. }),
  47870. (n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47871. constructor: n.LinearInterpolant,
  47872. interpolate_: function (e, t, i, n) {
  47873. for (
  47874. var r = this.resultBuffer,
  47875. o = this.sampleValues,
  47876. a = this.valueSize,
  47877. s = e * a,
  47878. l = s - a,
  47879. c = (i - t) / (n - t),
  47880. h = 1 - c,
  47881. u = 0;
  47882. u !== a;
  47883. ++u
  47884. )
  47885. r[u] = o[l + u] * h + o[s + u] * c;
  47886. return r;
  47887. },
  47888. })),
  47889. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  47890. n.Interpolant.call(this, e, t, i, r);
  47891. }),
  47892. (n.QuaternionLinearInterpolant.prototype = Object.assign(
  47893. Object.create(n.Interpolant.prototype),
  47894. {
  47895. constructor: n.QuaternionLinearInterpolant,
  47896. interpolate_: function (e, t, i, r) {
  47897. for (
  47898. var o = this.resultBuffer,
  47899. a = this.sampleValues,
  47900. s = this.valueSize,
  47901. l = e * s,
  47902. c = (i - t) / (r - t),
  47903. h = l + s;
  47904. l !== h;
  47905. l += 4
  47906. )
  47907. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  47908. return o;
  47909. },
  47910. }
  47911. )),
  47912. (n.Clock = function (e) {
  47913. (this.autoStart = void 0 === e || e),
  47914. (this.startTime = 0),
  47915. (this.oldTime = 0),
  47916. (this.elapsedTime = 0),
  47917. (this.running = !1);
  47918. }),
  47919. (n.Clock.prototype = {
  47920. constructor: n.Clock,
  47921. start: function () {
  47922. (this.startTime = performance.now()),
  47923. (this.oldTime = this.startTime),
  47924. (this.running = !0);
  47925. },
  47926. stop: function () {
  47927. this.getElapsedTime(), (this.running = !1);
  47928. },
  47929. getElapsedTime: function () {
  47930. return this.getDelta(), this.elapsedTime;
  47931. },
  47932. getDelta: function () {
  47933. var e = 0;
  47934. if ((this.autoStart && !this.running && this.start(), this.running)) {
  47935. var t = performance.now();
  47936. (e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e);
  47937. }
  47938. return e;
  47939. },
  47940. }),
  47941. (n.EventDispatcher = function () {}),
  47942. (n.EventDispatcher.prototype = {
  47943. constructor: n.EventDispatcher,
  47944. apply: function (e) {
  47945. (e.addEventListener = n.EventDispatcher.prototype.addEventListener),
  47946. (e.hasEventListener = n.EventDispatcher.prototype.hasEventListener),
  47947. (e.removeEventListener = n.EventDispatcher.prototype.removeEventListener),
  47948. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent);
  47949. },
  47950. addEventListener: function (e, t) {
  47951. void 0 === this._listeners && (this._listeners = {});
  47952. var i = this._listeners;
  47953. void 0 === i[e] && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t);
  47954. },
  47955. hasEventListener: function (e, t) {
  47956. if (void 0 === this._listeners) return !1;
  47957. var i = this._listeners;
  47958. return void 0 !== i[e] && i[e].indexOf(t) !== -1;
  47959. },
  47960. removeEventListener: function (e, t) {
  47961. if (void 0 !== this._listeners) {
  47962. var i = this._listeners,
  47963. n = i[e];
  47964. if (void 0 !== n) {
  47965. var r = n.indexOf(t);
  47966. r !== -1 && n.splice(r, 1);
  47967. }
  47968. }
  47969. },
  47970. dispatchEvent: function (e) {
  47971. if (void 0 !== this._listeners) {
  47972. var t = this._listeners,
  47973. i = t[e.type];
  47974. if (void 0 !== i) {
  47975. e.target = this;
  47976. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o];
  47977. for (var o = 0; o < r; o++) n[o].call(this, e);
  47978. }
  47979. }
  47980. },
  47981. }),
  47982. (n.Layers = function () {
  47983. this.mask = 1;
  47984. }),
  47985. (n.Layers.prototype = {
  47986. constructor: n.Layers,
  47987. set: function (e) {
  47988. this.mask = 1 << e;
  47989. },
  47990. enable: function (e) {
  47991. this.mask |= 1 << e;
  47992. },
  47993. toggle: function (e) {
  47994. this.mask ^= 1 << e;
  47995. },
  47996. disable: function (e) {
  47997. this.mask &= ~(1 << e);
  47998. },
  47999. test: function (e) {
  48000. return 0 !== (this.mask & e.mask);
  48001. },
  48002. }),
  48003. (function (e) {
  48004. function t(e, t) {
  48005. return e.distance - t.distance;
  48006. }
  48007. function i(e, t, n, r) {
  48008. if (e.visible !== !1 && (e.raycast(t, n), r === !0))
  48009. for (var o = e.children, a = 0, s = o.length; a < s; a++) i(o[a], t, n, !0);
  48010. }
  48011. (e.Raycaster = function (t, i, n, r) {
  48012. (this.ray = new e.Ray(t, i)),
  48013. (this.near = n || 0),
  48014. (this.far = r || 1 / 0),
  48015. (this.params = {
  48016. Mesh: {},
  48017. Line: {},
  48018. LOD: {},
  48019. Points: {
  48020. threshold: 1,
  48021. },
  48022. Sprite: {},
  48023. }),
  48024. Object.defineProperties(this.params, {
  48025. PointCloud: {
  48026. get: function () {
  48027. return (
  48028. console.warn(
  48029. 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.'
  48030. ),
  48031. this.Points
  48032. );
  48033. },
  48034. },
  48035. });
  48036. }),
  48037. (e.Raycaster.prototype = {
  48038. constructor: e.Raycaster,
  48039. linePrecision: 1,
  48040. set: function (e, t) {
  48041. this.ray.set(e, t);
  48042. },
  48043. setFromCamera: function (t, i) {
  48044. i instanceof e.PerspectiveCamera
  48045. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  48046. this.ray.direction
  48047. .set(t.x, t.y, 0.5)
  48048. .unproject(i)
  48049. .sub(this.ray.origin)
  48050. .normalize())
  48051. : i instanceof e.OrthographicCamera
  48052. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  48053. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld))
  48054. : console.error('THREE.Raycaster: Unsupported camera type.');
  48055. },
  48056. intersectObject: function (e, n) {
  48057. var r = [];
  48058. return i(e, this, r, n), r.sort(t), r;
  48059. },
  48060. intersectObjects: function (e, n) {
  48061. var r = [];
  48062. if (Array.isArray(e) === !1)
  48063. return (
  48064. console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), r
  48065. );
  48066. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n);
  48067. return r.sort(t), r;
  48068. },
  48069. });
  48070. })(n),
  48071. (n.Object3D = function () {
  48072. function e() {
  48073. o.setFromEuler(r, !1);
  48074. }
  48075. function t() {
  48076. r.setFromQuaternion(o, void 0, !1);
  48077. }
  48078. Object.defineProperty(this, 'id', {
  48079. value: n.Object3DIdCount++,
  48080. }),
  48081. (this.uuid = n.Math.generateUUID()),
  48082. (this.name = ''),
  48083. (this.type = 'Object3D'),
  48084. (this.parent = null),
  48085. (this.children = []),
  48086. (this.up = n.Object3D.DefaultUp.clone());
  48087. var i = new n.Vector3(),
  48088. r = new n.Euler(),
  48089. o = new n.Quaternion(),
  48090. a = new n.Vector3(1, 1, 1);
  48091. r.onChange(e),
  48092. o.onChange(t),
  48093. Object.defineProperties(this, {
  48094. position: {
  48095. enumerable: !0,
  48096. value: i,
  48097. },
  48098. rotation: {
  48099. enumerable: !0,
  48100. value: r,
  48101. },
  48102. quaternion: {
  48103. enumerable: !0,
  48104. value: o,
  48105. },
  48106. scale: {
  48107. enumerable: !0,
  48108. value: a,
  48109. },
  48110. modelViewMatrix: {
  48111. value: new n.Matrix4(),
  48112. },
  48113. normalMatrix: {
  48114. value: new n.Matrix3(),
  48115. },
  48116. }),
  48117. (this.rotationAutoUpdate = !0),
  48118. (this.matrix = new n.Matrix4()),
  48119. (this.matrixWorld = new n.Matrix4()),
  48120. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  48121. (this.matrixWorldNeedsUpdate = !1),
  48122. (this.layers = new n.Layers()),
  48123. (this.visible = !0),
  48124. (this.castShadow = !1),
  48125. (this.receiveShadow = !1),
  48126. (this.frustumCulled = !0),
  48127. (this.renderOrder = 0),
  48128. (this.userData = {});
  48129. }),
  48130. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  48131. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  48132. (n.Object3D.prototype = {
  48133. constructor: n.Object3D,
  48134. applyMatrix: function (e) {
  48135. this.matrix.multiplyMatrices(e, this.matrix),
  48136. this.matrix.decompose(this.position, this.quaternion, this.scale);
  48137. },
  48138. setRotationFromAxisAngle: function (e, t) {
  48139. this.quaternion.setFromAxisAngle(e, t);
  48140. },
  48141. setRotationFromEuler: function (e) {
  48142. this.quaternion.setFromEuler(e, !0);
  48143. },
  48144. setRotationFromMatrix: function (e) {
  48145. this.quaternion.setFromRotationMatrix(e);
  48146. },
  48147. setRotationFromQuaternion: function (e) {
  48148. this.quaternion.copy(e);
  48149. },
  48150. rotateOnAxis: (function () {
  48151. var e = new n.Quaternion();
  48152. return function (t, i) {
  48153. return e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this;
  48154. };
  48155. })(),
  48156. rotateX: (function () {
  48157. var e = new n.Vector3(1, 0, 0);
  48158. return function (t) {
  48159. return this.rotateOnAxis(e, t);
  48160. };
  48161. })(),
  48162. rotateY: (function () {
  48163. var e = new n.Vector3(0, 1, 0);
  48164. return function (t) {
  48165. return this.rotateOnAxis(e, t);
  48166. };
  48167. })(),
  48168. rotateZ: (function () {
  48169. var e = new n.Vector3(0, 0, 1);
  48170. return function (t) {
  48171. return this.rotateOnAxis(e, t);
  48172. };
  48173. })(),
  48174. translateOnAxis: (function () {
  48175. var e = new n.Vector3();
  48176. return function (t, i) {
  48177. return (
  48178. e.copy(t).applyQuaternion(this.quaternion),
  48179. this.position.add(e.multiplyScalar(i)),
  48180. this
  48181. );
  48182. };
  48183. })(),
  48184. translateX: (function () {
  48185. var e = new n.Vector3(1, 0, 0);
  48186. return function (t) {
  48187. return this.translateOnAxis(e, t);
  48188. };
  48189. })(),
  48190. translateY: (function () {
  48191. var e = new n.Vector3(0, 1, 0);
  48192. return function (t) {
  48193. return this.translateOnAxis(e, t);
  48194. };
  48195. })(),
  48196. translateZ: (function () {
  48197. var e = new n.Vector3(0, 0, 1);
  48198. return function (t) {
  48199. return this.translateOnAxis(e, t);
  48200. };
  48201. })(),
  48202. localToWorld: function (e) {
  48203. return e.applyMatrix4(this.matrixWorld);
  48204. },
  48205. worldToLocal: (function () {
  48206. var e = new n.Matrix4();
  48207. return function (t) {
  48208. return t.applyMatrix4(e.getInverse(this.matrixWorld));
  48209. };
  48210. })(),
  48211. lookAt: (function () {
  48212. var e = new n.Matrix4();
  48213. return function (t) {
  48214. e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e);
  48215. };
  48216. })(),
  48217. add: function (e) {
  48218. if (arguments.length > 1) {
  48219. for (var t = 0; t < arguments.length; t++) this.add(arguments[t]);
  48220. return this;
  48221. }
  48222. return e === this
  48223. ? (console.error(
  48224. "THREE.Object3D.add: object can't be added as a child of itself.",
  48225. e
  48226. ),
  48227. this)
  48228. : (e instanceof n.Object3D
  48229. ? (null !== e.parent && e.parent.remove(e),
  48230. (e.parent = this),
  48231. e.dispatchEvent({
  48232. type: 'added',
  48233. }),
  48234. this.children.push(e))
  48235. : console.error(
  48236. 'THREE.Object3D.add: object not an instance of THREE.Object3D.',
  48237. e
  48238. ),
  48239. this);
  48240. },
  48241. remove: function (e) {
  48242. if (arguments.length > 1)
  48243. for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]);
  48244. var i = this.children.indexOf(e);
  48245. i !== -1 &&
  48246. ((e.parent = null),
  48247. e.dispatchEvent({
  48248. type: 'removed',
  48249. }),
  48250. this.children.splice(i, 1));
  48251. },
  48252. getObjectById: function (e) {
  48253. return this.getObjectByProperty('id', e);
  48254. },
  48255. getObjectByName: function (e) {
  48256. return this.getObjectByProperty('name', e);
  48257. },
  48258. getObjectByProperty: function (e, t) {
  48259. if (this[e] === t) return this;
  48260. for (var i = 0, n = this.children.length; i < n; i++) {
  48261. var r = this.children[i],
  48262. o = r.getObjectByProperty(e, t);
  48263. if (void 0 !== o) return o;
  48264. }
  48265. },
  48266. getWorldPosition: function (e) {
  48267. var t = e || new n.Vector3();
  48268. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld);
  48269. },
  48270. getWorldQuaternion: (function () {
  48271. var e = new n.Vector3(),
  48272. t = new n.Vector3();
  48273. return function (i) {
  48274. var r = i || new n.Quaternion();
  48275. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r;
  48276. };
  48277. })(),
  48278. getWorldRotation: (function () {
  48279. var e = new n.Quaternion();
  48280. return function (t) {
  48281. var i = t || new n.Euler();
  48282. return this.getWorldQuaternion(e), i.setFromQuaternion(e, this.rotation.order, !1);
  48283. };
  48284. })(),
  48285. getWorldScale: (function () {
  48286. var e = new n.Vector3(),
  48287. t = new n.Quaternion();
  48288. return function (i) {
  48289. var r = i || new n.Vector3();
  48290. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r;
  48291. };
  48292. })(),
  48293. getWorldDirection: (function () {
  48294. var e = new n.Quaternion();
  48295. return function (t) {
  48296. var i = t || new n.Vector3();
  48297. return this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e);
  48298. };
  48299. })(),
  48300. raycast: function () {},
  48301. traverse: function (e) {
  48302. e(this);
  48303. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e);
  48304. },
  48305. traverseVisible: function (e) {
  48306. if (this.visible !== !1) {
  48307. e(this);
  48308. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  48309. t[i].traverseVisible(e);
  48310. }
  48311. },
  48312. traverseAncestors: function (e) {
  48313. var t = this.parent;
  48314. null !== t && (e(t), t.traverseAncestors(e));
  48315. },
  48316. updateMatrix: function () {
  48317. this.matrix.compose(this.position, this.quaternion, this.scale),
  48318. (this.matrixWorldNeedsUpdate = !0);
  48319. },
  48320. updateMatrixWorld: function (e) {
  48321. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  48322. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  48323. (null === this.parent
  48324. ? this.matrixWorld.copy(this.matrix)
  48325. : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  48326. (this.matrixWorldNeedsUpdate = !1),
  48327. (e = !0));
  48328. for (var t = 0, i = this.children.length; t < i; t++)
  48329. this.children[t].updateMatrixWorld(e);
  48330. },
  48331. toJSON: function (e) {
  48332. function t(e) {
  48333. var t = [];
  48334. for (var i in e) {
  48335. var n = e[i];
  48336. delete n.metadata, t.push(n);
  48337. }
  48338. return t;
  48339. }
  48340. var i = void 0 === e,
  48341. n = {};
  48342. i &&
  48343. ((e = {
  48344. geometries: {},
  48345. materials: {},
  48346. textures: {},
  48347. images: {},
  48348. }),
  48349. (n.metadata = {
  48350. version: 4.4,
  48351. type: 'Object',
  48352. generator: 'Object3D.toJSON',
  48353. }));
  48354. var r = {};
  48355. if (
  48356. ((r.uuid = this.uuid),
  48357. (r.type = this.type),
  48358. '' !== this.name && (r.name = this.name),
  48359. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  48360. this.castShadow === !0 && (r.castShadow = !0),
  48361. this.receiveShadow === !0 && (r.receiveShadow = !0),
  48362. this.visible === !1 && (r.visible = !1),
  48363. (r.matrix = this.matrix.toArray()),
  48364. void 0 !== this.geometry &&
  48365. (void 0 === e.geometries[this.geometry.uuid] &&
  48366. (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  48367. (r.geometry = this.geometry.uuid)),
  48368. void 0 !== this.material &&
  48369. (void 0 === e.materials[this.material.uuid] &&
  48370. (e.materials[this.material.uuid] = this.material.toJSON(e)),
  48371. (r.material = this.material.uuid)),
  48372. this.children.length > 0)
  48373. ) {
  48374. r.children = [];
  48375. for (var o = 0; o < this.children.length; o++)
  48376. r.children.push(this.children[o].toJSON(e).object);
  48377. }
  48378. if (i) {
  48379. var a = t(e.geometries),
  48380. s = t(e.materials),
  48381. l = t(e.textures),
  48382. c = t(e.images);
  48383. a.length > 0 && (n.geometries = a),
  48384. s.length > 0 && (n.materials = s),
  48385. l.length > 0 && (n.textures = l),
  48386. c.length > 0 && (n.images = c);
  48387. }
  48388. return (n.object = r), n;
  48389. },
  48390. clone: function (e) {
  48391. return new this.constructor().copy(this, e);
  48392. },
  48393. copy: function (e, t) {
  48394. if (
  48395. (void 0 === t && (t = !0),
  48396. (this.name = e.name),
  48397. this.up.copy(e.up),
  48398. this.position.copy(e.position),
  48399. this.quaternion.copy(e.quaternion),
  48400. this.scale.copy(e.scale),
  48401. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  48402. this.matrix.copy(e.matrix),
  48403. this.matrixWorld.copy(e.matrixWorld),
  48404. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  48405. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  48406. (this.visible = e.visible),
  48407. (this.castShadow = e.castShadow),
  48408. (this.receiveShadow = e.receiveShadow),
  48409. (this.frustumCulled = e.frustumCulled),
  48410. (this.renderOrder = e.renderOrder),
  48411. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  48412. t === !0)
  48413. )
  48414. for (var i = 0; i < e.children.length; i++) {
  48415. var n = e.children[i];
  48416. this.add(n.clone());
  48417. }
  48418. return this;
  48419. },
  48420. }),
  48421. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  48422. (n.Object3DIdCount = 0),
  48423. (n.Face3 = function (e, t, i, r, o, a) {
  48424. (this.a = e),
  48425. (this.b = t),
  48426. (this.c = i),
  48427. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  48428. (this.vertexNormals = Array.isArray(r) ? r : []),
  48429. (this.color = o instanceof n.Color ? o : new n.Color()),
  48430. (this.vertexColors = Array.isArray(o) ? o : []),
  48431. (this.materialIndex = void 0 !== a ? a : 0);
  48432. }),
  48433. (n.Face3.prototype = {
  48434. constructor: n.Face3,
  48435. clone: function () {
  48436. return new this.constructor().copy(this);
  48437. },
  48438. copy: function (e) {
  48439. (this.a = e.a),
  48440. (this.b = e.b),
  48441. (this.c = e.c),
  48442. this.normal.copy(e.normal),
  48443. this.color.copy(e.color),
  48444. (this.materialIndex = e.materialIndex);
  48445. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  48446. this.vertexNormals[t] = e.vertexNormals[t].clone();
  48447. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  48448. this.vertexColors[t] = e.vertexColors[t].clone();
  48449. return this;
  48450. },
  48451. }),
  48452. (n.BufferAttribute = function (e, t) {
  48453. (this.uuid = n.Math.generateUUID()),
  48454. (this.array = e),
  48455. (this.itemSize = t),
  48456. (this.dynamic = !1),
  48457. (this.updateRange = {
  48458. offset: 0,
  48459. count: -1,
  48460. }),
  48461. (this.version = 0);
  48462. }),
  48463. (n.BufferAttribute.prototype = {
  48464. constructor: n.BufferAttribute,
  48465. get count() {
  48466. return this.array.length / this.itemSize;
  48467. },
  48468. set needsUpdate(e) {
  48469. e === !0 && this.version++;
  48470. },
  48471. setDynamic: function (e) {
  48472. return (this.dynamic = e), this;
  48473. },
  48474. copy: function (e) {
  48475. return (
  48476. (this.array = new e.array.constructor(e.array)),
  48477. (this.itemSize = e.itemSize),
  48478. (this.dynamic = e.dynamic),
  48479. this
  48480. );
  48481. },
  48482. copyAt: function (e, t, i) {
  48483. (e *= this.itemSize), (i *= t.itemSize);
  48484. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n];
  48485. return this;
  48486. },
  48487. copyArray: function (e) {
  48488. return this.array.set(e), this;
  48489. },
  48490. copyColorsArray: function (e) {
  48491. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48492. var a = e[r];
  48493. void 0 === a &&
  48494. (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', r),
  48495. (a = new n.Color())),
  48496. (t[i++] = a.r),
  48497. (t[i++] = a.g),
  48498. (t[i++] = a.b);
  48499. }
  48500. return this;
  48501. },
  48502. copyIndicesArray: function (e) {
  48503. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  48504. var o = e[n];
  48505. (t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c);
  48506. }
  48507. return this;
  48508. },
  48509. copyVector2sArray: function (e) {
  48510. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48511. var a = e[r];
  48512. void 0 === a &&
  48513. (console.warn(
  48514. 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined',
  48515. r
  48516. ),
  48517. (a = new n.Vector2())),
  48518. (t[i++] = a.x),
  48519. (t[i++] = a.y);
  48520. }
  48521. return this;
  48522. },
  48523. copyVector3sArray: function (e) {
  48524. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48525. var a = e[r];
  48526. void 0 === a &&
  48527. (console.warn(
  48528. 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined',
  48529. r
  48530. ),
  48531. (a = new n.Vector3())),
  48532. (t[i++] = a.x),
  48533. (t[i++] = a.y),
  48534. (t[i++] = a.z);
  48535. }
  48536. return this;
  48537. },
  48538. copyVector4sArray: function (e) {
  48539. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48540. var a = e[r];
  48541. void 0 === a &&
  48542. (console.warn(
  48543. 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined',
  48544. r
  48545. ),
  48546. (a = new n.Vector4())),
  48547. (t[i++] = a.x),
  48548. (t[i++] = a.y),
  48549. (t[i++] = a.z),
  48550. (t[i++] = a.w);
  48551. }
  48552. return this;
  48553. },
  48554. set: function (e, t) {
  48555. return void 0 === t && (t = 0), this.array.set(e, t), this;
  48556. },
  48557. getX: function (e) {
  48558. return this.array[e * this.itemSize];
  48559. },
  48560. setX: function (e, t) {
  48561. return (this.array[e * this.itemSize] = t), this;
  48562. },
  48563. getY: function (e) {
  48564. return this.array[e * this.itemSize + 1];
  48565. },
  48566. setY: function (e, t) {
  48567. return (this.array[e * this.itemSize + 1] = t), this;
  48568. },
  48569. getZ: function (e) {
  48570. return this.array[e * this.itemSize + 2];
  48571. },
  48572. setZ: function (e, t) {
  48573. return (this.array[e * this.itemSize + 2] = t), this;
  48574. },
  48575. getW: function (e) {
  48576. return this.array[e * this.itemSize + 3];
  48577. },
  48578. setW: function (e, t) {
  48579. return (this.array[e * this.itemSize + 3] = t), this;
  48580. },
  48581. setXY: function (e, t, i) {
  48582. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this;
  48583. },
  48584. setXYZ: function (e, t, i, n) {
  48585. return (
  48586. (e *= this.itemSize),
  48587. (this.array[e + 0] = t),
  48588. (this.array[e + 1] = i),
  48589. (this.array[e + 2] = n),
  48590. this
  48591. );
  48592. },
  48593. setXYZW: function (e, t, i, n, r) {
  48594. return (
  48595. (e *= this.itemSize),
  48596. (this.array[e + 0] = t),
  48597. (this.array[e + 1] = i),
  48598. (this.array[e + 2] = n),
  48599. (this.array[e + 3] = r),
  48600. this
  48601. );
  48602. },
  48603. clone: function () {
  48604. return new this.constructor().copy(this);
  48605. },
  48606. }),
  48607. (n.Int8Attribute = function (e, t) {
  48608. return new n.BufferAttribute(new Int8Array(e), t);
  48609. }),
  48610. (n.Uint8Attribute = function (e, t) {
  48611. return new n.BufferAttribute(new Uint8Array(e), t);
  48612. }),
  48613. (n.Uint8ClampedAttribute = function (e, t) {
  48614. return new n.BufferAttribute(new Uint8ClampedArray(e), t);
  48615. }),
  48616. (n.Int16Attribute = function (e, t) {
  48617. return new n.BufferAttribute(new Int16Array(e), t);
  48618. }),
  48619. (n.Uint16Attribute = function (e, t) {
  48620. return new n.BufferAttribute(new Uint16Array(e), t);
  48621. });
  48622. n.Int32Attribute = function (e, t) {
  48623. return new n.BufferAttribute(new Int32Array(e), t);
  48624. };
  48625. (n.Uint32Attribute = function (e, t) {
  48626. return new n.BufferAttribute(new Uint32Array(e), t);
  48627. }),
  48628. (n.Float32Attribute = function (e, t) {
  48629. return new n.BufferAttribute(new Float32Array(e), t);
  48630. }),
  48631. (n.Float64Attribute = function (e, t) {
  48632. return new n.BufferAttribute(new Float64Array(e), t);
  48633. }),
  48634. (n.DynamicBufferAttribute = function (e, t) {
  48635. return (
  48636. console.warn(
  48637. 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'
  48638. ),
  48639. new n.BufferAttribute(e, t).setDynamic(!0)
  48640. );
  48641. }),
  48642. (n.InstancedBufferAttribute = function (e, t, i) {
  48643. n.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1);
  48644. }),
  48645. (n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype)),
  48646. (n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute),
  48647. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  48648. return (
  48649. n.BufferAttribute.prototype.copy.call(this, e),
  48650. (this.meshPerAttribute = e.meshPerAttribute),
  48651. this
  48652. );
  48653. }),
  48654. (n.InterleavedBuffer = function (e, t) {
  48655. (this.uuid = n.Math.generateUUID()),
  48656. (this.array = e),
  48657. (this.stride = t),
  48658. (this.dynamic = !1),
  48659. (this.updateRange = {
  48660. offset: 0,
  48661. count: -1,
  48662. }),
  48663. (this.version = 0);
  48664. }),
  48665. (n.InterleavedBuffer.prototype = {
  48666. constructor: n.InterleavedBuffer,
  48667. get length() {
  48668. return this.array.length;
  48669. },
  48670. get count() {
  48671. return this.array.length / this.stride;
  48672. },
  48673. set needsUpdate(e) {
  48674. e === !0 && this.version++;
  48675. },
  48676. setDynamic: function (e) {
  48677. return (this.dynamic = e), this;
  48678. },
  48679. copy: function (e) {
  48680. return (
  48681. (this.array = new e.array.constructor(e.array)),
  48682. (this.stride = e.stride),
  48683. (this.dynamic = e.dynamic),
  48684. this
  48685. );
  48686. },
  48687. copyAt: function (e, t, i) {
  48688. (e *= this.stride), (i *= t.stride);
  48689. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n];
  48690. return this;
  48691. },
  48692. set: function (e, t) {
  48693. return void 0 === t && (t = 0), this.array.set(e, t), this;
  48694. },
  48695. clone: function () {
  48696. return new this.constructor().copy(this);
  48697. },
  48698. }),
  48699. (n.InstancedInterleavedBuffer = function (e, t, i) {
  48700. n.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1);
  48701. }),
  48702. (n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype)),
  48703. (n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer),
  48704. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  48705. return (
  48706. n.InterleavedBuffer.prototype.copy.call(this, e),
  48707. (this.meshPerAttribute = e.meshPerAttribute),
  48708. this
  48709. );
  48710. }),
  48711. (n.InterleavedBufferAttribute = function (e, t, i) {
  48712. (this.uuid = n.Math.generateUUID()),
  48713. (this.data = e),
  48714. (this.itemSize = t),
  48715. (this.offset = i);
  48716. }),
  48717. (n.InterleavedBufferAttribute.prototype = {
  48718. constructor: n.InterleavedBufferAttribute,
  48719. get length() {
  48720. return (
  48721. console.warn(
  48722. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  48723. ),
  48724. this.array.length
  48725. );
  48726. },
  48727. get count() {
  48728. return this.data.count;
  48729. },
  48730. setX: function (e, t) {
  48731. return (this.data.array[e * this.data.stride + this.offset] = t), this;
  48732. },
  48733. setY: function (e, t) {
  48734. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this;
  48735. },
  48736. setZ: function (e, t) {
  48737. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this;
  48738. },
  48739. setW: function (e, t) {
  48740. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this;
  48741. },
  48742. getX: function (e) {
  48743. return this.data.array[e * this.data.stride + this.offset];
  48744. },
  48745. getY: function (e) {
  48746. return this.data.array[e * this.data.stride + this.offset + 1];
  48747. },
  48748. getZ: function (e) {
  48749. return this.data.array[e * this.data.stride + this.offset + 2];
  48750. },
  48751. getW: function (e) {
  48752. return this.data.array[e * this.data.stride + this.offset + 3];
  48753. },
  48754. setXY: function (e, t, i) {
  48755. return (
  48756. (e = e * this.data.stride + this.offset),
  48757. (this.data.array[e + 0] = t),
  48758. (this.data.array[e + 1] = i),
  48759. this
  48760. );
  48761. },
  48762. setXYZ: function (e, t, i, n) {
  48763. return (
  48764. (e = e * this.data.stride + this.offset),
  48765. (this.data.array[e + 0] = t),
  48766. (this.data.array[e + 1] = i),
  48767. (this.data.array[e + 2] = n),
  48768. this
  48769. );
  48770. },
  48771. setXYZW: function (e, t, i, n, r) {
  48772. return (
  48773. (e = e * this.data.stride + this.offset),
  48774. (this.data.array[e + 0] = t),
  48775. (this.data.array[e + 1] = i),
  48776. (this.data.array[e + 2] = n),
  48777. (this.data.array[e + 3] = r),
  48778. this
  48779. );
  48780. },
  48781. }),
  48782. (n.Geometry = function () {
  48783. Object.defineProperty(this, 'id', {
  48784. value: n.GeometryIdCount++,
  48785. }),
  48786. (this.uuid = n.Math.generateUUID()),
  48787. (this.name = ''),
  48788. (this.type = 'Geometry'),
  48789. (this.vertices = []),
  48790. (this.colors = []),
  48791. (this.faces = []),
  48792. (this.faceVertexUvs = [[]]),
  48793. (this.morphTargets = []),
  48794. (this.morphNormals = []),
  48795. (this.skinWeights = []),
  48796. (this.skinIndices = []),
  48797. (this.lineDistances = []),
  48798. (this.boundingBox = null),
  48799. (this.boundingSphere = null),
  48800. (this.verticesNeedUpdate = !1),
  48801. (this.elementsNeedUpdate = !1),
  48802. (this.uvsNeedUpdate = !1),
  48803. (this.normalsNeedUpdate = !1),
  48804. (this.colorsNeedUpdate = !1),
  48805. (this.lineDistancesNeedUpdate = !1),
  48806. (this.groupsNeedUpdate = !1);
  48807. }),
  48808. (n.Geometry.prototype = {
  48809. constructor: n.Geometry,
  48810. applyMatrix: function (e) {
  48811. for (
  48812. var t = new n.Matrix3().getNormalMatrix(e), i = 0, r = this.vertices.length;
  48813. i < r;
  48814. i++
  48815. ) {
  48816. var o = this.vertices[i];
  48817. o.applyMatrix4(e);
  48818. }
  48819. for (var i = 0, r = this.faces.length; i < r; i++) {
  48820. var a = this.faces[i];
  48821. a.normal.applyMatrix3(t).normalize();
  48822. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  48823. a.vertexNormals[s].applyMatrix3(t).normalize();
  48824. }
  48825. return (
  48826. null !== this.boundingBox && this.computeBoundingBox(),
  48827. null !== this.boundingSphere && this.computeBoundingSphere(),
  48828. (this.verticesNeedUpdate = !0),
  48829. (this.normalsNeedUpdate = !0),
  48830. this
  48831. );
  48832. },
  48833. rotateX: (function () {
  48834. var e;
  48835. return function (t) {
  48836. return (
  48837. void 0 === e && (e = new n.Matrix4()),
  48838. e.makeRotationX(t),
  48839. this.applyMatrix(e),
  48840. this
  48841. );
  48842. };
  48843. })(),
  48844. rotateY: (function () {
  48845. var e;
  48846. return function (t) {
  48847. return (
  48848. void 0 === e && (e = new n.Matrix4()),
  48849. e.makeRotationY(t),
  48850. this.applyMatrix(e),
  48851. this
  48852. );
  48853. };
  48854. })(),
  48855. rotateZ: (function () {
  48856. var e;
  48857. return function (t) {
  48858. return (
  48859. void 0 === e && (e = new n.Matrix4()),
  48860. e.makeRotationZ(t),
  48861. this.applyMatrix(e),
  48862. this
  48863. );
  48864. };
  48865. })(),
  48866. translate: (function () {
  48867. var e;
  48868. return function (t, i, r) {
  48869. return (
  48870. void 0 === e && (e = new n.Matrix4()),
  48871. e.makeTranslation(t, i, r),
  48872. this.applyMatrix(e),
  48873. this
  48874. );
  48875. };
  48876. })(),
  48877. scale: (function () {
  48878. var e;
  48879. return function (t, i, r) {
  48880. return (
  48881. void 0 === e && (e = new n.Matrix4()),
  48882. e.makeScale(t, i, r),
  48883. this.applyMatrix(e),
  48884. this
  48885. );
  48886. };
  48887. })(),
  48888. lookAt: (function () {
  48889. var e;
  48890. return function (t) {
  48891. void 0 === e && (e = new n.Object3D()),
  48892. e.lookAt(t),
  48893. e.updateMatrix(),
  48894. this.applyMatrix(e.matrix);
  48895. };
  48896. })(),
  48897. fromBufferGeometry: function (e) {
  48898. function t(e, t, r, o) {
  48899. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : [],
  48900. f =
  48901. void 0 !== l
  48902. ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()]
  48903. : [],
  48904. g = new n.Face3(e, t, r, a, f, o);
  48905. i.faces.push(g),
  48906. void 0 !== c &&
  48907. i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  48908. void 0 !== h &&
  48909. i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()]);
  48910. }
  48911. var i = this,
  48912. r = null !== e.index ? e.index.array : void 0,
  48913. o = e.attributes,
  48914. a = o.position.array,
  48915. s = void 0 !== o.normal ? o.normal.array : void 0,
  48916. l = void 0 !== o.color ? o.color.array : void 0,
  48917. c = void 0 !== o.uv ? o.uv.array : void 0,
  48918. h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  48919. void 0 !== h && (this.faceVertexUvs[1] = []);
  48920. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3, g += 2)
  48921. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  48922. void 0 !== s && u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  48923. void 0 !== l && i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  48924. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  48925. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]));
  48926. if (void 0 !== r) {
  48927. var m = e.groups;
  48928. if (m.length > 0)
  48929. for (var f = 0; f < m.length; f++)
  48930. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  48931. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  48932. else for (var f = 0; f < r.length; f += 3) t(r[f], r[f + 1], r[f + 2]);
  48933. } else for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2);
  48934. return (
  48935. this.computeFaceNormals(),
  48936. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  48937. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  48938. this
  48939. );
  48940. },
  48941. center: function () {
  48942. this.computeBoundingBox();
  48943. var e = this.boundingBox.center().negate();
  48944. return this.translate(e.x, e.y, e.z), e;
  48945. },
  48946. normalize: function () {
  48947. this.computeBoundingSphere();
  48948. var e = this.boundingSphere.center,
  48949. t = this.boundingSphere.radius,
  48950. i = 0 === t ? 1 : 1 / t,
  48951. r = new n.Matrix4();
  48952. return (
  48953. r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  48954. this.applyMatrix(r),
  48955. this
  48956. );
  48957. },
  48958. computeFaceNormals: function () {
  48959. for (
  48960. var e = new n.Vector3(), t = new n.Vector3(), i = 0, r = this.faces.length;
  48961. i < r;
  48962. i++
  48963. ) {
  48964. var o = this.faces[i],
  48965. a = this.vertices[o.a],
  48966. s = this.vertices[o.b],
  48967. l = this.vertices[o.c];
  48968. e.subVectors(l, s), t.subVectors(a, s), e.cross(t), e.normalize(), o.normal.copy(e);
  48969. }
  48970. },
  48971. computeVertexNormals: function (e) {
  48972. void 0 === e && (e = !0);
  48973. var t, i, r, o, a, s;
  48974. for (s = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++)
  48975. s[t] = new n.Vector3();
  48976. if (e) {
  48977. var l,
  48978. c,
  48979. h,
  48980. u = new n.Vector3(),
  48981. d = new n.Vector3();
  48982. for (r = 0, o = this.faces.length; r < o; r++)
  48983. (a = this.faces[r]),
  48984. (l = this.vertices[a.a]),
  48985. (c = this.vertices[a.b]),
  48986. (h = this.vertices[a.c]),
  48987. u.subVectors(h, c),
  48988. d.subVectors(l, c),
  48989. u.cross(d),
  48990. s[a.a].add(u),
  48991. s[a.b].add(u),
  48992. s[a.c].add(u);
  48993. } else
  48994. for (r = 0, o = this.faces.length; r < o; r++)
  48995. (a = this.faces[r]),
  48996. s[a.a].add(a.normal),
  48997. s[a.b].add(a.normal),
  48998. s[a.c].add(a.normal);
  48999. for (t = 0, i = this.vertices.length; t < i; t++) s[t].normalize();
  49000. for (r = 0, o = this.faces.length; r < o; r++) {
  49001. a = this.faces[r];
  49002. var p = a.vertexNormals;
  49003. 3 === p.length
  49004. ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c]))
  49005. : ((p[0] = s[a.a].clone()), (p[1] = s[a.b].clone()), (p[2] = s[a.c].clone()));
  49006. }
  49007. this.faces.length > 0 && (this.normalsNeedUpdate = !0);
  49008. },
  49009. computeMorphNormals: function () {
  49010. var e, t, i, r, o;
  49011. for (i = 0, r = this.faces.length; i < r; i++)
  49012. for (
  49013. o = this.faces[i],
  49014. o.__originalFaceNormal
  49015. ? o.__originalFaceNormal.copy(o.normal)
  49016. : (o.__originalFaceNormal = o.normal.clone()),
  49017. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  49018. e = 0,
  49019. t = o.vertexNormals.length;
  49020. e < t;
  49021. e++
  49022. )
  49023. o.__originalVertexNormals[e]
  49024. ? o.__originalVertexNormals[e].copy(o.vertexNormals[e])
  49025. : (o.__originalVertexNormals[e] = o.vertexNormals[e].clone());
  49026. var a = new n.Geometry();
  49027. for (a.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  49028. if (!this.morphNormals[e]) {
  49029. (this.morphNormals[e] = {}),
  49030. (this.morphNormals[e].faceNormals = []),
  49031. (this.morphNormals[e].vertexNormals = []);
  49032. var s,
  49033. l,
  49034. c = this.morphNormals[e].faceNormals,
  49035. h = this.morphNormals[e].vertexNormals;
  49036. for (i = 0, r = this.faces.length; i < r; i++)
  49037. (s = new n.Vector3()),
  49038. (l = {
  49039. a: new n.Vector3(),
  49040. b: new n.Vector3(),
  49041. c: new n.Vector3(),
  49042. }),
  49043. c.push(s),
  49044. h.push(l);
  49045. }
  49046. var u = this.morphNormals[e];
  49047. (a.vertices = this.morphTargets[e].vertices),
  49048. a.computeFaceNormals(),
  49049. a.computeVertexNormals();
  49050. var s, l;
  49051. for (i = 0, r = this.faces.length; i < r; i++)
  49052. (o = this.faces[i]),
  49053. (s = u.faceNormals[i]),
  49054. (l = u.vertexNormals[i]),
  49055. s.copy(o.normal),
  49056. l.a.copy(o.vertexNormals[0]),
  49057. l.b.copy(o.vertexNormals[1]),
  49058. l.c.copy(o.vertexNormals[2]);
  49059. }
  49060. for (i = 0, r = this.faces.length; i < r; i++)
  49061. (o = this.faces[i]),
  49062. (o.normal = o.__originalFaceNormal),
  49063. (o.vertexNormals = o.__originalVertexNormals);
  49064. },
  49065. computeTangents: function () {
  49066. console.warn('THREE.Geometry: .computeTangents() has been removed.');
  49067. },
  49068. computeLineDistances: function () {
  49069. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  49070. i > 0 && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e);
  49071. },
  49072. computeBoundingBox: function () {
  49073. null === this.boundingBox && (this.boundingBox = new n.Box3()),
  49074. this.boundingBox.setFromPoints(this.vertices);
  49075. },
  49076. computeBoundingSphere: function () {
  49077. null === this.boundingSphere && (this.boundingSphere = new n.Sphere()),
  49078. this.boundingSphere.setFromPoints(this.vertices);
  49079. },
  49080. merge: function (e, t, i) {
  49081. if (e instanceof n.Geometry == !1)
  49082. return void console.error(
  49083. 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.',
  49084. e
  49085. );
  49086. var r,
  49087. o = this.vertices.length,
  49088. a = this.vertices,
  49089. s = e.vertices,
  49090. l = this.faces,
  49091. c = e.faces,
  49092. h = this.faceVertexUvs[0],
  49093. u = e.faceVertexUvs[0];
  49094. void 0 === i && (i = 0), void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t));
  49095. for (var d = 0, p = s.length; d < p; d++) {
  49096. var f = s[d],
  49097. g = f.clone();
  49098. void 0 !== t && g.applyMatrix4(t), a.push(g);
  49099. }
  49100. for (d = 0, p = c.length; d < p; d++) {
  49101. var m,
  49102. v,
  49103. A,
  49104. y = c[d],
  49105. C = y.vertexNormals,
  49106. I = y.vertexColors;
  49107. (m = new n.Face3(y.a + o, y.b + o, y.c + o)),
  49108. m.normal.copy(y.normal),
  49109. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  49110. for (var E = 0, b = C.length; E < b; E++)
  49111. (v = C[E].clone()),
  49112. void 0 !== r && v.applyMatrix3(r).normalize(),
  49113. m.vertexNormals.push(v);
  49114. m.color.copy(y.color);
  49115. for (var E = 0, b = I.length; E < b; E++)
  49116. (A = I[E]), m.vertexColors.push(A.clone());
  49117. (m.materialIndex = y.materialIndex + i), l.push(m);
  49118. }
  49119. for (d = 0, p = u.length; d < p; d++) {
  49120. var w = u[d],
  49121. _ = [];
  49122. if (void 0 !== w) {
  49123. for (var E = 0, b = w.length; E < b; E++) _.push(w[E].clone());
  49124. h.push(_);
  49125. }
  49126. }
  49127. },
  49128. mergeMesh: function (e) {
  49129. return e instanceof n.Mesh == !1
  49130. ? void console.error(
  49131. 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.',
  49132. e
  49133. )
  49134. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix));
  49135. },
  49136. mergeVertices: function () {
  49137. var e,
  49138. t,
  49139. i,
  49140. n,
  49141. r,
  49142. o,
  49143. a,
  49144. s,
  49145. l = {},
  49146. c = [],
  49147. h = [],
  49148. u = 4,
  49149. d = Math.pow(10, u);
  49150. for (i = 0, n = this.vertices.length; i < n; i++)
  49151. (e = this.vertices[i]),
  49152. (t = Math.round(e.x * d) + '_' + Math.round(e.y * d) + '_' + Math.round(e.z * d)),
  49153. void 0 === l[t]
  49154. ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1))
  49155. : (h[i] = h[l[t]]);
  49156. var p = [];
  49157. for (i = 0, n = this.faces.length; i < n; i++) {
  49158. (r = this.faces[i]),
  49159. (r.a = h[r.a]),
  49160. (r.b = h[r.b]),
  49161. (r.c = h[r.c]),
  49162. (o = [r.a, r.b, r.c]);
  49163. for (var f = -1, g = 0; g < 3; g++)
  49164. if (o[g] === o[(g + 1) % 3]) {
  49165. (f = g), p.push(i);
  49166. break;
  49167. }
  49168. }
  49169. for (i = p.length - 1; i >= 0; i--) {
  49170. var m = p[i];
  49171. for (this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++)
  49172. this.faceVertexUvs[a].splice(m, 1);
  49173. }
  49174. var v = this.vertices.length - c.length;
  49175. return (this.vertices = c), v;
  49176. },
  49177. sortFacesByMaterialIndex: function () {
  49178. function e(e, t) {
  49179. return e.materialIndex - t.materialIndex;
  49180. }
  49181. for (var t = this.faces, i = t.length, n = 0; n < i; n++) t[n]._id = n;
  49182. t.sort(e);
  49183. var r,
  49184. o,
  49185. a = this.faceVertexUvs[0],
  49186. s = this.faceVertexUvs[1];
  49187. a && a.length === i && (r = []), s && s.length === i && (o = []);
  49188. for (var n = 0; n < i; n++) {
  49189. var l = t[n]._id;
  49190. r && r.push(a[l]), o && o.push(s[l]);
  49191. }
  49192. r && (this.faceVertexUvs[0] = r), o && (this.faceVertexUvs[1] = o);
  49193. },
  49194. toJSON: function () {
  49195. function e(e, t, i) {
  49196. return i ? e | (1 << t) : e & ~(1 << t);
  49197. }
  49198. function t(e) {
  49199. var t = e.x.toString() + e.y.toString() + e.z.toString();
  49200. return void 0 !== d[t]
  49201. ? d[t]
  49202. : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t]);
  49203. }
  49204. function i(e) {
  49205. var t = e.r.toString() + e.g.toString() + e.b.toString();
  49206. return void 0 !== f[t] ? f[t] : ((f[t] = p.length), p.push(e.getHex()), f[t]);
  49207. }
  49208. function n(e) {
  49209. var t = e.x.toString() + e.y.toString();
  49210. return void 0 !== m[t] ? m[t] : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t]);
  49211. }
  49212. var r = {
  49213. metadata: {
  49214. version: 4.4,
  49215. type: 'Geometry',
  49216. generator: 'Geometry.toJSON',
  49217. },
  49218. };
  49219. if (
  49220. ((r.uuid = this.uuid),
  49221. (r.type = this.type),
  49222. '' !== this.name && (r.name = this.name),
  49223. void 0 !== this.parameters)
  49224. ) {
  49225. var o = this.parameters;
  49226. for (var a in o) void 0 !== o[a] && (r[a] = o[a]);
  49227. return r;
  49228. }
  49229. for (var s = [], l = 0; l < this.vertices.length; l++) {
  49230. var c = this.vertices[l];
  49231. s.push(c.x, c.y, c.z);
  49232. }
  49233. for (
  49234. var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0;
  49235. l < this.faces.length;
  49236. l++
  49237. ) {
  49238. var v = this.faces[l],
  49239. A = !0,
  49240. y = !1,
  49241. C = void 0 !== this.faceVertexUvs[0][l],
  49242. I = v.normal.length() > 0,
  49243. E = v.vertexNormals.length > 0,
  49244. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  49245. w = v.vertexColors.length > 0,
  49246. _ = 0;
  49247. if (
  49248. ((_ = e(_, 0, 0)),
  49249. (_ = e(_, 1, A)),
  49250. (_ = e(_, 2, y)),
  49251. (_ = e(_, 3, C)),
  49252. (_ = e(_, 4, I)),
  49253. (_ = e(_, 5, E)),
  49254. (_ = e(_, 6, b)),
  49255. (_ = e(_, 7, w)),
  49256. h.push(_),
  49257. h.push(v.a, v.b, v.c),
  49258. h.push(v.materialIndex),
  49259. C)
  49260. ) {
  49261. var T = this.faceVertexUvs[0][l];
  49262. h.push(n(T[0]), n(T[1]), n(T[2]));
  49263. }
  49264. if ((I && h.push(t(v.normal)), E)) {
  49265. var x = v.vertexNormals;
  49266. h.push(t(x[0]), t(x[1]), t(x[2]));
  49267. }
  49268. if ((b && h.push(i(v.color)), w)) {
  49269. var S = v.vertexColors;
  49270. h.push(i(S[0]), i(S[1]), i(S[2]));
  49271. }
  49272. }
  49273. return (
  49274. (r.data = {}),
  49275. (r.data.vertices = s),
  49276. (r.data.normals = u),
  49277. p.length > 0 && (r.data.colors = p),
  49278. g.length > 0 && (r.data.uvs = [g]),
  49279. (r.data.faces = h),
  49280. r
  49281. );
  49282. },
  49283. clone: function () {
  49284. return new n.Geometry().copy(this);
  49285. },
  49286. copy: function (e) {
  49287. (this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]]);
  49288. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  49289. this.vertices.push(t[i].clone());
  49290. for (var r = e.faces, i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone());
  49291. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  49292. var o = e.faceVertexUvs[i];
  49293. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  49294. for (var a = 0, s = o.length; a < s; a++) {
  49295. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  49296. var d = l[h];
  49297. c.push(d.clone());
  49298. }
  49299. this.faceVertexUvs[i].push(c);
  49300. }
  49301. }
  49302. return this;
  49303. },
  49304. dispose: function () {
  49305. this.dispatchEvent({
  49306. type: 'dispose',
  49307. });
  49308. },
  49309. }),
  49310. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  49311. (n.GeometryIdCount = 0),
  49312. (n.DirectGeometry = function () {
  49313. Object.defineProperty(this, 'id', {
  49314. value: n.GeometryIdCount++,
  49315. }),
  49316. (this.uuid = n.Math.generateUUID()),
  49317. (this.name = ''),
  49318. (this.type = 'DirectGeometry'),
  49319. (this.indices = []),
  49320. (this.vertices = []),
  49321. (this.normals = []),
  49322. (this.colors = []),
  49323. (this.uvs = []),
  49324. (this.uvs2 = []),
  49325. (this.groups = []),
  49326. (this.morphTargets = {}),
  49327. (this.skinWeights = []),
  49328. (this.skinIndices = []),
  49329. (this.boundingBox = null),
  49330. (this.boundingSphere = null),
  49331. (this.verticesNeedUpdate = !1),
  49332. (this.normalsNeedUpdate = !1),
  49333. (this.colorsNeedUpdate = !1),
  49334. (this.uvsNeedUpdate = !1),
  49335. (this.groupsNeedUpdate = !1);
  49336. }),
  49337. (n.DirectGeometry.prototype = {
  49338. constructor: n.DirectGeometry,
  49339. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  49340. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  49341. computeFaceNormals: function () {
  49342. console.warn(
  49343. 'THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.'
  49344. );
  49345. },
  49346. computeVertexNormals: function () {
  49347. console.warn(
  49348. 'THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.'
  49349. );
  49350. },
  49351. computeGroups: function (e) {
  49352. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  49353. var a = r[o];
  49354. a.materialIndex !== i &&
  49355. ((i = a.materialIndex),
  49356. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  49357. (t = {
  49358. start: 3 * o,
  49359. materialIndex: i,
  49360. }));
  49361. }
  49362. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n);
  49363. },
  49364. fromGeometry: function (e) {
  49365. var t,
  49366. i = e.faces,
  49367. r = e.vertices,
  49368. o = e.faceVertexUvs,
  49369. a = o[0] && o[0].length > 0,
  49370. s = o[1] && o[1].length > 0,
  49371. l = e.morphTargets,
  49372. c = l.length;
  49373. if (c > 0) {
  49374. t = [];
  49375. for (var h = 0; h < c; h++) t[h] = [];
  49376. this.morphTargets.position = t;
  49377. }
  49378. var u,
  49379. d = e.morphNormals,
  49380. p = d.length;
  49381. if (p > 0) {
  49382. u = [];
  49383. for (var h = 0; h < p; h++) u[h] = [];
  49384. this.morphTargets.normal = u;
  49385. }
  49386. for (
  49387. var f = e.skinIndices,
  49388. g = e.skinWeights,
  49389. m = f.length === r.length,
  49390. v = g.length === r.length,
  49391. h = 0;
  49392. h < i.length;
  49393. h++
  49394. ) {
  49395. var A = i[h];
  49396. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  49397. var y = A.vertexNormals;
  49398. if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
  49399. else {
  49400. var C = A.normal;
  49401. this.normals.push(C, C, C);
  49402. }
  49403. var I = A.vertexColors;
  49404. if (3 === I.length) this.colors.push(I[0], I[1], I[2]);
  49405. else {
  49406. var E = A.color;
  49407. this.colors.push(E, E, E);
  49408. }
  49409. if (a === !0) {
  49410. var b = o[0][h];
  49411. void 0 !== b
  49412. ? this.uvs.push(b[0], b[1], b[2])
  49413. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', h),
  49414. this.uvs.push(new n.Vector2(), new n.Vector2(), new n.Vector2()));
  49415. }
  49416. if (s === !0) {
  49417. var b = o[1][h];
  49418. void 0 !== b
  49419. ? this.uvs2.push(b[0], b[1], b[2])
  49420. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', h),
  49421. this.uvs2.push(new n.Vector2(), new n.Vector2(), new n.Vector2()));
  49422. }
  49423. for (var w = 0; w < c; w++) {
  49424. var _ = l[w].vertices;
  49425. t[w].push(_[A.a], _[A.b], _[A.c]);
  49426. }
  49427. for (var w = 0; w < p; w++) {
  49428. var T = d[w].vertexNormals[h];
  49429. u[w].push(T.a, T.b, T.c);
  49430. }
  49431. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  49432. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c]);
  49433. }
  49434. return (
  49435. this.computeGroups(e),
  49436. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  49437. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  49438. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  49439. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  49440. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  49441. this
  49442. );
  49443. },
  49444. dispose: function () {
  49445. this.dispatchEvent({
  49446. type: 'dispose',
  49447. });
  49448. },
  49449. }),
  49450. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  49451. (n.BufferGeometry = function () {
  49452. Object.defineProperty(this, 'id', {
  49453. value: n.GeometryIdCount++,
  49454. }),
  49455. (this.uuid = n.Math.generateUUID()),
  49456. (this.name = ''),
  49457. (this.type = 'BufferGeometry'),
  49458. (this.index = null),
  49459. (this.attributes = {}),
  49460. (this.morphAttributes = {}),
  49461. (this.groups = []),
  49462. (this.boundingBox = null),
  49463. (this.boundingSphere = null),
  49464. (this.drawRange = {
  49465. start: 0,
  49466. count: 1 / 0,
  49467. });
  49468. }),
  49469. (n.BufferGeometry.prototype = {
  49470. constructor: n.BufferGeometry,
  49471. getIndex: function () {
  49472. return this.index;
  49473. },
  49474. setIndex: function (e) {
  49475. this.index = e;
  49476. },
  49477. addAttribute: function (e, t) {
  49478. return t instanceof n.BufferAttribute == !1 &&
  49479. t instanceof n.InterleavedBufferAttribute == !1
  49480. ? (console.warn(
  49481. 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'
  49482. ),
  49483. void this.addAttribute(e, new n.BufferAttribute(arguments[1], arguments[2])))
  49484. : 'index' === e
  49485. ? (console.warn(
  49486. 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'
  49487. ),
  49488. void this.setIndex(t))
  49489. : ((this.attributes[e] = t), this);
  49490. },
  49491. getAttribute: function (e) {
  49492. return this.attributes[e];
  49493. },
  49494. removeAttribute: function (e) {
  49495. return delete this.attributes[e], this;
  49496. },
  49497. addGroup: function (e, t, i) {
  49498. this.groups.push({
  49499. start: e,
  49500. count: t,
  49501. materialIndex: void 0 !== i ? i : 0,
  49502. });
  49503. },
  49504. clearGroups: function () {
  49505. this.groups = [];
  49506. },
  49507. setDrawRange: function (e, t) {
  49508. (this.drawRange.start = e), (this.drawRange.count = t);
  49509. },
  49510. applyMatrix: function (e) {
  49511. var t = this.attributes.position;
  49512. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0));
  49513. var i = this.attributes.normal;
  49514. if (void 0 !== i) {
  49515. var r = new n.Matrix3().getNormalMatrix(e);
  49516. r.applyToVector3Array(i.array), (i.needsUpdate = !0);
  49517. }
  49518. return (
  49519. null !== this.boundingBox && this.computeBoundingBox(),
  49520. null !== this.boundingSphere && this.computeBoundingSphere(),
  49521. this
  49522. );
  49523. },
  49524. rotateX: (function () {
  49525. var e;
  49526. return function (t) {
  49527. return (
  49528. void 0 === e && (e = new n.Matrix4()),
  49529. e.makeRotationX(t),
  49530. this.applyMatrix(e),
  49531. this
  49532. );
  49533. };
  49534. })(),
  49535. rotateY: (function () {
  49536. var e;
  49537. return function (t) {
  49538. return (
  49539. void 0 === e && (e = new n.Matrix4()),
  49540. e.makeRotationY(t),
  49541. this.applyMatrix(e),
  49542. this
  49543. );
  49544. };
  49545. })(),
  49546. rotateZ: (function () {
  49547. var e;
  49548. return function (t) {
  49549. return (
  49550. void 0 === e && (e = new n.Matrix4()),
  49551. e.makeRotationZ(t),
  49552. this.applyMatrix(e),
  49553. this
  49554. );
  49555. };
  49556. })(),
  49557. translate: (function () {
  49558. var e;
  49559. return function (t, i, r) {
  49560. return (
  49561. void 0 === e && (e = new n.Matrix4()),
  49562. e.makeTranslation(t, i, r),
  49563. this.applyMatrix(e),
  49564. this
  49565. );
  49566. };
  49567. })(),
  49568. scale: (function () {
  49569. var e;
  49570. return function (t, i, r) {
  49571. return (
  49572. void 0 === e && (e = new n.Matrix4()),
  49573. e.makeScale(t, i, r),
  49574. this.applyMatrix(e),
  49575. this
  49576. );
  49577. };
  49578. })(),
  49579. lookAt: (function () {
  49580. var e;
  49581. return function (t) {
  49582. void 0 === e && (e = new n.Object3D()),
  49583. e.lookAt(t),
  49584. e.updateMatrix(),
  49585. this.applyMatrix(e.matrix);
  49586. };
  49587. })(),
  49588. center: function () {
  49589. this.computeBoundingBox();
  49590. var e = this.boundingBox.center().negate();
  49591. return this.translate(e.x, e.y, e.z), e;
  49592. },
  49593. setFromObject: function (e) {
  49594. var t = e.geometry;
  49595. if (e instanceof n.Points || e instanceof n.Line) {
  49596. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  49597. r = new n.Float32Attribute(3 * t.colors.length, 3);
  49598. if (
  49599. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  49600. this.addAttribute('color', r.copyColorsArray(t.colors)),
  49601. t.lineDistances && t.lineDistances.length === t.vertices.length)
  49602. ) {
  49603. var o = new n.Float32Attribute(t.lineDistances.length, 1);
  49604. this.addAttribute('lineDistance', o.copyArray(t.lineDistances));
  49605. }
  49606. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  49607. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone());
  49608. } else e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  49609. return this;
  49610. },
  49611. updateFromObject: function (e) {
  49612. var t = e.geometry;
  49613. if (e instanceof n.Mesh) {
  49614. var i = t.__directGeometry;
  49615. if (void 0 === i) return this.fromGeometry(t);
  49616. (i.verticesNeedUpdate = t.verticesNeedUpdate),
  49617. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  49618. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  49619. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  49620. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  49621. (t.verticesNeedUpdate = !1),
  49622. (t.normalsNeedUpdate = !1),
  49623. (t.colorsNeedUpdate = !1),
  49624. (t.uvsNeedUpdate = !1),
  49625. (t.groupsNeedUpdate = !1),
  49626. (t = i);
  49627. }
  49628. if (t.verticesNeedUpdate === !0) {
  49629. var r = this.attributes.position;
  49630. void 0 !== r && (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)),
  49631. (t.verticesNeedUpdate = !1);
  49632. }
  49633. if (t.normalsNeedUpdate === !0) {
  49634. var r = this.attributes.normal;
  49635. void 0 !== r && (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)),
  49636. (t.normalsNeedUpdate = !1);
  49637. }
  49638. if (t.colorsNeedUpdate === !0) {
  49639. var r = this.attributes.color;
  49640. void 0 !== r && (r.copyColorsArray(t.colors), (r.needsUpdate = !0)),
  49641. (t.colorsNeedUpdate = !1);
  49642. }
  49643. if (t.uvsNeedUpdate) {
  49644. var r = this.attributes.uv;
  49645. void 0 !== r && (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)),
  49646. (t.uvsNeedUpdate = !1);
  49647. }
  49648. if (t.lineDistancesNeedUpdate) {
  49649. var r = this.attributes.lineDistance;
  49650. void 0 !== r && (r.copyArray(t.lineDistances), (r.needsUpdate = !0)),
  49651. (t.lineDistancesNeedUpdate = !1);
  49652. }
  49653. return (
  49654. t.groupsNeedUpdate &&
  49655. (t.computeGroups(e.geometry),
  49656. (this.groups = t.groups),
  49657. (t.groupsNeedUpdate = !1)),
  49658. this
  49659. );
  49660. },
  49661. fromGeometry: function (e) {
  49662. return (
  49663. (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)),
  49664. this.fromDirectGeometry(e.__directGeometry)
  49665. );
  49666. },
  49667. fromDirectGeometry: function (e) {
  49668. var t = new Float32Array(3 * e.vertices.length);
  49669. if (
  49670. (this.addAttribute(
  49671. 'position',
  49672. new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)
  49673. ),
  49674. e.normals.length > 0)
  49675. ) {
  49676. var i = new Float32Array(3 * e.normals.length);
  49677. this.addAttribute(
  49678. 'normal',
  49679. new n.BufferAttribute(i, 3).copyVector3sArray(e.normals)
  49680. );
  49681. }
  49682. if (e.colors.length > 0) {
  49683. var r = new Float32Array(3 * e.colors.length);
  49684. this.addAttribute('color', new n.BufferAttribute(r, 3).copyColorsArray(e.colors));
  49685. }
  49686. if (e.uvs.length > 0) {
  49687. var o = new Float32Array(2 * e.uvs.length);
  49688. this.addAttribute('uv', new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs));
  49689. }
  49690. if (e.uvs2.length > 0) {
  49691. var a = new Float32Array(2 * e.uvs2.length);
  49692. this.addAttribute('uv2', new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2));
  49693. }
  49694. if (e.indices.length > 0) {
  49695. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  49696. l = new s(3 * e.indices.length);
  49697. this.setIndex(new n.BufferAttribute(l, 1).copyIndicesArray(e.indices));
  49698. }
  49699. this.groups = e.groups;
  49700. for (var c in e.morphTargets) {
  49701. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  49702. var f = u[d],
  49703. g = new n.Float32Attribute(3 * f.length, 3);
  49704. h.push(g.copyVector3sArray(f));
  49705. }
  49706. this.morphAttributes[c] = h;
  49707. }
  49708. if (e.skinIndices.length > 0) {
  49709. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4);
  49710. this.addAttribute('skinIndex', m.copyVector4sArray(e.skinIndices));
  49711. }
  49712. if (e.skinWeights.length > 0) {
  49713. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4);
  49714. this.addAttribute('skinWeight', v.copyVector4sArray(e.skinWeights));
  49715. }
  49716. return (
  49717. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  49718. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  49719. this
  49720. );
  49721. },
  49722. computeBoundingBox: (function () {
  49723. new n.Vector3();
  49724. return function () {
  49725. null === this.boundingBox && (this.boundingBox = new n.Box3());
  49726. var e = this.attributes.position.array;
  49727. e && this.boundingBox.setFromArray(e),
  49728. (void 0 !== e && 0 !== e.length) ||
  49729. (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  49730. (isNaN(this.boundingBox.min.x) ||
  49731. isNaN(this.boundingBox.min.y) ||
  49732. isNaN(this.boundingBox.min.z)) &&
  49733. console.error(
  49734. 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
  49735. this
  49736. );
  49737. };
  49738. })(),
  49739. computeBoundingSphere: (function () {
  49740. var e = new n.Box3(),
  49741. t = new n.Vector3();
  49742. return function () {
  49743. null === this.boundingSphere && (this.boundingSphere = new n.Sphere());
  49744. var i = this.attributes.position.array;
  49745. if (i) {
  49746. var r = this.boundingSphere.center;
  49747. e.setFromArray(i), e.center(r);
  49748. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  49749. t.fromArray(i, a), (o = Math.max(o, r.distanceToSquared(t)));
  49750. (this.boundingSphere.radius = Math.sqrt(o)),
  49751. isNaN(this.boundingSphere.radius) &&
  49752. console.error(
  49753. 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
  49754. this
  49755. );
  49756. }
  49757. };
  49758. })(),
  49759. computeFaceNormals: function () {},
  49760. computeVertexNormals: function () {
  49761. var e = this.index,
  49762. t = this.attributes,
  49763. i = this.groups;
  49764. if (t.position) {
  49765. var r = t.position.array;
  49766. if (void 0 === t.normal)
  49767. this.addAttribute('normal', new n.BufferAttribute(new Float32Array(r.length), 3));
  49768. else for (var o = t.normal.array, a = 0, s = o.length; a < s; a++) o[a] = 0;
  49769. var l,
  49770. c,
  49771. h,
  49772. u = t.normal.array,
  49773. d = new n.Vector3(),
  49774. p = new n.Vector3(),
  49775. f = new n.Vector3(),
  49776. g = new n.Vector3(),
  49777. m = new n.Vector3();
  49778. if (e) {
  49779. var v = e.array;
  49780. 0 === i.length && this.addGroup(0, v.length);
  49781. for (var A = 0, y = i.length; A < y; ++A)
  49782. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  49783. (l = 3 * v[a + 0]),
  49784. (c = 3 * v[a + 1]),
  49785. (h = 3 * v[a + 2]),
  49786. d.fromArray(r, l),
  49787. p.fromArray(r, c),
  49788. f.fromArray(r, h),
  49789. g.subVectors(f, p),
  49790. m.subVectors(d, p),
  49791. g.cross(m),
  49792. (u[l] += g.x),
  49793. (u[l + 1] += g.y),
  49794. (u[l + 2] += g.z),
  49795. (u[c] += g.x),
  49796. (u[c + 1] += g.y),
  49797. (u[c + 2] += g.z),
  49798. (u[h] += g.x),
  49799. (u[h + 1] += g.y),
  49800. (u[h + 2] += g.z);
  49801. } else
  49802. for (var a = 0, s = r.length; a < s; a += 9)
  49803. d.fromArray(r, a),
  49804. p.fromArray(r, a + 3),
  49805. f.fromArray(r, a + 6),
  49806. g.subVectors(f, p),
  49807. m.subVectors(d, p),
  49808. g.cross(m),
  49809. (u[a] = g.x),
  49810. (u[a + 1] = g.y),
  49811. (u[a + 2] = g.z),
  49812. (u[a + 3] = g.x),
  49813. (u[a + 4] = g.y),
  49814. (u[a + 5] = g.z),
  49815. (u[a + 6] = g.x),
  49816. (u[a + 7] = g.y),
  49817. (u[a + 8] = g.z);
  49818. this.normalizeNormals(), (t.normal.needsUpdate = !0);
  49819. }
  49820. },
  49821. merge: function (e, t) {
  49822. if (e instanceof n.BufferGeometry == !1)
  49823. return void console.error(
  49824. 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.',
  49825. e
  49826. );
  49827. void 0 === t && (t = 0);
  49828. var i = this.attributes;
  49829. for (var r in i)
  49830. if (void 0 !== e.attributes[r])
  49831. for (
  49832. var o = i[r],
  49833. a = o.array,
  49834. s = e.attributes[r],
  49835. l = s.array,
  49836. c = s.itemSize,
  49837. h = 0,
  49838. u = c * t;
  49839. h < l.length;
  49840. h++, u++
  49841. )
  49842. a[u] = l[h];
  49843. return this;
  49844. },
  49845. normalizeNormals: function () {
  49846. for (
  49847. var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length;
  49848. o < a;
  49849. o += 3
  49850. )
  49851. (e = r[o]),
  49852. (t = r[o + 1]),
  49853. (i = r[o + 2]),
  49854. (n = 1 / Math.sqrt(e * e + t * t + i * i)),
  49855. (r[o] *= n),
  49856. (r[o + 1] *= n),
  49857. (r[o + 2] *= n);
  49858. },
  49859. toNonIndexed: function () {
  49860. if (null === this.index)
  49861. return (
  49862. console.warn(
  49863. 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'
  49864. ),
  49865. this
  49866. );
  49867. var e = new n.BufferGeometry(),
  49868. t = this.index.array,
  49869. i = this.attributes;
  49870. for (var r in i) {
  49871. for (
  49872. var o = i[r],
  49873. a = o.array,
  49874. s = o.itemSize,
  49875. l = new a.constructor(t.length * s),
  49876. c = 0,
  49877. h = 0,
  49878. u = 0,
  49879. d = t.length;
  49880. u < d;
  49881. u++
  49882. ) {
  49883. c = t[u] * s;
  49884. for (var p = 0; p < s; p++) l[h++] = a[c++];
  49885. }
  49886. e.addAttribute(r, new n.BufferAttribute(l, s));
  49887. }
  49888. return e;
  49889. },
  49890. toJSON: function () {
  49891. var e = {
  49892. metadata: {
  49893. version: 4.4,
  49894. type: 'BufferGeometry',
  49895. generator: 'BufferGeometry.toJSON',
  49896. },
  49897. };
  49898. if (
  49899. ((e.uuid = this.uuid),
  49900. (e.type = this.type),
  49901. '' !== this.name && (e.name = this.name),
  49902. void 0 !== this.parameters)
  49903. ) {
  49904. var t = this.parameters;
  49905. for (var i in t) void 0 !== t[i] && (e[i] = t[i]);
  49906. return e;
  49907. }
  49908. e.data = {
  49909. attributes: {},
  49910. };
  49911. var n = this.index;
  49912. if (null !== n) {
  49913. var r = Array.prototype.slice.call(n.array);
  49914. e.data.index = {
  49915. type: n.array.constructor.name,
  49916. array: r,
  49917. };
  49918. }
  49919. var o = this.attributes;
  49920. for (var i in o) {
  49921. var a = o[i],
  49922. r = Array.prototype.slice.call(a.array);
  49923. e.data.attributes[i] = {
  49924. itemSize: a.itemSize,
  49925. type: a.array.constructor.name,
  49926. array: r,
  49927. };
  49928. }
  49929. var s = this.groups;
  49930. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  49931. var l = this.boundingSphere;
  49932. return (
  49933. null !== l &&
  49934. (e.data.boundingSphere = {
  49935. center: l.center.toArray(),
  49936. radius: l.radius,
  49937. }),
  49938. e
  49939. );
  49940. },
  49941. clone: function () {
  49942. return new n.BufferGeometry().copy(this);
  49943. },
  49944. copy: function (e) {
  49945. var t = e.index;
  49946. null !== t && this.setIndex(t.clone());
  49947. var i = e.attributes;
  49948. for (var n in i) {
  49949. var r = i[n];
  49950. this.addAttribute(n, r.clone());
  49951. }
  49952. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  49953. var l = o[a];
  49954. this.addGroup(l.start, l.count);
  49955. }
  49956. return this;
  49957. },
  49958. dispose: function () {
  49959. this.dispatchEvent({
  49960. type: 'dispose',
  49961. });
  49962. },
  49963. }),
  49964. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  49965. (n.BufferGeometry.MaxIndex = 65535),
  49966. (n.InstancedBufferGeometry = function () {
  49967. n.BufferGeometry.call(this),
  49968. (this.type = 'InstancedBufferGeometry'),
  49969. (this.maxInstancedCount = void 0);
  49970. }),
  49971. (n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  49972. (n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry),
  49973. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  49974. this.groups.push({
  49975. start: e,
  49976. count: t,
  49977. instances: i,
  49978. });
  49979. }),
  49980. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  49981. var t = e.index;
  49982. null !== t && this.setIndex(t.clone());
  49983. var i = e.attributes;
  49984. for (var n in i) {
  49985. var r = i[n];
  49986. this.addAttribute(n, r.clone());
  49987. }
  49988. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  49989. var l = o[a];
  49990. this.addGroup(l.start, l.count, l.instances);
  49991. }
  49992. return this;
  49993. }),
  49994. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  49995. (n.Uniform = function (e, t) {
  49996. (this.type = e), (this.value = t), (this.dynamic = !1);
  49997. }),
  49998. (n.Uniform.prototype = {
  49999. constructor: n.Uniform,
  50000. onUpdate: function (e) {
  50001. return (this.dynamic = !0), (this.onUpdateCallback = e), this;
  50002. },
  50003. }),
  50004. (n.AnimationClip = function (e, t, i) {
  50005. (this.name = e || n.Math.generateUUID()),
  50006. (this.tracks = i),
  50007. (this.duration = void 0 !== t ? t : -1),
  50008. this.duration < 0 && this.resetDuration(),
  50009. this.trim(),
  50010. this.optimize();
  50011. }),
  50012. (n.AnimationClip.prototype = {
  50013. constructor: n.AnimationClip,
  50014. resetDuration: function () {
  50015. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  50016. var r = this.tracks[i];
  50017. t = Math.max(t, r.times[r.times.length - 1]);
  50018. }
  50019. this.duration = t;
  50020. },
  50021. trim: function () {
  50022. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration);
  50023. return this;
  50024. },
  50025. optimize: function () {
  50026. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize();
  50027. return this;
  50028. },
  50029. }),
  50030. Object.assign(n.AnimationClip, {
  50031. parse: function (e) {
  50032. for (
  50033. var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length;
  50034. o !== a;
  50035. ++o
  50036. )
  50037. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  50038. return new n.AnimationClip(e.name, e.duration, t);
  50039. },
  50040. toJSON: function (e) {
  50041. for (
  50042. var t = [],
  50043. i = e.tracks,
  50044. r = {
  50045. name: e.name,
  50046. duration: e.duration,
  50047. tracks: t,
  50048. },
  50049. o = 0,
  50050. a = i.length;
  50051. o !== a;
  50052. ++o
  50053. )
  50054. t.push(n.KeyframeTrack.toJSON(i[o]));
  50055. return r;
  50056. },
  50057. CreateFromMorphTargetSequence: function (e, t, i) {
  50058. for (var r = t.length, o = [], a = 0; a < r; a++) {
  50059. var s = [],
  50060. l = [];
  50061. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0);
  50062. var c = n.AnimationUtils.getKeyframeOrder(s);
  50063. (s = n.AnimationUtils.sortedArray(s, 1, c)),
  50064. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  50065. 0 === s[0] && (s.push(r), l.push(l[0])),
  50066. o.push(
  50067. new n.NumberKeyframeTrack(
  50068. '.morphTargetInfluences[' + t[a].name + ']',
  50069. s,
  50070. l
  50071. ).scale(1 / i)
  50072. );
  50073. }
  50074. return new n.AnimationClip(e, -1, o);
  50075. },
  50076. findByName: function (e, t) {
  50077. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i];
  50078. return null;
  50079. },
  50080. CreateClipsFromMorphTargetSequences: function (e, t) {
  50081. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  50082. var s = e[o],
  50083. l = s.name.match(r);
  50084. if (l && l.length > 1) {
  50085. var c = l[1],
  50086. h = i[c];
  50087. h || (i[c] = h = []), h.push(s);
  50088. }
  50089. }
  50090. var u = [];
  50091. for (var c in i) u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  50092. return u;
  50093. },
  50094. parseAnimation: function (e, t, i) {
  50095. if (!e) return console.error(' no animation in JSONLoader data'), null;
  50096. for (
  50097. var r = function (e, t, i, r, o) {
  50098. if (0 !== i.length) {
  50099. var a = [],
  50100. s = [];
  50101. n.AnimationUtils.flattenJSON(i, a, s, r),
  50102. 0 !== a.length && o.push(new e(t, a, s));
  50103. }
  50104. },
  50105. o = [],
  50106. a = e.name || 'default',
  50107. s = e.length || -1,
  50108. l = e.fps || 30,
  50109. c = e.hierarchy || [],
  50110. h = 0;
  50111. h < c.length;
  50112. h++
  50113. ) {
  50114. var u = c[h].keys;
  50115. if (u && 0 != u.length)
  50116. if (u[0].morphTargets) {
  50117. for (var d = {}, p = 0; p < u.length; p++)
  50118. if (u[p].morphTargets)
  50119. for (var f = 0; f < u[p].morphTargets.length; f++)
  50120. d[u[p].morphTargets[f]] = -1;
  50121. for (var g in d) {
  50122. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  50123. var A = u[p];
  50124. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0);
  50125. }
  50126. o.push(new n.NumberKeyframeTrack('.morphTargetInfluence[' + g + ']', m, v));
  50127. }
  50128. s = d.length * (l || 1);
  50129. } else {
  50130. var y = '.bones[' + t[h].name + ']';
  50131. r(n.VectorKeyframeTrack, y + '.position', u, 'pos', o),
  50132. r(n.QuaternionKeyframeTrack, y + '.quaternion', u, 'rot', o),
  50133. r(n.VectorKeyframeTrack, y + '.scale', u, 'scl', o);
  50134. }
  50135. }
  50136. if (0 === o.length) return null;
  50137. var C = new n.AnimationClip(a, s, o);
  50138. return C;
  50139. },
  50140. }),
  50141. (n.AnimationMixer = function (e) {
  50142. (this._root = e),
  50143. this._initMemoryManager(),
  50144. (this._accuIndex = 0),
  50145. (this.time = 0),
  50146. (this.timeScale = 1);
  50147. }),
  50148. (n.AnimationMixer.prototype = {
  50149. constructor: n.AnimationMixer,
  50150. clipAction: function (e, t) {
  50151. var i,
  50152. r = t || this._root,
  50153. o = r.uuid,
  50154. a = 'string' == typeof e ? e : e.name,
  50155. s = e !== a ? e : null,
  50156. l = this._actionsByClip[a];
  50157. if (void 0 !== l) {
  50158. var c = l.actionByRoot[o];
  50159. if (void 0 !== c) return c;
  50160. if (((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s))
  50161. throw new Error('Different clips with the same name detected!');
  50162. }
  50163. if (null === s) return null;
  50164. var h = new n.AnimationMixer._Action(this, s, t);
  50165. return this._bindAction(h, i), this._addInactiveAction(h, a, o), h;
  50166. },
  50167. existingAction: function (e, t) {
  50168. var i = t || this._root,
  50169. n = i.uuid,
  50170. r = 'string' == typeof e ? e : e.name,
  50171. o = this._actionsByClip[r];
  50172. return void 0 !== o ? o.actionByRoot[n] || null : null;
  50173. },
  50174. stopAllAction: function () {
  50175. var e = this._actions,
  50176. t = this._nActiveActions,
  50177. i = this._bindings,
  50178. n = this._nActiveBindings;
  50179. (this._nActiveActions = 0), (this._nActiveBindings = 0);
  50180. for (var r = 0; r !== t; ++r) e[r].reset();
  50181. for (var r = 0; r !== n; ++r) i[r].useCount = 0;
  50182. return this;
  50183. },
  50184. update: function (e) {
  50185. e *= this.timeScale;
  50186. for (
  50187. var t = this._actions,
  50188. i = this._nActiveActions,
  50189. n = (this.time += e),
  50190. r = Math.sign(e),
  50191. o = (this._accuIndex ^= 1),
  50192. a = 0;
  50193. a !== i;
  50194. ++a
  50195. ) {
  50196. var s = t[a];
  50197. s.enabled && s._update(n, e, r, o);
  50198. }
  50199. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  50200. l[a].apply(o);
  50201. return this;
  50202. },
  50203. getRoot: function () {
  50204. return this._root;
  50205. },
  50206. uncacheClip: function (e) {
  50207. var t = this._actions,
  50208. i = e.name,
  50209. n = this._actionsByClip,
  50210. r = n[i];
  50211. if (void 0 !== r) {
  50212. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  50213. var l = o[a];
  50214. this._deactivateAction(l);
  50215. var c = l._cacheIndex,
  50216. h = t[t.length - 1];
  50217. (l._cacheIndex = null),
  50218. (l._byClipCacheIndex = null),
  50219. (h._cacheIndex = c),
  50220. (t[c] = h),
  50221. t.pop(),
  50222. this._removeInactiveBindingsForAction(l);
  50223. }
  50224. delete n[i];
  50225. }
  50226. },
  50227. uncacheRoot: function (e) {
  50228. var t = e.uuid,
  50229. i = this._actionsByClip;
  50230. for (var n in i) {
  50231. var r = i[n].actionByRoot,
  50232. o = r[t];
  50233. void 0 !== o && (this._deactivateAction(o), this._removeInactiveAction(o));
  50234. }
  50235. var a = this._bindingsByRootAndName,
  50236. s = a[t];
  50237. if (void 0 !== s)
  50238. for (var l in s) {
  50239. var c = s[l];
  50240. c.restoreOriginalState(), this._removeInactiveBinding(c);
  50241. }
  50242. },
  50243. uncacheAction: function (e, t) {
  50244. var i = this.existingAction(e, t);
  50245. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i));
  50246. },
  50247. }),
  50248. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  50249. (n.AnimationMixer._Action = function (e, t, i) {
  50250. (this._mixer = e), (this._clip = t), (this._localRoot = i || null);
  50251. for (
  50252. var r = t.tracks,
  50253. o = r.length,
  50254. a = new Array(o),
  50255. s = {
  50256. endingStart: n.ZeroCurvatureEnding,
  50257. endingEnd: n.ZeroCurvatureEnding,
  50258. },
  50259. l = 0;
  50260. l !== o;
  50261. ++l
  50262. ) {
  50263. var c = r[l].createInterpolant(null);
  50264. (a[l] = c), (c.settings = s);
  50265. }
  50266. (this._interpolantSettings = s),
  50267. (this._interpolants = a),
  50268. (this._propertyBindings = new Array(o)),
  50269. (this._cacheIndex = null),
  50270. (this._byClipCacheIndex = null),
  50271. (this._timeScaleInterpolant = null),
  50272. (this._weightInterpolant = null),
  50273. (this.loop = n.LoopRepeat),
  50274. (this._loopCount = -1),
  50275. (this._startTime = null),
  50276. (this.time = 0),
  50277. (this.timeScale = 1),
  50278. (this._effectiveTimeScale = 1),
  50279. (this.weight = 1),
  50280. (this._effectiveWeight = 1),
  50281. (this.repetitions = 1 / 0),
  50282. (this.paused = !1),
  50283. (this.enabled = !0),
  50284. (this.clampWhenFinished = !1),
  50285. (this.zeroSlopeAtStart = !0),
  50286. (this.zeroSlopeAtEnd = !0);
  50287. }),
  50288. (n.AnimationMixer._Action.prototype = {
  50289. constructor: n.AnimationMixer._Action,
  50290. play: function () {
  50291. return this._mixer._activateAction(this), this;
  50292. },
  50293. stop: function () {
  50294. return this._mixer._deactivateAction(this), this.reset();
  50295. },
  50296. reset: function () {
  50297. return (
  50298. (this.paused = !1),
  50299. (this.enabled = !0),
  50300. (this.time = 0),
  50301. (this._loopCount = -1),
  50302. (this._startTime = null),
  50303. this.stopFading().stopWarping()
  50304. );
  50305. },
  50306. isRunning: function () {
  50307. this._startTime;
  50308. return (
  50309. this.enabled &&
  50310. !this.paused &&
  50311. 0 !== this.timeScale &&
  50312. null === this._startTime &&
  50313. this._mixer._isActiveAction(this)
  50314. );
  50315. },
  50316. isScheduled: function () {
  50317. return this._mixer._isActiveAction(this);
  50318. },
  50319. startAt: function (e) {
  50320. return (this._startTime = e), this;
  50321. },
  50322. setLoop: function (e, t) {
  50323. return (this.loop = e), (this.repetitions = t), this;
  50324. },
  50325. setEffectiveWeight: function (e) {
  50326. return (
  50327. (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  50328. );
  50329. },
  50330. getEffectiveWeight: function () {
  50331. return this._effectiveWeight;
  50332. },
  50333. fadeIn: function (e) {
  50334. return this._scheduleFading(e, 0, 1);
  50335. },
  50336. fadeOut: function (e) {
  50337. return this._scheduleFading(e, 1, 0);
  50338. },
  50339. crossFadeFrom: function (e, t, i) {
  50340. this._mixer;
  50341. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  50342. var n = this._clip.duration,
  50343. r = e._clip.duration,
  50344. o = r / n,
  50345. a = n / r;
  50346. e.warp(1, o, t), this.warp(a, 1, t);
  50347. }
  50348. return this;
  50349. },
  50350. crossFadeTo: function (e, t, i) {
  50351. return e.crossFadeFrom(this, t, i);
  50352. },
  50353. stopFading: function () {
  50354. var e = this._weightInterpolant;
  50355. return (
  50356. null !== e &&
  50357. ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50358. this
  50359. );
  50360. },
  50361. setEffectiveTimeScale: function (e) {
  50362. return (
  50363. (this.timeScale = e),
  50364. (this._effectiveTimeScale = this.paused ? 0 : e),
  50365. this.stopWarping()
  50366. );
  50367. },
  50368. getEffectiveTimeScale: function () {
  50369. return this._effectiveTimeScale;
  50370. },
  50371. setDuration: function (e) {
  50372. return (this.timeScale = this._clip.duration / e), this.stopWarping();
  50373. },
  50374. syncWith: function (e) {
  50375. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping();
  50376. },
  50377. halt: function (e) {
  50378. return this.warp(this._currentTimeScale, 0, e);
  50379. },
  50380. warp: function (e, t, i) {
  50381. var n = this._mixer,
  50382. r = n.time,
  50383. o = this._timeScaleInterpolant,
  50384. a = this.timeScale;
  50385. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o));
  50386. var s = o.parameterPositions,
  50387. l = o.sampleValues;
  50388. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this;
  50389. },
  50390. stopWarping: function () {
  50391. var e = this._timeScaleInterpolant;
  50392. return (
  50393. null !== e &&
  50394. ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50395. this
  50396. );
  50397. },
  50398. getMixer: function () {
  50399. return this._mixer;
  50400. },
  50401. getClip: function () {
  50402. return this._clip;
  50403. },
  50404. getRoot: function () {
  50405. return this._localRoot || this._mixer._root;
  50406. },
  50407. _update: function (e, t, i, n) {
  50408. var r = this._startTime;
  50409. if (null !== r) {
  50410. var o = (e - r) * i;
  50411. if (o < 0 || 0 === i) return;
  50412. (this._startTime = null), (t = i * o);
  50413. }
  50414. t *= this._updateTimeScale(e);
  50415. var a = this._updateTime(t),
  50416. s = this._updateWeight(e);
  50417. if (s > 0)
  50418. for (
  50419. var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length;
  50420. h !== u;
  50421. ++h
  50422. )
  50423. l[h].evaluate(a), c[h].accumulate(n, s);
  50424. },
  50425. _updateWeight: function (e) {
  50426. var t = 0;
  50427. if (this.enabled) {
  50428. t = this.weight;
  50429. var i = this._weightInterpolant;
  50430. if (null !== i) {
  50431. var n = i.evaluate(e)[0];
  50432. (t *= n),
  50433. e > i.parameterPositions[1] &&
  50434. (this.stopFading(), 0 === n && (this.enabled = !1));
  50435. }
  50436. }
  50437. return (this._effectiveWeight = t), t;
  50438. },
  50439. _updateTimeScale: function (e) {
  50440. var t = 0;
  50441. if (!this.paused) {
  50442. t = this.timeScale;
  50443. var i = this._timeScaleInterpolant;
  50444. if (null !== i) {
  50445. var n = i.evaluate(e)[0];
  50446. (t *= n),
  50447. e > i.parameterPositions[1] &&
  50448. (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t));
  50449. }
  50450. }
  50451. return (this._effectiveTimeScale = t), t;
  50452. },
  50453. _updateTime: function (e) {
  50454. var t = this.time + e;
  50455. if (0 === e) return t;
  50456. var i = this._clip.duration,
  50457. r = this.loop,
  50458. o = this._loopCount,
  50459. a = !1;
  50460. switch (r) {
  50461. case n.LoopOnce:
  50462. if ((o === -1 && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), t >= i))
  50463. t = i;
  50464. else {
  50465. if (!(t < 0)) break;
  50466. t = 0;
  50467. }
  50468. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  50469. this._mixer.dispatchEvent({
  50470. type: 'finished',
  50471. action: this,
  50472. direction: e < 0 ? -1 : 1,
  50473. });
  50474. break;
  50475. case n.LoopPingPong:
  50476. a = !0;
  50477. case n.LoopRepeat:
  50478. if (
  50479. (o === -1 &&
  50480. (e > 0
  50481. ? ((o = 0), this._setEndings(!0, 0 === this.repetitions, a))
  50482. : this._setEndings(0 === this.repetitions, !0, a)),
  50483. t >= i || t < 0)
  50484. ) {
  50485. var s = Math.floor(t / i);
  50486. (t -= i * s), (o += Math.abs(s));
  50487. var l = this.repetitions - o;
  50488. if (l < 0) {
  50489. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  50490. (t = e > 0 ? i : 0),
  50491. this._mixer.dispatchEvent({
  50492. type: 'finished',
  50493. action: this,
  50494. direction: e > 0 ? 1 : -1,
  50495. });
  50496. break;
  50497. }
  50498. if (0 === l) {
  50499. var c = e < 0;
  50500. this._setEndings(c, !c, a);
  50501. } else this._setEndings(!1, !1, a);
  50502. (this._loopCount = o),
  50503. this._mixer.dispatchEvent({
  50504. type: 'loop',
  50505. action: this,
  50506. loopDelta: s,
  50507. });
  50508. }
  50509. if (r === n.LoopPingPong && 1 === (1 & o)) return (this.time = t), i - t;
  50510. }
  50511. return (this.time = t), t;
  50512. },
  50513. _setEndings: function (e, t, i) {
  50514. var r = this._interpolantSettings;
  50515. i
  50516. ? ((r.endingStart = n.ZeroSlopeEnding), (r.endingEnd = n.ZeroSlopeEnding))
  50517. : (e
  50518. ? (r.endingStart = this.zeroSlopeAtStart
  50519. ? n.ZeroSlopeEnding
  50520. : n.ZeroCurvatureEnding)
  50521. : (r.endingStart = n.WrapAroundEnding),
  50522. t
  50523. ? (r.endingEnd = this.zeroSlopeAtEnd
  50524. ? n.ZeroSlopeEnding
  50525. : n.ZeroCurvatureEnding)
  50526. : (r.endingEnd = n.WrapAroundEnding));
  50527. },
  50528. _scheduleFading: function (e, t, i) {
  50529. var n = this._mixer,
  50530. r = n.time,
  50531. o = this._weightInterpolant;
  50532. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o));
  50533. var a = o.parameterPositions,
  50534. s = o.sampleValues;
  50535. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this;
  50536. },
  50537. }),
  50538. Object.assign(n.AnimationMixer.prototype, {
  50539. _bindAction: function (e, t) {
  50540. var i = e._localRoot || this._root,
  50541. r = e._clip.tracks,
  50542. o = r.length,
  50543. a = e._propertyBindings,
  50544. s = e._interpolants,
  50545. l = i.uuid,
  50546. c = this._bindingsByRootAndName,
  50547. h = c[l];
  50548. void 0 === h && ((h = {}), (c[l] = h));
  50549. for (var u = 0; u !== o; ++u) {
  50550. var d = r[u],
  50551. p = d.name,
  50552. f = h[p];
  50553. if (void 0 !== f) a[u] = f;
  50554. else {
  50555. if (((f = a[u]), void 0 !== f)) {
  50556. null === f._cacheIndex &&
  50557. (++f.referenceCount, this._addInactiveBinding(f, l, p));
  50558. continue;
  50559. }
  50560. var g = t && t._propertyBindings[u].binding.parsedPath;
  50561. (f = new n.PropertyMixer(
  50562. n.PropertyBinding.create(i, p, g),
  50563. d.ValueTypeName,
  50564. d.getValueSize()
  50565. )),
  50566. ++f.referenceCount,
  50567. this._addInactiveBinding(f, l, p),
  50568. (a[u] = f);
  50569. }
  50570. s[u].resultBuffer = f.buffer;
  50571. }
  50572. },
  50573. _activateAction: function (e) {
  50574. if (!this._isActiveAction(e)) {
  50575. if (null === e._cacheIndex) {
  50576. var t = (e._localRoot || this._root).uuid,
  50577. i = e._clip.name,
  50578. n = this._actionsByClip[i];
  50579. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t);
  50580. }
  50581. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  50582. var s = r[o];
  50583. 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState());
  50584. }
  50585. this._lendAction(e);
  50586. }
  50587. },
  50588. _deactivateAction: function (e) {
  50589. if (this._isActiveAction(e)) {
  50590. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50591. var r = t[i];
  50592. 0 === --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r));
  50593. }
  50594. this._takeBackAction(e);
  50595. }
  50596. },
  50597. _initMemoryManager: function () {
  50598. (this._actions = []),
  50599. (this._nActiveActions = 0),
  50600. (this._actionsByClip = {}),
  50601. (this._bindings = []),
  50602. (this._nActiveBindings = 0),
  50603. (this._bindingsByRootAndName = {}),
  50604. (this._controlInterpolants = []),
  50605. (this._nActiveControlInterpolants = 0);
  50606. var e = this;
  50607. this.stats = {
  50608. actions: {
  50609. get total() {
  50610. return e._actions.length;
  50611. },
  50612. get inUse() {
  50613. return e._nActiveActions;
  50614. },
  50615. },
  50616. bindings: {
  50617. get total() {
  50618. return e._bindings.length;
  50619. },
  50620. get inUse() {
  50621. return e._nActiveBindings;
  50622. },
  50623. },
  50624. controlInterpolants: {
  50625. get total() {
  50626. return e._controlInterpolants.length;
  50627. },
  50628. get inUse() {
  50629. return e._nActiveControlInterpolants;
  50630. },
  50631. },
  50632. };
  50633. },
  50634. _isActiveAction: function (e) {
  50635. var t = e._cacheIndex;
  50636. return null !== t && t < this._nActiveActions;
  50637. },
  50638. _addInactiveAction: function (e, t, i) {
  50639. var n = this._actions,
  50640. r = this._actionsByClip,
  50641. o = r[t];
  50642. if (void 0 === o)
  50643. (o = {
  50644. knownActions: [e],
  50645. actionByRoot: {},
  50646. }),
  50647. (e._byClipCacheIndex = 0),
  50648. (r[t] = o);
  50649. else {
  50650. var a = o.knownActions;
  50651. (e._byClipCacheIndex = a.length), a.push(e);
  50652. }
  50653. (e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e);
  50654. },
  50655. _removeInactiveAction: function (e) {
  50656. var t = this._actions,
  50657. i = t[t.length - 1],
  50658. n = e._cacheIndex;
  50659. (i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null);
  50660. var r = e._clip.name,
  50661. o = this._actionsByClip,
  50662. a = o[r],
  50663. s = a.knownActions,
  50664. l = s[s.length - 1],
  50665. c = e._byClipCacheIndex;
  50666. (l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null);
  50667. var h = a.actionByRoot,
  50668. u = (t._localRoot || this._root).uuid;
  50669. delete h[u], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e);
  50670. },
  50671. _removeInactiveBindingsForAction: function (e) {
  50672. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50673. var r = t[i];
  50674. 0 === --r.referenceCount && this._removeInactiveBinding(r);
  50675. }
  50676. },
  50677. _lendAction: function (e) {
  50678. var t = this._actions,
  50679. i = e._cacheIndex,
  50680. n = this._nActiveActions++,
  50681. r = t[n];
  50682. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50683. },
  50684. _takeBackAction: function (e) {
  50685. var t = this._actions,
  50686. i = e._cacheIndex,
  50687. n = --this._nActiveActions,
  50688. r = t[n];
  50689. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50690. },
  50691. _addInactiveBinding: function (e, t, i) {
  50692. var n = this._bindingsByRootAndName,
  50693. r = n[t],
  50694. o = this._bindings;
  50695. void 0 === r && ((r = {}), (n[t] = r)),
  50696. (r[i] = e),
  50697. (e._cacheIndex = o.length),
  50698. o.push(e);
  50699. },
  50700. _removeInactiveBinding: function (e) {
  50701. var t = this._bindings,
  50702. i = e.binding,
  50703. n = i.rootNode.uuid,
  50704. r = i.path,
  50705. o = this._bindingsByRootAndName,
  50706. a = o[n],
  50707. s = t[t.length - 1],
  50708. l = e._cacheIndex;
  50709. (s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r];
  50710. e: {
  50711. for (var c in a) break e;
  50712. delete o[n];
  50713. }
  50714. },
  50715. _lendBinding: function (e) {
  50716. var t = this._bindings,
  50717. i = e._cacheIndex,
  50718. n = this._nActiveBindings++,
  50719. r = t[n];
  50720. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50721. },
  50722. _takeBackBinding: function (e) {
  50723. var t = this._bindings,
  50724. i = e._cacheIndex,
  50725. n = --this._nActiveBindings,
  50726. r = t[n];
  50727. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50728. },
  50729. _lendControlInterpolant: function () {
  50730. var e = this._controlInterpolants,
  50731. t = this._nActiveControlInterpolants++,
  50732. i = e[t];
  50733. return (
  50734. void 0 === i &&
  50735. ((i = new n.LinearInterpolant(
  50736. new Float32Array(2),
  50737. new Float32Array(2),
  50738. 1,
  50739. this._controlInterpolantsResultBuffer
  50740. )),
  50741. (i.__cacheIndex = t),
  50742. (e[t] = i)),
  50743. i
  50744. );
  50745. },
  50746. _takeBackControlInterpolant: function (e) {
  50747. var t = this._controlInterpolants,
  50748. i = e.__cacheIndex,
  50749. n = --this._nActiveControlInterpolants,
  50750. r = t[n];
  50751. (e.__cacheIndex = n), (t[n] = e), (r.__cacheIndex = i), (t[i] = r);
  50752. },
  50753. _controlInterpolantsResultBuffer: new Float32Array(1),
  50754. }),
  50755. (n.AnimationObjectGroup = function (e) {
  50756. (this.uuid = n.Math.generateUUID()),
  50757. (this._objects = Array.prototype.slice.call(arguments)),
  50758. (this.nCachedObjects_ = 0);
  50759. var t = {};
  50760. this._indicesByUUID = t;
  50761. for (var i = 0, r = arguments.length; i !== r; ++i) t[arguments[i].uuid] = i;
  50762. (this._paths = []),
  50763. (this._parsedPaths = []),
  50764. (this._bindings = []),
  50765. (this._bindingsIndicesByPath = {});
  50766. var o = this;
  50767. this.stats = {
  50768. objects: {
  50769. get total() {
  50770. return o._objects.length;
  50771. },
  50772. get inUse() {
  50773. return this.total - o.nCachedObjects_;
  50774. },
  50775. },
  50776. get bindingsPerObject() {
  50777. return o._bindings.length;
  50778. },
  50779. };
  50780. }),
  50781. (n.AnimationObjectGroup.prototype = {
  50782. constructor: n.AnimationObjectGroup,
  50783. add: function (e) {
  50784. for (
  50785. var t = this._objects,
  50786. i = t.length,
  50787. r = this.nCachedObjects_,
  50788. o = this._indicesByUUID,
  50789. a = this._paths,
  50790. s = this._parsedPaths,
  50791. l = this._bindings,
  50792. c = l.length,
  50793. h = 0,
  50794. u = arguments.length;
  50795. h !== u;
  50796. ++h
  50797. ) {
  50798. var d = arguments[h],
  50799. p = d.uuid,
  50800. f = o[p];
  50801. if (void 0 === f) {
  50802. (f = i++), (o[p] = f), t.push(d);
  50803. for (var g = 0, m = c; g !== m; ++g)
  50804. l[g].push(new n.PropertyBinding(d, a[g], s[g]));
  50805. } else if (f < r) {
  50806. var v = t[f],
  50807. A = --r,
  50808. y = t[A];
  50809. (o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d);
  50810. for (var g = 0, m = c; g !== m; ++g) {
  50811. var C = l[g],
  50812. I = C[A],
  50813. E = C[f];
  50814. (C[f] = I),
  50815. void 0 === E && (E = new n.PropertyBinding(d, a[g], s[g])),
  50816. (C[A] = E);
  50817. }
  50818. } else
  50819. t[f] !== v &&
  50820. console.error(
  50821. 'Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...'
  50822. );
  50823. }
  50824. this.nCachedObjects_ = r;
  50825. },
  50826. remove: function (e) {
  50827. for (
  50828. var t = this._objects,
  50829. i = (t.length, this.nCachedObjects_),
  50830. n = this._indicesByUUID,
  50831. r = this._bindings,
  50832. o = r.length,
  50833. a = 0,
  50834. s = arguments.length;
  50835. a !== s;
  50836. ++a
  50837. ) {
  50838. var l = arguments[a],
  50839. c = l.uuid,
  50840. h = n[c];
  50841. if (void 0 !== h && h >= i) {
  50842. var u = i++,
  50843. d = t[u];
  50844. (n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l);
  50845. for (var p = 0, f = o; p !== f; ++p) {
  50846. var g = r[p],
  50847. m = g[u],
  50848. v = g[h];
  50849. (g[h] = m), (g[u] = v);
  50850. }
  50851. }
  50852. }
  50853. this.nCachedObjects_ = i;
  50854. },
  50855. uncache: function (e) {
  50856. for (
  50857. var t = this._objects,
  50858. i = t.length,
  50859. n = this.nCachedObjects_,
  50860. r = this._indicesByUUID,
  50861. o = this._bindings,
  50862. a = o.length,
  50863. s = 0,
  50864. l = arguments.length;
  50865. s !== l;
  50866. ++s
  50867. ) {
  50868. var c = arguments[s],
  50869. h = c.uuid,
  50870. u = r[h];
  50871. if (void 0 !== u)
  50872. if ((delete r[h], u < n)) {
  50873. var d = --n,
  50874. p = t[d],
  50875. f = --i,
  50876. g = t[f];
  50877. (r[p.uuid] = u), (t[u] = p), (r[g.uuid] = d), (t[d] = g), t.pop();
  50878. for (var m = 0, v = a; m !== v; ++m) {
  50879. var A = o[m],
  50880. y = A[d],
  50881. C = A[f];
  50882. (A[u] = y), (A[d] = C), A.pop();
  50883. }
  50884. } else {
  50885. var f = --i,
  50886. g = t[f];
  50887. (r[g.uuid] = u), (t[u] = g), t.pop();
  50888. for (var m = 0, v = a; m !== v; ++m) {
  50889. var A = o[m];
  50890. (A[u] = A[f]), A.pop();
  50891. }
  50892. }
  50893. }
  50894. this.nCachedObjects_ = n;
  50895. },
  50896. subscribe_: function (e, t) {
  50897. var i = this._bindingsIndicesByPath,
  50898. r = i[e],
  50899. o = this._bindings;
  50900. if (void 0 !== r) return o[r];
  50901. var a = this._paths,
  50902. s = this._parsedPaths,
  50903. l = this._objects,
  50904. c = l.length,
  50905. h = this.nCachedObjects_,
  50906. u = new Array(c);
  50907. (r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u);
  50908. for (var d = h, p = l.length; d !== p; ++d) {
  50909. var f = l[d];
  50910. u[d] = new n.PropertyBinding(f, e, t);
  50911. }
  50912. return u;
  50913. },
  50914. unsubscribe_: function (e) {
  50915. var t = this._bindingsIndicesByPath,
  50916. i = t[e];
  50917. if (void 0 !== i) {
  50918. var n = this._paths,
  50919. r = this._parsedPaths,
  50920. o = this._bindings,
  50921. a = o.length - 1,
  50922. s = o[a],
  50923. l = e[a];
  50924. (t[l] = i), (o[i] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop();
  50925. }
  50926. },
  50927. }),
  50928. (n.AnimationUtils = {
  50929. arraySlice: function (e, t, i) {
  50930. return n.AnimationUtils.isTypedArray(e)
  50931. ? new e.constructor(e.subarray(t, i))
  50932. : e.slice(t, i);
  50933. },
  50934. convertArray: function (e, t, i) {
  50935. return !e || (!i && e.constructor === t)
  50936. ? e
  50937. : 'number' == typeof t.BYTES_PER_ELEMENT
  50938. ? new t(e)
  50939. : Array.prototype.slice.call(e);
  50940. },
  50941. isTypedArray: function (e) {
  50942. return ArrayBuffer.isView(e) && !(e instanceof DataView);
  50943. },
  50944. getKeyframeOrder: function (e) {
  50945. function t(t, i) {
  50946. return e[t] - e[i];
  50947. }
  50948. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r) n[r] = r;
  50949. return n.sort(t), n;
  50950. },
  50951. sortedArray: function (e, t, i) {
  50952. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  50953. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l];
  50954. return r;
  50955. },
  50956. flattenJSON: function (e, t, i, n) {
  50957. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++];
  50958. if (void 0 !== o) {
  50959. var a = o[n];
  50960. if (void 0 !== a)
  50961. if (Array.isArray(a)) {
  50962. do
  50963. (a = o[n]),
  50964. void 0 !== a && (t.push(o.time), i.push.apply(i, a)),
  50965. (o = e[r++]);
  50966. while (void 0 !== o);
  50967. } else if (void 0 !== a.toArray) {
  50968. do
  50969. (a = o[n]),
  50970. void 0 !== a && (t.push(o.time), a.toArray(i, i.length)),
  50971. (o = e[r++]);
  50972. while (void 0 !== o);
  50973. } else
  50974. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push(a)), (o = e[r++]);
  50975. while (void 0 !== o);
  50976. }
  50977. },
  50978. }),
  50979. (n.KeyframeTrack = function (e, t, i, r) {
  50980. if (void 0 === e) throw new Error('track name is undefined');
  50981. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e);
  50982. (this.name = e),
  50983. (this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType)),
  50984. (this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType)),
  50985. this.setInterpolation(r || this.DefaultInterpolation),
  50986. this.validate(),
  50987. this.optimize();
  50988. }),
  50989. (n.KeyframeTrack.prototype = {
  50990. constructor: n.KeyframeTrack,
  50991. TimeBufferType: Float32Array,
  50992. ValueBufferType: Float32Array,
  50993. DefaultInterpolation: n.InterpolateLinear,
  50994. InterpolantFactoryMethodDiscrete: function (e) {
  50995. return new n.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e);
  50996. },
  50997. InterpolantFactoryMethodLinear: function (e) {
  50998. return new n.LinearInterpolant(this.times, this.values, this.getValueSize(), e);
  50999. },
  51000. InterpolantFactoryMethodSmooth: function (e) {
  51001. return new n.CubicInterpolant(this.times, this.values, this.getValueSize(), e);
  51002. },
  51003. setInterpolation: function (e) {
  51004. var t = void 0;
  51005. switch (e) {
  51006. case n.InterpolateDiscrete:
  51007. t = this.InterpolantFactoryMethodDiscrete;
  51008. break;
  51009. case n.InterpolateLinear:
  51010. t = this.InterpolantFactoryMethodLinear;
  51011. break;
  51012. case n.InterpolateSmooth:
  51013. t = this.InterpolantFactoryMethodSmooth;
  51014. }
  51015. if (void 0 === t) {
  51016. var i =
  51017. 'unsupported interpolation for ' +
  51018. this.ValueTypeName +
  51019. ' keyframe track named ' +
  51020. this.name;
  51021. if (void 0 === this.createInterpolant) {
  51022. if (e === this.DefaultInterpolation) throw new Error(i);
  51023. this.setInterpolation(this.DefaultInterpolation);
  51024. }
  51025. return void console.warn(i);
  51026. }
  51027. this.createInterpolant = t;
  51028. },
  51029. getInterpolation: function () {
  51030. switch (this.createInterpolant) {
  51031. case this.InterpolantFactoryMethodDiscrete:
  51032. return n.InterpolateDiscrete;
  51033. case this.InterpolantFactoryMethodLinear:
  51034. return n.InterpolateLinear;
  51035. case this.InterpolantFactoryMethodSmooth:
  51036. return n.InterpolateSmooth;
  51037. }
  51038. },
  51039. getValueSize: function () {
  51040. return this.values.length / this.times.length;
  51041. },
  51042. shift: function (e) {
  51043. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e;
  51044. return this;
  51045. },
  51046. scale: function (e) {
  51047. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e;
  51048. return this;
  51049. },
  51050. trim: function (e, t) {
  51051. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; ) ++o;
  51052. for (; a !== -1 && i[a] > t; ) --a;
  51053. if ((++a, 0 !== o || a !== r)) {
  51054. o >= a && ((a = Math.max(a, 1)), (o = a - 1));
  51055. var s = this.getValueSize();
  51056. (this.times = n.AnimationUtils.arraySlice(i, o, a)),
  51057. (this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s));
  51058. }
  51059. return this;
  51060. },
  51061. validate: function () {
  51062. var e = !0,
  51063. t = this.getValueSize();
  51064. t - Math.floor(t) !== 0 &&
  51065. (console.error('invalid value size in track', this), (e = !1));
  51066. var i = this.times,
  51067. r = this.values,
  51068. o = i.length;
  51069. 0 === o && (console.error('track is empty', this), (e = !1));
  51070. for (var a = null, s = 0; s !== o; s++) {
  51071. var l = i[s];
  51072. if ('number' == typeof l && isNaN(l)) {
  51073. console.error('time is not a valid number', this, s, l), (e = !1);
  51074. break;
  51075. }
  51076. if (null !== a && a > l) {
  51077. console.error('out of order keys', this, s, l, a), (e = !1);
  51078. break;
  51079. }
  51080. a = l;
  51081. }
  51082. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  51083. for (var s = 0, c = r.length; s !== c; ++s) {
  51084. var h = r[s];
  51085. if (isNaN(h)) {
  51086. console.error('value is not a valid number', this, s, h), (e = !1);
  51087. break;
  51088. }
  51089. }
  51090. return e;
  51091. },
  51092. optimize: function () {
  51093. for (
  51094. var e = this.times,
  51095. t = this.values,
  51096. i = this.getValueSize(),
  51097. r = 1,
  51098. o = 1,
  51099. a = e.length - 1;
  51100. o <= a;
  51101. ++o
  51102. ) {
  51103. var s = !1,
  51104. l = e[o],
  51105. c = e[o + 1];
  51106. if (l !== c && (1 !== o || l !== l[0]))
  51107. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  51108. var f = t[h + p];
  51109. if (f !== t[u + p] || f !== t[d + p]) {
  51110. s = !0;
  51111. break;
  51112. }
  51113. }
  51114. if (s) {
  51115. if (o !== r) {
  51116. e[r] = e[o];
  51117. for (var g = o * i, m = r * i, p = 0; p !== i; ++p) t[m + p] = t[g + p];
  51118. }
  51119. ++r;
  51120. }
  51121. }
  51122. return (
  51123. r !== e.length &&
  51124. ((this.times = n.AnimationUtils.arraySlice(e, 0, r)),
  51125. (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))),
  51126. this
  51127. );
  51128. },
  51129. }),
  51130. Object.assign(n.KeyframeTrack, {
  51131. parse: function (e) {
  51132. if (void 0 === e.type) throw new Error('track type undefined, can not parse');
  51133. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  51134. if (void 0 === e.times) {
  51135. console.warn('legacy JSON format detected, converting');
  51136. var i = [],
  51137. r = [];
  51138. n.AnimationUtils.flattenJSON(e.keys, i, r, 'value'), (e.times = i), (e.values = r);
  51139. }
  51140. return void 0 !== t.parse
  51141. ? t.parse(e)
  51142. : new t(e.name, e.times, e.values, e.interpolation);
  51143. },
  51144. toJSON: function (e) {
  51145. var t,
  51146. i = e.constructor;
  51147. if (void 0 !== i.toJSON) t = i.toJSON(e);
  51148. else {
  51149. t = {
  51150. name: e.name,
  51151. times: n.AnimationUtils.convertArray(e.times, Array),
  51152. values: n.AnimationUtils.convertArray(e.values, Array),
  51153. };
  51154. var r = e.getInterpolation();
  51155. r !== e.DefaultInterpolation && (t.interpolation = r);
  51156. }
  51157. return (t.type = e.ValueTypeName), t;
  51158. },
  51159. _getTrackTypeForValueTypeName: function (e) {
  51160. switch (e.toLowerCase()) {
  51161. case 'scalar':
  51162. case 'double':
  51163. case 'float':
  51164. case 'number':
  51165. case 'integer':
  51166. return n.NumberKeyframeTrack;
  51167. case 'vector':
  51168. case 'vector2':
  51169. case 'vector3':
  51170. case 'vector4':
  51171. return n.VectorKeyframeTrack;
  51172. case 'color':
  51173. return n.ColorKeyframeTrack;
  51174. case 'quaternion':
  51175. return n.QuaternionKeyframeTrack;
  51176. case 'bool':
  51177. case 'boolean':
  51178. return n.BooleanKeyframeTrack;
  51179. case 'string':
  51180. return n.StringKeyframeTrack;
  51181. }
  51182. throw new Error('Unsupported typeName: ' + e);
  51183. },
  51184. }),
  51185. (n.PropertyBinding = function (e, t, i) {
  51186. (this.path = t),
  51187. (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)),
  51188. (this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e),
  51189. (this.rootNode = e);
  51190. }),
  51191. (n.PropertyBinding.prototype = {
  51192. constructor: n.PropertyBinding,
  51193. getValue: function (e, t) {
  51194. this.bind(), this.getValue(e, t);
  51195. },
  51196. setValue: function (e, t) {
  51197. this.bind(), this.setValue(e, t);
  51198. },
  51199. bind: function () {
  51200. var e = this.node,
  51201. t = this.parsedPath,
  51202. i = t.objectName,
  51203. r = t.propertyName,
  51204. o = t.propertyIndex;
  51205. if (
  51206. (e ||
  51207. ((e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode),
  51208. (this.node = e)),
  51209. (this.getValue = this._getValue_unavailable),
  51210. (this.setValue = this._setValue_unavailable),
  51211. !e)
  51212. )
  51213. return void console.error(
  51214. ' trying to update node for track: ' + this.path + " but it wasn't found."
  51215. );
  51216. if (i) {
  51217. var a = t.objectIndex;
  51218. switch (i) {
  51219. case 'materials':
  51220. if (!e.material)
  51221. return void console.error(
  51222. ' can not bind to material as node does not have a material',
  51223. this
  51224. );
  51225. if (!e.material.materials)
  51226. return void console.error(
  51227. ' can not bind to material.materials as node.material does not have a materials array',
  51228. this
  51229. );
  51230. e = e.material.materials;
  51231. break;
  51232. case 'bones':
  51233. if (!e.skeleton)
  51234. return void console.error(
  51235. ' can not bind to bones as node does not have a skeleton',
  51236. this
  51237. );
  51238. e = e.skeleton.bones;
  51239. for (var s = 0; s < e.length; s++)
  51240. if (e[s].name === a) {
  51241. a = s;
  51242. break;
  51243. }
  51244. break;
  51245. default:
  51246. if (void 0 === e[i])
  51247. return void console.error(
  51248. ' can not bind to objectName of node, undefined',
  51249. this
  51250. );
  51251. e = e[i];
  51252. }
  51253. if (void 0 !== a) {
  51254. if (void 0 === e[a])
  51255. return void console.error(
  51256. ' trying to bind to objectIndex of objectName, but is undefined:',
  51257. this,
  51258. e
  51259. );
  51260. e = e[a];
  51261. }
  51262. }
  51263. var l = e[r];
  51264. if (!l) {
  51265. var c = t.nodeName;
  51266. return void console.error(
  51267. ' trying to update property for track: ' + c + '.' + r + " but it wasn't found.",
  51268. e
  51269. );
  51270. }
  51271. var h = this.Versioning.None;
  51272. void 0 !== e.needsUpdate
  51273. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  51274. : void 0 !== e.matrixWorldNeedsUpdate &&
  51275. ((h = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e));
  51276. var u = this.BindingType.Direct;
  51277. if (void 0 !== o) {
  51278. if ('morphTargetInfluences' === r) {
  51279. if (!e.geometry)
  51280. return void console.error(
  51281. ' can not bind to morphTargetInfluences becasuse node does not have a geometry',
  51282. this
  51283. );
  51284. if (!e.geometry.morphTargets)
  51285. return void console.error(
  51286. ' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets',
  51287. this
  51288. );
  51289. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  51290. if (e.geometry.morphTargets[s].name === o) {
  51291. o = s;
  51292. break;
  51293. }
  51294. }
  51295. (u = this.BindingType.ArrayElement),
  51296. (this.resolvedProperty = l),
  51297. (this.propertyIndex = o);
  51298. } else
  51299. void 0 !== l.fromArray && void 0 !== l.toArray
  51300. ? ((u = this.BindingType.HasFromToArray), (this.resolvedProperty = l))
  51301. : void 0 !== l.length
  51302. ? ((u = this.BindingType.EntireArray), (this.resolvedProperty = l))
  51303. : (this.propertyName = r);
  51304. (this.getValue = this.GetterByBindingType[u]),
  51305. (this.setValue = this.SetterByBindingTypeAndVersioning[u][h]);
  51306. },
  51307. unbind: function () {
  51308. (this.node = null),
  51309. (this.getValue = this._getValue_unbound),
  51310. (this.setValue = this._setValue_unbound);
  51311. },
  51312. }),
  51313. Object.assign(n.PropertyBinding.prototype, {
  51314. _getValue_unavailable: function () {},
  51315. _setValue_unavailable: function () {},
  51316. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  51317. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  51318. BindingType: {
  51319. Direct: 0,
  51320. EntireArray: 1,
  51321. ArrayElement: 2,
  51322. HasFromToArray: 3,
  51323. },
  51324. Versioning: {
  51325. None: 0,
  51326. NeedsUpdate: 1,
  51327. MatrixWorldNeedsUpdate: 2,
  51328. },
  51329. GetterByBindingType: [
  51330. function (e, t) {
  51331. e[t] = this.node[this.propertyName];
  51332. },
  51333. function (e, t) {
  51334. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51335. e[t++] = i[n];
  51336. },
  51337. function (e, t) {
  51338. e[t] = this.resolvedProperty[this.propertyIndex];
  51339. },
  51340. function (e, t) {
  51341. this.resolvedProperty.toArray(e, t);
  51342. },
  51343. ],
  51344. SetterByBindingTypeAndVersioning: [
  51345. [
  51346. function (e, t) {
  51347. this.node[this.propertyName] = e[t];
  51348. },
  51349. function (e, t) {
  51350. (this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0);
  51351. },
  51352. function (e, t) {
  51353. (this.node[this.propertyName] = e[t]),
  51354. (this.targetObject.matrixWorldNeedsUpdate = !0);
  51355. },
  51356. ],
  51357. [
  51358. function (e, t) {
  51359. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51360. i[n] = e[t++];
  51361. },
  51362. function (e, t) {
  51363. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51364. i[n] = e[t++];
  51365. this.targetObject.needsUpdate = !0;
  51366. },
  51367. function (e, t) {
  51368. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51369. i[n] = e[t++];
  51370. this.targetObject.matrixWorldNeedsUpdate = !0;
  51371. },
  51372. ],
  51373. [
  51374. function (e, t) {
  51375. this.resolvedProperty[this.propertyIndex] = e[t];
  51376. },
  51377. function (e, t) {
  51378. (this.resolvedProperty[this.propertyIndex] = e[t]),
  51379. (this.targetObject.needsUpdate = !0);
  51380. },
  51381. function (e, t) {
  51382. (this.resolvedProperty[this.propertyIndex] = e[t]),
  51383. (this.targetObject.matrixWorldNeedsUpdate = !0);
  51384. },
  51385. ],
  51386. [
  51387. function (e, t) {
  51388. this.resolvedProperty.fromArray(e, t);
  51389. },
  51390. function (e, t) {
  51391. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0);
  51392. },
  51393. function (e, t) {
  51394. this.resolvedProperty.fromArray(e, t),
  51395. (this.targetObject.matrixWorldNeedsUpdate = !0);
  51396. },
  51397. ],
  51398. ],
  51399. }),
  51400. (n.PropertyBinding.Composite = function (e, t, i) {
  51401. var r = i || n.PropertyBinding.parseTrackName(t);
  51402. (this._targetGroup = e), (this._bindings = e.subscribe_(t, r));
  51403. }),
  51404. (n.PropertyBinding.Composite.prototype = {
  51405. constructor: n.PropertyBinding.Composite,
  51406. getValue: function (e, t) {
  51407. this.bind();
  51408. var i = this._targetGroup.nCachedObjects_,
  51409. n = this._bindings[i];
  51410. void 0 !== n && n.getValue(e, t);
  51411. },
  51412. setValue: function (e, t) {
  51413. for (
  51414. var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length;
  51415. n !== r;
  51416. ++n
  51417. )
  51418. i[n].setValue(e, t);
  51419. },
  51420. bind: function () {
  51421. for (
  51422. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51423. t !== i;
  51424. ++t
  51425. )
  51426. e[t].bind();
  51427. },
  51428. unbind: function () {
  51429. for (
  51430. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51431. t !== i;
  51432. ++t
  51433. )
  51434. e[t].unbind();
  51435. },
  51436. }),
  51437. (n.PropertyBinding.create = function (e, t, i) {
  51438. return e instanceof n.AnimationObjectGroup
  51439. ? new n.PropertyBinding.Composite(e, t, i)
  51440. : new n.PropertyBinding(e, t, i);
  51441. }),
  51442. (n.PropertyBinding.parseTrackName = function (e) {
  51443. var t =
  51444. /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  51445. i = t.exec(e);
  51446. if (!i) throw new Error('cannot parse trackName at all: ' + e);
  51447. i.index === t.lastIndex && t.lastIndex++;
  51448. var n = {
  51449. nodeName: i[3],
  51450. objectName: i[5],
  51451. objectIndex: i[7],
  51452. propertyName: i[9],
  51453. propertyIndex: i[11],
  51454. };
  51455. if (null === n.propertyName || 0 === n.propertyName.length)
  51456. throw new Error('can not parse propertyName from trackName: ' + e);
  51457. return n;
  51458. }),
  51459. (n.PropertyBinding.findNode = function (e, t) {
  51460. if (
  51461. !t ||
  51462. '' === t ||
  51463. 'root' === t ||
  51464. '.' === t ||
  51465. t === -1 ||
  51466. t === e.name ||
  51467. t === e.uuid
  51468. )
  51469. return e;
  51470. if (e.skeleton) {
  51471. var i = function (e) {
  51472. for (var i = 0; i < e.bones.length; i++) {
  51473. var n = e.bones[i];
  51474. if (n.name === t) return n;
  51475. }
  51476. return null;
  51477. },
  51478. n = i(e.skeleton);
  51479. if (n) return n;
  51480. }
  51481. if (e.children) {
  51482. var r = function (e) {
  51483. for (var i = 0; i < e.length; i++) {
  51484. var n = e[i];
  51485. if (n.name === t || n.uuid === t) return n;
  51486. var o = r(n.children);
  51487. if (o) return o;
  51488. }
  51489. return null;
  51490. },
  51491. o = r(e.children);
  51492. if (o) return o;
  51493. }
  51494. return null;
  51495. }),
  51496. (n.PropertyMixer = function (e, t, i) {
  51497. (this.binding = e), (this.valueSize = i);
  51498. var n,
  51499. r = Float64Array;
  51500. switch (t) {
  51501. case 'quaternion':
  51502. n = this._slerp;
  51503. break;
  51504. case 'string':
  51505. case 'bool':
  51506. (r = Array), (n = this._select);
  51507. break;
  51508. default:
  51509. n = this._lerp;
  51510. }
  51511. (this.buffer = new r(4 * i)),
  51512. (this._mixBufferRegion = n),
  51513. (this.cumulativeWeight = 0),
  51514. (this.useCount = 0),
  51515. (this.referenceCount = 0);
  51516. }),
  51517. (n.PropertyMixer.prototype = {
  51518. constructor: n.PropertyMixer,
  51519. accumulate: function (e, t) {
  51520. var i = this.buffer,
  51521. n = this.valueSize,
  51522. r = e * n + n,
  51523. o = this.cumulativeWeight;
  51524. if (0 === o) {
  51525. for (var a = 0; a !== n; ++a) i[r + a] = i[a];
  51526. o = t;
  51527. } else {
  51528. o += t;
  51529. var s = t / o;
  51530. this._mixBufferRegion(i, r, 0, s, n);
  51531. }
  51532. this.cumulativeWeight = o;
  51533. },
  51534. apply: function (e) {
  51535. var t = this.valueSize,
  51536. i = this.buffer,
  51537. n = e * t + t,
  51538. r = this.cumulativeWeight,
  51539. o = this.binding;
  51540. if (((this.cumulativeWeight = 0), r < 1)) {
  51541. var a = 3 * t;
  51542. this._mixBufferRegion(i, n, a, 1 - r, t);
  51543. }
  51544. for (var s = t, l = t + t; s !== l; ++s)
  51545. if (i[s] !== i[s + t]) {
  51546. o.setValue(i, n);
  51547. break;
  51548. }
  51549. },
  51550. saveOriginalState: function () {
  51551. var e = this.binding,
  51552. t = this.buffer,
  51553. i = this.valueSize,
  51554. n = 3 * i;
  51555. e.getValue(t, n);
  51556. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)];
  51557. this.cumulativeWeight = 0;
  51558. },
  51559. restoreOriginalState: function () {
  51560. var e = 3 * this.valueSize;
  51561. this.binding.setValue(this.buffer, e);
  51562. },
  51563. _select: function (e, t, i, n, r) {
  51564. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o];
  51565. },
  51566. _slerp: function (e, t, i, r, o) {
  51567. n.Quaternion.slerpFlat(e, t, e, t, e, i, r);
  51568. },
  51569. _lerp: function (e, t, i, n, r) {
  51570. for (var o = 1 - n, a = 0; a !== r; ++a) {
  51571. var s = t + a;
  51572. e[s] = e[s] * o + e[i + a] * n;
  51573. }
  51574. },
  51575. }),
  51576. (n.BooleanKeyframeTrack = function (e, t, i) {
  51577. n.KeyframeTrack.call(this, e, t, i);
  51578. }),
  51579. (n.BooleanKeyframeTrack.prototype = Object.assign(
  51580. Object.create(n.KeyframeTrack.prototype),
  51581. {
  51582. constructor: n.BooleanKeyframeTrack,
  51583. ValueTypeName: 'bool',
  51584. ValueBufferType: Array,
  51585. DefaultInterpolation: n.IntepolateDiscrete,
  51586. InterpolantFactoryMethodLinear: void 0,
  51587. InterpolantFactoryMethodSmooth: void 0,
  51588. }
  51589. )),
  51590. (n.NumberKeyframeTrack = function (e, t, i, r) {
  51591. n.KeyframeTrack.call(this, e, t, i, r);
  51592. }),
  51593. (n.NumberKeyframeTrack.prototype = Object.assign(
  51594. Object.create(n.KeyframeTrack.prototype),
  51595. {
  51596. constructor: n.NumberKeyframeTrack,
  51597. ValueTypeName: 'number',
  51598. }
  51599. )),
  51600. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  51601. n.KeyframeTrack.call(this, e, t, i, r);
  51602. }),
  51603. (n.QuaternionKeyframeTrack.prototype = Object.assign(
  51604. Object.create(n.KeyframeTrack.prototype),
  51605. {
  51606. constructor: n.QuaternionKeyframeTrack,
  51607. ValueTypeName: 'quaternion',
  51608. DefaultInterpolation: n.InterpolateLinear,
  51609. InterpolantFactoryMethodLinear: function (e) {
  51610. return new n.QuaternionLinearInterpolant(
  51611. this.times,
  51612. this.values,
  51613. this.getValueSize(),
  51614. e
  51615. );
  51616. },
  51617. InterpolantFactoryMethodSmooth: void 0,
  51618. }
  51619. )),
  51620. (n.StringKeyframeTrack = function (e, t, i, r) {
  51621. n.KeyframeTrack.call(this, e, t, i, r);
  51622. }),
  51623. (n.StringKeyframeTrack.prototype = Object.assign(
  51624. Object.create(n.KeyframeTrack.prototype),
  51625. {
  51626. constructor: n.StringKeyframeTrack,
  51627. ValueTypeName: 'string',
  51628. ValueBufferType: Array,
  51629. DefaultInterpolation: n.IntepolateDiscrete,
  51630. InterpolantFactoryMethodLinear: void 0,
  51631. InterpolantFactoryMethodSmooth: void 0,
  51632. }
  51633. )),
  51634. (n.VectorKeyframeTrack = function (e, t, i, r) {
  51635. n.KeyframeTrack.call(this, e, t, i, r);
  51636. }),
  51637. (n.VectorKeyframeTrack.prototype = Object.assign(
  51638. Object.create(n.KeyframeTrack.prototype),
  51639. {
  51640. constructor: n.VectorKeyframeTrack,
  51641. ValueTypeName: 'vector',
  51642. }
  51643. )),
  51644. (n.Audio = function (e) {
  51645. n.Object3D.call(this),
  51646. (this.type = 'Audio'),
  51647. (this.context = e.context),
  51648. (this.source = this.context.createBufferSource()),
  51649. (this.source.onended = this.onEnded.bind(this)),
  51650. (this.gain = this.context.createGain()),
  51651. this.gain.connect(e.getInput()),
  51652. (this.autoplay = !1),
  51653. (this.startTime = 0),
  51654. (this.playbackRate = 1),
  51655. (this.isPlaying = !1),
  51656. (this.hasPlaybackControl = !0),
  51657. (this.sourceType = 'empty'),
  51658. (this.filter = null);
  51659. }),
  51660. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  51661. (n.Audio.prototype.constructor = n.Audio),
  51662. (n.Audio.prototype.getOutput = function () {
  51663. return this.gain;
  51664. }),
  51665. (n.Audio.prototype.load = function (e) {
  51666. var t = new n.AudioBuffer(this.context);
  51667. return t.load(e), this.setBuffer(t), this;
  51668. }),
  51669. (n.Audio.prototype.setNodeSource = function (e) {
  51670. return (
  51671. (this.hasPlaybackControl = !1),
  51672. (this.sourceType = 'audioNode'),
  51673. (this.source = e),
  51674. this.connect(),
  51675. this
  51676. );
  51677. }),
  51678. (n.Audio.prototype.setBuffer = function (e) {
  51679. var t = this;
  51680. return (
  51681. e.onReady(function (e) {
  51682. (t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play();
  51683. }),
  51684. this
  51685. );
  51686. }),
  51687. (n.Audio.prototype.play = function () {
  51688. if (this.isPlaying === !0)
  51689. return void console.warn('THREE.Audio: Audio is already playing.');
  51690. if (this.hasPlaybackControl === !1)
  51691. return void console.warn('THREE.Audio: this Audio has no playback control.');
  51692. var e = this.context.createBufferSource();
  51693. (e.buffer = this.source.buffer),
  51694. (e.loop = this.source.loop),
  51695. (e.onended = this.source.onended),
  51696. e.start(0, this.startTime),
  51697. (e.playbackRate.value = this.playbackRate),
  51698. (this.isPlaying = !0),
  51699. (this.source = e),
  51700. this.connect();
  51701. }),
  51702. (n.Audio.prototype.pause = function () {
  51703. return this.hasPlaybackControl === !1
  51704. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51705. : (this.source.stop(), void (this.startTime = this.context.currentTime));
  51706. }),
  51707. (n.Audio.prototype.stop = function () {
  51708. return this.hasPlaybackControl === !1
  51709. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51710. : (this.source.stop(), void (this.startTime = 0));
  51711. }),
  51712. (n.Audio.prototype.connect = function () {
  51713. null !== this.filter
  51714. ? (this.source.connect(this.filter), this.filter.connect(this.getOutput()))
  51715. : this.source.connect(this.getOutput());
  51716. }),
  51717. (n.Audio.prototype.disconnect = function () {
  51718. null !== this.filter
  51719. ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput()))
  51720. : this.source.disconnect(this.getOutput());
  51721. }),
  51722. (n.Audio.prototype.getFilter = function () {
  51723. return this.filter;
  51724. }),
  51725. (n.Audio.prototype.setFilter = function (e) {
  51726. void 0 === e && (e = null),
  51727. this.isPlaying === !0
  51728. ? (this.disconnect(), (this.filter = e), this.connect())
  51729. : (this.filter = e);
  51730. }),
  51731. (n.Audio.prototype.setPlaybackRate = function (e) {
  51732. return this.hasPlaybackControl === !1
  51733. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51734. : ((this.playbackRate = e),
  51735. void (
  51736. this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)
  51737. ));
  51738. }),
  51739. (n.Audio.prototype.getPlaybackRate = function () {
  51740. return this.playbackRate;
  51741. }),
  51742. (n.Audio.prototype.onEnded = function () {
  51743. this.isPlaying = !1;
  51744. }),
  51745. (n.Audio.prototype.setLoop = function (e) {
  51746. return this.hasPlaybackControl === !1
  51747. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51748. : void (this.source.loop = e);
  51749. }),
  51750. (n.Audio.prototype.getLoop = function () {
  51751. return this.hasPlaybackControl === !1
  51752. ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1)
  51753. : this.source.loop;
  51754. }),
  51755. (n.Audio.prototype.setVolume = function (e) {
  51756. this.gain.gain.value = e;
  51757. }),
  51758. (n.Audio.prototype.getVolume = function () {
  51759. return this.gain.gain.value;
  51760. }),
  51761. (n.AudioAnalyser = function (e, t) {
  51762. (this.analyser = e.context.createAnalyser()),
  51763. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  51764. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  51765. e.getOutput().connect(this.analyser);
  51766. }),
  51767. (n.AudioAnalyser.prototype = {
  51768. constructor: n.AudioAnalyser,
  51769. getData: function () {
  51770. return this.analyser.getByteFrequencyData(this.data), this.data;
  51771. },
  51772. }),
  51773. (n.AudioBuffer = function (e) {
  51774. (this.context = e), (this.ready = !1), (this.readyCallbacks = []);
  51775. }),
  51776. (n.AudioBuffer.prototype.load = function (e) {
  51777. var t = this,
  51778. i = new XMLHttpRequest();
  51779. return (
  51780. i.open('GET', e, !0),
  51781. (i.responseType = 'arraybuffer'),
  51782. (i.onload = function (e) {
  51783. t.context.decodeAudioData(this.response, function (e) {
  51784. (t.buffer = e), (t.ready = !0);
  51785. for (var i = 0; i < t.readyCallbacks.length; i++) t.readyCallbacks[i](t.buffer);
  51786. t.readyCallbacks = [];
  51787. });
  51788. }),
  51789. i.send(),
  51790. this
  51791. );
  51792. }),
  51793. (n.AudioBuffer.prototype.onReady = function (e) {
  51794. this.ready ? e(this.buffer) : this.readyCallbacks.push(e);
  51795. }),
  51796. (n.PositionalAudio = function (e) {
  51797. n.Audio.call(this, e),
  51798. (this.panner = this.context.createPanner()),
  51799. this.panner.connect(this.gain);
  51800. }),
  51801. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  51802. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  51803. (n.PositionalAudio.prototype.getOutput = function () {
  51804. return this.panner;
  51805. }),
  51806. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  51807. this.panner.refDistance = e;
  51808. }),
  51809. (n.PositionalAudio.prototype.getRefDistance = function () {
  51810. return this.panner.refDistance;
  51811. }),
  51812. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  51813. this.panner.rolloffFactor = e;
  51814. }),
  51815. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  51816. return this.panner.rolloffFactor;
  51817. }),
  51818. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  51819. this.panner.distanceModel = e;
  51820. }),
  51821. (n.PositionalAudio.prototype.getDistanceModel = function () {
  51822. return this.panner.distanceModel;
  51823. }),
  51824. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  51825. this.panner.maxDistance = e;
  51826. }),
  51827. (n.PositionalAudio.prototype.getMaxDistance = function () {
  51828. return this.panner.maxDistance;
  51829. }),
  51830. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  51831. var e = new n.Vector3();
  51832. return function (t) {
  51833. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  51834. e.setFromMatrixPosition(this.matrixWorld),
  51835. this.panner.setPosition(e.x, e.y, e.z);
  51836. };
  51837. })()),
  51838. (n.AudioListener = function () {
  51839. n.Object3D.call(this),
  51840. (this.type = 'AudioListener'),
  51841. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  51842. (this.gain = this.context.createGain()),
  51843. this.gain.connect(this.context.destination),
  51844. (this.filter = null);
  51845. }),
  51846. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  51847. (n.AudioListener.prototype.constructor = n.AudioListener),
  51848. (n.AudioListener.prototype.getInput = function () {
  51849. return this.gain;
  51850. }),
  51851. (n.AudioListener.prototype.removeFilter = function () {
  51852. null !== this.filter &&
  51853. (this.gain.disconnect(this.filter),
  51854. this.filter.disconnect(this.context.destination),
  51855. this.gain.connect(this.context.destination),
  51856. (this.filter = null));
  51857. }),
  51858. (n.AudioListener.prototype.setFilter = function (e) {
  51859. null !== this.filter
  51860. ? (this.gain.disconnect(this.filter),
  51861. this.filter.disconnect(this.context.destination))
  51862. : this.gain.disconnect(this.context.destination),
  51863. (this.filter = e),
  51864. this.gain.connect(this.filter),
  51865. this.filter.connect(this.context.destination);
  51866. }),
  51867. (n.AudioListener.prototype.getFilter = function () {
  51868. return this.filter;
  51869. }),
  51870. (n.AudioListener.prototype.setMasterVolume = function (e) {
  51871. this.gain.gain.value = e;
  51872. }),
  51873. (n.AudioListener.prototype.getMasterVolume = function () {
  51874. return this.gain.gain.value;
  51875. }),
  51876. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  51877. var e = new n.Vector3(),
  51878. t = new n.Quaternion(),
  51879. i = new n.Vector3(),
  51880. r = new n.Vector3();
  51881. return function (o) {
  51882. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  51883. var a = this.context.listener,
  51884. s = this.up;
  51885. this.matrixWorld.decompose(e, t, i),
  51886. r.set(0, 0, -1).applyQuaternion(t),
  51887. a.setPosition(e.x, e.y, e.z),
  51888. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z);
  51889. };
  51890. })()),
  51891. (n.Camera = function () {
  51892. n.Object3D.call(this),
  51893. (this.type = 'Camera'),
  51894. (this.matrixWorldInverse = new n.Matrix4()),
  51895. (this.projectionMatrix = new n.Matrix4());
  51896. }),
  51897. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  51898. (n.Camera.prototype.constructor = n.Camera),
  51899. (n.Camera.prototype.getWorldDirection = (function () {
  51900. var e = new n.Quaternion();
  51901. return function (t) {
  51902. var i = t || new n.Vector3();
  51903. return this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e);
  51904. };
  51905. })()),
  51906. (n.Camera.prototype.lookAt = (function () {
  51907. var e = new n.Matrix4();
  51908. return function (t) {
  51909. e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e);
  51910. };
  51911. })()),
  51912. (n.Camera.prototype.clone = function () {
  51913. return new this.constructor().copy(this);
  51914. }),
  51915. (n.Camera.prototype.copy = function (e) {
  51916. return (
  51917. n.Object3D.prototype.copy.call(this, e),
  51918. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  51919. this.projectionMatrix.copy(e.projectionMatrix),
  51920. this
  51921. );
  51922. }),
  51923. (n.CubeCamera = function (e, t, i) {
  51924. n.Object3D.call(this), (this.type = 'CubeCamera');
  51925. var r = 90,
  51926. o = 1,
  51927. a = new n.PerspectiveCamera(r, o, e, t);
  51928. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a);
  51929. var s = new n.PerspectiveCamera(r, o, e, t);
  51930. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s);
  51931. var l = new n.PerspectiveCamera(r, o, e, t);
  51932. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l);
  51933. var c = new n.PerspectiveCamera(r, o, e, t);
  51934. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c);
  51935. var h = new n.PerspectiveCamera(r, o, e, t);
  51936. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h);
  51937. var u = new n.PerspectiveCamera(r, o, e, t);
  51938. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u);
  51939. var d = {
  51940. format: n.RGBFormat,
  51941. magFilter: n.LinearFilter,
  51942. minFilter: n.LinearFilter,
  51943. };
  51944. (this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  51945. (this.updateCubeMap = function (e, t) {
  51946. null === this.parent && this.updateMatrixWorld();
  51947. var i = this.renderTarget,
  51948. n = i.texture.generateMipmaps;
  51949. (i.texture.generateMipmaps = !1),
  51950. (i.activeCubeFace = 0),
  51951. e.render(t, a, i),
  51952. (i.activeCubeFace = 1),
  51953. e.render(t, s, i),
  51954. (i.activeCubeFace = 2),
  51955. e.render(t, l, i),
  51956. (i.activeCubeFace = 3),
  51957. e.render(t, c, i),
  51958. (i.activeCubeFace = 4),
  51959. e.render(t, h, i),
  51960. (i.texture.generateMipmaps = n),
  51961. (i.activeCubeFace = 5),
  51962. e.render(t, u, i),
  51963. e.setRenderTarget(null);
  51964. });
  51965. }),
  51966. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  51967. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  51968. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  51969. n.Camera.call(this),
  51970. (this.type = 'OrthographicCamera'),
  51971. (this.zoom = 1),
  51972. (this.left = e),
  51973. (this.right = t),
  51974. (this.top = i),
  51975. (this.bottom = r),
  51976. (this.near = void 0 !== o ? o : 0.1),
  51977. (this.far = void 0 !== a ? a : 2e3),
  51978. this.updateProjectionMatrix();
  51979. }),
  51980. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  51981. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  51982. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  51983. var e = (this.right - this.left) / (2 * this.zoom),
  51984. t = (this.top - this.bottom) / (2 * this.zoom),
  51985. i = (this.right + this.left) / 2,
  51986. n = (this.top + this.bottom) / 2;
  51987. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far);
  51988. }),
  51989. (n.OrthographicCamera.prototype.copy = function (e) {
  51990. return (
  51991. n.Camera.prototype.copy.call(this, e),
  51992. (this.left = e.left),
  51993. (this.right = e.right),
  51994. (this.top = e.top),
  51995. (this.bottom = e.bottom),
  51996. (this.near = e.near),
  51997. (this.far = e.far),
  51998. (this.zoom = e.zoom),
  51999. this
  52000. );
  52001. }),
  52002. (n.OrthographicCamera.prototype.toJSON = function (e) {
  52003. var t = n.Object3D.prototype.toJSON.call(this, e);
  52004. return (
  52005. (t.object.zoom = this.zoom),
  52006. (t.object.left = this.left),
  52007. (t.object.right = this.right),
  52008. (t.object.top = this.top),
  52009. (t.object.bottom = this.bottom),
  52010. (t.object.near = this.near),
  52011. (t.object.far = this.far),
  52012. t
  52013. );
  52014. }),
  52015. (n.PerspectiveCamera = function (e, t, i, r) {
  52016. n.Camera.call(this),
  52017. (this.type = 'PerspectiveCamera'),
  52018. (this.focalLength = 10),
  52019. (this.zoom = 1),
  52020. (this.fov = void 0 !== e ? e : 50),
  52021. (this.aspect = void 0 !== t ? t : 1),
  52022. (this.near = void 0 !== i ? i : 0.1),
  52023. (this.far = void 0 !== r ? r : 2e3),
  52024. this.updateProjectionMatrix();
  52025. }),
  52026. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  52027. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  52028. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  52029. void 0 === t && (t = 24),
  52030. (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))),
  52031. this.updateProjectionMatrix();
  52032. }),
  52033. (n.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  52034. (this.fullWidth = e),
  52035. (this.fullHeight = t),
  52036. (this.x = i),
  52037. (this.y = n),
  52038. (this.width = r),
  52039. (this.height = o),
  52040. this.updateProjectionMatrix();
  52041. }),
  52042. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  52043. var e = n.Math.radToDeg(
  52044. 2 * Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom)
  52045. );
  52046. if (this.fullWidth) {
  52047. var t = this.fullWidth / this.fullHeight,
  52048. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  52049. r = -i,
  52050. o = t * r,
  52051. a = t * i,
  52052. s = Math.abs(a - o),
  52053. l = Math.abs(i - r);
  52054. this.projectionMatrix.makeFrustum(
  52055. o + (this.x * s) / this.fullWidth,
  52056. o + ((this.x + this.width) * s) / this.fullWidth,
  52057. i - ((this.y + this.height) * l) / this.fullHeight,
  52058. i - (this.y * l) / this.fullHeight,
  52059. this.near,
  52060. this.far
  52061. );
  52062. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far);
  52063. }),
  52064. (n.PerspectiveCamera.prototype.copy = function (e) {
  52065. return (
  52066. n.Camera.prototype.copy.call(this, e),
  52067. (this.focalLength = e.focalLength),
  52068. (this.zoom = e.zoom),
  52069. (this.fov = e.fov),
  52070. (this.aspect = e.aspect),
  52071. (this.near = e.near),
  52072. (this.far = e.far),
  52073. this
  52074. );
  52075. }),
  52076. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  52077. var t = n.Object3D.prototype.toJSON.call(this, e);
  52078. return (
  52079. (t.object.focalLength = this.focalLength),
  52080. (t.object.zoom = this.zoom),
  52081. (t.object.fov = this.fov),
  52082. (t.object.aspect = this.aspect),
  52083. (t.object.near = this.near),
  52084. (t.object.far = this.far),
  52085. t
  52086. );
  52087. }),
  52088. (n.StereoCamera = function () {
  52089. (this.type = 'StereoCamera'),
  52090. (this.aspect = 1),
  52091. (this.cameraL = new n.PerspectiveCamera()),
  52092. this.cameraL.layers.enable(1),
  52093. (this.cameraL.matrixAutoUpdate = !1),
  52094. (this.cameraR = new n.PerspectiveCamera()),
  52095. this.cameraR.layers.enable(2),
  52096. (this.cameraR.matrixAutoUpdate = !1);
  52097. }),
  52098. (n.StereoCamera.prototype = {
  52099. constructor: n.StereoCamera,
  52100. update: (function () {
  52101. var e,
  52102. t,
  52103. i,
  52104. r,
  52105. o,
  52106. a = new n.Matrix4(),
  52107. s = new n.Matrix4();
  52108. return function (l) {
  52109. var c =
  52110. e !== l.focalLength ||
  52111. t !== l.fov ||
  52112. i !== l.aspect * this.aspect ||
  52113. r !== l.near ||
  52114. o !== l.far;
  52115. if (c) {
  52116. (e = l.focalLength),
  52117. (t = l.fov),
  52118. (i = l.aspect * this.aspect),
  52119. (r = l.near),
  52120. (o = l.far);
  52121. var h,
  52122. u,
  52123. d = l.projectionMatrix.clone(),
  52124. p = 0.032,
  52125. f = (p * r) / e,
  52126. g = r * Math.tan(n.Math.degToRad(0.5 * t));
  52127. (s.elements[12] = -p),
  52128. (a.elements[12] = p),
  52129. (h = -g * i + f),
  52130. (u = g * i + f),
  52131. (d.elements[0] = (2 * r) / (u - h)),
  52132. (d.elements[8] = (u + h) / (u - h)),
  52133. this.cameraL.projectionMatrix.copy(d),
  52134. (h = -g * i - f),
  52135. (u = g * i - f),
  52136. (d.elements[0] = (2 * r) / (u - h)),
  52137. (d.elements[8] = (u + h) / (u - h)),
  52138. this.cameraR.projectionMatrix.copy(d);
  52139. }
  52140. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  52141. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a);
  52142. };
  52143. })(),
  52144. }),
  52145. (n.Light = function (e, t) {
  52146. n.Object3D.call(this),
  52147. (this.type = 'Light'),
  52148. (this.color = new n.Color(e)),
  52149. (this.intensity = void 0 !== t ? t : 1),
  52150. (this.receiveShadow = void 0);
  52151. }),
  52152. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  52153. (n.Light.prototype.constructor = n.Light),
  52154. (n.Light.prototype.copy = function (e) {
  52155. return (
  52156. n.Object3D.prototype.copy.call(this, e),
  52157. this.color.copy(e.color),
  52158. (this.intensity = e.intensity),
  52159. this
  52160. );
  52161. }),
  52162. (n.Light.prototype.toJSON = function (e) {
  52163. var t = n.Object3D.prototype.toJSON.call(this, e);
  52164. return (
  52165. (t.object.color = this.color.getHex()),
  52166. (t.object.intensity = this.intensity),
  52167. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  52168. void 0 !== this.distance && (t.object.distance = this.distance),
  52169. void 0 !== this.angle && (t.object.angle = this.angle),
  52170. void 0 !== this.decay && (t.object.decay = this.decay),
  52171. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  52172. t
  52173. );
  52174. }),
  52175. (n.LightShadow = function (e) {
  52176. (this.camera = e),
  52177. (this.bias = 0),
  52178. (this.radius = 1),
  52179. (this.mapSize = new n.Vector2(512, 512)),
  52180. (this.map = null),
  52181. (this.matrix = new n.Matrix4());
  52182. }),
  52183. (n.LightShadow.prototype = {
  52184. constructor: n.LightShadow,
  52185. copy: function (e) {
  52186. return (
  52187. (this.camera = e.camera.clone()),
  52188. (this.bias = e.bias),
  52189. (this.radius = e.radius),
  52190. this.mapSize.copy(e.mapSize),
  52191. this
  52192. );
  52193. },
  52194. clone: function () {
  52195. return new this.constructor().copy(this);
  52196. },
  52197. }),
  52198. (n.AmbientLight = function (e, t) {
  52199. n.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0);
  52200. }),
  52201. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  52202. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  52203. (n.DirectionalLight = function (e, t) {
  52204. n.Light.call(this, e, t),
  52205. (this.type = 'DirectionalLight'),
  52206. this.position.set(0, 1, 0),
  52207. this.updateMatrix(),
  52208. (this.target = new n.Object3D()),
  52209. (this.shadow = new n.LightShadow(new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)));
  52210. }),
  52211. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  52212. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  52213. (n.DirectionalLight.prototype.copy = function (e) {
  52214. return (
  52215. n.Light.prototype.copy.call(this, e),
  52216. (this.target = e.target.clone()),
  52217. (this.shadow = e.shadow.clone()),
  52218. this
  52219. );
  52220. }),
  52221. (n.HemisphereLight = function (e, t, i) {
  52222. n.Light.call(this, e, i),
  52223. (this.type = 'HemisphereLight'),
  52224. (this.castShadow = void 0),
  52225. this.position.set(0, 1, 0),
  52226. this.updateMatrix(),
  52227. (this.groundColor = new n.Color(t));
  52228. }),
  52229. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  52230. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  52231. (n.HemisphereLight.prototype.copy = function (e) {
  52232. return n.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this;
  52233. }),
  52234. (n.PointLight = function (e, t, i, r) {
  52235. n.Light.call(this, e, t),
  52236. (this.type = 'PointLight'),
  52237. (this.distance = void 0 !== i ? i : 0),
  52238. (this.decay = void 0 !== r ? r : 1),
  52239. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(90, 1, 0.5, 500)));
  52240. }),
  52241. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  52242. (n.PointLight.prototype.constructor = n.PointLight),
  52243. Object.defineProperty(n.PointLight.prototype, 'power', {
  52244. get: function () {
  52245. return 4 * this.intensity * Math.PI;
  52246. },
  52247. set: function (e) {
  52248. this.intensity = e / (4 * Math.PI);
  52249. },
  52250. }),
  52251. (n.PointLight.prototype.copy = function (e) {
  52252. return (
  52253. n.Light.prototype.copy.call(this, e),
  52254. (this.distance = e.distance),
  52255. (this.decay = e.decay),
  52256. (this.shadow = e.shadow.clone()),
  52257. this
  52258. );
  52259. }),
  52260. (n.SpotLight = function (e, t, i, r, o, a) {
  52261. n.Light.call(this, e, t),
  52262. (this.type = 'SpotLight'),
  52263. this.position.set(0, 1, 0),
  52264. this.updateMatrix(),
  52265. (this.target = new n.Object3D()),
  52266. (this.distance = void 0 !== i ? i : 0),
  52267. (this.angle = void 0 !== r ? r : Math.PI / 3),
  52268. (this.penumbra = void 0 !== o ? o : 0),
  52269. (this.decay = void 0 !== a ? a : 1),
  52270. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(50, 1, 0.5, 500)));
  52271. }),
  52272. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  52273. (n.SpotLight.prototype.constructor = n.SpotLight),
  52274. Object.defineProperty(n.SpotLight.prototype, 'power', {
  52275. get: function () {
  52276. return this.intensity * Math.PI;
  52277. },
  52278. set: function (e) {
  52279. this.intensity = e / Math.PI;
  52280. },
  52281. }),
  52282. (n.SpotLight.prototype.copy = function (e) {
  52283. return (
  52284. n.Light.prototype.copy.call(this, e),
  52285. (this.distance = e.distance),
  52286. (this.angle = e.angle),
  52287. (this.penumbra = e.penumbra),
  52288. (this.decay = e.decay),
  52289. (this.target = e.target.clone()),
  52290. (this.shadow = e.shadow.clone()),
  52291. this
  52292. );
  52293. }),
  52294. (n.Cache = {
  52295. enabled: !1,
  52296. files: {},
  52297. add: function (e, t) {
  52298. this.enabled !== !1 && (this.files[e] = t);
  52299. },
  52300. get: function (e) {
  52301. if (this.enabled !== !1) return this.files[e];
  52302. },
  52303. remove: function (e) {
  52304. delete this.files[e];
  52305. },
  52306. clear: function () {
  52307. this.files = {};
  52308. },
  52309. }),
  52310. (n.Loader = function () {
  52311. (this.onLoadStart = function () {}),
  52312. (this.onLoadProgress = function () {}),
  52313. (this.onLoadComplete = function () {});
  52314. }),
  52315. (n.Loader.prototype = {
  52316. constructor: n.Loader,
  52317. crossOrigin: void 0,
  52318. extractUrlBase: function (e) {
  52319. var t = e.split('/');
  52320. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/');
  52321. },
  52322. initMaterials: function (e, t, i) {
  52323. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i);
  52324. return n;
  52325. },
  52326. createMaterial: (function () {
  52327. var e, t, i;
  52328. return function (r, o, a) {
  52329. function s(e, i, r, s, c) {
  52330. var h,
  52331. u = o + e,
  52332. d = n.Loader.Handlers.get(u);
  52333. null !== d ? (h = d.load(u)) : (t.setCrossOrigin(a), (h = t.load(u))),
  52334. void 0 !== i &&
  52335. (h.repeat.fromArray(i),
  52336. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  52337. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  52338. void 0 !== r && h.offset.fromArray(r),
  52339. void 0 !== s &&
  52340. ('repeat' === s[0] && (h.wrapS = n.RepeatWrapping),
  52341. 'mirror' === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  52342. 'repeat' === s[1] && (h.wrapT = n.RepeatWrapping),
  52343. 'mirror' === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  52344. void 0 !== c && (h.anisotropy = c);
  52345. var p = n.Math.generateUUID();
  52346. return (l[p] = h), p;
  52347. }
  52348. void 0 === e && (e = new n.Color()),
  52349. void 0 === t && (t = new n.TextureLoader()),
  52350. void 0 === i && (i = new n.MaterialLoader());
  52351. var l = {},
  52352. c = {
  52353. uuid: n.Math.generateUUID(),
  52354. type: 'MeshLambertMaterial',
  52355. };
  52356. for (var h in r) {
  52357. var u = r[h];
  52358. switch (h) {
  52359. case 'DbgColor':
  52360. case 'DbgIndex':
  52361. case 'opticalDensity':
  52362. case 'illumination':
  52363. break;
  52364. case 'DbgName':
  52365. c.name = u;
  52366. break;
  52367. case 'blending':
  52368. c.blending = n[u];
  52369. break;
  52370. case 'colorAmbient':
  52371. case 'mapAmbient':
  52372. console.warn('THREE.Loader.createMaterial:', h, 'is no longer supported.');
  52373. break;
  52374. case 'colorDiffuse':
  52375. c.color = e.fromArray(u).getHex();
  52376. break;
  52377. case 'colorSpecular':
  52378. c.specular = e.fromArray(u).getHex();
  52379. break;
  52380. case 'colorEmissive':
  52381. c.emissive = e.fromArray(u).getHex();
  52382. break;
  52383. case 'specularCoef':
  52384. c.shininess = u;
  52385. break;
  52386. case 'shading':
  52387. 'basic' === u.toLowerCase() && (c.type = 'MeshBasicMaterial'),
  52388. 'phong' === u.toLowerCase() && (c.type = 'MeshPhongMaterial');
  52389. break;
  52390. case 'mapDiffuse':
  52391. c.map = s(
  52392. u,
  52393. r.mapDiffuseRepeat,
  52394. r.mapDiffuseOffset,
  52395. r.mapDiffuseWrap,
  52396. r.mapDiffuseAnisotropy
  52397. );
  52398. break;
  52399. case 'mapDiffuseRepeat':
  52400. case 'mapDiffuseOffset':
  52401. case 'mapDiffuseWrap':
  52402. case 'mapDiffuseAnisotropy':
  52403. break;
  52404. case 'mapLight':
  52405. c.lightMap = s(
  52406. u,
  52407. r.mapLightRepeat,
  52408. r.mapLightOffset,
  52409. r.mapLightWrap,
  52410. r.mapLightAnisotropy
  52411. );
  52412. break;
  52413. case 'mapLightRepeat':
  52414. case 'mapLightOffset':
  52415. case 'mapLightWrap':
  52416. case 'mapLightAnisotropy':
  52417. break;
  52418. case 'mapAO':
  52419. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  52420. break;
  52421. case 'mapAORepeat':
  52422. case 'mapAOOffset':
  52423. case 'mapAOWrap':
  52424. case 'mapAOAnisotropy':
  52425. break;
  52426. case 'mapBump':
  52427. c.bumpMap = s(
  52428. u,
  52429. r.mapBumpRepeat,
  52430. r.mapBumpOffset,
  52431. r.mapBumpWrap,
  52432. r.mapBumpAnisotropy
  52433. );
  52434. break;
  52435. case 'mapBumpScale':
  52436. c.bumpScale = u;
  52437. break;
  52438. case 'mapBumpRepeat':
  52439. case 'mapBumpOffset':
  52440. case 'mapBumpWrap':
  52441. case 'mapBumpAnisotropy':
  52442. break;
  52443. case 'mapNormal':
  52444. c.normalMap = s(
  52445. u,
  52446. r.mapNormalRepeat,
  52447. r.mapNormalOffset,
  52448. r.mapNormalWrap,
  52449. r.mapNormalAnisotropy
  52450. );
  52451. break;
  52452. case 'mapNormalFactor':
  52453. c.normalScale = [u, u];
  52454. break;
  52455. case 'mapNormalRepeat':
  52456. case 'mapNormalOffset':
  52457. case 'mapNormalWrap':
  52458. case 'mapNormalAnisotropy':
  52459. break;
  52460. case 'mapSpecular':
  52461. c.specularMap = s(
  52462. u,
  52463. r.mapSpecularRepeat,
  52464. r.mapSpecularOffset,
  52465. r.mapSpecularWrap,
  52466. r.mapSpecularAnisotropy
  52467. );
  52468. break;
  52469. case 'mapSpecularRepeat':
  52470. case 'mapSpecularOffset':
  52471. case 'mapSpecularWrap':
  52472. case 'mapSpecularAnisotropy':
  52473. break;
  52474. case 'mapAlpha':
  52475. c.alphaMap = s(
  52476. u,
  52477. r.mapAlphaRepeat,
  52478. r.mapAlphaOffset,
  52479. r.mapAlphaWrap,
  52480. r.mapAlphaAnisotropy
  52481. );
  52482. break;
  52483. case 'mapAlphaRepeat':
  52484. case 'mapAlphaOffset':
  52485. case 'mapAlphaWrap':
  52486. case 'mapAlphaAnisotropy':
  52487. break;
  52488. case 'flipSided':
  52489. c.side = n.BackSide;
  52490. break;
  52491. case 'doubleSided':
  52492. c.side = n.DoubleSide;
  52493. break;
  52494. case 'transparency':
  52495. console.warn(
  52496. 'THREE.Loader.createMaterial: transparency has been renamed to opacity'
  52497. ),
  52498. (c.opacity = u);
  52499. break;
  52500. case 'depthTest':
  52501. case 'depthWrite':
  52502. case 'colorWrite':
  52503. case 'opacity':
  52504. case 'reflectivity':
  52505. case 'transparent':
  52506. case 'visible':
  52507. case 'wireframe':
  52508. c[h] = u;
  52509. break;
  52510. case 'vertexColors':
  52511. u === !0 && (c.vertexColors = n.VertexColors),
  52512. 'face' === u && (c.vertexColors = n.FaceColors);
  52513. break;
  52514. default:
  52515. console.error('THREE.Loader.createMaterial: Unsupported', h, u);
  52516. }
  52517. }
  52518. return (
  52519. 'MeshBasicMaterial' === c.type && delete c.emissive,
  52520. 'MeshPhongMaterial' !== c.type && delete c.specular,
  52521. c.opacity < 1 && (c.transparent = !0),
  52522. i.setTextures(l),
  52523. i.parse(c)
  52524. );
  52525. };
  52526. })(),
  52527. }),
  52528. (n.Loader.Handlers = {
  52529. handlers: [],
  52530. add: function (e, t) {
  52531. this.handlers.push(e, t);
  52532. },
  52533. get: function (e) {
  52534. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  52535. var r = t[i],
  52536. o = t[i + 1];
  52537. if (r.test(e)) return o;
  52538. }
  52539. return null;
  52540. },
  52541. }),
  52542. (n.XHRLoader = function (e) {
  52543. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  52544. }),
  52545. (n.XHRLoader.prototype = {
  52546. constructor: n.XHRLoader,
  52547. load: function (e, t, i, r) {
  52548. void 0 !== this.path && (e = this.path + e);
  52549. var o = this,
  52550. a = n.Cache.get(e);
  52551. if (void 0 !== a)
  52552. return (
  52553. t &&
  52554. setTimeout(function () {
  52555. t(a);
  52556. }, 0),
  52557. a
  52558. );
  52559. var s = new XMLHttpRequest();
  52560. return (
  52561. s.overrideMimeType('text/plain'),
  52562. s.open('GET', e, !0),
  52563. s.addEventListener(
  52564. 'load',
  52565. function (i) {
  52566. var a = i.target.response;
  52567. n.Cache.add(e, a),
  52568. 200 === this.status
  52569. ? (t && t(a), o.manager.itemEnd(e))
  52570. : 0 === this.status
  52571. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'),
  52572. t && t(a),
  52573. o.manager.itemEnd(e))
  52574. : (r && r(i), o.manager.itemError(e));
  52575. },
  52576. !1
  52577. ),
  52578. void 0 !== i &&
  52579. s.addEventListener(
  52580. 'progress',
  52581. function (e) {
  52582. i(e);
  52583. },
  52584. !1
  52585. ),
  52586. s.addEventListener(
  52587. 'error',
  52588. function (t) {
  52589. r && r(t), o.manager.itemError(e);
  52590. },
  52591. !1
  52592. ),
  52593. void 0 !== this.responseType && (s.responseType = this.responseType),
  52594. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  52595. s.send(null),
  52596. o.manager.itemStart(e),
  52597. s
  52598. );
  52599. },
  52600. setPath: function (e) {
  52601. this.path = e;
  52602. },
  52603. setResponseType: function (e) {
  52604. this.responseType = e;
  52605. },
  52606. setWithCredentials: function (e) {
  52607. this.withCredentials = e;
  52608. },
  52609. }),
  52610. (n.FontLoader = function (e) {
  52611. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  52612. }),
  52613. (n.FontLoader.prototype = {
  52614. constructor: n.FontLoader,
  52615. load: function (e, t, i, r) {
  52616. var o = new n.XHRLoader(this.manager);
  52617. o.load(
  52618. e,
  52619. function (e) {
  52620. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))));
  52621. },
  52622. i,
  52623. r
  52624. );
  52625. },
  52626. }),
  52627. (n.ImageLoader = function (e) {
  52628. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  52629. }),
  52630. (n.ImageLoader.prototype = {
  52631. constructor: n.ImageLoader,
  52632. load: function (e, t, i, r) {
  52633. void 0 !== this.path && (e = this.path + e);
  52634. var o = this,
  52635. a = n.Cache.get(e);
  52636. if (void 0 !== a)
  52637. return (
  52638. o.manager.itemStart(e),
  52639. t
  52640. ? setTimeout(function () {
  52641. t(a), o.manager.itemEnd(e);
  52642. }, 0)
  52643. : o.manager.itemEnd(e),
  52644. a
  52645. );
  52646. var s = document.createElement('img');
  52647. return (
  52648. s.addEventListener(
  52649. 'load',
  52650. function (i) {
  52651. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e);
  52652. },
  52653. !1
  52654. ),
  52655. void 0 !== i &&
  52656. s.addEventListener(
  52657. 'progress',
  52658. function (e) {
  52659. i(e);
  52660. },
  52661. !1
  52662. ),
  52663. s.addEventListener(
  52664. 'error',
  52665. function (t) {
  52666. r && r(t), o.manager.itemError(e);
  52667. },
  52668. !1
  52669. ),
  52670. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  52671. o.manager.itemStart(e),
  52672. (s.src = e),
  52673. s
  52674. );
  52675. },
  52676. setCrossOrigin: function (e) {
  52677. this.crossOrigin = e;
  52678. },
  52679. setPath: function (e) {
  52680. this.path = e;
  52681. },
  52682. }),
  52683. (n.JSONLoader = function (e) {
  52684. 'boolean' == typeof e &&
  52685. (console.warn(
  52686. 'THREE.JSONLoader: showStatus parameter has been removed from constructor.'
  52687. ),
  52688. (e = void 0)),
  52689. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  52690. (this.withCredentials = !1);
  52691. }),
  52692. (n.JSONLoader.prototype = {
  52693. constructor: n.JSONLoader,
  52694. get statusDomElement() {
  52695. return (
  52696. void 0 === this._statusDomElement &&
  52697. (this._statusDomElement = document.createElement('div')),
  52698. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  52699. this._statusDomElement
  52700. );
  52701. },
  52702. load: function (e, t, i, r) {
  52703. var o = this,
  52704. a =
  52705. this.texturePath && 'string' == typeof this.texturePath
  52706. ? this.texturePath
  52707. : n.Loader.prototype.extractUrlBase(e),
  52708. s = new n.XHRLoader(this.manager);
  52709. s.setWithCredentials(this.withCredentials),
  52710. s.load(
  52711. e,
  52712. function (i) {
  52713. var n = JSON.parse(i),
  52714. r = n.metadata;
  52715. if (void 0 !== r) {
  52716. var s = r.type;
  52717. if (void 0 !== s) {
  52718. if ('object' === s.toLowerCase())
  52719. return void console.error(
  52720. 'THREE.JSONLoader: ' +
  52721. e +
  52722. ' should be loaded with THREE.ObjectLoader instead.'
  52723. );
  52724. if ('scene' === s.toLowerCase())
  52725. return void console.error(
  52726. 'THREE.JSONLoader: ' +
  52727. e +
  52728. ' should be loaded with THREE.SceneLoader instead.'
  52729. );
  52730. }
  52731. }
  52732. var l = o.parse(n, a);
  52733. t(l.geometry, l.materials);
  52734. },
  52735. i,
  52736. r
  52737. );
  52738. },
  52739. setTexturePath: function (e) {
  52740. this.texturePath = e;
  52741. },
  52742. parse: function (e, t) {
  52743. function i(t) {
  52744. function i(e, t) {
  52745. return e & (1 << t);
  52746. }
  52747. var r,
  52748. o,
  52749. a,
  52750. l,
  52751. c,
  52752. h,
  52753. u,
  52754. d,
  52755. p,
  52756. f,
  52757. g,
  52758. m,
  52759. v,
  52760. A,
  52761. y,
  52762. C,
  52763. I,
  52764. E,
  52765. b,
  52766. w,
  52767. _,
  52768. T,
  52769. x,
  52770. S,
  52771. M,
  52772. R,
  52773. P,
  52774. O = e.faces,
  52775. L = e.vertices,
  52776. D = e.normals,
  52777. N = e.colors,
  52778. B = 0;
  52779. if (void 0 !== e.uvs) {
  52780. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++;
  52781. for (r = 0; r < B; r++) s.faceVertexUvs[r] = [];
  52782. }
  52783. for (l = 0, c = L.length; l < c; )
  52784. (E = new n.Vector3()),
  52785. (E.x = L[l++] * t),
  52786. (E.y = L[l++] * t),
  52787. (E.z = L[l++] * t),
  52788. s.vertices.push(E);
  52789. for (l = 0, c = O.length; l < c; )
  52790. if (
  52791. ((f = O[l++]),
  52792. (g = i(f, 0)),
  52793. (m = i(f, 1)),
  52794. (v = i(f, 3)),
  52795. (A = i(f, 4)),
  52796. (y = i(f, 5)),
  52797. (C = i(f, 6)),
  52798. (I = i(f, 7)),
  52799. g)
  52800. ) {
  52801. if (
  52802. ((w = new n.Face3()),
  52803. (w.a = O[l]),
  52804. (w.b = O[l + 1]),
  52805. (w.c = O[l + 3]),
  52806. (_ = new n.Face3()),
  52807. (_.a = O[l + 1]),
  52808. (_.b = O[l + 2]),
  52809. (_.c = O[l + 3]),
  52810. (l += 4),
  52811. m && ((p = O[l++]), (w.materialIndex = p), (_.materialIndex = p)),
  52812. (a = s.faces.length),
  52813. v)
  52814. )
  52815. for (r = 0; r < B; r++)
  52816. for (
  52817. S = e.uvs[r],
  52818. s.faceVertexUvs[r][a] = [],
  52819. s.faceVertexUvs[r][a + 1] = [],
  52820. o = 0;
  52821. o < 4;
  52822. o++
  52823. )
  52824. (d = O[l++]),
  52825. (R = S[2 * d]),
  52826. (P = S[2 * d + 1]),
  52827. (M = new n.Vector2(R, P)),
  52828. 2 !== o && s.faceVertexUvs[r][a].push(M),
  52829. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  52830. if (
  52831. (A &&
  52832. ((u = 3 * O[l++]),
  52833. w.normal.set(D[u++], D[u++], D[u]),
  52834. _.normal.copy(w.normal)),
  52835. y)
  52836. )
  52837. for (r = 0; r < 4; r++)
  52838. (u = 3 * O[l++]),
  52839. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52840. 2 !== r && w.vertexNormals.push(x),
  52841. 0 !== r && _.vertexNormals.push(x);
  52842. if ((C && ((h = O[l++]), (T = N[h]), w.color.setHex(T), _.color.setHex(T)), I))
  52843. for (r = 0; r < 4; r++)
  52844. (h = O[l++]),
  52845. (T = N[h]),
  52846. 2 !== r && w.vertexColors.push(new n.Color(T)),
  52847. 0 !== r && _.vertexColors.push(new n.Color(T));
  52848. s.faces.push(w), s.faces.push(_);
  52849. } else {
  52850. if (
  52851. ((b = new n.Face3()),
  52852. (b.a = O[l++]),
  52853. (b.b = O[l++]),
  52854. (b.c = O[l++]),
  52855. m && ((p = O[l++]), (b.materialIndex = p)),
  52856. (a = s.faces.length),
  52857. v)
  52858. )
  52859. for (r = 0; r < B; r++)
  52860. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0; o < 3; o++)
  52861. (d = O[l++]),
  52862. (R = S[2 * d]),
  52863. (P = S[2 * d + 1]),
  52864. (M = new n.Vector2(R, P)),
  52865. s.faceVertexUvs[r][a].push(M);
  52866. if ((A && ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])), y))
  52867. for (r = 0; r < 3; r++)
  52868. (u = 3 * O[l++]),
  52869. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52870. b.vertexNormals.push(x);
  52871. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I))
  52872. for (r = 0; r < 3; r++) (h = O[l++]), b.vertexColors.push(new n.Color(N[h]));
  52873. s.faces.push(b);
  52874. }
  52875. }
  52876. function r() {
  52877. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  52878. if (e.skinWeights)
  52879. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  52880. var o = e.skinWeights[i],
  52881. a = t > 1 ? e.skinWeights[i + 1] : 0,
  52882. l = t > 2 ? e.skinWeights[i + 2] : 0,
  52883. c = t > 3 ? e.skinWeights[i + 3] : 0;
  52884. s.skinWeights.push(new n.Vector4(o, a, l, c));
  52885. }
  52886. if (e.skinIndices)
  52887. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  52888. var h = e.skinIndices[i],
  52889. u = t > 1 ? e.skinIndices[i + 1] : 0,
  52890. d = t > 2 ? e.skinIndices[i + 2] : 0,
  52891. p = t > 3 ? e.skinIndices[i + 3] : 0;
  52892. s.skinIndices.push(new n.Vector4(h, u, d, p));
  52893. }
  52894. (s.bones = e.bones),
  52895. s.bones &&
  52896. s.bones.length > 0 &&
  52897. (s.skinWeights.length !== s.skinIndices.length ||
  52898. s.skinIndices.length !== s.vertices.length) &&
  52899. console.warn(
  52900. 'When skinning, number of vertices (' +
  52901. s.vertices.length +
  52902. '), skinIndices (' +
  52903. s.skinIndices.length +
  52904. '), and skinWeights (' +
  52905. s.skinWeights.length +
  52906. ') should match.'
  52907. );
  52908. }
  52909. function o(t) {
  52910. if (void 0 !== e.morphTargets)
  52911. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  52912. (s.morphTargets[i] = {}),
  52913. (s.morphTargets[i].name = e.morphTargets[i].name),
  52914. (s.morphTargets[i].vertices = []);
  52915. for (
  52916. var o = s.morphTargets[i].vertices,
  52917. a = e.morphTargets[i].vertices,
  52918. l = 0,
  52919. c = a.length;
  52920. l < c;
  52921. l += 3
  52922. ) {
  52923. var h = new n.Vector3();
  52924. (h.x = a[l] * t), (h.y = a[l + 1] * t), (h.z = a[l + 2] * t), o.push(h);
  52925. }
  52926. }
  52927. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  52928. console.warn(
  52929. 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
  52930. );
  52931. for (
  52932. var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length;
  52933. i < r;
  52934. i++
  52935. )
  52936. u[i].color.fromArray(d, 3 * i);
  52937. }
  52938. }
  52939. function a() {
  52940. var t = [],
  52941. i = [];
  52942. void 0 !== e.animation && i.push(e.animation),
  52943. void 0 !== e.animations &&
  52944. (e.animations.length ? (i = i.concat(e.animations)) : i.push(e.animations));
  52945. for (var r = 0; r < i.length; r++) {
  52946. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  52947. o && t.push(o);
  52948. }
  52949. if (s.morphTargets) {
  52950. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  52951. t = t.concat(a);
  52952. }
  52953. t.length > 0 && (s.animations = t);
  52954. }
  52955. var s = new n.Geometry(),
  52956. l = void 0 !== e.scale ? 1 / e.scale : 1;
  52957. if (
  52958. (i(l),
  52959. r(),
  52960. o(l),
  52961. a(),
  52962. s.computeFaceNormals(),
  52963. s.computeBoundingSphere(),
  52964. void 0 === e.materials || 0 === e.materials.length)
  52965. )
  52966. return {
  52967. geometry: s,
  52968. };
  52969. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  52970. return {
  52971. geometry: s,
  52972. materials: c,
  52973. };
  52974. },
  52975. }),
  52976. (n.LoadingManager = function (e, t, i) {
  52977. var n = this,
  52978. r = !1,
  52979. o = 0,
  52980. a = 0;
  52981. (this.onStart = void 0),
  52982. (this.onLoad = e),
  52983. (this.onProgress = t),
  52984. (this.onError = i),
  52985. (this.itemStart = function (e) {
  52986. a++, r === !1 && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0);
  52987. }),
  52988. (this.itemEnd = function (e) {
  52989. o++,
  52990. void 0 !== n.onProgress && n.onProgress(e, o, a),
  52991. o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad());
  52992. }),
  52993. (this.itemError = function (e) {
  52994. void 0 !== n.onError && n.onError(e);
  52995. });
  52996. }),
  52997. (n.DefaultLoadingManager = new n.LoadingManager()),
  52998. (n.BufferGeometryLoader = function (e) {
  52999. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  53000. }),
  53001. (n.BufferGeometryLoader.prototype = {
  53002. constructor: n.BufferGeometryLoader,
  53003. load: function (e, t, i, r) {
  53004. var o = this,
  53005. a = new n.XHRLoader(o.manager);
  53006. a.load(
  53007. e,
  53008. function (e) {
  53009. t(o.parse(JSON.parse(e)));
  53010. },
  53011. i,
  53012. r
  53013. );
  53014. },
  53015. parse: function (e) {
  53016. var t = new n.BufferGeometry(),
  53017. i = e.data.index,
  53018. r = {
  53019. Int8Array: Int8Array,
  53020. Uint8Array: Uint8Array,
  53021. Uint8ClampedArray: Uint8ClampedArray,
  53022. Int16Array: Int16Array,
  53023. Uint16Array: Uint16Array,
  53024. Int32Array: Int32Array,
  53025. Uint32Array: Uint32Array,
  53026. Float32Array: Float32Array,
  53027. Float64Array: Float64Array,
  53028. };
  53029. if (void 0 !== i) {
  53030. var o = new r[i.type](i.array);
  53031. t.setIndex(new n.BufferAttribute(o, 1));
  53032. }
  53033. var a = e.data.attributes;
  53034. for (var s in a) {
  53035. var l = a[s],
  53036. o = new r[l.type](l.array);
  53037. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize));
  53038. }
  53039. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  53040. if (void 0 !== c)
  53041. for (var h = 0, u = c.length; h !== u; ++h) {
  53042. var d = c[h];
  53043. t.addGroup(d.start, d.count, d.materialIndex);
  53044. }
  53045. var p = e.data.boundingSphere;
  53046. if (void 0 !== p) {
  53047. var f = new n.Vector3();
  53048. void 0 !== p.center && f.fromArray(p.center),
  53049. (t.boundingSphere = new n.Sphere(f, p.radius));
  53050. }
  53051. return t;
  53052. },
  53053. }),
  53054. (n.MaterialLoader = function (e) {
  53055. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.textures = {});
  53056. }),
  53057. (n.MaterialLoader.prototype = {
  53058. constructor: n.MaterialLoader,
  53059. load: function (e, t, i, r) {
  53060. var o = this,
  53061. a = new n.XHRLoader(o.manager);
  53062. a.load(
  53063. e,
  53064. function (e) {
  53065. t(o.parse(JSON.parse(e)));
  53066. },
  53067. i,
  53068. r
  53069. );
  53070. },
  53071. setTextures: function (e) {
  53072. this.textures = e;
  53073. },
  53074. getTexture: function (e) {
  53075. var t = this.textures;
  53076. return (
  53077. void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  53078. );
  53079. },
  53080. parse: function (e) {
  53081. var t = new n[e.type]();
  53082. if (
  53083. (void 0 !== e.uuid && (t.uuid = e.uuid),
  53084. void 0 !== e.name && (t.name = e.name),
  53085. void 0 !== e.color && t.color.setHex(e.color),
  53086. void 0 !== e.roughness && (t.roughness = e.roughness),
  53087. void 0 !== e.metalness && (t.metalness = e.metalness),
  53088. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  53089. void 0 !== e.specular && t.specular.setHex(e.specular),
  53090. void 0 !== e.shininess && (t.shininess = e.shininess),
  53091. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  53092. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  53093. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  53094. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  53095. void 0 !== e.shading && (t.shading = e.shading),
  53096. void 0 !== e.blending && (t.blending = e.blending),
  53097. void 0 !== e.side && (t.side = e.side),
  53098. void 0 !== e.opacity && (t.opacity = e.opacity),
  53099. void 0 !== e.transparent && (t.transparent = e.transparent),
  53100. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  53101. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  53102. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  53103. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  53104. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  53105. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  53106. void 0 !== e.size && (t.size = e.size),
  53107. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  53108. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  53109. void 0 !== e.alphaMap &&
  53110. ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  53111. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  53112. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  53113. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  53114. void 0 !== e.normalScale)
  53115. ) {
  53116. var i = e.normalScale;
  53117. Array.isArray(i) === !1 && (i = [i, i]),
  53118. (t.normalScale = new n.Vector2().fromArray(i));
  53119. }
  53120. if (
  53121. (void 0 !== e.displacementMap &&
  53122. (t.displacementMap = this.getTexture(e.displacementMap)),
  53123. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  53124. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  53125. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  53126. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  53127. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  53128. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  53129. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  53130. void 0 !== e.envMap &&
  53131. ((t.envMap = this.getTexture(e.envMap)), (t.combine = n.MultiplyOperation)),
  53132. e.reflectivity && (t.reflectivity = e.reflectivity),
  53133. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  53134. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  53135. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  53136. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  53137. void 0 !== e.materials)
  53138. )
  53139. for (var r = 0, o = e.materials.length; r < o; r++)
  53140. t.materials.push(this.parse(e.materials[r]));
  53141. return t;
  53142. },
  53143. }),
  53144. (n.ObjectLoader = function (e) {
  53145. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.texturePath = '');
  53146. }),
  53147. (n.ObjectLoader.prototype = {
  53148. constructor: n.ObjectLoader,
  53149. load: function (e, t, i, r) {
  53150. '' === this.texturePath &&
  53151. (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1));
  53152. var o = this,
  53153. a = new n.XHRLoader(o.manager);
  53154. a.load(
  53155. e,
  53156. function (e) {
  53157. o.parse(JSON.parse(e), t);
  53158. },
  53159. i,
  53160. r
  53161. );
  53162. },
  53163. setTexturePath: function (e) {
  53164. this.texturePath = e;
  53165. },
  53166. setCrossOrigin: function (e) {
  53167. this.crossOrigin = e;
  53168. },
  53169. parse: function (e, t) {
  53170. var i = this.parseGeometries(e.geometries),
  53171. n = this.parseImages(e.images, function () {
  53172. void 0 !== t && t(a);
  53173. }),
  53174. r = this.parseTextures(e.textures, n),
  53175. o = this.parseMaterials(e.materials, r),
  53176. a = this.parseObject(e.object, i, o);
  53177. return (
  53178. e.animations && (a.animations = this.parseAnimations(e.animations)),
  53179. (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)),
  53180. a
  53181. );
  53182. },
  53183. parseGeometries: function (e) {
  53184. var t = {};
  53185. if (void 0 !== e)
  53186. for (
  53187. var i = new n.JSONLoader(), r = new n.BufferGeometryLoader(), o = 0, a = e.length;
  53188. o < a;
  53189. o++
  53190. ) {
  53191. var s,
  53192. l = e[o];
  53193. switch (l.type) {
  53194. case 'PlaneGeometry':
  53195. case 'PlaneBufferGeometry':
  53196. s = new n[l.type](l.width, l.height, l.widthSegments, l.heightSegments);
  53197. break;
  53198. case 'BoxGeometry':
  53199. case 'BoxBufferGeometry':
  53200. case 'CubeGeometry':
  53201. s = new n[l.type](
  53202. l.width,
  53203. l.height,
  53204. l.depth,
  53205. l.widthSegments,
  53206. l.heightSegments,
  53207. l.depthSegments
  53208. );
  53209. break;
  53210. case 'CircleGeometry':
  53211. case 'CircleBufferGeometry':
  53212. s = new n[l.type](l.radius, l.segments, l.thetaStart, l.thetaLength);
  53213. break;
  53214. case 'CylinderGeometry':
  53215. case 'CylinderBufferGeometry':
  53216. s = new n[l.type](
  53217. l.radiusTop,
  53218. l.radiusBottom,
  53219. l.height,
  53220. l.radialSegments,
  53221. l.heightSegments,
  53222. l.openEnded,
  53223. l.thetaStart,
  53224. l.thetaLength
  53225. );
  53226. break;
  53227. case 'SphereGeometry':
  53228. case 'SphereBufferGeometry':
  53229. s = new n[l.type](
  53230. l.radius,
  53231. l.widthSegments,
  53232. l.heightSegments,
  53233. l.phiStart,
  53234. l.phiLength,
  53235. l.thetaStart,
  53236. l.thetaLength
  53237. );
  53238. break;
  53239. case 'DodecahedronGeometry':
  53240. s = new n.DodecahedronGeometry(l.radius, l.detail);
  53241. break;
  53242. case 'IcosahedronGeometry':
  53243. s = new n.IcosahedronGeometry(l.radius, l.detail);
  53244. break;
  53245. case 'OctahedronGeometry':
  53246. s = new n.OctahedronGeometry(l.radius, l.detail);
  53247. break;
  53248. case 'TetrahedronGeometry':
  53249. s = new n.TetrahedronGeometry(l.radius, l.detail);
  53250. break;
  53251. case 'RingGeometry':
  53252. case 'RingBufferGeometry':
  53253. s = new n[l.type](
  53254. l.innerRadius,
  53255. l.outerRadius,
  53256. l.thetaSegments,
  53257. l.phiSegments,
  53258. l.thetaStart,
  53259. l.thetaLength
  53260. );
  53261. break;
  53262. case 'TorusGeometry':
  53263. case 'TorusBufferGeometry':
  53264. s = new n[l.type](
  53265. l.radius,
  53266. l.tube,
  53267. l.radialSegments,
  53268. l.tubularSegments,
  53269. l.arc
  53270. );
  53271. break;
  53272. case 'TorusKnotGeometry':
  53273. case 'TorusKnotBufferGeometry':
  53274. s = new n[l.type](
  53275. l.radius,
  53276. l.tube,
  53277. l.tubularSegments,
  53278. l.radialSegments,
  53279. l.p,
  53280. l.q
  53281. );
  53282. break;
  53283. case 'LatheGeometry':
  53284. s = new n.LatheGeometry(l.points, l.segments, l.phiStart, l.phiLength);
  53285. break;
  53286. case 'BufferGeometry':
  53287. s = r.parse(l);
  53288. break;
  53289. case 'Geometry':
  53290. s = i.parse(l.data, this.texturePath).geometry;
  53291. break;
  53292. default:
  53293. console.warn(
  53294. 'THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"'
  53295. );
  53296. continue;
  53297. }
  53298. (s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), (t[l.uuid] = s);
  53299. }
  53300. return t;
  53301. },
  53302. parseMaterials: function (e, t) {
  53303. var i = {};
  53304. if (void 0 !== e) {
  53305. var r = new n.MaterialLoader();
  53306. r.setTextures(t);
  53307. for (var o = 0, a = e.length; o < a; o++) {
  53308. var s = r.parse(e[o]);
  53309. i[s.uuid] = s;
  53310. }
  53311. }
  53312. return i;
  53313. },
  53314. parseAnimations: function (e) {
  53315. for (var t = [], i = 0; i < e.length; i++) {
  53316. var r = n.AnimationClip.parse(e[i]);
  53317. t.push(r);
  53318. }
  53319. return t;
  53320. },
  53321. parseImages: function (e, t) {
  53322. function i(e) {
  53323. return (
  53324. r.manager.itemStart(e),
  53325. s.load(e, function () {
  53326. r.manager.itemEnd(e);
  53327. })
  53328. );
  53329. }
  53330. var r = this,
  53331. o = {};
  53332. if (void 0 !== e && e.length > 0) {
  53333. var a = new n.LoadingManager(t),
  53334. s = new n.ImageLoader(a);
  53335. s.setCrossOrigin(this.crossOrigin);
  53336. for (var l = 0, c = e.length; l < c; l++) {
  53337. var h = e[l],
  53338. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  53339. o[h.uuid] = i(u);
  53340. }
  53341. }
  53342. return o;
  53343. },
  53344. parseTextures: function (e, t) {
  53345. function i(e) {
  53346. return 'number' == typeof e
  53347. ? e
  53348. : (console.warn(
  53349. 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.',
  53350. e
  53351. ),
  53352. n[e]);
  53353. }
  53354. var r = {};
  53355. if (void 0 !== e)
  53356. for (var o = 0, a = e.length; o < a; o++) {
  53357. var s = e[o];
  53358. void 0 === s.image &&
  53359. console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  53360. void 0 === t[s.image] &&
  53361. console.warn('THREE.ObjectLoader: Undefined image', s.image);
  53362. var l = new n.Texture(t[s.image]);
  53363. (l.needsUpdate = !0),
  53364. (l.uuid = s.uuid),
  53365. void 0 !== s.name && (l.name = s.name),
  53366. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  53367. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  53368. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  53369. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  53370. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  53371. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  53372. Array.isArray(s.wrap) && ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  53373. (r[s.uuid] = l);
  53374. }
  53375. return r;
  53376. },
  53377. parseObject: (function () {
  53378. var e = new n.Matrix4();
  53379. return function (t, i, r) {
  53380. function o(e) {
  53381. return (
  53382. void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e),
  53383. i[e]
  53384. );
  53385. }
  53386. function a(e) {
  53387. if (void 0 !== e)
  53388. return (
  53389. void 0 === r[e] && console.warn('THREE.ObjectLoader: Undefined material', e),
  53390. r[e]
  53391. );
  53392. }
  53393. var s;
  53394. switch (t.type) {
  53395. case 'Scene':
  53396. s = new n.Scene();
  53397. break;
  53398. case 'PerspectiveCamera':
  53399. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far);
  53400. break;
  53401. case 'OrthographicCamera':
  53402. s = new n.OrthographicCamera(t.left, t.right, t.top, t.bottom, t.near, t.far);
  53403. break;
  53404. case 'AmbientLight':
  53405. s = new n.AmbientLight(t.color, t.intensity);
  53406. break;
  53407. case 'DirectionalLight':
  53408. s = new n.DirectionalLight(t.color, t.intensity);
  53409. break;
  53410. case 'PointLight':
  53411. s = new n.PointLight(t.color, t.intensity, t.distance, t.decay);
  53412. break;
  53413. case 'SpotLight':
  53414. s = new n.SpotLight(
  53415. t.color,
  53416. t.intensity,
  53417. t.distance,
  53418. t.angle,
  53419. t.penumbra,
  53420. t.decay
  53421. );
  53422. break;
  53423. case 'HemisphereLight':
  53424. s = new n.HemisphereLight(t.color, t.groundColor, t.intensity);
  53425. break;
  53426. case 'Mesh':
  53427. var l = o(t.geometry),
  53428. c = a(t.material);
  53429. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l, c) : new n.Mesh(l, c);
  53430. break;
  53431. case 'LOD':
  53432. s = new n.LOD();
  53433. break;
  53434. case 'Line':
  53435. s = new n.Line(o(t.geometry), a(t.material), t.mode);
  53436. break;
  53437. case 'PointCloud':
  53438. case 'Points':
  53439. s = new n.Points(o(t.geometry), a(t.material));
  53440. break;
  53441. case 'Sprite':
  53442. s = new n.Sprite(a(t.material));
  53443. break;
  53444. case 'Group':
  53445. s = new n.Group();
  53446. break;
  53447. default:
  53448. s = new n.Object3D();
  53449. }
  53450. if (
  53451. ((s.uuid = t.uuid),
  53452. void 0 !== t.name && (s.name = t.name),
  53453. void 0 !== t.matrix
  53454. ? (e.fromArray(t.matrix), e.decompose(s.position, s.quaternion, s.scale))
  53455. : (void 0 !== t.position && s.position.fromArray(t.position),
  53456. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  53457. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  53458. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  53459. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  53460. void 0 !== t.visible && (s.visible = t.visible),
  53461. void 0 !== t.userData && (s.userData = t.userData),
  53462. void 0 !== t.children)
  53463. )
  53464. for (var h in t.children) s.add(this.parseObject(t.children[h], i, r));
  53465. if ('LOD' === t.type)
  53466. for (var u = t.levels, d = 0; d < u.length; d++) {
  53467. var p = u[d],
  53468. h = s.getObjectByProperty('uuid', p.object);
  53469. void 0 !== h && s.addLevel(h, p.distance);
  53470. }
  53471. return s;
  53472. };
  53473. })(),
  53474. }),
  53475. (n.TextureLoader = function (e) {
  53476. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  53477. }),
  53478. (n.TextureLoader.prototype = {
  53479. constructor: n.TextureLoader,
  53480. load: function (e, t, i, r) {
  53481. var o = new n.Texture(),
  53482. a = new n.ImageLoader(this.manager);
  53483. return (
  53484. a.setCrossOrigin(this.crossOrigin),
  53485. a.setPath(this.path),
  53486. a.load(
  53487. e,
  53488. function (e) {
  53489. (o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o);
  53490. },
  53491. i,
  53492. r
  53493. ),
  53494. o
  53495. );
  53496. },
  53497. setCrossOrigin: function (e) {
  53498. this.crossOrigin = e;
  53499. },
  53500. setPath: function (e) {
  53501. this.path = e;
  53502. },
  53503. }),
  53504. (n.CubeTextureLoader = function (e) {
  53505. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  53506. }),
  53507. (n.CubeTextureLoader.prototype = {
  53508. constructor: n.CubeTextureLoader,
  53509. load: function (e, t, i, r) {
  53510. function o(i) {
  53511. s.load(
  53512. e[i],
  53513. function (e) {
  53514. (a.images[i] = e), l++, 6 === l && ((a.needsUpdate = !0), t && t(a));
  53515. },
  53516. void 0,
  53517. r
  53518. );
  53519. }
  53520. var a = new n.CubeTexture(),
  53521. s = new n.ImageLoader(this.manager);
  53522. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path);
  53523. for (var l = 0, c = 0; c < e.length; ++c) o(c);
  53524. return a;
  53525. },
  53526. setCrossOrigin: function (e) {
  53527. this.crossOrigin = e;
  53528. },
  53529. setPath: function (e) {
  53530. this.path = e;
  53531. },
  53532. }),
  53533. (n.DataTextureLoader = n.BinaryTextureLoader =
  53534. function (e) {
  53535. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null);
  53536. }),
  53537. (n.BinaryTextureLoader.prototype = {
  53538. constructor: n.BinaryTextureLoader,
  53539. load: function (e, t, i, r) {
  53540. var o = this,
  53541. a = new n.DataTexture(),
  53542. s = new n.XHRLoader(this.manager);
  53543. return (
  53544. s.setResponseType('arraybuffer'),
  53545. s.load(
  53546. e,
  53547. function (e) {
  53548. var i = o._parser(e);
  53549. i &&
  53550. (void 0 !== i.image
  53551. ? (a.image = i.image)
  53552. : void 0 !== i.data &&
  53553. ((a.image.width = i.width),
  53554. (a.image.height = i.height),
  53555. (a.image.data = i.data)),
  53556. (a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  53557. (a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  53558. (a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  53559. (a.minFilter =
  53560. void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter),
  53561. (a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1),
  53562. void 0 !== i.format && (a.format = i.format),
  53563. void 0 !== i.type && (a.type = i.type),
  53564. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  53565. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  53566. (a.needsUpdate = !0),
  53567. t && t(a, i));
  53568. },
  53569. i,
  53570. r
  53571. ),
  53572. a
  53573. );
  53574. },
  53575. }),
  53576. (n.CompressedTextureLoader = function (e) {
  53577. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null);
  53578. });
  53579. n.CompressedTextureLoader.prototype = {
  53580. constructor: n.CompressedTextureLoader,
  53581. load: function (e, t, i, r) {
  53582. function o(o) {
  53583. c.load(
  53584. e[o],
  53585. function (e) {
  53586. var i = a._parser(e, !0);
  53587. (s[o] = {
  53588. width: i.width,
  53589. height: i.height,
  53590. format: i.format,
  53591. mipmaps: i.mipmaps,
  53592. }),
  53593. (h += 1),
  53594. 6 === h &&
  53595. (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53596. (l.format = i.format),
  53597. (l.needsUpdate = !0),
  53598. t && t(l));
  53599. },
  53600. i,
  53601. r
  53602. );
  53603. }
  53604. var a = this,
  53605. s = [],
  53606. l = new n.CompressedTexture();
  53607. l.image = s;
  53608. var c = new n.XHRLoader(this.manager);
  53609. if ((c.setPath(this.path), c.setResponseType('arraybuffer'), Array.isArray(e)))
  53610. for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u);
  53611. else
  53612. c.load(
  53613. e,
  53614. function (e) {
  53615. var i = a._parser(e, !0);
  53616. if (i.isCubemap)
  53617. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  53618. s[o] = {
  53619. mipmaps: [],
  53620. };
  53621. for (var c = 0; c < i.mipmapCount; c++)
  53622. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  53623. (s[o].format = i.format),
  53624. (s[o].width = i.width),
  53625. (s[o].height = i.height);
  53626. }
  53627. else
  53628. (l.image.width = i.width), (l.image.height = i.height), (l.mipmaps = i.mipmaps);
  53629. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53630. (l.format = i.format),
  53631. (l.needsUpdate = !0),
  53632. t && t(l);
  53633. },
  53634. i,
  53635. r
  53636. );
  53637. return l;
  53638. },
  53639. setPath: function (e) {
  53640. this.path = e;
  53641. },
  53642. };
  53643. (n.Material = function () {
  53644. Object.defineProperty(this, 'id', {
  53645. value: n.MaterialIdCount++,
  53646. }),
  53647. (this.uuid = n.Math.generateUUID()),
  53648. (this.name = ''),
  53649. (this.type = 'Material'),
  53650. (this.side = n.FrontSide),
  53651. (this.opacity = 1),
  53652. (this.transparent = !1),
  53653. (this.blending = n.NormalBlending),
  53654. (this.blendSrc = n.SrcAlphaFactor),
  53655. (this.blendDst = n.OneMinusSrcAlphaFactor),
  53656. (this.blendEquation = n.AddEquation),
  53657. (this.blendSrcAlpha = null),
  53658. (this.blendDstAlpha = null),
  53659. (this.blendEquationAlpha = null),
  53660. (this.depthFunc = n.LessEqualDepth),
  53661. (this.depthTest = !0),
  53662. (this.depthWrite = !0),
  53663. (this.colorWrite = !0),
  53664. (this.precision = null),
  53665. (this.polygonOffset = !1),
  53666. (this.polygonOffsetFactor = 0),
  53667. (this.polygonOffsetUnits = 0),
  53668. (this.alphaTest = 0),
  53669. (this.premultipliedAlpha = !1),
  53670. (this.overdraw = 0),
  53671. (this.visible = !0),
  53672. (this._needsUpdate = !0);
  53673. }),
  53674. (n.Material.prototype = {
  53675. constructor: n.Material,
  53676. get needsUpdate() {
  53677. return this._needsUpdate;
  53678. },
  53679. set needsUpdate(e) {
  53680. e === !0 && this.update(), (this._needsUpdate = e);
  53681. },
  53682. setValues: function (e) {
  53683. if (void 0 !== e)
  53684. for (var t in e) {
  53685. var i = e[t];
  53686. if (void 0 !== i) {
  53687. var r = this[t];
  53688. void 0 !== r
  53689. ? r instanceof n.Color
  53690. ? r.set(i)
  53691. : r instanceof n.Vector3 && i instanceof n.Vector3
  53692. ? r.copy(i)
  53693. : 'overdraw' === t
  53694. ? (this[t] = Number(i))
  53695. : (this[t] = i)
  53696. : console.warn(
  53697. 'THREE.' + this.type + ": '" + t + "' is not a property of this material."
  53698. );
  53699. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.");
  53700. }
  53701. },
  53702. toJSON: function (e) {
  53703. function t(e) {
  53704. var t = [];
  53705. for (var i in e) {
  53706. var n = e[i];
  53707. delete n.metadata, t.push(n);
  53708. }
  53709. return t;
  53710. }
  53711. var i = void 0 === e;
  53712. i &&
  53713. (e = {
  53714. textures: {},
  53715. images: {},
  53716. });
  53717. var r = {
  53718. metadata: {
  53719. version: 4.4,
  53720. type: 'Material',
  53721. generator: 'Material.toJSON',
  53722. },
  53723. };
  53724. if (
  53725. ((r.uuid = this.uuid),
  53726. (r.type = this.type),
  53727. '' !== this.name && (r.name = this.name),
  53728. this.color instanceof n.Color && (r.color = this.color.getHex()),
  53729. 0.5 !== this.roughness && (r.roughness = this.roughness),
  53730. 0.5 !== this.metalness && (r.metalness = this.metalness),
  53731. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  53732. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  53733. void 0 !== this.shininess && (r.shininess = this.shininess),
  53734. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  53735. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  53736. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  53737. this.bumpMap instanceof n.Texture &&
  53738. ((r.bumpMap = this.bumpMap.toJSON(e).uuid), (r.bumpScale = this.bumpScale)),
  53739. this.normalMap instanceof n.Texture &&
  53740. ((r.normalMap = this.normalMap.toJSON(e).uuid),
  53741. (r.normalScale = this.normalScale.toArray())),
  53742. this.displacementMap instanceof n.Texture &&
  53743. ((r.displacementMap = this.displacementMap.toJSON(e).uuid),
  53744. (r.displacementScale = this.displacementScale),
  53745. (r.displacementBias = this.displacementBias)),
  53746. this.roughnessMap instanceof n.Texture &&
  53747. (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  53748. this.metalnessMap instanceof n.Texture &&
  53749. (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  53750. this.emissiveMap instanceof n.Texture &&
  53751. (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  53752. this.specularMap instanceof n.Texture &&
  53753. (r.specularMap = this.specularMap.toJSON(e).uuid),
  53754. this.envMap instanceof n.Texture &&
  53755. ((r.envMap = this.envMap.toJSON(e).uuid), (r.reflectivity = this.reflectivity)),
  53756. void 0 !== this.size && (r.size = this.size),
  53757. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  53758. void 0 !== this.vertexColors &&
  53759. this.vertexColors !== n.NoColors &&
  53760. (r.vertexColors = this.vertexColors),
  53761. void 0 !== this.shading &&
  53762. this.shading !== n.SmoothShading &&
  53763. (r.shading = this.shading),
  53764. void 0 !== this.blending &&
  53765. this.blending !== n.NormalBlending &&
  53766. (r.blending = this.blending),
  53767. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  53768. this.opacity < 1 && (r.opacity = this.opacity),
  53769. this.transparent === !0 && (r.transparent = this.transparent),
  53770. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  53771. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  53772. this.wireframe === !0 && (r.wireframe = this.wireframe),
  53773. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  53774. i)
  53775. ) {
  53776. var o = t(e.textures),
  53777. a = t(e.images);
  53778. o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a);
  53779. }
  53780. return r;
  53781. },
  53782. clone: function () {
  53783. return new this.constructor().copy(this);
  53784. },
  53785. copy: function (e) {
  53786. return (
  53787. (this.name = e.name),
  53788. (this.side = e.side),
  53789. (this.opacity = e.opacity),
  53790. (this.transparent = e.transparent),
  53791. (this.blending = e.blending),
  53792. (this.blendSrc = e.blendSrc),
  53793. (this.blendDst = e.blendDst),
  53794. (this.blendEquation = e.blendEquation),
  53795. (this.blendSrcAlpha = e.blendSrcAlpha),
  53796. (this.blendDstAlpha = e.blendDstAlpha),
  53797. (this.blendEquationAlpha = e.blendEquationAlpha),
  53798. (this.depthFunc = e.depthFunc),
  53799. (this.depthTest = e.depthTest),
  53800. (this.depthWrite = e.depthWrite),
  53801. (this.colorWrite = e.colorWrite),
  53802. (this.precision = e.precision),
  53803. (this.polygonOffset = e.polygonOffset),
  53804. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  53805. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  53806. (this.alphaTest = e.alphaTest),
  53807. (this.premultipliedAlpha = e.premultipliedAlpha),
  53808. (this.overdraw = e.overdraw),
  53809. (this.visible = e.visible),
  53810. this
  53811. );
  53812. },
  53813. update: function () {
  53814. this.dispatchEvent({
  53815. type: 'update',
  53816. });
  53817. },
  53818. dispose: function () {
  53819. this.dispatchEvent({
  53820. type: 'dispose',
  53821. });
  53822. },
  53823. }),
  53824. n.EventDispatcher.prototype.apply(n.Material.prototype),
  53825. (n.MaterialIdCount = 0),
  53826. (n.LineBasicMaterial = function (e) {
  53827. n.Material.call(this),
  53828. (this.type = 'LineBasicMaterial'),
  53829. (this.color = new n.Color(16777215)),
  53830. (this.linewidth = 1),
  53831. (this.linecap = 'round'),
  53832. (this.linejoin = 'round'),
  53833. (this.blending = n.NormalBlending),
  53834. (this.vertexColors = n.NoColors),
  53835. (this.fog = !0),
  53836. this.setValues(e);
  53837. }),
  53838. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  53839. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  53840. (n.LineBasicMaterial.prototype.copy = function (e) {
  53841. return (
  53842. n.Material.prototype.copy.call(this, e),
  53843. this.color.copy(e.color),
  53844. (this.linewidth = e.linewidth),
  53845. (this.linecap = e.linecap),
  53846. (this.linejoin = e.linejoin),
  53847. (this.vertexColors = e.vertexColors),
  53848. (this.fog = e.fog),
  53849. this
  53850. );
  53851. }),
  53852. (n.LineDashedMaterial = function (e) {
  53853. n.Material.call(this),
  53854. (this.type = 'LineDashedMaterial'),
  53855. (this.color = new n.Color(16777215)),
  53856. (this.linewidth = 1),
  53857. (this.scale = 1),
  53858. (this.dashSize = 3),
  53859. (this.gapSize = 1),
  53860. (this.blending = n.NormalBlending),
  53861. (this.vertexColors = n.NoColors),
  53862. (this.fog = !0),
  53863. this.setValues(e);
  53864. }),
  53865. (n.LineDashedMaterial.prototype = Object.create(n.Material.prototype)),
  53866. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  53867. (n.LineDashedMaterial.prototype.copy = function (e) {
  53868. return (
  53869. n.Material.prototype.copy.call(this, e),
  53870. this.color.copy(e.color),
  53871. (this.linewidth = e.linewidth),
  53872. (this.scale = e.scale),
  53873. (this.dashSize = e.dashSize),
  53874. (this.gapSize = e.gapSize),
  53875. (this.vertexColors = e.vertexColors),
  53876. (this.fog = e.fog),
  53877. this
  53878. );
  53879. }),
  53880. (n.MeshBasicMaterial = function (e) {
  53881. n.Material.call(this),
  53882. (this.type = 'MeshBasicMaterial'),
  53883. (this.color = new n.Color(16777215)),
  53884. (this.map = null),
  53885. (this.aoMap = null),
  53886. (this.aoMapIntensity = 1),
  53887. (this.specularMap = null),
  53888. (this.alphaMap = null),
  53889. (this.envMap = null),
  53890. (this.combine = n.MultiplyOperation),
  53891. (this.reflectivity = 1),
  53892. (this.refractionRatio = 0.98),
  53893. (this.fog = !0),
  53894. (this.shading = n.SmoothShading),
  53895. (this.blending = n.NormalBlending),
  53896. (this.wireframe = !1),
  53897. (this.wireframeLinewidth = 1),
  53898. (this.wireframeLinecap = 'round'),
  53899. (this.wireframeLinejoin = 'round'),
  53900. (this.vertexColors = n.NoColors),
  53901. (this.skinning = !1),
  53902. (this.morphTargets = !1),
  53903. this.setValues(e);
  53904. }),
  53905. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  53906. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  53907. (n.MeshBasicMaterial.prototype.copy = function (e) {
  53908. return (
  53909. n.Material.prototype.copy.call(this, e),
  53910. this.color.copy(e.color),
  53911. (this.map = e.map),
  53912. (this.aoMap = e.aoMap),
  53913. (this.aoMapIntensity = e.aoMapIntensity),
  53914. (this.specularMap = e.specularMap),
  53915. (this.alphaMap = e.alphaMap),
  53916. (this.envMap = e.envMap),
  53917. (this.combine = e.combine),
  53918. (this.reflectivity = e.reflectivity),
  53919. (this.refractionRatio = e.refractionRatio),
  53920. (this.fog = e.fog),
  53921. (this.shading = e.shading),
  53922. (this.wireframe = e.wireframe),
  53923. (this.wireframeLinewidth = e.wireframeLinewidth),
  53924. (this.wireframeLinecap = e.wireframeLinecap),
  53925. (this.wireframeLinejoin = e.wireframeLinejoin),
  53926. (this.vertexColors = e.vertexColors),
  53927. (this.skinning = e.skinning),
  53928. (this.morphTargets = e.morphTargets),
  53929. this
  53930. );
  53931. }),
  53932. (n.MeshLambertMaterial = function (e) {
  53933. n.Material.call(this),
  53934. (this.type = 'MeshLambertMaterial'),
  53935. (this.color = new n.Color(16777215)),
  53936. (this.map = null),
  53937. (this.lightMap = null),
  53938. (this.lightMapIntensity = 1),
  53939. (this.aoMap = null),
  53940. (this.aoMapIntensity = 1),
  53941. (this.emissive = new n.Color(0)),
  53942. (this.emissiveIntensity = 1),
  53943. (this.emissiveMap = null),
  53944. (this.specularMap = null),
  53945. (this.alphaMap = null),
  53946. (this.envMap = null),
  53947. (this.combine = n.MultiplyOperation),
  53948. (this.reflectivity = 1),
  53949. (this.refractionRatio = 0.98),
  53950. (this.fog = !0),
  53951. (this.blending = n.NormalBlending),
  53952. (this.wireframe = !1),
  53953. (this.wireframeLinewidth = 1),
  53954. (this.wireframeLinecap = 'round'),
  53955. (this.wireframeLinejoin = 'round'),
  53956. (this.vertexColors = n.NoColors),
  53957. (this.skinning = !1),
  53958. (this.morphTargets = !1),
  53959. (this.morphNormals = !1),
  53960. this.setValues(e);
  53961. }),
  53962. (n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype)),
  53963. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  53964. (n.MeshLambertMaterial.prototype.copy = function (e) {
  53965. return (
  53966. n.Material.prototype.copy.call(this, e),
  53967. this.color.copy(e.color),
  53968. (this.map = e.map),
  53969. (this.lightMap = e.lightMap),
  53970. (this.lightMapIntensity = e.lightMapIntensity),
  53971. (this.aoMap = e.aoMap),
  53972. (this.aoMapIntensity = e.aoMapIntensity),
  53973. this.emissive.copy(e.emissive),
  53974. (this.emissiveMap = e.emissiveMap),
  53975. (this.emissiveIntensity = e.emissiveIntensity),
  53976. (this.specularMap = e.specularMap),
  53977. (this.alphaMap = e.alphaMap),
  53978. (this.envMap = e.envMap),
  53979. (this.combine = e.combine),
  53980. (this.reflectivity = e.reflectivity),
  53981. (this.refractionRatio = e.refractionRatio),
  53982. (this.fog = e.fog),
  53983. (this.wireframe = e.wireframe),
  53984. (this.wireframeLinewidth = e.wireframeLinewidth),
  53985. (this.wireframeLinecap = e.wireframeLinecap),
  53986. (this.wireframeLinejoin = e.wireframeLinejoin),
  53987. (this.vertexColors = e.vertexColors),
  53988. (this.skinning = e.skinning),
  53989. (this.morphTargets = e.morphTargets),
  53990. (this.morphNormals = e.morphNormals),
  53991. this
  53992. );
  53993. }),
  53994. (n.MeshPhongMaterial = function (e) {
  53995. n.Material.call(this),
  53996. (this.type = 'MeshPhongMaterial'),
  53997. (this.color = new n.Color(16777215)),
  53998. (this.specular = new n.Color(1118481)),
  53999. (this.shininess = 30),
  54000. (this.map = null),
  54001. (this.lightMap = null),
  54002. (this.lightMapIntensity = 1),
  54003. (this.aoMap = null),
  54004. (this.aoMapIntensity = 1),
  54005. (this.emissive = new n.Color(0)),
  54006. (this.emissiveIntensity = 1),
  54007. (this.emissiveMap = null),
  54008. (this.bumpMap = null),
  54009. (this.bumpScale = 1),
  54010. (this.normalMap = null),
  54011. (this.normalScale = new n.Vector2(1, 1)),
  54012. (this.displacementMap = null),
  54013. (this.displacementScale = 1),
  54014. (this.displacementBias = 0),
  54015. (this.specularMap = null),
  54016. (this.alphaMap = null),
  54017. (this.envMap = null),
  54018. (this.combine = n.MultiplyOperation),
  54019. (this.reflectivity = 1),
  54020. (this.refractionRatio = 0.98),
  54021. (this.fog = !0),
  54022. (this.shading = n.SmoothShading),
  54023. (this.blending = n.NormalBlending),
  54024. (this.wireframe = !1),
  54025. (this.wireframeLinewidth = 1),
  54026. (this.wireframeLinecap = 'round'),
  54027. (this.wireframeLinejoin = 'round'),
  54028. (this.vertexColors = n.NoColors),
  54029. (this.skinning = !1),
  54030. (this.morphTargets = !1),
  54031. (this.morphNormals = !1),
  54032. this.setValues(e);
  54033. }),
  54034. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  54035. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  54036. (n.MeshPhongMaterial.prototype.copy = function (e) {
  54037. return (
  54038. n.Material.prototype.copy.call(this, e),
  54039. this.color.copy(e.color),
  54040. this.specular.copy(e.specular),
  54041. (this.shininess = e.shininess),
  54042. (this.map = e.map),
  54043. (this.lightMap = e.lightMap),
  54044. (this.lightMapIntensity = e.lightMapIntensity),
  54045. (this.aoMap = e.aoMap),
  54046. (this.aoMapIntensity = e.aoMapIntensity),
  54047. this.emissive.copy(e.emissive),
  54048. (this.emissiveMap = e.emissiveMap),
  54049. (this.emissiveIntensity = e.emissiveIntensity),
  54050. (this.bumpMap = e.bumpMap),
  54051. (this.bumpScale = e.bumpScale),
  54052. (this.normalMap = e.normalMap),
  54053. this.normalScale.copy(e.normalScale),
  54054. (this.displacementMap = e.displacementMap),
  54055. (this.displacementScale = e.displacementScale),
  54056. (this.displacementBias = e.displacementBias),
  54057. (this.specularMap = e.specularMap),
  54058. (this.alphaMap = e.alphaMap),
  54059. (this.envMap = e.envMap),
  54060. (this.combine = e.combine),
  54061. (this.reflectivity = e.reflectivity),
  54062. (this.refractionRatio = e.refractionRatio),
  54063. (this.fog = e.fog),
  54064. (this.shading = e.shading),
  54065. (this.wireframe = e.wireframe),
  54066. (this.wireframeLinewidth = e.wireframeLinewidth),
  54067. (this.wireframeLinecap = e.wireframeLinecap),
  54068. (this.wireframeLinejoin = e.wireframeLinejoin),
  54069. (this.vertexColors = e.vertexColors),
  54070. (this.skinning = e.skinning),
  54071. (this.morphTargets = e.morphTargets),
  54072. (this.morphNormals = e.morphNormals),
  54073. this
  54074. );
  54075. }),
  54076. (n.MeshStandardMaterial = function (e) {
  54077. n.Material.call(this),
  54078. (this.type = 'MeshStandardMaterial'),
  54079. (this.color = new n.Color(16777215)),
  54080. (this.roughness = 0.5),
  54081. (this.metalness = 0.5),
  54082. (this.map = null),
  54083. (this.lightMap = null),
  54084. (this.lightMapIntensity = 1),
  54085. (this.aoMap = null),
  54086. (this.aoMapIntensity = 1),
  54087. (this.emissive = new n.Color(0)),
  54088. (this.emissiveIntensity = 1),
  54089. (this.emissiveMap = null),
  54090. (this.bumpMap = null),
  54091. (this.bumpScale = 1),
  54092. (this.normalMap = null),
  54093. (this.normalScale = new n.Vector2(1, 1)),
  54094. (this.displacementMap = null),
  54095. (this.displacementScale = 1),
  54096. (this.displacementBias = 0),
  54097. (this.roughnessMap = null),
  54098. (this.metalnessMap = null),
  54099. (this.alphaMap = null),
  54100. (this.envMap = null),
  54101. (this.envMapIntensity = 1),
  54102. (this.refractionRatio = 0.98),
  54103. (this.fog = !0),
  54104. (this.shading = n.SmoothShading),
  54105. (this.blending = n.NormalBlending),
  54106. (this.wireframe = !1),
  54107. (this.wireframeLinewidth = 1),
  54108. (this.wireframeLinecap = 'round'),
  54109. (this.wireframeLinejoin = 'round'),
  54110. (this.vertexColors = n.NoColors),
  54111. (this.skinning = !1),
  54112. (this.morphTargets = !1),
  54113. (this.morphNormals = !1),
  54114. this.setValues(e);
  54115. }),
  54116. (n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype)),
  54117. (n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial),
  54118. (n.MeshStandardMaterial.prototype.copy = function (e) {
  54119. return (
  54120. n.Material.prototype.copy.call(this, e),
  54121. this.color.copy(e.color),
  54122. (this.roughness = e.roughness),
  54123. (this.metalness = e.metalness),
  54124. (this.map = e.map),
  54125. (this.lightMap = e.lightMap),
  54126. (this.lightMapIntensity = e.lightMapIntensity),
  54127. (this.aoMap = e.aoMap),
  54128. (this.aoMapIntensity = e.aoMapIntensity),
  54129. this.emissive.copy(e.emissive),
  54130. (this.emissiveMap = e.emissiveMap),
  54131. (this.emissiveIntensity = e.emissiveIntensity),
  54132. (this.bumpMap = e.bumpMap),
  54133. (this.bumpScale = e.bumpScale),
  54134. (this.normalMap = e.normalMap),
  54135. this.normalScale.copy(e.normalScale),
  54136. (this.displacementMap = e.displacementMap),
  54137. (this.displacementScale = e.displacementScale),
  54138. (this.displacementBias = e.displacementBias),
  54139. (this.roughnessMap = e.roughnessMap),
  54140. (this.metalnessMap = e.metalnessMap),
  54141. (this.alphaMap = e.alphaMap),
  54142. (this.envMap = e.envMap),
  54143. (this.envMapIntensity = e.envMapIntensity),
  54144. (this.refractionRatio = e.refractionRatio),
  54145. (this.fog = e.fog),
  54146. (this.shading = e.shading),
  54147. (this.wireframe = e.wireframe),
  54148. (this.wireframeLinewidth = e.wireframeLinewidth),
  54149. (this.wireframeLinecap = e.wireframeLinecap),
  54150. (this.wireframeLinejoin = e.wireframeLinejoin),
  54151. (this.vertexColors = e.vertexColors),
  54152. (this.skinning = e.skinning),
  54153. (this.morphTargets = e.morphTargets),
  54154. (this.morphNormals = e.morphNormals),
  54155. this
  54156. );
  54157. }),
  54158. (n.MeshDepthMaterial = function (e) {
  54159. n.Material.call(this),
  54160. (this.type = 'MeshDepthMaterial'),
  54161. (this.morphTargets = !1),
  54162. (this.wireframe = !1),
  54163. (this.wireframeLinewidth = 1),
  54164. this.setValues(e);
  54165. }),
  54166. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  54167. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  54168. (n.MeshDepthMaterial.prototype.copy = function (e) {
  54169. return (
  54170. n.Material.prototype.copy.call(this, e),
  54171. (this.wireframe = e.wireframe),
  54172. (this.wireframeLinewidth = e.wireframeLinewidth),
  54173. this
  54174. );
  54175. }),
  54176. (n.MeshNormalMaterial = function (e) {
  54177. n.Material.call(this, e),
  54178. (this.type = 'MeshNormalMaterial'),
  54179. (this.wireframe = !1),
  54180. (this.wireframeLinewidth = 1),
  54181. (this.morphTargets = !1),
  54182. this.setValues(e);
  54183. }),
  54184. (n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype)),
  54185. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  54186. (n.MeshNormalMaterial.prototype.copy = function (e) {
  54187. return (
  54188. n.Material.prototype.copy.call(this, e),
  54189. (this.wireframe = e.wireframe),
  54190. (this.wireframeLinewidth = e.wireframeLinewidth),
  54191. this
  54192. );
  54193. }),
  54194. (n.MultiMaterial = function (e) {
  54195. (this.uuid = n.Math.generateUUID()),
  54196. (this.type = 'MultiMaterial'),
  54197. (this.materials = e instanceof Array ? e : []),
  54198. (this.visible = !0);
  54199. }),
  54200. (n.MultiMaterial.prototype = {
  54201. constructor: n.MultiMaterial,
  54202. toJSON: function (e) {
  54203. for (
  54204. var t = {
  54205. metadata: {
  54206. version: 4.2,
  54207. type: 'material',
  54208. generator: 'MaterialExporter',
  54209. },
  54210. uuid: this.uuid,
  54211. type: this.type,
  54212. materials: [],
  54213. },
  54214. i = this.materials,
  54215. n = 0,
  54216. r = i.length;
  54217. n < r;
  54218. n++
  54219. ) {
  54220. var o = i[n].toJSON(e);
  54221. delete o.metadata, t.materials.push(o);
  54222. }
  54223. return (t.visible = this.visible), t;
  54224. },
  54225. clone: function () {
  54226. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++)
  54227. e.materials.push(this.materials[t].clone());
  54228. return (e.visible = this.visible), e;
  54229. },
  54230. }),
  54231. (n.PointsMaterial = function (e) {
  54232. n.Material.call(this),
  54233. (this.type = 'PointsMaterial'),
  54234. (this.color = new n.Color(16777215)),
  54235. (this.map = null),
  54236. (this.size = 1),
  54237. (this.sizeAttenuation = !0),
  54238. (this.blending = n.NormalBlending),
  54239. (this.vertexColors = n.NoColors),
  54240. (this.fog = !0),
  54241. this.setValues(e);
  54242. }),
  54243. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  54244. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  54245. (n.PointsMaterial.prototype.copy = function (e) {
  54246. return (
  54247. n.Material.prototype.copy.call(this, e),
  54248. this.color.copy(e.color),
  54249. (this.map = e.map),
  54250. (this.size = e.size),
  54251. (this.sizeAttenuation = e.sizeAttenuation),
  54252. (this.vertexColors = e.vertexColors),
  54253. (this.fog = e.fog),
  54254. this
  54255. );
  54256. }),
  54257. (n.ShaderMaterial = function (e) {
  54258. n.Material.call(this),
  54259. (this.type = 'ShaderMaterial'),
  54260. (this.defines = {}),
  54261. (this.uniforms = {}),
  54262. (this.vertexShader =
  54263. 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  54264. (this.fragmentShader =
  54265. 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  54266. (this.shading = n.SmoothShading),
  54267. (this.linewidth = 1),
  54268. (this.wireframe = !1),
  54269. (this.wireframeLinewidth = 1),
  54270. (this.fog = !1),
  54271. (this.lights = !1),
  54272. (this.vertexColors = n.NoColors),
  54273. (this.skinning = !1),
  54274. (this.morphTargets = !1),
  54275. (this.morphNormals = !1),
  54276. (this.extensions = {
  54277. derivatives: !1,
  54278. fragDepth: !1,
  54279. drawBuffers: !1,
  54280. shaderTextureLOD: !1,
  54281. }),
  54282. (this.defaultAttributeValues = {
  54283. color: [1, 1, 1],
  54284. uv: [0, 0],
  54285. uv2: [0, 0],
  54286. }),
  54287. (this.index0AttributeName = void 0),
  54288. void 0 !== e &&
  54289. (void 0 !== e.attributes &&
  54290. console.error(
  54291. 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'
  54292. ),
  54293. this.setValues(e));
  54294. }),
  54295. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  54296. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  54297. (n.ShaderMaterial.prototype.copy = function (e) {
  54298. return (
  54299. n.Material.prototype.copy.call(this, e),
  54300. (this.fragmentShader = e.fragmentShader),
  54301. (this.vertexShader = e.vertexShader),
  54302. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  54303. (this.defines = e.defines),
  54304. (this.shading = e.shading),
  54305. (this.wireframe = e.wireframe),
  54306. (this.wireframeLinewidth = e.wireframeLinewidth),
  54307. (this.fog = e.fog),
  54308. (this.lights = e.lights),
  54309. (this.vertexColors = e.vertexColors),
  54310. (this.skinning = e.skinning),
  54311. (this.morphTargets = e.morphTargets),
  54312. (this.morphNormals = e.morphNormals),
  54313. (this.extensions = e.extensions),
  54314. this
  54315. );
  54316. }),
  54317. (n.ShaderMaterial.prototype.toJSON = function (e) {
  54318. var t = n.Material.prototype.toJSON.call(this, e);
  54319. return (
  54320. (t.uniforms = this.uniforms),
  54321. (t.vertexShader = this.vertexShader),
  54322. (t.fragmentShader = this.fragmentShader),
  54323. t
  54324. );
  54325. }),
  54326. (n.RawShaderMaterial = function (e) {
  54327. n.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial');
  54328. }),
  54329. (n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype)),
  54330. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  54331. (n.SpriteMaterial = function (e) {
  54332. n.Material.call(this),
  54333. (this.type = 'SpriteMaterial'),
  54334. (this.color = new n.Color(16777215)),
  54335. (this.map = null),
  54336. (this.rotation = 0),
  54337. (this.fog = !1),
  54338. this.setValues(e);
  54339. }),
  54340. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  54341. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  54342. (n.SpriteMaterial.prototype.copy = function (e) {
  54343. return (
  54344. n.Material.prototype.copy.call(this, e),
  54345. this.color.copy(e.color),
  54346. (this.map = e.map),
  54347. (this.rotation = e.rotation),
  54348. (this.fog = e.fog),
  54349. this
  54350. );
  54351. }),
  54352. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  54353. Object.defineProperty(this, 'id', {
  54354. value: n.TextureIdCount++,
  54355. }),
  54356. (this.uuid = n.Math.generateUUID()),
  54357. (this.name = ''),
  54358. (this.sourceFile = ''),
  54359. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  54360. (this.mipmaps = []),
  54361. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  54362. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  54363. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  54364. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  54365. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  54366. (this.anisotropy = void 0 !== c ? c : 1),
  54367. (this.format = void 0 !== s ? s : n.RGBAFormat),
  54368. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  54369. (this.offset = new n.Vector2(0, 0)),
  54370. (this.repeat = new n.Vector2(1, 1)),
  54371. (this.generateMipmaps = !0),
  54372. (this.premultiplyAlpha = !1),
  54373. (this.flipY = !0),
  54374. (this.unpackAlignment = 4),
  54375. (this.encoding = n.LinearEncoding),
  54376. (this.version = 0),
  54377. (this.onUpdate = null);
  54378. }),
  54379. (n.Texture.DEFAULT_IMAGE = void 0),
  54380. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  54381. (n.Texture.prototype = {
  54382. constructor: n.Texture,
  54383. set needsUpdate(e) {
  54384. e === !0 && this.version++;
  54385. },
  54386. clone: function () {
  54387. return new this.constructor().copy(this);
  54388. },
  54389. copy: function (e) {
  54390. return (
  54391. (this.image = e.image),
  54392. (this.mipmaps = e.mipmaps.slice(0)),
  54393. (this.mapping = e.mapping),
  54394. (this.wrapS = e.wrapS),
  54395. (this.wrapT = e.wrapT),
  54396. (this.magFilter = e.magFilter),
  54397. (this.minFilter = e.minFilter),
  54398. (this.anisotropy = e.anisotropy),
  54399. (this.format = e.format),
  54400. (this.type = e.type),
  54401. this.offset.copy(e.offset),
  54402. this.repeat.copy(e.repeat),
  54403. (this.generateMipmaps = e.generateMipmaps),
  54404. (this.premultiplyAlpha = e.premultiplyAlpha),
  54405. (this.flipY = e.flipY),
  54406. (this.unpackAlignment = e.unpackAlignment),
  54407. (this.encoding = e.encoding),
  54408. this
  54409. );
  54410. },
  54411. toJSON: function (e) {
  54412. function t(e) {
  54413. var t;
  54414. return (
  54415. void 0 !== e.toDataURL
  54416. ? (t = e)
  54417. : ((t = document.createElement('canvas')),
  54418. (t.width = e.width),
  54419. (t.height = e.height),
  54420. t.getContext('2d').drawImage(e, 0, 0, e.width, e.height)),
  54421. t.width > 2048 || t.height > 2048
  54422. ? t.toDataURL('image/jpeg', 0.6)
  54423. : t.toDataURL('image/png')
  54424. );
  54425. }
  54426. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid];
  54427. var i = {
  54428. metadata: {
  54429. version: 4.4,
  54430. type: 'Texture',
  54431. generator: 'Texture.toJSON',
  54432. },
  54433. uuid: this.uuid,
  54434. name: this.name,
  54435. mapping: this.mapping,
  54436. repeat: [this.repeat.x, this.repeat.y],
  54437. offset: [this.offset.x, this.offset.y],
  54438. wrap: [this.wrapS, this.wrapT],
  54439. minFilter: this.minFilter,
  54440. magFilter: this.magFilter,
  54441. anisotropy: this.anisotropy,
  54442. };
  54443. if (void 0 !== this.image) {
  54444. var r = this.image;
  54445. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  54446. void 0 === e.images[r.uuid] &&
  54447. (e.images[r.uuid] = {
  54448. uuid: r.uuid,
  54449. url: t(r),
  54450. }),
  54451. (i.image = r.uuid);
  54452. }
  54453. return (e.textures[this.uuid] = i), i;
  54454. },
  54455. dispose: function () {
  54456. this.dispatchEvent({
  54457. type: 'dispose',
  54458. });
  54459. },
  54460. transformUv: function (e) {
  54461. if (this.mapping === n.UVMapping) {
  54462. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || e.x > 1))
  54463. switch (this.wrapS) {
  54464. case n.RepeatWrapping:
  54465. e.x = e.x - Math.floor(e.x);
  54466. break;
  54467. case n.ClampToEdgeWrapping:
  54468. e.x = e.x < 0 ? 0 : 1;
  54469. break;
  54470. case n.MirroredRepeatWrapping:
  54471. 1 === Math.abs(Math.floor(e.x) % 2)
  54472. ? (e.x = Math.ceil(e.x) - e.x)
  54473. : (e.x = e.x - Math.floor(e.x));
  54474. }
  54475. if (e.y < 0 || e.y > 1)
  54476. switch (this.wrapT) {
  54477. case n.RepeatWrapping:
  54478. e.y = e.y - Math.floor(e.y);
  54479. break;
  54480. case n.ClampToEdgeWrapping:
  54481. e.y = e.y < 0 ? 0 : 1;
  54482. break;
  54483. case n.MirroredRepeatWrapping:
  54484. 1 === Math.abs(Math.floor(e.y) % 2)
  54485. ? (e.y = Math.ceil(e.y) - e.y)
  54486. : (e.y = e.y - Math.floor(e.y));
  54487. }
  54488. this.flipY && (e.y = 1 - e.y);
  54489. }
  54490. },
  54491. }),
  54492. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  54493. (n.TextureIdCount = 0),
  54494. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  54495. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.needsUpdate = !0);
  54496. }),
  54497. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  54498. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  54499. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  54500. (e = void 0 !== e ? e : []),
  54501. (t = void 0 !== t ? t : n.CubeReflectionMapping),
  54502. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  54503. (this.flipY = !1);
  54504. }),
  54505. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  54506. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  54507. Object.defineProperty(n.CubeTexture.prototype, 'images', {
  54508. get: function () {
  54509. return this.image;
  54510. },
  54511. set: function (e) {
  54512. this.image = e;
  54513. },
  54514. }),
  54515. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54516. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54517. (this.image = {
  54518. width: t,
  54519. height: i,
  54520. }),
  54521. (this.mipmaps = e),
  54522. (this.flipY = !1),
  54523. (this.generateMipmaps = !1);
  54524. }),
  54525. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  54526. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  54527. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54528. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54529. (this.image = {
  54530. data: e,
  54531. width: t,
  54532. height: i,
  54533. }),
  54534. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  54535. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  54536. (this.flipY = !1),
  54537. (this.generateMipmaps = !1);
  54538. }),
  54539. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  54540. (n.DataTexture.prototype.constructor = n.DataTexture),
  54541. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  54542. function h() {
  54543. requestAnimationFrame(h);
  54544. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  54545. //改 add !e.paused
  54546. u.needsUpdate = !0;
  54547. }
  54548. }
  54549. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.generateMipmaps = !1);
  54550. var u = this;
  54551. h();
  54552. }),
  54553. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  54554. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  54555. (n.Group = function () {
  54556. n.Object3D.call(this), (this.type = 'Group');
  54557. }),
  54558. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  54559. (n.Group.prototype.constructor = n.Group),
  54560. (n.Points = function (e, t) {
  54561. n.Object3D.call(this),
  54562. (this.type = 'Points'),
  54563. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54564. (this.material =
  54565. void 0 !== t
  54566. ? t
  54567. : new n.PointsMaterial({
  54568. color: 16777215 * Math.random(),
  54569. }));
  54570. }),
  54571. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  54572. (n.Points.prototype.constructor = n.Points),
  54573. (n.Points.prototype.raycast = (function () {
  54574. var e = new n.Matrix4(),
  54575. t = new n.Ray(),
  54576. i = new n.Sphere();
  54577. return function (r, o) {
  54578. function a(e, i) {
  54579. var n = t.distanceSqToPoint(e);
  54580. if (n < d) {
  54581. var a = t.closestPointToPoint(e);
  54582. a.applyMatrix4(c);
  54583. var l = r.ray.origin.distanceTo(a);
  54584. if (l < r.near || l > r.far) return;
  54585. o.push({
  54586. distance: l,
  54587. distanceToRay: Math.sqrt(n),
  54588. point: a.clone(),
  54589. index: i,
  54590. face: null,
  54591. object: s,
  54592. });
  54593. }
  54594. }
  54595. var s = this,
  54596. l = this.geometry,
  54597. c = this.matrixWorld,
  54598. h = r.params.Points.threshold;
  54599. if (
  54600. (null === l.boundingSphere && l.computeBoundingSphere(),
  54601. i.copy(l.boundingSphere),
  54602. i.applyMatrix4(c),
  54603. r.ray.intersectsSphere(i) !== !1)
  54604. ) {
  54605. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  54606. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  54607. d = u * u,
  54608. p = new n.Vector3();
  54609. if (l instanceof n.BufferGeometry) {
  54610. var f = l.index,
  54611. g = l.attributes,
  54612. m = g.position.array;
  54613. if (null !== f)
  54614. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  54615. var C = v[A];
  54616. p.fromArray(m, 3 * C), a(p, C);
  54617. }
  54618. else for (var A = 0, I = m.length / 3; A < I; A++) p.fromArray(m, 3 * A), a(p, A);
  54619. } else for (var E = l.vertices, A = 0, I = E.length; A < I; A++) a(E[A], A);
  54620. }
  54621. };
  54622. })()),
  54623. (n.Points.prototype.clone = function () {
  54624. return new this.constructor(this.geometry, this.material).copy(this);
  54625. }),
  54626. (n.Line = function (e, t, i) {
  54627. return 1 === i
  54628. ? (console.warn(
  54629. 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'
  54630. ),
  54631. new n.LineSegments(e, t))
  54632. : (n.Object3D.call(this),
  54633. (this.type = 'Line'),
  54634. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54635. void (this.material =
  54636. void 0 !== t
  54637. ? t
  54638. : new n.LineBasicMaterial({
  54639. color: 16777215 * Math.random(),
  54640. })));
  54641. }),
  54642. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  54643. (n.Line.prototype.constructor = n.Line),
  54644. (n.Line.prototype.raycast = (function () {
  54645. var e = new n.Matrix4(),
  54646. t = new n.Ray(),
  54647. i = new n.Sphere();
  54648. return function (r, o) {
  54649. var a = r.linePrecision,
  54650. s = a * a,
  54651. l = this.geometry,
  54652. c = this.matrixWorld;
  54653. if (
  54654. (null === l.boundingSphere && l.computeBoundingSphere(),
  54655. i.copy(l.boundingSphere),
  54656. i.applyMatrix4(c),
  54657. r.ray.intersectsSphere(i) !== !1)
  54658. ) {
  54659. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  54660. var h = new n.Vector3(),
  54661. u = new n.Vector3(),
  54662. d = new n.Vector3(),
  54663. p = new n.Vector3(),
  54664. f = this instanceof n.LineSegments ? 2 : 1;
  54665. if (l instanceof n.BufferGeometry) {
  54666. var g = l.index,
  54667. m = l.attributes,
  54668. v = m.position.array;
  54669. if (null !== g)
  54670. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  54671. var I = A[y],
  54672. E = A[y + 1];
  54673. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E);
  54674. var b = t.distanceSqToSegment(h, u, p, d);
  54675. if (!(b > s)) {
  54676. p.applyMatrix4(this.matrixWorld);
  54677. var w = r.ray.origin.distanceTo(p);
  54678. w < r.near ||
  54679. w > r.far ||
  54680. o.push({
  54681. distance: w,
  54682. point: d.clone().applyMatrix4(this.matrixWorld),
  54683. index: y,
  54684. face: null,
  54685. faceIndex: null,
  54686. object: this,
  54687. });
  54688. }
  54689. }
  54690. else
  54691. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  54692. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3);
  54693. var b = t.distanceSqToSegment(h, u, p, d);
  54694. if (!(b > s)) {
  54695. p.applyMatrix4(this.matrixWorld);
  54696. var w = r.ray.origin.distanceTo(p);
  54697. w < r.near ||
  54698. w > r.far ||
  54699. o.push({
  54700. distance: w,
  54701. point: d.clone().applyMatrix4(this.matrixWorld),
  54702. index: y,
  54703. face: null,
  54704. faceIndex: null,
  54705. object: this,
  54706. });
  54707. }
  54708. }
  54709. } else if (l instanceof n.Geometry)
  54710. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  54711. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  54712. if (!(b > s)) {
  54713. p.applyMatrix4(this.matrixWorld);
  54714. var w = r.ray.origin.distanceTo(p);
  54715. w < r.near ||
  54716. w > r.far ||
  54717. o.push({
  54718. distance: w,
  54719. point: d.clone().applyMatrix4(this.matrixWorld),
  54720. index: y,
  54721. face: null,
  54722. faceIndex: null,
  54723. object: this,
  54724. });
  54725. }
  54726. }
  54727. }
  54728. };
  54729. })()),
  54730. (n.Line.prototype.clone = function () {
  54731. return new this.constructor(this.geometry, this.material).copy(this);
  54732. }),
  54733. (n.LineStrip = 0),
  54734. (n.LinePieces = 1),
  54735. (n.LineSegments = function (e, t) {
  54736. n.Line.call(this, e, t), (this.type = 'LineSegments');
  54737. }),
  54738. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  54739. (n.LineSegments.prototype.constructor = n.LineSegments),
  54740. (n.Mesh = function (e, t) {
  54741. n.Object3D.call(this),
  54742. (this.type = 'Mesh'),
  54743. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54744. (this.material =
  54745. void 0 !== t
  54746. ? t
  54747. : new n.MeshBasicMaterial({
  54748. color: 16777215 * Math.random(),
  54749. })),
  54750. (this.drawMode = n.TrianglesDrawMode),
  54751. this.updateMorphTargets();
  54752. }),
  54753. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  54754. (n.Mesh.prototype.constructor = n.Mesh),
  54755. (n.Mesh.prototype.setDrawMode = function (e) {
  54756. this.drawMode = e;
  54757. }),
  54758. (n.Mesh.prototype.updateMorphTargets = function () {
  54759. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  54760. (this.morphTargetBase = -1),
  54761. (this.morphTargetInfluences = []),
  54762. (this.morphTargetDictionary = {});
  54763. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  54764. this.morphTargetInfluences.push(0),
  54765. (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e);
  54766. }
  54767. }),
  54768. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  54769. return void 0 !== this.morphTargetDictionary[e]
  54770. ? this.morphTargetDictionary[e]
  54771. : (console.warn(
  54772. 'THREE.Mesh.getMorphTargetIndexByName: morph target ' +
  54773. e +
  54774. ' does not exist. Returning 0.'
  54775. ),
  54776. 0);
  54777. }),
  54778. (n.Mesh.prototype.raycast = (function () {
  54779. function e(e, t, i, r, o, a, s) {
  54780. return (
  54781. n.Triangle.barycoordFromPoint(e, t, i, r, m),
  54782. o.multiplyScalar(m.x),
  54783. a.multiplyScalar(m.y),
  54784. s.multiplyScalar(m.z),
  54785. o.add(a).add(s),
  54786. o.clone()
  54787. );
  54788. }
  54789. function t(e, t, i, r, o, a, s) {
  54790. var l,
  54791. c = e.material;
  54792. if (
  54793. ((l =
  54794. c.side === n.BackSide
  54795. ? i.intersectTriangle(a, o, r, !0, s)
  54796. : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)),
  54797. null === l)
  54798. )
  54799. return null;
  54800. A.copy(s), A.applyMatrix4(e.matrixWorld);
  54801. var h = t.ray.origin.distanceTo(A);
  54802. return h < t.near || h > t.far
  54803. ? null
  54804. : {
  54805. distance: h,
  54806. point: A.clone(),
  54807. object: e,
  54808. };
  54809. }
  54810. function i(i, r, o, a, h, u, d, m) {
  54811. s.fromArray(a, 3 * u), l.fromArray(a, 3 * d), c.fromArray(a, 3 * m);
  54812. var A = t(i, r, o, s, l, c, v);
  54813. return (
  54814. A &&
  54815. (h &&
  54816. (p.fromArray(h, 2 * u),
  54817. f.fromArray(h, 2 * d),
  54818. g.fromArray(h, 2 * m),
  54819. (A.uv = e(v, s, l, c, p, f, g))),
  54820. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  54821. (A.faceIndex = u)),
  54822. A
  54823. );
  54824. }
  54825. var r = new n.Matrix4(),
  54826. o = new n.Ray(),
  54827. a = new n.Sphere(),
  54828. s = new n.Vector3(),
  54829. l = new n.Vector3(),
  54830. c = new n.Vector3(),
  54831. h = new n.Vector3(),
  54832. u = new n.Vector3(),
  54833. d = new n.Vector3(),
  54834. p = new n.Vector2(),
  54835. f = new n.Vector2(),
  54836. g = new n.Vector2(),
  54837. m = new n.Vector3(),
  54838. v = new n.Vector3(),
  54839. A = new n.Vector3();
  54840. return function (m, A) {
  54841. var y = this.geometry,
  54842. C = this.material,
  54843. I = this.matrixWorld;
  54844. if (
  54845. void 0 !== C &&
  54846. (null === y.boundingSphere && y.computeBoundingSphere(),
  54847. a.copy(y.boundingSphere),
  54848. a.applyMatrix4(I),
  54849. m.ray.intersectsSphere(a) !== !1 &&
  54850. (r.getInverse(I),
  54851. o.copy(m.ray).applyMatrix4(r),
  54852. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))
  54853. ) {
  54854. var E, b;
  54855. if (y instanceof n.BufferGeometry) {
  54856. var w,
  54857. _,
  54858. T,
  54859. x = y.index,
  54860. S = y.attributes,
  54861. M = S.position.array;
  54862. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  54863. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  54864. (w = R[P]),
  54865. (_ = R[P + 1]),
  54866. (T = R[P + 2]),
  54867. (b = i(this, m, o, M, E, w, _, T)),
  54868. b && ((b.faceIndex = Math.floor(P / 3)), A.push(b));
  54869. else
  54870. for (var P = 0, O = M.length; P < O; P += 9)
  54871. (w = P / 3),
  54872. (_ = w + 1),
  54873. (T = w + 2),
  54874. (b = i(this, m, o, M, E, w, _, T)),
  54875. b && ((b.index = w), A.push(b));
  54876. } else if (y instanceof n.Geometry) {
  54877. var L,
  54878. D,
  54879. N,
  54880. B = C instanceof n.MultiMaterial,
  54881. F = B === !0 ? C.materials : null,
  54882. V = y.vertices,
  54883. U = y.faces,
  54884. k = y.faceVertexUvs[0];
  54885. k.length > 0 && (E = k);
  54886. for (var H = 0, G = U.length; H < G; H++) {
  54887. var z = U[H],
  54888. W = B === !0 ? F[z.materialIndex] : C;
  54889. if (void 0 !== W) {
  54890. if (((L = V[z.a]), (D = V[z.b]), (N = V[z.c]), W.morphTargets === !0)) {
  54891. var j = y.morphTargets,
  54892. Y = this.morphTargetInfluences;
  54893. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0);
  54894. for (var X = 0, Z = j.length; X < Z; X++) {
  54895. var q = Y[X];
  54896. if (0 !== q) {
  54897. var K = j[X].vertices;
  54898. s.addScaledVector(h.subVectors(K[z.a], L), q),
  54899. l.addScaledVector(u.subVectors(K[z.b], D), q),
  54900. c.addScaledVector(d.subVectors(K[z.c], N), q);
  54901. }
  54902. }
  54903. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c);
  54904. }
  54905. if ((b = t(this, m, o, L, D, N, v))) {
  54906. if (E) {
  54907. var Q = E[H];
  54908. p.copy(Q[0]), f.copy(Q[1]), g.copy(Q[2]), (b.uv = e(v, L, D, N, p, f, g));
  54909. }
  54910. (b.face = z), (b.faceIndex = H), A.push(b);
  54911. }
  54912. }
  54913. }
  54914. }
  54915. }
  54916. };
  54917. })()),
  54918. (n.Mesh.prototype.clone = function () {
  54919. return new this.constructor(this.geometry, this.material).copy(this);
  54920. }),
  54921. (n.Bone = function (e) {
  54922. n.Object3D.call(this), (this.type = 'Bone'), (this.skin = e);
  54923. }),
  54924. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  54925. (n.Bone.prototype.constructor = n.Bone),
  54926. (n.Bone.prototype.copy = function (e) {
  54927. return n.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this;
  54928. }),
  54929. (n.Skeleton = function (e, t, i) {
  54930. if (
  54931. ((this.useVertexTexture = void 0 === i || i),
  54932. (this.identityMatrix = new n.Matrix4()),
  54933. (e = e || []),
  54934. (this.bones = e.slice(0)),
  54935. this.useVertexTexture)
  54936. ) {
  54937. var r = Math.sqrt(4 * this.bones.length);
  54938. (r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  54939. (r = Math.max(r, 4)),
  54940. (this.boneTextureWidth = r),
  54941. (this.boneTextureHeight = r),
  54942. (this.boneMatrices = new Float32Array(
  54943. this.boneTextureWidth * this.boneTextureHeight * 4
  54944. )),
  54945. (this.boneTexture = new n.DataTexture(
  54946. this.boneMatrices,
  54947. this.boneTextureWidth,
  54948. this.boneTextureHeight,
  54949. n.RGBAFormat,
  54950. n.FloatType
  54951. ));
  54952. } else this.boneMatrices = new Float32Array(16 * this.bones.length);
  54953. if (void 0 === t) this.calculateInverses();
  54954. else if (this.bones.length === t.length) this.boneInverses = t.slice(0);
  54955. else {
  54956. console.warn('THREE.Skeleton bonInverses is the wrong length.'),
  54957. (this.boneInverses = []);
  54958. for (var o = 0, a = this.bones.length; o < a; o++)
  54959. this.boneInverses.push(new n.Matrix4());
  54960. }
  54961. }),
  54962. (n.Skeleton.prototype.calculateInverses = function () {
  54963. this.boneInverses = [];
  54964. for (var e = 0, t = this.bones.length; e < t; e++) {
  54965. var i = new n.Matrix4();
  54966. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i);
  54967. }
  54968. }),
  54969. (n.Skeleton.prototype.pose = function () {
  54970. for (var e, t = 0, i = this.bones.length; t < i; t++)
  54971. (e = this.bones[t]), e && e.matrixWorld.getInverse(this.boneInverses[t]);
  54972. for (var t = 0, i = this.bones.length; t < i; t++)
  54973. (e = this.bones[t]),
  54974. e &&
  54975. (e.parent
  54976. ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld))
  54977. : e.matrix.copy(e.matrixWorld),
  54978. e.matrix.decompose(e.position, e.quaternion, e.scale));
  54979. }),
  54980. (n.Skeleton.prototype.update = (function () {
  54981. var e = new n.Matrix4();
  54982. return function () {
  54983. for (var t = 0, i = this.bones.length; t < i; t++) {
  54984. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  54985. e.multiplyMatrices(n, this.boneInverses[t]),
  54986. e.flattenToArrayOffset(this.boneMatrices, 16 * t);
  54987. }
  54988. this.useVertexTexture && (this.boneTexture.needsUpdate = !0);
  54989. };
  54990. })()),
  54991. (n.Skeleton.prototype.clone = function () {
  54992. return new n.Skeleton(this.bones, this.boneInverses, this.useVertexTexture);
  54993. }),
  54994. (n.SkinnedMesh = function (e, t, i) {
  54995. n.Mesh.call(this, e, t),
  54996. (this.type = 'SkinnedMesh'),
  54997. (this.bindMode = 'attached'),
  54998. (this.bindMatrix = new n.Matrix4()),
  54999. (this.bindMatrixInverse = new n.Matrix4());
  55000. var r = [];
  55001. if (this.geometry && void 0 !== this.geometry.bones) {
  55002. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  55003. (a = this.geometry.bones[s]),
  55004. (o = new n.Bone(this)),
  55005. r.push(o),
  55006. (o.name = a.name),
  55007. o.position.fromArray(a.pos),
  55008. o.quaternion.fromArray(a.rotq),
  55009. void 0 !== a.scl && o.scale.fromArray(a.scl);
  55010. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  55011. (a = this.geometry.bones[s]),
  55012. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s]);
  55013. }
  55014. this.normalizeSkinWeights(),
  55015. this.updateMatrixWorld(!0),
  55016. this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld);
  55017. }),
  55018. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  55019. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  55020. (n.SkinnedMesh.prototype.bind = function (e, t) {
  55021. (this.skeleton = e),
  55022. void 0 === t &&
  55023. (this.updateMatrixWorld(!0),
  55024. this.skeleton.calculateInverses(),
  55025. (t = this.matrixWorld)),
  55026. this.bindMatrix.copy(t),
  55027. this.bindMatrixInverse.getInverse(t);
  55028. }),
  55029. (n.SkinnedMesh.prototype.pose = function () {
  55030. this.skeleton.pose();
  55031. }),
  55032. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  55033. if (this.geometry instanceof n.Geometry)
  55034. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  55035. var t = this.geometry.skinWeights[e],
  55036. i = 1 / t.lengthManhattan();
  55037. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0);
  55038. }
  55039. else if (this.geometry instanceof n.BufferGeometry)
  55040. for (
  55041. var r = new n.Vector4(), o = this.geometry.attributes.skinWeight, e = 0;
  55042. e < o.count;
  55043. e++
  55044. ) {
  55045. (r.x = o.getX(e)), (r.y = o.getY(e)), (r.z = o.getZ(e)), (r.w = o.getW(e));
  55046. var i = 1 / r.lengthManhattan();
  55047. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  55048. o.setXYZW(e, r.x, r.y, r.z, r.w);
  55049. }
  55050. }),
  55051. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  55052. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  55053. 'attached' === this.bindMode
  55054. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  55055. : 'detached' === this.bindMode
  55056. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  55057. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode);
  55058. }),
  55059. (n.SkinnedMesh.prototype.clone = function () {
  55060. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(
  55061. this
  55062. );
  55063. }),
  55064. (n.LOD = function () {
  55065. n.Object3D.call(this),
  55066. (this.type = 'LOD'),
  55067. Object.defineProperties(this, {
  55068. levels: {
  55069. enumerable: !0,
  55070. value: [],
  55071. },
  55072. objects: {
  55073. get: function () {
  55074. return (
  55075. console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  55076. );
  55077. },
  55078. },
  55079. });
  55080. }),
  55081. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  55082. (n.LOD.prototype.constructor = n.LOD),
  55083. (n.LOD.prototype.addLevel = function (e, t) {
  55084. void 0 === t && (t = 0), (t = Math.abs(t));
  55085. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  55086. i.splice(n, 0, {
  55087. distance: t,
  55088. object: e,
  55089. }),
  55090. this.add(e);
  55091. }),
  55092. (n.LOD.prototype.getObjectForDistance = function (e) {
  55093. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  55094. return t[i - 1].object;
  55095. }),
  55096. (n.LOD.prototype.raycast = (function () {
  55097. var e = new n.Vector3();
  55098. return function (t, i) {
  55099. e.setFromMatrixPosition(this.matrixWorld);
  55100. var n = t.ray.origin.distanceTo(e);
  55101. this.getObjectForDistance(n).raycast(t, i);
  55102. };
  55103. })()),
  55104. (n.LOD.prototype.update = (function () {
  55105. var e = new n.Vector3(),
  55106. t = new n.Vector3();
  55107. return function (i) {
  55108. var n = this.levels;
  55109. if (n.length > 1) {
  55110. e.setFromMatrixPosition(i.matrixWorld), t.setFromMatrixPosition(this.matrixWorld);
  55111. var r = e.distanceTo(t);
  55112. n[0].object.visible = !0;
  55113. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  55114. (n[o - 1].object.visible = !1), (n[o].object.visible = !0);
  55115. for (; o < a; o++) n[o].object.visible = !1;
  55116. }
  55117. };
  55118. })()),
  55119. (n.LOD.prototype.copy = function (e) {
  55120. n.Object3D.prototype.copy.call(this, e, !1);
  55121. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  55122. var o = t[i];
  55123. this.addLevel(o.object.clone(), o.distance);
  55124. }
  55125. return this;
  55126. }),
  55127. (n.LOD.prototype.toJSON = function (e) {
  55128. var t = n.Object3D.prototype.toJSON.call(this, e);
  55129. t.object.levels = [];
  55130. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  55131. var a = i[r];
  55132. t.object.levels.push({
  55133. object: a.object.uuid,
  55134. distance: a.distance,
  55135. });
  55136. }
  55137. return t;
  55138. }),
  55139. (n.Sprite = (function () {
  55140. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  55141. t = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]),
  55142. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  55143. r = new n.BufferGeometry();
  55144. return (
  55145. r.setIndex(new n.BufferAttribute(e, 1)),
  55146. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  55147. r.addAttribute('uv', new n.BufferAttribute(i, 2)),
  55148. function (e) {
  55149. n.Object3D.call(this),
  55150. (this.type = 'Sprite'),
  55151. (this.geometry = r),
  55152. (this.material = void 0 !== e ? e : new n.SpriteMaterial());
  55153. }
  55154. );
  55155. })()),
  55156. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  55157. (n.Sprite.prototype.constructor = n.Sprite),
  55158. (n.Sprite.prototype.raycast = (function () {
  55159. var e = new n.Vector3();
  55160. return function (t, i) {
  55161. e.setFromMatrixPosition(this.matrixWorld);
  55162. var n = t.ray.distanceSqToPoint(e),
  55163. r = this.scale.x * this.scale.y;
  55164. n > r ||
  55165. i.push({
  55166. distance: Math.sqrt(n),
  55167. point: this.position,
  55168. face: null,
  55169. object: this,
  55170. });
  55171. };
  55172. })()),
  55173. (n.Sprite.prototype.clone = function () {
  55174. return new this.constructor(this.material).copy(this);
  55175. }),
  55176. (n.Particle = n.Sprite),
  55177. (n.LensFlare = function (e, t, i, r, o) {
  55178. n.Object3D.call(this),
  55179. (this.lensFlares = []),
  55180. (this.positionScreen = new n.Vector3()),
  55181. (this.customUpdateCallback = void 0),
  55182. void 0 !== e && this.add(e, t, i, r, o);
  55183. }),
  55184. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  55185. (n.LensFlare.prototype.constructor = n.LensFlare),
  55186. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  55187. void 0 === t && (t = -1),
  55188. void 0 === i && (i = 0),
  55189. void 0 === a && (a = 1),
  55190. void 0 === o && (o = new n.Color(16777215)),
  55191. void 0 === r && (r = n.NormalBlending),
  55192. (i = Math.min(i, Math.max(0, i))),
  55193. this.lensFlares.push({
  55194. texture: e,
  55195. size: t,
  55196. distance: i,
  55197. x: 0,
  55198. y: 0,
  55199. z: 0,
  55200. scale: 1,
  55201. rotation: 0,
  55202. opacity: a,
  55203. color: o,
  55204. blending: r,
  55205. });
  55206. }),
  55207. (n.LensFlare.prototype.updateLensFlares = function () {
  55208. var e,
  55209. t,
  55210. i = this.lensFlares.length,
  55211. n = 2 * -this.positionScreen.x,
  55212. r = 2 * -this.positionScreen.y;
  55213. for (e = 0; e < i; e++)
  55214. (t = this.lensFlares[e]),
  55215. (t.x = this.positionScreen.x + n * t.distance),
  55216. (t.y = this.positionScreen.y + r * t.distance),
  55217. (t.wantedRotation = t.x * Math.PI * 0.25),
  55218. (t.rotation += 0.25 * (t.wantedRotation - t.rotation));
  55219. }),
  55220. (n.LensFlare.prototype.copy = function (e) {
  55221. n.Object3D.prototype.copy.call(this, e),
  55222. this.positionScreen.copy(e.positionScreen),
  55223. (this.customUpdateCallback = e.customUpdateCallback);
  55224. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  55225. this.lensFlares.push(e.lensFlares[t]);
  55226. return this;
  55227. }),
  55228. (n.Scene = function () {
  55229. n.Object3D.call(this),
  55230. (this.type = 'Scene'),
  55231. (this.fog = null),
  55232. (this.overrideMaterial = null),
  55233. (this.autoUpdate = !0);
  55234. }),
  55235. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  55236. (n.Scene.prototype.constructor = n.Scene),
  55237. (n.Scene.prototype.copy = function (e, t) {
  55238. return (
  55239. n.Object3D.prototype.copy.call(this, e, t),
  55240. null !== e.fog && (this.fog = e.fog.clone()),
  55241. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  55242. (this.autoUpdate = e.autoUpdate),
  55243. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  55244. this
  55245. );
  55246. }),
  55247. (n.Fog = function (e, t, i) {
  55248. (this.name = ''),
  55249. (this.color = new n.Color(e)),
  55250. (this.near = void 0 !== t ? t : 1),
  55251. (this.far = void 0 !== i ? i : 1e3);
  55252. }),
  55253. (n.Fog.prototype.clone = function () {
  55254. return new n.Fog(this.color.getHex(), this.near, this.far);
  55255. }),
  55256. (n.FogExp2 = function (e, t) {
  55257. (this.name = ''),
  55258. (this.color = new n.Color(e)),
  55259. (this.density = void 0 !== t ? t : 25e-5);
  55260. }),
  55261. (n.FogExp2.prototype.clone = function () {
  55262. return new n.FogExp2(this.color.getHex(), this.density);
  55263. }),
  55264. (n.ShaderChunk = {}),
  55265. (n.ShaderChunk.alphamap_fragment =
  55266. '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  55267. (n.ShaderChunk.alphamap_pars_fragment =
  55268. '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  55269. (n.ShaderChunk.alphatest_fragment =
  55270. '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  55271. (n.ShaderChunk.aomap_fragment =
  55272. '#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n'),
  55273. (n.ShaderChunk.aomap_pars_fragment =
  55274. '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  55275. (n.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  55276. (n.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  55277. (n.ShaderChunk.bsdfs =
  55278. 'bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n'),
  55279. (n.ShaderChunk.bumpmap_pars_fragment =
  55280. '#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n'),
  55281. (n.ShaderChunk.color_fragment =
  55282. '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  55283. (n.ShaderChunk.color_pars_fragment =
  55284. '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  55285. (n.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  55286. (n.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  55287. (n.ShaderChunk.common =
  55288. '#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n'),
  55289. (n.ShaderChunk.cube_uv_reflection_fragment =
  55290. '#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n'),
  55291. (n.ShaderChunk.defaultnormal_vertex =
  55292. '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  55293. (n.ShaderChunk.displacementmap_vertex =
  55294. '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  55295. (n.ShaderChunk.displacementmap_pars_vertex =
  55296. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  55297. (n.ShaderChunk.emissivemap_fragment =
  55298. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  55299. (n.ShaderChunk.emissivemap_pars_fragment =
  55300. '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  55301. (n.ShaderChunk.encodings_pars_fragment =
  55302. '\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n'),
  55303. (n.ShaderChunk.encodings_fragment =
  55304. ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  55305. (n.ShaderChunk.envmap_fragment =
  55306. '#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n'),
  55307. (n.ShaderChunk.envmap_pars_fragment =
  55308. '#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n'),
  55309. (n.ShaderChunk.envmap_pars_vertex =
  55310. '#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n'),
  55311. (n.ShaderChunk.envmap_vertex =
  55312. '#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n'),
  55313. (n.ShaderChunk.fog_fragment =
  55314. '#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n'),
  55315. (n.ShaderChunk.fog_pars_fragment =
  55316. '#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif'),
  55317. (n.ShaderChunk.lightmap_fragment =
  55318. '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  55319. (n.ShaderChunk.lightmap_pars_fragment =
  55320. '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  55321. (n.ShaderChunk.lights_lambert_vertex =
  55322. 'vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n'),
  55323. (n.ShaderChunk.lights_pars =
  55324. 'uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n'),
  55325. (n.ShaderChunk.lights_phong_fragment =
  55326. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  55327. (n.ShaderChunk.lights_phong_pars_fragment =
  55328. '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n'),
  55329. (n.ShaderChunk.lights_phong_pars_vertex =
  55330. '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  55331. (n.ShaderChunk.lights_phong_vertex =
  55332. '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  55333. (n.ShaderChunk.lights_standard_fragment =
  55334. 'StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n'),
  55335. (n.ShaderChunk.lights_standard_pars_fragment =
  55336. 'struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n'),
  55337. (n.ShaderChunk.lights_template =
  55338. '\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n'),
  55339. (n.ShaderChunk.logdepthbuf_fragment =
  55340. '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  55341. (n.ShaderChunk.logdepthbuf_pars_fragment =
  55342. '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n'),
  55343. (n.ShaderChunk.logdepthbuf_pars_vertex =
  55344. '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif'),
  55345. (n.ShaderChunk.logdepthbuf_vertex =
  55346. '#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n'),
  55347. (n.ShaderChunk.map_fragment =
  55348. '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  55349. (n.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  55350. (n.ShaderChunk.map_particle_fragment =
  55351. '#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n'),
  55352. (n.ShaderChunk.map_particle_pars_fragment =
  55353. '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  55354. (n.ShaderChunk.metalnessmap_fragment =
  55355. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  55356. (n.ShaderChunk.metalnessmap_pars_fragment =
  55357. '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  55358. (n.ShaderChunk.morphnormal_vertex =
  55359. '#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n'),
  55360. (n.ShaderChunk.morphtarget_pars_vertex =
  55361. '#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif');
  55362. n.ShaderChunk.morphtarget_vertex =
  55363. '#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n';
  55364. (n.ShaderChunk.normal_fragment =
  55365. '#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n'),
  55366. (n.ShaderChunk.normalmap_pars_fragment =
  55367. '#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n'),
  55368. (n.ShaderChunk.premultiplied_alpha_fragment =
  55369. '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  55370. (n.ShaderChunk.project_vertex =
  55371. '#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n'),
  55372. (n.ShaderChunk.roughnessmap_fragment =
  55373. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  55374. (n.ShaderChunk.roughnessmap_pars_fragment =
  55375. '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  55376. (n.ShaderChunk.shadowmap_pars_fragment =
  55377. '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n'),
  55378. (n.ShaderChunk.shadowmap_pars_vertex =
  55379. '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n'),
  55380. (n.ShaderChunk.shadowmap_vertex =
  55381. '#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n'),
  55382. (n.ShaderChunk.shadowmask_pars_fragment =
  55383. 'float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n'),
  55384. (n.ShaderChunk.skinbase_vertex =
  55385. '#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif'),
  55386. (n.ShaderChunk.skinning_pars_vertex =
  55387. '#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n'),
  55388. (n.ShaderChunk.skinning_vertex =
  55389. '#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n'),
  55390. (n.ShaderChunk.skinnormal_vertex =
  55391. '#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n'),
  55392. (n.ShaderChunk.specularmap_fragment =
  55393. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  55394. (n.ShaderChunk.specularmap_pars_fragment =
  55395. '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  55396. (n.ShaderChunk.tonemapping_fragment =
  55397. '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  55398. (n.ShaderChunk.tonemapping_pars_fragment =
  55399. '#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n'),
  55400. (n.ShaderChunk.uv2_pars_fragment =
  55401. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  55402. (n.ShaderChunk.uv2_pars_vertex =
  55403. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  55404. (n.ShaderChunk.uv2_vertex =
  55405. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  55406. (n.ShaderChunk.uv_pars_fragment =
  55407. '#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif'),
  55408. (n.ShaderChunk.uv_pars_vertex =
  55409. '#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n'),
  55410. (n.ShaderChunk.uv_vertex =
  55411. '#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif'),
  55412. (n.ShaderChunk.worldpos_vertex =
  55413. '#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n'),
  55414. (n.UniformsUtils = {
  55415. merge: function (e) {
  55416. for (var t = {}, i = 0; i < e.length; i++) {
  55417. var n = this.clone(e[i]);
  55418. for (var r in n) t[r] = n[r];
  55419. }
  55420. return t;
  55421. },
  55422. clone: function (e) {
  55423. var t = {};
  55424. for (var i in e) {
  55425. t[i] = {};
  55426. for (var r in e[i]) {
  55427. var o = e[i][r];
  55428. o instanceof n.Color ||
  55429. o instanceof n.Vector2 ||
  55430. o instanceof n.Vector3 ||
  55431. o instanceof n.Vector4 ||
  55432. o instanceof n.Matrix3 ||
  55433. o instanceof n.Matrix4 ||
  55434. o instanceof n.Texture
  55435. ? (t[i][r] = o.clone())
  55436. : Array.isArray(o)
  55437. ? (t[i][r] = o.slice())
  55438. : (t[i][r] = o);
  55439. }
  55440. }
  55441. return t;
  55442. },
  55443. }),
  55444. (n.UniformsLib = {
  55445. common: {
  55446. diffuse: {
  55447. type: 'c',
  55448. value: new n.Color(15658734),
  55449. },
  55450. opacity: {
  55451. type: 'f',
  55452. value: 1,
  55453. },
  55454. map: {
  55455. type: 't',
  55456. value: null,
  55457. },
  55458. offsetRepeat: {
  55459. type: 'v4',
  55460. value: new n.Vector4(0, 0, 1, 1),
  55461. },
  55462. specularMap: {
  55463. type: 't',
  55464. value: null,
  55465. },
  55466. alphaMap: {
  55467. type: 't',
  55468. value: null,
  55469. },
  55470. envMap: {
  55471. type: 't',
  55472. value: null,
  55473. },
  55474. flipEnvMap: {
  55475. type: 'f',
  55476. value: -1,
  55477. },
  55478. reflectivity: {
  55479. type: 'f',
  55480. value: 1,
  55481. },
  55482. refractionRatio: {
  55483. type: 'f',
  55484. value: 0.98,
  55485. },
  55486. },
  55487. aomap: {
  55488. aoMap: {
  55489. type: 't',
  55490. value: null,
  55491. },
  55492. aoMapIntensity: {
  55493. type: 'f',
  55494. value: 1,
  55495. },
  55496. },
  55497. lightmap: {
  55498. lightMap: {
  55499. type: 't',
  55500. value: null,
  55501. },
  55502. lightMapIntensity: {
  55503. type: 'f',
  55504. value: 1,
  55505. },
  55506. },
  55507. emissivemap: {
  55508. emissiveMap: {
  55509. type: 't',
  55510. value: null,
  55511. },
  55512. },
  55513. bumpmap: {
  55514. bumpMap: {
  55515. type: 't',
  55516. value: null,
  55517. },
  55518. bumpScale: {
  55519. type: 'f',
  55520. value: 1,
  55521. },
  55522. },
  55523. normalmap: {
  55524. normalMap: {
  55525. type: 't',
  55526. value: null,
  55527. },
  55528. normalScale: {
  55529. type: 'v2',
  55530. value: new n.Vector2(1, 1),
  55531. },
  55532. },
  55533. displacementmap: {
  55534. displacementMap: {
  55535. type: 't',
  55536. value: null,
  55537. },
  55538. displacementScale: {
  55539. type: 'f',
  55540. value: 1,
  55541. },
  55542. displacementBias: {
  55543. type: 'f',
  55544. value: 0,
  55545. },
  55546. },
  55547. roughnessmap: {
  55548. roughnessMap: {
  55549. type: 't',
  55550. value: null,
  55551. },
  55552. },
  55553. metalnessmap: {
  55554. metalnessMap: {
  55555. type: 't',
  55556. value: null,
  55557. },
  55558. },
  55559. fog: {
  55560. fogDensity: {
  55561. type: 'f',
  55562. value: 25e-5,
  55563. },
  55564. fogNear: {
  55565. type: 'f',
  55566. value: 1,
  55567. },
  55568. fogFar: {
  55569. type: 'f',
  55570. value: 2e3,
  55571. },
  55572. fogColor: {
  55573. type: 'c',
  55574. value: new n.Color(16777215),
  55575. },
  55576. },
  55577. lights: {
  55578. ambientLightColor: {
  55579. type: 'fv',
  55580. value: [],
  55581. },
  55582. directionalLights: {
  55583. type: 'sa',
  55584. value: [],
  55585. properties: {
  55586. direction: {
  55587. type: 'v3',
  55588. },
  55589. color: {
  55590. type: 'c',
  55591. },
  55592. shadow: {
  55593. type: 'i',
  55594. },
  55595. shadowBias: {
  55596. type: 'f',
  55597. },
  55598. shadowRadius: {
  55599. type: 'f',
  55600. },
  55601. shadowMapSize: {
  55602. type: 'v2',
  55603. },
  55604. },
  55605. },
  55606. directionalShadowMap: {
  55607. type: 'tv',
  55608. value: [],
  55609. },
  55610. directionalShadowMatrix: {
  55611. type: 'm4v',
  55612. value: [],
  55613. },
  55614. spotLights: {
  55615. type: 'sa',
  55616. value: [],
  55617. properties: {
  55618. color: {
  55619. type: 'c',
  55620. },
  55621. position: {
  55622. type: 'v3',
  55623. },
  55624. direction: {
  55625. type: 'v3',
  55626. },
  55627. distance: {
  55628. type: 'f',
  55629. },
  55630. coneCos: {
  55631. type: 'f',
  55632. },
  55633. penumbraCos: {
  55634. type: 'f',
  55635. },
  55636. decay: {
  55637. type: 'f',
  55638. },
  55639. shadow: {
  55640. type: 'i',
  55641. },
  55642. shadowBias: {
  55643. type: 'f',
  55644. },
  55645. shadowRadius: {
  55646. type: 'f',
  55647. },
  55648. shadowMapSize: {
  55649. type: 'v2',
  55650. },
  55651. },
  55652. },
  55653. spotShadowMap: {
  55654. type: 'tv',
  55655. value: [],
  55656. },
  55657. spotShadowMatrix: {
  55658. type: 'm4v',
  55659. value: [],
  55660. },
  55661. pointLights: {
  55662. type: 'sa',
  55663. value: [],
  55664. properties: {
  55665. color: {
  55666. type: 'c',
  55667. },
  55668. position: {
  55669. type: 'v3',
  55670. },
  55671. decay: {
  55672. type: 'f',
  55673. },
  55674. distance: {
  55675. type: 'f',
  55676. },
  55677. shadow: {
  55678. type: 'i',
  55679. },
  55680. shadowBias: {
  55681. type: 'f',
  55682. },
  55683. shadowRadius: {
  55684. type: 'f',
  55685. },
  55686. shadowMapSize: {
  55687. type: 'v2',
  55688. },
  55689. },
  55690. },
  55691. pointShadowMap: {
  55692. type: 'tv',
  55693. value: [],
  55694. },
  55695. pointShadowMatrix: {
  55696. type: 'm4v',
  55697. value: [],
  55698. },
  55699. hemisphereLights: {
  55700. type: 'sa',
  55701. value: [],
  55702. properties: {
  55703. direction: {
  55704. type: 'v3',
  55705. },
  55706. skyColor: {
  55707. type: 'c',
  55708. },
  55709. groundColor: {
  55710. type: 'c',
  55711. },
  55712. },
  55713. },
  55714. },
  55715. points: {
  55716. diffuse: {
  55717. type: 'c',
  55718. value: new n.Color(15658734),
  55719. },
  55720. opacity: {
  55721. type: 'f',
  55722. value: 1,
  55723. },
  55724. size: {
  55725. type: 'f',
  55726. value: 1,
  55727. },
  55728. scale: {
  55729. type: 'f',
  55730. value: 1,
  55731. },
  55732. map: {
  55733. type: 't',
  55734. value: null,
  55735. },
  55736. offsetRepeat: {
  55737. type: 'v4',
  55738. value: new n.Vector4(0, 0, 1, 1),
  55739. },
  55740. },
  55741. }),
  55742. (n.ShaderChunk.cube_frag =
  55743. 'uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n'),
  55744. (n.ShaderChunk.cube_vert =
  55745. 'varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n'),
  55746. (n.ShaderChunk.depth_frag =
  55747. 'uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n'),
  55748. (n.ShaderChunk.depth_vert =
  55749. '#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n'),
  55750. (n.ShaderChunk.depthRGBA_frag =
  55751. '#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n'),
  55752. (n.ShaderChunk.depthRGBA_vert =
  55753. '#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n'),
  55754. (n.ShaderChunk.distanceRGBA_frag =
  55755. 'uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n'),
  55756. (n.ShaderChunk.distanceRGBA_vert =
  55757. 'varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n'),
  55758. (n.ShaderChunk.equirect_frag =
  55759. 'uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n'),
  55760. (n.ShaderChunk.equirect_vert =
  55761. 'varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n'),
  55762. (n.ShaderChunk.linedashed_frag =
  55763. 'uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n'),
  55764. (n.ShaderChunk.linedashed_vert =
  55765. 'uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n'),
  55766. (n.ShaderChunk.meshbasic_frag =
  55767. 'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n'),
  55768. (n.ShaderChunk.meshbasic_vert =
  55769. '#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n'),
  55770. (n.ShaderChunk.meshlambert_frag =
  55771. 'uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n'),
  55772. (n.ShaderChunk.meshlambert_vert =
  55773. '#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n'),
  55774. (n.ShaderChunk.meshphong_frag =
  55775. '#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n'),
  55776. (n.ShaderChunk.meshphong_vert =
  55777. '#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n'),
  55778. (n.ShaderChunk.meshstandard_frag =
  55779. '#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n'),
  55780. (n.ShaderChunk.meshstandard_vert =
  55781. '#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n'),
  55782. (n.ShaderChunk.normal_frag =
  55783. 'uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n'),
  55784. (n.ShaderChunk.normal_vert =
  55785. 'varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n'),
  55786. (n.ShaderChunk.points_frag =
  55787. 'uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n'),
  55788. (n.ShaderChunk.points_vert =
  55789. 'uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n'),
  55790. (n.ShaderLib = {
  55791. basic: {
  55792. uniforms: n.UniformsUtils.merge([
  55793. n.UniformsLib.common,
  55794. n.UniformsLib.aomap,
  55795. n.UniformsLib.fog,
  55796. ]),
  55797. vertexShader: n.ShaderChunk.meshbasic_vert,
  55798. fragmentShader: n.ShaderChunk.meshbasic_frag,
  55799. },
  55800. lambert: {
  55801. uniforms: n.UniformsUtils.merge([
  55802. n.UniformsLib.common,
  55803. n.UniformsLib.aomap,
  55804. n.UniformsLib.lightmap,
  55805. n.UniformsLib.emissivemap,
  55806. n.UniformsLib.fog,
  55807. n.UniformsLib.lights,
  55808. {
  55809. emissive: {
  55810. type: 'c',
  55811. value: new n.Color(0),
  55812. },
  55813. },
  55814. ]),
  55815. vertexShader: n.ShaderChunk.meshlambert_vert,
  55816. fragmentShader: n.ShaderChunk.meshlambert_frag,
  55817. },
  55818. phong: {
  55819. uniforms: n.UniformsUtils.merge([
  55820. n.UniformsLib.common,
  55821. n.UniformsLib.aomap,
  55822. n.UniformsLib.lightmap,
  55823. n.UniformsLib.emissivemap,
  55824. n.UniformsLib.bumpmap,
  55825. n.UniformsLib.normalmap,
  55826. n.UniformsLib.displacementmap,
  55827. n.UniformsLib.fog,
  55828. n.UniformsLib.lights,
  55829. {
  55830. emissive: {
  55831. type: 'c',
  55832. value: new n.Color(0),
  55833. },
  55834. specular: {
  55835. type: 'c',
  55836. value: new n.Color(1118481),
  55837. },
  55838. shininess: {
  55839. type: 'f',
  55840. value: 30,
  55841. },
  55842. },
  55843. ]),
  55844. vertexShader: n.ShaderChunk.meshphong_vert,
  55845. fragmentShader: n.ShaderChunk.meshphong_frag,
  55846. },
  55847. standard: {
  55848. uniforms: n.UniformsUtils.merge([
  55849. n.UniformsLib.common,
  55850. n.UniformsLib.aomap,
  55851. n.UniformsLib.lightmap,
  55852. n.UniformsLib.emissivemap,
  55853. n.UniformsLib.bumpmap,
  55854. n.UniformsLib.normalmap,
  55855. n.UniformsLib.displacementmap,
  55856. n.UniformsLib.roughnessmap,
  55857. n.UniformsLib.metalnessmap,
  55858. n.UniformsLib.fog,
  55859. n.UniformsLib.lights,
  55860. {
  55861. emissive: {
  55862. type: 'c',
  55863. value: new n.Color(0),
  55864. },
  55865. roughness: {
  55866. type: 'f',
  55867. value: 0.5,
  55868. },
  55869. metalness: {
  55870. type: 'f',
  55871. value: 0,
  55872. },
  55873. envMapIntensity: {
  55874. type: 'f',
  55875. value: 1,
  55876. },
  55877. },
  55878. ]),
  55879. vertexShader: n.ShaderChunk.meshstandard_vert,
  55880. fragmentShader: n.ShaderChunk.meshstandard_frag,
  55881. },
  55882. points: {
  55883. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  55884. vertexShader: n.ShaderChunk.points_vert,
  55885. fragmentShader: n.ShaderChunk.points_frag,
  55886. },
  55887. dashed: {
  55888. uniforms: n.UniformsUtils.merge([
  55889. n.UniformsLib.common,
  55890. n.UniformsLib.fog,
  55891. {
  55892. scale: {
  55893. type: 'f',
  55894. value: 1,
  55895. },
  55896. dashSize: {
  55897. type: 'f',
  55898. value: 1,
  55899. },
  55900. totalSize: {
  55901. type: 'f',
  55902. value: 2,
  55903. },
  55904. },
  55905. ]),
  55906. vertexShader: n.ShaderChunk.linedashed_vert,
  55907. fragmentShader: n.ShaderChunk.linedashed_frag,
  55908. },
  55909. depth: {
  55910. uniforms: {
  55911. mNear: {
  55912. type: 'f',
  55913. value: 1,
  55914. },
  55915. mFar: {
  55916. type: 'f',
  55917. value: 2e3,
  55918. },
  55919. opacity: {
  55920. type: 'f',
  55921. value: 1,
  55922. },
  55923. },
  55924. vertexShader: n.ShaderChunk.depth_vert,
  55925. fragmentShader: n.ShaderChunk.depth_frag,
  55926. },
  55927. normal: {
  55928. uniforms: {
  55929. opacity: {
  55930. type: 'f',
  55931. value: 1,
  55932. },
  55933. },
  55934. vertexShader: n.ShaderChunk.normal_vert,
  55935. fragmentShader: n.ShaderChunk.normal_frag,
  55936. },
  55937. cube: {
  55938. uniforms: {
  55939. tCube: {
  55940. type: 't',
  55941. value: null,
  55942. },
  55943. tFlip: {
  55944. type: 'f',
  55945. value: -1,
  55946. },
  55947. },
  55948. vertexShader: n.ShaderChunk.cube_vert,
  55949. fragmentShader: n.ShaderChunk.cube_frag,
  55950. },
  55951. equirect: {
  55952. uniforms: {
  55953. tEquirect: {
  55954. type: 't',
  55955. value: null,
  55956. },
  55957. tFlip: {
  55958. type: 'f',
  55959. value: -1,
  55960. },
  55961. },
  55962. vertexShader: n.ShaderChunk.equirect_vert,
  55963. fragmentShader: n.ShaderChunk.equirect_frag,
  55964. },
  55965. depthRGBA: {
  55966. uniforms: {},
  55967. vertexShader: n.ShaderChunk.depthRGBA_vert,
  55968. fragmentShader: n.ShaderChunk.depthRGBA_frag,
  55969. },
  55970. distanceRGBA: {
  55971. uniforms: {
  55972. lightPos: {
  55973. type: 'v3',
  55974. value: new n.Vector3(0, 0, 0),
  55975. },
  55976. },
  55977. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  55978. fragmentShader: n.ShaderChunk.distanceRGBA_frag,
  55979. },
  55980. }),
  55981. (n.WebGLRenderer = function (e) {
  55982. function t() {
  55983. return null === ye ? Oe : 1;
  55984. }
  55985. function i(e, t, i, n) {
  55986. se === !0 && ((e *= n), (t *= n), (i *= n)), Ye.clearColor(e, t, i, n);
  55987. }
  55988. function r() {
  55989. Ye.init(),
  55990. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  55991. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  55992. i(Se.r, Se.g, Se.b, Me);
  55993. }
  55994. function o() {
  55995. (Ae = null), (be = null), (Ee = ''), (Ie = -1), Ye.reset();
  55996. }
  55997. function a(e) {
  55998. e.preventDefault(), o(), r(), Xe.clear();
  55999. }
  56000. function s(e) {
  56001. var t = e.target;
  56002. t.removeEventListener('dispose', s), h(t), ke.textures--;
  56003. }
  56004. function l(e) {
  56005. var t = e.target;
  56006. t.removeEventListener('dispose', l), u(t), ke.textures--;
  56007. }
  56008. function c(e) {
  56009. var t = e.target;
  56010. t.removeEventListener('dispose', c), d(t);
  56011. }
  56012. function h(e) {
  56013. var t = Xe.get(e);
  56014. if (e.image && t.__image__webglTextureCube)
  56015. Ge.deleteTexture(t.__image__webglTextureCube);
  56016. else {
  56017. if (void 0 === t.__webglInit) return;
  56018. Ge.deleteTexture(t.__webglTexture);
  56019. }
  56020. Xe.delete(e);
  56021. }
  56022. function u(e) {
  56023. var t = Xe.get(e),
  56024. i = Xe.get(e.texture);
  56025. if (e && void 0 !== i.__webglTexture) {
  56026. if ((Ge.deleteTexture(i.__webglTexture), e instanceof n.WebGLRenderTargetCube))
  56027. for (var r = 0; r < 6; r++)
  56028. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  56029. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  56030. else
  56031. Ge.deleteFramebuffer(t.__webglFramebuffer),
  56032. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  56033. Xe.delete(e.texture), Xe.delete(e);
  56034. }
  56035. }
  56036. function d(e) {
  56037. p(e), Xe.delete(e);
  56038. }
  56039. function p(e) {
  56040. var t = Xe.get(e).program;
  56041. (e.program = void 0), void 0 !== t && qe.releaseProgram(t);
  56042. }
  56043. function f(e, t, i, r) {
  56044. var o;
  56045. if (
  56046. i instanceof n.InstancedBufferGeometry &&
  56047. ((o = We.get('ANGLE_instanced_arrays')), null === o)
  56048. )
  56049. return void console.error(
  56050. 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  56051. );
  56052. void 0 === r && (r = 0), Ye.initAttributes();
  56053. var a = i.attributes,
  56054. s = t.getAttributes(),
  56055. l = e.defaultAttributeValues;
  56056. for (var c in s) {
  56057. var h = s[c];
  56058. if (h >= 0) {
  56059. var u = a[c];
  56060. if (void 0 !== u) {
  56061. var d = u.itemSize,
  56062. p = Ze.getAttributeBuffer(u);
  56063. if (u instanceof n.InterleavedBufferAttribute) {
  56064. var f = u.data,
  56065. g = f.stride,
  56066. m = u.offset;
  56067. f instanceof n.InstancedInterleavedBuffer
  56068. ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  56069. void 0 === i.maxInstancedCount &&
  56070. (i.maxInstancedCount = f.meshPerAttribute * f.count))
  56071. : Ye.enableAttribute(h),
  56072. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56073. Ge.vertexAttribPointer(
  56074. h,
  56075. d,
  56076. Ge.FLOAT,
  56077. !1,
  56078. g * f.array.BYTES_PER_ELEMENT,
  56079. (r * g + m) * f.array.BYTES_PER_ELEMENT
  56080. );
  56081. } else
  56082. u instanceof n.InstancedBufferAttribute
  56083. ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  56084. void 0 === i.maxInstancedCount &&
  56085. (i.maxInstancedCount = u.meshPerAttribute * u.count))
  56086. : Ye.enableAttribute(h),
  56087. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56088. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4);
  56089. } else if (void 0 !== l) {
  56090. var v = l[c];
  56091. if (void 0 !== v)
  56092. switch (v.length) {
  56093. case 2:
  56094. Ge.vertexAttrib2fv(h, v);
  56095. break;
  56096. case 3:
  56097. Ge.vertexAttrib3fv(h, v);
  56098. break;
  56099. case 4:
  56100. Ge.vertexAttrib4fv(h, v);
  56101. break;
  56102. default:
  56103. Ge.vertexAttrib1fv(h, v);
  56104. }
  56105. }
  56106. }
  56107. }
  56108. Ye.disableUnusedAttributes();
  56109. }
  56110. function g(e, t) {
  56111. return Math.abs(t[0]) - Math.abs(e[0]);
  56112. }
  56113. function m(e, t) {
  56114. return e.object.renderOrder !== t.object.renderOrder
  56115. ? e.object.renderOrder - t.object.renderOrder
  56116. : e.material.id !== t.material.id
  56117. ? e.material.id - t.material.id
  56118. : e.z !== t.z
  56119. ? e.z - t.z
  56120. : e.id - t.id;
  56121. }
  56122. function v(e, t) {
  56123. return e.object.renderOrder !== t.object.renderOrder
  56124. ? e.object.renderOrder - t.object.renderOrder
  56125. : e.z !== t.z
  56126. ? t.z - e.z
  56127. : e.id - t.id;
  56128. }
  56129. function A(e, t, i, n, r) {
  56130. var o, a;
  56131. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue));
  56132. var s = o[a];
  56133. void 0 !== s
  56134. ? ((s.id = e.id),
  56135. (s.object = e),
  56136. (s.geometry = t),
  56137. (s.material = i),
  56138. (s.z = Ve.z),
  56139. (s.group = r))
  56140. : ((s = {
  56141. id: e.id,
  56142. object: e,
  56143. geometry: t,
  56144. material: i,
  56145. z: Ve.z,
  56146. group: r,
  56147. }),
  56148. o.push(s));
  56149. }
  56150. function y(e, t) {
  56151. if (e.visible !== !1) {
  56152. if (e.layers.test(t.layers))
  56153. if (e instanceof n.Light) ce.push(e);
  56154. else if (e instanceof n.Sprite)
  56155. (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) || ge.push(e);
  56156. else if (e instanceof n.LensFlare) me.push(e);
  56157. else if (e instanceof n.ImmediateRenderObject)
  56158. ve.sortObjects === !0 &&
  56159. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe)),
  56160. A(e, null, e.material, Ve.z, null);
  56161. else if (
  56162. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  56163. (e instanceof n.SkinnedMesh && e.skeleton.update(),
  56164. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  56165. ) {
  56166. var i = e.material;
  56167. if (i.visible === !0) {
  56168. ve.sortObjects === !0 &&
  56169. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe));
  56170. var r = Ze.update(e);
  56171. if (i instanceof n.MultiMaterial)
  56172. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  56173. var c = o[s],
  56174. h = a[c.materialIndex];
  56175. h.visible === !0 && A(e, r, h, Ve.z, c);
  56176. }
  56177. else A(e, r, i, Ve.z, null);
  56178. }
  56179. }
  56180. for (var u = e.children, s = 0, l = u.length; s < l; s++) y(u[s], t);
  56181. }
  56182. }
  56183. function C(e, t, i, r) {
  56184. for (var o = 0, a = e.length; o < a; o++) {
  56185. var s = e[o],
  56186. l = s.object,
  56187. c = s.geometry,
  56188. h = void 0 === r ? s.material : r,
  56189. u = s.group;
  56190. if (
  56191. (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  56192. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  56193. l instanceof n.ImmediateRenderObject)
  56194. ) {
  56195. E(h);
  56196. var d = w(t, i, h, l);
  56197. (Ee = ''),
  56198. l.render(function (e) {
  56199. ve.renderBufferImmediate(e, d, h);
  56200. });
  56201. } else ve.renderBufferDirect(t, i, c, h, l, u);
  56202. }
  56203. }
  56204. function I(e, t, i) {
  56205. var r = Xe.get(e),
  56206. o = qe.getParameters(e, Ue, t, i),
  56207. a = qe.getProgramCode(e, o),
  56208. s = r.program,
  56209. l = !0;
  56210. if (void 0 === s) e.addEventListener('dispose', c);
  56211. else if (s.code !== a) p(e);
  56212. else {
  56213. if (void 0 !== o.shaderID) return;
  56214. l = !1;
  56215. }
  56216. if (l) {
  56217. if (o.shaderID) {
  56218. var h = n.ShaderLib[o.shaderID];
  56219. r.__webglShader = {
  56220. name: e.type,
  56221. uniforms: n.UniformsUtils.clone(h.uniforms),
  56222. vertexShader: h.vertexShader,
  56223. fragmentShader: h.fragmentShader,
  56224. };
  56225. } else
  56226. r.__webglShader = {
  56227. name: e.type,
  56228. uniforms: e.uniforms,
  56229. vertexShader: e.vertexShader,
  56230. fragmentShader: e.fragmentShader,
  56231. };
  56232. (e.__webglShader = r.__webglShader),
  56233. (s = qe.acquireProgram(e, o, a)),
  56234. (r.program = s),
  56235. (e.program = s);
  56236. }
  56237. var u = s.getAttributes();
  56238. if (e.morphTargets) {
  56239. e.numSupportedMorphTargets = 0;
  56240. for (var d = 0; d < ve.maxMorphTargets; d++)
  56241. u['morphTarget' + d] >= 0 && e.numSupportedMorphTargets++;
  56242. }
  56243. if (e.morphNormals) {
  56244. e.numSupportedMorphNormals = 0;
  56245. for (var d = 0; d < ve.maxMorphNormals; d++)
  56246. u['morphNormal' + d] >= 0 && e.numSupportedMorphNormals++;
  56247. }
  56248. r.uniformsList = [];
  56249. var f = r.__webglShader.uniforms,
  56250. g = r.program.getUniforms();
  56251. for (var m in f) {
  56252. var v = g[m];
  56253. v && r.uniformsList.push([r.__webglShader.uniforms[m], v]);
  56254. }
  56255. (e instanceof n.MeshPhongMaterial ||
  56256. e instanceof n.MeshLambertMaterial ||
  56257. e instanceof n.MeshStandardMaterial ||
  56258. e.lights) &&
  56259. ((r.lightsHash = Ue.hash),
  56260. (f.ambientLightColor.value = Ue.ambient),
  56261. (f.directionalLights.value = Ue.directional),
  56262. (f.spotLights.value = Ue.spot),
  56263. (f.pointLights.value = Ue.point),
  56264. (f.hemisphereLights.value = Ue.hemi),
  56265. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  56266. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  56267. (f.spotShadowMap.value = Ue.spotShadowMap),
  56268. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  56269. (f.pointShadowMap.value = Ue.pointShadowMap),
  56270. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  56271. (r.hasDynamicUniforms = !1);
  56272. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  56273. var C = r.uniformsList[A][0];
  56274. if (C.dynamic === !0) {
  56275. r.hasDynamicUniforms = !0;
  56276. break;
  56277. }
  56278. }
  56279. }
  56280. function E(e) {
  56281. b(e),
  56282. e.transparent === !0
  56283. ? Ye.setBlending(
  56284. e.blending,
  56285. e.blendEquation,
  56286. e.blendSrc,
  56287. e.blendDst,
  56288. e.blendEquationAlpha,
  56289. e.blendSrcAlpha,
  56290. e.blendDstAlpha,
  56291. e.premultipliedAlpha
  56292. )
  56293. : Ye.setBlending(n.NoBlending),
  56294. Ye.setDepthFunc(e.depthFunc),
  56295. Ye.setDepthTest(e.depthTest),
  56296. Ye.setDepthWrite(e.depthWrite),
  56297. Ye.setColorWrite(e.colorWrite),
  56298. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits);
  56299. }
  56300. function b(e) {
  56301. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  56302. Ye.setFlipSided(e.side === n.BackSide);
  56303. }
  56304. function w(e, t, i, r) {
  56305. xe = 0;
  56306. var o = Xe.get(i);
  56307. void 0 === o.program && (i.needsUpdate = !0),
  56308. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  56309. i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1));
  56310. var a = !1,
  56311. s = !1,
  56312. l = !1,
  56313. c = o.program,
  56314. h = c.getUniforms(),
  56315. u = o.__webglShader.uniforms;
  56316. if (
  56317. (c.id !== Ae &&
  56318. (Ge.useProgram(c.program), (Ae = c.id), (a = !0), (s = !0), (l = !0)),
  56319. i.id !== Ie && ((Ie = i.id), (s = !0)),
  56320. (a || e !== be) &&
  56321. (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  56322. je.logarithmicDepthBuffer &&
  56323. Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  56324. e !== be && ((be = e), (s = !0), (l = !0)),
  56325. (i instanceof n.ShaderMaterial ||
  56326. i instanceof n.MeshPhongMaterial ||
  56327. i instanceof n.MeshStandardMaterial ||
  56328. i.envMap) &&
  56329. void 0 !== h.cameraPosition &&
  56330. (Ve.setFromMatrixPosition(e.matrixWorld),
  56331. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  56332. (i instanceof n.MeshPhongMaterial ||
  56333. i instanceof n.MeshLambertMaterial ||
  56334. i instanceof n.MeshBasicMaterial ||
  56335. i instanceof n.MeshStandardMaterial ||
  56336. i instanceof n.ShaderMaterial ||
  56337. i.skinning) &&
  56338. void 0 !== h.viewMatrix &&
  56339. Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  56340. void 0 !== h.toneMappingExposure &&
  56341. Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  56342. void 0 !== h.toneMappingWhitePoint &&
  56343. Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  56344. i.skinning)
  56345. )
  56346. if (
  56347. (r.bindMatrix &&
  56348. void 0 !== h.bindMatrix &&
  56349. Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  56350. r.bindMatrixInverse &&
  56351. void 0 !== h.bindMatrixInverse &&
  56352. Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  56353. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture)
  56354. ) {
  56355. if (void 0 !== h.boneTexture) {
  56356. var d = B();
  56357. Ge.uniform1i(h.boneTexture, d), ve.setTexture(r.skeleton.boneTexture, d);
  56358. }
  56359. void 0 !== h.boneTextureWidth &&
  56360. Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  56361. void 0 !== h.boneTextureHeight &&
  56362. Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight);
  56363. } else
  56364. r.skeleton &&
  56365. r.skeleton.boneMatrices &&
  56366. void 0 !== h.boneGlobalMatrices &&
  56367. Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  56368. return (
  56369. s &&
  56370. ((i instanceof n.MeshPhongMaterial ||
  56371. i instanceof n.MeshLambertMaterial ||
  56372. i instanceof n.MeshStandardMaterial ||
  56373. i.lights) &&
  56374. D(u, l),
  56375. t && i.fog && R(u, t),
  56376. (i instanceof n.MeshBasicMaterial ||
  56377. i instanceof n.MeshLambertMaterial ||
  56378. i instanceof n.MeshPhongMaterial ||
  56379. i instanceof n.MeshStandardMaterial) &&
  56380. T(u, i),
  56381. i instanceof n.LineBasicMaterial
  56382. ? x(u, i)
  56383. : i instanceof n.LineDashedMaterial
  56384. ? (x(u, i), S(u, i))
  56385. : i instanceof n.PointsMaterial
  56386. ? M(u, i)
  56387. : i instanceof n.MeshLambertMaterial
  56388. ? P(u, i)
  56389. : i instanceof n.MeshPhongMaterial
  56390. ? O(u, i)
  56391. : i instanceof n.MeshStandardMaterial
  56392. ? L(u, i)
  56393. : i instanceof n.MeshDepthMaterial
  56394. ? ((u.mNear.value = e.near),
  56395. (u.mFar.value = e.far),
  56396. (u.opacity.value = i.opacity))
  56397. : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  56398. V(o.uniformsList)),
  56399. N(h, r),
  56400. void 0 !== h.modelMatrix &&
  56401. Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  56402. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  56403. c
  56404. );
  56405. }
  56406. function _(e, t, i) {
  56407. for (var n = [], r = 0, o = e.length; r < o; r++) {
  56408. var a = e[r][0],
  56409. s = a.onUpdateCallback;
  56410. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]));
  56411. }
  56412. V(n);
  56413. }
  56414. function T(e, t) {
  56415. (e.opacity.value = t.opacity),
  56416. (e.diffuse.value = t.color),
  56417. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  56418. (e.map.value = t.map),
  56419. (e.specularMap.value = t.specularMap),
  56420. (e.alphaMap.value = t.alphaMap),
  56421. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity));
  56422. var i;
  56423. if (
  56424. (t.map
  56425. ? (i = t.map)
  56426. : t.specularMap
  56427. ? (i = t.specularMap)
  56428. : t.displacementMap
  56429. ? (i = t.displacementMap)
  56430. : t.normalMap
  56431. ? (i = t.normalMap)
  56432. : t.bumpMap
  56433. ? (i = t.bumpMap)
  56434. : t.roughnessMap
  56435. ? (i = t.roughnessMap)
  56436. : t.metalnessMap
  56437. ? (i = t.metalnessMap)
  56438. : t.alphaMap
  56439. ? (i = t.alphaMap)
  56440. : t.emissiveMap && (i = t.emissiveMap),
  56441. void 0 !== i)
  56442. ) {
  56443. i instanceof n.WebGLRenderTarget && (i = i.texture);
  56444. var r = i.offset,
  56445. o = i.repeat;
  56446. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y);
  56447. }
  56448. (e.envMap.value = t.envMap),
  56449. (e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  56450. (e.reflectivity.value = t.reflectivity),
  56451. (e.refractionRatio.value = t.refractionRatio);
  56452. }
  56453. function x(e, t) {
  56454. (e.diffuse.value = t.color), (e.opacity.value = t.opacity);
  56455. }
  56456. function S(e, t) {
  56457. (e.dashSize.value = t.dashSize),
  56458. (e.totalSize.value = t.dashSize + t.gapSize),
  56459. (e.scale.value = t.scale);
  56460. }
  56461. function M(e, t) {
  56462. if (
  56463. ((e.diffuse.value = t.color),
  56464. (e.opacity.value = t.opacity),
  56465. (e.size.value = t.size * Oe),
  56466. (e.scale.value = te.clientHeight / 2),
  56467. (e.map.value = t.map),
  56468. null !== t.map)
  56469. ) {
  56470. var i = t.map.offset,
  56471. n = t.map.repeat;
  56472. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y);
  56473. }
  56474. }
  56475. function R(e, t) {
  56476. (e.fogColor.value = t.color),
  56477. t instanceof n.Fog
  56478. ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far))
  56479. : t instanceof n.FogExp2 && (e.fogDensity.value = t.density);
  56480. }
  56481. function P(e, t) {
  56482. t.lightMap &&
  56483. ((e.lightMap.value = t.lightMap),
  56484. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56485. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap);
  56486. }
  56487. function O(e, t) {
  56488. (e.specular.value = t.specular),
  56489. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  56490. t.lightMap &&
  56491. ((e.lightMap.value = t.lightMap),
  56492. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56493. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56494. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56495. t.normalMap &&
  56496. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56497. t.displacementMap &&
  56498. ((e.displacementMap.value = t.displacementMap),
  56499. (e.displacementScale.value = t.displacementScale),
  56500. (e.displacementBias.value = t.displacementBias));
  56501. }
  56502. function L(e, t) {
  56503. (e.roughness.value = t.roughness),
  56504. (e.metalness.value = t.metalness),
  56505. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  56506. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  56507. t.lightMap &&
  56508. ((e.lightMap.value = t.lightMap),
  56509. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56510. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56511. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56512. t.normalMap &&
  56513. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56514. t.displacementMap &&
  56515. ((e.displacementMap.value = t.displacementMap),
  56516. (e.displacementScale.value = t.displacementScale),
  56517. (e.displacementBias.value = t.displacementBias)),
  56518. t.envMap && (e.envMapIntensity.value = t.envMapIntensity);
  56519. }
  56520. function D(e, t) {
  56521. (e.ambientLightColor.needsUpdate = t),
  56522. (e.directionalLights.needsUpdate = t),
  56523. (e.pointLights.needsUpdate = t),
  56524. (e.spotLights.needsUpdate = t),
  56525. (e.hemisphereLights.needsUpdate = t);
  56526. }
  56527. function N(e, t) {
  56528. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  56529. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements);
  56530. }
  56531. function B() {
  56532. var e = xe;
  56533. return (
  56534. e >= je.maxTextures &&
  56535. console.warn(
  56536. 'WebGLRenderer: trying to use ' +
  56537. e +
  56538. ' texture units while this GPU supports only ' +
  56539. je.maxTextures
  56540. ),
  56541. (xe += 1),
  56542. e
  56543. );
  56544. }
  56545. function F(e, t, i, r) {
  56546. var o, a;
  56547. if ('1i' === t) Ge.uniform1i(i, r);
  56548. else if ('1f' === t) Ge.uniform1f(i, r);
  56549. else if ('2f' === t) Ge.uniform2f(i, r[0], r[1]);
  56550. else if ('3f' === t) Ge.uniform3f(i, r[0], r[1], r[2]);
  56551. else if ('4f' === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  56552. else if ('1iv' === t) Ge.uniform1iv(i, r);
  56553. else if ('3iv' === t) Ge.uniform3iv(i, r);
  56554. else if ('1fv' === t) Ge.uniform1fv(i, r);
  56555. else if ('2fv' === t) Ge.uniform2fv(i, r);
  56556. else if ('3fv' === t) Ge.uniform3fv(i, r);
  56557. else if ('4fv' === t) Ge.uniform4fv(i, r);
  56558. else if ('Matrix2fv' === t) Ge.uniformMatrix2fv(i, !1, r);
  56559. else if ('Matrix3fv' === t) Ge.uniformMatrix3fv(i, !1, r);
  56560. else if ('Matrix4fv' === t) Ge.uniformMatrix4fv(i, !1, r);
  56561. else if ('i' === t) Ge.uniform1i(i, r);
  56562. else if ('f' === t) Ge.uniform1f(i, r);
  56563. else if ('v2' === t) Ge.uniform2f(i, r.x, r.y);
  56564. else if ('v3' === t) Ge.uniform3f(i, r.x, r.y, r.z);
  56565. else if ('v4' === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  56566. else if ('c' === t) Ge.uniform3f(i, r.r, r.g, r.b);
  56567. else if ('s' === t) {
  56568. var s = e.properties;
  56569. for (var l in s) {
  56570. var c = s[l],
  56571. h = i[l],
  56572. u = r[l];
  56573. F(c, c.type, h, u);
  56574. }
  56575. } else if ('sa' === t)
  56576. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  56577. for (var l in s) {
  56578. var c = s[l],
  56579. h = i[d][l],
  56580. u = r[d][l];
  56581. F(c, c.type, h, u);
  56582. }
  56583. else if ('iv1' === t) Ge.uniform1iv(i, r);
  56584. else if ('iv' === t) Ge.uniform3iv(i, r);
  56585. else if ('fv1' === t) Ge.uniform1fv(i, r);
  56586. else if ('fv' === t) Ge.uniform3fv(i, r);
  56587. else if ('v2v' === t) {
  56588. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  56589. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2)
  56590. (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y);
  56591. Ge.uniform2fv(i, e._array);
  56592. } else if ('v3v' === t) {
  56593. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  56594. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3)
  56595. (e._array[m + 0] = r[d].x),
  56596. (e._array[m + 1] = r[d].y),
  56597. (e._array[m + 2] = r[d].z);
  56598. Ge.uniform3fv(i, e._array);
  56599. } else if ('v4v' === t) {
  56600. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  56601. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4)
  56602. (e._array[v + 0] = r[d].x),
  56603. (e._array[v + 1] = r[d].y),
  56604. (e._array[v + 2] = r[d].z),
  56605. (e._array[v + 3] = r[d].w);
  56606. Ge.uniform4fv(i, e._array);
  56607. } else if ('m2' === t) Ge.uniformMatrix2fv(i, !1, r.elements);
  56608. else if ('m3' === t) Ge.uniformMatrix3fv(i, !1, r.elements);
  56609. else if ('m3v' === t) {
  56610. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  56611. for (var d = 0, g = r.length; d < g; d++)
  56612. r[d].flattenToArrayOffset(e._array, 9 * d);
  56613. Ge.uniformMatrix3fv(i, !1, e._array);
  56614. } else if ('m4' === t) Ge.uniformMatrix4fv(i, !1, r.elements);
  56615. else if ('m4v' === t) {
  56616. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  56617. for (var d = 0, g = r.length; d < g; d++)
  56618. r[d].flattenToArrayOffset(e._array, 16 * d);
  56619. Ge.uniformMatrix4fv(i, !1, e._array);
  56620. } else if ('t' === t) {
  56621. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return;
  56622. o instanceof n.CubeTexture || (Array.isArray(o.image) && 6 === o.image.length)
  56623. ? Y(o, a)
  56624. : o instanceof n.WebGLRenderTargetCube
  56625. ? X(o.texture, a)
  56626. : o instanceof n.WebGLRenderTarget
  56627. ? ve.setTexture(o.texture, a)
  56628. : ve.setTexture(o, a);
  56629. } else if ('tv' === t) {
  56630. void 0 === e._array && (e._array = []);
  56631. for (var d = 0, g = e.value.length; d < g; d++) e._array[d] = B();
  56632. Ge.uniform1iv(i, e._array);
  56633. for (var d = 0, g = e.value.length; d < g; d++)
  56634. (o = e.value[d]),
  56635. (a = e._array[d]),
  56636. o &&
  56637. (o instanceof n.CubeTexture ||
  56638. (o.image instanceof Array && 6 === o.image.length)
  56639. ? Y(o, a)
  56640. : o instanceof n.WebGLRenderTarget
  56641. ? ve.setTexture(o.texture, a)
  56642. : o instanceof n.WebGLRenderTargetCube
  56643. ? X(o.texture, a)
  56644. : ve.setTexture(o, a));
  56645. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t);
  56646. }
  56647. function V(e) {
  56648. for (var t = 0, i = e.length; t < i; t++) {
  56649. var n = e[t][0];
  56650. if (n.needsUpdate !== !1) {
  56651. var r = n.type,
  56652. o = e[t][1],
  56653. a = n.value;
  56654. F(n, r, o, a);
  56655. }
  56656. }
  56657. }
  56658. function U(e, t) {
  56659. var i,
  56660. r,
  56661. o,
  56662. a,
  56663. s,
  56664. l,
  56665. c = 0,
  56666. h = 0,
  56667. u = 0,
  56668. d = t.matrixWorldInverse,
  56669. p = 0,
  56670. f = 0,
  56671. g = 0,
  56672. m = 0,
  56673. v = 0;
  56674. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  56675. if (
  56676. ((o = e[i]),
  56677. (a = o.color),
  56678. (s = o.intensity),
  56679. (l = o.distance),
  56680. o instanceof n.AmbientLight)
  56681. )
  56682. (c += a.r * s), (h += a.g * s), (u += a.b * s);
  56683. else if (o instanceof n.DirectionalLight) {
  56684. var A = Ke.get(o);
  56685. A.color.copy(o.color).multiplyScalar(o.intensity),
  56686. A.direction.setFromMatrixPosition(o.matrixWorld),
  56687. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56688. A.direction.sub(Ve),
  56689. A.direction.transformDirection(d),
  56690. (A.shadow = o.castShadow),
  56691. o.castShadow &&
  56692. ((A.shadowBias = o.shadow.bias),
  56693. (A.shadowRadius = o.shadow.radius),
  56694. (A.shadowMapSize = o.shadow.mapSize),
  56695. (Ue.shadows[v++] = o)),
  56696. (Ue.directionalShadowMap[p] = o.shadow.map),
  56697. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  56698. (Ue.directional[p++] = A);
  56699. } else if (o instanceof n.SpotLight) {
  56700. var A = Ke.get(o);
  56701. A.position.setFromMatrixPosition(o.matrixWorld),
  56702. A.position.applyMatrix4(d),
  56703. A.color.copy(a).multiplyScalar(s),
  56704. (A.distance = l),
  56705. A.direction.setFromMatrixPosition(o.matrixWorld),
  56706. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56707. A.direction.sub(Ve),
  56708. A.direction.transformDirection(d),
  56709. (A.coneCos = Math.cos(o.angle)),
  56710. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  56711. (A.decay = 0 === o.distance ? 0 : o.decay),
  56712. (A.shadow = o.castShadow),
  56713. o.castShadow &&
  56714. ((A.shadowBias = o.shadow.bias),
  56715. (A.shadowRadius = o.shadow.radius),
  56716. (A.shadowMapSize = o.shadow.mapSize),
  56717. (Ue.shadows[v++] = o)),
  56718. (Ue.spotShadowMap[g] = o.shadow.map),
  56719. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  56720. (Ue.spot[g++] = A);
  56721. } else if (o instanceof n.PointLight) {
  56722. var A = Ke.get(o);
  56723. A.position.setFromMatrixPosition(o.matrixWorld),
  56724. A.position.applyMatrix4(d),
  56725. A.color.copy(o.color).multiplyScalar(o.intensity),
  56726. (A.distance = o.distance),
  56727. (A.decay = 0 === o.distance ? 0 : o.decay),
  56728. (A.shadow = o.castShadow),
  56729. o.castShadow &&
  56730. ((A.shadowBias = o.shadow.bias),
  56731. (A.shadowRadius = o.shadow.radius),
  56732. (A.shadowMapSize = o.shadow.mapSize),
  56733. (Ue.shadows[v++] = o)),
  56734. (Ue.pointShadowMap[f] = o.shadow.map),
  56735. void 0 === Ue.pointShadowMatrix[f] &&
  56736. (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  56737. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  56738. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  56739. (Ue.point[f++] = A);
  56740. } else if (o instanceof n.HemisphereLight) {
  56741. var A = Ke.get(o);
  56742. A.direction.setFromMatrixPosition(o.matrixWorld),
  56743. A.direction.transformDirection(d),
  56744. A.direction.normalize(),
  56745. A.skyColor.copy(o.color).multiplyScalar(s),
  56746. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  56747. (Ue.hemi[m++] = A);
  56748. }
  56749. (Ue.ambient[0] = c),
  56750. (Ue.ambient[1] = h),
  56751. (Ue.ambient[2] = u),
  56752. (Ue.directional.length = p),
  56753. (Ue.spot.length = g),
  56754. (Ue.point.length = f),
  56755. (Ue.hemi.length = m),
  56756. (Ue.shadows.length = v),
  56757. (Ue.hash = p + ',' + f + ',' + g + ',' + m + ',' + v);
  56758. }
  56759. function k(e, t, i) {
  56760. var r;
  56761. if (
  56762. (i
  56763. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  56764. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  56765. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  56766. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  56767. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  56768. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  56769. (t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping) ||
  56770. console.warn(
  56771. 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.',
  56772. t
  56773. ),
  56774. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  56775. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  56776. t.minFilter !== n.NearestFilter &&
  56777. t.minFilter !== n.LinearFilter &&
  56778. console.warn(
  56779. 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.',
  56780. t
  56781. )),
  56782. (r = We.get('EXT_texture_filter_anisotropic')))
  56783. ) {
  56784. if (t.type === n.FloatType && null === We.get('OES_texture_float_linear')) return;
  56785. if (t.type === n.HalfFloatType && null === We.get('OES_texture_half_float_linear'))
  56786. return;
  56787. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  56788. (Ge.texParameterf(
  56789. e,
  56790. r.TEXTURE_MAX_ANISOTROPY_EXT,
  56791. Math.min(t.anisotropy, ve.getMaxAnisotropy())
  56792. ),
  56793. (Xe.get(t).__currentAnisotropy = t.anisotropy));
  56794. }
  56795. }
  56796. function H(e, t, i) {
  56797. void 0 === e.__webglInit &&
  56798. ((e.__webglInit = !0),
  56799. t.addEventListener('dispose', s),
  56800. (e.__webglTexture = Ge.createTexture()),
  56801. ke.textures++),
  56802. Ye.activeTexture(Ge.TEXTURE0 + i),
  56803. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  56804. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  56805. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  56806. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  56807. var r = G(t.image, je.maxTextureSize);
  56808. W(t) && z(r) === !1 && (r = j(r));
  56809. var o = z(r),
  56810. a = ee(t.format),
  56811. l = ee(t.type);
  56812. k(Ge.TEXTURE_2D, t, o);
  56813. var c,
  56814. h = t.mipmaps;
  56815. if (t instanceof n.DataTexture)
  56816. if (h.length > 0 && o) {
  56817. for (var u = 0, d = h.length; u < d; u++)
  56818. (c = h[u]),
  56819. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  56820. t.generateMipmaps = !1;
  56821. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  56822. else if (t instanceof n.CompressedTexture)
  56823. for (var u = 0, d = h.length; u < d; u++)
  56824. (c = h[u]),
  56825. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  56826. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  56827. ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data)
  56828. : console.warn(
  56829. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()'
  56830. )
  56831. : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  56832. else if (h.length > 0 && o) {
  56833. for (var u = 0, d = h.length; u < d; u++)
  56834. (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  56835. t.generateMipmaps = !1;
  56836. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  56837. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  56838. (e.__version = t.version),
  56839. t.onUpdate && t.onUpdate(t);
  56840. }
  56841. function G(e, t) {
  56842. if (e.width > t || e.height > t) {
  56843. var i = t / Math.max(e.width, e.height),
  56844. n = document.createElement('canvas');
  56845. (n.width = Math.floor(e.width * i)), (n.height = Math.floor(e.height * i));
  56846. var r = n.getContext('2d');
  56847. return (
  56848. r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  56849. console.warn(
  56850. 'THREE.WebGLRenderer: image is too big (' +
  56851. e.width +
  56852. 'x' +
  56853. e.height +
  56854. '). Resized to ' +
  56855. n.width +
  56856. 'x' +
  56857. n.height,
  56858. e
  56859. ),
  56860. n
  56861. );
  56862. }
  56863. return e;
  56864. }
  56865. function z(e) {
  56866. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  56867. }
  56868. function W(e) {
  56869. return (
  56870. e.wrapS !== n.ClampToEdgeWrapping ||
  56871. e.wrapT !== n.ClampToEdgeWrapping ||
  56872. (e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter)
  56873. );
  56874. }
  56875. function j(e) {
  56876. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  56877. var t = document.createElement('canvas');
  56878. (t.width = n.Math.nearestPowerOfTwo(e.width)),
  56879. (t.height = n.Math.nearestPowerOfTwo(e.height));
  56880. var i = t.getContext('2d');
  56881. return (
  56882. i.drawImage(e, 0, 0, t.width, t.height),
  56883. console.warn(
  56884. 'THREE.WebGLRenderer: image is not power of two (' +
  56885. e.width +
  56886. 'x' +
  56887. e.height +
  56888. '). Resized to ' +
  56889. t.width +
  56890. 'x' +
  56891. t.height,
  56892. e
  56893. ),
  56894. t
  56895. );
  56896. }
  56897. return e;
  56898. }
  56899. function Y(e, t) {
  56900. var i = Xe.get(e);
  56901. if (6 === e.image.length)
  56902. if (e.version > 0 && i.__version !== e.version) {
  56903. i.__image__webglTextureCube ||
  56904. (e.addEventListener('dispose', s),
  56905. (i.__image__webglTextureCube = Ge.createTexture()),
  56906. ke.textures++),
  56907. Ye.activeTexture(Ge.TEXTURE0 + t),
  56908. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  56909. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  56910. for (
  56911. var r = e instanceof n.CompressedTexture,
  56912. o = e.image[0] instanceof n.DataTexture,
  56913. a = [],
  56914. l = 0;
  56915. l < 6;
  56916. l++
  56917. )
  56918. !ve.autoScaleCubemaps || r || o
  56919. ? (a[l] = o ? e.image[l].image : e.image[l])
  56920. : (a[l] = G(e.image[l], je.maxCubemapSize));
  56921. var c = a[0],
  56922. h = z(c),
  56923. u = ee(e.format),
  56924. d = ee(e.type);
  56925. k(Ge.TEXTURE_CUBE_MAP, e, h);
  56926. for (var l = 0; l < 6; l++)
  56927. if (r)
  56928. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  56929. (p = f[g]),
  56930. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  56931. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  56932. ? Ye.compressedTexImage2D(
  56933. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  56934. g,
  56935. u,
  56936. p.width,
  56937. p.height,
  56938. 0,
  56939. p.data
  56940. )
  56941. : console.warn(
  56942. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()'
  56943. )
  56944. : Ye.texImage2D(
  56945. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  56946. g,
  56947. u,
  56948. p.width,
  56949. p.height,
  56950. 0,
  56951. u,
  56952. d,
  56953. p.data
  56954. );
  56955. else
  56956. o
  56957. ? Ye.texImage2D(
  56958. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  56959. 0,
  56960. u,
  56961. a[l].width,
  56962. a[l].height,
  56963. 0,
  56964. u,
  56965. d,
  56966. a[l].data
  56967. )
  56968. : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  56969. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  56970. (i.__version = e.version),
  56971. e.onUpdate && e.onUpdate(e);
  56972. } else
  56973. Ye.activeTexture(Ge.TEXTURE0 + t),
  56974. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube);
  56975. }
  56976. function X(e, t) {
  56977. Ye.activeTexture(Ge.TEXTURE0 + t),
  56978. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture);
  56979. }
  56980. function Z(e, t, i, n) {
  56981. var r = ee(t.texture.format),
  56982. o = ee(t.texture.type);
  56983. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  56984. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  56985. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  56986. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  56987. }
  56988. function q(e, t) {
  56989. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  56990. t.depthBuffer && !t.stencilBuffer
  56991. ? (Ge.renderbufferStorage(
  56992. Ge.RENDERBUFFER,
  56993. Ge.DEPTH_COMPONENT16,
  56994. t.width,
  56995. t.height
  56996. ),
  56997. Ge.framebufferRenderbuffer(
  56998. Ge.FRAMEBUFFER,
  56999. Ge.DEPTH_ATTACHMENT,
  57000. Ge.RENDERBUFFER,
  57001. e
  57002. ))
  57003. : t.depthBuffer && t.stencilBuffer
  57004. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  57005. Ge.framebufferRenderbuffer(
  57006. Ge.FRAMEBUFFER,
  57007. Ge.DEPTH_STENCIL_ATTACHMENT,
  57008. Ge.RENDERBUFFER,
  57009. e
  57010. ))
  57011. : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  57012. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null);
  57013. }
  57014. function K(e) {
  57015. var t = Xe.get(e),
  57016. i = e instanceof n.WebGLRenderTargetCube;
  57017. if (i) {
  57018. t.__webglDepthbuffer = [];
  57019. for (var r = 0; r < 6; r++)
  57020. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  57021. (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()),
  57022. q(t.__webglDepthbuffer[r], e);
  57023. } else
  57024. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  57025. (t.__webglDepthbuffer = Ge.createRenderbuffer()),
  57026. q(t.__webglDepthbuffer, e);
  57027. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  57028. }
  57029. function Q(e) {
  57030. var t = Xe.get(e),
  57031. i = Xe.get(e.texture);
  57032. e.addEventListener('dispose', l),
  57033. (i.__webglTexture = Ge.createTexture()),
  57034. ke.textures++;
  57035. var r = e instanceof n.WebGLRenderTargetCube,
  57036. o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  57037. if (r) {
  57038. t.__webglFramebuffer = [];
  57039. for (var a = 0; a < 6; a++) t.__webglFramebuffer[a] = Ge.createFramebuffer();
  57040. } else t.__webglFramebuffer = Ge.createFramebuffer();
  57041. if (r) {
  57042. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  57043. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  57044. for (var a = 0; a < 6; a++)
  57045. Z(
  57046. t.__webglFramebuffer[a],
  57047. e,
  57048. Ge.COLOR_ATTACHMENT0,
  57049. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a
  57050. );
  57051. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  57052. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null);
  57053. } else
  57054. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  57055. k(Ge.TEXTURE_2D, e.texture, o),
  57056. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  57057. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  57058. Ye.bindTexture(Ge.TEXTURE_2D, null);
  57059. e.depthBuffer && K(e);
  57060. }
  57061. function J(e) {
  57062. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D,
  57063. i = Xe.get(e.texture).__webglTexture;
  57064. Ye.bindTexture(t, i), Ge.generateMipmap(t), Ye.bindTexture(t, null);
  57065. }
  57066. function $(e) {
  57067. return e === n.NearestFilter ||
  57068. e === n.NearestMipMapNearestFilter ||
  57069. e === n.NearestMipMapLinearFilter
  57070. ? Ge.NEAREST
  57071. : Ge.LINEAR;
  57072. }
  57073. function ee(e) {
  57074. var t;
  57075. if (e === n.RepeatWrapping) return Ge.REPEAT;
  57076. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE;
  57077. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT;
  57078. if (e === n.NearestFilter) return Ge.NEAREST;
  57079. if (e === n.NearestMipMapNearestFilter) return Ge.NEAREST_MIPMAP_NEAREST;
  57080. if (e === n.NearestMipMapLinearFilter) return Ge.NEAREST_MIPMAP_LINEAR;
  57081. if (e === n.LinearFilter) return Ge.LINEAR;
  57082. if (e === n.LinearMipMapNearestFilter) return Ge.LINEAR_MIPMAP_NEAREST;
  57083. if (e === n.LinearMipMapLinearFilter) return Ge.LINEAR_MIPMAP_LINEAR;
  57084. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE;
  57085. if (e === n.UnsignedShort4444Type) return Ge.UNSIGNED_SHORT_4_4_4_4;
  57086. if (e === n.UnsignedShort5551Type) return Ge.UNSIGNED_SHORT_5_5_5_1;
  57087. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5;
  57088. if (e === n.ByteType) return Ge.BYTE;
  57089. if (e === n.ShortType) return Ge.SHORT;
  57090. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT;
  57091. if (e === n.IntType) return Ge.INT;
  57092. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT;
  57093. if (e === n.FloatType) return Ge.FLOAT;
  57094. if (((t = We.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  57095. return t.HALF_FLOAT_OES;
  57096. if (e === n.AlphaFormat) return Ge.ALPHA;
  57097. if (e === n.RGBFormat) return Ge.RGB;
  57098. if (e === n.RGBAFormat) return Ge.RGBA;
  57099. if (e === n.LuminanceFormat) return Ge.LUMINANCE;
  57100. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA;
  57101. if (e === n.AddEquation) return Ge.FUNC_ADD;
  57102. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT;
  57103. if (e === n.ReverseSubtractEquation) return Ge.FUNC_REVERSE_SUBTRACT;
  57104. if (e === n.ZeroFactor) return Ge.ZERO;
  57105. if (e === n.OneFactor) return Ge.ONE;
  57106. if (e === n.SrcColorFactor) return Ge.SRC_COLOR;
  57107. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR;
  57108. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA;
  57109. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA;
  57110. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA;
  57111. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA;
  57112. if (e === n.DstColorFactor) return Ge.DST_COLOR;
  57113. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR;
  57114. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE;
  57115. if (((t = We.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  57116. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  57117. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  57118. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  57119. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  57120. }
  57121. if (((t = We.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  57122. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  57123. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  57124. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  57125. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  57126. }
  57127. if (
  57128. ((t = We.get('WEBGL_compressed_texture_etc1')),
  57129. null !== t && e === n.RGB_ETC1_Format)
  57130. )
  57131. return t.COMPRESSED_RGB_ETC1_WEBGL;
  57132. if (((t = We.get('EXT_blend_minmax')), null !== t)) {
  57133. if (e === n.MinEquation) return t.MIN_EXT;
  57134. if (e === n.MaxEquation) return t.MAX_EXT;
  57135. }
  57136. return 0;
  57137. }
  57138. console.log('THREE.WebGLRenderer', n.REVISION), (e = e || {});
  57139. var te = void 0 !== e.canvas ? e.canvas : document.createElement('canvas'),
  57140. ie = void 0 !== e.context ? e.context : null,
  57141. ne = void 0 !== e.alpha && e.alpha,
  57142. re = void 0 === e.depth || e.depth,
  57143. oe = void 0 === e.stencil || e.stencil,
  57144. ae = void 0 !== e.antialias && e.antialias,
  57145. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  57146. le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  57147. ce = [],
  57148. he = [],
  57149. ue = -1,
  57150. de = [],
  57151. pe = -1,
  57152. fe = new Float32Array(8),
  57153. ge = [],
  57154. me = [];
  57155. (this.domElement = te),
  57156. (this.context = null),
  57157. (this.autoClear = !0),
  57158. (this.autoClearColor = !0),
  57159. (this.autoClearDepth = !0),
  57160. (this.autoClearStencil = !0),
  57161. (this.sortObjects = !0),
  57162. (this.gammaFactor = 2),
  57163. (this.gammaInput = !1),
  57164. (this.gammaOutput = !1),
  57165. (this.physicallyCorrectLights = !1),
  57166. (this.toneMapping = n.LinearToneMapping),
  57167. (this.toneMappingExposure = 1),
  57168. (this.toneMappingWhitePoint = 1),
  57169. (this.maxMorphTargets = 8),
  57170. (this.maxMorphNormals = 4),
  57171. (this.autoScaleCubemaps = !0);
  57172. var ve = this,
  57173. Ae = null,
  57174. ye = null,
  57175. Ce = null,
  57176. Ie = -1,
  57177. Ee = '',
  57178. be = null,
  57179. we = new n.Vector4(),
  57180. _e = null,
  57181. Te = new n.Vector4(),
  57182. xe = 0,
  57183. Se = new n.Color(0),
  57184. Me = 0,
  57185. Re = te.width,
  57186. Pe = te.height,
  57187. Oe = 1,
  57188. Le = new n.Vector4(0, 0, Re, Pe),
  57189. De = !1,
  57190. Ne = new n.Vector4(0, 0, Re, Pe),
  57191. Be = new n.Frustum(),
  57192. Fe = new n.Matrix4(),
  57193. Ve = new n.Vector3(),
  57194. Ue = {
  57195. hash: '',
  57196. ambient: [0, 0, 0],
  57197. directional: [],
  57198. directionalShadowMap: [],
  57199. directionalShadowMatrix: [],
  57200. spot: [],
  57201. spotShadowMap: [],
  57202. spotShadowMatrix: [],
  57203. point: [],
  57204. pointShadowMap: [],
  57205. pointShadowMatrix: [],
  57206. hemi: [],
  57207. shadows: [],
  57208. shadowsPointLight: 0,
  57209. },
  57210. ke = {
  57211. geometries: 0,
  57212. textures: 0,
  57213. },
  57214. He = {
  57215. calls: 0,
  57216. vertices: 0,
  57217. faces: 0,
  57218. points: 0,
  57219. };
  57220. this.info = {
  57221. render: He,
  57222. memory: ke,
  57223. programs: null,
  57224. };
  57225. var Ge;
  57226. try {
  57227. var ze = {
  57228. alpha: ne,
  57229. depth: re,
  57230. stencil: oe,
  57231. antialias: ae,
  57232. premultipliedAlpha: se,
  57233. preserveDrawingBuffer: le,
  57234. };
  57235. if (
  57236. ((Ge = ie || te.getContext('webgl', ze) || te.getContext('experimental-webgl', ze)),
  57237. null === Ge)
  57238. )
  57239. throw null !== te.getContext('webgl')
  57240. ? 'Error creating WebGL context with your selected attributes.'
  57241. : 'Error creating WebGL context.';
  57242. void 0 === Ge.getShaderPrecisionFormat &&
  57243. (Ge.getShaderPrecisionFormat = function () {
  57244. return {
  57245. rangeMin: 1,
  57246. rangeMax: 1,
  57247. precision: 1,
  57248. };
  57249. }),
  57250. te.addEventListener('webglcontextlost', a, !1);
  57251. } catch (e) {
  57252. console.error('THREE.WebGLRenderer: ' + e);
  57253. }
  57254. var We = new n.WebGLExtensions(Ge);
  57255. We.get('OES_texture_float'),
  57256. We.get('OES_texture_float_linear'),
  57257. We.get('OES_texture_half_float'),
  57258. We.get('OES_texture_half_float_linear'),
  57259. We.get('OES_standard_derivatives'),
  57260. We.get('ANGLE_instanced_arrays'),
  57261. We.get('OES_element_index_uint') && (n.BufferGeometry.MaxIndex = 4294967296);
  57262. var je = new n.WebGLCapabilities(Ge, We, e),
  57263. Ye = new n.WebGLState(Ge, We, ee),
  57264. Xe = new n.WebGLProperties(),
  57265. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  57266. qe = new n.WebGLPrograms(this, je),
  57267. Ke = new n.WebGLLights();
  57268. this.info.programs = qe.programs;
  57269. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  57270. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He);
  57271. r(),
  57272. (this.context = Ge),
  57273. (this.capabilities = je),
  57274. (this.extensions = We),
  57275. (this.properties = Xe),
  57276. (this.state = Ye);
  57277. var $e = new n.WebGLShadowMap(this, Ue, Ze);
  57278. this.shadowMap = $e;
  57279. var et = new n.SpritePlugin(this, ge),
  57280. tt = new n.LensFlarePlugin(this, me);
  57281. (this.getContext = function () {
  57282. return Ge;
  57283. }),
  57284. (this.getContextAttributes = function () {
  57285. return Ge.getContextAttributes();
  57286. }),
  57287. (this.forceContextLoss = function () {
  57288. We.get('WEBGL_lose_context').loseContext();
  57289. }),
  57290. (this.getMaxAnisotropy = (function () {
  57291. var e;
  57292. return function () {
  57293. if (void 0 !== e) return e;
  57294. var t = We.get('EXT_texture_filter_anisotropic');
  57295. return (e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0);
  57296. };
  57297. })()),
  57298. (this.getPrecision = function () {
  57299. return je.precision;
  57300. }),
  57301. (this.getPixelRatio = function () {
  57302. return Oe;
  57303. }),
  57304. (this.setPixelRatio = function (e) {
  57305. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1));
  57306. }),
  57307. (this.getSize = function () {
  57308. return {
  57309. width: Re,
  57310. height: Pe,
  57311. };
  57312. }),
  57313. (this.setSize = function (e, t, i, devicePixelRatio) {
  57314. if (devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  57315. (Re = e),
  57316. (Pe = t),
  57317. (te.width = e * Oe),
  57318. (te.height = t * Oe),
  57319. i !== !1 && ((te.style.width = e + 'px'), (te.style.height = t + 'px')),
  57320. this.setViewport(0, 0, e, t);
  57321. }),
  57322. (this.setViewport = function (e, t, i, n) {
  57323. Ye.viewport(Ne.set(e, t, i, n));
  57324. }),
  57325. (this.setScissor = function (e, t, i, n) {
  57326. Ye.scissor(Le.set(e, t, i, n));
  57327. }),
  57328. (this.setScissorTest = function (e) {
  57329. Ye.setScissorTest((De = e));
  57330. }),
  57331. (this.getClearColor = function () {
  57332. return Se;
  57333. }),
  57334. (this.setClearColor = function (e, t) {
  57335. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me);
  57336. }),
  57337. (this.getClearAlpha = function () {
  57338. return Me;
  57339. }),
  57340. (this.setClearAlpha = function (e) {
  57341. (Me = e), i(Se.r, Se.g, Se.b, Me);
  57342. }),
  57343. (this.clear = function (e, t, i) {
  57344. var n = 0;
  57345. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  57346. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  57347. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  57348. Ge.clear(n);
  57349. }),
  57350. (this.clearColor = function () {
  57351. this.clear(!0, !1, !1);
  57352. }),
  57353. (this.clearDepth = function () {
  57354. this.clear(!1, !0, !1);
  57355. }),
  57356. (this.clearStencil = function () {
  57357. this.clear(!1, !1, !0);
  57358. }),
  57359. (this.clearTarget = function (e, t, i, n) {
  57360. this.setRenderTarget(e), this.clear(t, i, n);
  57361. }),
  57362. (this.resetGLState = o),
  57363. (this.dispose = function () {
  57364. te.removeEventListener('webglcontextlost', a, !1);
  57365. }),
  57366. (this.renderBufferImmediate = function (e, t, i) {
  57367. Ye.initAttributes();
  57368. var r = Xe.get(e);
  57369. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  57370. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  57371. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  57372. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  57373. var o = t.getAttributes();
  57374. if (
  57375. (e.hasPositions &&
  57376. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  57377. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  57378. Ye.enableAttribute(o.position),
  57379. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  57380. e.hasNormals)
  57381. ) {
  57382. if (
  57383. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  57384. 'MeshPhongMaterial' !== i.type &&
  57385. 'MeshStandardMaterial' !== i.type &&
  57386. i.shading === n.FlatShading)
  57387. )
  57388. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  57389. var l = e.normalArray,
  57390. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  57391. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  57392. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  57393. (l[a + 0] = c),
  57394. (l[a + 1] = h),
  57395. (l[a + 2] = u),
  57396. (l[a + 3] = c),
  57397. (l[a + 4] = h),
  57398. (l[a + 5] = u),
  57399. (l[a + 6] = c),
  57400. (l[a + 7] = h),
  57401. (l[a + 8] = u);
  57402. }
  57403. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  57404. Ye.enableAttribute(o.normal),
  57405. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0);
  57406. }
  57407. e.hasUvs &&
  57408. i.map &&
  57409. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  57410. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  57411. Ye.enableAttribute(o.uv),
  57412. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  57413. e.hasColors &&
  57414. i.vertexColors !== n.NoColors &&
  57415. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  57416. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  57417. Ye.enableAttribute(o.color),
  57418. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  57419. Ye.disableUnusedAttributes(),
  57420. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  57421. (e.count = 0);
  57422. }),
  57423. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  57424. E(o);
  57425. var l = w(e, i, o, a),
  57426. c = !1,
  57427. h = r.id + '_' + l.id + '_' + o.wireframe;
  57428. h !== Ee && ((Ee = h), (c = !0));
  57429. var u = a.morphTargetInfluences;
  57430. if (void 0 !== u) {
  57431. for (var d = [], p = 0, m = u.length; p < m; p++) {
  57432. var v = u[p];
  57433. d.push([v, p]);
  57434. }
  57435. d.sort(g), d.length > 8 && (d.length = 8);
  57436. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  57437. var v = d[p];
  57438. if (((fe[p] = v[0]), 0 !== v[0])) {
  57439. var y = v[1];
  57440. o.morphTargets === !0 &&
  57441. A.position &&
  57442. r.addAttribute('morphTarget' + p, A.position[y]),
  57443. o.morphNormals === !0 &&
  57444. A.normal &&
  57445. r.addAttribute('morphNormal' + p, A.normal[y]);
  57446. } else
  57447. o.morphTargets === !0 && r.removeAttribute('morphTarget' + p),
  57448. o.morphNormals === !0 && r.removeAttribute('morphNormal' + p);
  57449. }
  57450. var C = l.getUniforms();
  57451. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  57452. (c = !0);
  57453. }
  57454. var y = r.index,
  57455. I = r.attributes.position;
  57456. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  57457. var b;
  57458. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe),
  57459. c &&
  57460. (f(o, l, r),
  57461. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  57462. var _ = 0,
  57463. T = 1 / 0;
  57464. null !== y ? (T = y.count) : void 0 !== I && (T = I.count);
  57465. var x = r.drawRange.start,
  57466. S = r.drawRange.count,
  57467. M = null !== s ? s.start : 0,
  57468. R = null !== s ? s.count : 1 / 0,
  57469. P = Math.max(_, x, M),
  57470. O = Math.min(_ + T, x + S, M + R) - 1,
  57471. L = Math.max(0, O - P + 1);
  57472. if (a instanceof n.Mesh)
  57473. if (o.wireframe === !0)
  57474. Ye.setLineWidth(o.wireframeLinewidth * t()), b.setMode(Ge.LINES);
  57475. else
  57476. switch (a.drawMode) {
  57477. case n.TrianglesDrawMode:
  57478. b.setMode(Ge.TRIANGLES);
  57479. break;
  57480. case n.TriangleStripDrawMode:
  57481. b.setMode(Ge.TRIANGLE_STRIP);
  57482. break;
  57483. case n.TriangleFanDrawMode:
  57484. b.setMode(Ge.TRIANGLE_FAN);
  57485. }
  57486. else if (a instanceof n.Line) {
  57487. var D = o.linewidth;
  57488. void 0 === D && (D = 1),
  57489. Ye.setLineWidth(D * t()),
  57490. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP);
  57491. } else a instanceof n.Points && b.setMode(Ge.POINTS);
  57492. r instanceof n.InstancedBufferGeometry
  57493. ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L)
  57494. : b.render(P, L);
  57495. }),
  57496. (this.render = function (e, t, i, r) {
  57497. if (t instanceof n.Camera == !1)
  57498. return void console.error(
  57499. 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.'
  57500. );
  57501. var o = e.fog;
  57502. if (
  57503. ((Ee = ''),
  57504. (Ie = -1),
  57505. (be = null),
  57506. e.autoUpdate === !0 && e.updateMatrixWorld(),
  57507. null === t.parent && t.updateMatrixWorld(),
  57508. t.matrixWorldInverse.getInverse(t.matrixWorld),
  57509. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  57510. Be.setFromMatrix(Fe),
  57511. (ce.length = 0),
  57512. (ue = -1),
  57513. (pe = -1),
  57514. (ge.length = 0),
  57515. (me.length = 0),
  57516. y(e, t),
  57517. (he.length = ue + 1),
  57518. (de.length = pe + 1),
  57519. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  57520. U(ce, t),
  57521. $e.render(e, t),
  57522. (He.calls = 0),
  57523. (He.vertices = 0),
  57524. (He.faces = 0),
  57525. (He.points = 0),
  57526. void 0 === i && (i = null),
  57527. this.setRenderTarget(i),
  57528. (this.autoClear || r) &&
  57529. this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  57530. e.overrideMaterial)
  57531. ) {
  57532. var a = e.overrideMaterial;
  57533. C(he, t, o, a), C(de, t, o, a);
  57534. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o);
  57535. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  57536. var s = i.texture;
  57537. s.generateMipmaps &&
  57538. z(i) &&
  57539. s.minFilter !== n.NearestFilter &&
  57540. s.minFilter !== n.LinearFilter &&
  57541. J(i);
  57542. }
  57543. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0);
  57544. }),
  57545. (this.setFaceCulling = function (e, t) {
  57546. e === n.CullFaceNone
  57547. ? Ye.disable(Ge.CULL_FACE)
  57548. : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  57549. e === n.CullFaceBack
  57550. ? Ge.cullFace(Ge.BACK)
  57551. : e === n.CullFaceFront
  57552. ? Ge.cullFace(Ge.FRONT)
  57553. : Ge.cullFace(Ge.FRONT_AND_BACK),
  57554. Ye.enable(Ge.CULL_FACE));
  57555. }),
  57556. (this.setTexture = function (e, t) {
  57557. var i = Xe.get(e);
  57558. if (e.version > 0 && i.__version !== e.version) {
  57559. var n = e.image;
  57560. return void 0 === n
  57561. ? void console.warn(
  57562. 'THREE.WebGLRenderer: Texture marked for update but image is undefined',
  57563. e
  57564. )
  57565. : n.complete === !1
  57566. ? void console.warn(
  57567. 'THREE.WebGLRenderer: Texture marked for update but image is incomplete',
  57568. e
  57569. )
  57570. : void H(i, e, t);
  57571. }
  57572. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture);
  57573. }),
  57574. (this.getCurrentRenderTarget = function () {
  57575. return ye;
  57576. }),
  57577. (this.setRenderTargetFramebuffer = function (renderTarget, defaultFramebuffer) {
  57578. //add
  57579. const renderTargetProperties = Xe.get(renderTarget);
  57580. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  57581. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  57582. }),
  57583. (this.setFramebuffer = function (value) {
  57584. //add
  57585. if (Ce !== value && ye === null) Ge.bindFramebuffer(36160, value);
  57586. Ce = value;
  57587. }),
  57588. (this.setRenderTarget = function (e) {
  57589. (ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  57590. var t,
  57591. i = e instanceof n.WebGLRenderTargetCube;
  57592. if (e) {
  57593. var r = Xe.get(e);
  57594. (t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer),
  57595. we.copy(e.scissor),
  57596. (_e = e.scissorTest),
  57597. Te.copy(e.viewport);
  57598. } else
  57599. (t = null),
  57600. we.copy(Le).multiplyScalar(Oe),
  57601. (_e = De),
  57602. Te.copy(Ne).multiplyScalar(Oe);
  57603. if (
  57604. (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)),
  57605. Ye.scissor(we),
  57606. Ye.setScissorTest(_e),
  57607. Ye.viewport(Te),
  57608. i)
  57609. ) {
  57610. var o = Xe.get(e.texture);
  57611. Ge.framebufferTexture2D(
  57612. Ge.FRAMEBUFFER,
  57613. Ge.COLOR_ATTACHMENT0,
  57614. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace,
  57615. o.__webglTexture,
  57616. e.activeMipMapLevel
  57617. );
  57618. }
  57619. }),
  57620. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  57621. if (e instanceof n.WebGLRenderTarget == !1)
  57622. return void console.error(
  57623. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.'
  57624. );
  57625. var s = Xe.get(e).__webglFramebuffer;
  57626. if (s) {
  57627. var l = !1;
  57628. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0));
  57629. try {
  57630. var c = e.texture;
  57631. if (
  57632. c.format !== n.RGBAFormat &&
  57633. ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT)
  57634. )
  57635. return void console.error(
  57636. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.'
  57637. );
  57638. if (
  57639. !(
  57640. c.type === n.UnsignedByteType ||
  57641. ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  57642. (c.type === n.FloatType && We.get('WEBGL_color_buffer_float')) ||
  57643. (c.type === n.HalfFloatType && We.get('EXT_color_buffer_half_float'))
  57644. )
  57645. )
  57646. return void console.error(
  57647. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.'
  57648. );
  57649. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE
  57650. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  57651. : console.error(
  57652. 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.'
  57653. );
  57654. } finally {
  57655. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce);
  57656. }
  57657. }
  57658. });
  57659. }),
  57660. (n.WebGLRenderTarget = function (e, t, i) {
  57661. (this.uuid = n.Math.generateUUID()),
  57662. (this.width = e),
  57663. (this.height = t),
  57664. (this.scissor = new n.Vector4(0, 0, e, t)),
  57665. (this.scissorTest = !1),
  57666. (this.viewport = new n.Vector4(0, 0, e, t)),
  57667. (i = i || {}),
  57668. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  57669. (this.texture = new n.Texture(
  57670. void 0,
  57671. void 0,
  57672. i.wrapS,
  57673. i.wrapT,
  57674. i.magFilter,
  57675. i.minFilter,
  57676. i.format,
  57677. i.type,
  57678. i.anisotropy
  57679. )),
  57680. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  57681. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer);
  57682. }),
  57683. (n.WebGLRenderTarget.prototype = {
  57684. constructor: n.WebGLRenderTarget,
  57685. setSize: function (e, t) {
  57686. (this.width === e && this.height === t) ||
  57687. ((this.width = e), (this.height = t), this.dispose()),
  57688. this.viewport.set(0, 0, e, t),
  57689. this.scissor.set(0, 0, e, t);
  57690. },
  57691. clone: function () {
  57692. return new this.constructor().copy(this);
  57693. },
  57694. copy: function (e) {
  57695. return (
  57696. (this.width = e.width),
  57697. (this.height = e.height),
  57698. this.viewport.copy(e.viewport),
  57699. (this.texture = e.texture.clone()),
  57700. (this.depthBuffer = e.depthBuffer),
  57701. (this.stencilBuffer = e.stencilBuffer),
  57702. this
  57703. );
  57704. },
  57705. dispose: function () {
  57706. this.dispatchEvent({
  57707. type: 'dispose',
  57708. });
  57709. },
  57710. }),
  57711. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  57712. (n.WebGLRenderTargetCube = function (e, t, i) {
  57713. n.WebGLRenderTarget.call(this, e, t, i),
  57714. (this.activeCubeFace = 0),
  57715. (this.activeMipMapLevel = 0);
  57716. }),
  57717. (n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype)),
  57718. (n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube),
  57719. (n.WebGLBufferRenderer = function (e, t, i) {
  57720. function r(e) {
  57721. s = e;
  57722. }
  57723. function o(t, n) {
  57724. e.drawArrays(s, t, n),
  57725. i.calls++,
  57726. (i.vertices += n),
  57727. s === e.TRIANGLES && (i.faces += n / 3);
  57728. }
  57729. function a(r) {
  57730. var o = t.get('ANGLE_instanced_arrays');
  57731. if (null === o)
  57732. return void console.error(
  57733. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57734. );
  57735. var a = r.attributes.position,
  57736. l = 0;
  57737. a instanceof n.InterleavedBufferAttribute
  57738. ? ((l = a.data.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  57739. : ((l = a.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  57740. i.calls++,
  57741. (i.vertices += l * r.maxInstancedCount),
  57742. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3);
  57743. }
  57744. var s;
  57745. (this.setMode = r), (this.render = o), (this.renderInstances = a);
  57746. }),
  57747. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  57748. function n(e) {
  57749. s = e;
  57750. }
  57751. function r(i) {
  57752. i.array instanceof Uint32Array && t.get('OES_element_index_uint')
  57753. ? ((l = e.UNSIGNED_INT), (c = 4))
  57754. : ((l = e.UNSIGNED_SHORT), (c = 2));
  57755. }
  57756. function o(t, n) {
  57757. e.drawElements(s, n, l, t * c),
  57758. i.calls++,
  57759. (i.vertices += n),
  57760. s === e.TRIANGLES && (i.faces += n / 3);
  57761. }
  57762. function a(n, r, o) {
  57763. var a = t.get('ANGLE_instanced_arrays');
  57764. return null === a
  57765. ? void console.error(
  57766. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57767. )
  57768. : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  57769. i.calls++,
  57770. (i.vertices += o * n.maxInstancedCount),
  57771. void (s === e.TRIANGLES && (i.faces += (n.maxInstancedCount * o) / 3)));
  57772. }
  57773. var s, l, c;
  57774. (this.setMode = n), (this.setIndex = r), (this.render = o), (this.renderInstances = a);
  57775. }),
  57776. (n.WebGLExtensions = function (e) {
  57777. var t = {};
  57778. this.get = function (i) {
  57779. if (void 0 !== t[i]) return t[i];
  57780. var n;
  57781. switch (i) {
  57782. case 'EXT_texture_filter_anisotropic':
  57783. n =
  57784. e.getExtension('EXT_texture_filter_anisotropic') ||
  57785. e.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
  57786. e.getExtension('WEBKIT_EXT_texture_filter_anisotropic');
  57787. break;
  57788. case 'WEBGL_compressed_texture_s3tc':
  57789. n =
  57790. e.getExtension('WEBGL_compressed_texture_s3tc') ||
  57791. e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') ||
  57792. e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');
  57793. break;
  57794. case 'WEBGL_compressed_texture_pvrtc':
  57795. n =
  57796. e.getExtension('WEBGL_compressed_texture_pvrtc') ||
  57797. e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');
  57798. break;
  57799. case 'WEBGL_compressed_texture_etc1':
  57800. n = e.getExtension('WEBGL_compressed_texture_etc1');
  57801. break;
  57802. default:
  57803. n = e.getExtension(i);
  57804. }
  57805. return (
  57806. null === n &&
  57807. console.warn('THREE.WebGLRenderer: ' + i + ' extension not supported.'),
  57808. (t[i] = n),
  57809. n
  57810. );
  57811. };
  57812. }),
  57813. (n.WebGLCapabilities = function (e, t, i) {
  57814. function n(t) {
  57815. if ('highp' === t) {
  57816. if (
  57817. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 &&
  57818. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0
  57819. )
  57820. return 'highp';
  57821. t = 'mediump';
  57822. }
  57823. return 'mediump' === t &&
  57824. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 &&
  57825. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0
  57826. ? 'mediump'
  57827. : 'lowp';
  57828. }
  57829. (this.getMaxPrecision = n),
  57830. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  57831. (this.logarithmicDepthBuffer =
  57832. void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  57833. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  57834. (this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  57835. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  57836. (this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),
  57837. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  57838. (this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),
  57839. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  57840. (this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),
  57841. (this.vertexTextures = this.maxVertexTextures > 0),
  57842. (this.floatFragmentTextures = !!t.get('OES_texture_float')),
  57843. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures);
  57844. var r = n(this.precision);
  57845. r !== this.precision &&
  57846. (console.warn(
  57847. 'THREE.WebGLRenderer:',
  57848. this.precision,
  57849. 'not supported, using',
  57850. r,
  57851. 'instead.'
  57852. ),
  57853. (this.precision = r)),
  57854. this.logarithmicDepthBuffer &&
  57855. (this.logarithmicDepthBuffer = !!t.get('EXT_frag_depth'));
  57856. }),
  57857. (n.WebGLGeometries = function (e, t, i) {
  57858. function r(e) {
  57859. var t = e.geometry;
  57860. if (void 0 !== h[t.id]) return h[t.id];
  57861. t.addEventListener('dispose', o);
  57862. var r;
  57863. return (
  57864. t instanceof n.BufferGeometry
  57865. ? (r = t)
  57866. : t instanceof n.Geometry &&
  57867. (void 0 === t._bufferGeometry &&
  57868. (t._bufferGeometry = new n.BufferGeometry().setFromObject(e)),
  57869. (r = t._bufferGeometry)),
  57870. (h[t.id] = r),
  57871. i.memory.geometries++,
  57872. r
  57873. );
  57874. }
  57875. function o(e) {
  57876. var n = e.target,
  57877. r = h[n.id];
  57878. null !== r.index && s(r.index),
  57879. l(r.attributes),
  57880. n.removeEventListener('dispose', o),
  57881. delete h[n.id];
  57882. var a = t.get(n);
  57883. a.wireframe && s(a.wireframe), t.delete(n);
  57884. var c = t.get(r);
  57885. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--;
  57886. }
  57887. function a(e) {
  57888. return e instanceof n.InterleavedBufferAttribute
  57889. ? t.get(e.data).__webglBuffer
  57890. : t.get(e).__webglBuffer;
  57891. }
  57892. function s(t) {
  57893. var i = a(t);
  57894. void 0 !== i && (e.deleteBuffer(i), c(t));
  57895. }
  57896. function l(e) {
  57897. for (var t in e) s(e[t]);
  57898. }
  57899. function c(e) {
  57900. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e);
  57901. }
  57902. var h = {};
  57903. this.get = r;
  57904. }),
  57905. (n.WebGLLights = function () {
  57906. var e = {};
  57907. this.get = function (t) {
  57908. if (void 0 !== e[t.id]) return e[t.id];
  57909. var i;
  57910. switch (t.type) {
  57911. case 'DirectionalLight':
  57912. i = {
  57913. direction: new n.Vector3(),
  57914. color: new n.Color(),
  57915. shadow: !1,
  57916. shadowBias: 0,
  57917. shadowRadius: 1,
  57918. shadowMapSize: new n.Vector2(),
  57919. };
  57920. break;
  57921. case 'SpotLight':
  57922. i = {
  57923. position: new n.Vector3(),
  57924. direction: new n.Vector3(),
  57925. color: new n.Color(),
  57926. distance: 0,
  57927. coneCos: 0,
  57928. penumbraCos: 0,
  57929. decay: 0,
  57930. shadow: !1,
  57931. shadowBias: 0,
  57932. shadowRadius: 1,
  57933. shadowMapSize: new n.Vector2(),
  57934. };
  57935. break;
  57936. case 'PointLight':
  57937. i = {
  57938. position: new n.Vector3(),
  57939. color: new n.Color(),
  57940. distance: 0,
  57941. decay: 0,
  57942. shadow: !1,
  57943. shadowBias: 0,
  57944. shadowRadius: 1,
  57945. shadowMapSize: new n.Vector2(),
  57946. };
  57947. break;
  57948. case 'HemisphereLight':
  57949. i = {
  57950. direction: new n.Vector3(),
  57951. skyColor: new n.Color(),
  57952. groundColor: new n.Color(),
  57953. };
  57954. }
  57955. return (e[t.id] = i), i;
  57956. };
  57957. }),
  57958. (n.WebGLObjects = function (e, t, i) {
  57959. function r(t) {
  57960. var i = u.get(t);
  57961. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  57962. var r = i.index,
  57963. a = i.attributes;
  57964. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  57965. for (var s in a) o(a[s], e.ARRAY_BUFFER);
  57966. var l = i.morphAttributes;
  57967. for (var s in l)
  57968. for (var c = l[s], h = 0, d = c.length; h < d; h++) o(c[h], e.ARRAY_BUFFER);
  57969. return i;
  57970. }
  57971. function o(e, i) {
  57972. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  57973. o = t.get(r);
  57974. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i);
  57975. }
  57976. function a(t, i, n) {
  57977. (t.__webglBuffer = e.createBuffer()), e.bindBuffer(n, t.__webglBuffer);
  57978. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  57979. e.bufferData(n, i.array, r), (t.version = i.version);
  57980. }
  57981. function s(t, i, n) {
  57982. e.bindBuffer(n, t.__webglBuffer),
  57983. i.dynamic === !1 || i.updateRange.count === -1
  57984. ? e.bufferSubData(n, 0, i.array)
  57985. : 0 === i.updateRange.count
  57986. ? console.error(
  57987. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  57988. )
  57989. : (e.bufferSubData(
  57990. n,
  57991. i.updateRange.offset * i.array.BYTES_PER_ELEMENT,
  57992. i.array.subarray(
  57993. i.updateRange.offset,
  57994. i.updateRange.offset + i.updateRange.count
  57995. )
  57996. ),
  57997. (i.updateRange.count = 0)),
  57998. (t.version = i.version);
  57999. }
  58000. function l(e) {
  58001. return e instanceof n.InterleavedBufferAttribute
  58002. ? t.get(e.data).__webglBuffer
  58003. : t.get(e).__webglBuffer;
  58004. }
  58005. function c(i) {
  58006. var r = t.get(i);
  58007. if (void 0 !== r.wireframe) return r.wireframe;
  58008. var a = [],
  58009. s = i.index,
  58010. l = i.attributes,
  58011. c = l.position;
  58012. if (null !== s)
  58013. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  58014. var g = d[p + 0],
  58015. m = d[p + 1],
  58016. v = d[p + 2];
  58017. h(u, g, m) && a.push(g, m),
  58018. h(u, m, v) && a.push(m, v),
  58019. h(u, v, g) && a.push(v, g);
  58020. }
  58021. else
  58022. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  58023. var g = p + 0,
  58024. m = p + 1,
  58025. v = p + 2;
  58026. a.push(g, m, m, v, v, g);
  58027. }
  58028. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  58029. y = new n.BufferAttribute(new A(a), 1);
  58030. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y;
  58031. }
  58032. function h(e, t, i) {
  58033. if (t > i) {
  58034. var n = t;
  58035. (t = i), (i = n);
  58036. }
  58037. var r = e[t];
  58038. return void 0 === r ? ((e[t] = [i]), !0) : r.indexOf(i) === -1 && (r.push(i), !0);
  58039. }
  58040. var u = new n.WebGLGeometries(e, t, i);
  58041. (this.getAttributeBuffer = l), (this.getWireframeAttribute = c), (this.update = r);
  58042. }),
  58043. (n.WebGLProgram = (function () {
  58044. function e(e) {
  58045. switch (e) {
  58046. case n.LinearEncoding:
  58047. return ['Linear', '( value )'];
  58048. case n.sRGBEncoding:
  58049. return ['sRGB', '( value )'];
  58050. case n.RGBEEncoding:
  58051. return ['RGBE', '( value )'];
  58052. case n.RGBM7Encoding:
  58053. return ['RGBM', '( value, 7.0 )'];
  58054. case n.RGBM16Encoding:
  58055. return ['RGBM', '( value, 16.0 )'];
  58056. case n.RGBDEncoding:
  58057. return ['RGBD', '( value, 256.0 )'];
  58058. case n.GammaEncoding:
  58059. return ['Gamma', '( value, float( GAMMA_FACTOR ) )'];
  58060. default:
  58061. throw new Error('unsupported encoding: ' + e);
  58062. }
  58063. }
  58064. function t(t, i) {
  58065. var n = e(i);
  58066. return 'vec4 ' + t + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }';
  58067. }
  58068. function i(t, i) {
  58069. var n = e(i);
  58070. return 'vec4 ' + t + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }';
  58071. }
  58072. function r(e, t) {
  58073. var i;
  58074. switch (t) {
  58075. case n.LinearToneMapping:
  58076. i = 'Linear';
  58077. break;
  58078. case n.ReinhardToneMapping:
  58079. i = 'Reinhard';
  58080. break;
  58081. case n.Uncharted2ToneMapping:
  58082. i = 'Uncharted2';
  58083. break;
  58084. case n.CineonToneMapping:
  58085. i = 'OptimizedCineon';
  58086. break;
  58087. default:
  58088. throw new Error('unsupported toneMapping: ' + t);
  58089. }
  58090. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }';
  58091. }
  58092. function o(e, t, i) {
  58093. e = e || {};
  58094. var n = [
  58095. e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading
  58096. ? '#extension GL_OES_standard_derivatives : enable'
  58097. : '',
  58098. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth')
  58099. ? '#extension GL_EXT_frag_depth : enable'
  58100. : '',
  58101. e.drawBuffers && i.get('WEBGL_draw_buffers')
  58102. ? '#extension GL_EXT_draw_buffers : require'
  58103. : '',
  58104. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod')
  58105. ? '#extension GL_EXT_shader_texture_lod : enable'
  58106. : '',
  58107. ];
  58108. return n.filter(c).join('\n');
  58109. }
  58110. function a(e) {
  58111. var t = [];
  58112. for (var i in e) {
  58113. var n = e[i];
  58114. n !== !1 && t.push('#define ' + i + ' ' + n);
  58115. }
  58116. return t.join('\n');
  58117. }
  58118. function s(e, t, i) {
  58119. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  58120. var a = e.getActiveUniform(t, o),
  58121. s = a.name,
  58122. l = e.getUniformLocation(t, s),
  58123. c = f.exec(s);
  58124. if (c) {
  58125. var h = c[1],
  58126. u = c[2],
  58127. d = n[h];
  58128. d || (d = n[h] = {}), (d[u] = l);
  58129. } else if ((c = g.exec(s))) {
  58130. var p = c[1],
  58131. v = c[2],
  58132. A = c[3],
  58133. y = n[p];
  58134. y || (y = n[p] = []);
  58135. var C = y[v];
  58136. C || (C = y[v] = {}), (C[A] = l);
  58137. } else if ((c = m.exec(s))) {
  58138. var p = c[1];
  58139. n[p] = l;
  58140. } else n[s] = l;
  58141. }
  58142. return n;
  58143. }
  58144. function l(e, t, i) {
  58145. for (
  58146. var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0;
  58147. o < r;
  58148. o++
  58149. ) {
  58150. var a = e.getActiveAttrib(t, o),
  58151. s = a.name;
  58152. n[s] = e.getAttribLocation(t, s);
  58153. }
  58154. return n;
  58155. }
  58156. function c(e) {
  58157. return '' !== e;
  58158. }
  58159. function h(e, t) {
  58160. return e
  58161. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  58162. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  58163. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  58164. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights);
  58165. }
  58166. function u(e) {
  58167. function t(e, t) {
  58168. var i = n.ShaderChunk[t];
  58169. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>');
  58170. return u(i);
  58171. }
  58172. var i = /#include +<([\w\d.]+)>/g;
  58173. return e.replace(i, t);
  58174. }
  58175. function d(e) {
  58176. function t(e, t, i, n) {
  58177. for (var r = '', o = parseInt(t); o < parseInt(i); o++)
  58178. r += n.replace(/\[ i \]/g, '[ ' + o + ' ]');
  58179. return r;
  58180. }
  58181. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  58182. return e.replace(i, t);
  58183. }
  58184. var p = 0,
  58185. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  58186. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  58187. m = /^([\w\d_]+)\[0\]$/;
  58188. return function (e, f, g, m) {
  58189. var v = e.context,
  58190. A = g.extensions,
  58191. y = g.defines,
  58192. C = g.__webglShader.vertexShader,
  58193. I = g.__webglShader.fragmentShader,
  58194. E = 'SHADOWMAP_TYPE_BASIC';
  58195. m.shadowMapType === n.PCFShadowMap
  58196. ? (E = 'SHADOWMAP_TYPE_PCF')
  58197. : m.shadowMapType === n.PCFSoftShadowMap && (E = 'SHADOWMAP_TYPE_PCF_SOFT');
  58198. var b = 'ENVMAP_TYPE_CUBE',
  58199. w = 'ENVMAP_MODE_REFLECTION',
  58200. _ = 'ENVMAP_BLENDING_MULTIPLY';
  58201. if (m.envMap) {
  58202. switch (g.envMap.mapping) {
  58203. case n.CubeReflectionMapping:
  58204. case n.CubeRefractionMapping:
  58205. b = 'ENVMAP_TYPE_CUBE';
  58206. break;
  58207. case n.CubeUVReflectionMapping:
  58208. case n.CubeUVRefractionMapping:
  58209. b = 'ENVMAP_TYPE_CUBE_UV';
  58210. break;
  58211. case n.EquirectangularReflectionMapping:
  58212. case n.EquirectangularRefractionMapping:
  58213. b = 'ENVMAP_TYPE_EQUIREC';
  58214. break;
  58215. case n.SphericalReflectionMapping:
  58216. b = 'ENVMAP_TYPE_SPHERE';
  58217. }
  58218. switch (g.envMap.mapping) {
  58219. case n.CubeRefractionMapping:
  58220. case n.EquirectangularRefractionMapping:
  58221. w = 'ENVMAP_MODE_REFRACTION';
  58222. }
  58223. switch (g.combine) {
  58224. case n.MultiplyOperation:
  58225. _ = 'ENVMAP_BLENDING_MULTIPLY';
  58226. break;
  58227. case n.MixOperation:
  58228. _ = 'ENVMAP_BLENDING_MIX';
  58229. break;
  58230. case n.AddOperation:
  58231. _ = 'ENVMAP_BLENDING_ADD';
  58232. }
  58233. }
  58234. var T,
  58235. x,
  58236. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  58237. M = o(A, m, e.extensions),
  58238. R = a(y),
  58239. P = v.createProgram();
  58240. g instanceof n.RawShaderMaterial
  58241. ? ((T = ''), (x = ''))
  58242. : ((T = [
  58243. 'precision ' + m.precision + ' float;',
  58244. 'precision ' + m.precision + ' int;',
  58245. '#define SHADER_NAME ' + g.__webglShader.name,
  58246. R,
  58247. m.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  58248. '#define GAMMA_FACTOR ' + S,
  58249. '#define MAX_BONES ' + m.maxBones,
  58250. m.map ? '#define USE_MAP' : '',
  58251. m.envMap ? '#define USE_ENVMAP' : '',
  58252. m.envMap ? '#define ' + w : '',
  58253. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58254. m.aoMap ? '#define USE_AOMAP' : '',
  58255. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58256. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58257. m.normalMap ? '#define USE_NORMALMAP' : '',
  58258. m.displacementMap && m.supportsVertexTextures
  58259. ? '#define USE_DISPLACEMENTMAP'
  58260. : '',
  58261. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58262. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58263. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58264. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58265. m.vertexColors ? '#define USE_COLOR' : '',
  58266. m.flatShading ? '#define FLAT_SHADED' : '',
  58267. m.skinning ? '#define USE_SKINNING' : '',
  58268. m.useVertexTexture ? '#define BONE_TEXTURE' : '',
  58269. m.morphTargets ? '#define USE_MORPHTARGETS' : '',
  58270. m.morphNormals && m.flatShading === !1 ? '#define USE_MORPHNORMALS' : '',
  58271. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58272. m.flipSided ? '#define FLIP_SIDED' : '',
  58273. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58274. m.shadowMapEnabled ? '#define ' + E : '',
  58275. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58276. m.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  58277. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58278. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58279. ? '#define USE_LOGDEPTHBUF_EXT'
  58280. : '',
  58281. 'uniform mat4 modelMatrix;',
  58282. 'uniform mat4 modelViewMatrix;',
  58283. 'uniform mat4 projectionMatrix;',
  58284. 'uniform mat4 viewMatrix;',
  58285. 'uniform mat3 normalMatrix;',
  58286. 'uniform vec3 cameraPosition;',
  58287. 'attribute vec3 position;',
  58288. 'attribute vec3 normal;',
  58289. 'attribute vec2 uv;',
  58290. '#ifdef USE_COLOR',
  58291. '\tattribute vec3 color;',
  58292. '#endif',
  58293. '#ifdef USE_MORPHTARGETS',
  58294. '\tattribute vec3 morphTarget0;',
  58295. '\tattribute vec3 morphTarget1;',
  58296. '\tattribute vec3 morphTarget2;',
  58297. '\tattribute vec3 morphTarget3;',
  58298. '\t#ifdef USE_MORPHNORMALS',
  58299. '\t\tattribute vec3 morphNormal0;',
  58300. '\t\tattribute vec3 morphNormal1;',
  58301. '\t\tattribute vec3 morphNormal2;',
  58302. '\t\tattribute vec3 morphNormal3;',
  58303. '\t#else',
  58304. '\t\tattribute vec3 morphTarget4;',
  58305. '\t\tattribute vec3 morphTarget5;',
  58306. '\t\tattribute vec3 morphTarget6;',
  58307. '\t\tattribute vec3 morphTarget7;',
  58308. '\t#endif',
  58309. '#endif',
  58310. '#ifdef USE_SKINNING',
  58311. '\tattribute vec4 skinIndex;',
  58312. '\tattribute vec4 skinWeight;',
  58313. '#endif',
  58314. '\n',
  58315. ]
  58316. .filter(c)
  58317. .join('\n')),
  58318. (x = [
  58319. M,
  58320. 'precision ' + m.precision + ' float;',
  58321. 'precision ' + m.precision + ' int;',
  58322. '#define SHADER_NAME ' + g.__webglShader.name,
  58323. R,
  58324. m.alphaTest ? '#define ALPHATEST ' + m.alphaTest : '',
  58325. '#define GAMMA_FACTOR ' + S,
  58326. m.useFog && m.fog ? '#define USE_FOG' : '',
  58327. m.useFog && m.fogExp ? '#define FOG_EXP2' : '',
  58328. m.map ? '#define USE_MAP' : '',
  58329. m.envMap ? '#define USE_ENVMAP' : '',
  58330. m.envMap ? '#define ' + b : '',
  58331. m.envMap ? '#define ' + w : '',
  58332. m.envMap ? '#define ' + _ : '',
  58333. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58334. m.aoMap ? '#define USE_AOMAP' : '',
  58335. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58336. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58337. m.normalMap ? '#define USE_NORMALMAP' : '',
  58338. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58339. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58340. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58341. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58342. m.vertexColors ? '#define USE_COLOR' : '',
  58343. m.flatShading ? '#define FLAT_SHADED' : '',
  58344. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58345. m.flipSided ? '#define FLIP_SIDED' : '',
  58346. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58347. m.shadowMapEnabled ? '#define ' + E : '',
  58348. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58349. m.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  58350. m.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  58351. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58352. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58353. ? '#define USE_LOGDEPTHBUF_EXT'
  58354. : '',
  58355. m.envMap && e.extensions.get('EXT_shader_texture_lod')
  58356. ? '#define TEXTURE_LOD_EXT'
  58357. : '',
  58358. 'uniform mat4 viewMatrix;',
  58359. 'uniform vec3 cameraPosition;',
  58360. m.toneMapping !== n.NoToneMapping ? '#define TONE_MAPPING' : '',
  58361. m.toneMapping !== n.NoToneMapping
  58362. ? n.ShaderChunk.tonemapping_pars_fragment
  58363. : '',
  58364. m.toneMapping !== n.NoToneMapping ? r('toneMapping', m.toneMapping) : '',
  58365. m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding
  58366. ? n.ShaderChunk.encodings_pars_fragment
  58367. : '',
  58368. m.mapEncoding ? t('mapTexelToLinear', m.mapEncoding) : '',
  58369. m.envMapEncoding ? t('envMapTexelToLinear', m.envMapEncoding) : '',
  58370. m.emissiveMapEncoding
  58371. ? t('emissiveMapTexelToLinear', m.emissiveMapEncoding)
  58372. : '',
  58373. m.outputEncoding ? i('linearToOutputTexel', m.outputEncoding) : '',
  58374. '\n',
  58375. ]
  58376. .filter(c)
  58377. .join('\n'))),
  58378. (C = u(C, m)),
  58379. (C = h(C, m)),
  58380. (I = u(I, m)),
  58381. (I = h(I, m)),
  58382. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)));
  58383. var O = T + C,
  58384. L = x + I,
  58385. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  58386. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  58387. v.attachShader(P, D),
  58388. v.attachShader(P, N),
  58389. void 0 !== g.index0AttributeName
  58390. ? v.bindAttribLocation(P, 0, g.index0AttributeName)
  58391. : m.morphTargets === !0 && v.bindAttribLocation(P, 0, 'position'),
  58392. v.linkProgram(P);
  58393. var B = v.getProgramInfoLog(P),
  58394. F = v.getShaderInfoLog(D),
  58395. V = v.getShaderInfoLog(N),
  58396. U = !0,
  58397. k = !0;
  58398. v.getProgramParameter(P, v.LINK_STATUS) === !1
  58399. ? ((U = !1),
  58400. console.error(
  58401. 'THREE.WebGLProgram: shader error: ',
  58402. v.getError(),
  58403. 'gl.VALIDATE_STATUS',
  58404. v.getProgramParameter(P, v.VALIDATE_STATUS),
  58405. 'gl.getProgramInfoLog',
  58406. B,
  58407. F,
  58408. V
  58409. ))
  58410. : '' !== B
  58411. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', B)
  58412. : ('' !== F && '' !== V) || (k = !1),
  58413. k &&
  58414. (this.diagnostics = {
  58415. runnable: U,
  58416. material: g,
  58417. programLog: B,
  58418. vertexShader: {
  58419. log: F,
  58420. prefix: T,
  58421. },
  58422. fragmentShader: {
  58423. log: V,
  58424. prefix: x,
  58425. },
  58426. }),
  58427. v.deleteShader(D),
  58428. v.deleteShader(N);
  58429. var H;
  58430. this.getUniforms = function () {
  58431. return void 0 === H && (H = s(v, P)), H;
  58432. };
  58433. var G;
  58434. return (
  58435. (this.getAttributes = function () {
  58436. return void 0 === G && (G = l(v, P)), G;
  58437. }),
  58438. (this.destroy = function () {
  58439. v.deleteProgram(P), (this.program = void 0);
  58440. }),
  58441. Object.defineProperties(this, {
  58442. uniforms: {
  58443. get: function () {
  58444. return (
  58445. console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'),
  58446. this.getUniforms()
  58447. );
  58448. },
  58449. },
  58450. attributes: {
  58451. get: function () {
  58452. return (
  58453. console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'),
  58454. this.getAttributes()
  58455. );
  58456. },
  58457. },
  58458. }),
  58459. (this.id = p++),
  58460. (this.code = f),
  58461. (this.usedTimes = 1),
  58462. (this.program = P),
  58463. (this.vertexShader = D),
  58464. (this.fragmentShader = N),
  58465. this
  58466. );
  58467. };
  58468. })()),
  58469. (n.WebGLPrograms = function (e, t) {
  58470. function i(e) {
  58471. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  58472. return 1024;
  58473. var i = t.maxVertexUniforms,
  58474. r = Math.floor((i - 20) / 4),
  58475. o = r;
  58476. return (
  58477. void 0 !== e &&
  58478. e instanceof n.SkinnedMesh &&
  58479. ((o = Math.min(e.skeleton.bones.length, o)),
  58480. o < e.skeleton.bones.length &&
  58481. console.warn(
  58482. 'WebGLRenderer: too many bones - ' +
  58483. e.skeleton.bones.length +
  58484. ', this GPU supports just ' +
  58485. o +
  58486. ' (try OpenGL instead of ANGLE)'
  58487. )),
  58488. o
  58489. );
  58490. }
  58491. function r(e, t) {
  58492. var i;
  58493. return (
  58494. e
  58495. ? e instanceof n.Texture
  58496. ? (i = e.encoding)
  58497. : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding)
  58498. : (i = n.LinearEncoding),
  58499. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  58500. i
  58501. );
  58502. }
  58503. var o = [],
  58504. a = {
  58505. MeshDepthMaterial: 'depth',
  58506. MeshNormalMaterial: 'normal',
  58507. MeshBasicMaterial: 'basic',
  58508. MeshLambertMaterial: 'lambert',
  58509. MeshPhongMaterial: 'phong',
  58510. MeshStandardMaterial: 'standard',
  58511. LineBasicMaterial: 'basic',
  58512. LineDashedMaterial: 'dashed',
  58513. PointsMaterial: 'points',
  58514. },
  58515. s = [
  58516. 'precision',
  58517. 'supportsVertexTextures',
  58518. 'map',
  58519. 'mapEncoding',
  58520. 'envMap',
  58521. 'envMapMode',
  58522. 'envMapEncoding',
  58523. 'lightMap',
  58524. 'aoMap',
  58525. 'emissiveMap',
  58526. 'emissiveMapEncoding',
  58527. 'bumpMap',
  58528. 'normalMap',
  58529. 'displacementMap',
  58530. 'specularMap',
  58531. 'roughnessMap',
  58532. 'metalnessMap',
  58533. 'alphaMap',
  58534. 'combine',
  58535. 'vertexColors',
  58536. 'fog',
  58537. 'useFog',
  58538. 'fogExp',
  58539. 'flatShading',
  58540. 'sizeAttenuation',
  58541. 'logarithmicDepthBuffer',
  58542. 'skinning',
  58543. 'maxBones',
  58544. 'useVertexTexture',
  58545. 'morphTargets',
  58546. 'morphNormals',
  58547. 'maxMorphTargets',
  58548. 'maxMorphNormals',
  58549. 'premultipliedAlpha',
  58550. 'numDirLights',
  58551. 'numPointLights',
  58552. 'numSpotLights',
  58553. 'numHemiLights',
  58554. 'shadowMapEnabled',
  58555. 'pointLightShadows',
  58556. 'toneMapping',
  58557. 'physicallyCorrectLights',
  58558. 'shadowMapType',
  58559. 'alphaTest',
  58560. 'doubleSided',
  58561. 'flipSided',
  58562. ];
  58563. (this.getParameters = function (o, s, l, c) {
  58564. var h = a[o.type],
  58565. u = i(c),
  58566. d = e.getPrecision();
  58567. null !== o.precision &&
  58568. ((d = t.getMaxPrecision(o.precision)),
  58569. d !== o.precision &&
  58570. console.warn(
  58571. 'THREE.WebGLProgram.getParameters:',
  58572. o.precision,
  58573. 'not supported, using',
  58574. d,
  58575. 'instead.'
  58576. ));
  58577. var p = {
  58578. shaderID: h,
  58579. precision: d,
  58580. supportsVertexTextures: t.vertexTextures,
  58581. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  58582. map: !!o.map,
  58583. mapEncoding: r(o.map, e.gammaInput),
  58584. envMap: !!o.envMap,
  58585. envMapMode: o.envMap && o.envMap.mapping,
  58586. envMapEncoding: r(o.envMap, e.gammaInput),
  58587. envMapCubeUV:
  58588. !!o.envMap &&
  58589. (o.envMap.mapping === n.CubeUVReflectionMapping ||
  58590. o.envMap.mapping === n.CubeUVRefractionMapping),
  58591. lightMap: !!o.lightMap,
  58592. aoMap: !!o.aoMap,
  58593. emissiveMap: !!o.emissiveMap,
  58594. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  58595. bumpMap: !!o.bumpMap,
  58596. normalMap: !!o.normalMap,
  58597. displacementMap: !!o.displacementMap,
  58598. roughnessMap: !!o.roughnessMap,
  58599. metalnessMap: !!o.metalnessMap,
  58600. specularMap: !!o.specularMap,
  58601. alphaMap: !!o.alphaMap,
  58602. combine: o.combine,
  58603. vertexColors: o.vertexColors,
  58604. fog: l,
  58605. useFog: o.fog,
  58606. fogExp: l instanceof n.FogExp2,
  58607. flatShading: o.shading === n.FlatShading,
  58608. sizeAttenuation: o.sizeAttenuation,
  58609. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  58610. skinning: o.skinning,
  58611. maxBones: u,
  58612. useVertexTexture:
  58613. t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  58614. morphTargets: o.morphTargets,
  58615. morphNormals: o.morphNormals,
  58616. maxMorphTargets: e.maxMorphTargets,
  58617. maxMorphNormals: e.maxMorphNormals,
  58618. numDirLights: s.directional.length,
  58619. numPointLights: s.point.length,
  58620. numSpotLights: s.spot.length,
  58621. numHemiLights: s.hemi.length,
  58622. pointLightShadows: s.shadowsPointLight,
  58623. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  58624. shadowMapType: e.shadowMap.type,
  58625. toneMapping: e.toneMapping,
  58626. physicallyCorrectLights: e.physicallyCorrectLights,
  58627. premultipliedAlpha: o.premultipliedAlpha,
  58628. alphaTest: o.alphaTest,
  58629. doubleSided: o.side === n.DoubleSide,
  58630. flipSided: o.side === n.BackSide,
  58631. };
  58632. return p;
  58633. }),
  58634. (this.getProgramCode = function (e, t) {
  58635. var i = [];
  58636. if (
  58637. (t.shaderID
  58638. ? i.push(t.shaderID)
  58639. : (i.push(e.fragmentShader), i.push(e.vertexShader)),
  58640. void 0 !== e.defines)
  58641. )
  58642. for (var n in e.defines) i.push(n), i.push(e.defines[n]);
  58643. for (var r = 0; r < s.length; r++) {
  58644. var o = s[r];
  58645. i.push(o), i.push(t[o]);
  58646. }
  58647. return i.join();
  58648. }),
  58649. (this.acquireProgram = function (t, i, r) {
  58650. for (var a, s = 0, l = o.length; s < l; s++) {
  58651. var c = o[s];
  58652. if (c.code === r) {
  58653. (a = c), ++a.usedTimes;
  58654. break;
  58655. }
  58656. }
  58657. return void 0 === a && ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)), a;
  58658. }),
  58659. (this.releaseProgram = function (e) {
  58660. if (0 === --e.usedTimes) {
  58661. var t = o.indexOf(e);
  58662. (o[t] = o[o.length - 1]), o.pop(), e.destroy();
  58663. }
  58664. }),
  58665. (this.programs = o);
  58666. }),
  58667. (n.WebGLProperties = function () {
  58668. var e = {};
  58669. (this.get = function (t) {
  58670. var i = t.uuid,
  58671. n = e[i];
  58672. return void 0 === n && ((n = {}), (e[i] = n)), n;
  58673. }),
  58674. (this.delete = function (t) {
  58675. delete e[t.uuid];
  58676. }),
  58677. (this.clear = function () {
  58678. e = {};
  58679. });
  58680. }),
  58681. (n.WebGLShader = (function () {
  58682. function e(e) {
  58683. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i];
  58684. return t.join('\n');
  58685. }
  58686. return function (t, i, n) {
  58687. var r = t.createShader(i);
  58688. return (
  58689. t.shaderSource(r, n),
  58690. t.compileShader(r),
  58691. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 &&
  58692. console.error("THREE.WebGLShader: Shader couldn't compile."),
  58693. '' !== t.getShaderInfoLog(r) &&
  58694. console.warn(
  58695. 'THREE.WebGLShader: gl.getShaderInfoLog()',
  58696. i === t.VERTEX_SHADER ? 'vertex' : 'fragment',
  58697. t.getShaderInfoLog(r),
  58698. e(n)
  58699. ),
  58700. r
  58701. );
  58702. };
  58703. })()),
  58704. (n.WebGLShadowMap = function (e, t, i) {
  58705. function r(e, t, i, r) {
  58706. var o = e.geometry,
  58707. a = null,
  58708. s = v,
  58709. l = e.customDepthMaterial;
  58710. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l;
  58711. else {
  58712. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets,
  58713. h = e instanceof n.SkinnedMesh && t.skinning,
  58714. u = 0;
  58715. c && (u |= f), h && (u |= g), (a = s[u]);
  58716. }
  58717. return (
  58718. (a.visible = t.visible),
  58719. (a.wireframe = t.wireframe),
  58720. (a.wireframeLinewidth = t.wireframeLinewidth),
  58721. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  58722. a
  58723. );
  58724. }
  58725. function o(e, t, i) {
  58726. if (e.visible !== !1) {
  58727. if (
  58728. e.layers.test(t.layers) &&
  58729. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  58730. e.castShadow &&
  58731. (e.frustumCulled === !1 || l.intersectsObject(e) === !0)
  58732. ) {
  58733. var r = e.material;
  58734. r.visible === !0 &&
  58735. (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  58736. p.push(e));
  58737. }
  58738. for (var a = e.children, s = 0, c = a.length; s < c; s++) o(a[s], t, i);
  58739. }
  58740. }
  58741. for (
  58742. var a = e.context,
  58743. s = e.state,
  58744. l = new n.Frustum(),
  58745. c = new n.Matrix4(),
  58746. h = new n.Vector2(),
  58747. u = new n.Vector3(),
  58748. d = new n.Vector3(),
  58749. p = [],
  58750. f = 1,
  58751. g = 2,
  58752. m = (f | g) + 1,
  58753. v = new Array(m),
  58754. A = new Array(m),
  58755. y = [
  58756. new n.Vector3(1, 0, 0),
  58757. new n.Vector3(-1, 0, 0),
  58758. new n.Vector3(0, 0, 1),
  58759. new n.Vector3(0, 0, -1),
  58760. new n.Vector3(0, 1, 0),
  58761. new n.Vector3(0, -1, 0),
  58762. ],
  58763. C = [
  58764. new n.Vector3(0, 1, 0),
  58765. new n.Vector3(0, 1, 0),
  58766. new n.Vector3(0, 1, 0),
  58767. new n.Vector3(0, 1, 0),
  58768. new n.Vector3(0, 0, 1),
  58769. new n.Vector3(0, 0, -1),
  58770. ],
  58771. I = [
  58772. new n.Vector4(),
  58773. new n.Vector4(),
  58774. new n.Vector4(),
  58775. new n.Vector4(),
  58776. new n.Vector4(),
  58777. new n.Vector4(),
  58778. ],
  58779. E = n.ShaderLib.depthRGBA,
  58780. b = n.UniformsUtils.clone(E.uniforms),
  58781. w = n.ShaderLib.distanceRGBA,
  58782. _ = n.UniformsUtils.clone(w.uniforms),
  58783. T = 0;
  58784. T !== m;
  58785. ++T
  58786. ) {
  58787. var x = 0 !== (T & f),
  58788. S = 0 !== (T & g),
  58789. M = new n.ShaderMaterial({
  58790. uniforms: b,
  58791. vertexShader: E.vertexShader,
  58792. fragmentShader: E.fragmentShader,
  58793. morphTargets: x,
  58794. skinning: S,
  58795. });
  58796. v[T] = M;
  58797. var R = new n.ShaderMaterial({
  58798. defines: {
  58799. USE_SHADOWMAP: '',
  58800. },
  58801. uniforms: _,
  58802. vertexShader: w.vertexShader,
  58803. fragmentShader: w.fragmentShader,
  58804. morphTargets: x,
  58805. skinning: S,
  58806. });
  58807. A[T] = R;
  58808. }
  58809. var P = this;
  58810. (this.enabled = !1),
  58811. (this.autoUpdate = !0),
  58812. (this.needsUpdate = !1),
  58813. (this.type = n.PCFShadowMap),
  58814. (this.cullFace = n.CullFaceFront),
  58815. (this.render = function (f, g) {
  58816. var m,
  58817. v,
  58818. A = t.shadows;
  58819. if (
  58820. 0 !== A.length &&
  58821. P.enabled !== !1 &&
  58822. (P.autoUpdate !== !1 || P.needsUpdate !== !1)
  58823. ) {
  58824. s.clearColor(1, 1, 1, 1),
  58825. s.disable(a.BLEND),
  58826. s.enable(a.CULL_FACE),
  58827. a.frontFace(a.CCW),
  58828. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  58829. s.setDepthTest(!0),
  58830. s.setScissorTest(!1);
  58831. for (var E = 0, b = A.length; E < b; E++) {
  58832. var w = A[E],
  58833. _ = w.shadow,
  58834. T = _.camera;
  58835. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  58836. (m = 6), (v = !0);
  58837. var x = h.x,
  58838. S = h.y;
  58839. I[0].set(2 * x, S, x, S),
  58840. I[1].set(0, S, x, S),
  58841. I[2].set(3 * x, S, x, S),
  58842. I[3].set(x, S, x, S),
  58843. I[4].set(3 * x, 0, x, S),
  58844. I[5].set(x, 0, x, S),
  58845. (h.x *= 4),
  58846. (h.y *= 2);
  58847. } else (m = 1), (v = !1);
  58848. if (null === _.map) {
  58849. var M = {
  58850. minFilter: n.NearestFilter,
  58851. magFilter: n.NearestFilter,
  58852. format: n.RGBAFormat,
  58853. };
  58854. (_.map = new n.WebGLRenderTarget(h.x, h.y, M)),
  58855. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  58856. T.updateProjectionMatrix();
  58857. }
  58858. var R = _.map,
  58859. O = _.matrix;
  58860. d.setFromMatrixPosition(w.matrixWorld),
  58861. T.position.copy(d),
  58862. e.setRenderTarget(R),
  58863. e.clear();
  58864. for (var L = 0; L < m; L++) {
  58865. if (v) {
  58866. u.copy(T.position), u.add(y[L]), T.up.copy(C[L]), T.lookAt(u);
  58867. var D = I[L];
  58868. s.viewport(D);
  58869. } else u.setFromMatrixPosition(w.target.matrixWorld), T.lookAt(u);
  58870. T.updateMatrixWorld(),
  58871. T.matrixWorldInverse.getInverse(T.matrixWorld),
  58872. O.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  58873. O.multiply(T.projectionMatrix),
  58874. O.multiply(T.matrixWorldInverse),
  58875. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  58876. l.setFromMatrix(c),
  58877. (p.length = 0),
  58878. o(f, g, T);
  58879. for (var N = 0, B = p.length; N < B; N++) {
  58880. var F = p[N],
  58881. V = i.update(F),
  58882. U = F.material;
  58883. if (U instanceof n.MultiMaterial)
  58884. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  58885. var W = k[G],
  58886. j = H[W.materialIndex];
  58887. if (j.visible === !0) {
  58888. var Y = r(F, j, v, d);
  58889. e.renderBufferDirect(T, null, V, Y, F, W);
  58890. }
  58891. }
  58892. else {
  58893. var Y = r(F, U, v, d);
  58894. e.renderBufferDirect(T, null, V, Y, F, null);
  58895. }
  58896. }
  58897. }
  58898. }
  58899. var X = e.getClearColor(),
  58900. Z = e.getClearAlpha();
  58901. e.setClearColor(X, Z),
  58902. s.enable(a.BLEND),
  58903. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  58904. (P.needsUpdate = !1);
  58905. }
  58906. });
  58907. }),
  58908. (n.WebGLState = function (e, t, i) {
  58909. var r = this,
  58910. o = new n.Vector4(),
  58911. a = new Uint8Array(16),
  58912. s = new Uint8Array(16),
  58913. l = new Uint8Array(16),
  58914. c = {},
  58915. h = null,
  58916. u = null,
  58917. d = null,
  58918. p = null,
  58919. f = null,
  58920. g = null,
  58921. m = null,
  58922. v = null,
  58923. A = !1,
  58924. y = null,
  58925. C = null,
  58926. I = null,
  58927. E = null,
  58928. b = null,
  58929. w = null,
  58930. _ = null,
  58931. T = null,
  58932. x = null,
  58933. S = null,
  58934. M = null,
  58935. R = null,
  58936. P = null,
  58937. O = null,
  58938. L = null,
  58939. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  58940. N = void 0,
  58941. B = {},
  58942. F = new n.Vector4(),
  58943. V = null,
  58944. U = null,
  58945. k = new n.Vector4(),
  58946. H = new n.Vector4(),
  58947. G = e.createTexture();
  58948. e.bindTexture(e.TEXTURE_2D, G),
  58949. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  58950. e.texImage2D(
  58951. e.TEXTURE_2D,
  58952. 0,
  58953. e.RGB,
  58954. 1,
  58955. 1,
  58956. 0,
  58957. e.RGB,
  58958. e.UNSIGNED_BYTE,
  58959. new Uint8Array(3)
  58960. ),
  58961. (this.init = function () {
  58962. this.clearColor(0, 0, 0, 1),
  58963. this.clearDepth(1),
  58964. this.clearStencil(0),
  58965. this.enable(e.DEPTH_TEST),
  58966. e.depthFunc(e.LEQUAL),
  58967. e.frontFace(e.CCW),
  58968. e.cullFace(e.BACK),
  58969. this.enable(e.CULL_FACE),
  58970. this.enable(e.BLEND),
  58971. e.blendEquation(e.FUNC_ADD),
  58972. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  58973. }),
  58974. (this.initAttributes = function () {
  58975. for (var e = 0, t = a.length; e < t; e++) a[e] = 0;
  58976. }),
  58977. (this.enableAttribute = function (i) {
  58978. if (
  58979. ((a[i] = 1), 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)), 0 !== l[i])
  58980. ) {
  58981. var n = t.get('ANGLE_instanced_arrays');
  58982. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0);
  58983. }
  58984. }),
  58985. (this.enableAttributeAndDivisor = function (t, i, n) {
  58986. (a[t] = 1),
  58987. 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)),
  58988. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i));
  58989. }),
  58990. (this.disableUnusedAttributes = function () {
  58991. for (var t = 0, i = s.length; t < i; t++)
  58992. s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  58993. }),
  58994. (this.enable = function (t) {
  58995. c[t] !== !0 && (e.enable(t), (c[t] = !0));
  58996. }),
  58997. (this.disable = function (t) {
  58998. c[t] !== !1 && (e.disable(t), (c[t] = !1));
  58999. }),
  59000. (this.getCompressedTextureFormats = function () {
  59001. if (
  59002. null === h &&
  59003. ((h = []),
  59004. t.get('WEBGL_compressed_texture_pvrtc') ||
  59005. t.get('WEBGL_compressed_texture_s3tc') ||
  59006. t.get('WEBGL_compressed_texture_etc1'))
  59007. )
  59008. for (
  59009. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  59010. n < i.length;
  59011. n++
  59012. )
  59013. h.push(i[n]);
  59014. return h;
  59015. }),
  59016. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  59017. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  59018. (t === u && h === A) ||
  59019. (t === n.AdditiveBlending
  59020. ? h
  59021. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59022. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  59023. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  59024. : t === n.SubtractiveBlending
  59025. ? h
  59026. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59027. e.blendFuncSeparate(
  59028. e.ZERO,
  59029. e.ZERO,
  59030. e.ONE_MINUS_SRC_COLOR,
  59031. e.ONE_MINUS_SRC_ALPHA
  59032. ))
  59033. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  59034. : t === n.MultiplyBlending
  59035. ? h
  59036. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59037. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  59038. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  59039. : h
  59040. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59041. e.blendFuncSeparate(
  59042. e.ONE,
  59043. e.ONE_MINUS_SRC_ALPHA,
  59044. e.ONE,
  59045. e.ONE_MINUS_SRC_ALPHA
  59046. ))
  59047. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59048. e.blendFuncSeparate(
  59049. e.SRC_ALPHA,
  59050. e.ONE_MINUS_SRC_ALPHA,
  59051. e.ONE,
  59052. e.ONE_MINUS_SRC_ALPHA
  59053. )),
  59054. (u = t),
  59055. (A = h)),
  59056. t === n.CustomBlending
  59057. ? ((s = s || r),
  59058. (l = l || o),
  59059. (c = c || a),
  59060. (r === d && s === g) ||
  59061. (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  59062. (o === p && a === f && l === m && c === v) ||
  59063. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  59064. (p = o),
  59065. (f = a),
  59066. (m = l),
  59067. (v = c)))
  59068. : ((d = null), (p = null), (f = null), (g = null), (m = null), (v = null));
  59069. }),
  59070. (this.setDepthFunc = function (t) {
  59071. if (y !== t) {
  59072. if (t)
  59073. switch (t) {
  59074. case n.NeverDepth:
  59075. e.depthFunc(e.NEVER);
  59076. break;
  59077. case n.AlwaysDepth:
  59078. e.depthFunc(e.ALWAYS);
  59079. break;
  59080. case n.LessDepth:
  59081. e.depthFunc(e.LESS);
  59082. break;
  59083. case n.LessEqualDepth:
  59084. e.depthFunc(e.LEQUAL);
  59085. break;
  59086. case n.EqualDepth:
  59087. e.depthFunc(e.EQUAL);
  59088. break;
  59089. case n.GreaterEqualDepth:
  59090. e.depthFunc(e.GEQUAL);
  59091. break;
  59092. case n.GreaterDepth:
  59093. e.depthFunc(e.GREATER);
  59094. break;
  59095. case n.NotEqualDepth:
  59096. e.depthFunc(e.NOTEQUAL);
  59097. break;
  59098. default:
  59099. e.depthFunc(e.LEQUAL);
  59100. }
  59101. else e.depthFunc(e.LEQUAL);
  59102. y = t;
  59103. }
  59104. }),
  59105. (this.setDepthTest = function (t) {
  59106. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  59107. }),
  59108. (this.setDepthWrite = function (t) {
  59109. C !== t && (e.depthMask(t), (C = t));
  59110. }),
  59111. (this.setColorWrite = function (t) {
  59112. I !== t && (e.colorMask(t, t, t, t), (I = t));
  59113. }),
  59114. (this.setStencilFunc = function (t, i, n) {
  59115. (b === t && w === i && _ === n) ||
  59116. (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n));
  59117. }),
  59118. (this.setStencilOp = function (t, i, n) {
  59119. (T === t && x === i && S === n) ||
  59120. (e.stencilOp(t, i, n), (T = t), (x = i), (S = n));
  59121. }),
  59122. (this.setStencilTest = function (t) {
  59123. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  59124. }),
  59125. (this.setStencilWrite = function (t) {
  59126. E !== t && (e.stencilMask(t), (E = t));
  59127. }),
  59128. (this.setFlipSided = function (t) {
  59129. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t));
  59130. }),
  59131. (this.setLineWidth = function (t) {
  59132. t !== R && (e.lineWidth(t), (R = t));
  59133. }),
  59134. (this.setPolygonOffset = function (t, i, n) {
  59135. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  59136. !t || (P === i && O === n) || (e.polygonOffset(i, n), (P = i), (O = n));
  59137. }),
  59138. (this.getScissorTest = function () {
  59139. return L;
  59140. }),
  59141. (this.setScissorTest = function (t) {
  59142. (L = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST);
  59143. }),
  59144. (this.activeTexture = function (t) {
  59145. void 0 === t && (t = e.TEXTURE0 + D - 1), N !== t && (e.activeTexture(t), (N = t));
  59146. }),
  59147. (this.bindTexture = function (t, i) {
  59148. void 0 === N && r.activeTexture();
  59149. var n = B[N];
  59150. void 0 === n &&
  59151. ((n = {
  59152. type: void 0,
  59153. texture: void 0,
  59154. }),
  59155. (B[N] = n)),
  59156. (n.type === t && n.texture === i) ||
  59157. (e.bindTexture(t, i || G), (n.type = t), (n.texture = i));
  59158. }),
  59159. (this.compressedTexImage2D = function () {
  59160. try {
  59161. e.compressedTexImage2D.apply(e, arguments);
  59162. } catch (e) {
  59163. console.error(e);
  59164. }
  59165. }),
  59166. (this.texImage2D = function () {
  59167. try {
  59168. e.texImage2D.apply(e, arguments);
  59169. } catch (e) {
  59170. console.error(e);
  59171. }
  59172. }),
  59173. (this.clearColor = function (t, i, n, r) {
  59174. o.set(t, i, n, r), F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o));
  59175. }),
  59176. (this.clearDepth = function (t) {
  59177. V !== t && (e.clearDepth(t), (V = t));
  59178. }),
  59179. (this.clearStencil = function (t) {
  59180. U !== t && (e.clearStencil(t), (U = t));
  59181. }),
  59182. (this.scissor = function (t) {
  59183. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), k.copy(t));
  59184. }),
  59185. (this.viewport = function (t) {
  59186. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), H.copy(t));
  59187. }),
  59188. (this.reset = function () {
  59189. for (var t = 0; t < s.length; t++)
  59190. 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  59191. (c = {}),
  59192. (h = null),
  59193. (N = void 0),
  59194. (B = {}),
  59195. (u = null),
  59196. (I = null),
  59197. (C = null),
  59198. (E = null),
  59199. (M = null);
  59200. });
  59201. }),
  59202. (n.LensFlarePlugin = function (e, t) {
  59203. function i() {
  59204. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  59205. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  59206. (o = p.createBuffer()),
  59207. (a = p.createBuffer()),
  59208. p.bindBuffer(p.ARRAY_BUFFER, o),
  59209. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  59210. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59211. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  59212. (u = p.createTexture()),
  59213. (d = p.createTexture()),
  59214. f.bindTexture(p.TEXTURE_2D, u),
  59215. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  59216. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59217. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59218. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59219. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59220. f.bindTexture(p.TEXTURE_2D, d),
  59221. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  59222. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59223. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59224. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59225. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59226. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0);
  59227. var i;
  59228. (i = h
  59229. ? {
  59230. vertexShader: [
  59231. 'uniform lowp int renderType;',
  59232. 'uniform vec3 screenPosition;',
  59233. 'uniform vec2 scale;',
  59234. 'uniform float rotation;',
  59235. 'uniform sampler2D occlusionMap;',
  59236. 'attribute vec2 position;',
  59237. 'attribute vec2 uv;',
  59238. 'varying vec2 vUV;',
  59239. 'varying float vVisibility;',
  59240. 'void main() {',
  59241. 'vUV = uv;',
  59242. 'vec2 pos = position;',
  59243. 'if ( renderType == 2 ) {',
  59244. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  59245. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  59246. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  59247. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  59248. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  59249. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  59250. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  59251. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  59252. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  59253. 'vVisibility = visibility.r / 9.0;',
  59254. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  59255. 'vVisibility *= visibility.b / 9.0;',
  59256. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  59257. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59258. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59259. '}',
  59260. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59261. '}',
  59262. ].join('\n'),
  59263. fragmentShader: [
  59264. 'uniform lowp int renderType;',
  59265. 'uniform sampler2D map;',
  59266. 'uniform float opacity;',
  59267. 'uniform vec3 color;',
  59268. 'varying vec2 vUV;',
  59269. 'varying float vVisibility;',
  59270. 'void main() {',
  59271. 'if ( renderType == 0 ) {',
  59272. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  59273. '} else if ( renderType == 1 ) {',
  59274. 'gl_FragColor = texture2D( map, vUV );',
  59275. '} else {',
  59276. 'vec4 texture = texture2D( map, vUV );',
  59277. 'texture.a *= opacity * vVisibility;',
  59278. 'gl_FragColor = texture;',
  59279. 'gl_FragColor.rgb *= color;',
  59280. '}',
  59281. '}',
  59282. ].join('\n'),
  59283. }
  59284. : {
  59285. vertexShader: [
  59286. 'uniform lowp int renderType;',
  59287. 'uniform vec3 screenPosition;',
  59288. 'uniform vec2 scale;',
  59289. 'uniform float rotation;',
  59290. 'attribute vec2 position;',
  59291. 'attribute vec2 uv;',
  59292. 'varying vec2 vUV;',
  59293. 'void main() {',
  59294. 'vUV = uv;',
  59295. 'vec2 pos = position;',
  59296. 'if ( renderType == 2 ) {',
  59297. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59298. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59299. '}',
  59300. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59301. '}',
  59302. ].join('\n'),
  59303. fragmentShader: [
  59304. 'precision mediump float;',
  59305. 'uniform lowp int renderType;',
  59306. 'uniform sampler2D map;',
  59307. 'uniform sampler2D occlusionMap;',
  59308. 'uniform float opacity;',
  59309. 'uniform vec3 color;',
  59310. 'varying vec2 vUV;',
  59311. 'void main() {',
  59312. 'if ( renderType == 0 ) {',
  59313. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  59314. '} else if ( renderType == 1 ) {',
  59315. 'gl_FragColor = texture2D( map, vUV );',
  59316. '} else {',
  59317. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  59318. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  59319. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  59320. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  59321. 'visibility = ( 1.0 - visibility / 4.0 );',
  59322. 'vec4 texture = texture2D( map, vUV );',
  59323. 'texture.a *= opacity * visibility;',
  59324. 'gl_FragColor = texture;',
  59325. 'gl_FragColor.rgb *= color;',
  59326. '}',
  59327. '}',
  59328. ].join('\n'),
  59329. }),
  59330. (s = r(i)),
  59331. (l = {
  59332. vertex: p.getAttribLocation(s, 'position'),
  59333. uv: p.getAttribLocation(s, 'uv'),
  59334. }),
  59335. (c = {
  59336. renderType: p.getUniformLocation(s, 'renderType'),
  59337. map: p.getUniformLocation(s, 'map'),
  59338. occlusionMap: p.getUniformLocation(s, 'occlusionMap'),
  59339. opacity: p.getUniformLocation(s, 'opacity'),
  59340. color: p.getUniformLocation(s, 'color'),
  59341. scale: p.getUniformLocation(s, 'scale'),
  59342. rotation: p.getUniformLocation(s, 'rotation'),
  59343. screenPosition: p.getUniformLocation(s, 'screenPosition'),
  59344. });
  59345. }
  59346. function r(t) {
  59347. var i = p.createProgram(),
  59348. n = p.createShader(p.FRAGMENT_SHADER),
  59349. r = p.createShader(p.VERTEX_SHADER),
  59350. o = 'precision ' + e.getPrecision() + ' float;\n';
  59351. return (
  59352. p.shaderSource(n, o + t.fragmentShader),
  59353. p.shaderSource(r, o + t.vertexShader),
  59354. p.compileShader(n),
  59355. p.compileShader(r),
  59356. p.attachShader(i, n),
  59357. p.attachShader(i, r),
  59358. p.linkProgram(i),
  59359. i
  59360. );
  59361. }
  59362. var o,
  59363. a,
  59364. s,
  59365. l,
  59366. c,
  59367. h,
  59368. u,
  59369. d,
  59370. p = e.context,
  59371. f = e.state;
  59372. this.render = function (r, g, m) {
  59373. if (0 !== t.length) {
  59374. var v = new n.Vector3(),
  59375. A = m.w / m.z,
  59376. y = 0.5 * m.z,
  59377. C = 0.5 * m.w,
  59378. I = 16 / m.w,
  59379. E = new n.Vector2(I * A, I),
  59380. b = new n.Vector3(1, 1, 0),
  59381. w = new n.Vector2(1, 1);
  59382. void 0 === s && i(),
  59383. p.useProgram(s),
  59384. f.initAttributes(),
  59385. f.enableAttribute(l.vertex),
  59386. f.enableAttribute(l.uv),
  59387. f.disableUnusedAttributes(),
  59388. p.uniform1i(c.occlusionMap, 0),
  59389. p.uniform1i(c.map, 1),
  59390. p.bindBuffer(p.ARRAY_BUFFER, o),
  59391. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  59392. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  59393. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59394. f.disable(p.CULL_FACE),
  59395. f.setDepthWrite(!1);
  59396. for (var _ = 0, T = t.length; _ < T; _++) {
  59397. (I = 16 / m.w), E.set(I * A, I);
  59398. var x = t[_];
  59399. if (
  59400. (v.set(
  59401. x.matrixWorld.elements[12],
  59402. x.matrixWorld.elements[13],
  59403. x.matrixWorld.elements[14]
  59404. ),
  59405. v.applyMatrix4(g.matrixWorldInverse),
  59406. v.applyProjection(g.projectionMatrix),
  59407. b.copy(v),
  59408. (w.x = b.x * y + y),
  59409. (w.y = b.y * C + C),
  59410. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  59411. ) {
  59412. f.activeTexture(p.TEXTURE0),
  59413. f.bindTexture(p.TEXTURE_2D, null),
  59414. f.activeTexture(p.TEXTURE1),
  59415. f.bindTexture(p.TEXTURE_2D, u),
  59416. p.copyTexImage2D(
  59417. p.TEXTURE_2D,
  59418. 0,
  59419. p.RGB,
  59420. m.x + w.x - 8,
  59421. m.y + w.y - 8,
  59422. 16,
  59423. 16,
  59424. 0
  59425. ),
  59426. p.uniform1i(c.renderType, 0),
  59427. p.uniform2f(c.scale, E.x, E.y),
  59428. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59429. f.disable(p.BLEND),
  59430. f.enable(p.DEPTH_TEST),
  59431. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59432. f.activeTexture(p.TEXTURE0),
  59433. f.bindTexture(p.TEXTURE_2D, d),
  59434. p.copyTexImage2D(
  59435. p.TEXTURE_2D,
  59436. 0,
  59437. p.RGBA,
  59438. m.x + w.x - 8,
  59439. m.y + w.y - 8,
  59440. 16,
  59441. 16,
  59442. 0
  59443. ),
  59444. p.uniform1i(c.renderType, 1),
  59445. f.disable(p.DEPTH_TEST),
  59446. f.activeTexture(p.TEXTURE1),
  59447. f.bindTexture(p.TEXTURE_2D, u),
  59448. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59449. x.positionScreen.copy(b),
  59450. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  59451. p.uniform1i(c.renderType, 2),
  59452. f.enable(p.BLEND);
  59453. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  59454. var R = x.lensFlares[S];
  59455. R.opacity > 0.001 &&
  59456. R.scale > 0.001 &&
  59457. ((b.x = R.x),
  59458. (b.y = R.y),
  59459. (b.z = R.z),
  59460. (I = (R.size * R.scale) / m.w),
  59461. (E.x = I * A),
  59462. (E.y = I),
  59463. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59464. p.uniform2f(c.scale, E.x, E.y),
  59465. p.uniform1f(c.rotation, R.rotation),
  59466. p.uniform1f(c.opacity, R.opacity),
  59467. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  59468. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  59469. e.setTexture(R.texture, 1),
  59470. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0));
  59471. }
  59472. }
  59473. }
  59474. f.enable(p.CULL_FACE),
  59475. f.enable(p.DEPTH_TEST),
  59476. f.setDepthWrite(!0),
  59477. e.resetGLState();
  59478. }
  59479. };
  59480. }),
  59481. (n.SpritePlugin = function (e, t) {
  59482. function i() {
  59483. var e = new Float32Array([
  59484. -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1,
  59485. ]),
  59486. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  59487. (a = d.createBuffer()),
  59488. (s = d.createBuffer()),
  59489. d.bindBuffer(d.ARRAY_BUFFER, a),
  59490. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  59491. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59492. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  59493. (l = r()),
  59494. (c = {
  59495. position: d.getAttribLocation(l, 'position'),
  59496. uv: d.getAttribLocation(l, 'uv'),
  59497. }),
  59498. (h = {
  59499. uvOffset: d.getUniformLocation(l, 'uvOffset'),
  59500. uvScale: d.getUniformLocation(l, 'uvScale'),
  59501. rotation: d.getUniformLocation(l, 'rotation'),
  59502. scale: d.getUniformLocation(l, 'scale'),
  59503. color: d.getUniformLocation(l, 'color'),
  59504. map: d.getUniformLocation(l, 'map'),
  59505. opacity: d.getUniformLocation(l, 'opacity'),
  59506. modelViewMatrix: d.getUniformLocation(l, 'modelViewMatrix'),
  59507. projectionMatrix: d.getUniformLocation(l, 'projectionMatrix'),
  59508. fogType: d.getUniformLocation(l, 'fogType'),
  59509. fogDensity: d.getUniformLocation(l, 'fogDensity'),
  59510. fogNear: d.getUniformLocation(l, 'fogNear'),
  59511. fogFar: d.getUniformLocation(l, 'fogFar'),
  59512. fogColor: d.getUniformLocation(l, 'fogColor'),
  59513. alphaTest: d.getUniformLocation(l, 'alphaTest'),
  59514. });
  59515. var i = document.createElement('canvas');
  59516. (i.width = 8), (i.height = 8);
  59517. var o = i.getContext('2d');
  59518. (o.fillStyle = 'white'),
  59519. o.fillRect(0, 0, 8, 8),
  59520. (u = new n.Texture(i)),
  59521. (u.needsUpdate = !0);
  59522. }
  59523. function r() {
  59524. var t = d.createProgram(),
  59525. i = d.createShader(d.VERTEX_SHADER),
  59526. n = d.createShader(d.FRAGMENT_SHADER);
  59527. return (
  59528. d.shaderSource(
  59529. i,
  59530. [
  59531. 'precision ' + e.getPrecision() + ' float;',
  59532. 'uniform mat4 modelViewMatrix;',
  59533. 'uniform mat4 projectionMatrix;',
  59534. 'uniform float rotation;',
  59535. 'uniform vec2 scale;',
  59536. 'uniform vec2 uvOffset;',
  59537. 'uniform vec2 uvScale;',
  59538. 'attribute vec2 position;',
  59539. 'attribute vec2 uv;',
  59540. 'varying vec2 vUV;',
  59541. 'void main() {',
  59542. 'vUV = uvOffset + uv * uvScale;',
  59543. 'vec2 alignedPosition = position * scale;',
  59544. 'vec2 rotatedPosition;',
  59545. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  59546. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  59547. 'vec4 finalPosition;',
  59548. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  59549. 'finalPosition.xy += rotatedPosition;',
  59550. 'finalPosition = projectionMatrix * finalPosition;',
  59551. 'gl_Position = finalPosition;',
  59552. '}',
  59553. ].join('\n')
  59554. ),
  59555. d.shaderSource(
  59556. n,
  59557. [
  59558. 'precision ' + e.getPrecision() + ' float;',
  59559. 'uniform vec3 color;',
  59560. 'uniform sampler2D map;',
  59561. 'uniform float opacity;',
  59562. 'uniform int fogType;',
  59563. 'uniform vec3 fogColor;',
  59564. 'uniform float fogDensity;',
  59565. 'uniform float fogNear;',
  59566. 'uniform float fogFar;',
  59567. 'uniform float alphaTest;',
  59568. 'varying vec2 vUV;',
  59569. 'void main() {',
  59570. 'vec4 texture = texture2D( map, vUV );',
  59571. 'if ( texture.a < alphaTest ) discard;',
  59572. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  59573. 'if ( fogType > 0 ) {',
  59574. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  59575. 'float fogFactor = 0.0;',
  59576. 'if ( fogType == 1 ) {',
  59577. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  59578. '} else {',
  59579. 'const float LOG2 = 1.442695;',
  59580. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  59581. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  59582. '}',
  59583. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  59584. '}',
  59585. '}',
  59586. ].join('\n')
  59587. ),
  59588. d.compileShader(i),
  59589. d.compileShader(n),
  59590. d.attachShader(t, i),
  59591. d.attachShader(t, n),
  59592. d.linkProgram(t),
  59593. t
  59594. );
  59595. }
  59596. function o(e, t) {
  59597. return e.renderOrder !== t.renderOrder
  59598. ? e.renderOrder - t.renderOrder
  59599. : e.z !== t.z
  59600. ? t.z - e.z
  59601. : t.id - e.id;
  59602. }
  59603. var a,
  59604. s,
  59605. l,
  59606. c,
  59607. h,
  59608. u,
  59609. d = e.context,
  59610. p = e.state,
  59611. f = new n.Vector3(),
  59612. g = new n.Quaternion(),
  59613. m = new n.Vector3();
  59614. this.render = function (r, v) {
  59615. if (0 !== t.length) {
  59616. void 0 === l && i(),
  59617. d.useProgram(l),
  59618. p.initAttributes(),
  59619. p.enableAttribute(c.position),
  59620. p.enableAttribute(c.uv),
  59621. p.disableUnusedAttributes(),
  59622. p.disable(d.CULL_FACE),
  59623. p.enable(d.BLEND),
  59624. d.bindBuffer(d.ARRAY_BUFFER, a),
  59625. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  59626. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  59627. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59628. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  59629. p.activeTexture(d.TEXTURE0),
  59630. d.uniform1i(h.map, 0);
  59631. var A = 0,
  59632. y = 0,
  59633. C = r.fog;
  59634. C
  59635. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  59636. C instanceof n.Fog
  59637. ? (d.uniform1f(h.fogNear, C.near),
  59638. d.uniform1f(h.fogFar, C.far),
  59639. d.uniform1i(h.fogType, 1),
  59640. (A = 1),
  59641. (y = 1))
  59642. : C instanceof n.FogExp2 &&
  59643. (d.uniform1f(h.fogDensity, C.density),
  59644. d.uniform1i(h.fogType, 2),
  59645. (A = 2),
  59646. (y = 2)))
  59647. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0));
  59648. for (var I = 0, E = t.length; I < E; I++) {
  59649. var b = t[I];
  59650. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  59651. (b.z = -b.modelViewMatrix.elements[14]);
  59652. }
  59653. t.sort(o);
  59654. for (var w = [], I = 0, E = t.length; I < E; I++) {
  59655. var b = t[I],
  59656. _ = b.material;
  59657. d.uniform1f(h.alphaTest, _.alphaTest),
  59658. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  59659. b.matrixWorld.decompose(f, g, m),
  59660. (w[0] = m.x),
  59661. (w[1] = m.y);
  59662. var T = 0;
  59663. r.fog && _.fog && (T = y),
  59664. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  59665. null !== _.map
  59666. ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  59667. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  59668. : (d.uniform2f(h.uvOffset, 0, 0), d.uniform2f(h.uvScale, 1, 1)),
  59669. d.uniform1f(h.opacity, _.opacity),
  59670. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  59671. d.uniform1f(h.rotation, _.rotation),
  59672. d.uniform2fv(h.scale, w),
  59673. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  59674. p.setDepthTest(_.depthTest),
  59675. p.setDepthWrite(_.depthWrite),
  59676. _.map && _.map.image && _.map.image.width
  59677. ? e.setTexture(_.map, 0)
  59678. : e.setTexture(u, 0),
  59679. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0);
  59680. }
  59681. p.enable(d.CULL_FACE), e.resetGLState();
  59682. }
  59683. };
  59684. }),
  59685. Object.defineProperties(n.Box2.prototype, {
  59686. empty: {
  59687. value: function () {
  59688. return (
  59689. console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'),
  59690. this.isEmpty()
  59691. );
  59692. },
  59693. },
  59694. isIntersectionBox: {
  59695. value: function (e) {
  59696. return (
  59697. console.warn(
  59698. 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'
  59699. ),
  59700. this.intersectsBox(e)
  59701. );
  59702. },
  59703. },
  59704. }),
  59705. Object.defineProperties(n.Box3.prototype, {
  59706. empty: {
  59707. value: function () {
  59708. return (
  59709. console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'),
  59710. this.isEmpty()
  59711. );
  59712. },
  59713. },
  59714. isIntersectionBox: {
  59715. value: function (e) {
  59716. return (
  59717. console.warn(
  59718. 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'
  59719. ),
  59720. this.intersectsBox(e)
  59721. );
  59722. },
  59723. },
  59724. isIntersectionSphere: {
  59725. value: function (e) {
  59726. return (
  59727. console.warn(
  59728. 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  59729. ),
  59730. this.intersectsSphere(e)
  59731. );
  59732. },
  59733. },
  59734. }),
  59735. Object.defineProperties(n.Matrix3.prototype, {
  59736. multiplyVector3: {
  59737. value: function (e) {
  59738. return (
  59739. console.warn(
  59740. 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'
  59741. ),
  59742. e.applyMatrix3(this)
  59743. );
  59744. },
  59745. },
  59746. multiplyVector3Array: {
  59747. value: function (e) {
  59748. return (
  59749. console.warn(
  59750. 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59751. ),
  59752. this.applyToVector3Array(e)
  59753. );
  59754. },
  59755. },
  59756. }),
  59757. Object.defineProperties(n.Matrix4.prototype, {
  59758. extractPosition: {
  59759. value: function (e) {
  59760. return (
  59761. console.warn(
  59762. 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'
  59763. ),
  59764. this.copyPosition(e)
  59765. );
  59766. },
  59767. },
  59768. setRotationFromQuaternion: {
  59769. value: function (e) {
  59770. return (
  59771. console.warn(
  59772. 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'
  59773. ),
  59774. this.makeRotationFromQuaternion(e)
  59775. );
  59776. },
  59777. },
  59778. multiplyVector3: {
  59779. value: function (e) {
  59780. return (
  59781. console.warn(
  59782. 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'
  59783. ),
  59784. e.applyProjection(this)
  59785. );
  59786. },
  59787. },
  59788. multiplyVector4: {
  59789. value: function (e) {
  59790. return (
  59791. console.warn(
  59792. 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59793. ),
  59794. e.applyMatrix4(this)
  59795. );
  59796. },
  59797. },
  59798. multiplyVector3Array: {
  59799. value: function (e) {
  59800. return (
  59801. console.warn(
  59802. 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59803. ),
  59804. this.applyToVector3Array(e)
  59805. );
  59806. },
  59807. },
  59808. rotateAxis: {
  59809. value: function (e) {
  59810. console.warn(
  59811. 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'
  59812. ),
  59813. e.transformDirection(this);
  59814. },
  59815. },
  59816. crossVector: {
  59817. value: function (e) {
  59818. return (
  59819. console.warn(
  59820. 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59821. ),
  59822. e.applyMatrix4(this)
  59823. );
  59824. },
  59825. },
  59826. translate: {
  59827. value: function (e) {
  59828. console.error('THREE.Matrix4: .translate() has been removed.');
  59829. },
  59830. },
  59831. rotateX: {
  59832. value: function (e) {
  59833. console.error('THREE.Matrix4: .rotateX() has been removed.');
  59834. },
  59835. },
  59836. rotateY: {
  59837. value: function (e) {
  59838. console.error('THREE.Matrix4: .rotateY() has been removed.');
  59839. },
  59840. },
  59841. rotateZ: {
  59842. value: function (e) {
  59843. console.error('THREE.Matrix4: .rotateZ() has been removed.');
  59844. },
  59845. },
  59846. rotateByAxis: {
  59847. value: function (e, t) {
  59848. console.error('THREE.Matrix4: .rotateByAxis() has been removed.');
  59849. },
  59850. },
  59851. }),
  59852. Object.defineProperties(n.Plane.prototype, {
  59853. isIntersectionLine: {
  59854. value: function (e) {
  59855. return (
  59856. console.warn(
  59857. 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'
  59858. ),
  59859. this.intersectsLine(e)
  59860. );
  59861. },
  59862. },
  59863. }),
  59864. Object.defineProperties(n.Quaternion.prototype, {
  59865. multiplyVector3: {
  59866. value: function (e) {
  59867. return (
  59868. console.warn(
  59869. 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'
  59870. ),
  59871. e.applyQuaternion(this)
  59872. );
  59873. },
  59874. },
  59875. }),
  59876. Object.defineProperties(n.Ray.prototype, {
  59877. isIntersectionBox: {
  59878. value: function (e) {
  59879. return (
  59880. console.warn(
  59881. 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'
  59882. ),
  59883. this.intersectsBox(e)
  59884. );
  59885. },
  59886. },
  59887. isIntersectionPlane: {
  59888. value: function (e) {
  59889. return (
  59890. console.warn(
  59891. 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'
  59892. ),
  59893. this.intersectsPlane(e)
  59894. );
  59895. },
  59896. },
  59897. isIntersectionSphere: {
  59898. value: function (e) {
  59899. return (
  59900. console.warn(
  59901. 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  59902. ),
  59903. this.intersectsSphere(e)
  59904. );
  59905. },
  59906. },
  59907. }),
  59908. Object.defineProperties(n.Vector3.prototype, {
  59909. setEulerFromRotationMatrix: {
  59910. value: function () {
  59911. console.error(
  59912. 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.'
  59913. );
  59914. },
  59915. },
  59916. setEulerFromQuaternion: {
  59917. value: function () {
  59918. console.error(
  59919. 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.'
  59920. );
  59921. },
  59922. },
  59923. getPositionFromMatrix: {
  59924. value: function (e) {
  59925. return (
  59926. console.warn(
  59927. 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'
  59928. ),
  59929. this.setFromMatrixPosition(e)
  59930. );
  59931. },
  59932. },
  59933. getScaleFromMatrix: {
  59934. value: function (e) {
  59935. return (
  59936. console.warn(
  59937. 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'
  59938. ),
  59939. this.setFromMatrixScale(e)
  59940. );
  59941. },
  59942. },
  59943. getColumnFromMatrix: {
  59944. value: function (e, t) {
  59945. return (
  59946. console.warn(
  59947. 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'
  59948. ),
  59949. this.setFromMatrixColumn(e, t)
  59950. );
  59951. },
  59952. },
  59953. }),
  59954. (n.Face4 = function (e, t, i, r, o, a, s) {
  59955. return (
  59956. console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'),
  59957. new n.Face3(e, t, i, o, a, s)
  59958. );
  59959. }),
  59960. (n.Vertex = function (e, t, i) {
  59961. return (
  59962. console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),
  59963. new n.Vector3(e, t, i)
  59964. );
  59965. }),
  59966. Object.defineProperties(n.Object3D.prototype, {
  59967. eulerOrder: {
  59968. get: function () {
  59969. return (
  59970. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  59971. this.rotation.order
  59972. );
  59973. },
  59974. set: function (e) {
  59975. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  59976. (this.rotation.order = e);
  59977. },
  59978. },
  59979. getChildByName: {
  59980. value: function (e) {
  59981. return (
  59982. console.warn(
  59983. 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'
  59984. ),
  59985. this.getObjectByName(e)
  59986. );
  59987. },
  59988. },
  59989. renderDepth: {
  59990. set: function (e) {
  59991. console.warn(
  59992. 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.'
  59993. );
  59994. },
  59995. },
  59996. translate: {
  59997. value: function (e, t) {
  59998. return (
  59999. console.warn(
  60000. 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'
  60001. ),
  60002. this.translateOnAxis(t, e)
  60003. );
  60004. },
  60005. },
  60006. useQuaternion: {
  60007. get: function () {
  60008. console.warn(
  60009. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60010. );
  60011. },
  60012. set: function (e) {
  60013. console.warn(
  60014. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60015. );
  60016. },
  60017. },
  60018. }),
  60019. Object.defineProperties(n, {
  60020. PointCloud: {
  60021. value: function (e, t) {
  60022. return (
  60023. console.warn('THREE.PointCloud has been renamed to THREE.Points.'),
  60024. new n.Points(e, t)
  60025. );
  60026. },
  60027. },
  60028. ParticleSystem: {
  60029. value: function (e, t) {
  60030. return (
  60031. console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),
  60032. new n.Points(e, t)
  60033. );
  60034. },
  60035. },
  60036. }),
  60037. Object.defineProperties(n.Light.prototype, {
  60038. onlyShadow: {
  60039. set: function (e) {
  60040. console.warn('THREE.Light: .onlyShadow has been removed.');
  60041. },
  60042. },
  60043. shadowCameraFov: {
  60044. set: function (e) {
  60045. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'),
  60046. (this.shadow.camera.fov = e);
  60047. },
  60048. },
  60049. shadowCameraLeft: {
  60050. set: function (e) {
  60051. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'),
  60052. (this.shadow.camera.left = e);
  60053. },
  60054. },
  60055. shadowCameraRight: {
  60056. set: function (e) {
  60057. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'),
  60058. (this.shadow.camera.right = e);
  60059. },
  60060. },
  60061. shadowCameraTop: {
  60062. set: function (e) {
  60063. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'),
  60064. (this.shadow.camera.top = e);
  60065. },
  60066. },
  60067. shadowCameraBottom: {
  60068. set: function (e) {
  60069. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'),
  60070. (this.shadow.camera.bottom = e);
  60071. },
  60072. },
  60073. shadowCameraNear: {
  60074. set: function (e) {
  60075. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'),
  60076. (this.shadow.camera.near = e);
  60077. },
  60078. },
  60079. shadowCameraFar: {
  60080. set: function (e) {
  60081. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'),
  60082. (this.shadow.camera.far = e);
  60083. },
  60084. },
  60085. shadowCameraVisible: {
  60086. set: function (e) {
  60087. console.warn(
  60088. 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.'
  60089. );
  60090. },
  60091. },
  60092. shadowBias: {
  60093. set: function (e) {
  60094. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'),
  60095. (this.shadow.bias = e);
  60096. },
  60097. },
  60098. shadowDarkness: {
  60099. set: function (e) {
  60100. console.warn('THREE.Light: .shadowDarkness has been removed.');
  60101. },
  60102. },
  60103. shadowMapWidth: {
  60104. set: function (e) {
  60105. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'),
  60106. (this.shadow.mapSize.width = e);
  60107. },
  60108. },
  60109. shadowMapHeight: {
  60110. set: function (e) {
  60111. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'),
  60112. (this.shadow.mapSize.height = e);
  60113. },
  60114. },
  60115. }),
  60116. Object.defineProperties(n.BufferAttribute.prototype, {
  60117. length: {
  60118. get: function () {
  60119. return (
  60120. console.warn(
  60121. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  60122. ),
  60123. this.array.length
  60124. );
  60125. },
  60126. },
  60127. }),
  60128. Object.defineProperties(n.BufferGeometry.prototype, {
  60129. drawcalls: {
  60130. get: function () {
  60131. return (
  60132. console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'),
  60133. this.groups
  60134. );
  60135. },
  60136. },
  60137. offsets: {
  60138. get: function () {
  60139. return (
  60140. console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'),
  60141. this.groups
  60142. );
  60143. },
  60144. },
  60145. addIndex: {
  60146. value: function (e) {
  60147. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'),
  60148. this.setIndex(e);
  60149. },
  60150. },
  60151. addDrawCall: {
  60152. value: function (e, t, i) {
  60153. void 0 !== i &&
  60154. console.warn(
  60155. 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'
  60156. ),
  60157. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  60158. this.addGroup(e, t);
  60159. },
  60160. },
  60161. clearDrawCalls: {
  60162. value: function () {
  60163. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'),
  60164. this.clearGroups();
  60165. },
  60166. },
  60167. computeTangents: {
  60168. value: function () {
  60169. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.');
  60170. },
  60171. },
  60172. computeOffsets: {
  60173. value: function () {
  60174. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.');
  60175. },
  60176. },
  60177. }),
  60178. Object.defineProperties(n.Material.prototype, {
  60179. wrapAround: {
  60180. get: function () {
  60181. console.warn('THREE.' + this.type + ': .wrapAround has been removed.');
  60182. },
  60183. set: function (e) {
  60184. console.warn('THREE.' + this.type + ': .wrapAround has been removed.');
  60185. },
  60186. },
  60187. wrapRGB: {
  60188. get: function () {
  60189. return (
  60190. console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new n.Color()
  60191. );
  60192. },
  60193. },
  60194. }),
  60195. Object.defineProperties(n, {
  60196. PointCloudMaterial: {
  60197. value: function (e) {
  60198. return (
  60199. console.warn(
  60200. 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'
  60201. ),
  60202. new n.PointsMaterial(e)
  60203. );
  60204. },
  60205. },
  60206. ParticleBasicMaterial: {
  60207. value: function (e) {
  60208. return (
  60209. console.warn(
  60210. 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'
  60211. ),
  60212. new n.PointsMaterial(e)
  60213. );
  60214. },
  60215. },
  60216. ParticleSystemMaterial: {
  60217. value: function (e) {
  60218. return (
  60219. console.warn(
  60220. 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'
  60221. ),
  60222. new n.PointsMaterial(e)
  60223. );
  60224. },
  60225. },
  60226. }),
  60227. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  60228. metal: {
  60229. get: function () {
  60230. return (
  60231. console.warn(
  60232. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'
  60233. ),
  60234. !1
  60235. );
  60236. },
  60237. set: function (e) {
  60238. console.warn(
  60239. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead'
  60240. );
  60241. },
  60242. },
  60243. }),
  60244. Object.defineProperties(n.ShaderMaterial.prototype, {
  60245. derivatives: {
  60246. get: function () {
  60247. return (
  60248. console.warn(
  60249. 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60250. ),
  60251. this.extensions.derivatives
  60252. );
  60253. },
  60254. set: function (e) {
  60255. console.warn(
  60256. 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60257. ),
  60258. (this.extensions.derivatives = e);
  60259. },
  60260. },
  60261. }),
  60262. Object.defineProperties(n.WebGLRenderer.prototype, {
  60263. supportsFloatTextures: {
  60264. value: function () {
  60265. return (
  60266. console.warn(
  60267. "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
  60268. ),
  60269. this.extensions.get('OES_texture_float')
  60270. );
  60271. },
  60272. },
  60273. supportsHalfFloatTextures: {
  60274. value: function () {
  60275. return (
  60276. console.warn(
  60277. "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
  60278. ),
  60279. this.extensions.get('OES_texture_half_float')
  60280. );
  60281. },
  60282. },
  60283. supportsStandardDerivatives: {
  60284. value: function () {
  60285. return (
  60286. console.warn(
  60287. "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
  60288. ),
  60289. this.extensions.get('OES_standard_derivatives')
  60290. );
  60291. },
  60292. },
  60293. supportsCompressedTextureS3TC: {
  60294. value: function () {
  60295. return (
  60296. console.warn(
  60297. "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
  60298. ),
  60299. this.extensions.get('WEBGL_compressed_texture_s3tc')
  60300. );
  60301. },
  60302. },
  60303. supportsCompressedTexturePVRTC: {
  60304. value: function () {
  60305. return (
  60306. console.warn(
  60307. "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
  60308. ),
  60309. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  60310. );
  60311. },
  60312. },
  60313. supportsBlendMinMax: {
  60314. value: function () {
  60315. return (
  60316. console.warn(
  60317. "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
  60318. ),
  60319. this.extensions.get('EXT_blend_minmax')
  60320. );
  60321. },
  60322. },
  60323. supportsVertexTextures: {
  60324. value: function () {
  60325. return this.capabilities.vertexTextures;
  60326. },
  60327. },
  60328. supportsInstancedArrays: {
  60329. value: function () {
  60330. return (
  60331. console.warn(
  60332. "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."
  60333. ),
  60334. this.extensions.get('ANGLE_instanced_arrays')
  60335. );
  60336. },
  60337. },
  60338. enableScissorTest: {
  60339. value: function (e) {
  60340. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'),
  60341. this.setScissorTest(e);
  60342. },
  60343. },
  60344. initMaterial: {
  60345. value: function () {
  60346. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.');
  60347. },
  60348. },
  60349. addPrePlugin: {
  60350. value: function () {
  60351. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.');
  60352. },
  60353. },
  60354. addPostPlugin: {
  60355. value: function () {
  60356. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.');
  60357. },
  60358. },
  60359. updateShadowMap: {
  60360. value: function () {
  60361. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.');
  60362. },
  60363. },
  60364. shadowMapEnabled: {
  60365. get: function () {
  60366. return this.shadowMap.enabled;
  60367. },
  60368. set: function (e) {
  60369. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'),
  60370. (this.shadowMap.enabled = e);
  60371. },
  60372. },
  60373. shadowMapType: {
  60374. get: function () {
  60375. return this.shadowMap.type;
  60376. },
  60377. set: function (e) {
  60378. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'),
  60379. (this.shadowMap.type = e);
  60380. },
  60381. },
  60382. shadowMapCullFace: {
  60383. get: function () {
  60384. return this.shadowMap.cullFace;
  60385. },
  60386. set: function (e) {
  60387. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'),
  60388. (this.shadowMap.cullFace = e);
  60389. },
  60390. },
  60391. }),
  60392. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  60393. wrapS: {
  60394. get: function () {
  60395. return (
  60396. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60397. this.texture.wrapS
  60398. );
  60399. },
  60400. set: function (e) {
  60401. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60402. (this.texture.wrapS = e);
  60403. },
  60404. },
  60405. wrapT: {
  60406. get: function () {
  60407. return (
  60408. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60409. this.texture.wrapT
  60410. );
  60411. },
  60412. set: function (e) {
  60413. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60414. (this.texture.wrapT = e);
  60415. },
  60416. },
  60417. magFilter: {
  60418. get: function () {
  60419. return (
  60420. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60421. this.texture.magFilter
  60422. );
  60423. },
  60424. set: function (e) {
  60425. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60426. (this.texture.magFilter = e);
  60427. },
  60428. },
  60429. minFilter: {
  60430. get: function () {
  60431. return (
  60432. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60433. this.texture.minFilter
  60434. );
  60435. },
  60436. set: function (e) {
  60437. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60438. (this.texture.minFilter = e);
  60439. },
  60440. },
  60441. anisotropy: {
  60442. get: function () {
  60443. return (
  60444. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60445. this.texture.anisotropy
  60446. );
  60447. },
  60448. set: function (e) {
  60449. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60450. (this.texture.anisotropy = e);
  60451. },
  60452. },
  60453. offset: {
  60454. get: function () {
  60455. return (
  60456. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60457. this.texture.offset
  60458. );
  60459. },
  60460. set: function (e) {
  60461. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60462. (this.texture.offset = e);
  60463. },
  60464. },
  60465. repeat: {
  60466. get: function () {
  60467. return (
  60468. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60469. this.texture.repeat
  60470. );
  60471. },
  60472. set: function (e) {
  60473. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60474. (this.texture.repeat = e);
  60475. },
  60476. },
  60477. format: {
  60478. get: function () {
  60479. return (
  60480. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60481. this.texture.format
  60482. );
  60483. },
  60484. set: function (e) {
  60485. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60486. (this.texture.format = e);
  60487. },
  60488. },
  60489. type: {
  60490. get: function () {
  60491. return (
  60492. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60493. this.texture.type
  60494. );
  60495. },
  60496. set: function (e) {
  60497. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60498. (this.texture.type = e);
  60499. },
  60500. },
  60501. generateMipmaps: {
  60502. get: function () {
  60503. return (
  60504. console.warn(
  60505. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60506. ),
  60507. this.texture.generateMipmaps
  60508. );
  60509. },
  60510. set: function (e) {
  60511. console.warn(
  60512. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60513. ),
  60514. (this.texture.generateMipmaps = e);
  60515. },
  60516. },
  60517. }),
  60518. (n.GeometryUtils = {
  60519. merge: function (e, t, i) {
  60520. console.warn(
  60521. 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'
  60522. );
  60523. var r;
  60524. t instanceof n.Mesh &&
  60525. (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)),
  60526. e.merge(t, r, i);
  60527. },
  60528. center: function (e) {
  60529. return (
  60530. console.warn(
  60531. 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'
  60532. ),
  60533. e.center()
  60534. );
  60535. },
  60536. }),
  60537. (n.ImageUtils = {
  60538. crossOrigin: void 0,
  60539. loadTexture: function (e, t, i, r) {
  60540. console.warn(
  60541. 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.'
  60542. );
  60543. var o = new n.TextureLoader();
  60544. o.setCrossOrigin(this.crossOrigin);
  60545. var a = o.load(e, i, void 0, r);
  60546. return t && (a.mapping = t), a;
  60547. },
  60548. loadTextureCube: function (e, t, i, r) {
  60549. console.warn(
  60550. 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.'
  60551. );
  60552. var o = new n.CubeTextureLoader();
  60553. o.setCrossOrigin(this.crossOrigin);
  60554. var a = o.load(e, i, void 0, r);
  60555. return t && (a.mapping = t), a;
  60556. },
  60557. loadCompressedTexture: function () {
  60558. console.error(
  60559. 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.'
  60560. );
  60561. },
  60562. loadCompressedTextureCube: function () {
  60563. console.error(
  60564. 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.'
  60565. );
  60566. },
  60567. }),
  60568. (n.Projector = function () {
  60569. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  60570. (this.projectVector = function (e, t) {
  60571. console.warn('THREE.Projector: .projectVector() is now vector.project().'),
  60572. e.project(t);
  60573. }),
  60574. (this.unprojectVector = function (e, t) {
  60575. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'),
  60576. e.unproject(t);
  60577. }),
  60578. (this.pickingRay = function (e, t) {
  60579. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().');
  60580. });
  60581. }),
  60582. (n.CanvasRenderer = function () {
  60583. console.error(
  60584. 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'
  60585. ),
  60586. (this.domElement = document.createElement('canvas')),
  60587. (this.clear = function () {}),
  60588. (this.render = function () {}),
  60589. (this.setClearColor = function () {}),
  60590. (this.setSize = function () {});
  60591. }),
  60592. (n.MeshFaceMaterial = n.MultiMaterial),
  60593. (n.CurveUtils = {
  60594. tangentQuadraticBezier: function (e, t, i, n) {
  60595. return 2 * (1 - e) * (i - t) + 2 * e * (n - i);
  60596. },
  60597. tangentCubicBezier: function (e, t, i, n, r) {
  60598. return (
  60599. -3 * t * (1 - e) * (1 - e) +
  60600. 3 * i * (1 - e) * (1 - e) -
  60601. 6 * e * i * (1 - e) +
  60602. 6 * e * n * (1 - e) -
  60603. 3 * e * e * n +
  60604. 3 * e * e * r
  60605. );
  60606. },
  60607. tangentSpline: function (e, t, i, n, r) {
  60608. var o = 6 * e * e - 6 * e,
  60609. a = 3 * e * e - 4 * e + 1,
  60610. s = -6 * e * e + 6 * e,
  60611. l = 3 * e * e - 2 * e;
  60612. return o + a + s + l;
  60613. },
  60614. interpolate: function (e, t, i, n, r) {
  60615. var o = 0.5 * (i - e),
  60616. a = 0.5 * (n - t),
  60617. s = r * r,
  60618. l = r * s;
  60619. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t;
  60620. },
  60621. }),
  60622. (n.SceneUtils = {
  60623. createMultiMaterialObject: function (e, t) {
  60624. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++)
  60625. i.add(new n.Mesh(e, t[r]));
  60626. return i;
  60627. },
  60628. detach: function (e, t, i) {
  60629. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e);
  60630. },
  60631. attach: function (e, t, i) {
  60632. var r = new n.Matrix4();
  60633. r.getInverse(i.matrixWorld), e.applyMatrix(r), t.remove(e), i.add(e);
  60634. },
  60635. }),
  60636. (n.ShapeUtils = {
  60637. area: function (e) {
  60638. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  60639. i += e[n].x * e[r].y - e[r].x * e[n].y;
  60640. return 0.5 * i;
  60641. },
  60642. triangulate: (function () {
  60643. function e(e, t, i, n, r, o) {
  60644. var a, s, l, c, h, u, d, p, f;
  60645. if (
  60646. ((s = e[o[t]].x),
  60647. (l = e[o[t]].y),
  60648. (c = e[o[i]].x),
  60649. (h = e[o[i]].y),
  60650. (u = e[o[n]].x),
  60651. (d = e[o[n]].y),
  60652. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  60653. )
  60654. return !1;
  60655. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  60656. for (
  60657. g = u - c, m = d - h, v = s - u, A = l - d, y = c - s, C = h - l, a = 0;
  60658. a < r;
  60659. a++
  60660. )
  60661. if (
  60662. ((p = e[o[a]].x),
  60663. (f = e[o[a]].y),
  60664. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  60665. ((I = p - s),
  60666. (E = f - l),
  60667. (b = p - c),
  60668. (w = f - h),
  60669. (_ = p - u),
  60670. (T = f - d),
  60671. (M = g * w - m * b),
  60672. (x = y * E - C * I),
  60673. (S = v * T - A * _),
  60674. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  60675. )
  60676. return !1;
  60677. return !0;
  60678. }
  60679. return function (t, i) {
  60680. var r = t.length;
  60681. if (r < 3) return null;
  60682. var o,
  60683. a,
  60684. s,
  60685. l = [],
  60686. c = [],
  60687. h = [];
  60688. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a;
  60689. else for (a = 0; a < r; a++) c[a] = r - 1 - a;
  60690. var u = r,
  60691. d = 2 * u;
  60692. for (a = u - 1; u > 2; ) {
  60693. if (d-- <= 0)
  60694. return (
  60695. console.warn(
  60696. 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'
  60697. ),
  60698. i ? h : l
  60699. );
  60700. if (
  60701. ((o = a),
  60702. u <= o && (o = 0),
  60703. (a = o + 1),
  60704. u <= a && (a = 0),
  60705. (s = a + 1),
  60706. u <= s && (s = 0),
  60707. e(t, o, a, s, u, c))
  60708. ) {
  60709. var p, f, g, m, v;
  60710. for (
  60711. p = c[o],
  60712. f = c[a],
  60713. g = c[s],
  60714. l.push([t[p], t[f], t[g]]),
  60715. h.push([c[o], c[a], c[s]]),
  60716. m = a,
  60717. v = a + 1;
  60718. v < u;
  60719. m++, v++
  60720. )
  60721. c[m] = c[v];
  60722. u--, (d = 2 * u);
  60723. }
  60724. }
  60725. return i ? h : l;
  60726. };
  60727. })(),
  60728. triangulateShape: function (e, t) {
  60729. function i(e, t, i) {
  60730. return e.x !== t.x
  60731. ? e.x < t.x
  60732. ? e.x <= i.x && i.x <= t.x
  60733. : t.x <= i.x && i.x <= e.x
  60734. : e.y < t.y
  60735. ? e.y <= i.y && i.y <= t.y
  60736. : t.y <= i.y && i.y <= e.y;
  60737. }
  60738. function r(e, t, n, r, o) {
  60739. var a = t.x - e.x,
  60740. s = t.y - e.y,
  60741. l = r.x - n.x,
  60742. c = r.y - n.y,
  60743. h = e.x - n.x,
  60744. u = e.y - n.y,
  60745. d = s * l - a * c,
  60746. p = s * h - a * u;
  60747. if (Math.abs(d) > Number.EPSILON) {
  60748. var f;
  60749. if (d > 0) {
  60750. if (p < 0 || p > d) return [];
  60751. if (((f = c * h - l * u), f < 0 || f > d)) return [];
  60752. } else {
  60753. if (p > 0 || p < d) return [];
  60754. if (((f = c * h - l * u), f > 0 || f < d)) return [];
  60755. }
  60756. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : [];
  60757. if (f === d) return !o || (0 !== p && p !== d) ? [t] : [];
  60758. if (0 === p) return [n];
  60759. if (p === d) return [r];
  60760. var g = f / d;
  60761. return [
  60762. {
  60763. x: e.x + g * a,
  60764. y: e.y + g * s,
  60765. },
  60766. ];
  60767. }
  60768. if (0 !== p || c * h !== l * u) return [];
  60769. var m = 0 === a && 0 === s,
  60770. v = 0 === l && 0 === c;
  60771. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e];
  60772. if (m) return i(n, r, e) ? [e] : [];
  60773. if (v) return i(e, t, n) ? [n] : [];
  60774. var A, y, C, I, E, b, w, _;
  60775. return (
  60776. 0 !== a
  60777. ? (e.x < t.x
  60778. ? ((A = e), (C = e.x), (y = t), (I = t.x))
  60779. : ((A = t), (C = t.x), (y = e), (I = e.x)),
  60780. n.x < r.x
  60781. ? ((E = n), (w = n.x), (b = r), (_ = r.x))
  60782. : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  60783. : (e.y < t.y
  60784. ? ((A = e), (C = e.y), (y = t), (I = t.y))
  60785. : ((A = t), (C = t.y), (y = e), (I = e.y)),
  60786. n.y < r.y
  60787. ? ((E = n), (w = n.y), (b = r), (_ = r.y))
  60788. : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  60789. C <= w
  60790. ? I < w
  60791. ? []
  60792. : I === w
  60793. ? o
  60794. ? []
  60795. : [E]
  60796. : I <= _
  60797. ? [E, y]
  60798. : [E, b]
  60799. : C > _
  60800. ? []
  60801. : C === _
  60802. ? o
  60803. ? []
  60804. : [A]
  60805. : I <= _
  60806. ? [A, y]
  60807. : [A, b]
  60808. );
  60809. }
  60810. function o(e, t, i, n) {
  60811. var r = t.x - e.x,
  60812. o = t.y - e.y,
  60813. a = i.x - e.x,
  60814. s = i.y - e.y,
  60815. l = n.x - e.x,
  60816. c = n.y - e.y,
  60817. h = r * s - o * a,
  60818. u = r * c - o * l;
  60819. if (Math.abs(h) > Number.EPSILON) {
  60820. var d = l * s - c * a;
  60821. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0;
  60822. }
  60823. return u > 0;
  60824. }
  60825. function a(e, t) {
  60826. function i(e, t) {
  60827. var i = A.length - 1,
  60828. n = e - 1;
  60829. n < 0 && (n = i);
  60830. var r = e + 1;
  60831. r > i && (r = 0);
  60832. var a = o(A[e], A[n], A[r], s[t]);
  60833. if (!a) return !1;
  60834. var l = s.length - 1,
  60835. c = t - 1;
  60836. c < 0 && (c = l);
  60837. var h = t + 1;
  60838. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a;
  60839. }
  60840. function n(e, t) {
  60841. var i, n, o;
  60842. for (i = 0; i < A.length; i++)
  60843. if (((n = i + 1), (n %= A.length), (o = r(e, t, A[i], A[n], !0)), o.length > 0))
  60844. return !0;
  60845. return !1;
  60846. }
  60847. function a(e, i) {
  60848. var n, o, a, s, l;
  60849. for (n = 0; n < y.length; n++)
  60850. for (o = t[y[n]], a = 0; a < o.length; a++)
  60851. if (
  60852. ((s = a + 1), (s %= o.length), (l = r(e, i, o[a], o[s], !0)), l.length > 0)
  60853. )
  60854. return !0;
  60855. return !1;
  60856. }
  60857. for (
  60858. var s,
  60859. l,
  60860. c,
  60861. h,
  60862. u,
  60863. d,
  60864. p,
  60865. f,
  60866. g,
  60867. m,
  60868. v,
  60869. A = e.concat(),
  60870. y = [],
  60871. C = [],
  60872. I = 0,
  60873. E = t.length;
  60874. I < E;
  60875. I++
  60876. )
  60877. y.push(I);
  60878. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  60879. if ((w--, w < 0)) {
  60880. console.log(
  60881. 'Infinite Loop! Holes left:' + y.length + ', Probably Hole outside Shape!'
  60882. );
  60883. break;
  60884. }
  60885. for (c = b; c < A.length; c++) {
  60886. (h = A[c]), (l = -1);
  60887. for (var I = 0; I < y.length; I++)
  60888. if (((d = y[I]), (p = h.x + ':' + h.y + ':' + d), void 0 === C[p])) {
  60889. s = t[d];
  60890. for (var _ = 0; _ < s.length; _++)
  60891. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  60892. (l = _),
  60893. y.splice(I, 1),
  60894. (f = A.slice(0, c + 1)),
  60895. (g = A.slice(c)),
  60896. (m = s.slice(l)),
  60897. (v = s.slice(0, l + 1)),
  60898. (A = f.concat(m).concat(v).concat(g)),
  60899. (b = c);
  60900. break;
  60901. }
  60902. if (l >= 0) break;
  60903. C[p] = !0;
  60904. }
  60905. if (l >= 0) break;
  60906. }
  60907. }
  60908. return A;
  60909. }
  60910. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  60911. Array.prototype.push.apply(f, t[g]);
  60912. for (s = 0, l = f.length; s < l; s++)
  60913. (u = f[s].x + ':' + f[s].y),
  60914. void 0 !== p[u] && console.warn('THREE.Shape: Duplicate point', u),
  60915. (p[u] = s);
  60916. var v = a(e, t),
  60917. A = n.ShapeUtils.triangulate(v, !1);
  60918. for (s = 0, l = A.length; s < l; s++)
  60919. for (h = A[s], c = 0; c < 3; c++)
  60920. (u = h[c].x + ':' + h[c].y), (d = p[u]), void 0 !== d && (h[c] = d);
  60921. return A.concat();
  60922. },
  60923. isClockWise: function (e) {
  60924. return n.ShapeUtils.area(e) < 0;
  60925. },
  60926. b2: (function () {
  60927. function e(e, t) {
  60928. var i = 1 - e;
  60929. return i * i * t;
  60930. }
  60931. function t(e, t) {
  60932. return 2 * (1 - e) * e * t;
  60933. }
  60934. function i(e, t) {
  60935. return e * e * t;
  60936. }
  60937. return function (n, r, o, a) {
  60938. return e(n, r) + t(n, o) + i(n, a);
  60939. };
  60940. })(),
  60941. b3: (function () {
  60942. function e(e, t) {
  60943. var i = 1 - e;
  60944. return i * i * i * t;
  60945. }
  60946. function t(e, t) {
  60947. var i = 1 - e;
  60948. return 3 * i * i * e * t;
  60949. }
  60950. function i(e, t) {
  60951. var i = 1 - e;
  60952. return 3 * i * e * e * t;
  60953. }
  60954. function n(e, t) {
  60955. return e * e * e * t;
  60956. }
  60957. return function (r, o, a, s, l) {
  60958. return e(r, o) + t(r, a) + i(r, s) + n(r, l);
  60959. };
  60960. })(),
  60961. }),
  60962. (n.Curve = function () {}),
  60963. (n.Curve.prototype = {
  60964. constructor: n.Curve,
  60965. getPoint: function (e) {
  60966. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null;
  60967. },
  60968. getPointAt: function (e) {
  60969. var t = this.getUtoTmapping(e);
  60970. return this.getPoint(t);
  60971. },
  60972. getPoints: function (e) {
  60973. e || (e = 5);
  60974. var t,
  60975. i = [];
  60976. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e));
  60977. return i;
  60978. },
  60979. getSpacedPoints: function (e) {
  60980. e || (e = 5);
  60981. var t,
  60982. i = [];
  60983. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e));
  60984. return i;
  60985. },
  60986. getLength: function () {
  60987. var e = this.getLengths();
  60988. return e[e.length - 1];
  60989. },
  60990. getLengths: function (e) {
  60991. if (
  60992. (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  60993. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  60994. )
  60995. return this.cacheArcLengths;
  60996. this.needsUpdate = !1;
  60997. var t,
  60998. i,
  60999. n = [],
  61000. r = this.getPoint(0),
  61001. o = 0;
  61002. for (n.push(0), i = 1; i <= e; i++)
  61003. (t = this.getPoint(i / e)), (o += t.distanceTo(r)), n.push(o), (r = t);
  61004. return (this.cacheArcLengths = n), n;
  61005. },
  61006. updateArcLengths: function () {
  61007. (this.needsUpdate = !0), this.getLengths();
  61008. },
  61009. getUtoTmapping: function (e, t) {
  61010. var i,
  61011. n = this.getLengths(),
  61012. r = 0,
  61013. o = n.length;
  61014. i = t ? t : e * n[o - 1];
  61015. for (var a, s = 0, l = o - 1; s <= l; )
  61016. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0)) s = r + 1;
  61017. else {
  61018. if (!(a > 0)) {
  61019. l = r;
  61020. break;
  61021. }
  61022. l = r - 1;
  61023. }
  61024. if (((r = l), n[r] === i)) {
  61025. var c = r / (o - 1);
  61026. return c;
  61027. }
  61028. var h = n[r],
  61029. u = n[r + 1],
  61030. d = u - h,
  61031. p = (i - h) / d,
  61032. c = (r + p) / (o - 1);
  61033. return c;
  61034. },
  61035. getTangent: function (e) {
  61036. var t = 1e-4,
  61037. i = e - t,
  61038. n = e + t;
  61039. i < 0 && (i = 0), n > 1 && (n = 1);
  61040. var r = this.getPoint(i),
  61041. o = this.getPoint(n),
  61042. a = o.clone().sub(r);
  61043. return a.normalize();
  61044. },
  61045. getTangentAt: function (e) {
  61046. var t = this.getUtoTmapping(e);
  61047. return this.getTangent(t);
  61048. },
  61049. }),
  61050. (n.Curve.create = function (e, t) {
  61051. return (
  61052. (e.prototype = Object.create(n.Curve.prototype)),
  61053. (e.prototype.constructor = e),
  61054. (e.prototype.getPoint = t),
  61055. e
  61056. );
  61057. }),
  61058. (n.CurvePath = function () {
  61059. (this.curves = []), (this.autoClose = !1);
  61060. }),
  61061. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  61062. (n.CurvePath.prototype.constructor = n.CurvePath),
  61063. (n.CurvePath.prototype.add = function (e) {
  61064. this.curves.push(e);
  61065. }),
  61066. (n.CurvePath.prototype.closePath = function () {
  61067. var e = this.curves[0].getPoint(0),
  61068. t = this.curves[this.curves.length - 1].getPoint(1);
  61069. e.equals(t) || this.curves.push(new n.LineCurve(t, e));
  61070. }),
  61071. (n.CurvePath.prototype.getPoint = function (e) {
  61072. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  61073. if (i[n] >= t) {
  61074. var r = i[n] - t,
  61075. o = this.curves[n],
  61076. a = 1 - r / o.getLength();
  61077. return o.getPointAt(a);
  61078. }
  61079. n++;
  61080. }
  61081. return null;
  61082. }),
  61083. (n.CurvePath.prototype.getLength = function () {
  61084. var e = this.getCurveLengths();
  61085. return e[e.length - 1];
  61086. }),
  61087. (n.CurvePath.prototype.getCurveLengths = function () {
  61088. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  61089. return this.cacheLengths;
  61090. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  61091. (t += this.curves[i].getLength()), e.push(t);
  61092. return (this.cacheLengths = e), e;
  61093. }),
  61094. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  61095. var t = this.getPoints(e);
  61096. return this.createGeometry(t);
  61097. }),
  61098. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  61099. var t = this.getSpacedPoints(e);
  61100. return this.createGeometry(t);
  61101. }),
  61102. (n.CurvePath.prototype.createGeometry = function (e) {
  61103. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  61104. var o = e[i];
  61105. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0));
  61106. }
  61107. return t;
  61108. }),
  61109. (n.Font = function (e) {
  61110. this.data = e;
  61111. }),
  61112. (n.Font.prototype = {
  61113. constructor: n.Font,
  61114. generateShapes: function (e, t, i) {
  61115. function r(e) {
  61116. for (
  61117. var i = String(e).split(''), n = t / a.resolution, r = 0, s = [], l = 0;
  61118. l < i.length;
  61119. l++
  61120. ) {
  61121. var c = o(i[l], n, r);
  61122. (r += c.offset), s.push(c.path);
  61123. }
  61124. return s;
  61125. }
  61126. function o(e, t, r) {
  61127. var o = a.glyphs[e] || a.glyphs['?'];
  61128. if (o) {
  61129. var s,
  61130. l,
  61131. c,
  61132. h,
  61133. u,
  61134. d,
  61135. p,
  61136. f,
  61137. g,
  61138. m,
  61139. v,
  61140. A = new n.Path(),
  61141. y = [],
  61142. C = n.ShapeUtils.b2,
  61143. I = n.ShapeUtils.b3;
  61144. if (o.o)
  61145. for (
  61146. var E = o._cachedOutline || (o._cachedOutline = o.o.split(' ')),
  61147. b = 0,
  61148. w = E.length;
  61149. b < w;
  61150. ) {
  61151. var _ = E[b++];
  61152. switch (_) {
  61153. case 'm':
  61154. (s = E[b++] * t + r), (l = E[b++] * t), A.moveTo(s, l);
  61155. break;
  61156. case 'l':
  61157. (s = E[b++] * t + r), (l = E[b++] * t), A.lineTo(s, l);
  61158. break;
  61159. case 'q':
  61160. if (
  61161. ((c = E[b++] * t + r),
  61162. (h = E[b++] * t),
  61163. (p = E[b++] * t + r),
  61164. (f = E[b++] * t),
  61165. A.quadraticCurveTo(p, f, c, h),
  61166. (v = y[y.length - 1]))
  61167. ) {
  61168. (u = v.x), (d = v.y);
  61169. for (var T = 1; T <= i; T++) {
  61170. var x = T / i;
  61171. C(x, u, p, c), C(x, d, f, h);
  61172. }
  61173. }
  61174. break;
  61175. case 'b':
  61176. if (
  61177. ((c = E[b++] * t + r),
  61178. (h = E[b++] * t),
  61179. (p = E[b++] * t + r),
  61180. (f = E[b++] * t),
  61181. (g = E[b++] * t + r),
  61182. (m = E[b++] * t),
  61183. A.bezierCurveTo(p, f, g, m, c, h),
  61184. (v = y[y.length - 1]))
  61185. ) {
  61186. (u = v.x), (d = v.y);
  61187. for (var T = 1; T <= i; T++) {
  61188. var x = T / i;
  61189. I(x, u, p, g, c), I(x, d, f, m, h);
  61190. }
  61191. }
  61192. }
  61193. }
  61194. return {
  61195. offset: o.ha * t,
  61196. path: A,
  61197. };
  61198. }
  61199. }
  61200. void 0 === t && (t = 100), void 0 === i && (i = 4);
  61201. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  61202. Array.prototype.push.apply(l, s[c].toShapes());
  61203. return l;
  61204. },
  61205. }),
  61206. (n.Path = function (e) {
  61207. n.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e);
  61208. }),
  61209. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  61210. (n.Path.prototype.constructor = n.Path),
  61211. (n.Path.prototype.fromPoints = function (e) {
  61212. this.moveTo(e[0].x, e[0].y);
  61213. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y);
  61214. }),
  61215. (n.Path.prototype.moveTo = function (e, t) {
  61216. this.actions.push({
  61217. action: 'moveTo',
  61218. args: [e, t],
  61219. });
  61220. }),
  61221. (n.Path.prototype.lineTo = function (e, t) {
  61222. var i = this.actions[this.actions.length - 1].args,
  61223. r = i[i.length - 2],
  61224. o = i[i.length - 1],
  61225. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t));
  61226. this.curves.push(a),
  61227. this.actions.push({
  61228. action: 'lineTo',
  61229. args: [e, t],
  61230. });
  61231. }),
  61232. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  61233. var o = this.actions[this.actions.length - 1].args,
  61234. a = o[o.length - 2],
  61235. s = o[o.length - 1],
  61236. l = new n.QuadraticBezierCurve(
  61237. new n.Vector2(a, s),
  61238. new n.Vector2(e, t),
  61239. new n.Vector2(i, r)
  61240. );
  61241. this.curves.push(l),
  61242. this.actions.push({
  61243. action: 'quadraticCurveTo',
  61244. args: [e, t, i, r],
  61245. });
  61246. }),
  61247. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  61248. var s = this.actions[this.actions.length - 1].args,
  61249. l = s[s.length - 2],
  61250. c = s[s.length - 1],
  61251. h = new n.CubicBezierCurve(
  61252. new n.Vector2(l, c),
  61253. new n.Vector2(e, t),
  61254. new n.Vector2(i, r),
  61255. new n.Vector2(o, a)
  61256. );
  61257. this.curves.push(h),
  61258. this.actions.push({
  61259. action: 'bezierCurveTo',
  61260. args: [e, t, i, r, o, a],
  61261. });
  61262. }),
  61263. (n.Path.prototype.splineThru = function (e) {
  61264. var t = Array.prototype.slice.call(arguments),
  61265. i = this.actions[this.actions.length - 1].args,
  61266. r = i[i.length - 2],
  61267. o = i[i.length - 1],
  61268. a = [new n.Vector2(r, o)];
  61269. Array.prototype.push.apply(a, e);
  61270. var s = new n.SplineCurve(a);
  61271. this.curves.push(s),
  61272. this.actions.push({
  61273. action: 'splineThru',
  61274. args: t,
  61275. });
  61276. }),
  61277. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  61278. var a = this.actions[this.actions.length - 1].args,
  61279. s = a[a.length - 2],
  61280. l = a[a.length - 1];
  61281. this.absarc(e + s, t + l, i, n, r, o);
  61282. }),
  61283. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  61284. this.absellipse(e, t, i, i, n, r, o);
  61285. }),
  61286. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  61287. var l = this.actions[this.actions.length - 1].args,
  61288. c = l[l.length - 2],
  61289. h = l[l.length - 1];
  61290. this.absellipse(e + c, t + h, i, n, r, o, a, s);
  61291. }),
  61292. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  61293. var c = [e, t, i, r, o, a, s, l || 0],
  61294. h = new n.EllipseCurve(e, t, i, r, o, a, s, l);
  61295. this.curves.push(h);
  61296. var u = h.getPoint(1);
  61297. c.push(u.x),
  61298. c.push(u.y),
  61299. this.actions.push({
  61300. action: 'ellipse',
  61301. args: c,
  61302. });
  61303. }),
  61304. (n.Path.prototype.getSpacedPoints = function (e) {
  61305. e || (e = 40);
  61306. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e));
  61307. return this.autoClose && t.push(t[0]), t;
  61308. }),
  61309. (n.Path.prototype.getPoints = function (e) {
  61310. e = e || 12;
  61311. for (
  61312. var t,
  61313. i,
  61314. r,
  61315. o,
  61316. a,
  61317. s,
  61318. l,
  61319. c,
  61320. h,
  61321. u,
  61322. d,
  61323. p = n.ShapeUtils.b2,
  61324. f = n.ShapeUtils.b3,
  61325. g = [],
  61326. m = 0,
  61327. v = this.actions.length;
  61328. m < v;
  61329. m++
  61330. ) {
  61331. var A = this.actions[m],
  61332. y = A.action,
  61333. C = A.args;
  61334. switch (y) {
  61335. case 'moveTo':
  61336. g.push(new n.Vector2(C[0], C[1]));
  61337. break;
  61338. case 'lineTo':
  61339. g.push(new n.Vector2(C[0], C[1]));
  61340. break;
  61341. case 'quadraticCurveTo':
  61342. (t = C[2]),
  61343. (i = C[3]),
  61344. (a = C[0]),
  61345. (s = C[1]),
  61346. g.length > 0
  61347. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61348. : ((h = this.actions[m - 1].args),
  61349. (l = h[h.length - 2]),
  61350. (c = h[h.length - 1]));
  61351. for (var I = 1; I <= e; I++) {
  61352. var E = I / e;
  61353. (u = p(E, l, a, t)), (d = p(E, c, s, i)), g.push(new n.Vector2(u, d));
  61354. }
  61355. break;
  61356. case 'bezierCurveTo':
  61357. (t = C[4]),
  61358. (i = C[5]),
  61359. (a = C[0]),
  61360. (s = C[1]),
  61361. (r = C[2]),
  61362. (o = C[3]),
  61363. g.length > 0
  61364. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61365. : ((h = this.actions[m - 1].args),
  61366. (l = h[h.length - 2]),
  61367. (c = h[h.length - 1]));
  61368. for (var I = 1; I <= e; I++) {
  61369. var E = I / e;
  61370. (u = f(E, l, a, r, t)), (d = f(E, c, s, o, i)), g.push(new n.Vector2(u, d));
  61371. }
  61372. break;
  61373. case 'splineThru':
  61374. h = this.actions[m - 1].args;
  61375. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  61376. w = [b],
  61377. _ = e * C[0].length;
  61378. w = w.concat(C[0]);
  61379. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  61380. g.push(T.getPointAt(I / _));
  61381. break;
  61382. case 'arc':
  61383. for (
  61384. var x,
  61385. S = C[0],
  61386. M = C[1],
  61387. R = C[2],
  61388. P = C[3],
  61389. O = C[4],
  61390. L = !!C[5],
  61391. D = O - P,
  61392. N = 2 * e,
  61393. I = 1;
  61394. I <= N;
  61395. I++
  61396. ) {
  61397. var E = I / N;
  61398. L || (E = 1 - E),
  61399. (x = P + E * D),
  61400. (u = S + R * Math.cos(x)),
  61401. (d = M + R * Math.sin(x)),
  61402. g.push(new n.Vector2(u, d));
  61403. }
  61404. break;
  61405. case 'ellipse':
  61406. var x,
  61407. B,
  61408. F,
  61409. S = C[0],
  61410. M = C[1],
  61411. V = C[2],
  61412. U = C[3],
  61413. P = C[4],
  61414. O = C[5],
  61415. L = !!C[6],
  61416. k = C[7],
  61417. D = O - P,
  61418. N = 2 * e;
  61419. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)));
  61420. for (var I = 1; I <= N; I++) {
  61421. var E = I / N;
  61422. if (
  61423. (L || (E = 1 - E),
  61424. (x = P + E * D),
  61425. (u = S + V * Math.cos(x)),
  61426. (d = M + U * Math.sin(x)),
  61427. 0 !== k)
  61428. ) {
  61429. var H = u,
  61430. G = d;
  61431. (u = (H - S) * B - (G - M) * F + S), (d = (H - S) * F + (G - M) * B + M);
  61432. }
  61433. g.push(new n.Vector2(u, d));
  61434. }
  61435. }
  61436. }
  61437. var z = g[g.length - 1];
  61438. return (
  61439. Math.abs(z.x - g[0].x) < Number.EPSILON &&
  61440. Math.abs(z.y - g[0].y) < Number.EPSILON &&
  61441. g.splice(g.length - 1, 1),
  61442. this.autoClose && g.push(g[0]),
  61443. g
  61444. );
  61445. }),
  61446. (n.Path.prototype.toShapes = function (e, t) {
  61447. function i(e) {
  61448. for (var t = [], i = new n.Path(), r = 0, o = e.length; r < o; r++) {
  61449. var a = e[r],
  61450. s = a.args,
  61451. l = a.action;
  61452. 'moveTo' === l && 0 !== i.actions.length && (t.push(i), (i = new n.Path())),
  61453. i[l].apply(i, s);
  61454. }
  61455. return 0 !== i.actions.length && t.push(i), t;
  61456. }
  61457. function r(e) {
  61458. for (var t = [], i = 0, r = e.length; i < r; i++) {
  61459. var o = e[i],
  61460. a = new n.Shape();
  61461. (a.actions = o.actions), (a.curves = o.curves), t.push(a);
  61462. }
  61463. return t;
  61464. }
  61465. function o(e, t) {
  61466. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  61467. var a = t[r],
  61468. s = t[o],
  61469. l = s.x - a.x,
  61470. c = s.y - a.y;
  61471. if (Math.abs(c) > Number.EPSILON) {
  61472. if (
  61473. (c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)
  61474. )
  61475. continue;
  61476. if (e.y === a.y) {
  61477. if (e.x === a.x) return !0;
  61478. } else {
  61479. var h = c * (e.x - a.x) - l * (e.y - a.y);
  61480. if (0 === h) return !0;
  61481. if (h < 0) continue;
  61482. n = !n;
  61483. }
  61484. } else {
  61485. if (e.y !== a.y) continue;
  61486. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0;
  61487. }
  61488. }
  61489. return n;
  61490. }
  61491. var a = n.ShapeUtils.isClockWise,
  61492. s = i(this.actions);
  61493. if (0 === s.length) return [];
  61494. if (t === !0) return r(s);
  61495. var l,
  61496. c,
  61497. h,
  61498. u = [];
  61499. if (1 === s.length)
  61500. return (
  61501. (c = s[0]),
  61502. (h = new n.Shape()),
  61503. (h.actions = c.actions),
  61504. (h.curves = c.curves),
  61505. u.push(h),
  61506. u
  61507. );
  61508. var d = !a(s[0].getPoints());
  61509. d = e ? !d : d;
  61510. var p,
  61511. f = [],
  61512. g = [],
  61513. m = [],
  61514. v = 0;
  61515. (g[v] = void 0), (m[v] = []);
  61516. for (var A = 0, y = s.length; A < y; A++)
  61517. (c = s[A]),
  61518. (p = c.getPoints()),
  61519. (l = a(p)),
  61520. (l = e ? !l : l),
  61521. l
  61522. ? (!d && g[v] && v++,
  61523. (g[v] = {
  61524. s: new n.Shape(),
  61525. p: p,
  61526. }),
  61527. (g[v].s.actions = c.actions),
  61528. (g[v].s.curves = c.curves),
  61529. d && v++,
  61530. (m[v] = []))
  61531. : m[v].push({
  61532. h: c,
  61533. p: p[0],
  61534. });
  61535. if (!g[0]) return r(s);
  61536. if (g.length > 1) {
  61537. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++) f[E] = [];
  61538. for (var E = 0, b = g.length; E < b; E++)
  61539. for (var w = m[E], _ = 0; _ < w.length; _++) {
  61540. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  61541. o(T.p, g[S].p) &&
  61542. (E !== S &&
  61543. I.push({
  61544. froms: E,
  61545. tos: S,
  61546. hole: _,
  61547. }),
  61548. x ? ((x = !1), f[S].push(T)) : (C = !0));
  61549. x && f[E].push(T);
  61550. }
  61551. I.length > 0 && (C || (m = f));
  61552. }
  61553. for (var M, A = 0, R = g.length; A < R; A++) {
  61554. (h = g[A].s), u.push(h), (M = m[A]);
  61555. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h);
  61556. }
  61557. return u;
  61558. }),
  61559. (n.Shape = function () {
  61560. n.Path.apply(this, arguments), (this.holes = []);
  61561. }),
  61562. (n.Shape.prototype = Object.create(n.Path.prototype)),
  61563. (n.Shape.prototype.constructor = n.Shape),
  61564. (n.Shape.prototype.extrude = function (e) {
  61565. return new n.ExtrudeGeometry(this, e);
  61566. }),
  61567. (n.Shape.prototype.makeGeometry = function (e) {
  61568. return new n.ShapeGeometry(this, e);
  61569. }),
  61570. (n.Shape.prototype.getPointsHoles = function (e) {
  61571. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  61572. t[i] = this.holes[i].getPoints(e);
  61573. return t;
  61574. }),
  61575. (n.Shape.prototype.extractAllPoints = function (e) {
  61576. return {
  61577. shape: this.getPoints(e),
  61578. holes: this.getPointsHoles(e),
  61579. };
  61580. }),
  61581. (n.Shape.prototype.extractPoints = function (e) {
  61582. return this.extractAllPoints(e);
  61583. }),
  61584. (n.LineCurve = function (e, t) {
  61585. (this.v1 = e), (this.v2 = t);
  61586. }),
  61587. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  61588. (n.LineCurve.prototype.constructor = n.LineCurve),
  61589. (n.LineCurve.prototype.getPoint = function (e) {
  61590. var t = this.v2.clone().sub(this.v1);
  61591. return t.multiplyScalar(e).add(this.v1), t;
  61592. }),
  61593. (n.LineCurve.prototype.getPointAt = function (e) {
  61594. return this.getPoint(e);
  61595. }),
  61596. (n.LineCurve.prototype.getTangent = function (e) {
  61597. var t = this.v2.clone().sub(this.v1);
  61598. return t.normalize();
  61599. }),
  61600. (n.QuadraticBezierCurve = function (e, t, i) {
  61601. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  61602. }),
  61603. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61604. (n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve),
  61605. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  61606. var t = n.ShapeUtils.b2;
  61607. return new n.Vector2(
  61608. t(e, this.v0.x, this.v1.x, this.v2.x),
  61609. t(e, this.v0.y, this.v1.y, this.v2.y)
  61610. );
  61611. }),
  61612. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  61613. var t = n.CurveUtils.tangentQuadraticBezier;
  61614. return new n.Vector2(
  61615. t(e, this.v0.x, this.v1.x, this.v2.x),
  61616. t(e, this.v0.y, this.v1.y, this.v2.y)
  61617. ).normalize();
  61618. }),
  61619. (n.CubicBezierCurve = function (e, t, i, n) {
  61620. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  61621. }),
  61622. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61623. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  61624. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  61625. var t = n.ShapeUtils.b3;
  61626. return new n.Vector2(
  61627. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61628. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61629. );
  61630. }),
  61631. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  61632. var t = n.CurveUtils.tangentCubicBezier;
  61633. return new n.Vector2(
  61634. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61635. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61636. ).normalize();
  61637. }),
  61638. (n.SplineCurve = function (e) {
  61639. this.points = void 0 == e ? [] : e;
  61640. }),
  61641. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  61642. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  61643. (n.SplineCurve.prototype.getPoint = function (e) {
  61644. var t = this.points,
  61645. i = (t.length - 1) * e,
  61646. r = Math.floor(i),
  61647. o = i - r,
  61648. a = t[0 === r ? r : r - 1],
  61649. s = t[r],
  61650. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61651. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61652. h = n.CurveUtils.interpolate;
  61653. return new n.Vector2(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o));
  61654. }),
  61655. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  61656. (this.aX = e),
  61657. (this.aY = t),
  61658. (this.xRadius = i),
  61659. (this.yRadius = n),
  61660. (this.aStartAngle = r),
  61661. (this.aEndAngle = o),
  61662. (this.aClockwise = a),
  61663. (this.aRotation = s || 0);
  61664. }),
  61665. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  61666. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  61667. (n.EllipseCurve.prototype.getPoint = function (e) {
  61668. var t = this.aEndAngle - this.aStartAngle;
  61669. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI);
  61670. var i;
  61671. i =
  61672. this.aClockwise === !0
  61673. ? this.aEndAngle + (1 - e) * (2 * Math.PI - t)
  61674. : this.aStartAngle + e * t;
  61675. var r = this.aX + this.xRadius * Math.cos(i),
  61676. o = this.aY + this.yRadius * Math.sin(i);
  61677. if (0 !== this.aRotation) {
  61678. var a = Math.cos(this.aRotation),
  61679. s = Math.sin(this.aRotation),
  61680. l = r,
  61681. c = o;
  61682. (r = (l - this.aX) * a - (c - this.aY) * s + this.aX),
  61683. (o = (l - this.aX) * s + (c - this.aY) * a + this.aY);
  61684. }
  61685. return new n.Vector2(r, o);
  61686. }),
  61687. (n.ArcCurve = function (e, t, i, r, o, a) {
  61688. n.EllipseCurve.call(this, e, t, i, i, r, o, a);
  61689. }),
  61690. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  61691. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  61692. (n.LineCurve3 = n.Curve.create(
  61693. function (e, t) {
  61694. (this.v1 = e), (this.v2 = t);
  61695. },
  61696. function (e) {
  61697. var t = new n.Vector3();
  61698. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t;
  61699. }
  61700. )),
  61701. (n.QuadraticBezierCurve3 = n.Curve.create(
  61702. function (e, t, i) {
  61703. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  61704. },
  61705. function (e) {
  61706. var t = n.ShapeUtils.b2;
  61707. return new n.Vector3(
  61708. t(e, this.v0.x, this.v1.x, this.v2.x),
  61709. t(e, this.v0.y, this.v1.y, this.v2.y),
  61710. t(e, this.v0.z, this.v1.z, this.v2.z)
  61711. );
  61712. }
  61713. )),
  61714. (n.CubicBezierCurve3 = n.Curve.create(
  61715. function (e, t, i, n) {
  61716. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  61717. },
  61718. function (e) {
  61719. var t = n.ShapeUtils.b3;
  61720. return new n.Vector3(
  61721. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61722. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),
  61723. t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z)
  61724. );
  61725. }
  61726. )),
  61727. (n.SplineCurve3 = n.Curve.create(
  61728. function (e) {
  61729. console.warn(
  61730. 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'
  61731. ),
  61732. (this.points = void 0 == e ? [] : e);
  61733. },
  61734. function (e) {
  61735. var t = this.points,
  61736. i = (t.length - 1) * e,
  61737. r = Math.floor(i),
  61738. o = i - r,
  61739. a = t[0 == r ? r : r - 1],
  61740. s = t[r],
  61741. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61742. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61743. h = n.CurveUtils.interpolate;
  61744. return new n.Vector3(
  61745. h(a.x, s.x, l.x, c.x, o),
  61746. h(a.y, s.y, l.y, c.y, o),
  61747. h(a.z, s.z, l.z, c.z, o)
  61748. );
  61749. }
  61750. )),
  61751. (n.CatmullRomCurve3 = (function () {
  61752. function e() {}
  61753. var t = new n.Vector3(),
  61754. i = new e(),
  61755. r = new e(),
  61756. o = new e();
  61757. return (
  61758. (e.prototype.init = function (e, t, i, n) {
  61759. (this.c0 = e),
  61760. (this.c1 = i),
  61761. (this.c2 = -3 * e + 3 * t - 2 * i - n),
  61762. (this.c3 = 2 * e - 2 * t + i + n);
  61763. }),
  61764. (e.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  61765. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  61766. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  61767. (s *= o), (l *= o), this.init(t, i, s, l);
  61768. }),
  61769. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  61770. this.init(t, i, r * (i - e), r * (n - t));
  61771. }),
  61772. (e.prototype.calc = function (e) {
  61773. var t = e * e,
  61774. i = t * e;
  61775. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i;
  61776. }),
  61777. n.Curve.create(
  61778. function (e) {
  61779. (this.points = e || []), (this.closed = !1);
  61780. },
  61781. function (e) {
  61782. var a,
  61783. s,
  61784. l,
  61785. c,
  61786. h = this.points;
  61787. (c = h.length),
  61788. c < 2 && console.log('duh, you need at least 2 points'),
  61789. (a = (c - (this.closed ? 0 : 1)) * e),
  61790. (s = Math.floor(a)),
  61791. (l = a - s),
  61792. this.closed
  61793. ? (s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length)
  61794. : 0 === l && s === c - 1 && ((s = c - 2), (l = 1));
  61795. var u, d, p, f;
  61796. if (
  61797. (this.closed || s > 0
  61798. ? (u = h[(s - 1) % c])
  61799. : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  61800. (d = h[s % c]),
  61801. (p = h[(s + 1) % c]),
  61802. this.closed || s + 2 < c
  61803. ? (f = h[(s + 2) % c])
  61804. : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]), (f = t)),
  61805. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  61806. ) {
  61807. var g = 'chordal' === this.type ? 0.5 : 0.25,
  61808. m = Math.pow(u.distanceToSquared(d), g),
  61809. v = Math.pow(d.distanceToSquared(p), g),
  61810. A = Math.pow(p.distanceToSquared(f), g);
  61811. v < 1e-4 && (v = 1),
  61812. m < 1e-4 && (m = v),
  61813. A < 1e-4 && (A = v),
  61814. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  61815. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  61816. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A);
  61817. } else if ('catmullrom' === this.type) {
  61818. var y = void 0 !== this.tension ? this.tension : 0.5;
  61819. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  61820. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  61821. o.initCatmullRom(u.z, d.z, p.z, f.z, y);
  61822. }
  61823. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l));
  61824. return C;
  61825. }
  61826. )
  61827. );
  61828. })()),
  61829. (n.ClosedSplineCurve3 = function (e) {
  61830. console.warn(
  61831. 'THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'
  61832. ),
  61833. n.CatmullRomCurve3.call(this, e),
  61834. (this.type = 'catmullrom'),
  61835. (this.closed = !0);
  61836. }),
  61837. (n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype)),
  61838. (n.BoxGeometry = function (e, t, i, r, o, a) {
  61839. n.Geometry.call(this),
  61840. (this.type = 'BoxGeometry'),
  61841. (this.parameters = {
  61842. width: e,
  61843. height: t,
  61844. depth: i,
  61845. widthSegments: r,
  61846. heightSegments: o,
  61847. depthSegments: a,
  61848. }),
  61849. this.fromBufferGeometry(new n.BoxBufferGeometry(e, t, i, r, o, a)),
  61850. this.mergeVertices();
  61851. }),
  61852. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  61853. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  61854. (n.CubeGeometry = n.BoxGeometry),
  61855. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  61856. function s(e, t, i) {
  61857. var n = 0;
  61858. return (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n;
  61859. }
  61860. function l(e, t, i, r, o, a, s, l, h, u, I) {
  61861. for (
  61862. var E = a / h,
  61863. b = s / u,
  61864. w = a / 2,
  61865. _ = s / 2,
  61866. T = l / 2,
  61867. x = h + 1,
  61868. S = u + 1,
  61869. M = 0,
  61870. R = 0,
  61871. P = new n.Vector3(),
  61872. O = 0;
  61873. O < S;
  61874. O++
  61875. )
  61876. for (var L = O * b - _, D = 0; D < x; D++) {
  61877. var N = D * E - w;
  61878. (P[e] = N * r),
  61879. (P[t] = L * o),
  61880. (P[i] = T),
  61881. (p[m] = P.x),
  61882. (p[m + 1] = P.y),
  61883. (p[m + 2] = P.z),
  61884. (P[e] = 0),
  61885. (P[t] = 0),
  61886. (P[i] = l > 0 ? 1 : -1),
  61887. (f[m] = P.x),
  61888. (f[m + 1] = P.y),
  61889. (f[m + 2] = P.z),
  61890. (g[v] = D / h),
  61891. (g[v + 1] = 1 - O / u),
  61892. (m += 3),
  61893. (v += 2),
  61894. (M += 1);
  61895. }
  61896. for (O = 0; O < u; O++)
  61897. for (D = 0; D < h; D++) {
  61898. var B = y + D + x * O,
  61899. F = y + D + x * (O + 1),
  61900. V = y + (D + 1) + x * (O + 1),
  61901. U = y + (D + 1) + x * O;
  61902. (d[A] = B),
  61903. (d[A + 1] = F),
  61904. (d[A + 2] = U),
  61905. (d[A + 3] = F),
  61906. (d[A + 4] = V),
  61907. (d[A + 5] = U),
  61908. (A += 6),
  61909. (R += 6);
  61910. }
  61911. c.addGroup(C, R, I), (C += R), (y += M);
  61912. }
  61913. n.BufferGeometry.call(this),
  61914. (this.type = 'BoxBufferGeometry'),
  61915. (this.parameters = {
  61916. width: e,
  61917. height: t,
  61918. depth: i,
  61919. widthSegments: r,
  61920. heightSegments: o,
  61921. depthSegments: a,
  61922. });
  61923. var c = this;
  61924. (r = Math.floor(r) || 1), (o = Math.floor(o) || 1), (a = Math.floor(a) || 1);
  61925. var h = s(r, o, a),
  61926. u = (h / 4) * 6,
  61927. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  61928. p = new Float32Array(3 * h),
  61929. f = new Float32Array(3 * h),
  61930. g = new Float32Array(2 * h),
  61931. m = 0,
  61932. v = 0,
  61933. A = 0,
  61934. y = 0,
  61935. C = 0;
  61936. l('z', 'y', 'x', -1, -1, i, t, e, a, o, 0),
  61937. l('z', 'y', 'x', 1, -1, i, t, -e, a, o, 1),
  61938. l('x', 'z', 'y', 1, 1, e, i, t, r, a, 2),
  61939. l('x', 'z', 'y', 1, -1, e, i, -t, r, a, 3),
  61940. l('x', 'y', 'z', 1, -1, e, t, i, r, o, 4),
  61941. l('x', 'y', 'z', -1, -1, e, t, -i, r, o, 5),
  61942. this.setIndex(new n.BufferAttribute(d, 1)),
  61943. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  61944. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  61945. this.addAttribute('uv', new n.BufferAttribute(g, 2));
  61946. }),
  61947. (n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  61948. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  61949. (n.CircleGeometry = function (e, t, i, r) {
  61950. n.Geometry.call(this),
  61951. (this.type = 'CircleGeometry'),
  61952. (this.parameters = {
  61953. radius: e,
  61954. segments: t,
  61955. thetaStart: i,
  61956. thetaLength: r,
  61957. }),
  61958. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r));
  61959. }),
  61960. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  61961. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  61962. (n.CircleBufferGeometry = function (e, t, i, r) {
  61963. n.BufferGeometry.call(this),
  61964. (this.type = 'CircleBufferGeometry'),
  61965. (this.parameters = {
  61966. radius: e,
  61967. segments: t,
  61968. thetaStart: i,
  61969. thetaLength: r,
  61970. }),
  61971. (e = e || 50),
  61972. (t = void 0 !== t ? Math.max(3, t) : 8),
  61973. (i = void 0 !== i ? i : 0),
  61974. (r = void 0 !== r ? r : 2 * Math.PI);
  61975. var o = t + 2,
  61976. a = new Float32Array(3 * o),
  61977. s = new Float32Array(3 * o),
  61978. l = new Float32Array(2 * o);
  61979. (s[2] = 1), (l[0] = 0.5), (l[1] = 0.5);
  61980. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  61981. var d = i + (c / t) * r;
  61982. (a[h] = e * Math.cos(d)),
  61983. (a[h + 1] = e * Math.sin(d)),
  61984. (s[h + 2] = 1),
  61985. (l[u] = (a[h] / e + 1) / 2),
  61986. (l[u + 1] = (a[h + 1] / e + 1) / 2);
  61987. }
  61988. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0);
  61989. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  61990. this.addAttribute('position', new n.BufferAttribute(a, 3)),
  61991. this.addAttribute('normal', new n.BufferAttribute(s, 3)),
  61992. this.addAttribute('uv', new n.BufferAttribute(l, 2)),
  61993. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  61994. }),
  61995. (n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  61996. (n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry),
  61997. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  61998. function c() {
  61999. var e = (r + 1) * (o + 1);
  62000. return a === !1 && (e += 2 * (r + 1) + 2 * r), e;
  62001. }
  62002. function h() {
  62003. var e = r * o * 2 * 3;
  62004. return a === !1 && (e += 2 * r * 3), e;
  62005. }
  62006. function u() {
  62007. var a,
  62008. c,
  62009. h = new n.Vector3(),
  62010. u = new n.Vector3(),
  62011. d = (t - e) / i;
  62012. for (c = 0; c <= o; c++) {
  62013. var p = [],
  62014. f = c / o,
  62015. b = f * (t - e) + e;
  62016. for (a = 0; a <= r; a++) {
  62017. var w = a / r;
  62018. (u.x = b * Math.sin(w * l + s)),
  62019. (u.y = -f * i + E),
  62020. (u.z = b * Math.cos(w * l + s)),
  62021. m.setXYZ(y, u.x, u.y, u.z),
  62022. h.copy(u),
  62023. ((0 === e && 0 === c) || (0 === t && c === o)) &&
  62024. ((h.x = Math.sin(w * l + s)), (h.z = Math.cos(w * l + s))),
  62025. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  62026. v.setXYZ(y, h.x, h.y, h.z),
  62027. A.setXY(y, w, 1 - f),
  62028. p.push(y),
  62029. y++;
  62030. }
  62031. I.push(p);
  62032. }
  62033. for (a = 0; a < r; a++)
  62034. for (c = 0; c < o; c++) {
  62035. var _ = I[c][a],
  62036. T = I[c + 1][a],
  62037. x = I[c + 1][a + 1],
  62038. S = I[c][a + 1];
  62039. g.setX(C, _),
  62040. C++,
  62041. g.setX(C, T),
  62042. C++,
  62043. g.setX(C, S),
  62044. C++,
  62045. g.setX(C, T),
  62046. C++,
  62047. g.setX(C, x),
  62048. C++,
  62049. g.setX(C, S),
  62050. C++;
  62051. }
  62052. }
  62053. function d(i) {
  62054. var o,
  62055. a,
  62056. c,
  62057. h = new n.Vector2(),
  62058. u = new n.Vector3(),
  62059. d = i === !0 ? e : t,
  62060. p = i === !0 ? 1 : -1;
  62061. for (a = y, o = 1; o <= r; o++)
  62062. m.setXYZ(y, 0, E * p, 0),
  62063. v.setXYZ(y, 0, p, 0),
  62064. i === !0 ? ((h.x = o / r), (h.y = 0)) : ((h.x = (o - 1) / r), (h.y = 1)),
  62065. A.setXY(y, h.x, h.y),
  62066. y++;
  62067. for (c = y, o = 0; o <= r; o++) {
  62068. var f = o / r;
  62069. (u.x = d * Math.sin(f * l + s)),
  62070. (u.y = E * p),
  62071. (u.z = d * Math.cos(f * l + s)),
  62072. m.setXYZ(y, u.x, u.y, u.z),
  62073. v.setXYZ(y, 0, p, 0),
  62074. A.setXY(y, f, i === !0 ? 1 : 0),
  62075. y++;
  62076. }
  62077. for (o = 0; o < r; o++) {
  62078. var I = a + o,
  62079. b = c + o;
  62080. i === !0
  62081. ? (g.setX(C, b), C++, g.setX(C, b + 1), C++, g.setX(C, I), C++)
  62082. : (g.setX(C, b + 1), C++, g.setX(C, b), C++, g.setX(C, I), C++);
  62083. }
  62084. }
  62085. n.BufferGeometry.call(this),
  62086. (this.type = 'CylinderBufferGeometry'),
  62087. (this.parameters = {
  62088. radiusTop: e,
  62089. radiusBottom: t,
  62090. height: i,
  62091. radialSegments: r,
  62092. heightSegments: o,
  62093. openEnded: a,
  62094. thetaStart: s,
  62095. thetaLength: l,
  62096. }),
  62097. (e = void 0 !== e ? e : 20),
  62098. (t = void 0 !== t ? t : 20),
  62099. (i = void 0 !== i ? i : 100),
  62100. (r = Math.floor(r) || 8),
  62101. (o = Math.floor(o) || 1),
  62102. (a = void 0 !== a && a),
  62103. (s = void 0 !== s ? s : 0),
  62104. (l = void 0 !== l ? l : 2 * Math.PI);
  62105. var p = c(),
  62106. f = h(),
  62107. g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f), 1),
  62108. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62109. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62110. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  62111. y = 0,
  62112. C = 0,
  62113. I = [],
  62114. E = i / 2;
  62115. u(),
  62116. a === !1 && (e > 0 && d(!0), t > 0 && d(!1)),
  62117. this.setIndex(g),
  62118. this.addAttribute('position', m),
  62119. this.addAttribute('normal', v),
  62120. this.addAttribute('uv', A);
  62121. }),
  62122. (n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62123. (n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry),
  62124. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  62125. n.Geometry.call(this),
  62126. (this.type = 'CylinderGeometry'),
  62127. (this.parameters = {
  62128. radiusTop: e,
  62129. radiusBottom: t,
  62130. height: i,
  62131. radialSegments: r,
  62132. heightSegments: o,
  62133. openEnded: a,
  62134. thetaStart: s,
  62135. thetaLength: l,
  62136. }),
  62137. this.fromBufferGeometry(new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)),
  62138. this.mergeVertices();
  62139. }),
  62140. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  62141. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  62142. (n.EdgesGeometry = function (e, t) {
  62143. function i(e, t) {
  62144. return e - t;
  62145. }
  62146. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1);
  62147. var r,
  62148. o = Math.cos(n.Math.degToRad(t)),
  62149. a = [0, 0],
  62150. s = {},
  62151. l = ['a', 'b', 'c'];
  62152. e instanceof n.BufferGeometry
  62153. ? ((r = new n.Geometry()), r.fromBufferGeometry(e))
  62154. : (r = e.clone()),
  62155. r.mergeVertices(),
  62156. r.computeFaceNormals();
  62157. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  62158. for (var p = h[u], f = 0; f < 3; f++) {
  62159. (a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i);
  62160. var g = a.toString();
  62161. void 0 === s[g]
  62162. ? (s[g] = {
  62163. vert1: a[0],
  62164. vert2: a[1],
  62165. face1: u,
  62166. face2: void 0,
  62167. })
  62168. : (s[g].face2 = u);
  62169. }
  62170. var m = [];
  62171. for (var g in s) {
  62172. var v = s[g];
  62173. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  62174. var A = c[v.vert1];
  62175. m.push(A.x),
  62176. m.push(A.y),
  62177. m.push(A.z),
  62178. (A = c[v.vert2]),
  62179. m.push(A.x),
  62180. m.push(A.y),
  62181. m.push(A.z);
  62182. }
  62183. }
  62184. this.addAttribute('position', new n.BufferAttribute(new Float32Array(m), 3));
  62185. }),
  62186. (n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62187. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  62188. (n.ExtrudeGeometry = function (e, t) {
  62189. return 'undefined' == typeof e
  62190. ? void (e = [])
  62191. : (n.Geometry.call(this),
  62192. (this.type = 'ExtrudeGeometry'),
  62193. (e = Array.isArray(e) ? e : [e]),
  62194. this.addShapeList(e, t),
  62195. void this.computeFaceNormals());
  62196. });
  62197. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  62198. (n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  62199. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  62200. for (var i = e.length, n = 0; n < i; n++) {
  62201. var r = e[n];
  62202. this.addShape(r, t);
  62203. }
  62204. }),
  62205. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  62206. function i(e, t, i) {
  62207. return (
  62208. t || console.error('THREE.ExtrudeGeometry: vec does not exist'),
  62209. t.clone().multiplyScalar(i).add(e)
  62210. );
  62211. }
  62212. function r(e, t, i) {
  62213. var r,
  62214. o,
  62215. a = 1,
  62216. s = e.x - t.x,
  62217. l = e.y - t.y,
  62218. c = i.x - e.x,
  62219. h = i.y - e.y,
  62220. u = s * s + l * l,
  62221. d = s * h - l * c;
  62222. if (Math.abs(d) > Number.EPSILON) {
  62223. var p = Math.sqrt(u),
  62224. f = Math.sqrt(c * c + h * h),
  62225. g = t.x - l / p,
  62226. m = t.y + s / p,
  62227. v = i.x - h / f,
  62228. A = i.y + c / f,
  62229. y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  62230. (r = g + s * y - e.x), (o = m + l * y - e.y);
  62231. var C = r * r + o * o;
  62232. if (C <= 2) return new n.Vector2(r, o);
  62233. a = Math.sqrt(C / 2);
  62234. } else {
  62235. var I = !1;
  62236. s > Number.EPSILON
  62237. ? c > Number.EPSILON && (I = !0)
  62238. : s < -Number.EPSILON
  62239. ? c < -Number.EPSILON && (I = !0)
  62240. : Math.sign(l) === Math.sign(h) && (I = !0),
  62241. I
  62242. ? ((r = -l), (o = s), (a = Math.sqrt(u)))
  62243. : ((r = s), (o = l), (a = Math.sqrt(u / 2)));
  62244. }
  62245. return new n.Vector2(r / a, o / a);
  62246. }
  62247. function o() {
  62248. if (C) {
  62249. var e = 0,
  62250. t = z * e;
  62251. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t);
  62252. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++)
  62253. (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t);
  62254. } else {
  62255. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0]);
  62256. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E);
  62257. }
  62258. }
  62259. function a() {
  62260. var e = 0;
  62261. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++)
  62262. (T = L[x]), s(T, e), (e += T.length);
  62263. }
  62264. function s(e, t) {
  62265. var i, n;
  62266. for (Y = e.length; --Y >= 0; ) {
  62267. (i = Y), (n = Y - 1), n < 0 && (n = e.length - 1);
  62268. var r = 0,
  62269. o = E + 2 * y;
  62270. for (r = 0; r < o; r++) {
  62271. var a = z * r,
  62272. s = z * (r + 1),
  62273. l = t + i + a,
  62274. c = t + n + a,
  62275. u = t + n + s,
  62276. d = t + i + s;
  62277. h(l, c, u, d, e, r, o, i, n);
  62278. }
  62279. }
  62280. }
  62281. function l(e, t, i) {
  62282. M.vertices.push(new n.Vector3(e, t, i));
  62283. }
  62284. function c(e, t, i) {
  62285. (e += R), (t += R), (i += R), M.faces.push(new n.Face3(e, t, i, null, null, 0));
  62286. var r = _.generateTopUV(M, e, t, i);
  62287. M.faceVertexUvs[0].push(r);
  62288. }
  62289. function h(e, t, i, r, o, a, s, l, c) {
  62290. (e += R),
  62291. (t += R),
  62292. (i += R),
  62293. (r += R),
  62294. M.faces.push(new n.Face3(e, t, r, null, null, 1)),
  62295. M.faces.push(new n.Face3(t, i, r, null, null, 1));
  62296. var h = _.generateSideWallUV(M, e, t, i, r);
  62297. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  62298. M.faceVertexUvs[0].push([h[1], h[2], h[3]]);
  62299. }
  62300. var u,
  62301. d,
  62302. p,
  62303. f,
  62304. g,
  62305. m = void 0 !== t.amount ? t.amount : 100,
  62306. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  62307. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  62308. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  62309. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  62310. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62311. E = void 0 !== t.steps ? t.steps : 1,
  62312. b = t.extrudePath,
  62313. w = !1,
  62314. _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  62315. b &&
  62316. ((u = b.getSpacedPoints(E)),
  62317. (w = !0),
  62318. (C = !1),
  62319. (d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  62320. (p = new n.Vector3()),
  62321. (f = new n.Vector3()),
  62322. (g = new n.Vector3())),
  62323. C || ((y = 0), (v = 0), (A = 0));
  62324. var T,
  62325. x,
  62326. S,
  62327. M = this,
  62328. R = this.vertices.length,
  62329. P = e.extractPoints(I),
  62330. O = P.shape,
  62331. L = P.holes,
  62332. D = !n.ShapeUtils.isClockWise(O);
  62333. if (D) {
  62334. for (O = O.reverse(), x = 0, S = L.length; x < S; x++)
  62335. (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  62336. D = !1;
  62337. }
  62338. var N = n.ShapeUtils.triangulateShape(O, L),
  62339. B = O;
  62340. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T));
  62341. for (
  62342. var F,
  62343. V,
  62344. U,
  62345. k,
  62346. H,
  62347. G,
  62348. z = O.length,
  62349. W = N.length,
  62350. j = [],
  62351. Y = 0,
  62352. X = B.length,
  62353. Z = X - 1,
  62354. q = Y + 1;
  62355. Y < X;
  62356. Y++, Z++, q++
  62357. )
  62358. Z === X && (Z = 0), q === X && (q = 0), (j[Y] = r(B[Y], B[Z], B[q]));
  62359. var K,
  62360. Q = [],
  62361. J = j.concat();
  62362. for (x = 0, S = L.length; x < S; x++) {
  62363. for (
  62364. T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1;
  62365. Y < X;
  62366. Y++, Z++, q++
  62367. )
  62368. Z === X && (Z = 0), q === X && (q = 0), (K[Y] = r(T[Y], T[Z], T[q]));
  62369. Q.push(K), (J = J.concat(K));
  62370. }
  62371. for (F = 0; F < y; F++) {
  62372. for (
  62373. U = F / y,
  62374. k = v * (1 - U),
  62375. V = A * Math.sin((U * Math.PI) / 2),
  62376. Y = 0,
  62377. X = B.length;
  62378. Y < X;
  62379. Y++
  62380. )
  62381. (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k);
  62382. for (x = 0, S = L.length; x < S; x++)
  62383. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62384. (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k);
  62385. }
  62386. for (V = A, Y = 0; Y < z; Y++)
  62387. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62388. w
  62389. ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  62390. p.copy(d.binormals[0]).multiplyScalar(H.y),
  62391. g.copy(u[0]).add(f).add(p),
  62392. l(g.x, g.y, g.z))
  62393. : l(H.x, H.y, 0);
  62394. var $;
  62395. for ($ = 1; $ <= E; $++)
  62396. for (Y = 0; Y < z; Y++)
  62397. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62398. w
  62399. ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  62400. p.copy(d.binormals[$]).multiplyScalar(H.y),
  62401. g.copy(u[$]).add(f).add(p),
  62402. l(g.x, g.y, g.z))
  62403. : l(H.x, H.y, (m / E) * $);
  62404. for (F = y - 1; F >= 0; F--) {
  62405. for (
  62406. U = F / y,
  62407. k = v * (1 - U),
  62408. V = A * Math.sin((U * Math.PI) / 2),
  62409. Y = 0,
  62410. X = B.length;
  62411. Y < X;
  62412. Y++
  62413. )
  62414. (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k);
  62415. for (x = 0, S = L.length; x < S; x++)
  62416. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62417. (H = i(T[Y], K[Y], V)),
  62418. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k);
  62419. }
  62420. o(), a();
  62421. }),
  62422. (n.ExtrudeGeometry.WorldUVGenerator = {
  62423. generateTopUV: function (e, t, i, r) {
  62424. var o = e.vertices,
  62425. a = o[t],
  62426. s = o[i],
  62427. l = o[r];
  62428. return [new n.Vector2(a.x, a.y), new n.Vector2(s.x, s.y), new n.Vector2(l.x, l.y)];
  62429. },
  62430. generateSideWallUV: function (e, t, i, r, o) {
  62431. var a = e.vertices,
  62432. s = a[t],
  62433. l = a[i],
  62434. c = a[r],
  62435. h = a[o];
  62436. return Math.abs(s.y - l.y) < 0.01
  62437. ? [
  62438. new n.Vector2(s.x, 1 - s.z),
  62439. new n.Vector2(l.x, 1 - l.z),
  62440. new n.Vector2(c.x, 1 - c.z),
  62441. new n.Vector2(h.x, 1 - h.z),
  62442. ]
  62443. : [
  62444. new n.Vector2(s.y, 1 - s.z),
  62445. new n.Vector2(l.y, 1 - l.z),
  62446. new n.Vector2(c.y, 1 - c.z),
  62447. new n.Vector2(h.y, 1 - h.z),
  62448. ];
  62449. },
  62450. }),
  62451. (n.ShapeGeometry = function (e, t) {
  62452. n.Geometry.call(this),
  62453. (this.type = 'ShapeGeometry'),
  62454. Array.isArray(e) === !1 && (e = [e]),
  62455. this.addShapeList(e, t),
  62456. this.computeFaceNormals();
  62457. }),
  62458. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  62459. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  62460. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  62461. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t);
  62462. return this;
  62463. }),
  62464. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  62465. void 0 === t && (t = {});
  62466. var i,
  62467. r,
  62468. o,
  62469. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62470. s = t.material,
  62471. l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  62472. c = this.vertices.length,
  62473. h = e.extractPoints(a),
  62474. u = h.shape,
  62475. d = h.holes,
  62476. p = !n.ShapeUtils.isClockWise(u);
  62477. if (p) {
  62478. for (u = u.reverse(), i = 0, r = d.length; i < r; i++)
  62479. (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  62480. p = !1;
  62481. }
  62482. var f = n.ShapeUtils.triangulateShape(u, d);
  62483. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o));
  62484. var g,
  62485. m,
  62486. v = u.length,
  62487. A = f.length;
  62488. for (i = 0; i < v; i++) (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0));
  62489. for (i = 0; i < A; i++) {
  62490. m = f[i];
  62491. var y = m[0] + c,
  62492. C = m[1] + c,
  62493. I = m[2] + c;
  62494. this.faces.push(new n.Face3(y, C, I, null, null, s)),
  62495. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I));
  62496. }
  62497. }),
  62498. (n.LatheBufferGeometry = function (e, t, i, r) {
  62499. n.BufferGeometry.call(this),
  62500. (this.type = 'LatheBufferGeometry'),
  62501. (this.parameters = {
  62502. points: e,
  62503. segments: t,
  62504. phiStart: i,
  62505. phiLength: r,
  62506. }),
  62507. (t = Math.floor(t) || 12),
  62508. (i = i || 0),
  62509. (r = r || 2 * Math.PI),
  62510. (r = n.Math.clamp(r, 0, 2 * Math.PI));
  62511. var o,
  62512. a,
  62513. s,
  62514. l = (t + 1) * e.length,
  62515. c = t * e.length * 2 * 3,
  62516. h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c), 1),
  62517. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  62518. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  62519. p = 0,
  62520. f = 0,
  62521. g = (1 / (e.length - 1), 1 / t),
  62522. m = new n.Vector3(),
  62523. v = new n.Vector2();
  62524. for (a = 0; a <= t; a++) {
  62525. var A = i + a * g * r,
  62526. y = Math.sin(A),
  62527. C = Math.cos(A);
  62528. for (s = 0; s <= e.length - 1; s++)
  62529. (m.x = e[s].x * y),
  62530. (m.y = e[s].y),
  62531. (m.z = e[s].x * C),
  62532. u.setXYZ(p, m.x, m.y, m.z),
  62533. (v.x = a / t),
  62534. (v.y = s / (e.length - 1)),
  62535. d.setXY(p, v.x, v.y),
  62536. p++;
  62537. }
  62538. for (a = 0; a < t; a++)
  62539. for (s = 0; s < e.length - 1; s++) {
  62540. o = s + a * e.length;
  62541. var I = o,
  62542. E = o + e.length,
  62543. b = o + e.length + 1,
  62544. w = o + 1;
  62545. h.setX(f, I),
  62546. f++,
  62547. h.setX(f, E),
  62548. f++,
  62549. h.setX(f, w),
  62550. f++,
  62551. h.setX(f, E),
  62552. f++,
  62553. h.setX(f, b),
  62554. f++,
  62555. h.setX(f, w),
  62556. f++;
  62557. }
  62558. if (
  62559. (this.setIndex(h),
  62560. this.addAttribute('position', u),
  62561. this.addAttribute('uv', d),
  62562. this.computeVertexNormals(),
  62563. r === 2 * Math.PI)
  62564. ) {
  62565. var _ = this.attributes.normal.array,
  62566. T = new n.Vector3(),
  62567. x = new n.Vector3(),
  62568. S = new n.Vector3();
  62569. for (o = t * e.length * 3, a = 0, s = 0; a < e.length; a++, s += 3)
  62570. (T.x = _[s + 0]),
  62571. (T.y = _[s + 1]),
  62572. (T.z = _[s + 2]),
  62573. (x.x = _[o + s + 0]),
  62574. (x.y = _[o + s + 1]),
  62575. (x.z = _[o + s + 2]),
  62576. S.addVectors(T, x).normalize(),
  62577. (_[s + 0] = _[o + s + 0] = S.x),
  62578. (_[s + 1] = _[o + s + 1] = S.y),
  62579. (_[s + 2] = _[o + s + 2] = S.z);
  62580. }
  62581. }),
  62582. (n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62583. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  62584. (n.LatheGeometry = function (e, t, i, r) {
  62585. n.Geometry.call(this),
  62586. (this.type = 'LatheGeometry'),
  62587. (this.parameters = {
  62588. points: e,
  62589. segments: t,
  62590. phiStart: i,
  62591. phiLength: r,
  62592. }),
  62593. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  62594. this.mergeVertices();
  62595. }),
  62596. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  62597. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  62598. (n.PlaneGeometry = function (e, t, i, r) {
  62599. n.Geometry.call(this),
  62600. (this.type = 'PlaneGeometry'),
  62601. (this.parameters = {
  62602. width: e,
  62603. height: t,
  62604. widthSegments: i,
  62605. heightSegments: r,
  62606. }),
  62607. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r));
  62608. }),
  62609. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  62610. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  62611. (n.PlaneBufferGeometry = function (e, t, i, r) {
  62612. n.BufferGeometry.call(this),
  62613. (this.type = 'PlaneBufferGeometry'),
  62614. (this.parameters = {
  62615. width: e,
  62616. height: t,
  62617. widthSegments: i,
  62618. heightSegments: r,
  62619. });
  62620. for (
  62621. var o = e / 2,
  62622. a = t / 2,
  62623. s = Math.floor(i) || 1,
  62624. l = Math.floor(r) || 1,
  62625. c = s + 1,
  62626. h = l + 1,
  62627. u = e / s,
  62628. d = t / l,
  62629. p = new Float32Array(c * h * 3),
  62630. f = new Float32Array(c * h * 3),
  62631. g = new Float32Array(c * h * 2),
  62632. m = 0,
  62633. v = 0,
  62634. A = 0;
  62635. A < h;
  62636. A++
  62637. )
  62638. for (var y = A * d - a, C = 0; C < c; C++) {
  62639. var I = C * u - o;
  62640. (p[m] = I),
  62641. (p[m + 1] = -y),
  62642. (f[m + 2] = 1),
  62643. (g[v] = C / s),
  62644. (g[v + 1] = 1 - A / l),
  62645. (m += 3),
  62646. (v += 2);
  62647. }
  62648. m = 0;
  62649. for (
  62650. var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0;
  62651. A < l;
  62652. A++
  62653. )
  62654. for (var C = 0; C < s; C++) {
  62655. var b = C + c * A,
  62656. w = C + c * (A + 1),
  62657. _ = C + 1 + c * (A + 1),
  62658. T = C + 1 + c * A;
  62659. (E[m] = b),
  62660. (E[m + 1] = w),
  62661. (E[m + 2] = T),
  62662. (E[m + 3] = w),
  62663. (E[m + 4] = _),
  62664. (E[m + 5] = T),
  62665. (m += 6);
  62666. }
  62667. this.setIndex(new n.BufferAttribute(E, 1)),
  62668. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  62669. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  62670. this.addAttribute('uv', new n.BufferAttribute(g, 2));
  62671. }),
  62672. (n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62673. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  62674. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  62675. n.BufferGeometry.call(this),
  62676. (this.type = 'RingBufferGeometry'),
  62677. (this.parameters = {
  62678. innerRadius: e,
  62679. outerRadius: t,
  62680. thetaSegments: i,
  62681. phiSegments: r,
  62682. thetaStart: o,
  62683. thetaLength: a,
  62684. }),
  62685. (e = e || 20),
  62686. (t = t || 50),
  62687. (o = void 0 !== o ? o : 0),
  62688. (a = void 0 !== a ? a : 2 * Math.PI),
  62689. (i = void 0 !== i ? Math.max(3, i) : 8),
  62690. (r = void 0 !== r ? Math.max(1, r) : 1);
  62691. var s,
  62692. l,
  62693. c,
  62694. h = (i + 1) * (r + 1),
  62695. u = i * r * 2 * 3,
  62696. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  62697. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62698. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62699. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  62700. m = 0,
  62701. v = 0,
  62702. A = e,
  62703. y = (t - e) / r,
  62704. C = new n.Vector3(),
  62705. I = new n.Vector2();
  62706. for (l = 0; l <= r; l++) {
  62707. for (c = 0; c <= i; c++)
  62708. (s = o + (c / i) * a),
  62709. (C.x = A * Math.cos(s)),
  62710. (C.y = A * Math.sin(s)),
  62711. p.setXYZ(m, C.x, C.y, C.z),
  62712. f.setXYZ(m, 0, 0, 1),
  62713. (I.x = (C.x / t + 1) / 2),
  62714. (I.y = (C.y / t + 1) / 2),
  62715. g.setXY(m, I.x, I.y),
  62716. m++;
  62717. A += y;
  62718. }
  62719. for (l = 0; l < r; l++) {
  62720. var E = l * (i + 1);
  62721. for (c = 0; c < i; c++) {
  62722. s = c + E;
  62723. var b = s,
  62724. w = s + i + 1,
  62725. _ = s + i + 2,
  62726. T = s + 1;
  62727. d.setX(v, b),
  62728. v++,
  62729. d.setX(v, w),
  62730. v++,
  62731. d.setX(v, _),
  62732. v++,
  62733. d.setX(v, b),
  62734. v++,
  62735. d.setX(v, _),
  62736. v++,
  62737. d.setX(v, T),
  62738. v++;
  62739. }
  62740. }
  62741. this.setIndex(d),
  62742. this.addAttribute('position', p),
  62743. this.addAttribute('normal', f),
  62744. this.addAttribute('uv', g);
  62745. }),
  62746. (n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62747. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  62748. (n.RingGeometry = function (e, t, i, r, o, a) {
  62749. n.Geometry.call(this),
  62750. (this.type = 'RingGeometry'),
  62751. (this.parameters = {
  62752. innerRadius: e,
  62753. outerRadius: t,
  62754. thetaSegments: i,
  62755. phiSegments: r,
  62756. thetaStart: o,
  62757. thetaLength: a,
  62758. }),
  62759. this.fromBufferGeometry(new n.RingBufferGeometry(e, t, i, r, o, a));
  62760. }),
  62761. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  62762. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  62763. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  62764. n.Geometry.call(this),
  62765. (this.type = 'SphereGeometry'),
  62766. (this.parameters = {
  62767. radius: e,
  62768. widthSegments: t,
  62769. heightSegments: i,
  62770. phiStart: r,
  62771. phiLength: o,
  62772. thetaStart: a,
  62773. thetaLength: s,
  62774. }),
  62775. this.fromBufferGeometry(new n.SphereBufferGeometry(e, t, i, r, o, a, s));
  62776. }),
  62777. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  62778. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  62779. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  62780. n.BufferGeometry.call(this),
  62781. (this.type = 'SphereBufferGeometry'),
  62782. (this.parameters = {
  62783. radius: e,
  62784. widthSegments: t,
  62785. heightSegments: i,
  62786. phiStart: r,
  62787. phiLength: o,
  62788. thetaStart: a,
  62789. thetaLength: s,
  62790. }),
  62791. (e = e || 50),
  62792. (t = Math.max(3, Math.floor(t) || 8)),
  62793. (i = Math.max(2, Math.floor(i) || 6)),
  62794. (r = void 0 !== r ? r : 0),
  62795. (o = void 0 !== o ? o : 2 * Math.PI),
  62796. (a = void 0 !== a ? a : 0),
  62797. (s = void 0 !== s ? s : Math.PI);
  62798. for (
  62799. var l = a + s,
  62800. c = (t + 1) * (i + 1),
  62801. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62802. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62803. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  62804. p = 0,
  62805. f = [],
  62806. g = new n.Vector3(),
  62807. m = 0;
  62808. m <= i;
  62809. m++
  62810. ) {
  62811. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  62812. var C = y / t,
  62813. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  62814. E = e * Math.cos(a + A * s),
  62815. b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  62816. g.set(I, E, b).normalize(),
  62817. h.setXYZ(p, I, E, b),
  62818. u.setXYZ(p, g.x, g.y, g.z),
  62819. d.setXY(p, C, 1 - A),
  62820. v.push(p),
  62821. p++;
  62822. }
  62823. f.push(v);
  62824. }
  62825. for (var w = [], m = 0; m < i; m++)
  62826. for (var y = 0; y < t; y++) {
  62827. var _ = f[m][y + 1],
  62828. T = f[m][y],
  62829. x = f[m + 1][y],
  62830. S = f[m + 1][y + 1];
  62831. (0 !== m || a > 0) && w.push(_, T, S),
  62832. (m !== i - 1 || l < Math.PI) && w.push(T, x, S);
  62833. }
  62834. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w, 1)),
  62835. this.addAttribute('position', h),
  62836. this.addAttribute('normal', u),
  62837. this.addAttribute('uv', d),
  62838. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  62839. }),
  62840. (n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62841. (n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry),
  62842. (n.TextGeometry = function (e, t) {
  62843. t = t || {};
  62844. var i = t.font;
  62845. if (i instanceof n.Font == !1)
  62846. return (
  62847. console.error(
  62848. 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.'
  62849. ),
  62850. new n.Geometry()
  62851. );
  62852. var r = i.generateShapes(e, t.size, t.curveSegments);
  62853. (t.amount = void 0 !== t.height ? t.height : 50),
  62854. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  62855. void 0 === t.bevelSize && (t.bevelSize = 8),
  62856. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  62857. n.ExtrudeGeometry.call(this, r, t),
  62858. (this.type = 'TextGeometry');
  62859. }),
  62860. (n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype)),
  62861. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  62862. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  62863. n.BufferGeometry.call(this),
  62864. (this.type = 'TorusBufferGeometry'),
  62865. (this.parameters = {
  62866. radius: e,
  62867. tube: t,
  62868. radialSegments: i,
  62869. tubularSegments: r,
  62870. arc: o,
  62871. }),
  62872. (e = e || 100),
  62873. (t = t || 40),
  62874. (i = Math.floor(i) || 8),
  62875. (r = Math.floor(r) || 6),
  62876. (o = o || 2 * Math.PI);
  62877. var a,
  62878. s,
  62879. l = (i + 1) * (r + 1),
  62880. c = i * r * 2 * 3,
  62881. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  62882. u = new Float32Array(3 * l),
  62883. d = new Float32Array(3 * l),
  62884. p = new Float32Array(2 * l),
  62885. f = 0,
  62886. g = 0,
  62887. m = 0,
  62888. v = new n.Vector3(),
  62889. A = new n.Vector3(),
  62890. y = new n.Vector3();
  62891. for (a = 0; a <= i; a++)
  62892. for (s = 0; s <= r; s++) {
  62893. var C = (s / r) * o,
  62894. I = (a / i) * Math.PI * 2;
  62895. (A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  62896. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  62897. (A.z = t * Math.sin(I)),
  62898. (u[f] = A.x),
  62899. (u[f + 1] = A.y),
  62900. (u[f + 2] = A.z),
  62901. (v.x = e * Math.cos(C)),
  62902. (v.y = e * Math.sin(C)),
  62903. y.subVectors(A, v).normalize(),
  62904. (d[f] = y.x),
  62905. (d[f + 1] = y.y),
  62906. (d[f + 2] = y.z),
  62907. (p[g] = s / r),
  62908. (p[g + 1] = a / i),
  62909. (f += 3),
  62910. (g += 2);
  62911. }
  62912. for (a = 1; a <= i; a++)
  62913. for (s = 1; s <= r; s++) {
  62914. var E = (r + 1) * a + s - 1,
  62915. b = (r + 1) * (a - 1) + s - 1,
  62916. w = (r + 1) * (a - 1) + s,
  62917. _ = (r + 1) * a + s;
  62918. (h[m] = E),
  62919. (h[m + 1] = b),
  62920. (h[m + 2] = _),
  62921. (h[m + 3] = b),
  62922. (h[m + 4] = w),
  62923. (h[m + 5] = _),
  62924. (m += 6);
  62925. }
  62926. this.setIndex(new n.BufferAttribute(h, 1)),
  62927. this.addAttribute('position', new n.BufferAttribute(u, 3)),
  62928. this.addAttribute('normal', new n.BufferAttribute(d, 3)),
  62929. this.addAttribute('uv', new n.BufferAttribute(p, 2));
  62930. }),
  62931. (n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62932. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  62933. (n.TorusGeometry = function (e, t, i, r, o) {
  62934. n.Geometry.call(this),
  62935. (this.type = 'TorusGeometry'),
  62936. (this.parameters = {
  62937. radius: e,
  62938. tube: t,
  62939. radialSegments: i,
  62940. tubularSegments: r,
  62941. arc: o,
  62942. }),
  62943. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o));
  62944. }),
  62945. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  62946. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  62947. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  62948. function s(e, t, i, n, r) {
  62949. var o = Math.cos(e),
  62950. a = Math.sin(e),
  62951. s = (i / t) * e,
  62952. l = Math.cos(s);
  62953. (r.x = n * (2 + l) * 0.5 * o),
  62954. (r.y = n * (2 + l) * a * 0.5),
  62955. (r.z = n * Math.sin(s) * 0.5);
  62956. }
  62957. n.BufferGeometry.call(this),
  62958. (this.type = 'TorusKnotBufferGeometry'),
  62959. (this.parameters = {
  62960. radius: e,
  62961. tube: t,
  62962. tubularSegments: i,
  62963. radialSegments: r,
  62964. p: o,
  62965. q: a,
  62966. }),
  62967. (e = e || 100),
  62968. (t = t || 40),
  62969. (i = Math.floor(i) || 64),
  62970. (r = Math.floor(r) || 8),
  62971. (o = o || 2),
  62972. (a = a || 3);
  62973. var l,
  62974. c,
  62975. h = (r + 1) * (i + 1),
  62976. u = r * i * 2 * 3,
  62977. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  62978. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62979. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62980. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  62981. m = 0,
  62982. v = 0,
  62983. A = new n.Vector3(),
  62984. y = new n.Vector3(),
  62985. C = new n.Vector2(),
  62986. I = new n.Vector3(),
  62987. E = new n.Vector3(),
  62988. b = new n.Vector3(),
  62989. w = new n.Vector3(),
  62990. _ = new n.Vector3();
  62991. for (l = 0; l <= i; ++l) {
  62992. var T = (l / i) * o * Math.PI * 2;
  62993. for (
  62994. s(T, o, a, e, I),
  62995. s(T + 0.01, o, a, e, E),
  62996. w.subVectors(E, I),
  62997. _.addVectors(E, I),
  62998. b.crossVectors(w, _),
  62999. _.crossVectors(b, w),
  63000. b.normalize(),
  63001. _.normalize(),
  63002. c = 0;
  63003. c <= r;
  63004. ++c
  63005. ) {
  63006. var x = (c / r) * Math.PI * 2,
  63007. S = -t * Math.cos(x),
  63008. M = t * Math.sin(x);
  63009. (A.x = I.x + (S * _.x + M * b.x)),
  63010. (A.y = I.y + (S * _.y + M * b.y)),
  63011. (A.z = I.z + (S * _.z + M * b.z)),
  63012. p.setXYZ(m, A.x, A.y, A.z),
  63013. y.subVectors(A, I).normalize(),
  63014. f.setXYZ(m, y.x, y.y, y.z),
  63015. (C.x = l / i),
  63016. (C.y = c / r),
  63017. g.setXY(m, C.x, C.y),
  63018. m++;
  63019. }
  63020. }
  63021. for (c = 1; c <= i; c++)
  63022. for (l = 1; l <= r; l++) {
  63023. var R = (r + 1) * (c - 1) + (l - 1),
  63024. P = (r + 1) * c + (l - 1),
  63025. O = (r + 1) * c + l,
  63026. L = (r + 1) * (c - 1) + l;
  63027. d.setX(v, R),
  63028. v++,
  63029. d.setX(v, P),
  63030. v++,
  63031. d.setX(v, L),
  63032. v++,
  63033. d.setX(v, P),
  63034. v++,
  63035. d.setX(v, O),
  63036. v++,
  63037. d.setX(v, L),
  63038. v++;
  63039. }
  63040. this.setIndex(d),
  63041. this.addAttribute('position', p),
  63042. this.addAttribute('normal', f),
  63043. this.addAttribute('uv', g);
  63044. }),
  63045. (n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63046. (n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry),
  63047. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  63048. n.Geometry.call(this),
  63049. (this.type = 'TorusKnotGeometry'),
  63050. (this.parameters = {
  63051. radius: e,
  63052. tube: t,
  63053. tubularSegments: i,
  63054. radialSegments: r,
  63055. p: o,
  63056. q: a,
  63057. }),
  63058. void 0 !== s &&
  63059. console.warn(
  63060. 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'
  63061. ),
  63062. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e, t, i, r, o, a)),
  63063. this.mergeVertices();
  63064. }),
  63065. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  63066. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  63067. (n.TubeGeometry = function (e, t, i, r, o, a) {
  63068. function s(e, t, i) {
  63069. return R.vertices.push(new n.Vector3(e, t, i)) - 1;
  63070. }
  63071. n.Geometry.call(this),
  63072. (this.type = 'TubeGeometry'),
  63073. (this.parameters = {
  63074. path: e,
  63075. segments: t,
  63076. radius: i,
  63077. radialSegments: r,
  63078. closed: o,
  63079. taper: a,
  63080. }),
  63081. (t = t || 64),
  63082. (i = i || 1),
  63083. (r = r || 8),
  63084. (o = o || !1),
  63085. (a = a || n.TubeGeometry.NoTaper);
  63086. var l,
  63087. c,
  63088. h,
  63089. u,
  63090. d,
  63091. p,
  63092. f,
  63093. g,
  63094. m,
  63095. v,
  63096. A,
  63097. y,
  63098. C,
  63099. I,
  63100. E,
  63101. b,
  63102. w,
  63103. _,
  63104. T,
  63105. x,
  63106. S,
  63107. M = [],
  63108. R = this,
  63109. P = t + 1,
  63110. O = new n.Vector3(),
  63111. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  63112. D = L.tangents,
  63113. N = L.normals,
  63114. B = L.binormals;
  63115. for (this.tangents = D, this.normals = N, this.binormals = B, v = 0; v < P; v++)
  63116. for (
  63117. M[v] = [],
  63118. u = v / (P - 1),
  63119. m = e.getPointAt(u),
  63120. l = D[v],
  63121. c = N[v],
  63122. h = B[v],
  63123. p = i * a(u),
  63124. A = 0;
  63125. A < r;
  63126. A++
  63127. )
  63128. (d = (A / r) * 2 * Math.PI),
  63129. (f = -p * Math.cos(d)),
  63130. (g = p * Math.sin(d)),
  63131. O.copy(m),
  63132. (O.x += f * c.x + g * h.x),
  63133. (O.y += f * c.y + g * h.y),
  63134. (O.z += f * c.z + g * h.z),
  63135. (M[v][A] = s(O.x, O.y, O.z));
  63136. for (v = 0; v < t; v++)
  63137. for (A = 0; A < r; A++)
  63138. (y = o ? (v + 1) % t : v + 1),
  63139. (C = (A + 1) % r),
  63140. (I = M[v][A]),
  63141. (E = M[y][A]),
  63142. (b = M[y][C]),
  63143. (w = M[v][C]),
  63144. (_ = new n.Vector2(v / t, A / r)),
  63145. (T = new n.Vector2((v + 1) / t, A / r)),
  63146. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  63147. (S = new n.Vector2(v / t, (A + 1) / r)),
  63148. this.faces.push(new n.Face3(I, E, w)),
  63149. this.faceVertexUvs[0].push([_, T, S]),
  63150. this.faces.push(new n.Face3(E, b, w)),
  63151. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  63152. this.computeFaceNormals(), this.computeVertexNormals();
  63153. }),
  63154. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  63155. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  63156. (n.TubeGeometry.NoTaper = function (e) {
  63157. return 1;
  63158. }),
  63159. (n.TubeGeometry.SinusoidalTaper = function (e) {
  63160. return Math.sin(Math.PI * e);
  63161. }),
  63162. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  63163. function r() {
  63164. (f[0] = new n.Vector3()),
  63165. (g[0] = new n.Vector3()),
  63166. (a = Number.MAX_VALUE),
  63167. (s = Math.abs(p[0].x)),
  63168. (l = Math.abs(p[0].y)),
  63169. (c = Math.abs(p[0].z)),
  63170. s <= a && ((a = s), d.set(1, 0, 0)),
  63171. l <= a && ((a = l), d.set(0, 1, 0)),
  63172. c <= a && d.set(0, 0, 1),
  63173. m.crossVectors(p[0], d).normalize(),
  63174. f[0].crossVectors(p[0], m),
  63175. g[0].crossVectors(p[0], f[0]);
  63176. }
  63177. var o,
  63178. a,
  63179. s,
  63180. l,
  63181. c,
  63182. h,
  63183. u,
  63184. d = new n.Vector3(),
  63185. p = [],
  63186. f = [],
  63187. g = [],
  63188. m = new n.Vector3(),
  63189. v = new n.Matrix4(),
  63190. A = t + 1;
  63191. for (this.tangents = p, this.normals = f, this.binormals = g, h = 0; h < A; h++)
  63192. (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize();
  63193. for (r(), h = 1; h < A; h++)
  63194. (f[h] = f[h - 1].clone()),
  63195. (g[h] = g[h - 1].clone()),
  63196. m.crossVectors(p[h - 1], p[h]),
  63197. m.length() > Number.EPSILON &&
  63198. (m.normalize(),
  63199. (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))),
  63200. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  63201. g[h].crossVectors(p[h], f[h]);
  63202. if (i)
  63203. for (
  63204. o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  63205. o /= A - 1,
  63206. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  63207. h = 1;
  63208. h < A;
  63209. h++
  63210. )
  63211. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)), g[h].crossVectors(p[h], f[h]);
  63212. }),
  63213. (n.PolyhedronGeometry = function (e, t, i, r) {
  63214. function o(e) {
  63215. var t = e.normalize().clone();
  63216. t.index = u.vertices.push(t) - 1;
  63217. var i = l(e) / 2 / Math.PI + 0.5,
  63218. r = c(e) / Math.PI + 0.5;
  63219. return (t.uv = new n.Vector2(i, 1 - r)), t;
  63220. }
  63221. function a(e, t, i, r) {
  63222. var o = new n.Face3(
  63223. e.index,
  63224. t.index,
  63225. i.index,
  63226. [e.clone(), t.clone(), i.clone()],
  63227. void 0,
  63228. r
  63229. );
  63230. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3);
  63231. var a = l(C);
  63232. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)]);
  63233. }
  63234. function s(e, t) {
  63235. for (
  63236. var i = Math.pow(2, t),
  63237. n = o(u.vertices[e.a]),
  63238. r = o(u.vertices[e.b]),
  63239. s = o(u.vertices[e.c]),
  63240. l = [],
  63241. c = e.materialIndex,
  63242. h = 0;
  63243. h <= i;
  63244. h++
  63245. ) {
  63246. l[h] = [];
  63247. for (
  63248. var d = o(n.clone().lerp(s, h / i)),
  63249. p = o(r.clone().lerp(s, h / i)),
  63250. f = i - h,
  63251. g = 0;
  63252. g <= f;
  63253. g++
  63254. )
  63255. 0 === g && h === i ? (l[h][g] = d) : (l[h][g] = o(d.clone().lerp(p, g / f)));
  63256. }
  63257. for (var h = 0; h < i; h++)
  63258. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  63259. var m = Math.floor(g / 2);
  63260. g % 2 === 0
  63261. ? a(l[h][m + 1], l[h + 1][m], l[h][m], c)
  63262. : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c);
  63263. }
  63264. }
  63265. function l(e) {
  63266. return Math.atan2(e.z, -e.x);
  63267. }
  63268. function c(e) {
  63269. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z));
  63270. }
  63271. function h(e, t, i) {
  63272. return (
  63273. i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)),
  63274. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)),
  63275. e.clone()
  63276. );
  63277. }
  63278. n.Geometry.call(this),
  63279. (this.type = 'PolyhedronGeometry'),
  63280. (this.parameters = {
  63281. vertices: e,
  63282. indices: t,
  63283. radius: i,
  63284. detail: r,
  63285. }),
  63286. (i = i || 1),
  63287. (r = r || 0);
  63288. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  63289. o(new n.Vector3(e[d], e[d + 1], e[d + 2]));
  63290. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3, m++) {
  63291. var v = f[t[d]],
  63292. A = f[t[d + 1]],
  63293. y = f[t[d + 2]];
  63294. g[m] = new n.Face3(
  63295. v.index,
  63296. A.index,
  63297. y.index,
  63298. [v.clone(), A.clone(), y.clone()],
  63299. void 0,
  63300. m
  63301. );
  63302. }
  63303. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++) s(g[d], r);
  63304. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  63305. var I = this.faceVertexUvs[0][d],
  63306. E = I[0].x,
  63307. b = I[1].x,
  63308. w = I[2].x,
  63309. _ = Math.max(E, b, w),
  63310. T = Math.min(E, b, w);
  63311. _ > 0.9 &&
  63312. T < 0.1 &&
  63313. (E < 0.2 && (I[0].x += 1), b < 0.2 && (I[1].x += 1), w < 0.2 && (I[2].x += 1));
  63314. }
  63315. for (var d = 0, p = this.vertices.length; d < p; d++)
  63316. this.vertices[d].multiplyScalar(i);
  63317. this.mergeVertices(),
  63318. this.computeFaceNormals(),
  63319. (this.boundingSphere = new n.Sphere(new n.Vector3(), i));
  63320. }),
  63321. (n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype)),
  63322. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  63323. (n.DodecahedronGeometry = function (e, t) {
  63324. var i = (1 + Math.sqrt(5)) / 2,
  63325. r = 1 / i,
  63326. o = [
  63327. -1,
  63328. -1,
  63329. -1,
  63330. -1,
  63331. -1,
  63332. 1,
  63333. -1,
  63334. 1,
  63335. -1,
  63336. -1,
  63337. 1,
  63338. 1,
  63339. 1,
  63340. -1,
  63341. -1,
  63342. 1,
  63343. -1,
  63344. 1,
  63345. 1,
  63346. 1,
  63347. -1,
  63348. 1,
  63349. 1,
  63350. 1,
  63351. 0,
  63352. -r,
  63353. -i,
  63354. 0,
  63355. -r,
  63356. i,
  63357. 0,
  63358. r,
  63359. -i,
  63360. 0,
  63361. r,
  63362. i,
  63363. -r,
  63364. -i,
  63365. 0,
  63366. -r,
  63367. i,
  63368. 0,
  63369. r,
  63370. -i,
  63371. 0,
  63372. r,
  63373. i,
  63374. 0,
  63375. -i,
  63376. 0,
  63377. -r,
  63378. i,
  63379. 0,
  63380. -r,
  63381. -i,
  63382. 0,
  63383. r,
  63384. i,
  63385. 0,
  63386. r,
  63387. ],
  63388. a = [
  63389. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10,
  63390. 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6,
  63391. 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4,
  63392. 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19,
  63393. 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9,
  63394. ];
  63395. n.PolyhedronGeometry.call(this, o, a, e, t),
  63396. (this.type = 'DodecahedronGeometry'),
  63397. (this.parameters = {
  63398. radius: e,
  63399. detail: t,
  63400. });
  63401. }),
  63402. (n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63403. (n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry),
  63404. (n.IcosahedronGeometry = function (e, t) {
  63405. var i = (1 + Math.sqrt(5)) / 2,
  63406. r = [
  63407. -1,
  63408. i,
  63409. 0,
  63410. 1,
  63411. i,
  63412. 0,
  63413. -1,
  63414. -i,
  63415. 0,
  63416. 1,
  63417. -i,
  63418. 0,
  63419. 0,
  63420. -1,
  63421. i,
  63422. 0,
  63423. 1,
  63424. i,
  63425. 0,
  63426. -1,
  63427. -i,
  63428. 0,
  63429. 1,
  63430. -i,
  63431. i,
  63432. 0,
  63433. -1,
  63434. i,
  63435. 0,
  63436. 1,
  63437. -i,
  63438. 0,
  63439. -1,
  63440. -i,
  63441. 0,
  63442. 1,
  63443. ],
  63444. o = [
  63445. 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10,
  63446. 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2,
  63447. 10, 8, 6, 7, 9, 8, 1,
  63448. ];
  63449. n.PolyhedronGeometry.call(this, r, o, e, t),
  63450. (this.type = 'IcosahedronGeometry'),
  63451. (this.parameters = {
  63452. radius: e,
  63453. detail: t,
  63454. });
  63455. }),
  63456. (n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63457. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  63458. (n.OctahedronGeometry = function (e, t) {
  63459. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  63460. r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  63461. n.PolyhedronGeometry.call(this, i, r, e, t),
  63462. (this.type = 'OctahedronGeometry'),
  63463. (this.parameters = {
  63464. radius: e,
  63465. detail: t,
  63466. });
  63467. }),
  63468. (n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63469. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  63470. (n.TetrahedronGeometry = function (e, t) {
  63471. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  63472. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  63473. n.PolyhedronGeometry.call(this, i, r, e, t),
  63474. (this.type = 'TetrahedronGeometry'),
  63475. (this.parameters = {
  63476. radius: e,
  63477. detail: t,
  63478. });
  63479. }),
  63480. (n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63481. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  63482. (n.ParametricGeometry = function (e, t, i) {
  63483. n.Geometry.call(this),
  63484. (this.type = 'ParametricGeometry'),
  63485. (this.parameters = {
  63486. func: e,
  63487. slices: t,
  63488. stacks: i,
  63489. });
  63490. var r,
  63491. o,
  63492. a,
  63493. s,
  63494. l,
  63495. c = this.vertices,
  63496. h = this.faces,
  63497. u = this.faceVertexUvs[0],
  63498. d = t + 1;
  63499. for (r = 0; r <= i; r++)
  63500. for (l = r / i, o = 0; o <= t; o++) (s = o / t), (a = e(s, l)), c.push(a);
  63501. var p, f, g, m, v, A, y, C;
  63502. for (r = 0; r < i; r++)
  63503. for (o = 0; o < t; o++)
  63504. (p = r * d + o),
  63505. (f = r * d + o + 1),
  63506. (g = (r + 1) * d + o + 1),
  63507. (m = (r + 1) * d + o),
  63508. (v = new n.Vector2(o / t, r / i)),
  63509. (A = new n.Vector2((o + 1) / t, r / i)),
  63510. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  63511. (C = new n.Vector2(o / t, (r + 1) / i)),
  63512. h.push(new n.Face3(p, f, m)),
  63513. u.push([v, A, C]),
  63514. h.push(new n.Face3(f, g, m)),
  63515. u.push([A.clone(), y, C.clone()]);
  63516. this.computeFaceNormals(), this.computeVertexNormals();
  63517. }),
  63518. (n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype)),
  63519. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  63520. (n.WireframeGeometry = function (e) {
  63521. function t(e, t) {
  63522. return e - t;
  63523. }
  63524. n.BufferGeometry.call(this);
  63525. var i = [0, 0],
  63526. r = {},
  63527. o = ['a', 'b', 'c'];
  63528. if (e instanceof n.Geometry) {
  63529. for (
  63530. var a = e.vertices,
  63531. s = e.faces,
  63532. l = 0,
  63533. c = new Uint32Array(6 * s.length),
  63534. h = 0,
  63535. u = s.length;
  63536. h < u;
  63537. h++
  63538. )
  63539. for (var d = s[h], p = 0; p < 3; p++) {
  63540. (i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t);
  63541. var f = i.toString();
  63542. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++);
  63543. }
  63544. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63545. for (var p = 0; p < 2; p++) {
  63546. var m = a[c[2 * h + p]],
  63547. v = 6 * h + 3 * p;
  63548. (g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z);
  63549. }
  63550. this.addAttribute('position', new n.BufferAttribute(g, 3));
  63551. } else if (e instanceof n.BufferGeometry)
  63552. if (null !== e.index) {
  63553. var A = e.index.array,
  63554. a = e.attributes.position,
  63555. y = e.groups,
  63556. l = 0;
  63557. 0 === y.length && e.addGroup(0, A.length);
  63558. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  63559. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  63560. for (var p = 0; p < 3; p++) {
  63561. (i[0] = A[h + p]), (i[1] = A[h + ((p + 1) % 3)]), i.sort(t);
  63562. var f = i.toString();
  63563. void 0 === r[f] &&
  63564. ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++);
  63565. }
  63566. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63567. for (var p = 0; p < 2; p++) {
  63568. var v = 6 * h + 3 * p,
  63569. T = c[2 * h + p];
  63570. (g[v + 0] = a.getX(T)), (g[v + 1] = a.getY(T)), (g[v + 2] = a.getZ(T));
  63571. }
  63572. this.addAttribute('position', new n.BufferAttribute(g, 3));
  63573. } else {
  63574. for (
  63575. var a = e.attributes.position.array,
  63576. l = a.length / 3,
  63577. x = l / 3,
  63578. g = new Float32Array(2 * l * 3),
  63579. h = 0,
  63580. u = x;
  63581. h < u;
  63582. h++
  63583. )
  63584. for (var p = 0; p < 3; p++) {
  63585. var v = 18 * h + 6 * p,
  63586. S = 9 * h + 3 * p;
  63587. (g[v + 0] = a[S]), (g[v + 1] = a[S + 1]), (g[v + 2] = a[S + 2]);
  63588. var T = 9 * h + 3 * ((p + 1) % 3);
  63589. (g[v + 3] = a[T]), (g[v + 4] = a[T + 1]), (g[v + 5] = a[T + 2]);
  63590. }
  63591. this.addAttribute('position', new n.BufferAttribute(g, 3));
  63592. }
  63593. }),
  63594. (n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63595. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  63596. (n.AxisHelper = function (e) {
  63597. e = e || 1;
  63598. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  63599. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  63600. r = new n.BufferGeometry();
  63601. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  63602. r.addAttribute('color', new n.BufferAttribute(i, 3));
  63603. var o = new n.LineBasicMaterial({
  63604. vertexColors: n.VertexColors,
  63605. });
  63606. n.LineSegments.call(this, r, o);
  63607. }),
  63608. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  63609. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  63610. (n.ArrowHelper = (function () {
  63611. var e = new n.Geometry();
  63612. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0));
  63613. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1);
  63614. return (
  63615. t.translate(0, -0.5, 0),
  63616. function (i, r, o, a, s, l) {
  63617. n.Object3D.call(this),
  63618. void 0 === a && (a = 16776960),
  63619. void 0 === o && (o = 1),
  63620. void 0 === s && (s = 0.2 * o),
  63621. void 0 === l && (l = 0.2 * s),
  63622. this.position.copy(r),
  63623. (this.line = new n.Line(
  63624. e,
  63625. new n.LineBasicMaterial({
  63626. color: a,
  63627. })
  63628. )),
  63629. (this.line.matrixAutoUpdate = !1),
  63630. this.add(this.line),
  63631. (this.cone = new n.Mesh(
  63632. t,
  63633. new n.MeshBasicMaterial({
  63634. color: a,
  63635. })
  63636. )),
  63637. (this.cone.matrixAutoUpdate = !1),
  63638. this.add(this.cone),
  63639. this.setDirection(i),
  63640. this.setLength(o, s, l);
  63641. }
  63642. );
  63643. })()),
  63644. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  63645. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  63646. (n.ArrowHelper.prototype.setDirection = (function () {
  63647. var e,
  63648. t = new n.Vector3();
  63649. return function (i) {
  63650. i.y > 0.99999
  63651. ? this.quaternion.set(0, 0, 0, 1)
  63652. : i.y < -0.99999
  63653. ? this.quaternion.set(1, 0, 0, 0)
  63654. : (t.set(i.z, 0, -i.x).normalize(),
  63655. (e = Math.acos(i.y)),
  63656. this.quaternion.setFromAxisAngle(t, e));
  63657. };
  63658. })()),
  63659. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  63660. void 0 === t && (t = 0.2 * e),
  63661. void 0 === i && (i = 0.2 * t),
  63662. this.line.scale.set(1, Math.max(0, e - t), 1),
  63663. this.line.updateMatrix(),
  63664. this.cone.scale.set(i, t, i),
  63665. (this.cone.position.y = e),
  63666. this.cone.updateMatrix();
  63667. }),
  63668. (n.ArrowHelper.prototype.setColor = function (e) {
  63669. this.line.material.color.set(e), this.cone.material.color.set(e);
  63670. }),
  63671. (n.BoxHelper = function (e) {
  63672. var t = new Uint16Array([
  63673. 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7,
  63674. ]),
  63675. i = new Float32Array(24),
  63676. r = new n.BufferGeometry();
  63677. r.setIndex(new n.BufferAttribute(t, 1)),
  63678. r.addAttribute('position', new n.BufferAttribute(i, 3)),
  63679. n.LineSegments.call(
  63680. this,
  63681. r,
  63682. new n.LineBasicMaterial({
  63683. color: 16776960,
  63684. })
  63685. ),
  63686. void 0 !== e && this.update(e);
  63687. }),
  63688. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  63689. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  63690. (n.BoxHelper.prototype.update = (function () {
  63691. var e = new n.Box3();
  63692. return function (t) {
  63693. if ((e.setFromObject(t), !e.isEmpty())) {
  63694. var i = e.min,
  63695. n = e.max,
  63696. r = this.geometry.attributes.position,
  63697. o = r.array;
  63698. (o[0] = n.x),
  63699. (o[1] = n.y),
  63700. (o[2] = n.z),
  63701. (o[3] = i.x),
  63702. (o[4] = n.y),
  63703. (o[5] = n.z),
  63704. (o[6] = i.x),
  63705. (o[7] = i.y),
  63706. (o[8] = n.z),
  63707. (o[9] = n.x),
  63708. (o[10] = i.y),
  63709. (o[11] = n.z),
  63710. (o[12] = n.x),
  63711. (o[13] = n.y),
  63712. (o[14] = i.z),
  63713. (o[15] = i.x),
  63714. (o[16] = n.y),
  63715. (o[17] = i.z),
  63716. (o[18] = i.x),
  63717. (o[19] = i.y),
  63718. (o[20] = i.z),
  63719. (o[21] = n.x),
  63720. (o[22] = i.y),
  63721. (o[23] = i.z),
  63722. (r.needsUpdate = !0),
  63723. this.geometry.computeBoundingSphere();
  63724. }
  63725. };
  63726. })()),
  63727. (n.BoundingBoxHelper = function (e, t) {
  63728. var i = void 0 !== t ? t : 8947848;
  63729. (this.object = e),
  63730. (this.box = new n.Box3()),
  63731. n.Mesh.call(
  63732. this,
  63733. new n.BoxGeometry(1, 1, 1),
  63734. new n.MeshBasicMaterial({
  63735. color: i,
  63736. wireframe: !0,
  63737. })
  63738. );
  63739. }),
  63740. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  63741. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  63742. (n.BoundingBoxHelper.prototype.update = function () {
  63743. this.box.setFromObject(this.object),
  63744. this.box.size(this.scale),
  63745. this.box.center(this.position);
  63746. }),
  63747. (n.CameraHelper = function (e) {
  63748. function t(e, t, n) {
  63749. i(e, n), i(t, n);
  63750. }
  63751. function i(e, t) {
  63752. r.vertices.push(new n.Vector3()),
  63753. r.colors.push(new n.Color(t)),
  63754. void 0 === a[e] && (a[e] = []),
  63755. a[e].push(r.vertices.length - 1);
  63756. }
  63757. var r = new n.Geometry(),
  63758. o = new n.LineBasicMaterial({
  63759. color: 16777215,
  63760. vertexColors: n.FaceColors,
  63761. }),
  63762. a = {},
  63763. s = 16755200,
  63764. l = 16711680,
  63765. c = 43775,
  63766. h = 16777215,
  63767. u = 3355443;
  63768. t('n1', 'n2', s),
  63769. t('n2', 'n4', s),
  63770. t('n4', 'n3', s),
  63771. t('n3', 'n1', s),
  63772. t('f1', 'f2', s),
  63773. t('f2', 'f4', s),
  63774. t('f4', 'f3', s),
  63775. t('f3', 'f1', s),
  63776. t('n1', 'f1', s),
  63777. t('n2', 'f2', s),
  63778. t('n3', 'f3', s),
  63779. t('n4', 'f4', s),
  63780. t('p', 'n1', l),
  63781. t('p', 'n2', l),
  63782. t('p', 'n3', l),
  63783. t('p', 'n4', l),
  63784. t('u1', 'u2', c),
  63785. t('u2', 'u3', c),
  63786. t('u3', 'u1', c),
  63787. t('c', 't', h),
  63788. t('p', 'c', u),
  63789. t('cn1', 'cn2', u),
  63790. t('cn3', 'cn4', u),
  63791. t('cf1', 'cf2', u),
  63792. t('cf3', 'cf4', u),
  63793. n.LineSegments.call(this, r, o),
  63794. (this.camera = e),
  63795. this.camera.updateProjectionMatrix(),
  63796. (this.matrix = e.matrixWorld),
  63797. (this.matrixAutoUpdate = !1),
  63798. (this.pointMap = a),
  63799. this.update();
  63800. }),
  63801. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  63802. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  63803. (n.CameraHelper.prototype.update = (function () {
  63804. function e(e, n, a, s) {
  63805. r.set(n, a, s).unproject(o);
  63806. var l = i[e];
  63807. if (void 0 !== l) for (var c = 0, h = l.length; c < h; c++) t.vertices[l[c]].copy(r);
  63808. }
  63809. var t,
  63810. i,
  63811. r = new n.Vector3(),
  63812. o = new n.Camera();
  63813. return function () {
  63814. (t = this.geometry), (i = this.pointMap);
  63815. var n = 1,
  63816. r = 1;
  63817. o.projectionMatrix.copy(this.camera.projectionMatrix),
  63818. e('c', 0, 0, -1),
  63819. e('t', 0, 0, 1),
  63820. e('n1', -n, -r, -1),
  63821. e('n2', n, -r, -1),
  63822. e('n3', -n, r, -1),
  63823. e('n4', n, r, -1),
  63824. e('f1', -n, -r, 1),
  63825. e('f2', n, -r, 1),
  63826. e('f3', -n, r, 1),
  63827. e('f4', n, r, 1),
  63828. e('u1', 0.7 * n, 1.1 * r, -1),
  63829. e('u2', 0.7 * -n, 1.1 * r, -1),
  63830. e('u3', 0, 2 * r, -1),
  63831. e('cf1', -n, 0, 1),
  63832. e('cf2', n, 0, 1),
  63833. e('cf3', 0, -r, 1),
  63834. e('cf4', 0, r, 1),
  63835. e('cn1', -n, 0, -1),
  63836. e('cn2', n, 0, -1),
  63837. e('cn3', 0, -r, -1),
  63838. e('cn4', 0, r, -1),
  63839. (t.verticesNeedUpdate = !0);
  63840. };
  63841. })()),
  63842. (n.DirectionalLightHelper = function (e, t) {
  63843. n.Object3D.call(this),
  63844. (this.light = e),
  63845. this.light.updateMatrixWorld(),
  63846. (this.matrix = e.matrixWorld),
  63847. (this.matrixAutoUpdate = !1),
  63848. (t = t || 1);
  63849. var i = new n.Geometry();
  63850. i.vertices.push(
  63851. new n.Vector3(-t, t, 0),
  63852. new n.Vector3(t, t, 0),
  63853. new n.Vector3(t, -t, 0),
  63854. new n.Vector3(-t, -t, 0),
  63855. new n.Vector3(-t, t, 0)
  63856. );
  63857. var r = new n.LineBasicMaterial({
  63858. fog: !1,
  63859. });
  63860. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63861. (this.lightPlane = new n.Line(i, r)),
  63862. this.add(this.lightPlane),
  63863. (i = new n.Geometry()),
  63864. i.vertices.push(new n.Vector3(), new n.Vector3()),
  63865. (r = new n.LineBasicMaterial({
  63866. fog: !1,
  63867. })),
  63868. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63869. (this.targetLine = new n.Line(i, r)),
  63870. this.add(this.targetLine),
  63871. this.update();
  63872. }),
  63873. (n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype)),
  63874. (n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper),
  63875. (n.DirectionalLightHelper.prototype.dispose = function () {
  63876. this.lightPlane.geometry.dispose(),
  63877. this.lightPlane.material.dispose(),
  63878. this.targetLine.geometry.dispose(),
  63879. this.targetLine.material.dispose();
  63880. }),
  63881. (n.DirectionalLightHelper.prototype.update = (function () {
  63882. var e = new n.Vector3(),
  63883. t = new n.Vector3(),
  63884. i = new n.Vector3();
  63885. return function () {
  63886. e.setFromMatrixPosition(this.light.matrixWorld),
  63887. t.setFromMatrixPosition(this.light.target.matrixWorld),
  63888. i.subVectors(t, e),
  63889. this.lightPlane.lookAt(i),
  63890. this.lightPlane.material.color
  63891. .copy(this.light.color)
  63892. .multiplyScalar(this.light.intensity),
  63893. this.targetLine.geometry.vertices[1].copy(i),
  63894. (this.targetLine.geometry.verticesNeedUpdate = !0),
  63895. this.targetLine.material.color.copy(this.lightPlane.material.color);
  63896. };
  63897. })()),
  63898. (n.EdgesHelper = function (e, t, i) {
  63899. var r = void 0 !== t ? t : 16777215;
  63900. n.LineSegments.call(
  63901. this,
  63902. new n.EdgesGeometry(e.geometry, i),
  63903. new n.LineBasicMaterial({
  63904. color: r,
  63905. })
  63906. ),
  63907. (this.matrix = e.matrixWorld),
  63908. (this.matrixAutoUpdate = !1);
  63909. }),
  63910. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  63911. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  63912. (n.FaceNormalsHelper = function (e, t, i, r) {
  63913. (this.object = e), (this.size = void 0 !== t ? t : 1);
  63914. var o = void 0 !== i ? i : 16776960,
  63915. a = void 0 !== r ? r : 1,
  63916. s = 0,
  63917. l = this.object.geometry;
  63918. l instanceof n.Geometry
  63919. ? (s = l.faces.length)
  63920. : console.warn(
  63921. 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.'
  63922. );
  63923. var c = new n.BufferGeometry(),
  63924. h = new n.Float32Attribute(2 * s * 3, 3);
  63925. c.addAttribute('position', h),
  63926. n.LineSegments.call(
  63927. this,
  63928. c,
  63929. new n.LineBasicMaterial({
  63930. color: o,
  63931. linewidth: a,
  63932. })
  63933. ),
  63934. (this.matrixAutoUpdate = !1),
  63935. this.update();
  63936. }),
  63937. (n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  63938. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  63939. (n.FaceNormalsHelper.prototype.update = (function () {
  63940. var e = new n.Vector3(),
  63941. t = new n.Vector3(),
  63942. i = new n.Matrix3();
  63943. return function () {
  63944. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld);
  63945. for (
  63946. var n = this.object.matrixWorld,
  63947. r = this.geometry.attributes.position,
  63948. o = this.object.geometry,
  63949. a = o.vertices,
  63950. s = o.faces,
  63951. l = 0,
  63952. c = 0,
  63953. h = s.length;
  63954. c < h;
  63955. c++
  63956. ) {
  63957. var u = s[c],
  63958. d = u.normal;
  63959. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  63960. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  63961. r.setXYZ(l, e.x, e.y, e.z),
  63962. (l += 1),
  63963. r.setXYZ(l, t.x, t.y, t.z),
  63964. (l += 1);
  63965. }
  63966. return (r.needsUpdate = !0), this;
  63967. };
  63968. })()),
  63969. (n.GridHelper = function (e, t) {
  63970. var i = new n.Geometry(),
  63971. r = new n.LineBasicMaterial({
  63972. vertexColors: n.VertexColors,
  63973. });
  63974. (this.color1 = new n.Color(4473924)), (this.color2 = new n.Color(8947848));
  63975. for (var o = -e; o <= e; o += t) {
  63976. i.vertices.push(
  63977. new n.Vector3(-e, 0, o),
  63978. new n.Vector3(e, 0, o),
  63979. new n.Vector3(o, 0, -e),
  63980. new n.Vector3(o, 0, e)
  63981. );
  63982. var a = 0 === o ? this.color1 : this.color2;
  63983. i.colors.push(a, a, a, a);
  63984. }
  63985. n.LineSegments.call(this, i, r);
  63986. }),
  63987. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  63988. (n.GridHelper.prototype.constructor = n.GridHelper),
  63989. (n.GridHelper.prototype.setColors = function (e, t) {
  63990. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0);
  63991. }),
  63992. (n.HemisphereLightHelper = function (e, t) {
  63993. n.Object3D.call(this),
  63994. (this.light = e),
  63995. this.light.updateMatrixWorld(),
  63996. (this.matrix = e.matrixWorld),
  63997. (this.matrixAutoUpdate = !1),
  63998. (this.colors = [new n.Color(), new n.Color()]);
  63999. var i = new n.SphereGeometry(t, 4, 2);
  64000. i.rotateX(-Math.PI / 2);
  64001. for (var r = 0, o = 8; r < o; r++) i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  64002. var a = new n.MeshBasicMaterial({
  64003. vertexColors: n.FaceColors,
  64004. wireframe: !0,
  64005. });
  64006. (this.lightSphere = new n.Mesh(i, a)), this.add(this.lightSphere), this.update();
  64007. }),
  64008. (n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64009. (n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper),
  64010. (n.HemisphereLightHelper.prototype.dispose = function () {
  64011. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose();
  64012. }),
  64013. (n.HemisphereLightHelper.prototype.update = (function () {
  64014. var e = new n.Vector3();
  64015. return function () {
  64016. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  64017. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  64018. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  64019. (this.lightSphere.geometry.colorsNeedUpdate = !0);
  64020. };
  64021. })()),
  64022. (n.PointLightHelper = function (e, t) {
  64023. (this.light = e), this.light.updateMatrixWorld();
  64024. var i = new n.SphereGeometry(t, 4, 2),
  64025. r = new n.MeshBasicMaterial({
  64026. wireframe: !0,
  64027. fog: !1,
  64028. });
  64029. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  64030. n.Mesh.call(this, i, r),
  64031. (this.matrix = this.light.matrixWorld),
  64032. (this.matrixAutoUpdate = !1);
  64033. }),
  64034. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  64035. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  64036. (n.PointLightHelper.prototype.dispose = function () {
  64037. this.geometry.dispose(), this.material.dispose();
  64038. }),
  64039. (n.PointLightHelper.prototype.update = function () {
  64040. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
  64041. }),
  64042. (n.SkeletonHelper = function (e) {
  64043. this.bones = this.getBoneList(e);
  64044. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  64045. var r = this.bones[i];
  64046. r.parent instanceof n.Bone &&
  64047. (t.vertices.push(new n.Vector3()),
  64048. t.vertices.push(new n.Vector3()),
  64049. t.colors.push(new n.Color(0, 0, 1)),
  64050. t.colors.push(new n.Color(0, 1, 0)));
  64051. }
  64052. t.dynamic = !0;
  64053. var o = new n.LineBasicMaterial({
  64054. vertexColors: n.VertexColors,
  64055. depthTest: !1,
  64056. depthWrite: !1,
  64057. transparent: !0,
  64058. });
  64059. n.LineSegments.call(this, t, o),
  64060. (this.root = e),
  64061. (this.matrix = e.matrixWorld),
  64062. (this.matrixAutoUpdate = !1),
  64063. this.update();
  64064. }),
  64065. (n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype)),
  64066. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  64067. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  64068. var t = [];
  64069. e instanceof n.Bone && t.push(e);
  64070. for (var i = 0; i < e.children.length; i++)
  64071. t.push.apply(t, this.getBoneList(e.children[i]));
  64072. return t;
  64073. }),
  64074. (n.SkeletonHelper.prototype.update = function () {
  64075. for (
  64076. var e = this.geometry,
  64077. t = new n.Matrix4().getInverse(this.root.matrixWorld),
  64078. i = new n.Matrix4(),
  64079. r = 0,
  64080. o = 0;
  64081. o < this.bones.length;
  64082. o++
  64083. ) {
  64084. var a = this.bones[o];
  64085. a.parent instanceof n.Bone &&
  64086. (i.multiplyMatrices(t, a.matrixWorld),
  64087. e.vertices[r].setFromMatrixPosition(i),
  64088. i.multiplyMatrices(t, a.parent.matrixWorld),
  64089. e.vertices[r + 1].setFromMatrixPosition(i),
  64090. (r += 2));
  64091. }
  64092. (e.verticesNeedUpdate = !0), e.computeBoundingSphere();
  64093. }),
  64094. (n.SpotLightHelper = function (e) {
  64095. n.Object3D.call(this),
  64096. (this.light = e),
  64097. this.light.updateMatrixWorld(),
  64098. (this.matrix = e.matrixWorld),
  64099. (this.matrixAutoUpdate = !1);
  64100. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0);
  64101. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2);
  64102. var i = new n.MeshBasicMaterial({
  64103. wireframe: !0,
  64104. fog: !1,
  64105. });
  64106. (this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update();
  64107. }),
  64108. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64109. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  64110. (n.SpotLightHelper.prototype.dispose = function () {
  64111. this.cone.geometry.dispose(), this.cone.material.dispose();
  64112. }),
  64113. (n.SpotLightHelper.prototype.update = (function () {
  64114. var e = new n.Vector3(),
  64115. t = new n.Vector3();
  64116. return function () {
  64117. var i = this.light.distance ? this.light.distance : 1e4,
  64118. n = i * Math.tan(this.light.angle);
  64119. this.cone.scale.set(n, n, i),
  64120. e.setFromMatrixPosition(this.light.matrixWorld),
  64121. t.setFromMatrixPosition(this.light.target.matrixWorld),
  64122. this.cone.lookAt(t.sub(e)),
  64123. this.cone.material.color
  64124. .copy(this.light.color)
  64125. .multiplyScalar(this.light.intensity);
  64126. };
  64127. })()),
  64128. (n.VertexNormalsHelper = function (e, t, i, r) {
  64129. (this.object = e), (this.size = void 0 !== t ? t : 1);
  64130. var o = void 0 !== i ? i : 16711680,
  64131. a = void 0 !== r ? r : 1,
  64132. s = 0,
  64133. l = this.object.geometry;
  64134. l instanceof n.Geometry
  64135. ? (s = 3 * l.faces.length)
  64136. : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  64137. var c = new n.BufferGeometry(),
  64138. h = new n.Float32Attribute(2 * s * 3, 3);
  64139. c.addAttribute('position', h),
  64140. n.LineSegments.call(
  64141. this,
  64142. c,
  64143. new n.LineBasicMaterial({
  64144. color: o,
  64145. linewidth: a,
  64146. })
  64147. ),
  64148. (this.matrixAutoUpdate = !1),
  64149. this.update();
  64150. }),
  64151. (n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  64152. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  64153. (n.VertexNormalsHelper.prototype.update = (function () {
  64154. var e = new n.Vector3(),
  64155. t = new n.Vector3(),
  64156. i = new n.Matrix3();
  64157. return function () {
  64158. var r = ['a', 'b', 'c'];
  64159. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld);
  64160. var o = this.object.matrixWorld,
  64161. a = this.geometry.attributes.position,
  64162. s = this.object.geometry;
  64163. if (s instanceof n.Geometry)
  64164. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  64165. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  64166. var m = l[p[r[f]]],
  64167. v = p.vertexNormals[f];
  64168. e.copy(m).applyMatrix4(o),
  64169. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64170. a.setXYZ(h, e.x, e.y, e.z),
  64171. (h += 1),
  64172. a.setXYZ(h, t.x, t.y, t.z),
  64173. (h += 1);
  64174. }
  64175. else if (s instanceof n.BufferGeometry)
  64176. for (
  64177. var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count;
  64178. f < g;
  64179. f++
  64180. )
  64181. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  64182. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  64183. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64184. a.setXYZ(h, e.x, e.y, e.z),
  64185. (h += 1),
  64186. a.setXYZ(h, t.x, t.y, t.z),
  64187. (h += 1);
  64188. return (a.needsUpdate = !0), this;
  64189. };
  64190. })()),
  64191. (n.WireframeHelper = function (e, t) {
  64192. var i = void 0 !== t ? t : 16777215;
  64193. n.LineSegments.call(
  64194. this,
  64195. new n.WireframeGeometry(e.geometry),
  64196. new n.LineBasicMaterial({
  64197. color: i,
  64198. })
  64199. ),
  64200. (this.matrix = e.matrixWorld),
  64201. (this.matrixAutoUpdate = !1);
  64202. }),
  64203. (n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype)),
  64204. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  64205. (n.ImmediateRenderObject = function (e) {
  64206. n.Object3D.call(this), (this.material = e), (this.render = function (e) {});
  64207. }),
  64208. (n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype)),
  64209. (n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject),
  64210. (n.MorphBlendMesh = function (e, t) {
  64211. n.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = []);
  64212. var i = this.geometry.morphTargets.length,
  64213. r = '__default',
  64214. o = 0,
  64215. a = i - 1,
  64216. s = i / 1;
  64217. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1);
  64218. }),
  64219. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  64220. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  64221. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  64222. var r = {
  64223. start: t,
  64224. end: i,
  64225. length: i - t + 1,
  64226. fps: n,
  64227. duration: (i - t) / n,
  64228. lastFrame: 0,
  64229. currentFrame: 0,
  64230. active: !1,
  64231. time: 0,
  64232. direction: 1,
  64233. weight: 1,
  64234. directionBackwards: !1,
  64235. mirroredLoop: !1,
  64236. };
  64237. (this.animationsMap[e] = r), this.animationsList.push(r);
  64238. }),
  64239. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  64240. for (
  64241. var t,
  64242. i = /([a-z]+)_?(\d+)/i,
  64243. n = {},
  64244. r = this.geometry,
  64245. o = 0,
  64246. a = r.morphTargets.length;
  64247. o < a;
  64248. o++
  64249. ) {
  64250. var s = r.morphTargets[o],
  64251. l = s.name.match(i);
  64252. if (l && l.length > 1) {
  64253. var c = l[1];
  64254. n[c] ||
  64255. (n[c] = {
  64256. start: 1 / 0,
  64257. end: -(1 / 0),
  64258. });
  64259. var h = n[c];
  64260. o < h.start && (h.start = o), o > h.end && (h.end = o), t || (t = c);
  64261. }
  64262. }
  64263. for (var c in n) {
  64264. var h = n[c];
  64265. this.createAnimation(c, h.start, h.end, e);
  64266. }
  64267. this.firstAnimation = t;
  64268. }),
  64269. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  64270. var t = this.animationsMap[e];
  64271. t && ((t.direction = 1), (t.directionBackwards = !1));
  64272. }),
  64273. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  64274. var t = this.animationsMap[e];
  64275. t && ((t.direction = -1), (t.directionBackwards = !0));
  64276. }),
  64277. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  64278. var i = this.animationsMap[e];
  64279. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps));
  64280. }),
  64281. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  64282. var i = this.animationsMap[e];
  64283. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration));
  64284. }),
  64285. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  64286. var i = this.animationsMap[e];
  64287. i && (i.weight = t);
  64288. }),
  64289. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  64290. var i = this.animationsMap[e];
  64291. i && (i.time = t);
  64292. }),
  64293. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  64294. var t = 0,
  64295. i = this.animationsMap[e];
  64296. return i && (t = i.time), t;
  64297. }),
  64298. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  64299. var t = -1,
  64300. i = this.animationsMap[e];
  64301. return i && (t = i.duration), t;
  64302. }),
  64303. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  64304. var t = this.animationsMap[e];
  64305. t
  64306. ? ((t.time = 0), (t.active = !0))
  64307. : console.warn(
  64308. 'THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()'
  64309. );
  64310. }),
  64311. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  64312. var t = this.animationsMap[e];
  64313. t && (t.active = !1);
  64314. }),
  64315. (n.MorphBlendMesh.prototype.update = function (e) {
  64316. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  64317. var r = this.animationsList[t];
  64318. if (r.active) {
  64319. var o = r.duration / r.length;
  64320. (r.time += r.direction * e),
  64321. r.mirroredLoop
  64322. ? (r.time > r.duration || r.time < 0) &&
  64323. ((r.direction *= -1),
  64324. r.time > r.duration && ((r.time = r.duration), (r.directionBackwards = !0)),
  64325. r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  64326. : ((r.time = r.time % r.duration), r.time < 0 && (r.time += r.duration));
  64327. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  64328. s = r.weight;
  64329. a !== r.currentFrame &&
  64330. ((this.morphTargetInfluences[r.lastFrame] = 0),
  64331. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  64332. (this.morphTargetInfluences[a] = 0),
  64333. (r.lastFrame = r.currentFrame),
  64334. (r.currentFrame = a));
  64335. var l = (r.time % o) / o;
  64336. r.directionBackwards && (l = 1 - l),
  64337. r.currentFrame !== r.lastFrame
  64338. ? ((this.morphTargetInfluences[r.currentFrame] = l * s),
  64339. (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  64340. : (this.morphTargetInfluences[r.currentFrame] = s);
  64341. }
  64342. }
  64343. }),
  64344. 'undefined' != typeof i
  64345. ? ('undefined' != typeof t && t.exports && (i = t.exports = n), (i.THREE = n))
  64346. : (this.THREE = n);
  64347. window.THREE = n;
  64348. getObjLoader();
  64349. initByTHREE(THREE);
  64350. //getWebXRManager()
  64351. },
  64352. {},
  64353. ],
  64354. },
  64355. {},
  64356. [116]
  64357. );
  64358. /*
  64359. function getWebXRManager(){
  64360. class ArrayCamera extends THREE.PerspectiveCamera {
  64361. constructor(array = []) {
  64362. super();
  64363. this.isArrayCamera = true;
  64364. this.cameras = array;
  64365. }
  64366. }
  64367. function WebGLAnimation() {
  64368. let context = null;
  64369. let isAnimating = false;
  64370. let animationLoop = null;
  64371. let requestId = null;
  64372. function onAnimationFrame(time, frame) {
  64373. animationLoop(time, frame);
  64374. requestId = context.requestAnimationFrame(onAnimationFrame);
  64375. }
  64376. return {
  64377. start: function () {
  64378. if (isAnimating === true) return;
  64379. if (animationLoop === null) return;
  64380. requestId = context.requestAnimationFrame(onAnimationFrame);
  64381. isAnimating = true;
  64382. },
  64383. stop: function () {
  64384. context.cancelAnimationFrame(requestId);
  64385. isAnimating = false;
  64386. },
  64387. setAnimationLoop: function (callback) {
  64388. animationLoop = callback;
  64389. },
  64390. setContext: function (value) {
  64391. context = value;
  64392. }
  64393. };
  64394. }
  64395. function WebXRManager( renderer, gl ) {
  64396. var scope = this;
  64397. var session = null;
  64398. // var framebufferScaleFactor = 1.0;
  64399. var referenceSpace = null;
  64400. var referenceSpaceType = 'local-floor';
  64401. var pose = null;
  64402. var controllers = [];
  64403. var sortedInputSources = [];
  64404. function isPresenting() {
  64405. return session !== null && referenceSpace !== null;
  64406. }
  64407. //
  64408. var cameraL = new THREE.PerspectiveCamera();
  64409. cameraL.layers.enable( 1 );
  64410. cameraL.viewport = new THREE.Vector4();
  64411. var cameraR = new THREE.PerspectiveCamera();
  64412. cameraR.layers.enable( 2 );
  64413. cameraR.viewport = new THREE.Vector4();
  64414. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  64415. cameraVR.layers.enable( 1 );
  64416. cameraVR.layers.enable( 2 );
  64417. //
  64418. this.enabled = false;
  64419. this.getController = function ( id ) {
  64420. var controller = controllers[ id ];
  64421. if ( controller === undefined ) {
  64422. controller = new THREE.Group();
  64423. controller.matrixAutoUpdate = false;
  64424. controller.visible = false;
  64425. controllers[ id ] = controller;
  64426. }
  64427. return controller;
  64428. };
  64429. //
  64430. function onSessionEvent( event ) {
  64431. for ( var i = 0; i < controllers.length; i ++ ) {
  64432. if ( sortedInputSources[ i ] === event.inputSource ) {
  64433. controllers[ i ].dispatchEvent( { type: event.type } );
  64434. }
  64435. }
  64436. }
  64437. function onSessionEnd() {
  64438. renderer.setFramebuffer( null );
  64439. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  64440. animation.stop();
  64441. scope.dispatchEvent( { type: 'sessionend' } );
  64442. }
  64443. function onRequestReferenceSpace( value ) {
  64444. referenceSpace = value;
  64445. animation.setContext( session );
  64446. animation.start();
  64447. scope.dispatchEvent( { type: 'sessionstart' } );
  64448. }
  64449. this.setFramebufferScaleFactor = function ( ) {
  64450. // framebufferScaleFactor = value;
  64451. };
  64452. this.setReferenceSpaceType = function ( value ) {
  64453. referenceSpaceType = value;
  64454. };
  64455. this.getSession = function () {
  64456. return session;
  64457. };
  64458. this.setSession = function ( value ) {
  64459. session = value;
  64460. if ( session !== null ) {
  64461. session.addEventListener( 'select', onSessionEvent );
  64462. session.addEventListener( 'selectstart', onSessionEvent );
  64463. session.addEventListener( 'selectend', onSessionEvent );
  64464. session.addEventListener( 'end', onSessionEnd );
  64465. // eslint-disable-next-line no-undef
  64466. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  64467. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  64468. //
  64469. session.addEventListener( 'inputsourceschange', updateInputSources );
  64470. updateInputSources();
  64471. }
  64472. };
  64473. function updateInputSources() {
  64474. for ( var i = 0; i < controllers.length; i ++ ) {
  64475. sortedInputSources[ i ] = findInputSource( i );
  64476. }
  64477. }
  64478. function findInputSource( id ) {
  64479. var inputSources = session.inputSources;
  64480. for ( var i = 0; i < inputSources.length; i ++ ) {
  64481. var inputSource = inputSources[ i ];
  64482. var handedness = inputSource.handedness;
  64483. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  64484. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  64485. }
  64486. }
  64487. //
  64488. function updateCamera( camera, parent ) {
  64489. if ( parent === null ) {
  64490. camera.matrixWorld.copy( camera.matrix );
  64491. } else {
  64492. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  64493. }
  64494. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  64495. }
  64496. this.getCamera = function ( camera ) {
  64497. if ( isPresenting() ) {
  64498. var parent = camera.parent;
  64499. var cameras = cameraVR.cameras;
  64500. updateCamera( cameraVR, parent );
  64501. for ( var i = 0; i < cameras.length; i ++ ) {
  64502. updateCamera( cameras[ i ], parent );
  64503. }
  64504. // update camera and its children
  64505. camera.matrixWorld.copy( cameraVR.matrixWorld );
  64506. var children = camera.children;
  64507. for ( var i = 0, l = children.length; i < l; i ++ ) {
  64508. children[ i ].updateMatrixWorld( true );
  64509. }
  64510. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  64511. return cameraVR;
  64512. }
  64513. return camera;
  64514. };
  64515. this.isPresenting = isPresenting;
  64516. // Animation Loop
  64517. var onAnimationFrameCallback = null;
  64518. function onAnimationFrame( time, frame ) {
  64519. pose = frame.getViewerPose( referenceSpace );
  64520. if ( pose !== null ) {
  64521. var views = pose.views;
  64522. var baseLayer = session.renderState.baseLayer;
  64523. renderer.setFramebuffer( baseLayer.framebuffer );
  64524. for ( var i = 0; i < views.length; i ++ ) {
  64525. var view = views[ i ];
  64526. var viewport = baseLayer.getViewport( view );
  64527. var viewMatrix = view.transform.inverse.matrix;
  64528. var camera = cameraVR.cameras[ i ];
  64529. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  64530. camera.projectionMatrix.fromArray( view.projectionMatrix );
  64531. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  64532. if ( i === 0 ) {
  64533. cameraVR.matrix.copy( camera.matrix );
  64534. }
  64535. }
  64536. }
  64537. //
  64538. for ( var i = 0; i < controllers.length; i ++ ) {
  64539. var controller = controllers[ i ];
  64540. var inputSource = sortedInputSources[ i ];
  64541. if ( inputSource ) {
  64542. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  64543. if ( inputPose !== null ) {
  64544. controller.matrix.fromArray( inputPose.transform.matrix );
  64545. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  64546. controller.visible = true;
  64547. continue;
  64548. }
  64549. }
  64550. controller.visible = false;
  64551. }
  64552. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  64553. }
  64554. var animation = new WebGLAnimation();
  64555. animation.setAnimationLoop( onAnimationFrame );
  64556. this.setAnimationLoop = function ( callback ) {
  64557. onAnimationFrameCallback = callback;
  64558. };
  64559. this.dispose = function () {};
  64560. // DEPRECATED
  64561. this.getStandingMatrix = function () {
  64562. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  64563. return new THREE.Matrix4();
  64564. };
  64565. this.getDevice = function () {
  64566. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  64567. };
  64568. this.setDevice = function () {
  64569. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  64570. };
  64571. this.setFrameOfReferenceType = function () {
  64572. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  64573. };
  64574. this.submitFrame = function () {};
  64575. }
  64576. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  64577. THREE.WebXRManager = WebXRManager
  64578. }
  64579. function getWebXRManager(){
  64580. class ArrayCamera extends THREE.PerspectiveCamera {
  64581. constructor(array = []) {
  64582. super();
  64583. this.isArrayCamera = true;
  64584. this.cameras = array;
  64585. }
  64586. }
  64587. class WebXRController {
  64588. constructor() {
  64589. this._targetRay = null;
  64590. this._grip = null;
  64591. this._hand = null;
  64592. }
  64593. getHandSpace() {
  64594. if (this._hand === null) {
  64595. this._hand = new THREE.Group();
  64596. this._hand.matrixAutoUpdate = false;
  64597. this._hand.visible = false;
  64598. this._hand.joints = {};
  64599. this._hand.inputState = {
  64600. pinching: false
  64601. };
  64602. }
  64603. return this._hand;
  64604. }
  64605. getTargetRaySpace() {
  64606. if (this._targetRay === null) {
  64607. this._targetRay = new THREE.Group();
  64608. this._targetRay.matrixAutoUpdate = false;
  64609. this._targetRay.visible = false;
  64610. this._targetRay.hasLinearVelocity = false;
  64611. this._targetRay.linearVelocity = new THREE.Vector3();
  64612. this._targetRay.hasAngularVelocity = false;
  64613. this._targetRay.angularVelocity = new THREE.Vector3();
  64614. }
  64615. return this._targetRay;
  64616. }
  64617. getGripSpace() {
  64618. if (this._grip === null) {
  64619. this._grip = new THREE.Group();
  64620. this._grip.matrixAutoUpdate = false;
  64621. this._grip.visible = false;
  64622. this._grip.hasLinearVelocity = false;
  64623. this._grip.linearVelocity = new THREE.Vector3();
  64624. this._grip.hasAngularVelocity = false;
  64625. this._grip.angularVelocity = new THREE.Vector3();
  64626. }
  64627. return this._grip;
  64628. }
  64629. dispatchEvent(event) {
  64630. if (this._targetRay !== null) {
  64631. this._targetRay.dispatchEvent(event);
  64632. }
  64633. if (this._grip !== null) {
  64634. this._grip.dispatchEvent(event);
  64635. }
  64636. if (this._hand !== null) {
  64637. this._hand.dispatchEvent(event);
  64638. }
  64639. return this;
  64640. }
  64641. disconnect(inputSource) {
  64642. this.dispatchEvent({
  64643. type: 'disconnected',
  64644. data: inputSource
  64645. });
  64646. if (this._targetRay !== null) {
  64647. this._targetRay.visible = false;
  64648. }
  64649. if (this._grip !== null) {
  64650. this._grip.visible = false;
  64651. }
  64652. if (this._hand !== null) {
  64653. this._hand.visible = false;
  64654. }
  64655. return this;
  64656. }
  64657. update(inputSource, frame, referenceSpace) {
  64658. let inputPose = null;
  64659. let gripPose = null;
  64660. let handPose = null;
  64661. const targetRay = this._targetRay;
  64662. const grip = this._grip;
  64663. const hand = this._hand;
  64664. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  64665. if (hand && inputSource.hand) {
  64666. handPose = true;
  64667. for (const inputjoint of inputSource.hand.values()) {
  64668. // Update the joints groups with the XRJoint poses
  64669. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  64670. if (hand.joints[inputjoint.jointName] === undefined) {
  64671. // The transform of this joint will be updated with the joint pose on each frame
  64672. const joint = new THREE.Group();
  64673. joint.matrixAutoUpdate = false;
  64674. joint.visible = false;
  64675. hand.joints[inputjoint.jointName] = joint; // ??
  64676. hand.add(joint);
  64677. }
  64678. const joint = hand.joints[inputjoint.jointName];
  64679. if (jointPose !== null) {
  64680. joint.matrix.fromArray(jointPose.transform.matrix);
  64681. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  64682. joint.jointRadius = jointPose.radius;
  64683. }
  64684. joint.visible = jointPose !== null;
  64685. } // Custom events
  64686. // Check pinchz
  64687. const indexTip = hand.joints['index-finger-tip'];
  64688. const thumbTip = hand.joints['thumb-tip'];
  64689. const distance = indexTip.position.distanceTo(thumbTip.position);
  64690. const distanceToPinch = 0.02;
  64691. const threshold = 0.005;
  64692. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  64693. hand.inputState.pinching = false;
  64694. this.dispatchEvent({
  64695. type: 'pinchend',
  64696. handedness: inputSource.handedness,
  64697. target: this
  64698. });
  64699. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  64700. hand.inputState.pinching = true;
  64701. this.dispatchEvent({
  64702. type: 'pinchstart',
  64703. handedness: inputSource.handedness,
  64704. target: this
  64705. });
  64706. }
  64707. } else {
  64708. if (grip !== null && inputSource.gripSpace) {
  64709. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  64710. if (gripPose !== null) {
  64711. grip.matrix.fromArray(gripPose.transform.matrix);
  64712. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  64713. if (gripPose.linearVelocity) {
  64714. grip.hasLinearVelocity = true;
  64715. grip.linearVelocity.copy(gripPose.linearVelocity);
  64716. } else {
  64717. grip.hasLinearVelocity = false;
  64718. }
  64719. if (gripPose.angularVelocity) {
  64720. grip.hasAngularVelocity = true;
  64721. grip.angularVelocity.copy(gripPose.angularVelocity);
  64722. } else {
  64723. grip.hasAngularVelocity = false;
  64724. }
  64725. }
  64726. }
  64727. }
  64728. if (targetRay !== null) {
  64729. inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
  64730. if (inputPose === null && gripPose !== null) {
  64731. inputPose = gripPose;
  64732. }
  64733. if (inputPose !== null) {
  64734. targetRay.matrix.fromArray(inputPose.transform.matrix);
  64735. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  64736. if (inputPose.linearVelocity) {
  64737. targetRay.hasLinearVelocity = true;
  64738. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  64739. } else {
  64740. targetRay.hasLinearVelocity = false;
  64741. }
  64742. if (inputPose.angularVelocity) {
  64743. targetRay.hasAngularVelocity = true;
  64744. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  64745. } else {
  64746. targetRay.hasAngularVelocity = false;
  64747. }
  64748. this.dispatchEvent(_moveEvent);
  64749. }
  64750. }
  64751. }
  64752. if (targetRay !== null) {
  64753. targetRay.visible = inputPose !== null;
  64754. }
  64755. if (grip !== null) {
  64756. grip.visible = gripPose !== null;
  64757. }
  64758. if (hand !== null) {
  64759. hand.visible = handPose !== null;
  64760. }
  64761. return this;
  64762. }
  64763. }
  64764. function WebGLAnimation() {
  64765. let context = null;
  64766. let isAnimating = false;
  64767. let animationLoop = null;
  64768. let requestId = null;
  64769. function onAnimationFrame(time, frame) {
  64770. animationLoop(time, frame);
  64771. requestId = context.requestAnimationFrame(onAnimationFrame);
  64772. }
  64773. return {
  64774. start: function () {
  64775. if (isAnimating === true) return;
  64776. if (animationLoop === null) return;
  64777. requestId = context.requestAnimationFrame(onAnimationFrame);
  64778. isAnimating = true;
  64779. },
  64780. stop: function () {
  64781. context.cancelAnimationFrame(requestId);
  64782. isAnimating = false;
  64783. },
  64784. setAnimationLoop: function (callback) {
  64785. animationLoop = callback;
  64786. },
  64787. setContext: function (value) {
  64788. context = value;
  64789. }
  64790. };
  64791. }
  64792. class WebXRManager extends THREE.EventDispatcher {
  64793. constructor(renderer, gl) {
  64794. super();
  64795. const scope = this;
  64796. let session = null;
  64797. let framebufferScaleFactor = 1.0;
  64798. let referenceSpace = null;
  64799. let referenceSpaceType = 'local-floor';
  64800. let customReferenceSpace = null;
  64801. let pose = null;
  64802. let glBinding = null;
  64803. let glProjLayer = null;
  64804. let glBaseLayer = null;
  64805. let xrFrame = null;
  64806. const attributes = gl.getContextAttributes();
  64807. let initialRenderTarget = null;
  64808. let newRenderTarget = null;
  64809. const controllers = [];
  64810. const controllerInputSources = []; //
  64811. const cameraL = new THREE.PerspectiveCamera();
  64812. cameraL.layers.enable(1);
  64813. cameraL.viewport = new THREE.Vector4();
  64814. const cameraR = new THREE.PerspectiveCamera();
  64815. cameraR.layers.enable(2);
  64816. cameraR.viewport = new THREE.Vector4();
  64817. const cameras = [cameraL, cameraR];
  64818. const cameraVR = new ArrayCamera();
  64819. cameraVR.layers.enable(1);
  64820. cameraVR.layers.enable(2);
  64821. let _currentDepthNear = null;
  64822. let _currentDepthFar = null; //
  64823. this.cameraAutoUpdate = true;
  64824. this.enabled = false;
  64825. this.isPresenting = false;
  64826. this.getController = function (index) {
  64827. let controller = controllers[index];
  64828. if (controller === undefined) {
  64829. controller = new WebXRController();
  64830. controllers[index] = controller;
  64831. }
  64832. return controller.getTargetRaySpace();
  64833. };
  64834. this.getControllerGrip = function (index) {
  64835. let controller = controllers[index];
  64836. if (controller === undefined) {
  64837. controller = new WebXRController();
  64838. controllers[index] = controller;
  64839. }
  64840. return controller.getGripSpace();
  64841. };
  64842. this.getHand = function (index) {
  64843. let controller = controllers[index];
  64844. if (controller === undefined) {
  64845. controller = new WebXRController();
  64846. controllers[index] = controller;
  64847. }
  64848. return controller.getHandSpace();
  64849. }; //
  64850. function onSessionEvent(event) {
  64851. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  64852. if (controllerIndex === -1) {
  64853. return;
  64854. }
  64855. const controller = controllers[controllerIndex];
  64856. if (controller !== undefined) {
  64857. controller.dispatchEvent({
  64858. type: event.type,
  64859. data: event.inputSource
  64860. });
  64861. }
  64862. }
  64863. function onSessionEnd() {
  64864. session.removeEventListener('select', onSessionEvent);
  64865. session.removeEventListener('selectstart', onSessionEvent);
  64866. session.removeEventListener('selectend', onSessionEvent);
  64867. session.removeEventListener('squeeze', onSessionEvent);
  64868. session.removeEventListener('squeezestart', onSessionEvent);
  64869. session.removeEventListener('squeezeend', onSessionEvent);
  64870. session.removeEventListener('end', onSessionEnd);
  64871. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  64872. for (let i = 0; i < controllers.length; i++) {
  64873. const inputSource = controllerInputSources[i];
  64874. if (inputSource === null) continue;
  64875. controllerInputSources[i] = null;
  64876. controllers[i].disconnect(inputSource);
  64877. }
  64878. _currentDepthNear = null;
  64879. _currentDepthFar = null; // restore framebuffer/rendering state
  64880. renderer.setRenderTarget(initialRenderTarget);
  64881. glBaseLayer = null;
  64882. glProjLayer = null;
  64883. glBinding = null;
  64884. session = null;
  64885. newRenderTarget = null; //
  64886. animation.stop();
  64887. scope.isPresenting = false;
  64888. scope.dispatchEvent({
  64889. type: 'sessionend'
  64890. });
  64891. }
  64892. this.setFramebufferScaleFactor = function (value) {
  64893. framebufferScaleFactor = value;
  64894. if (scope.isPresenting === true) {
  64895. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  64896. }
  64897. };
  64898. this.setReferenceSpaceType = function (value) {
  64899. referenceSpaceType = value;
  64900. if (scope.isPresenting === true) {
  64901. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  64902. }
  64903. };
  64904. this.getReferenceSpace = function () {
  64905. return customReferenceSpace || referenceSpace;
  64906. };
  64907. this.setReferenceSpace = function (space) {
  64908. customReferenceSpace = space;
  64909. };
  64910. this.getBaseLayer = function () {
  64911. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  64912. };
  64913. this.getBinding = function () {
  64914. return glBinding;
  64915. };
  64916. this.getFrame = function () {
  64917. return xrFrame;
  64918. };
  64919. this.getSession = function () {
  64920. return session;
  64921. };
  64922. this.setSession = async function (value) {
  64923. session = value;
  64924. if (session !== null) {
  64925. initialRenderTarget = renderer.getCurrentRenderTarget();
  64926. session.addEventListener('select', onSessionEvent);
  64927. session.addEventListener('selectstart', onSessionEvent);
  64928. session.addEventListener('selectend', onSessionEvent);
  64929. session.addEventListener('squeeze', onSessionEvent);
  64930. session.addEventListener('squeezestart', onSessionEvent);
  64931. session.addEventListener('squeezeend', onSessionEvent);
  64932. session.addEventListener('end', onSessionEnd);
  64933. session.addEventListener('inputsourceschange', onInputSourcesChange);
  64934. if (attributes.xrCompatible !== true) {
  64935. await gl.makeXRCompatible();
  64936. }
  64937. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  64938. const layerInit = {
  64939. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  64940. alpha: attributes.alpha,
  64941. depth: attributes.depth,
  64942. stencil: attributes.stencil,
  64943. framebufferScaleFactor: framebufferScaleFactor
  64944. };
  64945. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  64946. session.updateRenderState({
  64947. baseLayer: glBaseLayer
  64948. });
  64949. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  64950. format: THREE.RGBAFormat,
  64951. type: THREE.UnsignedByteType,
  64952. encoding: renderer.outputEncoding
  64953. });
  64954. } else {
  64955. let depthFormat = null;
  64956. let depthType = null;
  64957. let glDepthFormat = null;
  64958. if (attributes.depth) {
  64959. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  64960. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  64961. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  64962. }
  64963. const projectionlayerInit = {
  64964. colorFormat: gl.RGBA8,
  64965. depthFormat: glDepthFormat,
  64966. scaleFactor: framebufferScaleFactor
  64967. };
  64968. glBinding = new XRWebGLBinding(session, gl);
  64969. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  64970. session.updateRenderState({
  64971. layers: [glProjLayer]
  64972. });
  64973. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  64974. format: THREE.RGBAFormat,
  64975. type: THREE.UnsignedByteType,
  64976. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  64977. stencilBuffer: attributes.stencil,
  64978. encoding: renderer.outputEncoding,
  64979. samples: attributes.antialias ? 4 : 0
  64980. });
  64981. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  64982. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  64983. }
  64984. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  64985. // Set foveation to maximum.
  64986. this.setFoveation(1.0);
  64987. customReferenceSpace = null;
  64988. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  64989. animation.setContext(session);
  64990. animation.start();
  64991. scope.isPresenting = true;
  64992. scope.dispatchEvent({
  64993. type: 'sessionstart'
  64994. });
  64995. }
  64996. };
  64997. function onInputSourcesChange(event) {
  64998. // Notify disconnected
  64999. for (let i = 0; i < event.removed.length; i++) {
  65000. const inputSource = event.removed[i];
  65001. const index = controllerInputSources.indexOf(inputSource);
  65002. if (index >= 0) {
  65003. controllerInputSources[index] = null;
  65004. controllers[index].dispatchEvent({
  65005. type: 'disconnected',
  65006. data: inputSource
  65007. });
  65008. }
  65009. } // Notify connected
  65010. for (let i = 0; i < event.added.length; i++) {
  65011. const inputSource = event.added[i];
  65012. let controllerIndex = controllerInputSources.indexOf(inputSource);
  65013. if (controllerIndex === -1) {
  65014. // Assign input source a controller that currently has no input source
  65015. for (let i = 0; i < controllers.length; i++) {
  65016. if (i >= controllerInputSources.length) {
  65017. controllerInputSources.push(inputSource);
  65018. controllerIndex = i;
  65019. break;
  65020. } else if (controllerInputSources[i] === null) {
  65021. controllerInputSources[i] = inputSource;
  65022. controllerIndex = i;
  65023. break;
  65024. }
  65025. } // If all controllers do currently receive input we ignore new ones
  65026. if (controllerIndex === -1) break;
  65027. }
  65028. const controller = controllers[controllerIndex];
  65029. if (controller) {
  65030. controller.dispatchEvent({
  65031. type: 'connected',
  65032. data: inputSource
  65033. });
  65034. }
  65035. }
  65036. } //
  65037. const cameraLPos = new THREE.Vector3();
  65038. const cameraRPos = new THREE.Vector3();
  65039. function setProjectionFromUnion(camera, cameraL, cameraR) {
  65040. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  65041. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  65042. const ipd = cameraLPos.distanceTo(cameraRPos);
  65043. const projL = cameraL.projectionMatrix.elements;
  65044. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  65045. // most likely identical top and bottom frustum extents.
  65046. // Use the left camera for these values.
  65047. const near = projL[14] / (projL[10] - 1);
  65048. const far = projL[14] / (projL[10] + 1);
  65049. const topFov = (projL[9] + 1) / projL[5];
  65050. const bottomFov = (projL[9] - 1) / projL[5];
  65051. const leftFov = (projL[8] - 1) / projL[0];
  65052. const rightFov = (projR[8] + 1) / projR[0];
  65053. const left = near * leftFov;
  65054. const right = near * rightFov; // Calculate the new camera's position offset from the
  65055. // left camera. xOffset should be roughly half `ipd`.
  65056. const zOffset = ipd / (-leftFov + rightFov);
  65057. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  65058. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  65059. camera.translateX(xOffset);
  65060. camera.translateZ(zOffset);
  65061. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  65062. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  65063. // the values so that the near plane's position does not change in world space,
  65064. // although must now be relative to the new union camera.
  65065. const near2 = near + zOffset;
  65066. const far2 = far + zOffset;
  65067. const left2 = left - xOffset;
  65068. const right2 = right + (ipd - xOffset);
  65069. const top2 = topFov * far / far2 * near2;
  65070. const bottom2 = bottomFov * far / far2 * near2;
  65071. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  65072. }
  65073. function updateCamera(camera, parent) {
  65074. if (parent === null) {
  65075. camera.matrixWorld.copy(camera.matrix);
  65076. } else {
  65077. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  65078. }
  65079. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  65080. }
  65081. this.updateCamera = function (camera) {
  65082. if (session === null) return;
  65083. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  65084. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  65085. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  65086. // Note that the new renderState won't apply until the next frame. See #18320
  65087. session.updateRenderState({
  65088. depthNear: cameraVR.near,
  65089. depthFar: cameraVR.far
  65090. });
  65091. _currentDepthNear = cameraVR.near;
  65092. _currentDepthFar = cameraVR.far;
  65093. }
  65094. const parent = camera.parent;
  65095. const cameras = cameraVR.cameras;
  65096. updateCamera(cameraVR, parent);
  65097. for (let i = 0; i < cameras.length; i++) {
  65098. updateCamera(cameras[i], parent);
  65099. }
  65100. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  65101. camera.position.copy(cameraVR.position);
  65102. camera.quaternion.copy(cameraVR.quaternion);
  65103. camera.scale.copy(cameraVR.scale);
  65104. camera.matrix.copy(cameraVR.matrix);
  65105. camera.matrixWorld.copy(cameraVR.matrixWorld);
  65106. const children = camera.children;
  65107. for (let i = 0, l = children.length; i < l; i++) {
  65108. children[i].updateMatrixWorld(true);
  65109. } // update projection matrix for proper view frustum culling
  65110. if (cameras.length === 2) {
  65111. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  65112. } else {
  65113. // assume single camera setup (AR)
  65114. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  65115. }
  65116. };
  65117. this.getCamera = function () {
  65118. return cameraVR;
  65119. };
  65120. this.getFoveation = function () {
  65121. if (glProjLayer !== null) {
  65122. return glProjLayer.fixedFoveation;
  65123. }
  65124. if (glBaseLayer !== null) {
  65125. return glBaseLayer.fixedFoveation;
  65126. }
  65127. return undefined;
  65128. };
  65129. this.setFoveation = function (foveation) {
  65130. // 0 = no foveation = full resolution
  65131. // 1 = maximum foveation = the edges render at lower resolution
  65132. if (glProjLayer !== null) {
  65133. glProjLayer.fixedFoveation = foveation;
  65134. }
  65135. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  65136. glBaseLayer.fixedFoveation = foveation;
  65137. }
  65138. }; // Animation Loop
  65139. let onAnimationFrameCallback = null;
  65140. function onAnimationFrame(time, frame) {
  65141. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  65142. xrFrame = frame;
  65143. if (pose !== null) {
  65144. const views = pose.views;
  65145. if (glBaseLayer !== null) {
  65146. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  65147. renderer.setRenderTarget(newRenderTarget);
  65148. }
  65149. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  65150. if (views.length !== cameraVR.cameras.length) {
  65151. cameraVR.cameras.length = 0;
  65152. cameraVRNeedsUpdate = true;
  65153. }
  65154. for (let i = 0; i < views.length; i++) {
  65155. const view = views[i];
  65156. let viewport = null;
  65157. if (glBaseLayer !== null) {
  65158. viewport = glBaseLayer.getViewport(view);
  65159. } else {
  65160. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  65161. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  65162. if (i === 0) {
  65163. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  65164. renderer.setRenderTarget(newRenderTarget);
  65165. }
  65166. }
  65167. let camera = cameras[i];
  65168. if (camera === undefined) {
  65169. camera = new THREE.PerspectiveCamera();
  65170. camera.layers.enable(i);
  65171. camera.viewport = new THREE.Vector4();
  65172. cameras[i] = camera;
  65173. }
  65174. camera.matrix.fromArray(view.transform.matrix);
  65175. camera.projectionMatrix.fromArray(view.projectionMatrix);
  65176. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  65177. if (i === 0) {
  65178. cameraVR.matrix.copy(camera.matrix);
  65179. }
  65180. if (cameraVRNeedsUpdate === true) {
  65181. cameraVR.cameras.push(camera);
  65182. }
  65183. }
  65184. } //
  65185. for (let i = 0; i < controllers.length; i++) {
  65186. const inputSource = controllerInputSources[i];
  65187. const controller = controllers[i];
  65188. if (inputSource !== null && controller !== undefined) {
  65189. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  65190. }
  65191. }
  65192. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  65193. xrFrame = null;
  65194. }
  65195. const animation = new WebGLAnimation();
  65196. animation.setAnimationLoop(onAnimationFrame);
  65197. this.setAnimationLoop = function (callback) {
  65198. onAnimationFrameCallback = callback;
  65199. };
  65200. this.dispose = function () {};
  65201. }
  65202. }
  65203. THREE.WebXRManager = WebXRManager
  65204. } */
  65205. /*
  65206. var addMagnifier = function(){
  65207. class Magnifier extends THREE.Object3D {
  65208. constructor () {
  65209. super()
  65210. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  65211. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  65212. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  65213. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  65214. format: THREE.RGBAFormat ,
  65215. //type: THREE.FloatType,
  65216. //minFilter: THREE.NearestFilter,
  65217. //magFilter: THREE.NearestFilter,
  65218. } )
  65219. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65220. side: THREE.DoubleSide ,
  65221. map: this.renderTarget.texture ,
  65222. transparent:true,
  65223. depthTest: !1,
  65224. depthWrite: !1,
  65225. }))
  65226. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65227. side: THREE.DoubleSide ,
  65228. map: Texture.load('images/crosshair.png') ,
  65229. transparent:true,
  65230. depthTest: !1,
  65231. depthWrite: !1,
  65232. }))
  65233. this.add(this.mesh)
  65234. this.add(this.overlayMesh)
  65235. player.model.add(this);
  65236. player.magnifier = this;
  65237. }
  65238. update(aimPos){
  65239. const magDistance_ = 0.3;
  65240. var playerPos = player.position
  65241. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  65242. this.camera.position.copy(aimPos.clone().add(vec))
  65243. this.camera.lookAt(aimPos)
  65244. var playerCamera = player.camera
  65245. this.quaternion.copy(playerCamera.quaternion);
  65246. var pos2d = player.mouse.clone();
  65247. var shift = 400;
  65248. var clientHeight = player.domElement.clientHeight
  65249. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  65250. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  65251. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  65252. this.position.copy(newPos)
  65253. var renderer = player.sceneRenderer.renderer
  65254. var oldAutoClear = renderer.autoClear
  65255. renderer.autoClear = false
  65256. //renderer.clear( true, true, true );
  65257. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  65258. renderer.autoClear = oldAutoClear
  65259. }
  65260. }
  65261. new Magnifier()
  65262. }
  65263. */
  65264. /*
  65265. 笔记:
  65266. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  65267. {
  65268. //到导览中某个点位(假设点位不重复)
  65269. var id = 73
  65270. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  65271. var i = player.model.heroLocations.indexOf(p)
  65272. var p1 = p.heroLocations.find(e=>e.panoId == id)
  65273. var j = p.heroLocations.indexOf(p1)
  65274. player.director.goToHighlight([i,j])
  65275. }
  65276. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  65277. */