main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. window.common = null;
  5. window.MathLight = null;
  6. window.math = null
  7. window.easing = null
  8. window.lerp = null
  9. window.transitions = null
  10. window.browser = null
  11. window.momentTourBlackNewType = 0//true
  12. g_playAudio = null
  13. // 全屏热点退出按钮
  14. exit = null
  15. g_tourAudio = new Audio
  16. g_tourAudio.loop = !1
  17. g_tourAudio.crossOrigin = "anonymous"
  18. g_tourAudio.addEventListener("ended", function() {
  19. var e = document.createEvent("MouseEvent");
  20. e.initEvent("tourAudioEnded", !0, !0),
  21. window.dispatchEvent(e)
  22. })
  23. g_tourAudio.oncanplaythrough = function() {
  24. if(g_tourAudio.shouldPlay){
  25. g_tourAudio.play();
  26. g_playAudio = g_tourAudio;
  27. }
  28. }
  29. var musicList = {
  30. "0102cp":'3458d3c7ca764ecaa13c88aaa8e0a1a8, 1107bf848a6146059249cc109c6d1472, 8c0e5bcc4a69470aa5f189edde162973, 2d00ef76d93f4a578b356c593da889b0, 61afb8aaf45046be865b1b30d0357754, 0a73cf23993d4f4cbb48337708f8c7b7, 9a32f7d9b29f427182b453b1a8009efc'.split(','),
  31. "04CP":'48930ada7d02438a846f6f6cf5a8693f, d3e00453736549e392ca91e9bd31ee72, b99ae9d8d19144f7866d49ed863a4b84, 14f349b0dd3d4646b2bd98c2ebfeb643'.split(','),
  32. "03cp":'d9b104d7df9244fca5ad5af4d5fca8f7, 2860b361da9246949ab6f57cbb8ce82d, 491d8cce5dfa441db5a52eb248bf4a63'.split(','),
  33. "19CP":'73a354895dc74c30beeb02a8d8bfe328, 256aedca55d6417fb696156279424d42, 10210bebd78b4d33ad05e0bef22cf0a3'.split(','),
  34. "2021cp":'10793e907fa7493c83f73fdcfd7df706, 2e2da10199634b5188c5469c0f52f9f6, 449196f2aa014f9db6a6cda675df7b70'.split(','),
  35. "22cp":'cf2d9fa92e8443aabbcc1a01736a052e, 08967bbdacec4ecf8ff44b219408ac9a, 8d20c6dd62c04564a172430705ba0295, a8a7d94bb9b84e8cb45556bbd548961d'.split(','),
  36. "23cp":'90197f7926e2466498135ef053147aaa, 6138d5511fe546e396a51408dfc9f6c5'.split(','),
  37. "0506CP":'6cee9744a41942f384ca0a9130f65ae8, a1f9e4436ea24f99a360ac327979e555, 8d216c8512264564bcde41c544fdfc69, f8769828fe9f4dda8449cd5d9506eeb4, 12142ab7fbb74122ba0df52eaa5a5363, fb3b381371d04864ab99dfd30a08fe89, 0921140bde3f428180b2d6b603775f51'.split(','),
  38. "07cp":'8902a763387040b2ad15a6325508cfca, 5adf5343a38340de998a0210cc97c00f'.split(','),
  39. "08CP":'f9e6d48c697f455f9b294523a5222624, 4f912bc6dc2848ce924064d025635b81, 518612bb1c884d9bb7aff8d431904f8d'.split(','),
  40. "09cp":'cb5887f7f3da43bf9ce383fbe4bae99b, d236fb56ac954bb29b3a6d0bdbe85588'.split(','),
  41. "10cp":'dca81dee239e4f7e9d8b69c3af629f00, 69ef058f04474e3fbfd4cd22bb440934, 42fe939bbf7c42058f9c32356a08f319'.split(','),
  42. "11cp":'fd62c35e2572460b88fb934e56888a2d, 4836763c382a45dcba1210f616e9e3be'.split(','),
  43. "1213CP":'06fcab3ccc204198ba04bc226d6a049a, c72fe82506234db6bd75919ac0e61ec5, 884d594255f54a88b36f078ec2842669, 921eaf2a769c4f069e9588b0fa99f170, 02abef88316e482b9d4c4f3cb2a34c64'.split(','),
  44. "15cp":'6e4c35329ba1470c8ebdf2ad3f1e92cd'.split(','),
  45. "14cp":'0b168caa5f1848e1b614e97b3cc22923, a05cc1124331484c9d852f4918a3248d'.split(','),
  46. "16cp":'506d2f805551425d938f488746730060, 21fbd2534bc840ebac3a5fac50e54cf5'.split(','),
  47. "17cp":'d756e9288311440599eab62bde2e017e'.split(','),
  48. "18cp":'11bb3c4c831a4151b8c7086f39086878'.split(','),
  49. }
  50. var playMusic = function(pano){//根据漫游点切换bgm
  51. //var describe = player.director.describe();
  52. //manage.bgmShouldPlay
  53. if( g_tourAudio.shouldPlay /* !g_tourAudio.paused */ || g_currentHot )return;
  54. var shouldplayMusic
  55. for(let i in musicList){
  56. if(musicList[i].find(e=>e.includes(pano.id))){
  57. shouldplayMusic = i;
  58. break
  59. }
  60. }
  61. if(shouldplayMusic){
  62. if(!g_bgAudio.src.includes(shouldplayMusic)){
  63. g_bgAudio.src = "music/"+shouldplayMusic+'.mp3'
  64. }
  65. manage.switchBgmState(true)
  66. }else{
  67. g_bgAudio.src = ''
  68. }
  69. }
  70. var dealMap = (map)=>{//使不resize when image is not power of two
  71. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  72. map.minFilter = THREE.LinearFilter;
  73. map.magFilter = THREE.LinearFilter;
  74. map.generateMipmaps = true;
  75. }
  76. var dom = {//许钟文add
  77. getOffset: function(type, element, parent) {
  78. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  79. if (!parent) parent = $("body")[0];
  80. while (element = element.offsetParent) {
  81. if (element == parent) break;
  82. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  83. }
  84. return left;
  85. }
  86. };
  87. var getTransformSid = function(){
  88. var name
  89. if(player.mode == 'panorama'){
  90. name = player.currentPano ? player.currentPano.id : 'outside'
  91. }else{
  92. name = 'outside'
  93. }
  94. return name
  95. }
  96. var convertTool = {
  97. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  98. var camera = camera || player.camera;
  99. var dom = dom || player.domElement;
  100. 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);
  101. var x,y;
  102. x = (pos.x + 1) / 2 * dom.clientWidth;
  103. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  104. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  105. && y <= dom.clientHeight && y >= 0
  106. return {
  107. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  108. vector: pos, //(范围 -1 ~ 1)
  109. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  110. inSight : inSight //在屏幕范围内可见
  111. };
  112. },
  113. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  114. var ori = player.position
  115. var dir = pos3d.clone().sub(ori).normalize()
  116. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  117. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  118. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  119. }else{ */
  120. var o = ray.intersectObjects(player.model.colliders);
  121. //}
  122. var len = pos3d.distanceTo(ori);
  123. if (o && o.length) {
  124. for(var i=0;i<o.length;i++){
  125. if(o[i].distance < len){ return true; }//有遮挡
  126. }
  127. }
  128. },
  129. /*
  130. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  131. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  132. */
  133. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  134. var A = pos;
  135. var player = player;
  136. var mouse = player.mouse;
  137. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  138. if(info.y != void 0){//地面线的
  139. var y = info.y;
  140. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  141. //intersectPlane和地面平行,无交点
  142. var x = pos.x, z = pos.z;
  143. }else{
  144. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  145. if(O.y == A.y){console.log('一样??');return;}
  146. if(A.y == y){console.log('一样2??');return;}
  147. var r = (O.y-y)/(A.y-y);
  148. var x = (r*A.x-O.x)/(r-1);
  149. var z = (r*A.z-O.z)/(r-1);
  150. }
  151. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  152. var N = info.normalVec;
  153. var P = info.pullPos;
  154. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  155. if(O.z==A.z){console.log('O.z==A.z?');return;}
  156. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  157. //console.log('N.z==0 && N.x == 0?');
  158. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  159. if(c == 0){console.log("分母为0?? return;");return;}
  160. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  161. var x = t * (A.x - O.x) + O.x;
  162. var y = t * (A.y - O.y) + O.y;
  163. var z = t * (A.z - O.z) + O.z;
  164. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  165. 求直线L与平面π的交点的坐标。
  166. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  167. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  168. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  169. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  170. 再代入参数方程即得交点的坐标(x,y,z). */
  171. }else if(N.x ==0 ){ //z与pullPos相等
  172. var z = P.z;
  173. if(O.y == A.y){console.log('一样??');return;}
  174. if(A.y == y){console.log('一样2??');return;}
  175. if(A.z == z){console.log('一样3??');return;}
  176. var r = (O.z-z)/(A.z-z);
  177. var x = (r*A.x-O.x)/(r-1);
  178. var y = (r*A.y-O.y)/(r-1);
  179. }else if(N.z == 0){//x与pullPos相等
  180. var x = P.x;
  181. if(O.y == A.y){console.log('一样??');return;}
  182. if(A.y == y){console.log('一样2??');return;}
  183. if(A.x == x){console.log('一样3??');return;}
  184. var r = (O.x-x)/(A.x-x);
  185. var y = (r*A.y-O.y)/(r-1);
  186. var z = (r*A.z-O.z)/(r-1);
  187. }
  188. }
  189. return new THREE.Vector3(x,y,z);
  190. },
  191. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  192. var raycaster = new THREE.Raycaster;
  193. camera.updateMatrixWorld();
  194. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  195. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  196. var dir = end.sub(origin).normalize()
  197. raycaster.set(origin, dir);
  198. var n = raycaster.intersectObjects(meshes);
  199. if (0 === n.length)
  200. return null;
  201. return n[0];
  202. },
  203. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  204. var dir = B.clone().sub(A).normalize();
  205. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  206. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  207. var o = ray.intersectObjects(options.model || player.model.colliders);
  208. if (o && o.length)return o;
  209. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  210. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  211. normal.multiplyScalar(options.throughWidth)
  212. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  213. var A2 = A.clone().add(normalVec3)
  214. ray.set(A2, dir);
  215. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  216. ray.set(A.clone().add(normalVec3.negate()), dir);
  217. if (o2 && o2.length)return o2;
  218. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  219. if (o3 && o3.length)return o3;
  220. }
  221. return null;
  222. },
  223. getPosAtSphere : function(pos3d, toPanoPos){
  224. var dir = pos3d.clone().sub(toPanoPos);
  225. dir.normalize();//然后计算在球中
  226. dir.multiplyScalar(Constants.skyRadius);
  227. dir.add(toPanoPos);
  228. return dir;
  229. }
  230. }
  231. var videoPosInfo = {
  232. /* "3458d3c7ca764ecaa13c88aaa8e0a1a8" : [-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],
  233. "1107bf848a6146059249cc109c6d1472":[-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],
  234. "8c0e5bcc4a69470aa5f189edde162973":[-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],//多出的左前
  235. "10444ea5b3ed4629915c3f449b790c58":[0.03080183370988987, -0.26776671083073333, 0.2865850992680396],
  236. "9a32f7d9b29f427182b453b1a8009efc":[0.03080183370988987, -0.26776671083073333, 0.2265850992680396],
  237. "988a92b36f544326896b101b54a69290":[-0.034905996796551514, -0.26776671083073333, 0.3680810776239348],
  238. "a812006399af4c73b6b19941485597a2":[-0.06490599679655151, -0.26776671083073333, 0.3380810776239347],
  239. "9438aaa08cc94456a432ee3a7fa3378f":[-0.06490599679655151, -0.26776671083073333, 0.3380810776239347],
  240. "491d8cce5dfa441db5a52eb248bf4a63": [-0.3375152936642509, -0.26776671083073333, 0.27173181146902703],
  241. */
  242. "3458d3c7ca764ecaa13c88aaa8e0a1a8": [0.15, -0.3, 0.37]
  243. , "1107bf848a6146059249cc109c6d1472" :[0.15, -0.3,0.23]
  244. ,"8c0e5bcc4a69470aa5f189edde162973":[0.08, -0.3,0.25]
  245. ,"9a32f7d9b29f427182b453b1a8009efc" :[ 0.13, -0.3, 0.26]
  246. ,"491d8cce5dfa441db5a52eb248bf4a63":[0.05,-0.3, 0.27 ]
  247. ,"0a73cf23993d4f4cbb48337708f8c7b7":[0.09,-0.3, 0.25 ]
  248. ,"61afb8aaf45046be865b1b30d0357754":[0.290,-0.3,0.38]
  249. ,"58ea5816c49b4c759c26b262f403eab1":[0.034,-0.3,0.38]
  250. ,"6c455875e3834d53b43a2beaba11aa4d":[-0.04,-0.3,0.39]
  251. ,"2d00ef76d93f4a578b356c593da889b0":[0.35,-0.3,0.38]
  252. }
  253. var videoOffset
  254. var videoScale
  255. var loadedVideo = false
  256. var videoMat;
  257. //add 将其中一个曲面材质改成视频
  258. var loadVideo = ()=>{
  259. videoOffset = new THREE.Vector3(0.2638254165649414, -0.039959073066711426, 0.17957305908203125)
  260. videoScale = new THREE.Vector3(1.0199999809265137, 1.0199999809265137, 1.0199999809265137)
  261. //videoScale = new THREE.Vector3(1.02,1.02,1.02)
  262. var video = $('<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>')[0]
  263. video.setAttribute("crossOrigin", 'Anonymous')//要在src设置好前解决跨域
  264. $(video).on('contextmenu', function () { return false; });//禁止右键点击出
  265. setTimeout(()=>{
  266. video.src = manage.dealURL("images/video/濠江战旗别样红_x264.mp4");
  267. },3000)
  268. videoMat = new THREE.MeshBasicMaterial({
  269. map : new THREE.VideoTexture( video )
  270. })
  271. videoMat.map.wrapS = videoMat.map.wrapT = THREE.ClampToEdgeWrapping;
  272. videoMat.map.minFilter = THREE.LinearFilter;
  273. videoMat.map.magFilter = THREE.LinearFilter;
  274. videoMat.map.generateMipmaps = true;
  275. video.volume = 0
  276. video.muted = true
  277. window.videoPlane = player.model.chunks[1];
  278. player.model.chunks.splice(1,1)
  279. window.videoShow = video
  280. //playVideo()
  281. window.videoPlane.name = 'videoPlane'
  282. video.addEventListener('loadeddata', ()=>{
  283. console.log( "video loaded!!!")
  284. loadedVideo = true
  285. })
  286. var btn = addSoundBtn(video)
  287. window.videoPlane.add(btn)
  288. video.btn = btn; btn.video = video
  289. btn.position.set(-11.6,1.02,-8.5);
  290. btn.rotation.y = -0.4
  291. }
  292. var playVideo = (()=>{
  293. var shouldPlay = true //只和用户点击有关,不点击时都是true
  294. return (state)=>{
  295. if(state != void 0) shouldPlay = state
  296. if(shouldPlay){
  297. window.videoShow && window.videoShow.play()
  298. }else{
  299. window.videoShow && window.videoShow.pause()
  300. }
  301. loadedVideo && changeVideoMat()
  302. }
  303. })()
  304. var changeVideoMat = function(){
  305. window.videoPlane.material = videoMat;
  306. }
  307. var updateVideo = (o)=>{//因为漫游中点位不准,所以在不同点更新视频位置
  308. if(!window.videoShow)return;
  309. if(o.type != "flyDone"){
  310. clearInterval(window.transformVideoTimer)
  311. }
  312. if(o.type == "beforeFlyOut"){
  313. window.videoPlane.visible = true;
  314. playVideo()
  315. changeVideoPos(new THREE.Vector3, o.dur/3)
  316. videoPlane.scale.set(1,1,1)
  317. }else{
  318. if( o.type == "beforeFlyIn"){
  319. videoPlane.scale.copy(videoScale)
  320. }
  321. if( o.type == "flyDone"){
  322. if(videoPosInfo[o.pano.id]){
  323. window.videoPlane.visible = true;
  324. playVideo()
  325. }else{
  326. window.videoPlane.visible = false
  327. window.videoShow.pause()
  328. }
  329. }else{
  330. if(videoPosInfo[o.pano.id]){
  331. window.videoPlane.visible = true;
  332. playVideo()
  333. var end = new THREE.Vector3().fromArray(videoPosInfo[o.pano.id])//.add(videoOffset)
  334. changeVideoPos(end, o.dur)
  335. }else{
  336. }
  337. }
  338. }
  339. }
  340. var easeInOutQuad = function(e, t, i, n) {
  341. return e /= n / 2,
  342. e < 1 ? i / 2 * e * e + t : (e--,
  343. -i / 2 * (e * (e - 2) - 1) + t)
  344. }
  345. var linearTween = function(e, t, i, n) {
  346. return i * e / n + t
  347. }
  348. var changeVideoPos = function(end, dur){//开始渐变位置
  349. var start = window.videoPlane.position.clone();
  350. var startTime = new Date().getTime();
  351. window.transformVideoTimer = setInterval(()=>{
  352. var progress = (new Date().getTime() - startTime) / dur;
  353. progress = Math.min(progress, 1);
  354. progress = linearTween(progress,0,1,1)
  355. if(progress >= 1)clearInterval(window.transformVideoTimer)
  356. window.videoPlane.position.copy(new THREE.Vector3().lerpVectors(start, end, progress))
  357. },20)
  358. }
  359. var getScale = function(){
  360. var s = 1.02;
  361. var center = videoPlane.geometry.boundingBox.center()
  362. var matrix1 = new THREE.Matrix4().setPosition(center.clone().negate());
  363. var scaleM = new THREE.Matrix4().makeScale(s,s,s);
  364. var matrix2 = new THREE.Matrix4().setPosition(center.clone());
  365. var scaleMatrix = new THREE.Matrix4().multiplyMatrices(scaleM, matrix1)
  366. scaleMatrix = new THREE.Matrix4().multiplyMatrices(matrix2, scaleMatrix)
  367. var quaterion = new THREE.Quaternion;
  368. var scale = new THREE.Vector3
  369. var position = new THREE.Vector3
  370. scaleMatrix.decompose(position, quaterion, scale)
  371. console.log(scale.toArray())
  372. console.log(position.toArray())
  373. }
  374. var btnMat;
  375. var btnGeo
  376. var soundOnMat, soundOffMat;
  377. var addSoundBtn = function(video){
  378. if(!soundOffMat){
  379. var videoMusicOffMap = Texture.load("images/videoMusicOff.png")
  380. var videoMusicOnMap = Texture.load("images/videoMusicOn.png")
  381. soundOffMat = new THREE.MeshBasicMaterial({
  382. map : videoMusicOffMap ,
  383. transparent:true,
  384. })
  385. soundOnMat = new THREE.MeshBasicMaterial({
  386. map : videoMusicOnMap ,
  387. transparent:true,
  388. })
  389. btnGeo = new THREE.PlaneGeometry(0.17, 0.17,1,1);
  390. }
  391. var btn = new THREE.Mesh(btnGeo, soundOffMat);
  392. btn.name = 'soundBtn'
  393. btn.video = video;
  394. video.btn = btn;
  395. return btn
  396. }
  397. var SoundOnVideo;
  398. var switchSoundBtn = function(video, belong){
  399. if(video.btn.material == soundOffMat){ //开启
  400. if(SoundOnVideo){
  401. SoundOnVideo.btn.material = soundOffMat,
  402. SoundOnVideo.volume = 0,
  403. SoundOnVideo.muted = true
  404. }else{
  405. if(g_bgAudio && !g_bgAudio.paused){
  406. manage.switchBgmState(false);
  407. g_bgAudio.pauseByVideo = true
  408. }
  409. }
  410. video.btn.material = soundOnMat
  411. video.volume = 1
  412. //从头开始放:
  413. video.currentTime = 0
  414. video.muted = false;
  415. if(g_tourAudio)g_tourAudio.pause()
  416. SoundOnVideo = video
  417. video.pauseByHot = video.pauseByTour = false
  418. if(belong instanceof Overlay){
  419. belong.switchPlay(true)
  420. }else{
  421. video.play()
  422. }
  423. }else{//关闭
  424. video.btn.material = soundOffMat
  425. video.volume = 0
  426. video.muted = true
  427. SoundOnVideo = null
  428. if(g_bgAudio && g_bgAudio.pauseByVideo && !video.pauseByHot && !video.pauseByTour){
  429. manage.switchBgmState(true)
  430. }
  431. }
  432. }
  433. var checkSoundBtnClick = function(intersect){
  434. if(intersect && intersect.object.name == "soundBtn"){
  435. switchSoundBtn(intersect.object.video, intersect.object.parent);
  436. return true
  437. }
  438. }
  439. !function() {
  440. "use strict";
  441. function t(t, i) {
  442. return typeof t === i
  443. }
  444. function i(t, i) {
  445. return t instanceof i
  446. }
  447. function n(t) {
  448. return t && t.nodeType
  449. }
  450. function e(t) {
  451. return n(t) ? t : i(t, g) ? t[0] : void 0
  452. }
  453. function o(t, i, n) {
  454. return g.each(t, function(t, e) {
  455. n = i.call(e, n, t, e)
  456. }),
  457. n
  458. }
  459. function r(t, i, n) {
  460. var e, o, r;
  461. if (t === i)
  462. return !0;
  463. if (!t || !i || t.constructor !== i.constructor)
  464. return !1;
  465. for (e = 0,
  466. o = n.length; o > e; e += 1) {
  467. if (r = n[e],
  468. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  469. return !1;
  470. if (t[r] !== i[r])
  471. return !1
  472. }
  473. return !0
  474. }
  475. function s(t, i, n, e) {
  476. this.left = E(t),
  477. this.top = E(i),
  478. this.width = E(n),
  479. this.height = E(e),
  480. this.right = this.left + this.width,
  481. this.bottom = this.top + this.height
  482. }
  483. function h(t, i, n, e) {
  484. this.visible = t || 0,
  485. this.viewport = i || 0,
  486. this.possible = n || 0,
  487. this.rects = e && T({}, e) || null
  488. }
  489. function l(t, i) {
  490. this.els = t,
  491. this.viewport = i
  492. }
  493. function c(t, i, n) {
  494. var e;
  495. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  496. e ? e[n] : 0
  497. }
  498. function u(t, i) {
  499. return t.val - i.val
  500. }
  501. function a(t, i) {
  502. return i.val - t.val
  503. }
  504. function f(t) {
  505. var i = s.ofContent(t, !0)
  506. , n = s.ofViewport(t, !0)
  507. , e = i.width - n.width
  508. , o = i.height - n.height;
  509. this.content = i,
  510. this.viewport = n,
  511. this.width = 0 >= e ? null : n.left / e,
  512. this.height = 0 >= o ? null : n.top / o,
  513. this.left = n.left,
  514. this.top = n.top,
  515. this.right = i.right - n.right,
  516. this.bottom = i.bottom - n.bottom
  517. }
  518. function p(t) {
  519. this.el = t || window
  520. }
  521. function d(t, i) {
  522. this.context = t,
  523. this.viewport = i,
  524. this.init()
  525. }
  526. function v(t, i, n, e) {
  527. this.context = new l(t,i),
  528. this.property = n,
  529. this.descending = e,
  530. this.init()
  531. }
  532. function w(t) {
  533. t && t !== window && t !== document ? (this.context = t,
  534. this.$autoTarget = g(t)) : this.context = window,
  535. this.init()
  536. }
  537. var g = jQuery
  538. , m = g(window)
  539. , b = g(document)
  540. , T = g.extend
  541. , y = g.isFunction
  542. , k = Math.max
  543. , V = Math.min
  544. , E = Math.round
  545. , x = function() {
  546. var t = {}
  547. , i = 1;
  548. return function(n) {
  549. return n ? (t[n] || (t[n] = i,
  550. i += 1),
  551. t[n]) : 0
  552. }
  553. }();
  554. T(s.prototype, {
  555. equals: function(t) {
  556. return r(this, t, ["left", "top", "width", "height"])
  557. },
  558. area: function() {
  559. return this.width * this.height
  560. },
  561. relativeTo: function(t) {
  562. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  563. },
  564. intersection: function(t) {
  565. if (!i(t, s))
  566. return null;
  567. var n = k(this.left, t.left)
  568. , e = V(this.right, t.right)
  569. , o = k(this.top, t.top)
  570. , r = V(this.bottom, t.bottom)
  571. , h = e - n
  572. , l = r - o;
  573. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  574. },
  575. envelope: function(t) {
  576. if (!i(t, s))
  577. return this;
  578. var n = V(this.left, t.left)
  579. , e = k(this.right, t.right)
  580. , o = V(this.top, t.top)
  581. , r = k(this.bottom, t.bottom)
  582. , h = e - n
  583. , l = r - o;
  584. return new s(n,o,h,l)
  585. }
  586. }),
  587. T(s, {
  588. ofContent: function(t, i) {
  589. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  590. },
  591. ofViewport: function(t, i) {
  592. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  593. },
  594. ofElement: function(t) {
  595. var i = g(t);
  596. if (!i.is(":visible"))
  597. return null;
  598. var n = i.offset();
  599. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  600. }
  601. }),
  602. T(h.prototype, {
  603. equals: function(t) {
  604. return this.fracsEqual(t) && this.rectsEqual(t)
  605. },
  606. fracsEqual: function(t) {
  607. return r(this, t, ["visible", "viewport", "possible"])
  608. },
  609. rectsEqual: function(t) {
  610. return r(this.rects, t.rects, ["document", "element", "viewport"])
  611. }
  612. }),
  613. T(h, {
  614. of: function(t, i) {
  615. var e, o, r;
  616. return t = n(t) && s.ofElement(t) || t,
  617. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  618. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  619. r = V(t.width, i.width) * V(t.height, i.height),
  620. new h(o / t.area(),o / i.area(),o / r,{
  621. document: e,
  622. element: e.relativeTo(t),
  623. viewport: e.relativeTo(i)
  624. })) : new h
  625. }
  626. });
  627. var q = ["width", "height", "left", "right", "top", "bottom"]
  628. , S = ["possible", "visible", "viewport"];
  629. T(l.prototype, {
  630. sorted: function(t, i) {
  631. var n = this.viewport;
  632. return g.map(this.els, function(i) {
  633. return {
  634. el: i,
  635. val: c(i, n, t)
  636. }
  637. }).sort(i ? a : u)
  638. },
  639. best: function(t, i) {
  640. return this.els.length ? this.sorted(t, i)[0] : null
  641. }
  642. }),
  643. T(f.prototype, {
  644. equals: function(t) {
  645. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  646. }
  647. }),
  648. T(p.prototype, {
  649. equals: function(t) {
  650. return r(this, t, ["el"])
  651. },
  652. scrollState: function() {
  653. return new f(this.el)
  654. },
  655. scrollTo: function(t, i, n) {
  656. var e = g(this.el === window ? "html,body" : this.el);
  657. t = t || 0,
  658. i = i || 0,
  659. n = isNaN(n) ? 1e3 : n,
  660. e.stop(!0).animate({
  661. scrollLeft: t,
  662. scrollTop: i
  663. }, n)
  664. },
  665. scroll: function(t, i, n) {
  666. var e = this.el === window ? m : g(this.el);
  667. t = t || 0,
  668. i = i || 0,
  669. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  670. },
  671. scrollToRect: function(t, i, n, e) {
  672. i = i || 0,
  673. n = n || 0,
  674. this.scrollTo(t.left - i, t.top - n, e)
  675. },
  676. scrollToElement: function(t, i, n, e) {
  677. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  678. this.scrollToRect(o, i, n, e)
  679. }
  680. });
  681. var C = {
  682. init: function() {
  683. this.callbacks = g.Callbacks("memory unique"),
  684. this.currVal = null,
  685. this.prevVal = null,
  686. this.checkProxy = g.proxy(this.check, this),
  687. this.autoCheck()
  688. },
  689. bind: function(t) {
  690. this.callbacks.add(t)
  691. },
  692. unbind: function(t) {
  693. t ? this.callbacks.remove(t) : this.callbacks.empty()
  694. },
  695. trigger: function() {
  696. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  697. },
  698. check: function(t) {
  699. var i = this.updatedValue(t);
  700. return void 0 !== i && (this.prevVal = this.currVal,
  701. this.currVal = i,
  702. this.trigger(),
  703. !0)
  704. },
  705. $autoTarget: m,
  706. autoEvents: "load resize scroll",
  707. autoCheck: function(t) {
  708. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  709. }
  710. };
  711. T(d.prototype, C, {
  712. updatedValue: function() {
  713. var t = h.of(this.context, this.viewport);
  714. return this.currVal && this.currVal.equals(t) ? void 0 : t
  715. }
  716. }),
  717. T(v.prototype, C, {
  718. updatedValue: function() {
  719. var t = this.context.best(this.property, this.descending);
  720. return t && (t = t.val > 0 ? t.el : null,
  721. this.currVal !== t) ? t : void 0
  722. }
  723. }),
  724. T(w.prototype, C, {
  725. updatedValue: function() {
  726. var t = new f(this.context);
  727. return this.currVal && this.currVal.equals(t) ? void 0 : t
  728. }
  729. });
  730. var L = function(t, i) {
  731. var n = [].slice
  732. , e = jQuery
  733. , o = e.extend
  734. , r = e.isFunction
  735. , s = o({}, i)
  736. , h = function(i, n, o, s) {
  737. return o = r(o) ? o.apply(i, n) : o,
  738. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  739. }
  740. , l = function() {
  741. return h(this, n.call(arguments), s.defaultStatic, l)
  742. }
  743. , c = function(t) {
  744. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  745. }
  746. , u = function(t) {
  747. t && (o(l, t.statics),
  748. o(c, t.methods)),
  749. l.modplug = u
  750. };
  751. u.prev = {
  752. statics: e[t],
  753. methods: e.fn[t]
  754. },
  755. u(i),
  756. e[t] = l,
  757. e.fn[t] = c
  758. }
  759. , M = "fracs";
  760. L(M, {
  761. statics: {
  762. version: "0.15.0",
  763. Rect: s,
  764. Fractions: h,
  765. Group: l,
  766. ScrollState: f,
  767. Viewport: p,
  768. FracsCallbacks: d,
  769. GroupCallbacks: v,
  770. ScrollStateCallbacks: w,
  771. fracs: function(t, i) {
  772. return h.of(t, i)
  773. }
  774. },
  775. methods: {
  776. content: function(t) {
  777. return this.length ? s.ofContent(this[0], t) : null
  778. },
  779. envelope: function() {
  780. return o(this, function(t) {
  781. var i = s.ofElement(this);
  782. return t ? t.envelope(i) : i
  783. })
  784. },
  785. fracs: function(i, n, o) {
  786. t(i, "string") || (o = n,
  787. n = i,
  788. i = null),
  789. y(n) || (o = n,
  790. n = null),
  791. o = e(o);
  792. var r = M + ".fracs." + x(o);
  793. return "unbind" === i ? this.each(function() {
  794. var t = g(this).data(r);
  795. t && t.unbind(n)
  796. }) : "check" === i ? this.each(function() {
  797. var t = g(this).data(r);
  798. t && t.check()
  799. }) : y(n) ? this.each(function() {
  800. var t = g(this)
  801. , i = t.data(r);
  802. i || (i = new d(this,o),
  803. t.data(r, i)),
  804. i.bind(n)
  805. }) : this.length ? h.of(this[0], o) : null
  806. },
  807. intersection: function() {
  808. return o(this, function(t) {
  809. var i = s.ofElement(this);
  810. return t ? t.intersection(i) : i
  811. })
  812. },
  813. max: function(t, i, n) {
  814. return y(i) || (n = i,
  815. i = null),
  816. n = e(n),
  817. i ? (new v(this,n,t,!0).bind(i),
  818. this) : this.pushStack(new l(this,n).best(t, !0).el)
  819. },
  820. min: function(t, i, n) {
  821. return y(i) || (n = i,
  822. i = null),
  823. n = e(n),
  824. i ? (new v(this,n,t).bind(i),
  825. this) : this.pushStack(new l(this,n).best(t).el)
  826. },
  827. rect: function() {
  828. return this.length ? s.ofElement(this[0]) : null
  829. },
  830. scrollState: function(i, n) {
  831. var e = M + ".scrollState";
  832. return t(i, "string") || (n = i,
  833. i = null),
  834. "unbind" === i ? this.each(function() {
  835. var t = g(this).data(e);
  836. t && t.unbind(n)
  837. }) : "check" === i ? this.each(function() {
  838. var t = g(this).data(e);
  839. t && t.check()
  840. }) : y(n) ? this.each(function() {
  841. var t = g(this)
  842. , i = t.data(e);
  843. i || (i = new w(this),
  844. t.data(e, i)),
  845. i.bind(n)
  846. }) : this.length ? new f(this[0]) : null
  847. },
  848. scroll: function(t, i, n) {
  849. return this.each(function() {
  850. new p(this).scroll(t, i, n)
  851. })
  852. },
  853. scrollTo: function(t, i, n, o) {
  854. return g.isNumeric(t) && (o = n,
  855. n = i,
  856. i = t,
  857. t = null),
  858. t = e(t),
  859. this.each(function() {
  860. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  861. })
  862. },
  863. scrollToThis: function(t, i, n, o) {
  864. return o = new p(e(o)),
  865. o.scrollToElement(this[0], t, i, n),
  866. this
  867. },
  868. softLink: function(t, i, n, o) {
  869. return o = new p(e(o)),
  870. this.filter("a[href^=#]").each(function() {
  871. var e = g(this);
  872. e.on("click", function() {
  873. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  874. })
  875. })
  876. },
  877. sort: function(i, n, o) {
  878. return t(n, "boolean") || (o = n,
  879. n = null),
  880. o = e(o),
  881. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  882. return t.el
  883. }))
  884. },
  885. viewport: function(t) {
  886. return this.length ? s.ofViewport(this[0], t) : null
  887. }
  888. },
  889. defaultStatic: "fracs",
  890. defaultMethod: "fracs"
  891. })
  892. }();
  893. if ("undefined" == typeof jQuery)
  894. throw new Error("Bootstrap's JavaScript requires jQuery");
  895. +function(t) {
  896. "use strict";
  897. function e(e) {
  898. return this.each(function() {
  899. var o = t(this)
  900. , s = o.data("bs.tooltip")
  901. , n = "object" == typeof e && e;
  902. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  903. "string" == typeof e && s[e]())
  904. })
  905. }
  906. var i = function(t, e) {
  907. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  908. this.init("tooltip", t, e)
  909. };
  910. i.VERSION = "3.2.0",
  911. i.DEFAULTS = {
  912. animation: !0,
  913. placement: "top",
  914. selector: !1,
  915. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  916. trigger: "hover focus",
  917. title: "",
  918. delay: 0,
  919. html: !1,
  920. container: !1,
  921. viewport: {
  922. selector: "body",
  923. padding: 0
  924. }
  925. },
  926. i.prototype.init = function(e, i, o) {
  927. this.enabled = !0,
  928. this.type = e,
  929. this.$element = t(i),
  930. this.options = this.getOptions(o),
  931. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  932. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  933. var r = s[n];
  934. if ("click" == r)
  935. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  936. else if ("manual" != r) {
  937. var a = "hover" == r ? "mouseenter" : "focusin"
  938. , l = "hover" == r ? "mouseleave" : "focusout";
  939. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  940. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  941. }
  942. }
  943. this.options.selector ? this._options = t.extend({}, this.options, {
  944. trigger: "manual",
  945. selector: ""
  946. }) : this.fixTitle()
  947. }
  948. ,
  949. i.prototype.getDefaults = function() {
  950. return i.DEFAULTS
  951. }
  952. ,
  953. i.prototype.getOptions = function(e) {
  954. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  955. e.delay && "number" == typeof e.delay && (e.delay = {
  956. show: e.delay,
  957. hide: e.delay
  958. }),
  959. e
  960. }
  961. ,
  962. i.prototype.getDelegateOptions = function() {
  963. var e = {}
  964. , i = this.getDefaults();
  965. return this._options && t.each(this._options, function(t, o) {
  966. i[t] != o && (e[t] = o)
  967. }),
  968. e
  969. }
  970. ,
  971. i.prototype.enter = function(e) {
  972. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  973. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  974. t(e.currentTarget).data("bs." + this.type, i)),
  975. clearTimeout(i.timeout),
  976. i.hoverState = "in",
  977. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  978. // "in" == i.hoverState && i.show()
  979. }, i.options.delay.show)) : i.show()
  980. }
  981. ,
  982. i.prototype.leave = function(e) {
  983. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  984. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  985. t(e.currentTarget).data("bs." + this.type, i)),
  986. clearTimeout(i.timeout),
  987. i.hoverState = "out",
  988. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  989. "out" == i.hoverState && i.hide()
  990. }, i.options.delay.hide)) : i.hide()
  991. }
  992. ,
  993. i.prototype.show = function() {
  994. var e = t.Event("show.bs." + this.type);
  995. if (this.hasContent() && this.enabled) {
  996. this.$element.trigger(e);
  997. var i = t.contains(document.documentElement, this.$element[0]);
  998. if (e.isDefaultPrevented() || !i)
  999. return;
  1000. var o = this
  1001. , s = this.tip()
  1002. , n = this.getUID(this.type);
  1003. this.setContent(),
  1004. s.attr("id", n),
  1005. this.$element.attr("aria-describedby", n),
  1006. this.options.animation && s.addClass("fade");
  1007. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  1008. , a = /\s?auto?\s?/i
  1009. , l = a.test(r);
  1010. l && (r = r.replace(a, "") || "top"),
  1011. s.detach().css({
  1012. top: 0,
  1013. left: 0,
  1014. display: "block"
  1015. }).addClass(r).data("bs." + this.type, this),
  1016. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  1017. var p = this.getPosition()
  1018. , h = s[0].offsetWidth
  1019. , f = s[0].offsetHeight;
  1020. if (l) {
  1021. var u = r
  1022. , c = this.$element.parent()
  1023. , d = this.getPosition(c);
  1024. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  1025. s.removeClass(u).addClass(r)
  1026. }
  1027. var g = this.getCalculatedOffset(r, p, h, f);
  1028. this.applyPlacement(g, r);
  1029. var y = function() {
  1030. o.$element.trigger("shown.bs." + o.type),
  1031. o.hoverState = null
  1032. };
  1033. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  1034. }
  1035. }
  1036. ,
  1037. i.prototype.applyPlacement = function(e, i) {
  1038. var o = this.tip()
  1039. , s = o[0].offsetWidth
  1040. , n = o[0].offsetHeight
  1041. , r = parseInt(o.css("margin-top"), 10)
  1042. , a = parseInt(o.css("margin-left"), 10);
  1043. isNaN(r) && (r = 0),
  1044. isNaN(a) && (a = 0),
  1045. e.top = e.top + r,
  1046. e.left = e.left + a,
  1047. t.offset.setOffset(o[0], t.extend({
  1048. using: function(t) {
  1049. o.css({
  1050. top: Math.round(t.top),
  1051. left: Math.round(t.left)
  1052. })
  1053. }
  1054. }, e), 0),
  1055. o.addClass("in");
  1056. var l = o[0].offsetWidth
  1057. , p = o[0].offsetHeight;
  1058. "top" == i && p != n && (e.top = e.top + n - p);
  1059. var h = this.getViewportAdjustedDelta(i, e, l, p);
  1060. h.left ? e.left += h.left : e.top += h.top;
  1061. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  1062. , u = h.left ? "left" : "top"
  1063. , c = h.left ? "offsetWidth" : "offsetHeight";
  1064. o.offset(e),
  1065. this.replaceArrow(f, o[0][c], u)
  1066. }
  1067. ,
  1068. i.prototype.replaceArrow = function(t, e, i) {
  1069. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  1070. }
  1071. ,
  1072. i.prototype.setContent = function() {
  1073. var t = this.tip()
  1074. , e = this.getTitle();
  1075. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  1076. t.removeClass("fade in top bottom left right")
  1077. }
  1078. ,
  1079. i.prototype.hide = function() {
  1080. function e() {
  1081. "in" != i.hoverState && o.detach(),
  1082. i.$element.trigger("hidden.bs." + i.type)
  1083. }
  1084. var i = this
  1085. , o = this.tip()
  1086. , s = t.Event("hide.bs." + this.type);
  1087. if (this.$element.removeAttr("aria-describedby"),
  1088. this.$element.trigger(s),
  1089. !s.isDefaultPrevented())
  1090. return o.removeClass("in"),
  1091. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  1092. this.hoverState = null,
  1093. this
  1094. }
  1095. ,
  1096. i.prototype.fixTitle = function() {
  1097. var t = this.$element;
  1098. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  1099. }
  1100. ,
  1101. i.prototype.hasContent = function() {
  1102. return this.getTitle()
  1103. }
  1104. ,
  1105. i.prototype.getPosition = function(e) {
  1106. e = e || this.$element;
  1107. var i = e[0]
  1108. , o = "BODY" == i.tagName;
  1109. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  1110. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  1111. width: o ? t(window).width() : e.outerWidth(),
  1112. height: o ? t(window).height() : e.outerHeight()
  1113. }, o ? {
  1114. top: 0,
  1115. left: 0
  1116. } : e.offset())
  1117. }
  1118. ,
  1119. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  1120. return "bottom" == t ? {
  1121. top: e.top + e.height,
  1122. left: e.left + e.width / 2 - i / 2
  1123. } : "top" == t ? {
  1124. top: e.top - o,
  1125. left: e.left + e.width / 2 - i / 2
  1126. } : "left" == t ? {
  1127. top: e.top + e.height / 2 - o / 2,
  1128. left: e.left - i
  1129. } : {
  1130. top: e.top + e.height / 2 - o / 2,
  1131. left: e.left + e.width
  1132. }
  1133. }
  1134. ,
  1135. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  1136. var s = {
  1137. top: 0,
  1138. left: 0
  1139. };
  1140. if (!this.$viewport)
  1141. return s;
  1142. var n = this.options.viewport && this.options.viewport.padding || 0
  1143. , r = this.getPosition(this.$viewport);
  1144. if (/right|left/.test(t)) {
  1145. var a = e.top - n - r.scroll
  1146. , l = e.top + n - r.scroll + o;
  1147. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  1148. } else {
  1149. var p = e.left - n
  1150. , h = e.left + n + i;
  1151. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  1152. }
  1153. return s
  1154. }
  1155. ,
  1156. i.prototype.getTitle = function() {
  1157. var t, e = this.$element, i = this.options;
  1158. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  1159. }
  1160. ,
  1161. i.prototype.getUID = function(t) {
  1162. do
  1163. t += ~~(1e6 * Math.random());
  1164. while (document.getElementById(t));return t
  1165. }
  1166. ,
  1167. i.prototype.tip = function() {
  1168. return this.$tip = this.$tip || t(this.options.template)
  1169. }
  1170. ,
  1171. i.prototype.arrow = function() {
  1172. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  1173. }
  1174. ,
  1175. i.prototype.validate = function() {
  1176. this.$element[0].parentNode || (this.hide(),
  1177. this.$element = null,
  1178. this.options = null)
  1179. }
  1180. ,
  1181. i.prototype.enable = function() {
  1182. this.enabled = !0
  1183. }
  1184. ,
  1185. i.prototype.disable = function() {
  1186. this.enabled = !1
  1187. }
  1188. ,
  1189. i.prototype.toggleEnabled = function() {
  1190. this.enabled = !this.enabled
  1191. }
  1192. ,
  1193. i.prototype.toggle = function(e) {
  1194. var i = this;
  1195. e && (i = t(e.currentTarget).data("bs." + this.type),
  1196. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  1197. t(e.currentTarget).data("bs." + this.type, i))),
  1198. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  1199. }
  1200. ,
  1201. i.prototype.destroy = function() {
  1202. clearTimeout(this.timeout),
  1203. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  1204. }
  1205. ;
  1206. var o = t.fn.tooltip;
  1207. t.fn.tooltip = e,
  1208. t.fn.tooltip.Constructor = i,
  1209. t.fn.tooltip.noConflict = function() {
  1210. return t.fn.tooltip = o,
  1211. this
  1212. }
  1213. }(jQuery);
  1214. !function(e, t, n) {
  1215. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1216. }("Keen", this, function() {
  1217. "use strict";
  1218. function Keen() {
  1219. return _init.apply(this, arguments)
  1220. }
  1221. function _init(e) {
  1222. if (_isUndefined(e))
  1223. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1224. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  1225. throw new Error("Please provide a projectId");
  1226. this.configure(e)
  1227. }
  1228. function _extend(e) {
  1229. for (var t = 1; t < arguments.length; t++)
  1230. for (var n in arguments[t])
  1231. e[n] = arguments[t][n];
  1232. return e
  1233. }
  1234. function _isUndefined(e) {
  1235. return void 0 === e
  1236. }
  1237. function _type(e) {
  1238. var t = e && e.constructor ? e.constructor.toString() : void 0;
  1239. return t ? t.match(/function (.*)\(/)[1] : "Null"
  1240. }
  1241. function _each(e, t, n) {
  1242. var r;
  1243. if (!e)
  1244. return 0;
  1245. if (n = n ? n : e,
  1246. "array" === _type(e)) {
  1247. for (r = 0; r < e.length; r++)
  1248. if (t.call(n, e[r], r, e) === !1)
  1249. return 0
  1250. } else
  1251. for (r in e)
  1252. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  1253. return 0;
  1254. return 1
  1255. }
  1256. function _parse_params(e) {
  1257. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  1258. return decodeURIComponent(e.replace(r, " "))
  1259. }, a = e.split("?")[1]; t = i.exec(a); )
  1260. n[o(t[1])] = o(t[2]);
  1261. return n
  1262. }
  1263. function _set_protocol(e) {
  1264. switch (e) {
  1265. case "http":
  1266. return "http";
  1267. case "auto":
  1268. return location.protocol.replace(/:/g, "");
  1269. case "https":
  1270. case void 0:
  1271. default:
  1272. return "https"
  1273. }
  1274. }
  1275. function _set_request_type(e) {
  1276. var t = e || "jsonp"
  1277. , n = !1;
  1278. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  1279. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  1280. }
  1281. function _build_url(e) {
  1282. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1283. }
  1284. function _uploadEvent(e, t, n, r, i) {
  1285. var o = _build_url.apply(this, ["/events/" + e])
  1286. , a = {};
  1287. n = n !== !1,
  1288. this.client.globalProperties && (a = this.client.globalProperties(e));
  1289. for (var c in t)
  1290. t.hasOwnProperty(c) && (a[c] = t[c]);
  1291. switch (this.client.requestType) {
  1292. case "xhr":
  1293. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  1294. break;
  1295. case "jsonp":
  1296. var s = JSON.stringify(a)
  1297. , l = Keen.Base64.encode(s);
  1298. o = o + "?api_key=" + this.client.writeKey,
  1299. o = o + "&data=" + l,
  1300. o = o + "&modified=" + (new Date).getTime(),
  1301. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  1302. break;
  1303. case "beacon":
  1304. var s = JSON.stringify(a)
  1305. , l = Keen.Base64.encode(s);
  1306. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  1307. o = o + "&data=" + encodeURIComponent(l),
  1308. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  1309. o += "&c=clv1",
  1310. _request.beacon.apply(this, [o, null, r, i])
  1311. }
  1312. }
  1313. Keen.prototype.configure = function(e) {
  1314. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1315. e.protocol = _set_protocol(e.protocol),
  1316. e.requestType = _set_request_type(e.requestType),
  1317. this.client = {
  1318. projectId: e.projectId,
  1319. writeKey: e.writeKey,
  1320. readKey: e.readKey,
  1321. globalProperties: null,
  1322. endpoint: e.protocol + "://" + e.host,
  1323. requestType: e.requestType
  1324. },
  1325. Keen.trigger("client", this, e),
  1326. this.trigger("ready"),
  1327. this
  1328. }
  1329. ;
  1330. var _request = {
  1331. xhr: function(e, t, n, r, i, o, a, c) {
  1332. if (!i)
  1333. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1334. var s = new XMLHttpRequest;
  1335. if (s.onreadystatechange = function() {
  1336. if (4 == s.readyState)
  1337. if (s.status >= 200 && s.status < 300) {
  1338. var e;
  1339. try {
  1340. e = JSON.parse(s.responseText)
  1341. } catch (e) {
  1342. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  1343. c && c(s, e)
  1344. }
  1345. a && e && a(e)
  1346. } else
  1347. Keen.log("HTTP request failed."),
  1348. c && c(s, null)
  1349. }
  1350. ,
  1351. s.open(e, t, o),
  1352. i && s.setRequestHeader("Authorization", i),
  1353. r && s.setRequestHeader("Content-Type", "application/json"),
  1354. n)
  1355. for (var l in n)
  1356. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1357. var u = r ? JSON.stringify(r) : null;
  1358. s.send(u)
  1359. },
  1360. jsonp: function(e, t, n, r) {
  1361. if (!t)
  1362. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1363. if (t && e.indexOf("api_key") < 0) {
  1364. var i = e.indexOf("?") > 0 ? "&" : "?";
  1365. e = e + i + "api_key=" + t
  1366. }
  1367. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1368. o += "a";
  1369. var a = !1;
  1370. window[o] = function(e) {
  1371. a = !0,
  1372. n && e && n(e),
  1373. window[o] = void 0
  1374. }
  1375. ,
  1376. e = e + "&jsonp=" + o;
  1377. var c = document.createElement("script");
  1378. c.id = "keen-jsonp",
  1379. c.src = e,
  1380. document.getElementsByTagName("head")[0].appendChild(c),
  1381. c.onreadystatechange = function() {
  1382. a === !1 && "loaded" === this.readyState && (a = !0,
  1383. r && r())
  1384. }
  1385. ,
  1386. c.onerror = function() {
  1387. a === !1 && (a = !0,
  1388. r && r())
  1389. }
  1390. },
  1391. beacon: function(e, t, n, r) {
  1392. if (t && e.indexOf("api_key") < 0) {
  1393. var i = e.indexOf("?") > 0 ? "&" : "?";
  1394. e = e + i + "api_key=" + t
  1395. }
  1396. var o = !1
  1397. , a = document.createElement("img");
  1398. a.onload = function() {
  1399. if (o = !0,
  1400. "naturalHeight"in this) {
  1401. if (this.naturalHeight + this.naturalWidth === 0)
  1402. return void this.onerror()
  1403. } else if (this.width + this.height === 0)
  1404. return void this.onerror();
  1405. n && n({
  1406. created: !0
  1407. })
  1408. }
  1409. ,
  1410. a.onerror = function() {
  1411. o = !0,
  1412. r && r()
  1413. }
  1414. ,
  1415. a.src = e
  1416. }
  1417. }
  1418. , Events = Keen.Events = {
  1419. on: function(e, t) {
  1420. this.listeners || (this.listeners = {});
  1421. var n = this.listeners[e] || (this.listeners[e] = []);
  1422. return n.push({
  1423. callback: t
  1424. }),
  1425. this
  1426. },
  1427. off: function(e, t) {
  1428. if (!e && !t)
  1429. return this.listeners = void 0,
  1430. delete this.listeners,
  1431. this;
  1432. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1433. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1434. t && 0 != n.length || (this.listeners[e] = void 0,
  1435. delete this.listeners[e]);
  1436. return this
  1437. },
  1438. trigger: function(e) {
  1439. if (!this.listeners)
  1440. return this;
  1441. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1442. n[r].callback.apply(this, t);
  1443. return this
  1444. }
  1445. };
  1446. _extend(Keen.prototype, Events),
  1447. _extend(Keen, Events),
  1448. Keen.loaded = !0,
  1449. Keen.utils = {
  1450. each: _each,
  1451. extend: _extend,
  1452. parseParams: _parse_params
  1453. },
  1454. Keen.ready = function(e) {
  1455. Keen.loaded ? e() : Keen.on("ready", e)
  1456. }
  1457. ,
  1458. Keen.log = function(e) {
  1459. "object" == typeof console && console.log("[Keen IO]", e)
  1460. }
  1461. ;
  1462. var Plugins = Keen.Plugins = {};
  1463. Keen.prototype.addEvent = function() {
  1464. _uploadEvent.apply(this, arguments)
  1465. }
  1466. ,
  1467. Keen.prototype.addEventSync = function(e, t, n, r) {
  1468. _uploadEvent.apply(this, [e, t, !1, n, r])
  1469. }
  1470. ,
  1471. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1472. var o = e
  1473. , a = o.metaKey
  1474. , c = o.target
  1475. , s = !1
  1476. , l = function() {};
  1477. return void 0 === r && (r = 500),
  1478. "A" === c.nodeName ? l = function() {
  1479. a || s || (s = !0,
  1480. window.location = c.href)
  1481. }
  1482. : "FORM" === c.nodeName && (l = function() {
  1483. s || (s = !0,
  1484. c.submit())
  1485. }
  1486. ),
  1487. i && (l = function() {
  1488. s || (s = !0,
  1489. i())
  1490. }
  1491. ),
  1492. _uploadEvent.call(this, t, n, l, l),
  1493. setTimeout(function() {
  1494. l()
  1495. }, r),
  1496. !!a && void 0
  1497. }
  1498. ,
  1499. Keen.prototype.setGlobalProperties = function(e) {
  1500. if (!this.client)
  1501. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1502. if (!e || "function" != typeof e)
  1503. throw new Error("Invalid value for global properties: " + e);
  1504. this.client.globalProperties = e
  1505. }
  1506. ,
  1507. Keen.Base64 = {
  1508. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1509. encode: function(e) {
  1510. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1511. for (e = this.utf8.encode(e); l < e.length; )
  1512. t = e.charCodeAt(l++),
  1513. n = e.charCodeAt(l++),
  1514. r = e.charCodeAt(l++),
  1515. i = t >> 2,
  1516. o = (3 & t) << 4 | n >> 4,
  1517. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1518. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1519. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1520. return s
  1521. },
  1522. decode: function(e) {
  1523. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1524. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1525. t = u.indexOf(e.charAt(l++)),
  1526. n = u.indexOf(e.charAt(l++)),
  1527. r = u.indexOf(e.charAt(l++)),
  1528. i = u.indexOf(e.charAt(l++)),
  1529. o = t << 2 | n >> 4,
  1530. a = (15 & n) << 4 | r >> 2,
  1531. c = (3 & r) << 6 | i,
  1532. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1533. return this.utf8.decode(s)
  1534. },
  1535. utf8: {
  1536. encode: function(e) {
  1537. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1538. t = e.charCodeAt(r++),
  1539. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1540. return n
  1541. },
  1542. decode: function(e) {
  1543. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1544. n = e.charCodeAt(i),
  1545. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1546. return r
  1547. }
  1548. }
  1549. },
  1550. "object" != typeof JSON && (JSON = {}),
  1551. function() {
  1552. function f(e) {
  1553. return 10 > e ? "0" + e : e
  1554. }
  1555. function quote(e) {
  1556. return escapable.lastIndex = 0,
  1557. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1558. var t = meta[e];
  1559. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1560. }) + '"' : '"' + e + '"'
  1561. }
  1562. function str(e, t) {
  1563. var n, r, i, o, a, c = gap, s = t[e];
  1564. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1565. "function" == typeof rep && (s = rep.call(t, e, s)),
  1566. typeof s) {
  1567. case "string":
  1568. return quote(s);
  1569. case "number":
  1570. return isFinite(s) ? String(s) : "null";
  1571. case "boolean":
  1572. case "null":
  1573. return String(s);
  1574. case "object":
  1575. if (!s)
  1576. return "null";
  1577. if (gap += indent,
  1578. a = [],
  1579. "[object Array]" === Object.prototype.toString.apply(s)) {
  1580. for (o = s.length,
  1581. n = 0; o > n; n += 1)
  1582. a[n] = str(n, s) || "null";
  1583. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1584. gap = c,
  1585. i
  1586. }
  1587. if (rep && "object" == typeof rep)
  1588. for (o = rep.length,
  1589. n = 0; o > n; n += 1)
  1590. "string" == typeof rep[n] && (r = rep[n],
  1591. i = str(r, s),
  1592. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1593. else
  1594. for (r in s)
  1595. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1596. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1597. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1598. gap = c,
  1599. i
  1600. }
  1601. }
  1602. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1603. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1604. }
  1605. ,
  1606. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1607. return this.valueOf()
  1608. }
  1609. );
  1610. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1611. "\b": "\\b",
  1612. "\t": "\\t",
  1613. "\n": "\\n",
  1614. "\f": "\\f",
  1615. "\r": "\\r",
  1616. '"': '\\"',
  1617. "\\": "\\\\"
  1618. }, rep;
  1619. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1620. var r;
  1621. if (gap = "",
  1622. indent = "",
  1623. "number" == typeof n)
  1624. for (r = 0; n > r; r += 1)
  1625. indent += " ";
  1626. else
  1627. "string" == typeof n && (indent = n);
  1628. if (rep = t,
  1629. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1630. throw new Error("JSON.stringify");
  1631. return str("", {
  1632. "": e
  1633. })
  1634. }
  1635. ),
  1636. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1637. function walk(e, t) {
  1638. var n, r, i = e[t];
  1639. if (i && "object" == typeof i)
  1640. for (n in i)
  1641. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1642. void 0 !== r ? i[n] = r : delete i[n]);
  1643. return reviver.call(e, t, i)
  1644. }
  1645. var j;
  1646. if (text = String(text),
  1647. cx.lastIndex = 0,
  1648. cx.test(text) && (text = text.replace(cx, function(e) {
  1649. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1650. })),
  1651. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1652. return j = eval("(" + text + ")"),
  1653. "function" == typeof reviver ? walk({
  1654. "": j
  1655. }, "") : j;
  1656. throw new SyntaxError("JSON.parse")
  1657. }
  1658. )
  1659. }(),
  1660. !function(e, t, n) {
  1661. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1662. }("domready", Keen.utils, function(e) {
  1663. function t(e) {
  1664. for (d = 1; e = r.shift(); )
  1665. e()
  1666. }
  1667. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1668. return o[l] && o[l](s, n = function() {
  1669. o.removeEventListener(s, n, i),
  1670. t()
  1671. }
  1672. , i),
  1673. c && o.attachEvent(u, n = function() {
  1674. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1675. t())
  1676. }
  1677. ),
  1678. e = c ? function(t) {
  1679. self != top ? d ? t() : r.push(t) : function() {
  1680. try {
  1681. a.doScroll("left")
  1682. } catch (n) {
  1683. return setTimeout(function() {
  1684. e(t)
  1685. }, 50)
  1686. }
  1687. t()
  1688. }()
  1689. }
  1690. : function(e) {
  1691. d ? e() : r.push(e)
  1692. }
  1693. });
  1694. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1695. if (loaded && cached) {
  1696. clients = cached.clients || {},
  1697. ready = cached.ready || [];
  1698. for (var instance in clients)
  1699. if (clients.hasOwnProperty(instance)) {
  1700. var client = clients[instance];
  1701. for (var method in Keen.prototype)
  1702. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1703. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1704. ,
  1705. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1706. ,
  1707. client._config && (client.configure.call(client, client._config),
  1708. delete client._config),
  1709. client._setGlobalProperties) {
  1710. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1711. client.setGlobalProperties.apply(client, globals[i]);
  1712. delete client._setGlobalProperties
  1713. }
  1714. if (client._addEvent) {
  1715. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1716. client.addEvent.apply(client, queue[i]);
  1717. delete client._addEvent
  1718. }
  1719. var callback = client._on || [];
  1720. if (client._on) {
  1721. for (var i = 0; i < callback.length; i++)
  1722. client.on.apply(client, callback[i]);
  1723. client.trigger("ready"),
  1724. delete client._on
  1725. }
  1726. }
  1727. for (var i = 0; i < ready.length; i++) {
  1728. var callback = ready[i];
  1729. Keen.on("ready", function() {
  1730. callback()
  1731. })
  1732. }
  1733. }
  1734. return Keen.loaded && setTimeout(function() {
  1735. Keen.utils.domready(function() {
  1736. Keen.trigger("ready")
  1737. })
  1738. }, 0),
  1739. Keen
  1740. });
  1741. !function() {
  1742. var t = window.analytics = window.analytics || [];
  1743. if (!t.initialize) {
  1744. if (t.invoked)
  1745. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1746. t.invoked = !0,
  1747. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1748. t.factory = function(e) {
  1749. return function() {
  1750. var n = Array.prototype.slice.call(arguments);
  1751. return n.unshift(e),
  1752. t.push(n),
  1753. t
  1754. }
  1755. }
  1756. ;
  1757. for (var e = 0; e < t.methods.length; e++) {
  1758. var n = t.methods[e];
  1759. t[n] = t.factory(n)
  1760. }
  1761. t.load = function(t) {
  1762. var e = document.createElement("script");
  1763. e.type = "text/javascript",
  1764. e.async = !0,
  1765. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1766. var n = document.getElementsByTagName("script")[0];
  1767. n.parentNode.insertBefore(e, n)
  1768. }
  1769. ,
  1770. t.SNIPPET_VERSION = "4.0.0"
  1771. }
  1772. }();
  1773. !function(i, e) {
  1774. "use strict";
  1775. var s = ""
  1776. , r = "?"
  1777. , o = "function"
  1778. , a = "undefined"
  1779. , n = "object"
  1780. , t = "major"
  1781. , d = "model"
  1782. , w = "name"
  1783. , l = "type"
  1784. , p = "vendor"
  1785. , m = "version"
  1786. , c = "architecture"
  1787. , u = "console"
  1788. , g = "mobile"
  1789. , f = "tablet"
  1790. , h = "smarttv"
  1791. , b = {
  1792. has: function(i, e) {
  1793. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1794. },
  1795. lowerize: function(i) {
  1796. return i.toLowerCase()
  1797. }
  1798. }
  1799. , y = {
  1800. rgx: function() {
  1801. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1802. var c = m[p]
  1803. , u = m[p + 1];
  1804. if (typeof i === a) {
  1805. i = {};
  1806. for (t in u)
  1807. d = u[t],
  1808. typeof d === n ? i[d[0]] = e : i[d] = e
  1809. }
  1810. for (s = r = 0; s < c.length; s++)
  1811. if (w = c[s].exec(this.getUA())) {
  1812. for (t = 0; t < u.length; t++)
  1813. l = w[++r],
  1814. d = u[t],
  1815. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1816. break
  1817. }
  1818. if (w)
  1819. break
  1820. }
  1821. return i
  1822. },
  1823. str: function(i, s) {
  1824. for (var o in s)
  1825. if (typeof s[o] === n && s[o].length > 0) {
  1826. for (var a = 0; a < s[o].length; a++)
  1827. if (b.has(s[o][a], i))
  1828. return o === r ? e : o
  1829. } else if (b.has(s[o], i))
  1830. return o === r ? e : o;
  1831. return i
  1832. }
  1833. }
  1834. , v = {
  1835. browser: {
  1836. oldsafari: {
  1837. major: {
  1838. 1: ["/8", "/1", "/3"],
  1839. 2: "/4",
  1840. "?": "/"
  1841. },
  1842. version: {
  1843. "1.0": "/8",
  1844. 1.2: "/1",
  1845. 1.3: "/3",
  1846. "2.0": "/412",
  1847. "2.0.2": "/416",
  1848. "2.0.3": "/417",
  1849. "2.0.4": "/419",
  1850. "?": "/"
  1851. }
  1852. }
  1853. },
  1854. device: {
  1855. sprint: {
  1856. model: {
  1857. "Evo Shift 4G": "7373KT"
  1858. },
  1859. vendor: {
  1860. HTC: "APA",
  1861. Sprint: "Sprint"
  1862. }
  1863. }
  1864. },
  1865. os: {
  1866. windows: {
  1867. version: {
  1868. ME: "4.90",
  1869. "NT 3.11": "NT3.51",
  1870. "NT 4.0": "NT4.0",
  1871. 2e3: "NT 5.0",
  1872. XP: ["NT 5.1", "NT 5.2"],
  1873. Vista: "NT 6.0",
  1874. 7: "NT 6.1",
  1875. 8: "NT 6.2",
  1876. 8.1: "NT 6.3",
  1877. RT: "ARM"
  1878. }
  1879. }
  1880. }
  1881. }
  1882. , k = {
  1883. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1884. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1885. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1886. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1887. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1888. }
  1889. , x = function(e) {
  1890. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1891. return this instanceof x ? (this.getBrowser = function() {
  1892. return y.rgx.apply(this, k.browser)
  1893. }
  1894. ,
  1895. this.getCPU = function() {
  1896. return y.rgx.apply(this, k.cpu)
  1897. }
  1898. ,
  1899. this.getDevice = function() {
  1900. return y.rgx.apply(this, k.device)
  1901. }
  1902. ,
  1903. this.getEngine = function() {
  1904. return y.rgx.apply(this, k.engine)
  1905. }
  1906. ,
  1907. this.getOS = function() {
  1908. return y.rgx.apply(this, k.os)
  1909. }
  1910. ,
  1911. this.getResult = function() {
  1912. return {
  1913. ua: this.getUA(),
  1914. browser: this.getBrowser(),
  1915. engine: this.getEngine(),
  1916. os: this.getOS(),
  1917. device: this.getDevice(),
  1918. cpu: this.getCPU()
  1919. }
  1920. }
  1921. ,
  1922. this.getUA = function() {
  1923. return r
  1924. }
  1925. ,
  1926. this.setUA = function(i) {
  1927. return r = i,
  1928. this
  1929. }
  1930. ,
  1931. void this.setUA(r)) : new x(e).getResult()
  1932. };
  1933. if (typeof exports !== a)
  1934. typeof module !== a && module.exports && (exports = module.exports = x),
  1935. exports.UAParser = x;
  1936. else if (i.UAParser = x,
  1937. typeof define === o && define.amd && define(function() {
  1938. return x
  1939. }),
  1940. typeof i.jQuery !== a) {
  1941. var A = i.jQuery
  1942. , _ = new x;
  1943. A.ua = _.getResult(),
  1944. A.ua.get = function() {
  1945. return _.getUA()
  1946. }
  1947. ,
  1948. A.ua.set = function(i) {
  1949. _.setUA(i);
  1950. var e = _.getResult();
  1951. for (var s in e)
  1952. A.ua[s] = e[s]
  1953. }
  1954. }
  1955. }(this);
  1956. window.Modernizr = function(n, e, t) {
  1957. function o(n) {
  1958. d.cssText = n
  1959. }
  1960. function r(n, e) {
  1961. return typeof n === e
  1962. }
  1963. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1964. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1965. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1966. return e in n && r(n.constructor.prototype[e], "undefined")
  1967. }
  1968. : function(n, e) {
  1969. return v.call(n, e)
  1970. }
  1971. ,
  1972. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1973. var e = this;
  1974. if ("function" != typeof e)
  1975. throw new TypeError;
  1976. var t = b.call(arguments, 1)
  1977. , o = function() {
  1978. if (this instanceof o) {
  1979. var r = function() {};
  1980. r.prototype = e.prototype;
  1981. var i = new r
  1982. , c = e.apply(i, t.concat(b.call(arguments)));
  1983. return Object(c) === c ? c : i
  1984. }
  1985. return e.apply(n, t.concat(b.call(arguments)))
  1986. };
  1987. return o
  1988. }
  1989. ),
  1990. y.webgl = function() {
  1991. return !!n.WebGLRenderingContext
  1992. }
  1993. ;
  1994. for (var h in y)
  1995. u(y, h) && (c = h.toLowerCase(),
  1996. f[c] = y[h](),
  1997. w.push((f[c] ? "" : "no-") + c));
  1998. return f.addTest = function(n, e) {
  1999. if ("object" == typeof n)
  2000. for (var o in n)
  2001. u(n, o) && f.addTest(o, n[o]);
  2002. else {
  2003. if (n = n.toLowerCase(),
  2004. f[n] !== t)
  2005. return f;
  2006. e = "function" == typeof e ? e() : e,
  2007. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  2008. f[n] = e
  2009. }
  2010. return f
  2011. }
  2012. ,
  2013. o(""),
  2014. p = i = null,
  2015. f._version = a,
  2016. f
  2017. }(this, this.document);
  2018. !function(e, t, a) {
  2019. "use strict";
  2020. function n(t, h, m) {
  2021. function H(a) {
  2022. var n = 0
  2023. , i = Ee.length;
  2024. if (Ce.old = e.extend({}, Ce),
  2025. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  2026. ke = Be[ge.horizontal ? "width" : "height"](),
  2027. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  2028. Ee.length = 0,
  2029. Ce.start = 0,
  2030. Ce.end = q(ze - Ie, 0),
  2031. Re) {
  2032. n = Ne.length,
  2033. qe = Pe.children(ge.itemSelector),
  2034. Ne.length = 0;
  2035. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  2036. ze = 0,
  2037. qe.each(function(t, a) {
  2038. var n = e(a)
  2039. , i = a.getBoundingClientRect()
  2040. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  2041. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  2042. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  2043. , h = l + d + p
  2044. , m = !d || !p
  2045. , g = {};
  2046. g.el = a,
  2047. g.size = m ? l : h,
  2048. g.half = g.size / 2,
  2049. g.start = ze + (m ? d : 0),
  2050. g.center = g.start - E(Ie / 2 - g.size / 2),
  2051. g.end = g.start - Ie + g.size,
  2052. t || (ze += s),
  2053. ze += h,
  2054. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  2055. t === v && (g.end += o,
  2056. ze += o,
  2057. f = m ? p : 0),
  2058. Ne.push(g),
  2059. r = g
  2060. }),
  2061. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  2062. ze -= f,
  2063. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  2064. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  2065. }
  2066. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  2067. Q(),
  2068. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  2069. Te = d(Te, ge.minHandleSize, ke),
  2070. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  2071. xe.end = ke - Te,
  2072. it || j()),
  2073. !we && Ie > 0) {
  2074. var p = Ce.start
  2075. , h = "";
  2076. if (Re)
  2077. e.each(Ne, function(e, t) {
  2078. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  2079. Ee.push(p),
  2080. p += Ie,
  2081. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  2082. });
  2083. else
  2084. for (; p - Ie < Ce.end; )
  2085. Ee.push(p),
  2086. p += Ie;
  2087. if (De[0] && i !== Ee.length) {
  2088. for (var m = 0; m < Ee.length; m++)
  2089. h += ge.pageBuilder.call(ye, m);
  2090. Ae = De.html(h).children(),
  2091. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  2092. }
  2093. }
  2094. if (Oe.slideeSize = ze,
  2095. Oe.frameSize = Ie,
  2096. Oe.sbSize = ke,
  2097. Oe.handleSize = Te,
  2098. Re) {
  2099. a && null != ge.startAt && (W(ge.startAt),
  2100. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  2101. var g = Ne[Oe.activeItem];
  2102. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  2103. } else
  2104. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  2105. pe("load")
  2106. }
  2107. function X(e, t, a) {
  2108. if (Re && at.released && !a) {
  2109. var n = $(e)
  2110. , i = e > Ce.start && e < Ce.end;
  2111. Le ? (i && (e = Ne[n.centerItem].center),
  2112. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  2113. }
  2114. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  2115. et.start = +new Date,
  2116. et.time = 0,
  2117. et.from = Ce.cur,
  2118. et.to = e,
  2119. et.delta = e - Ce.cur,
  2120. et.tweesing = at.tweese || at.init && !at.slidee,
  2121. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  2122. at.tweese = 0,
  2123. e !== Ce.dest && (Ce.dest = e,
  2124. pe("change"),
  2125. it || Y()),
  2126. K(),
  2127. Q(),
  2128. Z(),
  2129. F()
  2130. }
  2131. function Y() {
  2132. if (ye.initialized) {
  2133. if (!it)
  2134. return it = w(Y),
  2135. void (at.released && pe("moveStart"));
  2136. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  2137. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  2138. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  2139. et.to === Ce.cur ? (Ce.cur = et.to,
  2140. at.tweese = it = 0) : it = w(Y),
  2141. pe("move"),
  2142. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  2143. !it && at.released && pe("moveEnd"),
  2144. j()
  2145. }
  2146. }
  2147. function j() {
  2148. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  2149. xe.cur = d(E(xe.cur), xe.start, xe.end),
  2150. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  2151. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  2152. }
  2153. function F() {
  2154. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  2155. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2156. pe("activePage", _e.page))
  2157. }
  2158. function M() {
  2159. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  2160. ot = at.init ? w(M) : 0,
  2161. tt.now = +new Date,
  2162. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  2163. X(at.init ? tt.pos : E(tt.pos)),
  2164. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  2165. tt.lastTime = tt.now
  2166. }
  2167. function L(e, t, n) {
  2168. if ("boolean" === i(t) && (n = t,
  2169. t = a),
  2170. t === a)
  2171. X(Ce[e], n);
  2172. else {
  2173. if (Le && "center" !== e)
  2174. return;
  2175. var r = ye.getPos(t);
  2176. r && X(r[e], n, !Le)
  2177. }
  2178. }
  2179. function R(e) {
  2180. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  2181. }
  2182. function U(e) {
  2183. return R(l(e) && 0 > e ? e + Ne.length : e)
  2184. }
  2185. function W(e, t) {
  2186. var a = R(e);
  2187. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2188. qe.eq(a).addClass(ge.activeClass),
  2189. _e.active = Oe.activeItem = a,
  2190. Z(),
  2191. pe("active", a)),
  2192. a)
  2193. }
  2194. function $(e) {
  2195. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2196. var t = {}
  2197. , a = Me ? 0 : Ie / 2;
  2198. if (!we)
  2199. for (var n = 0, i = Ee.length; i > n; n++) {
  2200. if (e >= Ce.end || n === Ee.length - 1) {
  2201. t.activePage = Ee.length - 1;
  2202. break
  2203. }
  2204. if (e <= Ee[n] + a) {
  2205. t.activePage = n;
  2206. break
  2207. }
  2208. }
  2209. if (Re) {
  2210. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2211. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2212. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2213. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  2214. s = c;
  2215. break
  2216. }
  2217. t.firstItem = l(r) ? r : 0,
  2218. t.centerItem = l(o) ? o : t.firstItem,
  2219. t.lastItem = l(s) ? s : t.centerItem
  2220. }
  2221. return t
  2222. }
  2223. function Q(t) {
  2224. e.extend(Oe, $(t))
  2225. }
  2226. function Z() {
  2227. var e = Ce.dest <= Ce.start
  2228. , t = Ce.dest >= Ce.end
  2229. , a = (e ? 1 : 0) | (t ? 2 : 0);
  2230. if (_e.slideePosState !== a && (_e.slideePosState = a,
  2231. Je.is("button,input") && Je.prop("disabled", e),
  2232. Ke.is("button,input") && Ke.prop("disabled", t),
  2233. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  2234. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  2235. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  2236. Qe.is("button,input") && Qe.prop("disabled", e),
  2237. $e.is("button,input") && $e.prop("disabled", t)),
  2238. Re && null != Oe.activeItem) {
  2239. var n = 0 === Oe.activeItem
  2240. , i = Oe.activeItem >= Ne.length - 1
  2241. , r = (n ? 1 : 0) | (i ? 2 : 0);
  2242. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  2243. Ze.is("button,input") && Ze.prop("disabled", n),
  2244. Ge.is("button,input") && Ge.prop("disabled", i),
  2245. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  2246. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  2247. }
  2248. }
  2249. function G(e, t, a) {
  2250. if (e = U(e),
  2251. t = U(t),
  2252. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  2253. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  2254. var n = t > e ? e : a ? t : t - 1
  2255. , i = e > t ? e : a ? t + 1 : t
  2256. , r = e > t;
  2257. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2258. H()
  2259. }
  2260. }
  2261. function J(e, t) {
  2262. for (var a = 0, n = Ve[e].length; n > a; a++)
  2263. if (Ve[e][a] === t)
  2264. return a;
  2265. return -1
  2266. }
  2267. function K() {
  2268. at.released && !ye.isPaused && ye.resume()
  2269. }
  2270. function V(e) {
  2271. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  2272. }
  2273. function _() {
  2274. at.history[0] = at.history[1],
  2275. at.history[1] = at.history[2],
  2276. at.history[2] = at.history[3],
  2277. at.history[3] = at.delta
  2278. }
  2279. function ee(e) {
  2280. at.released = 0,
  2281. at.source = e,
  2282. at.slidee = "slidee" === e
  2283. }
  2284. function te(t) {
  2285. var a = "touchstart" === t.type
  2286. , n = t.data.source
  2287. , i = "slidee" === n;
  2288. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  2289. ee(n),
  2290. at.init = 0,
  2291. at.$source = e(t.target),
  2292. at.touch = a,
  2293. at.pointer = a ? t.originalEvent.touches[0] : t,
  2294. at.initX = at.pointer.pageX,
  2295. at.initY = at.pointer.pageY,
  2296. at.initPos = i ? Ce.cur : xe.cur,
  2297. at.start = +new Date,
  2298. at.time = 0,
  2299. at.path = 0,
  2300. at.delta = 0,
  2301. at.locked = 0,
  2302. at.history = [0, 0, 0, 0],
  2303. at.pathToLock = i ? a ? 30 : 10 : 0,
  2304. b.on(a ? z : I, ae),
  2305. ye.pause(1),
  2306. (i ? Pe : Se).addClass(ge.draggedClass),
  2307. pe("moveStart"),
  2308. i && (rt = setInterval(_, 10)))
  2309. }
  2310. function ae(e) {
  2311. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  2312. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  2313. at.pathX = at.pointer.pageX - at.initX,
  2314. at.pathY = at.pointer.pageY - at.initY,
  2315. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  2316. at.delta = ge.horizontal ? at.pathX : at.pathY,
  2317. at.released || !(at.path < 1)) {
  2318. if (!at.init) {
  2319. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  2320. return ne();
  2321. at.init = 1
  2322. }
  2323. r(e),
  2324. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  2325. at.$source.on(B, s)),
  2326. at.released && (ne(),
  2327. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  2328. at.delta += at.swing,
  2329. at.tweese = x(at.swing) > 10)),
  2330. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2331. }
  2332. }
  2333. function ne() {
  2334. clearInterval(rt),
  2335. at.released = !0,
  2336. b.off(at.touch ? z : I, ae),
  2337. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2338. setTimeout(function() {
  2339. at.$source.off(B, s)
  2340. }),
  2341. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  2342. ye.resume(1),
  2343. at.init = 0
  2344. }
  2345. function ie(t) {
  2346. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2347. }
  2348. function re() {
  2349. ye.stop(),
  2350. b.off("mouseup", re)
  2351. }
  2352. function se(e) {
  2353. switch (r(e),
  2354. this) {
  2355. case $e[0]:
  2356. case Qe[0]:
  2357. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  2358. b.on("mouseup", re);
  2359. break;
  2360. case Ze[0]:
  2361. ye.prev();
  2362. break;
  2363. case Ge[0]:
  2364. ye.next();
  2365. break;
  2366. case Je[0]:
  2367. ye.prevPage();
  2368. break;
  2369. case Ke[0]:
  2370. ye.nextPage()
  2371. }
  2372. }
  2373. function oe(e) {
  2374. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2375. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2376. Re ? (p = +new Date,
  2377. nt.last < p - nt.resetTime && (nt.delta = 0),
  2378. nt.last = p,
  2379. nt.delta += nt.curDelta,
  2380. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  2381. nt.delta %= 1),
  2382. nt.finalDelta) : nt.curDelta
  2383. }
  2384. function le(e) {
  2385. e.originalEvent[g] = ye;
  2386. var t = +new Date;
  2387. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2388. return void (O = t);
  2389. if (ge.scrollBy && Ce.start !== Ce.end) {
  2390. var a = oe(e.originalEvent);
  2391. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  2392. ye.slideBy(ge.scrollBy * a)
  2393. }
  2394. }
  2395. function ce(e) {
  2396. ge.clickBar && e.target === Be[0] && (r(e),
  2397. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2398. }
  2399. function de(e) {
  2400. if (ge.keyboardNavBy)
  2401. switch (e.which) {
  2402. case ge.horizontal ? 37 : 38:
  2403. r(e),
  2404. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2405. break;
  2406. case ge.horizontal ? 39 : 40:
  2407. r(e),
  2408. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  2409. }
  2410. }
  2411. function ue(e) {
  2412. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  2413. }
  2414. function fe() {
  2415. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2416. }
  2417. function ve(e) {
  2418. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  2419. }
  2420. function pe(e, t) {
  2421. if (Ve[e]) {
  2422. for (me = Ve[e].length,
  2423. T.length = 0,
  2424. he = 0; me > he; he++)
  2425. T.push(Ve[e][he]);
  2426. for (he = 0; me > he; he++)
  2427. T[he].call(ye, e, t)
  2428. }
  2429. }
  2430. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  2431. start: 0,
  2432. center: 0,
  2433. end: 0,
  2434. cur: 0,
  2435. dest: 0
  2436. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2437. start: 0,
  2438. end: 0,
  2439. cur: 0
  2440. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2441. firstItem: 0,
  2442. lastItem: 0,
  2443. centerItem: 0,
  2444. activeItem: null,
  2445. activePage: 0
  2446. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2447. released: 1
  2448. }, nt = {
  2449. last: 0,
  2450. delta: 0,
  2451. resetTime: 200
  2452. }, it = 0, rt = 0, st = 0, ot = 0;
  2453. we || (t = be[0]),
  2454. ye.initialized = 0,
  2455. ye.frame = t,
  2456. ye.slidee = Pe[0],
  2457. ye.pos = Ce,
  2458. ye.rel = Oe,
  2459. ye.items = Ne,
  2460. ye.pages = Ee,
  2461. ye.isPaused = 0,
  2462. ye.options = ge,
  2463. ye.dragging = at,
  2464. ye.reload = function() {
  2465. H()
  2466. }
  2467. ,
  2468. ye.getPos = function(e) {
  2469. if (Re) {
  2470. var t = R(e);
  2471. return -1 !== t && Ne[t]
  2472. }
  2473. var a = Pe.find(e).eq(0);
  2474. if (a[0]) {
  2475. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2476. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2477. return {
  2478. start: n,
  2479. center: n - Ie / 2 + i / 2,
  2480. end: n - Ie + i,
  2481. size: i
  2482. }
  2483. }
  2484. return !1
  2485. }
  2486. ,
  2487. ye.moveBy = function(e) {
  2488. tt.speed = e,
  2489. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2490. tt.startPos = Ce.cur,
  2491. ee("button"),
  2492. at.init = 1,
  2493. pe("moveStart"),
  2494. y(ot),
  2495. M())
  2496. }
  2497. ,
  2498. ye.stop = function() {
  2499. "button" === at.source && (at.init = 0,
  2500. at.released = 1)
  2501. }
  2502. ,
  2503. ye.prev = function() {
  2504. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2505. }
  2506. ,
  2507. ye.next = function() {
  2508. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2509. }
  2510. ,
  2511. ye.prevPage = function() {
  2512. ye.activatePage(Oe.activePage - 1)
  2513. }
  2514. ,
  2515. ye.nextPage = function() {
  2516. ye.activatePage(Oe.activePage + 1)
  2517. }
  2518. ,
  2519. ye.slideBy = function(e, t) {
  2520. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2521. }
  2522. ,
  2523. ye.slideTo = function(e, t) {
  2524. X(e, t)
  2525. }
  2526. ,
  2527. ye.toStart = function(e, t) {
  2528. L("start", e, t)
  2529. }
  2530. ,
  2531. ye.toEnd = function(e, t) {
  2532. L("end", e, t)
  2533. }
  2534. ,
  2535. ye.toCenter = function(e, t) {
  2536. L("center", e, t)
  2537. }
  2538. ,
  2539. ye.getIndex = R,
  2540. ye.activate = function(e, t) {
  2541. var a = W(e);
  2542. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2543. }
  2544. ,
  2545. ye.activatePage = function(e, t) {
  2546. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2547. }
  2548. ,
  2549. ye.resume = function(e) {
  2550. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2551. st ? st = clearTimeout(st) : pe("resume"),
  2552. st = setTimeout(function() {
  2553. switch (pe("cycle"),
  2554. ge.cycleBy) {
  2555. case "items":
  2556. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2557. break;
  2558. case "pages":
  2559. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2560. }
  2561. }, ge.cycleInterval))
  2562. }
  2563. ,
  2564. ye.pause = function(e) {
  2565. e < ye.isPaused || (ye.isPaused = e || 100,
  2566. st && (st = clearTimeout(st),
  2567. pe("pause")))
  2568. }
  2569. ,
  2570. ye.toggle = function() {
  2571. ye[st ? "pause" : "resume"]()
  2572. }
  2573. ,
  2574. ye.set = function(t, a) {
  2575. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2576. }
  2577. ,
  2578. ye.add = function(t, a) {
  2579. var n = e(t);
  2580. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2581. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2582. H()
  2583. }
  2584. ,
  2585. ye.remove = function(t) {
  2586. if (Re) {
  2587. var a = U(t);
  2588. if (a > -1) {
  2589. qe.eq(a).remove();
  2590. var n = a === Oe.activeItem;
  2591. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2592. H(),
  2593. n && (_e.active = null,
  2594. ye.activate(Oe.activeItem))
  2595. }
  2596. } else
  2597. e(t).remove(),
  2598. H()
  2599. }
  2600. ,
  2601. ye.moveAfter = function(e, t) {
  2602. G(e, t, 1)
  2603. }
  2604. ,
  2605. ye.moveBefore = function(e, t) {
  2606. G(e, t)
  2607. }
  2608. ,
  2609. ye.on = function(e, t) {
  2610. if ("object" === i(e))
  2611. for (var a in e)
  2612. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2613. else if ("function" === i(t))
  2614. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2615. Ve[n[r]] = Ve[n[r]] || [],
  2616. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2617. else if ("array" === i(t))
  2618. for (var o = 0, l = t.length; l > o; o++)
  2619. ye.on(e, t[o])
  2620. }
  2621. ,
  2622. ye.one = function(e, t) {
  2623. function a() {
  2624. t.apply(ye, arguments),
  2625. ye.off(e, a)
  2626. }
  2627. ye.on(e, a)
  2628. }
  2629. ,
  2630. ye.off = function(e, t) {
  2631. if (t instanceof Array)
  2632. for (var a = 0, n = t.length; n > a; a++)
  2633. ye.off(e, t[a]);
  2634. else
  2635. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2636. if (Ve[i[r]] = Ve[i[r]] || [],
  2637. null == t)
  2638. Ve[i[r]].length = 0;
  2639. else {
  2640. var o = J(i[r], t);
  2641. -1 !== o && Ve[i[r]].splice(o, 1)
  2642. }
  2643. }
  2644. ,
  2645. ye.destroy = function() {
  2646. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2647. b.off("keydown", de),
  2648. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2649. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2650. De.empty(),
  2651. we || (be.off("." + g),
  2652. He.restore(),
  2653. Xe.restore(),
  2654. Ye.restore(),
  2655. je.restore(),
  2656. e.removeData(t, g)),
  2657. Ne.length = Ee.length = 0,
  2658. _e = {},
  2659. ye.initialized = 0,
  2660. ye
  2661. }
  2662. ,
  2663. ye.init = function() {
  2664. if (!ye.initialized) {
  2665. ye.on(m);
  2666. var e = ["overflow", "position"]
  2667. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2668. He.save.apply(He, e),
  2669. Ye.save.apply(Ye, e),
  2670. Xe.save.apply(Xe, t),
  2671. je.save.apply(je, t);
  2672. var a = Se;
  2673. return we || (a = a.add(Pe),
  2674. be.css("overflow", "hidden"),
  2675. f || "static" !== be.css("position") || be.css("position", "relative")),
  2676. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2677. a.css({
  2678. position: "absolute"
  2679. })),
  2680. ge.forward && $e.on(S, se),
  2681. ge.backward && Qe.on(S, se),
  2682. ge.prev && Ze.on(B, se),
  2683. ge.next && Ge.on(B, se),
  2684. ge.prevPage && Je.on(B, se),
  2685. ge.nextPage && Ke.on(B, se),
  2686. Ue.on(C, le),
  2687. Be[0] && Be.on(B, ce),
  2688. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2689. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2690. We.on(P, {
  2691. source: "slidee"
  2692. }, te),
  2693. Se && Se.on(P, {
  2694. source: "handle"
  2695. }, te),
  2696. b.on("keydown", de),
  2697. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2698. be.on("scroll." + g, o)),
  2699. ye.initialized = 1,
  2700. H(!0),
  2701. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2702. ye
  2703. }
  2704. }
  2705. }
  2706. function i(e) {
  2707. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2708. }
  2709. function r(e, t) {
  2710. e.preventDefault(),
  2711. t && e.stopPropagation()
  2712. }
  2713. function s(t) {
  2714. r(t, 1),
  2715. e(this).off(t.type, s)
  2716. }
  2717. function o() {
  2718. this.scrollLeft = 0,
  2719. this.scrollTop = 0
  2720. }
  2721. function l(e) {
  2722. return !isNaN(parseFloat(e)) && isFinite(e)
  2723. }
  2724. function c(e, t) {
  2725. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2726. }
  2727. function d(e, t, a) {
  2728. return t > e ? t : e > a ? a : e
  2729. }
  2730. function u(e) {
  2731. var t = {};
  2732. return t.style = {},
  2733. t.save = function() {
  2734. if (e && e.nodeType) {
  2735. for (var a = 0; a < arguments.length; a++)
  2736. t.style[arguments[a]] = e.style[arguments[a]];
  2737. return t
  2738. }
  2739. }
  2740. ,
  2741. t.restore = function() {
  2742. if (e && e.nodeType) {
  2743. for (var a in t.style)
  2744. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2745. return t
  2746. }
  2747. }
  2748. ,
  2749. t
  2750. }
  2751. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2752. b.on(C, function(e) {
  2753. var t = e.originalEvent[g]
  2754. , a = +new Date;
  2755. (!t || t.options.scrollHijack < a - O) && (O = a)
  2756. }),
  2757. function(e) {
  2758. function t(e) {
  2759. var t = (new Date).getTime()
  2760. , n = Math.max(0, 16 - (t - a))
  2761. , i = setTimeout(e, n);
  2762. return a = t,
  2763. i
  2764. }
  2765. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2766. var a = (new Date).getTime()
  2767. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2768. y = function(t) {
  2769. n.call(e, t)
  2770. }
  2771. }(window),
  2772. function() {
  2773. function e(e) {
  2774. for (var n = 0, i = t.length; i > n; n++) {
  2775. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2776. if (null != a.style[r])
  2777. return r
  2778. }
  2779. }
  2780. var t = ["", "webkit", "moz", "ms", "o"]
  2781. , a = document.createElement("div");
  2782. f = e("transform"),
  2783. v = e("perspective") ? "translateZ(0) " : ""
  2784. }(),
  2785. t[m] = n,
  2786. e.fn[h] = function(t, a) {
  2787. var r, s;
  2788. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2789. s = Array.prototype.slice.call(arguments, 1)),
  2790. t = {}),
  2791. this.each(function(i, o) {
  2792. var l = e.data(o, g);
  2793. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2794. })
  2795. }
  2796. ,
  2797. n.defaults = {
  2798. slidee: null,
  2799. horizontal: !1,
  2800. itemNav: null,
  2801. itemSelector: null,
  2802. smart: !1,
  2803. activateOn: null,
  2804. activateMiddle: !1,
  2805. scrollSource: null,
  2806. scrollBy: 0,
  2807. scrollHijack: 300,
  2808. scrollTrap: !1,
  2809. dragSource: null,
  2810. mouseDragging: !1,
  2811. touchDragging: !1,
  2812. releaseSwing: !1,
  2813. swingSpeed: .2,
  2814. elasticBounds: !1,
  2815. interactive: null,
  2816. scrollBar: null,
  2817. dragHandle: !1,
  2818. dynamicHandle: !1,
  2819. minHandleSize: 50,
  2820. clickBar: !1,
  2821. syncSpeed: .5,
  2822. pagesBar: null,
  2823. activatePageOn: null,
  2824. pageBuilder: function(e) {
  2825. return "<li>" + (e + 1) + "</li>"
  2826. },
  2827. forward: null,
  2828. backward: null,
  2829. prev: null,
  2830. next: null,
  2831. prevPage: null,
  2832. nextPage: null,
  2833. cycleBy: null,
  2834. cycleInterval: 5e3,
  2835. pauseOnHover: !1,
  2836. startPaused: !1,
  2837. moveBy: 300,
  2838. speed: 0,
  2839. easing: "swing",
  2840. startAt: null,
  2841. keyboardNavBy: null,
  2842. draggedClass: "dragged",
  2843. activeClass: "active",
  2844. disabledClass: "disabled"
  2845. }
  2846. }(jQuery, window);
  2847. !function e(t, i, n) {
  2848. function r(a, s) {
  2849. if (!i[a]) {
  2850. if (!t[a]) {
  2851. var l = "function" == typeof require && require;
  2852. if (!s && l)
  2853. return l(a, !0);
  2854. if (o)
  2855. return o(a, !0);
  2856. var c = new Error("Cannot find module '" + a + "'");
  2857. throw c.code = "MODULE_NOT_FOUND",
  2858. c
  2859. }
  2860. var h = i[a] = {
  2861. exports: {}
  2862. };
  2863. t[a][0].call(h.exports, function(e) {
  2864. var i = t[a][1][e];
  2865. return r(i ? i : e)
  2866. }, h, h.exports, e, t, i, n)
  2867. }
  2868. return i[a].exports
  2869. }
  2870. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2871. r(n[a]);
  2872. return r
  2873. }({
  2874. 1: [function(e, t, i) {
  2875. (function(i) {
  2876. "use strict";
  2877. function n(e) {
  2878. this.player = null,
  2879. this.director = null,
  2880. this.modelManager = null,
  2881. this.container = null,
  2882. this.tagManager = null,
  2883. this.fadeInSpeed = e,
  2884. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2885. }
  2886. var r = e("three")
  2887. , o = e("./util/logger")
  2888. , a = (e("./util/common"),
  2889. e("./enum/PlayerEvents"))
  2890. , s = e("./enum/DirectorEvents")
  2891. , l = e("./settings")
  2892. , c = e("./enum/Viewmode")
  2893. , h = (e("./enum/WarpStyle"),
  2894. e("./enum/BlackoutStyle"),
  2895. e("./enum/ModelManagerEvents"))
  2896. , u = e("./enum/tagEvents")
  2897. , d = e("./util/transitions")
  2898. , p = e("./util/lerp")
  2899. , f = new o(i);
  2900. //window.THREE = r;
  2901. n.prototype.init = function(e, t, i, n, r) {
  2902. window.app = this;
  2903. this.player = t,
  2904. this.director = e,
  2905. this.modelManager = i,
  2906. this.tagManager = n,
  2907. this.container = r,
  2908. this.updateModel(),
  2909. this.bindEvents()
  2910. }
  2911. ,
  2912. n.prototype.bindEvents = function() {
  2913. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2914. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2915. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2916. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2917. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2918. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2919. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2920. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2921. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2922. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2923. }
  2924. ,
  2925. n.prototype.updateModel = function() {
  2926. //模型this.model
  2927. this.model = this.modelManager.getActiveModel()
  2928. }
  2929. ,
  2930. n.prototype.handleWarpStarted = function() {
  2931. this.hidePlayerReticule()
  2932. }
  2933. ,
  2934. n.prototype.ontagActivated = function() {
  2935. this.hidePlayerReticule()
  2936. }
  2937. ,
  2938. n.prototype.onNavigationTotag = function() {
  2939. this.hidePlayerReticule()
  2940. }
  2941. ,
  2942. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2943. var n = this.modelManager.getActiveModel()
  2944. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2945. n.fadePanoMarkers(r),
  2946. n.setMode(t)
  2947. }
  2948. ,
  2949. n.prototype.handlePlayerModeChanged = function(e, t) {
  2950. var i = this.modelManager.getActiveModel()
  2951. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2952. i.setSide(n),
  2953. i.setMode(t)
  2954. }
  2955. ,
  2956. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2957. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2958. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2959. }
  2960. ,
  2961. n.prototype.handleActionInterruption = function() {}
  2962. ,
  2963. n.prototype.handleStartInside = function(e) {
  2964. var t = l[this.player.mode]
  2965. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2966. this.fadeIn(this.fadeInSpeed),
  2967. this.model.alpha = 0,
  2968. this.model.skybox.material.uniforms.opacity.value = 1,
  2969. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2970. var n = this.player.reticule;
  2971. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2972. }
  2973. ,
  2974. n.prototype.handleStartOutside = function(e) {
  2975. this.fadeIn(e)
  2976. }
  2977. ,
  2978. n.prototype.fadeIn = function(e) {
  2979. null !== e && void 0 !== e || (e = 2e3,
  2980. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2981. $(this.container).fadeIn(e)
  2982. }
  2983. ,
  2984. n.prototype.hidePlayerReticule = function() {
  2985. this.player.reticule.hide()
  2986. }
  2987. ,
  2988. t.exports = n
  2989. }
  2990. ).call(this, "/js/DisplayController.js")
  2991. }
  2992. , {
  2993. "./enum/BlackoutStyle": 18,
  2994. "./enum/DirectorEvents": 23,
  2995. "./enum/tagEvents": 32,
  2996. "./enum/ModelManagerEvents": 33,
  2997. "./enum/PlayerEvents": 40,
  2998. "./enum/Viewmode": 51,
  2999. "./enum/WarpStyle": 52,
  3000. "./settings": 166,
  3001. "./util/common": 185,
  3002. "./util/lerp": 188,
  3003. "./util/logger": 189,
  3004. "./util/transitions": 195,
  3005. three: 217
  3006. }],
  3007. 2: [function(e, t, i) {
  3008. "use strict";
  3009. function n() {
  3010. this.baseStartTime = performance.timing.navigationStart,
  3011. this.loadingStartTime = null,
  3012. this.waitingStartTime = null,
  3013. this.appReadyTime = null
  3014. }
  3015. n.prototype.setBaseStartTime = function(e) {
  3016. this.baseStartTime = e || Date.now()
  3017. }
  3018. ,
  3019. n.prototype.setWaitingStartTime = function(e) {
  3020. this.waitingStartTime = e || Date.now()
  3021. }
  3022. ,
  3023. n.prototype.setLoadingStartTime = function(e) {
  3024. this.loadingStartTime = e || Date.now()
  3025. }
  3026. ,
  3027. n.prototype.setAppReadyTime = function(e) {
  3028. this.appReadyTime = e || Date.now()
  3029. }
  3030. ,
  3031. n.prototype.calcFullLoadingTime = function() {
  3032. var e = this.appReadyTime - this.baseStartTime;
  3033. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  3034. e
  3035. }
  3036. ,
  3037. t.exports = n
  3038. }
  3039. , {}],
  3040. 3: [function(e, t, i) {
  3041. (function(i) {
  3042. "use strict";
  3043. function n() {
  3044. return 100 * Math.random()
  3045. }
  3046. var r = e("./util/logger")
  3047. , o = e("./util/browser")
  3048. , a = new r(i)
  3049. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3050. initialized: !1,
  3051. init: function(e, t) {
  3052. if (t = t || {},
  3053. !this.initialized) {
  3054. this.initialized = !0,
  3055. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  3056. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  3057. for (var i in e) {
  3058. var r = i.match("^sc_tilegen_([0-9]+)$");
  3059. r && (s.tilegen = n() < parseInt(r[1]));
  3060. var l = i.match("^sc_imgopt_([0-9]+)$");
  3061. l && (s.imgopt = n() < parseInt(l[1]))
  3062. }
  3063. for (var c in t)
  3064. s[c] = t[c],
  3065. a.debug("A/B override:", c, s[c])
  3066. }
  3067. },
  3068. changeIfTileGenerating: function(e) {
  3069. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  3070. e += ""),
  3071. e
  3072. },
  3073. changeIfImageOptimzing: function(e) {
  3074. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  3075. e += ""),
  3076. e
  3077. },
  3078. tilegen: !1,
  3079. imgopt: !1
  3080. };
  3081. t.exports = s
  3082. }
  3083. ).call(this, "/js/ab.js")
  3084. }
  3085. , {
  3086. "./util/browser": 182,
  3087. "./util/logger": 189
  3088. }],
  3089. 4: [function(e, t, i) {
  3090. (function(i) {
  3091. "use strict";
  3092. function n() {
  3093. return {
  3094. addons: [{
  3095. name: "keen:ua_parser",
  3096. input: {
  3097. ua_string: "user_agent"
  3098. },
  3099. output: "parsed_user_agent"
  3100. }]
  3101. }
  3102. }
  3103. function r(e, t, i, n) {
  3104. function r(t) {
  3105. l[t.sid] = !0;
  3106. var i = t.billboard.media && t.billboard.media.type
  3107. , n = {
  3108. tag_id: t.sid,
  3109. tags_visited: Object.keys(l).length,
  3110. tag_count: Object.keys(e.tags).length,
  3111. tag_view_count: ++E,
  3112. has_media: !!i
  3113. };
  3114. i && (n.media_type = i),
  3115. u("tag_opened", n)
  3116. }
  3117. var l = {}
  3118. , h = Date.now() - N
  3119. , f = null;
  3120. n && (f = Date.now() - window.navigationStart);
  3121. var g;
  3122. try {
  3123. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  3124. } catch (e) {
  3125. g = !1
  3126. }
  3127. var v, A = e.supportsVR;
  3128. A || (v = "VR disabled at the model/account level",
  3129. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  3130. u("model_loaded", {
  3131. duration: h,
  3132. duration_from_navigation_start: f,
  3133. has_hlr: g,
  3134. has_vr: A,
  3135. vr_reason: v
  3136. });
  3137. var I = 0;
  3138. e.panos.forEach(function(e) {
  3139. e.on("enter", function() {
  3140. c("pano_viewed", {
  3141. pano_id: e.id,
  3142. pano_view_count: ++I,
  3143. alignment_type: e.alignmentType,
  3144. interaction_source: O,
  3145. navigation_source: p
  3146. })
  3147. })
  3148. });
  3149. var E = 0;
  3150. for (var T in e.tags)
  3151. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3152. t.on("tour_auto", function(e) {
  3153. p = "tour_" + e
  3154. }),
  3155. t.on("tour_manual", function(e) {
  3156. O = "gui-" + e,
  3157. p = "tour_manual"
  3158. }),
  3159. i.on(C.InteractionKey, function() {
  3160. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  3161. }),
  3162. i.on(C.InteractionDirect, function() {
  3163. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  3164. }),
  3165. o(t),
  3166. a(),
  3167. s()
  3168. }
  3169. function o(e) {
  3170. I.on(T.OPENED, function() {
  3171. c("showcase_share_intent", {
  3172. pano_id: e.currentPano && e.currentPano.id
  3173. })
  3174. }),
  3175. I.on(T.LINK_CLICKED, function(t) {
  3176. c("showcase_share_action", {
  3177. channel: t.channel,
  3178. pano_id: e.currentPano && e.currentPano.id
  3179. })
  3180. }),
  3181. E.on(x.ORIGIN_LINK_CLICKED, function() {
  3182. c("showcase_share_origin_link_clicked")
  3183. })
  3184. }
  3185. function a() {}
  3186. function s() {
  3187. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  3188. gui_action: "click_vr_button"
  3189. })),
  3190. b.on(S.LAUNCH, function(e) {
  3191. c("showcase_gui", {
  3192. gui_action: "launch_vr",
  3193. vr_platform: e.vr_platform,
  3194. vr_app: e.vr_app
  3195. })
  3196. }),
  3197. b.on(S.PREV, c.bind(this, "showcase_gui", {
  3198. gui_action: "vr_modal_prev"
  3199. })),
  3200. b.on(S.NEXT, function(e) {
  3201. c("showcase_gui", {
  3202. gui_action: e.nextAction
  3203. })
  3204. }),
  3205. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  3206. gui_action: "vr_modal_close"
  3207. })),
  3208. b.on(S.falseICECHOSEN, function(e) {
  3209. c("showcase_gui", {
  3210. gui_action: e.name + " "
  3211. })
  3212. }),
  3213. b.on(S.STORE, function(e) {
  3214. c("showcase_gui", {
  3215. gui_action: "launch_store",
  3216. store: e
  3217. })
  3218. })
  3219. }
  3220. function l(e, t) {
  3221. if (f)
  3222. try {
  3223. f.addEvent(e, v.extendObject({
  3224. host: window.location.host,
  3225. keen: n(),
  3226. user_agent: "${keen.user_agent}",
  3227. referrer: {
  3228. url: v.normalizeUrl(document.referrer),
  3229. domain: v.domainFromUrl(document.referrer),
  3230. url_original: document.referrer
  3231. },
  3232. embedded: m.inIframe(),
  3233. is_mobile: m.isMobile(),
  3234. version: "2.25.6-0-gd87e5b1"
  3235. }, t))
  3236. } catch (e) {
  3237. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  3238. }
  3239. }
  3240. function c(e, t) {
  3241. if (t = t || {},
  3242. L)
  3243. try {
  3244. window.analytics.track(e, v.extendObject(t, B), {
  3245. context: {
  3246. app: {
  3247. name: "showcase",
  3248. version: "2.25.6-0-gd87e5b1"
  3249. },
  3250. screen: {
  3251. width: window.screen.width,
  3252. height: window.screen.height,
  3253. density: window.devicePixelRatio
  3254. }
  3255. }
  3256. })
  3257. } catch (t) {
  3258. console.warn("Failed to send data to segment for " + e)
  3259. }
  3260. }
  3261. function h(e, t) {
  3262. if (t = t || {},
  3263. navigator.sendBeacon && L)
  3264. try {
  3265. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3266. event: e,
  3267. anonymousId: window.analytics.user().anonymousId(),
  3268. properties: v.extendObject(t, B),
  3269. writeKey: L,
  3270. sentAt: Date.now(),
  3271. type: "track",
  3272. context: {
  3273. userAgent: m.userAgent(),
  3274. library: {
  3275. name: "showcase-beacon",
  3276. version: "2.25.6-0-gd87e5b1"
  3277. },
  3278. app: {
  3279. name: "showcase",
  3280. version: "2.25.6-0-gd87e5b1"
  3281. }
  3282. }
  3283. }))
  3284. } catch (e) {
  3285. console.warn("Failed to send async segment request")
  3286. }
  3287. }
  3288. function u(e, t) {
  3289. t = t || {},
  3290. c(e, t)
  3291. }
  3292. function d(e, t) {
  3293. O = e === C.InteractionGui ? "gui-" + t : e,
  3294. p = "self_guided"
  3295. }
  3296. var p, f, g = (e("three"),
  3297. e("./util/ajax"),
  3298. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  3299. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  3300. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  3301. t.exports = {
  3302. report: function(e, t, i, n) {
  3303. l("Session starts", {
  3304. model: e,
  3305. status: t,
  3306. loadtime: Date.now() - (N || Date.now()),
  3307. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3308. autoplay: i,
  3309. quickstart: n,
  3310. ab_tilegen: g.tilegen,
  3311. ab_imgopt: g.imgopt
  3312. })
  3313. },
  3314. impression: function(e) {
  3315. e = e || {};
  3316. var t = void 0 === e.isVisible || e.isVisible
  3317. , i = (void 0 !== e.immediate && e.immediate,
  3318. window.location.search.substr(1).split("&"));
  3319. u("impression", {
  3320. visible: t,
  3321. url_params: i
  3322. })
  3323. },
  3324. initKeen: function(e) {
  3325. return e.token && e.appId ? void (f = new Keen({
  3326. projectId: e.appId,
  3327. writeKey: e.token,
  3328. readKey: "",
  3329. requestType: "xhr"
  3330. })) : void P.warn("no keen token/appId")
  3331. },
  3332. initSegment: function(e) {
  3333. return e.token ? (L = e.token,
  3334. window.analytics.load(e.token),
  3335. B = {
  3336. model_id: e.model,
  3337. start_source: e.startSource,
  3338. autoplay: e.autoplay,
  3339. quickstart: e.quickstart,
  3340. language_tag: A.languageTag,
  3341. is_mobile: m.isMobile(),
  3342. iframe: m.inIframe(),
  3343. aspect_ratio: m.aspectRatio(),
  3344. session_id: F,
  3345. window: {
  3346. width: $("#player").width(),
  3347. height: $("#player").height()
  3348. },
  3349. platform: {
  3350. browser: {
  3351. name: $.ua.browser.name,
  3352. major: $.ua.browser.major,
  3353. version: $.ua.browser.version
  3354. },
  3355. os: {
  3356. name: $.ua.os.name,
  3357. version: $.ua.os.version
  3358. },
  3359. device: {
  3360. vendor: $.ua.device.vendor,
  3361. model: $.ua.device.model,
  3362. type: $.ua.device.type
  3363. }
  3364. }
  3365. },
  3366. D = Math.random() < A.analytics.sessionTrackingRate,
  3367. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  3368. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  3369. },
  3370. sessionStart: function(e) {
  3371. P.debug("analytics user_session_start"),
  3372. c("session_started"),
  3373. N = Date.now(),
  3374. window.addEventListener("unload", function() {
  3375. h("session_ended", {
  3376. duration: Date.now() - N
  3377. })
  3378. })
  3379. },
  3380. modelLoaded: function(e, t, i, n) {
  3381. r(e, t, i, n)
  3382. },
  3383. loadComplete: function(e) {
  3384. var t = {
  3385. time_to_app_start: e
  3386. };
  3387. c("load_times", t)
  3388. },
  3389. track: function(e, t) {
  3390. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3391. c(e, t))
  3392. },
  3393. trackAlways: function(e, t) {
  3394. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3395. c(e, t)
  3396. },
  3397. getSessionId: function() {
  3398. return F
  3399. },
  3400. updateInteraction: d
  3401. }
  3402. }
  3403. ).call(this, "/js/analytics.js")
  3404. }
  3405. , {
  3406. "./ab": 3,
  3407. "./enum/ControlEvents": 21,
  3408. "./enum/PlayerEvents": 40,
  3409. "./enum/VROption": 47,
  3410. "./enum/VRPlatforms": 49,
  3411. "./enum/Viewmode": 51,
  3412. "./gui/sharing/ShareEvents": 76,
  3413. "./gui/sharing/modal": 77,
  3414. "./gui/title/TitleEvents": 80,
  3415. "./gui/title/titleBar": 82,
  3416. "./gui/vr/vrEvent": 85,
  3417. "./gui/vr/vrModal": 87,
  3418. "./localization/localize": 108,
  3419. "./tag/Billboard/BillboardEvent": 120,
  3420. "./settings": 166,
  3421. "./util/ajax": 181,
  3422. "./util/browser": 182,
  3423. "./util/common": 185,
  3424. "./util/logger": 189,
  3425. three: 217
  3426. }],
  3427. 5: [function(e, t, i) {
  3428. "use strict";
  3429. function n() {
  3430. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3431. this.controls = null
  3432. }
  3433. var r = e("three")
  3434. , o = e("../constants")
  3435. , a = e("../util/cameraLight");
  3436. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3437. n.prototype.updateAspect = function(e) {
  3438. this.aspect = e,
  3439. this.updateProjectionMatrix()
  3440. }
  3441. ,
  3442. t.exports = n
  3443. }
  3444. , {
  3445. "../constants": 8,
  3446. "../util/cameraLight": 184,
  3447. three: 217
  3448. }],
  3449. 6: [function(e, t, i) {
  3450. "use strict";
  3451. function n() {
  3452. var e = $("#player").width() / $("#player").height();
  3453. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3454. this.controls = null,
  3455. this.updateAspect(e)
  3456. }
  3457. var r = e("three")
  3458. , o = e("../constants");
  3459. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3460. n.prototype.updateAspect = function(e) {
  3461. this.aspect = e,
  3462. this.top = o.orthoBase / e,
  3463. this.bottom = -o.orthoBase / e,
  3464. this.updateProjectionMatrix()
  3465. }
  3466. ,
  3467. t.exports = n
  3468. }
  3469. , {
  3470. "../constants": 8,
  3471. three: 217
  3472. }],
  3473. 7: [function(e, t, i) {
  3474. "use strict";
  3475. function n() {
  3476. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3477. this.controls = null
  3478. }
  3479. var r = e("three")
  3480. , o = e("../settings")
  3481. , a = e("../util/cameraLight");
  3482. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3483. n.prototype.updateAspect = function(e) {
  3484. this.aspect = e,
  3485. this.updateProjectionMatrix()
  3486. }
  3487. ,
  3488. t.exports = n
  3489. }
  3490. , {
  3491. "../settings": 166,
  3492. "../util/cameraLight": 184,
  3493. three: 217
  3494. }],
  3495. 8: [function(e, t, i) {
  3496. "use strict";
  3497. t.exports = {
  3498. signedUrlDefaultExpireTime: 24e4,
  3499. signedUrlCheckInterval: 1e4,
  3500. signedUrlRefreshBuffer: 15e3,
  3501. dollhouseFOV: 70,
  3502. dollhouseNear: 1,
  3503. dollhouseFar: 5e3,
  3504. insideFOV: 70,
  3505. insideFOVMax: 120,
  3506. insideNear: .1,
  3507. insideFar: 5e3,
  3508. insideLookSpeed: .12,
  3509. insideLookLimitUp: 40,
  3510. insideLookLimitDown: -40,
  3511. orthoNear: 1,
  3512. orthoFar: 5e3,
  3513. orthoBase: 10,
  3514. narrowLandscapeHeight: 290,
  3515. reallyNarrowLandscapeHeight: 250,
  3516. visionTilingStartDate: new Date("8/26/2016"),
  3517. visionTilingStartVersion: "1.1.407.13667",
  3518. windowHeightHighQualityThreshold: 900,
  3519. tourStepDelayDefault: 3500,
  3520. tourStepDelaySlideShow: 5e3,
  3521. workshopApsect: 9 / 16,
  3522. highQualityMaxZoom: 2,
  3523. ultraHighQualityMaxZoom: 3
  3524. }
  3525. }
  3526. , {}],
  3527. 9: [function(e, t, i) {
  3528. "use strict";
  3529. function n() {
  3530. this.activeControl = null,
  3531. this.controls = {},
  3532. this.cameras = {}
  3533. }
  3534. var r = e("./PanoramaControls")
  3535. , o = e("./DollhouseControls")
  3536. , a = e("./FloorplanControls")
  3537. , s = e("../cameras/PanoramaCamera")
  3538. , l = e("../cameras/DollhouseCamera")
  3539. , c = e("../cameras/FloorplanCamera")
  3540. , h = e("events").EventEmitter
  3541. , u = e("../enum/ControlEvents")
  3542. , d = e("../enum/ModelManagerEvents")
  3543. , p = e("../enum/Viewmode")
  3544. , f = e("../settings");
  3545. n.prototype = Object.create(h.prototype),
  3546. n.prototype.init = function(e, t) {
  3547. this.setUpControls(),
  3548. this.bindEvents(e, t)
  3549. }
  3550. ,
  3551. n.prototype.activateControls = function(e) {
  3552. this.activeControl && (this.activeControl.reset(),
  3553. this.activeControl.enabled = !1),
  3554. this.controls[e] && (this.controls[e].enabled = !0),
  3555. this.activeControl = this.controls[e]
  3556. }
  3557. ,
  3558. n.prototype.setUpControls = function() {
  3559. var e = {}
  3560. , t = {}
  3561. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3562. , n = [s, l, c]
  3563. , h = [r, o, a];
  3564. i.forEach(function(i, r) {
  3565. e[i] = new n[r],
  3566. t[i] = new h[r](e[i]),
  3567. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3568. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3569. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3570. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3571. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3572. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3573. }
  3574. .bind(this)),
  3575. this.controls = t,
  3576. this.cameras = e
  3577. }
  3578. ,
  3579. n.prototype.bindEvents = function(e, t) {
  3580. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3581. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3582. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3583. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3584. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3585. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3586. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3587. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3588. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3589. e.addEventListener("contextmenu", function(e) {
  3590. e.preventDefault()
  3591. }),
  3592. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3593. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3594. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3595. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3596. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3597. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3598. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3599. t.on(d.ActiveModelChanged, function(e) {
  3600. this.setModelForControls(e.model)
  3601. }
  3602. .bind(this))
  3603. }
  3604. ,
  3605. n.prototype.setModelForControls = function(e) {
  3606. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3607. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3608. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3609. this.controls[e].setBounds(t)
  3610. }
  3611. .bind(this))
  3612. }
  3613. ,
  3614. n.prototype.onMouseDown = function(e) {
  3615. e.preventDefault(),
  3616. this.activeControl && this.activeControl.onMouseDown(e)
  3617. }
  3618. ,
  3619. n.prototype.onMouseMove = function(e) {
  3620. e.preventDefault(),
  3621. this.activeControl && this.activeControl.onMouseMove(e)
  3622. }
  3623. ,
  3624. n.prototype.onMouseUp = function(e) {
  3625. e.preventDefault(),
  3626. this.activeControl && this.activeControl.onMouseUp(e)
  3627. }
  3628. ,
  3629. n.prototype.onMouseOver = function(e) {
  3630. e.preventDefault(),
  3631. this.activeControl && this.activeControl.onMouseOver(e)
  3632. }
  3633. ,
  3634. n.prototype.onMouseWheel = function(e) {
  3635. e.preventDefault(),
  3636. this.activeControl && this.activeControl.onMouseWheel(e)
  3637. }
  3638. ,
  3639. n.prototype.onTouchStart = function(e) {
  3640. e.preventDefault(),
  3641. this.activeControl && this.activeControl.onTouchStart(e);
  3642. var hotList = $('#hotListWrap')[0];
  3643. hotList.classList.remove('hotListActive');
  3644. $('#hotListContent ul .active').removeClass('active');
  3645. $('#hotList')[0].classList.remove('active')
  3646. }
  3647. ,
  3648. n.prototype.onTouchMove = function(e) {
  3649. e.preventDefault(),
  3650. this.activeControl && this.activeControl.onTouchMove(e)
  3651. }
  3652. ,
  3653. n.prototype.onTouchEnd = function(e) {
  3654. e.preventDefault(),
  3655. this.activeControl && this.activeControl.onTouchEnd(e)
  3656. }
  3657. ,
  3658. n.prototype.onPointerDown = function(e) {
  3659. if (e.preventDefault(),
  3660. this.activeControl)
  3661. switch (e.pointerType) {
  3662. case "mouse":
  3663. this.activeControl.onMouseDown(e);
  3664. break;
  3665. default:
  3666. this.activeControl.onPointerDown(e)
  3667. }
  3668. }
  3669. ,
  3670. n.prototype.onPointerMove = function(e) {
  3671. if (e.preventDefault(),
  3672. this.activeControl)
  3673. switch (e.pointerType) {
  3674. case "mouse":
  3675. this.activeControl.onMouseMove(e);
  3676. break;
  3677. default:
  3678. this.activeControl.onPointerMove(e)
  3679. }
  3680. }
  3681. ,
  3682. n.prototype.onPointerUp = function(e) {
  3683. if (e.preventDefault(),
  3684. this.activeControl)
  3685. switch (e.pointerType) {
  3686. case "mouse":
  3687. this.activeControl.onMouseUp(e);
  3688. break;
  3689. default:
  3690. this.activeControl.onPointerUp(e)
  3691. }
  3692. }
  3693. ,
  3694. n.prototype.onPointerCancel = function(e) {
  3695. e.preventDefault(),
  3696. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3697. }
  3698. ,
  3699. n.prototype.onKeyDown = function(e) {
  3700. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3701. this.activeControl && this.activeControl.onKeyDown(e))
  3702. }
  3703. ,
  3704. n.prototype.onKeyUp = function(e) {
  3705. e.preventDefault(),
  3706. this.activeControl && this.activeControl.onKeyUp(e)
  3707. }
  3708. ,
  3709. t.exports = n
  3710. }
  3711. , {
  3712. "../cameras/DollhouseCamera": 5,
  3713. "../cameras/FloorplanCamera": 6,
  3714. "../cameras/PanoramaCamera": 7,
  3715. "../enum/ControlEvents": 21,
  3716. "../enum/ModelManagerEvents": 33,
  3717. "../enum/Viewmode": 51,
  3718. "../settings": 166,
  3719. "./DollhouseControls": 10,
  3720. "./FloorplanControls": 11,
  3721. "./PanoramaControls": 13,
  3722. events: 202
  3723. }],
  3724. 10: [function(e, t, i) {
  3725. "use strict";
  3726. function n(e) {
  3727. a.call(this, e),
  3728. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3729. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3730. this.minDistance = o.dollhouseDefault.minDistance,
  3731. this.maxDistance = o.dollhouseDefault.maxDistance,
  3732. this.adjustedMinDistance = this.minDistance,
  3733. this.adjustedMaxDistance = this.maxDistance
  3734. }
  3735. var r = e("three")
  3736. , o = e("../settings")
  3737. , a = e("./OutsideControls");
  3738. n.prototype = Object.create(a.prototype),
  3739. n.prototype.pan = function(e, t) {
  3740. this.camera.updateMatrix();
  3741. var i = this.camera.position.clone().sub(this.target).length();
  3742. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3743. this.panLeft(2 * e * i / $("#player").height()),
  3744. this.panUp(-2 * t * i / $("#player").height())
  3745. }
  3746. ,
  3747. n.prototype.updateZoom = function() {
  3748. var e = this.offset.length();
  3749. return e * this.scale
  3750. }
  3751. ,
  3752. n.prototype.setZoomBounds = function(e) {
  3753. var t = e.min.distanceTo(e.max);
  3754. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3755. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3756. this.minDistance = this.adjustedMinDistance,
  3757. this.maxDistance = this.adjustedMaxDistance
  3758. }
  3759. ,
  3760. n.prototype.resetRanges = function(e, t) {
  3761. e ? (this.minDistance = Math.min(e, this.minDistance),
  3762. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3763. this.maxDistance = this.adjustedMaxDistance),
  3764. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3765. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3766. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3767. }
  3768. ,
  3769. n.prototype.toJSON = function() {
  3770. return a.prototype.toJSON.call(this)
  3771. }
  3772. ,
  3773. t.exports = n
  3774. }
  3775. , {
  3776. "../settings": 166,
  3777. "./OutsideControls": 12,
  3778. three: 217
  3779. }],
  3780. 11: [function(e, t, i) {
  3781. "use strict";
  3782. function n(e) {
  3783. a.call(this, e),
  3784. this.minDistance = 15,
  3785. this.maxDistance = 50,
  3786. this.noRotateUpDown = !0,
  3787. this.minPolarAngle = 0,
  3788. this.maxPolarAngle = 0,
  3789. this.mouseActions[l.LEFT] = s.PAN,
  3790. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3791. this.mouseActions[l.RIGHT] = s.ROTATE,
  3792. this.touchActions[1] = s.PAN,
  3793. this.touchActions[2] = s.ROTATE_DOLLY,
  3794. this.absoluteScale = 1,
  3795. this.currentScale = 1
  3796. }
  3797. var r = e("three")
  3798. , o = e("../settings")
  3799. , a = e("./OutsideControls")
  3800. , s = e("../enum/ControlActions")
  3801. , l = e("../enum/MouseButton")
  3802. , c = e("../util/math")
  3803. , h = e("../util/browser");
  3804. n.prototype = Object.create(a.prototype),
  3805. n.prototype.zoomToContain = function(e) {
  3806. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3807. this.currentScale = this.absoluteScale
  3808. }
  3809. ,
  3810. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3811. var t = Math.max(modelSize.x, modelSize.z)
  3812. , i = Math.min(modelSize.x, modelSize.z)
  3813. , n = Math.max(t, i * this.camera.aspect)
  3814. , r = Math.max(i, t * this.camera.aspect);
  3815. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3816. return absoluteScale
  3817. },
  3818. n.prototype.rotateToView = function(e, t) {
  3819. var i = 0
  3820. , n = h.aspectRatio() < 1
  3821. , r = e.x < e.z;
  3822. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3823. this.rotateLeft(i),
  3824. this.update(0)
  3825. }
  3826. ,
  3827. n.prototype.pan = function(e, t) {
  3828. this.camera.updateMatrix(),
  3829. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3830. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3831. }
  3832. ,
  3833. n.prototype.updateZoom = function() {
  3834. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3835. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3836. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3837. this.camera.left = -o.orthoBase * this.currentScale,
  3838. this.camera.right = o.orthoBase * this.currentScale,
  3839. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3840. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3841. this.camera.updateProjectionMatrix(),
  3842. this.offset.length()
  3843. }
  3844. ,
  3845. n.prototype.toJSON = function() {
  3846. var e = new r.Quaternion
  3847. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3848. , i = new r.Quaternion;
  3849. return function() {
  3850. var n = a.prototype.toJSON.call(this);
  3851. return e.copy(n.camera_quaternion),
  3852. i.copy(t),
  3853. i.multiply(e),
  3854. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3855. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3856. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3857. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3858. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3859. n
  3860. }
  3861. }(),
  3862. t.exports = n
  3863. }
  3864. , {
  3865. "../enum/ControlActions": 20,
  3866. "../enum/MouseButton": 34,
  3867. "../settings": 166,
  3868. "../util/browser": 182,
  3869. "../util/math": 190,
  3870. "./OutsideControls": 12,
  3871. three: 217
  3872. }],
  3873. 12: [function(e, t, i) {
  3874. "use strict";
  3875. function n(e) {
  3876. this.camera = e,
  3877. this.camera.controls = this,
  3878. this.enabled = !1,
  3879. this.target = new r.Vector3,
  3880. this.targetBounds = new r.Box3,
  3881. this.zoomSpeed = 1,
  3882. this.minDistance = 0,
  3883. this.maxDistance = 1 / 0,
  3884. this.noRotateUpDown = !1,
  3885. this.rotateSpeed = 1,
  3886. this.keyboardZoomSpeed = 0,
  3887. this.keyPanSpeed = 7,
  3888. this.autoRotate = !1,
  3889. this.autoRotateSpeed = 2,
  3890. this.autoPan = !1,
  3891. this.autoPanPosition = new r.Vector3,
  3892. this.minPolarAngle = r.Math.degToRad(25),
  3893. this.maxPolarAngle = r.Math.degToRad(65),
  3894. this.rotationAcceleration = new r.Vector2,
  3895. this.rotationSpeed = new r.Vector2,
  3896. this.panAcceleration = new r.Vector2,
  3897. this.panSpeed = new r.Vector2,
  3898. this.rotateStart = new r.Vector2,
  3899. this.rotateEnd = new r.Vector2,
  3900. this.rotateDelta = new r.Vector2,
  3901. this.panStart = new r.Vector2,
  3902. this.panEnd = new r.Vector2,
  3903. this.panDelta = new r.Vector2,
  3904. this.panOffset = new r.Vector3,
  3905. this.offset = new r.Vector3,
  3906. this.dollyStart = new r.Vector2,
  3907. this.dollyEnd = new r.Vector2,
  3908. this.dollyDelta = new r.Vector2,
  3909. this.phiDelta = 0,
  3910. this.thetaDelta = 0,
  3911. this.scale = 1,
  3912. this.panVector = new r.Vector3,
  3913. this.lastPosition = new r.Vector3,
  3914. this.state = c.NONE,
  3915. this.mouseActions = {},
  3916. this.mouseActions[h.LEFT] = c.ROTATE,
  3917. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3918. this.mouseActions[h.RIGHT] = c.PAN,
  3919. this.touchActions = {},
  3920. this.touchActions[1] = c.ROTATE,
  3921. this.touchActions[2] = c.PAN_DOLLY,
  3922. this.lastMoveTime = 0,
  3923. this.pointersLimit = 2,
  3924. this.pointers = []
  3925. }
  3926. var r = e("three")
  3927. , o = e("../settings")
  3928. , a = e("../util/common")
  3929. , s = e("../util/math")
  3930. , l = e("../enum/Vectors")
  3931. , c = e("../enum/ControlActions")
  3932. , h = e("../enum/MouseButton")
  3933. , u = e("../enum/Keys")
  3934. , d = e("../enum/ControlEvents")
  3935. , p = e("events").EventEmitter
  3936. , f = 1e-6;
  3937. n.prototype = Object.create(p.prototype),
  3938. n.prototype.setBounds = function(e) {
  3939. this.targetBounds = e
  3940. }
  3941. ,
  3942. n.prototype.isEngaged = function() {
  3943. return this.state !== c.NONE
  3944. }
  3945. ,
  3946. n.prototype.rotateLeft = function(e) {
  3947. void 0 === e && (e = this.getAutoRotationAngle()),
  3948. this.thetaDelta -= e
  3949. }
  3950. ,
  3951. n.prototype.rotateUp = function(e) {
  3952. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3953. this.phiDelta -= e)
  3954. }
  3955. ,
  3956. n.prototype.panLeft = function(e) {
  3957. var t = this.camera.matrix.elements;
  3958. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3959. this.panOffset.multiplyScalar(-e),
  3960. this.panVector.add(this.panOffset)
  3961. }
  3962. ,
  3963. n.prototype.panUp = function(e) {
  3964. var t = this.camera.matrix.elements;
  3965. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3966. this.panOffset.multiplyScalar(-e),
  3967. this.panVector.add(this.panOffset)
  3968. }
  3969. ,
  3970. n.prototype.startRotating = function(e, t) {
  3971. e && this.navRotationAcc("x", e),
  3972. t && this.navRotationAcc("y", t)
  3973. }
  3974. ,
  3975. n.prototype.stopRotating = function(e) {
  3976. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3977. this.navRotationAcc("x", 0),
  3978. this.navRotationAcc("y", 0)
  3979. }
  3980. ,
  3981. n.prototype.setAutoPanPosition = function(e, t) {
  3982. var i = new r.Vector3
  3983. , n = new r.Vector3;
  3984. return function(e, t) {
  3985. i.copy(this.camera.position),
  3986. void 0 === e && null === e || i.setX(e),
  3987. void 0 === t && null === t || i.setZ(t);
  3988. var r = this.camera.position.distanceTo(this.target)
  3989. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3990. this.targetClamped = !1,
  3991. n.copy(i).addScaledVector(o, r),
  3992. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3993. i.copy(n).addScaledVector(o, -r),
  3994. this.targetClamped = !0),
  3995. this.autoPanPosition.x = i.x,
  3996. this.autoPanPosition.z = i.z,
  3997. this.autoPan && this.stopAutoPanning()
  3998. }
  3999. }(),
  4000. n.prototype.stopAutoPanning = function() {
  4001. var e = this.autoPan;
  4002. this.autoPan = !1,
  4003. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  4004. }
  4005. ,
  4006. n.prototype.dollyIn = function(e) {
  4007. void 0 === e && (e = this.getZoomScale()),
  4008. this.scale /= e
  4009. }
  4010. ,
  4011. n.prototype.dollyOut = function(e) {
  4012. void 0 === e && (e = this.getZoomScale()),
  4013. this.scale *= e
  4014. }
  4015. ,
  4016. n.prototype.updatePan = function(e) {
  4017. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4018. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4019. this.autoPan) {
  4020. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  4021. t.setY(0).clampLength(0, 50 * e),
  4022. this.target.add(t),
  4023. this.camera.position.add(t),
  4024. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  4025. this.stopAutoPanning())
  4026. }
  4027. }
  4028. ,
  4029. n.prototype.update = function(e) {
  4030. e || (e = 1 / 60),
  4031. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4032. this.rotateLeft(-this.rotationSpeed.x),
  4033. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4034. this.updatePan(e);
  4035. var t = this.camera.position;
  4036. this.offset.copy(t).sub(this.target);
  4037. var i = Math.atan2(this.offset.x, this.offset.z)
  4038. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  4039. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4040. i += this.thetaDelta,
  4041. n += this.phiDelta,
  4042. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  4043. n = Math.max(f, Math.min(Math.PI - f, n));
  4044. var r = this.updateZoom();
  4045. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  4046. this.target.add(this.panVector),
  4047. this.targetBounds.clampPoint(this.target, this.target),
  4048. this.offset.x = r * Math.sin(n) * Math.sin(i),
  4049. this.offset.y = r * Math.cos(n),
  4050. this.offset.z = r * Math.sin(n) * Math.cos(i),
  4051. t.copy(this.target).add(this.offset),
  4052. this.camera.lookAt(this.target),
  4053. this.thetaDelta = 0,
  4054. this.phiDelta = 0,
  4055. this.scale = 1,
  4056. this.panVector.set(0, 0, 0),
  4057. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  4058. }
  4059. ,
  4060. n.prototype.getAutoRotationAngle = function() {
  4061. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  4062. }
  4063. ,
  4064. n.prototype.getZoomScale = function() {
  4065. return Math.pow(.95, this.zoomSpeed)
  4066. }
  4067. ,
  4068. n.prototype.onMouseDown = function(e) {
  4069. if (this.enabled) {
  4070. switch (e.preventDefault(),
  4071. this.stopAutoPanning(),
  4072. this.mouseDown = !0,
  4073. this.state = this.mouseActions[e.button],
  4074. this.state) {
  4075. case c.ROTATE:
  4076. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4077. this.rotationSpeed.set(0, 0);
  4078. break;
  4079. case c.DOLLY:
  4080. this.dollyStart.set(e.clientX, e.clientY);
  4081. break;
  4082. case c.PAN:
  4083. this.panStart.set(e.clientX, e.clientY)
  4084. }
  4085. this.emit(d.InputStart, "mouse")
  4086. }
  4087. }
  4088. ,
  4089. n.prototype.onMouseMove = function(e) {
  4090. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4091. switch (e.preventDefault(),
  4092. this.state) {
  4093. case c.ROTATE:
  4094. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4095. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4096. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  4097. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  4098. this.rotateStart.copy(this.rotateEnd);
  4099. break;
  4100. case c.DOLLY:
  4101. this.dollyEnd.set(e.clientX, e.clientY),
  4102. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4103. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4104. t.call(this),
  4105. this.dollyStart.copy(this.dollyEnd);
  4106. break;
  4107. case c.PAN:
  4108. this.panEnd.set(e.clientX, e.clientY),
  4109. this.panDelta.subVectors(this.panEnd, this.panStart),
  4110. this.pan(this.panDelta.x, this.panDelta.y),
  4111. this.panStart.copy(this.panEnd)
  4112. }
  4113. this.emit(d.Move, "mouse"),
  4114. this.lastMoveTime = e.timeStamp,
  4115. this.update()
  4116. }
  4117. }
  4118. ,
  4119. n.prototype.onMouseUp = function(e) {
  4120. this.enabled && (this.mouseDown = !1,
  4121. this.state = c.NONE,
  4122. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4123. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4124. this.update(),
  4125. this.rotationAcceleration.set(0, 0),
  4126. this.rotateDelta.set(0, 0)))
  4127. }
  4128. ,
  4129. n.prototype.onMouseOver = function(e) {
  4130. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4131. }
  4132. ,
  4133. n.prototype.onMouseWheel = function(e) {
  4134. if (this.enabled && o.useWheel) {
  4135. this.emit(d.Move, "wheel");
  4136. var t = e.wheelDelta || -e.detail
  4137. , i = t > 0 ? this.dollyOut : this.dollyIn;
  4138. i.call(this),
  4139. this.update()
  4140. }
  4141. }
  4142. ,
  4143. n.prototype.onKeyDown = function(e) {
  4144. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4145. this.handleKeyDown(e.which)))
  4146. }
  4147. ,
  4148. n.prototype.navRotationAcc = function(e, t) {
  4149. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  4150. }
  4151. ,
  4152. n.prototype.navPanAcc = function(e, t) {
  4153. this.stopAutoPanning(),
  4154. this.panAcceleration[e] = t
  4155. }
  4156. ,
  4157. n.prototype.handleKeyDown = function(e) {
  4158. var t = !0;
  4159. switch (e) {
  4160. case u.UPARROW:
  4161. case u.I:
  4162. this.navRotationAcc("y", 1);
  4163. break;
  4164. case u.DOWNARROW:
  4165. case u.K:
  4166. this.navRotationAcc("y", -1);
  4167. break;
  4168. case u.LEFTARROW:
  4169. case u.J:
  4170. this.navRotationAcc("x", -1);
  4171. break;
  4172. case u.RIGHTARROW:
  4173. case u.L:
  4174. this.navRotationAcc("x", 1);
  4175. break;
  4176. case u.W:
  4177. this.navPanAcc("y", 1);
  4178. break;
  4179. case u.S:
  4180. this.navPanAcc("y", -1);
  4181. break;
  4182. case u.A:
  4183. this.navPanAcc("x", -1);
  4184. break;
  4185. case u.D:
  4186. this.navPanAcc("x", 1);
  4187. break;
  4188. default:
  4189. t = !1
  4190. }
  4191. t && this.emit(d.Move, "key")
  4192. }
  4193. ,
  4194. n.prototype.onKeyUp = function(e) {
  4195. this.enabled && (e.preventDefault(),
  4196. e.stopPropagation(),
  4197. this.handleKeyUp(e.which))
  4198. }
  4199. ,
  4200. n.prototype.handleKeyUp = function(e) {
  4201. switch (e) {
  4202. case u.I:
  4203. case u.K:
  4204. case u.UPARROW:
  4205. case u.DOWNARROW:
  4206. this.keyboardZoomSpeed = 0,
  4207. this.rotationAcceleration.y = 0;
  4208. break;
  4209. case u.J:
  4210. case u.L:
  4211. case u.LEFTARROW:
  4212. case u.RIGHTARROW:
  4213. this.rotationAcceleration.x = 0;
  4214. break;
  4215. case u.S:
  4216. case u.W:
  4217. this.panAcceleration.y = 0;
  4218. break;
  4219. case u.A:
  4220. case u.D:
  4221. this.panAcceleration.x = 0
  4222. }
  4223. }
  4224. ,
  4225. n.prototype.onTouchStart = function(e) {
  4226. if (this.enabled || this.state === c.NONE) {
  4227. e.preventDefault(),
  4228. e.stopPropagation(),
  4229. this.stopAutoPanning();
  4230. var t = function() {
  4231. if (2 === e.touches.length) {
  4232. var t = e.touches[0].pageX - e.touches[1].pageX
  4233. , i = e.touches[0].pageY - e.touches[1].pageY;
  4234. this.dollyStart.set(t, i)
  4235. }
  4236. }
  4237. .bind(this)
  4238. , i = function() {
  4239. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  4240. }
  4241. .bind(this)
  4242. , n = function() {
  4243. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  4244. }
  4245. .bind(this);
  4246. switch (this.state = this.touchActions[e.touches.length],
  4247. this.state) {
  4248. case c.PAN_DOLLY:
  4249. t();
  4250. case c.PAN:
  4251. i();
  4252. break;
  4253. case c.ROTATE_DOLLY:
  4254. t();
  4255. case c.ROTATE:
  4256. n()
  4257. }
  4258. this.rotationSpeed.set(0, 0),
  4259. this.emit(d.InputStart, "touch")
  4260. }
  4261. }
  4262. ,
  4263. n.prototype.onTouchMove = function(e) {
  4264. if (this.enabled && this.state !== c.NONE) {
  4265. e.preventDefault(),
  4266. e.stopPropagation();
  4267. var t = function() {
  4268. var t = e.touches[0].pageX - e.touches[1].pageX
  4269. , i = e.touches[0].pageY - e.touches[1].pageY;
  4270. this.dollyEnd.set(t, i);
  4271. var n = this.dollyStart.length() - this.dollyEnd.length();
  4272. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4273. this.dollyStart.copy(this.dollyEnd)
  4274. }
  4275. .bind(this)
  4276. , i = function() {
  4277. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  4278. this.panDelta.subVectors(this.panEnd, this.panStart),
  4279. this.pan(this.panDelta.x, this.panDelta.y),
  4280. this.panStart.copy(this.panEnd),
  4281. this.rotateDelta.set(0, 0)
  4282. }
  4283. .bind(this)
  4284. , n = function() {
  4285. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  4286. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4287. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  4288. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  4289. this.rotateStart.copy(this.rotateEnd)
  4290. }
  4291. .bind(this)
  4292. , r = function() {
  4293. if (2 === e.touches.length) {
  4294. var i = window.devicePixelRatio || 1
  4295. , r = e.touches[1].pageX - e.touches[0].pageX
  4296. , s = e.touches[1].pageY - e.touches[0].pageY
  4297. , l = Math.sqrt(r * r + s * s)
  4298. , h = Math.abs(this.dollyStart.length() - l);
  4299. if (h > o.input.touchMoveThreshold * i)
  4300. this.state = c.DOLLY,
  4301. t();
  4302. else {
  4303. var u = a.average(e.touches, "pageX")
  4304. , d = a.average(e.touches, "pageY")
  4305. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  4306. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  4307. this.rotateStart.set(u, d),
  4308. n())
  4309. }
  4310. }
  4311. }
  4312. .bind(this);
  4313. switch (this.state) {
  4314. case c.PAN_DOLLY:
  4315. t();
  4316. case c.PAN:
  4317. i();
  4318. break;
  4319. case c.ROTATE_DOLLY:
  4320. r();
  4321. break;
  4322. case c.DOLLY:
  4323. t();
  4324. break;
  4325. case c.ROTATE:
  4326. n();
  4327. break;
  4328. default:
  4329. this.state = c.NONE
  4330. }
  4331. this.lastMoveTime = e.timeStamp,
  4332. this.emit(d.Move, "touch")
  4333. }
  4334. }
  4335. ,
  4336. n.prototype.onTouchEnd = function(e) {
  4337. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4338. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4339. this.state = c.NONE,
  4340. this.update(),
  4341. this.rotationAcceleration.set(0, 0),
  4342. this.rotateDelta.set(0, 0))
  4343. }
  4344. ,
  4345. n.prototype.onPointerDown = function(e) {
  4346. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4347. id: e.pointerId,
  4348. pageX: e.pageX,
  4349. pageY: e.pageY
  4350. }),
  4351. e.touches = this.pointers,
  4352. this.onTouchStart(e)),
  4353. this.emit(d.InputStart, "pointer"))
  4354. }
  4355. ,
  4356. n.prototype.onPointerMove = function(e) {
  4357. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4358. e.pointerId === t.id && (t.pageX = e.pageX,
  4359. t.pageY = e.pageY)
  4360. }),
  4361. e.touches = this.pointers,
  4362. this.onTouchMove(e))
  4363. }
  4364. ,
  4365. n.prototype.onPointerUp = function(e) {
  4366. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4367. e.pointerId === t.id && this.pointers.splice(i, 1)
  4368. }
  4369. .bind(this)),
  4370. e.touches = this.pointers,
  4371. this.onTouchEnd(e))
  4372. }
  4373. ,
  4374. n.prototype.reset = function() {
  4375. this.state = c.NONE,
  4376. this.stopAutoPanning(),
  4377. this.rotationSpeed.set(0, 0),
  4378. this.rotationAcceleration.set(0, 0),
  4379. this.panSpeed.set(0, 0),
  4380. this.panAcceleration.set(0, 0)
  4381. }
  4382. ,
  4383. n.prototype.toJSON = function() {
  4384. var e = {
  4385. camera_position: {
  4386. x: s.toPrecision(this.camera.position.x, 4),
  4387. y: s.toPrecision(this.camera.position.y, 4),
  4388. z: s.toPrecision(this.camera.position.z, 4)
  4389. },
  4390. camera_quaternion: {
  4391. x: s.toPrecision(this.camera.quaternion.x, 4),
  4392. y: s.toPrecision(this.camera.quaternion.y, 4),
  4393. z: s.toPrecision(this.camera.quaternion.z, 4),
  4394. w: s.toPrecision(this.camera.quaternion.w, 4)
  4395. }
  4396. };
  4397. return e
  4398. }
  4399. ,
  4400. t.exports = n
  4401. }
  4402. , {
  4403. "../enum/ControlActions": 20,
  4404. "../enum/ControlEvents": 21,
  4405. "../enum/Keys": 30,
  4406. "../enum/MouseButton": 34,
  4407. "../enum/Vectors": 50,
  4408. "../settings": 166,
  4409. "../util/common": 185,
  4410. "../util/math": 190,
  4411. events: 202,
  4412. three: 217
  4413. }],
  4414. 13: [function(e, t, i) {
  4415. (function(i) {
  4416. "use strict";
  4417. function n(e) {
  4418. this.camera = e,
  4419. this.camera.controls = this,
  4420. this.target = new r.Vector3(0,0,0),
  4421. this.lookVector = new r.Vector3,
  4422. this.lookSpeed = .05,
  4423. this.rotationAcc = new r.Vector2,
  4424. this.rotationSpeed = new r.Vector2,
  4425. this.lat = 0,
  4426. this.lon = 0,
  4427. this.phi = 0,
  4428. this.theta = 0,
  4429. this.enabled = !1,
  4430. this.locked = !1,
  4431. this.pointer = new r.Vector2(0,0),
  4432. this.rotationHistory = [],
  4433. this.rotationDifference = new r.Vector2,
  4434. this.pointerDragOn = !1,
  4435. this.pointerDragStart = new r.Vector2(0,0),
  4436. this.pinchDistance = 0,
  4437. this.moveStart = new r.Vector2,
  4438. this.moveTolerance = .01,
  4439. this.pointersLimit = 2,
  4440. this.pointers = []
  4441. }
  4442. var r = e("three")
  4443. , o = e("../util/logger")
  4444. , a = e("../settings")
  4445. , s = e("../util/common")
  4446. , l = e("../util/math")
  4447. , c = (e("../enum/Vectors"),
  4448. e("../enum/MouseButton"))
  4449. , h = e("../enum/Keys")
  4450. , u = e("../enum/ControlEvents")
  4451. , d = e("events").EventEmitter;
  4452. new o(i);
  4453. n.prototype = Object.create(d.prototype),
  4454. n.prototype.usable = function() {
  4455. return this.enabled && !this.locked
  4456. }
  4457. ,
  4458. n.prototype.lookAt = function(e) {
  4459. var t = this.camera.position.clone().sub(e)
  4460. , i = Math.atan(t.z / t.x);
  4461. i += t.x < 0 ? Math.PI : 0,
  4462. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4463. this.lon = r.Math.radToDeg(i) + 180;
  4464. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4465. , o = Math.atan(t.y / n);
  4466. this.lat = -r.Math.radToDeg(o)
  4467. }
  4468. ,
  4469. n.prototype.startRotationFrom = function(e, t) {
  4470. l.convertScreenPositionToNDC(e, t, this.pointer),
  4471. this.pointerDragOn = !0,
  4472. this.pointerDragStart.copy(this.pointer),
  4473. this.moveStart.copy(this.pointer),
  4474. this.rotationHistory = [],
  4475. this.rotationSpeed.set(0, 0)
  4476. }
  4477. ,
  4478. n.prototype.onMouseOver = function(e) {
  4479. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4480. }
  4481. ,
  4482. n.prototype.onTouchStart = function(e) {
  4483. if (this.usable()) {
  4484. switch (e.preventDefault(),
  4485. e.stopPropagation(),
  4486. e.touches.length) {
  4487. case 1:
  4488. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4489. break;
  4490. case 2:
  4491. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4492. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4493. this.pinchDistance = Math.sqrt(t * t + i * i)
  4494. }
  4495. this.emit(u.InputStart, "touch")
  4496. }
  4497. }
  4498. ,
  4499. n.prototype.onPointerDown = function(e) {
  4500. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4501. id: e.pointerId,
  4502. clientX: e.clientX,
  4503. clientY: e.clientY
  4504. }),
  4505. e.touches = this.pointers,
  4506. this.onTouchStart(e),
  4507. this.emit(u.InputStart, "pointer"))
  4508. }
  4509. ,
  4510. n.prototype.onMouseDown = function(e) {
  4511. if (this.usable()) {
  4512. switch (e.preventDefault(),
  4513. e.stopPropagation(),
  4514. e.button) {
  4515. case c.LEFT:
  4516. this.startRotationFrom(e.clientX, e.clientY)
  4517. }
  4518. this.emit(u.InputStart, "mouse")
  4519. }
  4520. }
  4521. ,
  4522. n.prototype.updateRotation = function() {
  4523. if (this.usable() && this.pointerDragOn) {
  4524. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4525. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4526. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4527. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4528. , o = Math.atan2(e.y, i)
  4529. , a = Math.atan2(t.y, n);
  4530. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4531. e.y = 0,
  4532. t.y = 0;
  4533. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4534. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4535. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4536. this.pointerDragStart.copy(this.pointer)
  4537. }
  4538. }
  4539. ,
  4540. n.prototype.onMouseMove = function(e) {
  4541. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4542. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4543. }
  4544. ,
  4545. n.prototype.onTouchMove = function(e) {
  4546. if (this.usable())
  4547. switch (this.emit(u.Move, "touch"),
  4548. e.touches.length) {
  4549. case 1:
  4550. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4551. break;
  4552. case 2:
  4553. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4554. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4555. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4556. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4557. this.emit(u.Pinch, n),
  4558. this.pinchDistance -= n)
  4559. }
  4560. }
  4561. ,
  4562. n.prototype.onPointerMove = function(e) {
  4563. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4564. e.pointerId === t.id && (t.clientX = e.clientX,
  4565. t.clientY = e.clientY)
  4566. }),
  4567. e.touches = this.pointers,
  4568. this.onTouchMove(e))
  4569. }
  4570. ,
  4571. n.prototype.endRotation = function() {
  4572. this.pointerDragOn = !1;
  4573. var e = s.averageVectors(this.rotationHistory);
  4574. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4575. }
  4576. ,
  4577. n.prototype.onTouchEnd = function(e) {
  4578. this.usable() && (e.preventDefault(),
  4579. e.stopPropagation(),
  4580. this.endRotation())
  4581. }
  4582. ,
  4583. n.prototype.onMouseUp = function(e) {
  4584. this.usable() && (e.preventDefault(),
  4585. e.stopPropagation(),
  4586. this.endRotation())
  4587. }
  4588. ,
  4589. n.prototype.onPointerUp = function(e) {
  4590. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4591. e.pointerId === t.id && this.pointers.splice(i, 1)
  4592. }
  4593. .bind(this)),
  4594. e.touches = this.pointers,
  4595. this.onTouchEnd(e))
  4596. }
  4597. ,
  4598. n.prototype.update = function(e) {
  4599. this.lon,
  4600. this.lat;
  4601. for (this.updateRotation(),
  4602. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4603. this.rotationHistory.shift();
  4604. this.lon += this.rotationDifference.x,
  4605. this.lat += this.rotationDifference.y,
  4606. this.rotationDifference.set(0, 0),
  4607. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4608. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4609. this.lon += this.rotationSpeed.x * e,
  4610. this.lat += this.rotationSpeed.y * e
  4611. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4612. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4613. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4614. 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 );
  4615. this.phi = r.Math.degToRad(90 - this.lat),
  4616. this.theta = r.Math.degToRad(this.lon),
  4617. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4618. this.lookVector.y = Math.cos(this.phi),
  4619. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4620. this.target.copy(this.lookVector).add(this.camera.position),
  4621. this.camera.lookAt(this.target)
  4622. }
  4623. ,
  4624. n.prototype.onMouseWheel = function(e) {
  4625. if (this.usable()) {
  4626. var t = e.wheelDelta || -e.detail;
  4627. this.emit(u.InteractionDirect),
  4628. this.emit(u.Scroll, t)
  4629. }
  4630. }
  4631. ,
  4632. n.prototype.onKeyDown = function(e) {
  4633. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4634. this.handleKeyDown(e.which)))
  4635. }
  4636. ,
  4637. n.prototype.handleKeyDown = function(e) {
  4638. var t = function(e, t) {
  4639. this.rotationAcc[e] = t
  4640. }
  4641. .bind(this);
  4642. this.emit(u.InteractionKey);
  4643. var i = !0;
  4644. switch (e) {
  4645. case h.LEFTARROW:
  4646. case h.J:
  4647. t("x", -1);
  4648. break;
  4649. case h.RIGHTARROW:
  4650. case h.L:
  4651. t("x", 1);
  4652. break;
  4653. case h.I:
  4654. t("y", 1);
  4655. break;
  4656. case h.K:
  4657. t("y", -1);
  4658. break;
  4659. default:
  4660. i = !1
  4661. }
  4662. i && this.emit(u.Move, "key")
  4663. if(e == 27){
  4664. if(exit){
  4665. $(exit).click()
  4666. }
  4667. window.player.closePopup()
  4668. }
  4669. }
  4670. ,
  4671. n.prototype.onKeyUp = function(e) {
  4672. this.usable() && (e.preventDefault(),
  4673. e.stopPropagation(),
  4674. this.handleKeyUp(e.which))
  4675. }
  4676. ,
  4677. n.prototype.handleKeyUp = function(e) {
  4678. switch (e) {
  4679. case h.LEFTARROW:
  4680. case h.J:
  4681. case h.RIGHTARROW:
  4682. case h.L:
  4683. this.rotationAcc.x = 0;
  4684. break;
  4685. case h.I:
  4686. case h.K:
  4687. this.rotationAcc.y = 0
  4688. }
  4689. }
  4690. ,
  4691. n.prototype.startRotating = function(e, t) {
  4692. e && (this.rotationAcc.x = e),
  4693. t && (this.rotationAcc.y = t)
  4694. }
  4695. ,
  4696. n.prototype.stopRotating = function(e) {
  4697. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4698. this.rotationAcc.set(0, 0)
  4699. }
  4700. ,
  4701. n.prototype.reset = function() {
  4702. this.pointerDragOn = !1,
  4703. this.rotationAcc.set(0, 0),
  4704. this.rotationSpeed.set(0, 0),
  4705. this.pointers = []
  4706. }
  4707. ,
  4708. n.prototype.toJSON = function() {
  4709. var e = {
  4710. camera_position: {
  4711. x: l.toPrecision(this.camera.position.x, 4),
  4712. y: l.toPrecision(this.camera.position.y, 4),
  4713. z: l.toPrecision(this.camera.position.z, 4)
  4714. },
  4715. camera_quaternion: {
  4716. x: l.toPrecision(this.camera.quaternion.x, 4),
  4717. y: l.toPrecision(this.camera.quaternion.y, 4),
  4718. z: l.toPrecision(this.camera.quaternion.z, 4),
  4719. w: l.toPrecision(this.camera.quaternion.w, 4)
  4720. }
  4721. };
  4722. return e
  4723. }
  4724. ,
  4725. n.prototype.setStateFromJSON = function(e) {
  4726. this.camera.position.copy(e.camera_position),
  4727. this.camera.quaternion.copy(e.camera_quaternion)
  4728. }
  4729. ,
  4730. t.exports = n
  4731. }
  4732. ).call(this, "/js/controls/PanoramaControls.js")
  4733. }
  4734. , {
  4735. "../enum/ControlEvents": 21,
  4736. "../enum/Keys": 30,
  4737. "../enum/MouseButton": 34,
  4738. "../enum/Vectors": 50,
  4739. "../settings": 166,
  4740. "../util/common": 185,
  4741. "../util/logger": 189,
  4742. "../util/math": 190,
  4743. events: 202,
  4744. three: 217
  4745. }],
  4746. 14: [function(e, t, i) {
  4747. (function(i) {
  4748. "use strict";
  4749. var n = e("three")
  4750. , r = e("../enum/Viewmode")
  4751. , o = e("../util/logger")
  4752. , a = new o(i);
  4753. t.exports = {
  4754. serialize: function(e) {
  4755. return encodeURI(JSON.stringify(e))
  4756. },
  4757. deserialize: function(e) {
  4758. function t(e) {
  4759. function t(e, t) {
  4760. return e && "number" == typeof t && !isNaN(t)
  4761. }
  4762. return e.reduce(t, !0)
  4763. }
  4764. try {
  4765. var i = JSON.parse(decodeURI(e))
  4766. , o = {
  4767. mode: r.fromInt(i.camera_mode),
  4768. panoId: i.scan_id,
  4769. position: (new n.Vector3).copy(i.camera_position),
  4770. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4771. zoom: i.ortho_zoom,
  4772. floorVisibility: i.floor_visibility
  4773. }
  4774. , s = o.position;
  4775. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4776. var l = o.quaternion;
  4777. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4778. o
  4779. } catch (i) {
  4780. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4781. try {
  4782. var c = e.split(",")
  4783. , h = {
  4784. x: parseFloat(c[2]),
  4785. y: parseFloat(c[3]),
  4786. z: parseFloat(c[4])
  4787. }
  4788. , u = {
  4789. x: parseFloat(c[5]),
  4790. y: parseFloat(c[6]),
  4791. z: parseFloat(c[7]),
  4792. w: parseFloat(c[8])
  4793. };
  4794. return t([h.x, h.y, h.z]) || (h.x = 0,
  4795. h.y = 0,
  4796. h.z = 0),
  4797. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4798. u.y = 0,
  4799. u.z = 0,
  4800. u.w = 1),
  4801. {
  4802. mode: r.fromInt(c[0]),
  4803. panoId: c[1],
  4804. position: (new n.Vector3).copy(h),
  4805. quaternion: (new n.Quaternion).copy(u)
  4806. }
  4807. } catch (t) {
  4808. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4809. }
  4810. }
  4811. return null
  4812. }
  4813. }
  4814. }
  4815. ).call(this, "/js/controls/serializer.js")
  4816. }
  4817. , {
  4818. "../enum/Viewmode": 51,
  4819. "../util/logger": 189,
  4820. three: 217
  4821. }],
  4822. 15: [function(e, t, i) {
  4823. (function(i) {
  4824. "use strict";
  4825. function n() {
  4826. this.endlessLoop = a.warp.loop,
  4827. this.clock = new r.Clock(!0),
  4828. this.model = null,
  4829. this.player = null,
  4830. this.currentItem = null,
  4831. this.destinationItem = null,
  4832. this.tourIsPlaying = !1,
  4833. this.transitionStage = y.None,
  4834. this.nextFunc = null,
  4835. this.onTheBus = !1,
  4836. this.tourInProgress = !1,
  4837. this.reachSource = null,
  4838. this.interrupted = !1,
  4839. this.nItems = 0,
  4840. this.walkingSectionPaused = !1
  4841. }
  4842. var r = e("three")
  4843. , o = e("./util/logger")
  4844. , a = e("./settings")
  4845. , s = e("./util/transitions")
  4846. , l = e("events").EventEmitter
  4847. , c = e("./enum/Viewmode")
  4848. , h = e("./analytics")
  4849. , u = e("./enum/WarpStyle")
  4850. , s = e("./util/transitions")
  4851. , d = (e("./model/ModelManager"),
  4852. e("./enum/ModelManagerEvents"))
  4853. , p = e("./enum/DirectorEvents")
  4854. , f = e("./enum/PlayerEvents")
  4855. , g = (e("./enum/ControlEvents"),
  4856. e("./enum/BlackoutStyle"))
  4857. , m = e("./enum/PathDiscardMode")
  4858. , v = e("./enum/PathDisplayMode")
  4859. , A = (e("./player"),
  4860. new o(i))
  4861. , y = Object.freeze({
  4862. None: 0,
  4863. Moving: 1,
  4864. Aiming: 2,
  4865. Interlude: 3
  4866. })
  4867. , C = Object.freeze({
  4868. Forward: 1,
  4869. NoChange: 0,
  4870. Backwards: -1
  4871. })
  4872. , I = s.getUniqueId();
  4873. n.prototype = Object.create(l.prototype),
  4874. n.prototype.init = function(e, t) {
  4875. this.player = e,
  4876. this.modelManager = t,
  4877. this.updateModel(),
  4878. this.resetAll(),
  4879. this.bindEvents()
  4880. }
  4881. ,
  4882. n.prototype.resetAll = function() {
  4883. if (this.currentItem = null,
  4884. this.destinationItem = null,
  4885. this.tourIsPlaying = !1,
  4886. this.bgmReplay(),//xzw
  4887. this.transitionStage = y.None,
  4888. this.nextFunc = null,
  4889. this.onTheBus = !1,
  4890. this.reachSource = null,
  4891. this.interrupted = !1,
  4892. this.model) {
  4893. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4894. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4895. } else
  4896. this.defaultWarpStyle = u.BLACK,
  4897. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4898. this.resetSpecialTransition()
  4899. }
  4900. ,
  4901. n.prototype.updateModel = function() {
  4902. this.model = this.modelManager.getActiveModel(),
  4903. this.nItems = this.model.heroLocations.length
  4904. }
  4905. ,
  4906. n.prototype.bindEvents = function() {
  4907. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4908. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4909. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4910. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4911. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4912. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4913. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4914. this.player.once(f.Move, function() {
  4915. s.cancelById(I)
  4916. })
  4917. }
  4918. ,
  4919. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4920. return e === u.WALK && (this.interrupt(g.NONE),
  4921. this.pauseWalkingSection(),
  4922. this.player.fastForwardActivePanoFlight(),
  4923. !0)
  4924. }
  4925. ,
  4926. n.prototype.handlePlayerMove = function(e) {
  4927. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4928. this.emit("update.controls")
  4929. }
  4930. ,
  4931. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4932. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4933. this.emit("update.controls"))
  4934. }
  4935. ,
  4936. n.prototype.handlePlayerModeChanged = function(e, t) {
  4937. this.intermediateState() || e === t || (this.onTheBus = !1,
  4938. this.emit("update.controls"))
  4939. }
  4940. ,
  4941. n.prototype.handlePlayerInputStart = function(e) {
  4942. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4943. }
  4944. ,
  4945. n.prototype.handlePlayerFlyingStarted = function() {
  4946. this.clearWalkingSectionPaused()
  4947. }
  4948. ,
  4949. n.prototype.describe = function() {
  4950. return {
  4951. nItems: this.nItems,
  4952. currentItem: this.currentItem,
  4953. destinationItem: this.destinationItem,
  4954. tourIsPlaying: this.tourIsPlaying,
  4955. onTheBus: this.onTheBus,
  4956. endlessLoop: this.endlessLoop,
  4957. viewMode: this.player.mode,
  4958. inTransition: this._inTransition(),
  4959. transitionStage: this.transitionStage,
  4960. tourInProgress: this.tourInProgress
  4961. }
  4962. }
  4963. ,
  4964. n.prototype._inTransition = function() {
  4965. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4966. }
  4967. ,
  4968. n.prototype.bounceable = function() {
  4969. var e = this.clock.getDelta();
  4970. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4971. }
  4972. ,
  4973. n.prototype.itemCompare = function(item1, item2, type){//add
  4974. if(type == 'equal'){//==
  4975. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4976. }else if(type == 'less'){//<
  4977. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4978. }
  4979. }
  4980. n.prototype.currentMoveDirection = function() {
  4981. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4982. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4983. }
  4984. ,
  4985. n.prototype.clearPath = function() {
  4986. this._inTransition() || this.player.path.discardPathObject()
  4987. }
  4988. ,
  4989. n.prototype.allFloors = function() {
  4990. this.model.toggleAllFloors()
  4991. }
  4992. ,
  4993. n.prototype.actionComplete = function(e) {
  4994. if (this.interrupted = !1,
  4995. this.transitionStage = y.None,
  4996. this.resetSpecialTransition(),
  4997. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4998. this.tourIsPlaying || (this.player.disablePreRendering(),
  4999. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  5000. this.emit("update.controls"),
  5001. this.nextFunc) {
  5002. var t = this.nextFunc;
  5003. this.nextFunc = null,
  5004. t()
  5005. }
  5006. }
  5007. ,
  5008. n.prototype.awaitCompletion = function(e, t) {
  5009. this.nextFunc = t,
  5010. e()
  5011. }
  5012. ,
  5013. n.prototype.updateSuccessFunction = function(e) {
  5014. this.nextFunc = e
  5015. }
  5016. ,
  5017. n.prototype.interrupt = function(e, t) {
  5018. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5019. this.tourIsPlaying = !1,
  5020. this.bgmReplay(),//xzw
  5021. this.interrupted = !0,
  5022. this.nextFunc = null,
  5023. this.emit(p.ActionInterrupted),
  5024. null !== e && void 0 !== e || (e = g.BEGINNING),
  5025. this.player.interruptAndFastForward(e, t),
  5026. !0)
  5027. }
  5028. ,
  5029. n.prototype.wouldInterrupt = function() {
  5030. return this.transitionStage !== y.None
  5031. }
  5032. ,
  5033. n.prototype.intermediateState = function() {
  5034. return this.transitionStage !== y.None
  5035. }
  5036. ,
  5037. n.prototype.isInterrupted = function() {
  5038. return this.interrupted
  5039. }
  5040. ,
  5041. n.prototype.pauseWalkingSection = function() {
  5042. this.walkingSectionPaused = !0
  5043. }
  5044. ,
  5045. n.prototype.clearWalkingSectionPaused = function() {
  5046. this.walkingSectionPaused = !1
  5047. }
  5048. ,
  5049. n.prototype.autoTour = function() {
  5050. var e = Date.now();
  5051. this.model.auxDataPromise.then(function() {
  5052. e = Date.now() - e;
  5053. var t = a.warp.auto
  5054. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  5055. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  5056. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5057. done: function() {
  5058. this.playTour()
  5059. }
  5060. .bind(this),
  5061. name: "_atr",
  5062. id: I
  5063. })
  5064. }
  5065. .bind(this))
  5066. }
  5067. ,
  5068. n.prototype.atDestinationPano = function() {
  5069. if (!this.player.currentPano || null === this.destinationItem)
  5070. return !1;
  5071. var e = this.player.currentPano.id;
  5072. if (void 0 === e)
  5073. return !1;
  5074. var t = this.model.heroLocations;
  5075. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  5076. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  5077. return destination && destination.panoId == e
  5078. }
  5079. ,
  5080. n.prototype.redirectToItem = function(e, t) {
  5081. if (null === e || void 0 === e)
  5082. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  5083. if (!this.wouldInterrupt())
  5084. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  5085. if (this.player.mode === c.TRANSITIONING)
  5086. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  5087. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  5088. var i = function() {
  5089. s.setTimeout(function() {
  5090. this.setDestinationItem(e),
  5091. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  5092. }
  5093. .bind(this), 0)
  5094. }
  5095. .bind(this);
  5096. this.interrupt(g.END, 0),
  5097. this.updateSuccessFunction(i)
  5098. }
  5099. ,
  5100. n.prototype.useSpecialTransition = function(e) {
  5101. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  5102. this.nextWarpStyle = u.BLACK
  5103. }
  5104. ,
  5105. n.prototype.resetSpecialTransition = function() {
  5106. this.nextWarpStyle = this.defaultWarpStyle
  5107. }
  5108. ,
  5109. n.prototype.arrivedAtDestination = function(e) {
  5110. if (this.player.flying || this.player.isWarping())
  5111. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  5112. else {
  5113. this.transitionStage = y.Aiming;
  5114. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  5115. this.player.model.fadePanoMarkers(0),
  5116. this.awaitCompletion(function() {
  5117. this.resetSpecialTransition(),
  5118. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  5119. }
  5120. .bind(this), t)
  5121. }
  5122. }
  5123. ,
  5124. n.prototype.goToDestination = function(e, t, i, n) {
  5125. //音频
  5126. //if(this.destinationItem[1] == 0){//如果是每个folder的起始
  5127. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  5128. if(musicInfo && musicInfo.music){
  5129. var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5130. let audioSrc1 = g_tourAudio.src.split('/').pop();
  5131. let audioSrc2 = o.split('/').pop();
  5132. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  5133. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  5134. g_tourAudio.currentTime = 0; g_tourAudio.play();
  5135. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  5136. g_tourAudio.play();
  5137. }
  5138. g_tourAudio.shouldPlay = true
  5139. }else{//很可能是该folder的起始
  5140. g_tourAudio.src = manage.dealURL(o);
  5141. g_tourAudio.shouldPlay = true
  5142. g_tourAudio.load()
  5143. }
  5144. if(g_bgAudio && !g_bgAudio.paused){
  5145. manage.switchBgmState(false);
  5146. g_bgAudio.pauseByTour = true
  5147. }
  5148. }
  5149. //}
  5150. if (this.onTheBus = !0,
  5151. this.emit("update.controls"),
  5152. this.player.updateLastView(),
  5153. !n && this.atDestinationPano()){
  5154. /*
  5155. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5156. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5157. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5158. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5159. } */
  5160. return void this.arrivedAtDestination(!0);
  5161. }
  5162. if (this.player.flying || this.player.isWarping())
  5163. A.warn("Cannot go to new destination while player is flying or warping.");
  5164. else {
  5165. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5166. , o = null
  5167. , a1 = null;
  5168. if (r.isPano()) {
  5169. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5170. //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  5171. var s = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  5172. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  5173. o = this.arrivedAtDestination.bind(this, !0)
  5174. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  5175. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5176. }
  5177. } else{
  5178. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  5179. o = this.arrivedAtDestination.bind(this, !1);
  5180. }
  5181. this.transitionStage = y.Moving,
  5182. this.model.fadePanoMarkers(0),
  5183. this.awaitCompletion(function() {
  5184. a1();
  5185. }
  5186. .bind(this), o),
  5187. this.emit("update.controls")
  5188. }
  5189. }
  5190. ,
  5191. n.prototype.tourInterlude = function() {
  5192. if (h.trackAlways("reach_highlight", {
  5193. reach_source: this.reachSource
  5194. }),
  5195. this.model.fadePanoMarkers(0),
  5196. this.emit("update.controls"),
  5197. this.tourIsPlaying)
  5198. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  5199. this.stopTour(true),
  5200. this.emit(p.TourEnd),
  5201. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  5202. this.transitionStage = y.Interlude,
  5203. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  5204. }
  5205. .bind(this), this.goNext.bind(this))
  5206. }
  5207. ,
  5208. n.prototype.playTour = function() {
  5209. if (!this.bounceable())
  5210. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  5211. this.tourInProgress = !0,
  5212. this.reachSource = "play",
  5213. this.tourIsPlaying = !0,
  5214. this.wasZoomEnabled = this.player.zoomEnabled,
  5215. this.player.zoomEnabled = !1,
  5216. this.resetSpecialTransition(),
  5217. this.emit("update.controls"),
  5218. this.emit(p.TourStart),
  5219. this.player.enablePreRendering(),
  5220. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5221. this.goToDestination()) : this.goNext()))
  5222. }
  5223. ,
  5224. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5225. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  5226. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  5227. g_playAudio = g_bgAudio;
  5228. g_tourAudio && g_tourAudio.pause();
  5229. //window.tourAudio && window.tourAudio.pause();
  5230. //manage.switchBgmState(true);
  5231. playMusic(player.currentPano)
  5232. }
  5233. }
  5234. ,
  5235. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5236. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5237. this.tourIsPlaying = !1,
  5238. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  5239. this.interrupt(),
  5240. this.clearWalkingSectionPaused(),
  5241. this.resetSpecialTransition(),
  5242. this.emit("update.controls"))
  5243. //window.tourAudio && window.tourAudio.pause();
  5244. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  5245. {
  5246. g_tourAudio.pause();
  5247. g_tourAudio.shouldPlay = false
  5248. //g_tourAudio.src = ""
  5249. }
  5250. }
  5251. ,
  5252. n.prototype.endTourProgress = function() {
  5253. this.tourInProgress = !1,
  5254. this.emit("update.controls"),
  5255. this.emit(p.TourEnd)
  5256. }
  5257. ,
  5258. n.prototype.goToHighlight = function(e) {
  5259. if (this.wouldInterrupt())
  5260. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5261. else {
  5262. if (A.debug("<tour.goto " + e + ">"),
  5263. this.isInterrupted())
  5264. return;
  5265. this.clearWalkingSectionPaused(),
  5266. this.setDestinationItem(e),
  5267. this.useSpecialTransition("Hilight"),
  5268. this.goToDestination(),
  5269. h.trackAlways("reach_highlight", {
  5270. reach_source: "thumb"
  5271. })
  5272. }
  5273. }
  5274. ,
  5275. n.prototype.prevHighlight = function() {
  5276. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5277. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5278. this.reachSource = "prev",
  5279. this.goPrev()))
  5280. }
  5281. ,
  5282. n.prototype.nextHighlight = function() {
  5283. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5284. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5285. this.reachSource = "next",
  5286. this.goNext()))
  5287. }
  5288. ,
  5289. n.prototype.changeMode = function(e) {
  5290. var t = $.Deferred()
  5291. , i = t.resolve.bind(t)
  5292. , n = t.reject.bind(t);
  5293. this.emit(p.StartModeChange);
  5294. var r = function() {
  5295. return this.clearWalkingSectionPaused(),
  5296. !!this.wouldInterrupt() && (this.interrupt(),
  5297. !0)
  5298. }
  5299. .bind(this);
  5300. if (!r()) {
  5301. switch (e) {
  5302. case c.PANORAMA:
  5303. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  5304. break;
  5305. case c.DOLLHOUSE:
  5306. case c.FLOORPLAN:
  5307. this.player.flyToNewMode({
  5308. mode: e
  5309. }).done(i).fail(n);
  5310. break;
  5311. case c.OUTDOOR:
  5312. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  5313. }
  5314. return t.promise()
  5315. }
  5316. }
  5317. ,
  5318. n.prototype.atEndOfTour = function() {
  5319. //return this.currentItem >= this.nItems - 1
  5320. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  5321. if(end){
  5322. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5323. if(heroLocations){
  5324. end = this.currentItem[1] >= heroLocations.length - 1
  5325. }
  5326. }
  5327. return end;
  5328. }
  5329. ,
  5330. n.prototype.firstDestination = function() {
  5331. //return 0 < this.nItems ? 0 : null
  5332. return 0 < this.nItems ? [0,0]: null
  5333. }
  5334. ,
  5335. n.prototype.finalDestination = function() {
  5336. //return 0 < this.nItems ? this.nItems - 1 : null
  5337. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5338. }
  5339. ,
  5340. n.prototype.goPrev = function() {
  5341. this.tourAdvance(-1)
  5342. }
  5343. ,
  5344. n.prototype.goNext = function() {
  5345. this.tourAdvance(1)
  5346. }
  5347. ,
  5348. n.prototype.setDestinationItem = function(e) {
  5349. this.destinationItem = e,
  5350. this.emit("update.controls")
  5351. }
  5352. ,
  5353. n.prototype.setCurrentItem = function(e) {
  5354. this.currentItem = e,
  5355. this.emit("update.controls")
  5356. }
  5357. ,
  5358. n.prototype.nextItem = function(currentItem) {
  5359. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5360. if(currentItem == void 0)return this.firstDestination()
  5361. var currentLocation = this.model.heroLocations[currentItem[0]];
  5362. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5363. var item;
  5364. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5365. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5366. }else{
  5367. item = [currentItem[0] , currentItem[1]+1]
  5368. }
  5369. if(item[0] >= this.nItems ){
  5370. item = this.firstDestination()
  5371. }
  5372. return item;
  5373. //暂时不理会endlessLoop,默认为false
  5374. }
  5375. ,
  5376. n.prototype.prevItem = function(currentItem) {
  5377. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5378. if(currentItem == void 0)return this.firstDestination()
  5379. var item;
  5380. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5381. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5382. else{
  5383. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5384. if(this.currentItem[1] == 0){//子目录中第一个
  5385. return [currentItem[0] - 1, lastChildNum-1]
  5386. }else{
  5387. return [currentItem[0], currentItem[1]-1]
  5388. }
  5389. }
  5390. }
  5391. ,
  5392. n.prototype.tourAdvance = function(e) {//e是1或-1
  5393. A.debug("tourAdvance(" + e + ")")
  5394. if(null === this.currentItem || void 0 === this.currentItem){
  5395. this.setDestinationItem(this.firstDestination())
  5396. }else{
  5397. var item
  5398. if(e == 1){
  5399. item = this.nextItem(this.currentItem)
  5400. }else if(e == -1){
  5401. item = this.prevItem(this.currentItem)
  5402. }
  5403. this.setDestinationItem(item)
  5404. }
  5405. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5406. this.useSpecialTransition("reverse-looping to end")
  5407. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5408. this.useSpecialTransition("looping back to start")
  5409. }
  5410. /* var momentTour = this.getMomentTour(this.destinationItem);
  5411. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5412. var zoomLevel = this.player.zoomLevel;
  5413. this.player.zoomEnabled = true;
  5414. var zoom = function(e, d) {
  5415. this.player.zoomTo((1-e)*zoomLevel, true)
  5416. }.bind(this)
  5417. s.start(zoom, 1500, function(){
  5418. }, 0, d.easeOutQuad, "zoom")
  5419. } */
  5420. this.goToDestination()
  5421. }
  5422. ,
  5423. n.prototype.getMomentTour = function(destinationItem) {//add
  5424. var wholeMomentTour = window.MP_PREFETCHED_MODELDATA.momentTour || "walk"; //最外层
  5425. if(!destinationItem) return wholeMomentTour
  5426. else{
  5427. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5428. if(currentLocation.momentTour)return currentLocation.momentTour;
  5429. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5430. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5431. }
  5432. }
  5433. ,
  5434. t.exports = n
  5435. }
  5436. ).call(this, "/js/director.js")
  5437. }
  5438. , {
  5439. "./analytics": 4,
  5440. "./enum/BlackoutStyle": 18,
  5441. "./enum/ControlEvents": 21,
  5442. "./enum/DirectorEvents": 23,
  5443. "./enum/ModelManagerEvents": 33,
  5444. "./enum/PathDiscardMode": 38,
  5445. "./enum/PathDisplayMode": 39,
  5446. "./enum/PlayerEvents": 40,
  5447. "./enum/Viewmode": 51,
  5448. "./enum/WarpStyle": 52,
  5449. "./model/ModelManager": 140,
  5450. "./player": 155,
  5451. "./settings": 166,
  5452. "./util/logger": 189,
  5453. "./util/transitions": 195,
  5454. events: 202,
  5455. three: 217
  5456. }],
  5457. 16: [function(e, t, i) {
  5458. "use strict";
  5459. var n = e("three")
  5460. , r = e("./enum/Viewmode")
  5461. , o = (e("./settings"),
  5462. e("./util/transitions"))
  5463. , a = e("./enum/PlayerEvents")
  5464. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5465. , l = new n.ShaderPass(n.VerticalBlurShader);
  5466. l.renderToScreen = !0;
  5467. var c = $("#player").width() / $("#player").height();
  5468. isNaN(c) && (c = 1);
  5469. //initTransitionPass(n)
  5470. var h = {
  5471. currentBlur: 0,
  5472. aspect: c,
  5473. blurStrength: 1,
  5474. hblurPass: s,
  5475. vblurPass: l,
  5476. // transitionMaskPass : new n.TransitionPass()
  5477. bindEvents: function(e) {
  5478. e.on(a.ModeChanged, function(e, t) {
  5479. e === r.PANORAMA && (o.cancel(h.blur),
  5480. o.cancel(h.addBlur),
  5481. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5482. })
  5483. },
  5484. blur: function(e) {
  5485. h.currentBlur = e;
  5486. var t = e * h.blurStrength;
  5487. l.uniforms.v.value = t / 512 * h.aspect,
  5488. s.uniforms.h.value = t / 512
  5489. },
  5490. addBlur: function(e) {
  5491. e = Math.max(e, h.currentBlur),
  5492. h.blur(e)
  5493. },
  5494. removeBlur: function(e) {
  5495. e = Math.min(1 - e, h.currentBlur),
  5496. h.blur(e)
  5497. }
  5498. };
  5499. h.blur(0),
  5500. t.exports = h
  5501. }
  5502. , {
  5503. "./enum/PlayerEvents": 40,
  5504. "./enum/Viewmode": 51,
  5505. "./settings": 166,
  5506. "./util/transitions": 195,
  5507. three: 217
  5508. }],
  5509. 17: [function(e, t, i) {
  5510. "use strict";
  5511. t.exports = {
  5512. UNKNOWN: 0,
  5513. ALIGNED: 1,
  5514. UNALIGNED: 2,
  5515. PLACED: 3
  5516. }
  5517. }
  5518. , {}],
  5519. 18: [function(e, t, i) {
  5520. "use strict";
  5521. t.exports = {
  5522. NONE: 0,
  5523. MIDDLE: 1,
  5524. END: 2,
  5525. BEGINNING: 3,
  5526. FADEIN: 4
  5527. }
  5528. }
  5529. , {}],
  5530. 19: [function(e, t, i) {
  5531. "use strict";
  5532. var n = e("three");
  5533. t.exports = {
  5534. newBlue: new n.Color(4967932),
  5535. altBlue: new n.Color(47355),
  5536. tagDefault: new n.Color(223357),
  5537. classicBlue: new n.Color(53759),
  5538. mpYellow: new n.Color(16502016),
  5539. mpOrange: new n.Color(16428055),
  5540. mpBlue: new n.Color(12096),
  5541. mpLtGrey: new n.Color(13751252),
  5542. mpDkGrey: new n.Color(10000019),
  5543. mpRed: new n.Color(12525854),
  5544. mpOrangeDesat: new n.Color(16764529),
  5545. mpBlueDesat: new n.Color(4034734),
  5546. mpRedDesat: new n.Color(14705505),
  5547. white: new n.Color(16777215),
  5548. black: new n.Color(0),
  5549. _desat: function(e, t) {
  5550. var i = t || .3
  5551. , r = (new n.Color).copy(e).getHSL();
  5552. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5553. },
  5554. _darken: function(e, t) {
  5555. var i = t || .2
  5556. , r = e.getHSL();
  5557. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5558. }
  5559. }
  5560. }
  5561. , {
  5562. three: 217
  5563. }],
  5564. 20: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. NONE: -1,
  5568. ROTATE: 0,
  5569. DOLLY: 1,
  5570. PAN: 2,
  5571. ROTATE_DOLLY: 3,
  5572. PAN_DOLLY: 4
  5573. }
  5574. }
  5575. , {}],
  5576. 21: [function(e, t, i) {
  5577. "use strict";
  5578. t.exports = {
  5579. Move: "move",
  5580. InteractionDirect: "interaction.direct",
  5581. InteractionKey: "interaction.key",
  5582. InteractionGui: "interaction.gui",
  5583. FlyInDirection: "fly.direction",
  5584. InputStart: "input.start",
  5585. Pinch: "input.pinch",
  5586. Scroll: "input.scroll",
  5587. AutoPanInterrupt: "autopan.interrupt",
  5588. AutoPanComplete: "autopan.complete",
  5589. AutoPanClamped: "autopan.clamped",
  5590. LongTap: "longtap"
  5591. }
  5592. }
  5593. , {}],
  5594. 22: [function(e, t, i) {
  5595. "use strict";
  5596. t.exports = Object.freeze({
  5597. FORWARD: "FORWARD",
  5598. LEFT: "LEFT",
  5599. RIGHT: "RIGHT",
  5600. BACK: "BACK",
  5601. UP: "UP",
  5602. DOWN: "DOWN"
  5603. })
  5604. }
  5605. , {}],
  5606. 23: [function(e, t, i) {
  5607. "use strict";
  5608. t.exports = {
  5609. ActionInterrupted: "action.interrupted",
  5610. TourStart: "tour.start",
  5611. TourEnd: "tour.end",
  5612. StartModeChange: "mode.startChange"
  5613. }
  5614. }
  5615. , {}],
  5616. 24: [function(e, t, i) {
  5617. "use strict";
  5618. t.exports = Object.freeze({
  5619. None: 0,
  5620. Queued: 1,
  5621. ForceQueued: 2,
  5622. Downloading: 3,
  5623. Downloaded: 4,
  5624. DownloadFailed: 5
  5625. })
  5626. }
  5627. , {}],
  5628. 25: [function(e, t, i) {
  5629. "use strict";
  5630. t.exports = {
  5631. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5632. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5633. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5634. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5635. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5636. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5637. }
  5638. }
  5639. , {}],
  5640. 26: [function(e, t, i) {
  5641. "use strict";
  5642. t.exports = {
  5643. Texture2D: 0,
  5644. TextureCube: 1
  5645. }
  5646. }
  5647. , {}],
  5648. 27: [function(e, t, i) {
  5649. "use strict";
  5650. t.exports = {
  5651. SMALL: "small",
  5652. LARGE: "large"
  5653. }
  5654. }
  5655. , {}],
  5656. 28: [function(e, t, i) {
  5657. "use strict";
  5658. var n = e("./Viewmode")
  5659. , r = {
  5660. LANDING: {},
  5661. NAVIGATION: "navigation",
  5662. MORE_HELP: "moreHelp",
  5663. TOUR_INTERACTION: {}
  5664. };
  5665. r.LANDING[n.PANORAMA] = "panorama.landing",
  5666. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5667. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5668. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5669. r.TOUR_INTERACTION.standard = "standard.tour",
  5670. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5671. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5672. t.exports = r
  5673. }
  5674. , {
  5675. "./Viewmode": 51
  5676. }],
  5677. 29: [function(e, t, i) {
  5678. "use strict";
  5679. var n = {
  5680. UP: 1,
  5681. DOWN: -1,
  5682. LEFT: "L",
  5683. RIGHT: "R",
  5684. FORWARD: "F",
  5685. BACK: "B",
  5686. reverse: {},
  5687. opposite: function(e) {
  5688. return this.reverse[e.toString()]
  5689. }
  5690. };
  5691. !function() {
  5692. n.reverse[n.UP] = n.DOWN,
  5693. n.reverse[n.DOWN] = n.UP,
  5694. n.reverse[n.LEFT] = n.RIGHT,
  5695. n.reverse[n.RIGHT] = n.LEFT,
  5696. n.reverse[n.FORWARD] = n.BACK,
  5697. n.reverse[n.BACK] = n.FORWARD
  5698. }(),
  5699. t.exports = n
  5700. }
  5701. , {}],
  5702. 30: [function(e, t, i) {
  5703. "use strict";
  5704. var n = e("../util/browser")
  5705. , r = {
  5706. ZERO: 48,
  5707. ONE: 49,
  5708. TWO: 50,
  5709. THREE: 51,
  5710. FOUR: 52,
  5711. FIVE: 53,
  5712. SIX: 54,
  5713. SEVEN: 55,
  5714. EIGHT: 56,
  5715. NINE: 57,
  5716. LEFTARROW: 37,
  5717. UPARROW: 38,
  5718. RIGHTARROW: 39,
  5719. DOWNARROW: 40,
  5720. A: 65,
  5721. B: 66,
  5722. C: 67,
  5723. D: 68,
  5724. E: 69,
  5725. F: 70,
  5726. G: 71,
  5727. H: 72,
  5728. I: 73,
  5729. J: 74,
  5730. K: 75,
  5731. L: 76,
  5732. M: 77,
  5733. N: 78,
  5734. O: 79,
  5735. P: 80,
  5736. Q: 81,
  5737. R: 82,
  5738. S: 83,
  5739. T: 84,
  5740. U: 85,
  5741. V: 86,
  5742. W: 87,
  5743. X: 88,
  5744. Y: 89,
  5745. Z: 90,
  5746. SPACE: 32,
  5747. RETURN: 13,
  5748. SEMICOLON: 186,
  5749. PLUSEQUALS: 187,
  5750. DASHUNDERSCORE: 189,
  5751. OPENBRACKET: 219
  5752. };
  5753. n.detectFirefox() && (r.SEMICOLON = 59,
  5754. r.PLUSEQUALS = 61,
  5755. r.DASHUNDERSCORE = 173),
  5756. t.exports = r
  5757. }
  5758. , {
  5759. "../util/browser": 182
  5760. }],
  5761. 31: [function(e, t, i) {
  5762. "use strict";
  5763. t.exports = {
  5764. EN_US: "en-US",
  5765. ES_MX: "es-MX",
  5766. FR_FR: "fr-FR",
  5767. DE_DE: "de-DE",
  5768. RU_RU: "ru-RU",
  5769. CN_CN: "cn-CN",
  5770. JP_JP: "jp-JP"
  5771. }
  5772. }
  5773. , {}],
  5774. 32: [function(e, t, i) {
  5775. "use strict";
  5776. t.exports = {
  5777. TagActivated: "tag.activated",
  5778. TagDismissed: "tag.dismissed",
  5779. TagNavigation: "tag.navigation"
  5780. }
  5781. }
  5782. , {}],
  5783. 33: [function(e, t, i) {
  5784. "use strict";
  5785. t.exports = {
  5786. ModelAdded: "model-added",
  5787. ActiveModelChanged: "active-model-changed"
  5788. }
  5789. }
  5790. , {}],
  5791. 34: [function(e, t, i) {
  5792. "use strict";
  5793. t.exports = {
  5794. LEFT: 0,
  5795. MIDDLE: 1,
  5796. RIGHT: 2
  5797. }
  5798. }
  5799. , {}],
  5800. 35: [function(e, t, i) {
  5801. "use strict";
  5802. t.exports = {
  5803. PanoRenderComplete: "panorama.render.complete",
  5804. TileRenderFailure: "panorama.tile.render.failed",
  5805. TileRenderSuccess: "panorama.tile.render.success",
  5806. TileUploadAttempted: "panorama.tile.upload.attempted",
  5807. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5808. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5809. }
  5810. }
  5811. , {}],
  5812. 36: [function(e, t, i) {
  5813. "use strict";
  5814. t.exports = {
  5815. BASE: 1,
  5816. STANDARD: 2,
  5817. HIGH: 3,
  5818. ULTRAHIGH: 4
  5819. }
  5820. }
  5821. , {}],
  5822. 37: [function(e, t, i) {
  5823. "use strict";
  5824. t.exports = {
  5825. LoadComplete: "panorama.load.complete",
  5826. LoadFailed: "panorama.load.failed",
  5827. TileLoaded: "panorama.tile.loaded"
  5828. }
  5829. }
  5830. , {}],
  5831. 38: [function(e, t, i) {
  5832. "use strict";
  5833. t.exports = Object.freeze({
  5834. Standard: 0,
  5835. Slow: 1,
  5836. Retain: 2
  5837. })
  5838. }
  5839. , {}],
  5840. 39: [function(e, t, i) {
  5841. "use strict";
  5842. t.exports = Object.freeze({
  5843. Show: 0,
  5844. Hide: 1,
  5845. Retain: 2
  5846. })
  5847. }
  5848. , {}],
  5849. 40: [function(e, t, i) {
  5850. "use strict";
  5851. t.exports = {
  5852. Move: "move",
  5853. MoveComplete: "move.complete",
  5854. ModeChanged: "mode.changed",
  5855. ModeChanging: "mode.changing",
  5856. PanoChosen: "pano.chosen",
  5857. ClosestPanoChanging: "closest.pano.changing",
  5858. WarpStarted: "warp.started",
  5859. WarpInterrupted: "warp.interrupted",
  5860. WarpEnded: "warp.ended",
  5861. FlyinFinished: "flyin.finished",
  5862. FlyingStarted: "flying.started",
  5863. FlyingInterrupted: "flying.interrupted",
  5864. FlyingEnded: "flying.ended",
  5865. Ready: "ready",
  5866. StartInside: "start.inside",
  5867. StartOutside: "start.outside",
  5868. ViewChanged: "view.changed",
  5869. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5870. InputStart: "input.start"
  5871. }
  5872. }
  5873. , {}],
  5874. 41: [function(e, t, i) {
  5875. "use strict";
  5876. t.exports = Object.freeze({
  5877. DEFAULT: 0,
  5878. PANOMARKERS: 1,
  5879. RETICULE: 2,
  5880. TAG: 3
  5881. })
  5882. }
  5883. , {}],
  5884. 42: [function(e, t, i) {
  5885. "use strict";
  5886. t.exports = {
  5887. visibleFloor: 1,
  5888. ghostFloor: 3,
  5889. boundingSkybox: 1,
  5890. panoMarker: 2,
  5891. reticule: 3,
  5892. tagStem: 4,
  5893. tagDisc: 5,
  5894. ribbon: 100
  5895. }
  5896. }
  5897. , {}],
  5898. 43: [function(e, t, i) {
  5899. "use strict";
  5900. t.exports = {
  5901. ContextCreated: "scene-renderer-context-created",
  5902. AfterRender: "after-render",
  5903. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5904. }
  5905. }
  5906. , {}],
  5907. 44: [function(e, t, i) {
  5908. "use strict";
  5909. t.exports = {
  5910. IDLE: "idle",
  5911. BROWSE: "browse",
  5912. EXAMINE: "examine"
  5913. }
  5914. }
  5915. , {}],
  5916. 45: [function(e, t, i) {
  5917. "use strict";
  5918. t.exports = {
  5919. TileDownloadSuccess: "tiledownloader.download.success",
  5920. TileDownloadFailure: "tiledownloader.download.failure",
  5921. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5922. }
  5923. }
  5924. , {}],
  5925. 46: [function(e, t, i) {
  5926. "use strict";
  5927. t.exports = {
  5928. CardboardAndroid: "googlevr",
  5929. GearVR: "gearvr",
  5930. CardboardIOS: "googlevrios",
  5931. Cardboard: "googlevr"
  5932. }
  5933. }
  5934. , {}],
  5935. 47: [function(e, t, i) {
  5936. "use strict";
  5937. t.exports = {
  5938. NONE: 0,
  5939. CONTEXTUAL: 1,
  5940. ANDROID: 2
  5941. }
  5942. }
  5943. , {}],
  5944. 48: [function(e, t, i) {
  5945. "use strict";
  5946. var n = {
  5947. Title: 0,
  5948. Cardboard: 1
  5949. }
  5950. , r = {
  5951. Title: 0,
  5952. Cardboard: 1,
  5953. Gear: 2
  5954. };
  5955. !function() {
  5956. [n, r].forEach(function(e) {
  5957. e.pageCount = Object.keys(e).length
  5958. })
  5959. }(),
  5960. t.exports.ios = n,
  5961. t.exports.standard = r
  5962. }
  5963. , {}],
  5964. 49: [function(e, t, i) {
  5965. "use strict";
  5966. t.exports = {
  5967. Android: "android",
  5968. IOS: "ios",
  5969. Desktop: "desktop",
  5970. UnsupportedAndroid: "android-unsupported"
  5971. }
  5972. }
  5973. , {}],
  5974. 50: [function(e, t, i) {
  5975. "use strict";
  5976. var n = e("three");
  5977. t.exports = {
  5978. UP: new n.Vector3(0,1,0),
  5979. DOWN: new n.Vector3(0,-1,0),
  5980. LEFT: new n.Vector3(-1,0,0),
  5981. RIGHT: new n.Vector3(1,0,0),
  5982. FORWARD: new n.Vector3(0,0,-1),
  5983. BACK: new n.Vector3(0,0,1)
  5984. }
  5985. }
  5986. , {
  5987. three: 217
  5988. }],
  5989. 51: [function(e, t, i) {
  5990. "use strict";
  5991. var n = e("../exception/ViewmodeConvertException")
  5992. , r = e("./coreViewmodes")
  5993. , o = e("../util/common")
  5994. , a = {
  5995. MESH: "mesh",
  5996. OUTDOOR: "outdoor",
  5997. TRANSITIONING: "transitioning",
  5998. toInt: function(e) {
  5999. switch (e) {
  6000. case this.PANORAMA:
  6001. return 1;
  6002. case this.DOLLHOUSE:
  6003. return 2;
  6004. case this.FLOORPLAN:
  6005. return 3;
  6006. case this.OUTDOOR:
  6007. return 4;
  6008. case this.TRANSITIONING:
  6009. return -1
  6010. }
  6011. throw new n("No known conversion for Viewmode to int for mode: " + e)
  6012. },
  6013. fromInt: function(e) {
  6014. switch (e) {
  6015. case "1":
  6016. case 1:
  6017. return this.PANORAMA;
  6018. case "2":
  6019. case 2:
  6020. return this.DOLLHOUSE;
  6021. case "3":
  6022. case 3:
  6023. return this.FLOORPLAN;
  6024. case "4":
  6025. case 4:
  6026. return this.OUTDOOR
  6027. }
  6028. throw new n("No known conversion for int to viewmode for int: " + e)
  6029. },
  6030. convertWorkshopModeInt: function(e) {
  6031. switch (e) {
  6032. case "0":
  6033. case 0:
  6034. case undefined: //xzw add
  6035. return this.PANORAMA;
  6036. case "1":
  6037. case 1:
  6038. return this.FLOORPLAN;
  6039. case "2":
  6040. case 2:
  6041. return this.DOLLHOUSE;
  6042. case "3":
  6043. case 3:
  6044. return this.MESH
  6045. }
  6046. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  6047. }
  6048. };
  6049. o.extendObject(a, r),
  6050. t.exports = a
  6051. }
  6052. , {
  6053. "../exception/ViewmodeConvertException": 58,
  6054. "../util/common": 185,
  6055. "./coreViewmodes": 54
  6056. }],
  6057. 52: [function(e, t, i) {
  6058. "use strict";
  6059. t.exports = {
  6060. BLACK: "black",
  6061. STD: "std",
  6062. WALK: "walk"
  6063. }
  6064. }
  6065. , {}],
  6066. 53: [function(e, t, i) {
  6067. "use strict";
  6068. t.exports = {
  6069. ZoomIn: "zoom.in",
  6070. ZoomOut: "zoom.out",
  6071. ZoomMax: "zoom.max",
  6072. ZoomMin: "zoom.min"
  6073. }
  6074. }
  6075. , {}],
  6076. 54: [function(e, t, i) {
  6077. "use strict";
  6078. t.exports = {
  6079. PANORAMA: "panorama",
  6080. DOLLHOUSE: "dollhouse",
  6081. FLOORPLAN: "floorplan"
  6082. }
  6083. }
  6084. , {}],
  6085. 55: [function(e, t, i) {
  6086. "use strict";
  6087. function n(e) {
  6088. this.message = e
  6089. }
  6090. t.exports = n
  6091. }
  6092. , {}],
  6093. 56: [function(e, t, i) {
  6094. "use strict";
  6095. function n(e) {
  6096. r.call(this, e)
  6097. }
  6098. var r = e("./BasicException");
  6099. n.prototype = Object.create(r.prototype),
  6100. t.exports = n
  6101. }
  6102. , {
  6103. "./BasicException": 55
  6104. }],
  6105. 57: [function(e, t, i) {
  6106. "use strict";
  6107. function n(e) {
  6108. r.call(this, e)
  6109. }
  6110. var r = e("./BasicException");
  6111. n.prototype = Object.create(r.prototype),
  6112. t.exports = n
  6113. }
  6114. , {
  6115. "./BasicException": 55
  6116. }],
  6117. 58: [function(e, t, i) {
  6118. "use strict";
  6119. function n(e) {
  6120. r.call(this, e)
  6121. }
  6122. var r = e("./BasicException");
  6123. n.prototype = Object.create(r.prototype),
  6124. t.exports = n
  6125. }
  6126. , {
  6127. "./BasicException": 55
  6128. }],
  6129. 59: [function(e, t, i) {
  6130. (function(i) {
  6131. "use strict";
  6132. function n(e) {
  6133. var t = {};
  6134. if (e) {
  6135. var i = e.flags;
  6136. if (i)
  6137. for (var n in i)
  6138. i.hasOwnProperty(n) && (t[i[n]] = !0);
  6139. return t
  6140. }
  6141. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  6142. null
  6143. }
  6144. var r = e("./util/ajax")
  6145. , o = e("./util/showcase")
  6146. , a = e("./util/logger")
  6147. , s = ""
  6148. , l = new a(i)
  6149. , c = {};
  6150. t.exports = {
  6151. loadFeatureFlags: function(e) {
  6152. var t = $.Deferred();
  6153. return r.get(e.urlBase + s, {
  6154. responseType: "json",
  6155. prefetchFrom: "user",
  6156. auth: o.getAuthorizationHeader()
  6157. }).done(function(e) {
  6158. c = n(e),
  6159. c ? t.resolve(c) : t.reject("loading-failed")
  6160. }).fail(function() {
  6161. l.debug("Retrieval of feature flags failed."),
  6162. t.reject("loading-failed")
  6163. }),
  6164. t.promise()
  6165. },
  6166. getFlags: function() {
  6167. return c
  6168. },
  6169. updateDependentSettings: function(e, t) {
  6170. e = e || c,
  6171. e.labels && (t.labels.enabled = !0),
  6172. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6173. e.showcase_sdk && (t.sdkInit = !0),
  6174. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6175. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6176. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6177. e.hide_sc_sharing && (t.share.enabled = !1)
  6178. }
  6179. }
  6180. }
  6181. ).call(this, "/js/featureflags.js")
  6182. }
  6183. , {
  6184. "./util/ajax": 181,
  6185. "./util/logger": 189,
  6186. "./util/showcase": 193
  6187. }],
  6188. 60: [function(e, t, i) {
  6189. "use strict";
  6190. var n = (e("../util/common"),
  6191. {
  6192. status: 0,
  6193. set: function(e) {
  6194. if (isNaN(e))
  6195. return !1;
  6196. var t = $('.progressbar');
  6197. 0 > e && (e = 0);
  6198. e > 100 && (e = 100);
  6199. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  6200. var barperc = e*width;
  6201. var perc = Math.round(e);
  6202. var labelpos = (parseInt(barperc)-15);
  6203. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  6204. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  6205. t.find('.perc').text(perc+'%'); //具体数字的百分比
  6206. this.status = e
  6207. },
  6208. done: function(e) {
  6209. return e || this.status ? (this.status = null,
  6210. this.set(100)) : this
  6211. }
  6212. });
  6213. t.exports.circleLoader = n
  6214. }
  6215. , {
  6216. "../util/common": 185
  6217. }],
  6218. 61: [function(e, t, i) {
  6219. "use strict";
  6220. t.exports = Object.freeze({
  6221. CLOSE: "modal.closer.close"
  6222. })
  6223. }
  6224. , {}],
  6225. 62: [function(e, t, i) {
  6226. "use strict";
  6227. function n(e, t) {
  6228. t && (t.stopPropagation(),
  6229. t.preventDefault()),
  6230. e && this.emit(l.CLOSE, e),
  6231. g.reset()
  6232. }
  6233. function r(e, t) {
  6234. function i() {
  6235. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  6236. t !== f && (f = t,
  6237. t ? (e.classList.add("closeByFooter"),
  6238. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  6239. h.classList.remove("closeByFooter")))
  6240. }
  6241. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6242. }
  6243. var o = e("../../settings")
  6244. , a = (e("../../tag/Media/MediaEvent"),
  6245. e("../../util/browser"))
  6246. , s = e("../../util/common")
  6247. , l = e("./ModalCloserEvent")
  6248. , c = e("events").EventEmitter
  6249. , h = document.getElementsByClassName("footer")[0]
  6250. , u = h.querySelectorAll(".close")[0]
  6251. , d = null
  6252. , p = null
  6253. , f = null
  6254. , g = (a.isMobile(),
  6255. {
  6256. open: function(e) {
  6257. e && (r(e),
  6258. d && u.removeEventListener("click", d, !0),
  6259. d = n.bind(this, e.id),
  6260. u.addEventListener("click", d, !0),
  6261. p && window.removeEventListener("resize", p, !0),
  6262. p = r.bind(this, e),
  6263. window.addEventListener("resize", p, !0))
  6264. },
  6265. reset: function() {
  6266. h.classList.remove("closeByFooter"),
  6267. u.removeEventListener("click", d, !0),
  6268. window.removeEventListener("resize", p, !0),
  6269. d = p = f = null
  6270. }
  6271. });
  6272. s.extendObject(g, c.prototype),
  6273. t.exports = g
  6274. }
  6275. , {
  6276. "../../tag/Media/MediaEvent": 131,
  6277. "../../settings": 166,
  6278. "../../util/browser": 182,
  6279. "../../util/common": 185,
  6280. "./ModalCloserEvent": 61,
  6281. events: 202
  6282. }],
  6283. 63: [function(e, t, i) {
  6284. "use strict";
  6285. function n(e, t, i) {
  6286. var n = new r.GUI({
  6287. width: 400
  6288. })
  6289. , u = n.addFolder("Flydown from Dollhouse");
  6290. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6291. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6292. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6293. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6294. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6295. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6296. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6297. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6298. var d = n.addFolder("Transition between panos");
  6299. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6300. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6301. h.transition.flyTime = 0,
  6302. d.__controllers.forEach(function(e) {
  6303. e.updateDisplay()
  6304. })
  6305. }),
  6306. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6307. h.transition.flySpeed = 0,
  6308. d.__controllers.forEach(function(e) {
  6309. e.updateDisplay()
  6310. })
  6311. }),
  6312. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6313. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6314. d.add(h.transition, "movementEasing", Object.keys(a));
  6315. var p = n.addFolder("Path Display");
  6316. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6317. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6318. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6319. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6320. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6321. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6322. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6323. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6324. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6325. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6326. h.path.color = l[h.path.color],
  6327. h.path.colorUp = l._desat(h.path.color),
  6328. h.path.colorDown = l.darken(h.path.color)
  6329. }),
  6330. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6331. h.reticuleColor = l[h.reticuleColor]
  6332. });
  6333. var f = n.addFolder("Warping")
  6334. , g = f.addFolder("Warp/Teleport");
  6335. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6336. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6337. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6338. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6339. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6340. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6341. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6342. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6343. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6344. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6345. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6346. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6347. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6348. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6349. h.path.typ = c[h.path.typ]
  6350. }),
  6351. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6352. t.endlessLoop = h.warp.loop
  6353. }),
  6354. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6355. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6356. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6357. var m = f.addFolder("Long Warp Only");
  6358. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6359. h.warp.flySpeed = 0,
  6360. m.__controllers.forEach(function(e) {
  6361. e.updateDisplay()
  6362. })
  6363. }),
  6364. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6365. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6366. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6367. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6368. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6369. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6370. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6371. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6372. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6373. var v = n.addFolder("Warp Esoterica");
  6374. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6375. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6376. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6377. h.warp.minWarpTime = 0,
  6378. v.__controllers.forEach(function(e) {
  6379. e.updateDisplay()
  6380. })
  6381. }),
  6382. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6383. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6384. v.add(h.warp, "movementEasing", Object.keys(a));
  6385. var A = n.addFolder("Misc");
  6386. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6387. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6388. }),
  6389. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6390. i.cameras[s.PANORAMA].fov = h.insideFOV
  6391. }),
  6392. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6393. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6394. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6395. var y = n.addFolder("Navigation");
  6396. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6397. h.navigation.panoScores || e.panos.forEach(function(e) {
  6398. e.floor.remove(e.text3d),
  6399. e.text3d = null
  6400. })
  6401. }),
  6402. y.add(h.navigation, "mouseDirection"),
  6403. y.add(h.navigation, "filterStrictness", 0, 1),
  6404. y.add(h.navigation, "angleFactor", -60, 0),
  6405. y.add(h.navigation, "directionFactor", 1, 20),
  6406. y.add(h.navigation, "distanceFactor", -5, 5),
  6407. y.add(h.navigation, "optionalityFactor", .1, 10);
  6408. var C = n.addFolder("tags")
  6409. , I = C.addFolder("Tag Creation");
  6410. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6411. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6412. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6413. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6414. var E = C.addFolder("Visibility");
  6415. E.add(h.tags.visibility, "anyDistance"),
  6416. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6417. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6418. E.add(h.tags.visibility, "hideViaFloor"),
  6419. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6420. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6421. var b = C.addFolder("Disc Parameters");
  6422. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6423. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6424. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6425. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6426. }),
  6427. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6428. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6429. }),
  6430. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6431. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6432. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6433. var w = C.addFolder("Navigate");
  6434. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6435. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6436. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6437. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6438. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6439. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6440. var _ = n.addFolder("Debug");
  6441. _.add(h, "wireframe").onFinishChange(function() {
  6442. e.chunks.forEach(function(t) {
  6443. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6444. t.wireframeTwin.material.depthWrite = !1,
  6445. t.wireframeTwin.material.depthTest = !1,
  6446. t.wireframeTwin.material.opacity = .5,
  6447. t.wireframeTwin.material.transparent = !0),
  6448. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6449. })
  6450. }),
  6451. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6452. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6453. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6454. e.skybox.wireframe = null)
  6455. }),
  6456. _.add(h, "showSweeps").onFinishChange(function() {
  6457. e.setSweepVisibility(h.showSweeps)
  6458. }),
  6459. _.add(h, "showMesh").onFinishChange(function() {
  6460. e.chunks.forEach(function(e) {
  6461. e.visible = h.showMesh
  6462. })
  6463. }),
  6464. _.add(h, "showFloors").onFinishChange(function() {
  6465. e.floors.forEach(function(e) {
  6466. e.collider.children.forEach(function(e) {
  6467. e.material.visible = h.showFloors
  6468. })
  6469. })
  6470. }),
  6471. _.add(h, "showSkyboxes").onFinishChange(function() {
  6472. e.panos.forEach(function(e) {
  6473. e.skyboxMesh.visible = h.showSkyboxes
  6474. })
  6475. }),
  6476. _.add(h, "showNeighbors").onChange(function() {}),
  6477. _.add(e, "alpha", 0, 1)
  6478. }
  6479. var r = e("../lib/dat.gui")
  6480. , o = e("three")
  6481. , a = e("../util/easing")
  6482. , s = e("../enum/Viewmode")
  6483. , l = e("../enum/Colors")
  6484. , c = e("../enum/WarpStyle")
  6485. , h = e("../settings");
  6486. e("../tag/tag");
  6487. r.GUI.prototype.removeFolder = function(e) {
  6488. var t = this.__folders[e];
  6489. t && (t.close(),
  6490. this.__ul.removeChild(t.domElement.parentNode),
  6491. delete this.__folders[e],
  6492. this.onResize())
  6493. }
  6494. ,
  6495. t.exports.toggle = n
  6496. }
  6497. , {
  6498. "../enum/Colors": 19,
  6499. "../enum/Viewmode": 51,
  6500. "../enum/WarpStyle": 52,
  6501. "../lib/dat.gui": 93,
  6502. "../tag/tag": 123,
  6503. "../settings": 166,
  6504. "../util/easing": 186,
  6505. three: 217
  6506. }],
  6507. 64: [function(e, t, i) {
  6508. (function(i) {
  6509. "use strict";
  6510. function n(e, t, i, n) {
  6511. $(".gui-error .error-problem-text").text(e),
  6512. $(".gui-error .error-solution-text").text(t),
  6513. $(".gui-error .error-explanation").text(i),
  6514. $(".gui-error .error-actions").html(n),
  6515. $(window).resize(),
  6516. $(".gui-error").fadeIn(),
  6517. $("#bottom-logo").fadeIn()
  6518. }
  6519. function r(e) {
  6520. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  6521. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6522. s.isMobile() || $("[rel=tiletip]").tooltip({
  6523. placement: "bottom",
  6524. delay: {
  6525. show: 50,
  6526. hide: 0
  6527. },
  6528. trigger: "hover",
  6529. viewport: {
  6530. selector: "body",
  6531. padding: 10
  6532. }
  6533. })
  6534. }
  6535. function o() {
  6536. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6537. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6538. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6539. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6540. e.preventDefault(),
  6541. e.stopPropagation(),
  6542. r(" ")
  6543. })
  6544. }
  6545. function a(e) {
  6546. if ($("head title").text(c.pageTitle),
  6547. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6548. $("#gui-loading").fadeOut(250),
  6549. $("#quick-blackout").hide(),
  6550. l.track("showcase_error", {
  6551. error_key: e
  6552. }),
  6553. h.locale || h.init(),
  6554. "webgl-unsupported" === e)
  6555. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6556. else if ("webgl-ios" === e)
  6557. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6558. else if ("webgl-safari" === e)
  6559. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6560. else if ("webgl-generic" === e)
  6561. o();
  6562. else if ("missing-urls" === e)
  6563. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6564. else if ("loading-failed" === e)
  6565. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6566. else {
  6567. if ("loading-failed-maintenance" !== e)
  6568. return void d.error("Unhandled error: " + e);
  6569. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6570. }
  6571. }
  6572. var s = e("./../util/browser")
  6573. , l = e("./../analytics")
  6574. , c = e("./../settings")
  6575. , h = e("../localization/localize")
  6576. , u = e("./../util/logger")
  6577. , d = new u(i)
  6578. , p = '"https://support.port.com/hc/articles/208220058"';
  6579. t.exports.error = a
  6580. }
  6581. ).call(this, "/js/gui/error.js")
  6582. }
  6583. , {
  6584. "../localization/localize": 108,
  6585. "./../analytics": 4,
  6586. "./../settings": 166,
  6587. "./../util/browser": 182,
  6588. "./../util/logger": 189
  6589. }],
  6590. 65: [function(e, t, i) {
  6591. (function(i) {
  6592. "use strict";
  6593. function n() {
  6594. Ue = [],
  6595. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6596. Ue.push(".hideTarget", ".pinTop.right")
  6597. }
  6598. function r() {
  6599. for (var e in je)
  6600. if (je.hasOwnProperty(e)) {
  6601. var t = je[e];
  6602. if (!t.visible)
  6603. for (var i = 0; i < t.elements.length; i++)
  6604. $(t.elements[i]).hide()
  6605. }
  6606. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6607. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6608. n()
  6609. }
  6610. function o(e, t) {
  6611. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6612. $("#gui-zoomin").toggle(i),
  6613. $("#gui-zoomout").toggle(i)
  6614. }
  6615. function a() {
  6616. c(),
  6617. $(".pinBottom").toggleClass("open"),
  6618. $("#drawer").toggleClass("open"),
  6619. $(".footer").toggleClass("open"),
  6620. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6621. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6622. ie.resetDrawer()),
  6623. setTimeout(function() {
  6624. $("#pullTab").toggleClass("opened");
  6625. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6626. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6627. }
  6628. function s(e) {
  6629. var t;
  6630. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6631. t = e.position().top + e.outerHeight(),
  6632. e.attr("style", "display: none"));
  6633. var i = $("#player").outerHeight()
  6634. , n = i - 130;
  6635. return n < t + 25
  6636. }
  6637. function l(e) {
  6638. "touchstart" === e.type && e.preventDefault(),
  6639. e.stopPropagation()
  6640. }
  6641. function c() {
  6642. W && (W.reload(),
  6643. W.init())
  6644. }
  6645. function h(e) {
  6646. ne.show(e),
  6647. r()
  6648. }
  6649. function u(e) {
  6650. ne.progress(e)
  6651. }
  6652. function d(e, t, i) {
  6653. var n = t.player;
  6654. $("#gui-thumb").fadeOut(2500),
  6655. ne.hide(function() {
  6656. Ge = !1
  6657. }),
  6658. me.init(e, i),
  6659. de.finishSetup(Object.keys(e.tags).length),
  6660. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6661. var s = function() {
  6662. i.dismissExaminedTag(),
  6663. i.disableHovering()
  6664. };
  6665. Ae.on(ye.OPENED, s),
  6666. Ce.on(Me.OPENED, s),
  6667. he.on(ue.OPENED, s),
  6668. fe.on(ge.OPENED, s);
  6669. var l = i.enableHovering.bind(i);
  6670. if (Ae.on(ye.CLOSED, l),
  6671. Ce.on(Me.CLOSED, l),
  6672. he.on(ue.CLOSED, l),
  6673. fe.on(ge.CLOSED, l),
  6674. Q.labels.enabled && Object.keys(e.labels).length,
  6675. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6676. C(e.currentFloor, n.mode)),
  6677. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6678. r(),
  6679. o(t, t.player),
  6680. $("#gui").fadeIn(1500),
  6681. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6682. a(),
  6683. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6684. }, 2e3),
  6685. !K.isMobile())
  6686. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6687. $(c[h]).addClass("hasHover");
  6688. O(e),
  6689. de.setupToggling();
  6690. //xzw:
  6691. window.editHotPanel && editHotPanel();
  6692. //czj
  6693. navBorderRadius(e);
  6694. //czj 编辑界面
  6695. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6696. window.EditTools && new EditTools(n.sceneRenderer);
  6697. }
  6698. function navBorderRadius(e){
  6699. var pullTab = $("#pullTab"),
  6700. mobileRadius = {
  6701. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6702. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6703. },
  6704. topRadius = {
  6705. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6706. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6707. };
  6708. function BorderRadius(bottom,top){
  6709. $("#gui-modes-map > div:visible:last").css(bottom);
  6710. if(pullTab.is(':visible')){
  6711. $(".viewContainer > div:visible:first").css(top);
  6712. }else{
  6713. $("#gui-modes-map > div:visible:first").css(top);
  6714. }
  6715. }
  6716. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6717. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6718. }else{
  6719. BorderRadius(topRadius.bottom,topRadius.top);
  6720. }
  6721. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6722. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special){
  6723. window.specialScene && specialScene.special().afterImplement();
  6724. }
  6725. }
  6726. function p(e) {
  6727. e || (e = 0),
  6728. We = !1,
  6729. window.setTimeout(function() {
  6730. We || (ze = !0,
  6731. $("#gui-spinner").stop(!0, !0).show())
  6732. }
  6733. .bind(this), e)
  6734. }
  6735. function f() {
  6736. $("#gui-spinner").stop(!0, !0),
  6737. $("#gui-spinner").fadeOut(1e3),
  6738. We = !0,
  6739. ze = !1
  6740. }
  6741. function g(e, t) {
  6742. // $('#gui-modes-inside img').attr('src','images/inside1.png')
  6743. // $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6744. // $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6745. var i = e.mode
  6746. , n = t || e.currentPano;
  6747. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6748. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6749. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6750. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6751. Q.show360Views.enabled && !n.isAligned() ? (
  6752. $(".gui-floor").addClass("hidden"),
  6753. $("#gui-modes-outside").addClass("desktop-only")) : (
  6754. $(".gui-floor").removeClass("hidden"),
  6755. $("#gui-modes-outside").removeClass("desktop-only")),
  6756. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6757. Be = i,
  6758. $("#gui-modes-outside").addClass("hidden"),
  6759. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6760. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6761. setTimeout(()=>{
  6762. // console.log(1111111,$('#gui-modes-inside').attr('class'));
  6763. if($('#gui-modes-inside').attr('class')==='active'){
  6764. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6765. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6766. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6767. }
  6768. },500)
  6769. }
  6770. function m(e, t) {
  6771. // console.log(1111111);
  6772. var i = t.player;
  6773. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6774. l(e),
  6775. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6776. J.track("USER", {
  6777. event_type: "showcase_gui",
  6778. gui_action: "click_inside_mode_button"
  6779. }),
  6780. t.changeMode(_e.PANORAMA);
  6781. // console.log(333333);
  6782. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6783. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6784. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6785. }),
  6786. // $("#gui-modes-inside").on("click", function(e) {
  6787. // $('#gui-modes-inside img').attr('src','images/inside1.png')
  6788. // $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6789. // $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6790. // }),
  6791. $("#gui-modes-outside").find("a").on("click", function(e) {
  6792. l(e),
  6793. J.track("showcase_gui", {
  6794. gui_action: "click_outside_mode_button"
  6795. }),
  6796. t.changeMode(Be)
  6797. }),
  6798. $("#gui-modes-floorplan").on("click", function(e) {
  6799. l(e),
  6800. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6801. gui_action: "click_floorplan_mode_button"
  6802. }),
  6803. t.changeMode(_e.FLOORPLAN));
  6804. $('#gui-modes-inside img').attr('src','images/inside.png')
  6805. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6806. $('#gui-modes-floorplan img').attr('src','images/floor1.png')
  6807. }),
  6808. $("#gui-modes-dollhouse").on("click", function(e) {
  6809. l(e),
  6810. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6811. gui_action: "click_dollhouse_mode_button"
  6812. }),
  6813. t.changeMode(_e.DOLLHOUSE));
  6814. $('#gui-modes-inside img').attr('src','images/inside.png')
  6815. $('#gui-modes-dollhouse img').attr('src','images/dollhouse1.png')
  6816. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6817. })
  6818. }
  6819. function v(e, t) {
  6820. function i() {
  6821. document.getElementById("vr").classList.remove("hidden"),
  6822. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6823. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6824. $(".improper-embed").toggleClass("hidden", !1),
  6825. r())
  6826. }, function(e) {
  6827. r()
  6828. }) : r()
  6829. }
  6830. function n(i) {
  6831. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6832. Ie.init(e.data, t, i, q),
  6833. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6834. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6835. }
  6836. function r() {
  6837. De.info("WebVR support not found, VR button activates native app VR modal"),
  6838. Ae.init(e.data, q),
  6839. Ae.on(ye.OPENED, function() {
  6840. var e = document.getElementById("vr-modal");
  6841. return function() {
  6842. Ze("vr"),
  6843. le.open(e)
  6844. }
  6845. }()),
  6846. Ae.on(ye.CLOSED, le.reset)
  6847. }
  6848. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6849. /*********************** 方奕卓 VR功能事件监听 ********************/
  6850. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6851. switch (Q.vr.option) {
  6852. case Pe.CONTEXTUAL:
  6853. i();
  6854. break;
  6855. case Pe.ANDROID:
  6856. K.detectAndroid() && i();
  6857. break;
  6858. case Pe.NONE:
  6859. }
  6860. }
  6861. }
  6862. function A(e, t) {
  6863. $("#play").on("mousedown touchstart", function(e) {
  6864. l(e);
  6865. Ze("tour");
  6866. ve.play();
  6867. J.trackAlways("showcase_gui", {
  6868. gui_action: "play_highlights"
  6869. })
  6870. }),
  6871. window.startAndPlay = function(e) {
  6872. // l(e);
  6873. Ze("tour");
  6874. ve.play();
  6875. J.trackAlways("showcase_gui", {
  6876. gui_action: "play_highlights"
  6877. })
  6878. };
  6879. $("#pause").on("mousedown touchstart", function(e) {
  6880. l(e),
  6881. ve.pause(),
  6882. J.trackAlways("showcase_gui", {
  6883. gui_action: "pause_highlights"
  6884. })
  6885. }),
  6886. $("#gui-zoomin").find("a").on("click", function(e) {
  6887. l(e),
  6888. t.player.zoomInIncrementally()
  6889. }),
  6890. $("#gui-zoomout").find("a").on("click", function(e) {
  6891. l(e),
  6892. t.player.zoomOutIncrementally()
  6893. })
  6894. }
  6895. function y(e, t) {
  6896. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6897. if(getQueryVariable('m') === '372') continue;
  6898. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6899. $(".gui-floor").find(".container").prepend(r)
  6900. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6901. }
  6902. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6903. i.on("click", function(e) {
  6904. l(e),
  6905. Ze("floor"),
  6906. i.toggleClass("open")
  6907. }),
  6908. $(".floorChoice").on("click", function(e) {
  6909. l(e);
  6910. var n = $(this).data("index");
  6911. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6912. t.player.gotoFloor(n),
  6913. J.track("showcase_gui", {
  6914. gui_action: "click_floor_select_button",
  6915. interaction_source: "gui"
  6916. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6917. Ze("move"),
  6918. t.allFloors(),
  6919. J.track("showcase_gui", {
  6920. gui_action: "click_toggle_all_floors_button",
  6921. interaction_source: "gui"
  6922. })),
  6923. i.removeClass("open")
  6924. })
  6925. }
  6926. function C(e, t) {
  6927. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? ($(".allFloorBtn").show(),$(".gui-floor-icon").hide(),$(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),$(".gui-floor-icon").show(),$(".gui-floor-title").hide()),
  6928. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6929. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6930. $(".floorChoice").removeClass("active"),
  6931. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6932. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6933. $(".floorChoice").removeClass("active"),
  6934. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6935. }
  6936. function I(e) {
  6937. return e.describe().inTransition
  6938. }
  6939. function b(e, t, i) {
  6940. Fe = e.heroLocations.length;
  6941. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6942. , r = 100 / Fe + "%"
  6943. , o = $("#thumb-container")
  6944. , a = $("#progressBar");
  6945. $("#status").find(".totalSteps").text(Fe);
  6946. for (var s = 0; s < Fe; s++) {
  6947. var c = e.heroLocations[s]
  6948. , h = $(n);
  6949. var thumbUrl
  6950. if(c.heroLocations){//有子项,选第一张截图
  6951. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6952. }else{
  6953. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6954. }
  6955. h.attr("data-index", s)
  6956. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6957. if (c.name) {
  6958. var u = $('<div class="overlay"></div>').text(c.name);
  6959. h.prepend(u)
  6960. }
  6961. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6962. var d = e.panos.get(c.panoId)
  6963. , p = d && !d.isAligned()
  6964. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6965. h.prepend(f)
  6966. }
  6967. o.append(h),
  6968. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6969. }
  6970. j = 144 * Fe,
  6971. Y = 111 * Fe,
  6972. $(".thumbImg").on("mouseover", function() {
  6973. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6974. }),
  6975. $(".thumbImg").on("mouseout", function() {
  6976. t.clearPath()
  6977. }),
  6978. $(".thumbImg").on("click", function(e) {
  6979. l(e);
  6980. var i = $(this);
  6981. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6982. J.trackAlways("showcase_gui", {
  6983. gui_action: "click_highlight"
  6984. }),
  6985. t.goToHighlight([i.data("index"),0])//改
  6986. }),
  6987. $(".previous").find("a").on("click", function(e) {
  6988. l(e),
  6989. J.trackAlways("showcase_gui", {
  6990. gui_action: "prev_highlight"
  6991. }),
  6992. t.prevHighlight()
  6993. }),
  6994. $(".next").find("a").on("click", function(e) {
  6995. l(e),
  6996. J.trackAlways("showcase_gui", {
  6997. gui_action: "next_highlight"
  6998. }),
  6999. t.nextHighlight()
  7000. }),
  7001. $("#drawer").on("mouseleave", function(e) {
  7002. l(e);
  7003. var t;
  7004. try {
  7005. t = new MouseEvent("mouseup",{
  7006. clientX: e.clientX,
  7007. clientY: e.clientY,
  7008. screenX: e.screenX,
  7009. screenY: e.screenY
  7010. })
  7011. } catch (i) {
  7012. t = document.createEvent("MouseEvents"),
  7013. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  7014. }
  7015. document.dispatchEvent(t)
  7016. }),
  7017. W = new Sly($("#scrollFrame"),{
  7018. horizontal: !0,
  7019. itemNav: "centered",
  7020. smart: !0,
  7021. scrollTrap: !0,
  7022. scrollBy: 1,
  7023. mouseDragging: !0,
  7024. touchDragging: !0,
  7025. speed: 300,
  7026. dragHandle: !0,
  7027. dynamicHandle: !0,
  7028. clickBar: !0,
  7029. scrollBar: $("#scroller"),
  7030. activateOn: null
  7031. }).init(),
  7032. W.on("active", function(e, t) {
  7033. Ve = t,
  7034. Ze("tour"),
  7035. $(".step").removeClass("active"),
  7036. $("#status").find(".curIdx").text(t + 1);
  7037. for (var i = 0; i <= t; i++)
  7038. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  7039. }),
  7040. w()
  7041. }
  7042. function w() {
  7043. var e = $("#player").width() - 20
  7044. , t = $("#scroller")
  7045. , i = $("#drawer")
  7046. , n = $(".pinBottom");
  7047. if ($("#player").width() < 488 || $("#player").height() < 488)
  7048. t.addClass("hidden"),
  7049. i.addClass("noScroll"),
  7050. n.addClass("noScroll");
  7051. else {
  7052. var r = j > e
  7053. , o = !i.hasClass("noScroll")
  7054. , a = r !== o;
  7055. a && (t.toggleClass("hidden"),
  7056. i.toggleClass("noScroll"),
  7057. n.toggleClass("noScroll"))
  7058. }
  7059. }
  7060. function _(e) {
  7061. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  7062. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  7063. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  7064. }
  7065. function T(e) {
  7066. function t(t, i) {
  7067. return !!e.player_options[t] && e[i || t]
  7068. }
  7069. $(".model-title").text(e.name);
  7070. var i = Q.pageTitle;
  7071. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7072. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  7073. document.title = i ,
  7074. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7075. delay: {
  7076. show: 50,
  7077. hide: 0
  7078. },
  7079. trigger: "hover",
  7080. html: !1,
  7081. viewport: {
  7082. selector: "body",
  7083. padding: 10
  7084. }
  7085. }),
  7086. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7087. // 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"),
  7088. de.populate({
  7089. name: t("model_name", "name"),
  7090. coBrand: t("presented_by"),
  7091. description: t("model_summary", "summary") || "暂无内容",
  7092. contactName: t("contact_name"),
  7093. address: t("address"),
  7094. phone: t("contact_phone"),
  7095. formattedPhone: e.formatted_contact_phone,
  7096. email: t("contact_email"),
  7097. url: t("external_url"),
  7098. socialSharing: e.enable_social_sharing && e.is_public
  7099. })
  7100. }
  7101. function x(e, t, i, n, r, o) {
  7102. function a() {
  7103. o.setLoadingStartTime(),
  7104. H(),
  7105. r ? (re.showMessage(t, i, je.coBrand.visible),
  7106. l()) : h(l)
  7107. }
  7108. var s = $.Deferred()
  7109. , l = s.resolve.bind(s);
  7110. return Ge = !0,
  7111. O(e),
  7112. e.data.player_options && _(e.data.player_options),
  7113. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  7114. Re.localizeGUI(),
  7115. T(e.data),
  7116. r || $(".quick").addClass("hidden"),
  7117. //e.data.image && !r && E(e.data.image),
  7118. n ? (J.impression(),
  7119. a()) : (o.setWaitingStartTime(),
  7120. oe.show(r, a)),
  7121. s
  7122. }
  7123. function S(e, t, i, n, r, a, s) {
  7124. q = s,
  7125. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  7126. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  7127. ae.init(),
  7128. re.init(e, a),
  7129. Oe.init(e, t, n),
  7130. $(".icon").on("mouseover", function() {
  7131. t.player && t.player.reticule.hide()
  7132. }),
  7133. m(e, t),
  7134. A(e, t),
  7135. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(MP_PREFETCHED_MODELDATA.name/* e.data.name */),
  7136. Ce.on(Me.OPENED, function() {
  7137. var e = document.getElementById("share-modal");
  7138. return function() {
  7139. Ze("share"),
  7140. le.open(e)
  7141. }
  7142. }()),
  7143. Ce.on(Me.CLOSED, le.reset)),
  7144. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  7145. je.tourControls.visible = !1),
  7146. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  7147. z(),
  7148. g(i),
  7149. v(e, r),
  7150. e.on("floor.changed", C),
  7151. e.on("waiting", R.bind(this, e)),
  7152. e.on("waiting-done", P.bind(this, e)),
  7153. i.on(xe.ModeChanged, function(e, n) {
  7154. g(i),
  7155. o(t, i),
  7156. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  7157. he.updateMode(n)
  7158. }),
  7159. n.on(Se.Move, Ze.bind(this, "move")),
  7160. i.on(xe.Ready, function() {
  7161. ie.init(n, i, i.tagManager, t),
  7162. i.on(xe.ModeChanged, function(e, t) {
  7163. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  7164. })
  7165. }),
  7166. i.on(xe.PanoChosen, function(e, t) {
  7167. g(i, t),
  7168. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7169. }),
  7170. le.on(ce.CLOSE, function(e) {
  7171. switch (e) {
  7172. case "vr-modal":
  7173. Ae.dismiss();
  7174. break;
  7175. case "share-modal":
  7176. Ce.hide();
  7177. break;
  7178. case "terms-modal":
  7179. fe.hide()
  7180. }
  7181. });
  7182. var l = $("#play").eq(0)
  7183. , c = $("#pause").eq(0)
  7184. , h = $(".pinBottom").toArray()
  7185. , u = $("#drawer").eq(0)
  7186. , d = $("#playHead").eq(0)
  7187. , p = $("#progressBar").eq(0)
  7188. , f = $("#thumb-container").eq(0)
  7189. , y = f.children()
  7190. , I = p.children();
  7191. t.on("update.controls", function() {
  7192. var n = t.describe();
  7193. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  7194. c.show()),
  7195. n.tourInProgress && (h.forEach(function(e) {
  7196. e.classList.add("playing")
  7197. }),
  7198. u.addClass("playing"),
  7199. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  7200. c.hide()),
  7201. n.tourInProgress || (ve.stopTour(),
  7202. h.forEach(function(e) {
  7203. e.classList.remove("playing")
  7204. }),
  7205. u.removeClass("playing"),
  7206. d.removeClass("playing")));
  7207. var r, a, s;
  7208. if (null !== n.currentItem) {
  7209. var p, f;
  7210. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  7211. n.onTheBus ? (p = "active",
  7212. f = "recent") : (f = "active",
  7213. p = "recent");
  7214. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  7215. for (r = 0; r < e.heroLocations.length; r += 1)
  7216. s = y.eq(r),
  7217. a = I.eq(r),
  7218. s.removeClass(f),
  7219. a.removeClass(f),
  7220. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7221. a.addClass(p),
  7222. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7223. a.addClass(p)) : (s.removeClass(p),
  7224. a.removeClass(p))
  7225. } else
  7226. for (r = 0; r < e.heroLocations.length; r += 1)
  7227. s = y.eq(r),
  7228. a = I.eq(r),
  7229. s.removeClass("active recent"),
  7230. a.removeClass("active recent");
  7231. o(t, i)
  7232. }),
  7233. document.addEventListener("keydown", function(n) {
  7234. switch (J.updateInteraction(Se.InteractionKey),
  7235. n.which) {
  7236. case we.ZERO:
  7237. Q.debug && e.toggleAlpha();
  7238. break;
  7239. case we.NINE:
  7240. Q.debug && se.toggle();
  7241. break;
  7242. case we.ONE:
  7243. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7244. break;
  7245. case we.TWO:
  7246. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7247. break;
  7248. case we.THREE:
  7249. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7250. break;
  7251. case we.FOUR:
  7252. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7253. break;
  7254. case we.SPACE:
  7255. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7256. break;
  7257. case we.RETURN:
  7258. Q.debug && e.toggleExplodeUp();
  7259. break;
  7260. case we.P:
  7261. k();
  7262. break;
  7263. case we.U:
  7264. B();
  7265. break;
  7266. case we.X:
  7267. Q.debug && e.toggleExplode();
  7268. break;
  7269. case we.PLUSEQUALS:
  7270. t.player.activatePersistentZooming(!0),
  7271. ie.hideUi();
  7272. break;
  7273. case we.DASHUNDERSCORE:
  7274. t.player.activatePersistentZooming(!1),
  7275. ie.hideUi();
  7276. break;
  7277. case we.SEVEN:
  7278. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7279. break;
  7280. case we.EIGHT:
  7281. t.player.decreaseZoomSpeed();
  7282. break;
  7283. case we.NINE:
  7284. t.player.increaseZoomSpeed()
  7285. }
  7286. return i && i.reticule.hide(),
  7287. !0
  7288. }
  7289. .bind(this)),
  7290. document.addEventListener("keyup", function(e) {
  7291. switch (e.which) {
  7292. case we.PLUSEQUALS:
  7293. t.player.deactivatePersistentZooming();
  7294. break;
  7295. case we.DASHUNDERSCORE:
  7296. t.player.deactivatePersistentZooming()
  7297. }
  7298. }
  7299. .bind(this)),
  7300. F(e),
  7301. L(e, t.player),
  7302. M(i),
  7303. te.setAutoPlay(e.heroCount()),
  7304. he.init(i, a.mode),
  7305. he.on(ue.OPENED, Ze.bind(this, "help")),
  7306. fe.init(),
  7307. fe.on(ge.OPENED, function() {
  7308. var e = document.getElementById("terms-modal");
  7309. return function() {
  7310. Ze("terms"),
  7311. le.open(e)
  7312. }
  7313. }()),
  7314. fe.on(ge.CLOSED, le.reset),
  7315. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7316. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7317. Q.profiling.enabled && se.show(),
  7318. ve.init(t)
  7319. }
  7320. function M(e) {
  7321. var t = function(e, t) {
  7322. $(e).find("a").each(function(e, i) {
  7323. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7324. i.style.pointerEvents = t ? "auto" : "none"
  7325. })
  7326. }
  7327. , i = function() {
  7328. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7329. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7330. };
  7331. e.on(Ne.ZoomMax, function() {
  7332. t("#gui-zoomin", !1),
  7333. t("#gui-zoomout", !0)
  7334. }),
  7335. e.on(Ne.ZoomMin, function() {
  7336. t("#gui-zoomin", !0),
  7337. t("#gui-zoomout", !1)
  7338. }),
  7339. e.on(Ne.ZoomIn, function() {
  7340. t("#gui-zoomout", !0)
  7341. }),
  7342. e.on(Ne.ZoomOut, function() {
  7343. t("#gui-zoomin", !0)
  7344. }),
  7345. i()
  7346. }
  7347. function R(e) {
  7348. O(e)
  7349. }
  7350. function P(e) {
  7351. O(e)
  7352. }
  7353. function O(e) {
  7354. var t = e.waitQueue.length;
  7355. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7356. }
  7357. function L(e, t) {
  7358. He = {
  7359. gui: null,
  7360. visible: !1,
  7361. model: e,
  7362. player: t
  7363. }
  7364. }
  7365. function D(e, t) {
  7366. function i() {
  7367. var i = t.toJSON();
  7368. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7369. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7370. }
  7371. var n = {}
  7372. , r = new Le.GUI({
  7373. autoPlace: !0,
  7374. width: "60%"
  7375. });
  7376. i(),
  7377. t.on(xe.ViewChanged, i),
  7378. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7379. r.domElement.id = "datLinks";
  7380. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7381. return o.forEach(function(e) {
  7382. if (!K.detectSafari()) {
  7383. var t = document.createElement("button");
  7384. t.classList.add("btn-deep-link"),
  7385. t.innerText = Re.MENU_COPY,
  7386. e.nextSibling.appendChild(t);
  7387. var i = function() {
  7388. alert(Re.LINK_ALERT_COPY),
  7389. t.hide()
  7390. };
  7391. t.addEventListener("click", function(e) {
  7392. try {
  7393. var t = e.target.parentNode.childNodes[0];
  7394. t.select();
  7395. var n = document.execCommand("copy");
  7396. t.blur(),
  7397. n || i()
  7398. } catch (e) {
  7399. i()
  7400. }
  7401. })
  7402. }
  7403. }),
  7404. $(r.__closeButton).hide(),
  7405. r
  7406. }
  7407. function N(e) {
  7408. He.gui || (He.gui = D(He.model, He.player)),
  7409. He.visible = e,
  7410. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7411. }
  7412. function B() {
  7413. N(!He.visible)
  7414. }
  7415. function F(e) {
  7416. ke = {
  7417. gui: null,
  7418. visible: !1,
  7419. model: e
  7420. }
  7421. }
  7422. function V(e) {
  7423. var t = new Le.GUI;
  7424. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7425. e.setSweepVisibility(Q.showSweeps)
  7426. }),
  7427. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7428. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7429. Q.transition.flySpeed = 0,
  7430. t.__controllers.forEach(function(e) {
  7431. e.updateDisplay()
  7432. })
  7433. }),
  7434. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7435. $(t.__closeButton).hide(),
  7436. t
  7437. }
  7438. function U(e) {
  7439. ke.gui || (ke.gui = V(ke.model)),
  7440. ke.visible = e,
  7441. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7442. }
  7443. function k() {
  7444. U(!ke.visible)
  7445. }
  7446. function H() {
  7447. function e(e) {
  7448. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7449. }
  7450. $("body").css("touch-action", "none"),
  7451. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7452. // e.preventDefault()
  7453. });
  7454. var t = document.getElementById("terms-text")
  7455. , i = document.getElementById("more-help-wrapper")
  7456. , n = (document.getElementById("navigation-help-wrapper"),
  7457. document.getElementById("help-dialog"),
  7458. document.getElementById("tag-billboards"));
  7459. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7460. document.body.addEventListener("DOMMouseScroll", e)),
  7461. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7462. e.stopPropagation()
  7463. })
  7464. }
  7465. function G(e, t) {
  7466. for (var i = []; e; )
  7467. i.push(e),
  7468. e = e.parentNode;
  7469. for (; t && i.indexOf(t) === -1; )
  7470. t = t.parentNode;
  7471. return t
  7472. }
  7473. function z() {
  7474. var e, t = function(t) {
  7475. e = 0 === t.button || 1 === t.which ? t.target : null
  7476. }, i = function(t) {
  7477. e !== t.target && (e = G(e, t.target));
  7478. var i = document.getElementById("gui-parent");
  7479. if (G(i, e) !== i && (e = null),
  7480. e) {
  7481. var n;
  7482. try {
  7483. n = new MouseEvent("click",t)
  7484. } catch (e) {
  7485. n = document.createEvent("MouseEvents"),
  7486. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  7487. }
  7488. n.syntheticClick = !0,
  7489. e.dispatchEvent(n),
  7490. e = null
  7491. }
  7492. };
  7493. document.body.addEventListener("mousedown", t, !0),
  7494. document.body.addEventListener("mouseup", i, !0),
  7495. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7496. e.syntheticClick || (e.stopPropagation(),
  7497. "A" === e.target.nodeName && e.preventDefault())
  7498. }, !0)
  7499. }
  7500. var W, j, Y, X, Z, q, K = (e("three"),
  7501. e("../util/ajax"),
  7502. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7503. e("../util/camera"),
  7504. e("../util/logger")), te = (e("../objects/Snapshot"),
  7505. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  7506. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7507. e("../enum/PathDisplayMode"),
  7508. e("../enum/DirectorEvents"),
  7509. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7510. e("../enum/WarpStyle"),
  7511. e("../enum/AlignmentType"),
  7512. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7513. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7514. coBrand: {
  7515. visible: !0,
  7516. elements: [".co-brand", "#loaderCoBrand"]
  7517. },
  7518. help: {
  7519. visible: !0,
  7520. elements: [".nav-help", "#nav-help"]
  7521. },
  7522. tourControls: {
  7523. visible: !0,
  7524. elements: [".next", ".previous", "#play"]
  7525. },
  7526. highlight: {
  7527. visible: !0,
  7528. elements: ["#drawer", "#pullTab"]
  7529. },
  7530. share: {
  7531. visible: !0,
  7532. elements: [".socialButton", "#share"]
  7533. },
  7534. fullScreen: {
  7535. visible: !0,
  7536. elements: ["#gui-fullscreen"]
  7537. },
  7538. floors: {
  7539. visible: !0,
  7540. elements: [".gui-floor"]
  7541. }
  7542. }, Ye = function() {
  7543. var e = document.getElementById("drawer");
  7544. return function() {
  7545. $("#player").height() < 400 && e.classList.contains("open") && a()
  7546. }
  7547. }(), Xe = function() {
  7548. var e = document.getElementById("meta-info");
  7549. return function() {
  7550. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7551. }
  7552. }(), Ze = function(e) {
  7553. function t() {
  7554. u.classList.contains("expand") && de.toggleMeta(!0)
  7555. }
  7556. function i() {
  7557. fe.hide()
  7558. }
  7559. function n() {
  7560. he.close()
  7561. }
  7562. function r() {
  7563. Ae.dismiss()
  7564. }
  7565. function o() {
  7566. p.hasClass("open") && a(!0)
  7567. }
  7568. function l() {
  7569. Ce.hide()
  7570. }
  7571. function c() {
  7572. f.hasClass("open") && f.removeClass("open")
  7573. }
  7574. function h() {
  7575. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7576. }
  7577. var u = document.getElementById("meta-info")
  7578. , d = document.getElementById("interaction-modal")
  7579. , p = $("#drawer").eq(0)
  7580. , f = $(".gui-floor").eq(0)
  7581. , g = $(".vr-popup").eq(0);
  7582. return function(e) {
  7583. switch (e) {
  7584. case "info":
  7585. i(),
  7586. n(),
  7587. Ye(),
  7588. l(),
  7589. c(),
  7590. r(),
  7591. h();
  7592. break;
  7593. case "terms":
  7594. t(),
  7595. n(),
  7596. o(),
  7597. l(),
  7598. c(),
  7599. r(),
  7600. h();
  7601. break;
  7602. case "help":
  7603. t(),
  7604. i(),
  7605. l(),
  7606. c(),
  7607. r(),
  7608. h();
  7609. break;
  7610. case "vr":
  7611. t(),
  7612. i(),
  7613. l(),
  7614. c(),
  7615. n(),
  7616. h(),
  7617. s(g) && o();
  7618. break;
  7619. case "highlights":
  7620. Xe(),
  7621. i(),
  7622. l(),
  7623. c();
  7624. break;
  7625. case "share":
  7626. t(),
  7627. i(),
  7628. n(),
  7629. c(),
  7630. r(),
  7631. h();
  7632. break;
  7633. case "floor":
  7634. i(),
  7635. l(),
  7636. r();
  7637. break;
  7638. case "view":
  7639. c(),
  7640. l(),
  7641. i(),
  7642. r();
  7643. break;
  7644. case "tour":
  7645. i(),
  7646. l(),
  7647. c(),
  7648. r();
  7649. break;
  7650. case "move":
  7651. i(),
  7652. l(),
  7653. c(),
  7654. r();
  7655. break;
  7656. case "resize":
  7657. t(),
  7658. Ye(),
  7659. c();
  7660. break;
  7661. case "tag":
  7662. i(),
  7663. n(),
  7664. l(),
  7665. c(),
  7666. r()
  7667. }
  7668. }
  7669. }();
  7670. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7671. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7672. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7673. setTimeout(function() {
  7674. $(".icon:visible").hide().show(0)
  7675. }, 100)
  7676. }),
  7677. $("#gui-fullscreen").find("a").on("click", function(e) {
  7678. l(e),
  7679. K.requestFullscreen($("body")[0]),
  7680. J.track("showcase_gui", {
  7681. gui_action: "click_enter_fullscreen",
  7682. interaction_source: "gui"
  7683. })
  7684. //czj
  7685. //W.reload()
  7686. }),
  7687. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7688. l(e),
  7689. K.exitFullscreen(),
  7690. J.track("showcase_gui", {
  7691. gui_action: "click_exit_fullscreen",
  7692. interaction_source: "gui"
  7693. })
  7694. })
  7695. $(window).on("resize", function(e) {
  7696. var t = e.target.innerHeight
  7697. , i = e.target.innerWidth;
  7698. t === X && i === Z || (je.highlight.visible && w(),
  7699. Ze("resize"),
  7700. $(".pinTop.right").removeClass("hideUnderMeta"),
  7701. c(),
  7702. X = t,
  7703. Z = i)
  7704. }).resize(),
  7705. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7706. $("#pullTab").on("click", function(e) {
  7707. l(e),
  7708. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7709. gui_action: "hide_highlight_reel"
  7710. }),
  7711. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7712. gui_action: "show_highlight_reel"
  7713. }),
  7714. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7715. a()
  7716. });
  7717. /***********************方奕卓 热点列表事件监听 ************************/
  7718. if(window.MP_PREFETCHED_MODELDATA.showHotListSta) {
  7719. $('#hotList').css('display', '');
  7720. $('#hotList').on('click',function(e){
  7721. l(e);
  7722. var hotList = $('#hotListWrap')[0];
  7723. var isActive = hotList.classList.contains('hotListActive');
  7724. if(isActive){
  7725. hotList.classList.remove('hotListActive');
  7726. this.classList.remove('active')
  7727. }else{
  7728. hotList.classList.add('hotListActive');
  7729. this.classList.add('active')
  7730. }
  7731. }),
  7732. $('#hotListContent ul').on('mouseover', function(e){
  7733. l(e);
  7734. var target = e.target;
  7735. var hotList = document.getElementById('hotListWrap');
  7736. if(target.tagName === 'SPAN'){
  7737. var targetParent = target.parentElement.parentElement;
  7738. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7739. hotList.style.width = target.offsetWidth + 116 + 'px';
  7740. }else{
  7741. hotList.style.width = '';
  7742. }
  7743. }else if(target.tagName === 'LI'){
  7744. var targetParent = target.parentElement;
  7745. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7746. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7747. }else{
  7748. hotList.style.width = ''
  7749. }
  7750. }else {
  7751. hotList.style.width = '';
  7752. }
  7753. });
  7754. $('#hotListContent ul').on('click', function(e){
  7755. l(e);
  7756. this.preElem && this.preElem.classList.remove('active');
  7757. if(e.target.tagName === 'SPAN'){
  7758. e.target.parentElement.classList.add('active');
  7759. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7760. this.preElem = e.target.parentElement;
  7761. }else{
  7762. e.target.classList.add('active');
  7763. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7764. this.preElem = e.target;
  7765. }
  7766. })
  7767. $('#hotListClose').on('click', function(e){
  7768. l(e);
  7769. var hotList = $('#hotListWrap')[0];
  7770. hotList.classList.remove('hotListActive');
  7771. $('#hotListContent ul .active').removeClass('active');
  7772. $('#hotList')[0].classList.remove('active')
  7773. })
  7774. }
  7775. /*****************************************************************/
  7776. $("#more-menu-button").on("click", function(e) {
  7777. l(e);
  7778. var t = $("#more-menu");
  7779. t.toggleClass("open")
  7780. }),
  7781. t.exports.init = S,
  7782. t.exports.startLoading = x,
  7783. t.exports.endLoading = d,
  7784. t.exports.onProgress = u
  7785. }
  7786. ).call(this, "/js/gui/gui.js")
  7787. }
  7788. , {
  7789. "../analytics": 4,
  7790. "../controls/serializer": 14,
  7791. "../enum/AlignmentType": 17,
  7792. "../enum/BlackoutStyle": 18,
  7793. "../enum/ControlEvents": 21,
  7794. "../enum/DirectorEvents": 23,
  7795. "../enum/Keys": 30,
  7796. "../enum/PathDiscardMode": 38,
  7797. "../enum/PathDisplayMode": 39,
  7798. "../enum/PlayerEvents": 40,
  7799. "../enum/VROption": 47,
  7800. "../enum/Vectors": 50,
  7801. "../enum/Viewmode": 51,
  7802. "../enum/WarpStyle": 52,
  7803. "../enum/ZoomEvents": 53,
  7804. "../lib/dat.gui": 93,
  7805. "../localization/localize": 108,
  7806. "../tag/Media/MediaEvent": 131,
  7807. "../objects/Snapshot": 153,
  7808. "../settings": 166,
  7809. "../util/ajax": 181,
  7810. "../util/browser": 182,
  7811. "../util/camera": 183,
  7812. "../util/logger": 189,
  7813. "../util/showcase": 193,
  7814. "../util/transitions": 195,
  7815. "./closer/ModalCloserEvent": 61,
  7816. "./closer/modalCloser": 62,
  7817. "./help/HelpEvent": 66,
  7818. "./help/help": 67,
  7819. "./helpManager": 68,
  7820. "./immersiveMode": 69,
  7821. "./konami": 70,
  7822. "./landingScreen": 71,
  7823. "./loadingScreen": 72,
  7824. "./memoryUsage": 73,
  7825. "./playButton": 74,
  7826. "./populateModal": 75,
  7827. "./sharing/ShareEvents": 76,
  7828. "./sharing/modal": 77,
  7829. "./terms/TermsEvent": 78,
  7830. "./terms/terms": 79,
  7831. "./title/TitleEvents": 80,
  7832. "./title/tagToggle": 81,
  7833. "./title/titleBar": 82,
  7834. "./tourInteraction": 84,
  7835. "./vr/vrEvent": 85,
  7836. "./vr/vrModal": 87,
  7837. "./webvr/WebVrEvent": 88,
  7838. "./webvr/webVRgui": 89,
  7839. three: 217
  7840. }],
  7841. 66: [function(e, t, i) {
  7842. "use strict";
  7843. t.exports = Object.freeze({
  7844. OPENED: "help.opened",
  7845. CLOSED: "help.closed"
  7846. })
  7847. }
  7848. , {}],
  7849. 67: [function(e, t, i) {
  7850. "use strict";
  7851. function n() {
  7852. g.on("click", function(e) {
  7853. if (S && S !== l.TRANSITIONING) {
  7854. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7855. t && !M ? R.close() : r()
  7856. }
  7857. }),
  7858. w.on("click", function(e) {
  7859. R.close()
  7860. }),
  7861. E.on("click", function(e) {
  7862. S && S !== l.TRANSITIONING && (s(),
  7863. o())
  7864. }),
  7865. b.on("click", function(e) {
  7866. s(),
  7867. a()
  7868. })
  7869. }
  7870. function r() {
  7871. S && S !== l.TRANSITIONING && (M = !0,
  7872. setTimeout(function() {
  7873. M = !1
  7874. }, d.help.modalStayDuration),
  7875. R.emit(h.OPENED),
  7876. m.addClass("open " + S),
  7877. g.addClass("open"),
  7878. s(),
  7879. o(),
  7880. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7881. y.classList.add("fadeIn"))
  7882. }
  7883. function o() {
  7884. E.addClass("underline-tab"),
  7885. u.fill(_, c.NAVIGATION, S),
  7886. m.addClass(S)
  7887. }
  7888. function a() {
  7889. b.addClass("underline-tab"),
  7890. u.fill(T, c.MORE_HELP),
  7891. m.addClass("more-help")
  7892. }
  7893. function s(e, t) {
  7894. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7895. I.forEach(function(e) {
  7896. e.classList.remove("underline-tab")
  7897. })
  7898. }
  7899. var l = e("../../enum/Viewmode")
  7900. , c = e("../../enum/HelpModalType")
  7901. , h = e("./HelpEvent")
  7902. , u = (e("../helpManager"),
  7903. e("./../populateModal"))
  7904. , d = e("../../settings")
  7905. , p = e("../../util/common")
  7906. , f = e("events").EventEmitter
  7907. , g = $(".footer-help").eq(0)
  7908. , m = $("#help-dialog").eq(0)
  7909. , v = document.querySelector("#quick-logo")
  7910. , A = document.querySelector("#loaderCoBrand")
  7911. , y = document.querySelector("#help-dialog")
  7912. , C = document.querySelector(".footer")
  7913. , I = $(".help-tabs").children().toArray()
  7914. , E = $(".navigation-tab").eq(0)
  7915. , b = $(".more-help-tab").eq(0)
  7916. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7917. m.find(".close").eq(0))
  7918. , _ = m.find(".interactions").toArray()
  7919. , T = m.find(".ui-instructions").toArray()
  7920. , x = l.PANORAMA
  7921. , S = l.PANORAMA
  7922. , M = !1
  7923. , R = {
  7924. init: function(e, t) {
  7925. S = t,
  7926. x = t,
  7927. [y, A, v, C].forEach(function(e) {
  7928. e.classList.add(u.deviceType)
  7929. }),
  7930. n()
  7931. },
  7932. close: function() {
  7933. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7934. g.removeClass("open"),
  7935. m.removeClass("open"),
  7936. y.classList.contains("fadeIn"))) {
  7937. y.classList.remove("fadeIn");
  7938. var e = S === l.TRANSITIONING ? x : S;
  7939. u.clear(_, c.NAVIGATION, e)
  7940. }
  7941. },
  7942. updateMode: function(e) {
  7943. x = S,
  7944. S = e
  7945. }
  7946. };
  7947. p.extendObject(R, f.prototype),
  7948. t.exports = R
  7949. }
  7950. , {
  7951. "../../enum/HelpModalType": 28,
  7952. "../../enum/Viewmode": 51,
  7953. "../../settings": 166,
  7954. "../../util/common": 185,
  7955. "../helpManager": 68,
  7956. "./../populateModal": 75,
  7957. "./HelpEvent": 66,
  7958. events: 202
  7959. }],
  7960. 68: [function(e, t, i) {
  7961. (function(i) {
  7962. "use strict";
  7963. var n = e("../util/browser")
  7964. , r = e("./../util/logger")
  7965. , o = e("./../settings")
  7966. , a = new r(i)
  7967. , s = function() {
  7968. var e;
  7969. try {
  7970. return e = window.localStorage.getItem("visitCount") || "0",
  7971. e = (parseFloat(e) + 1).toString(),
  7972. window.localStorage.setItem("visitCount", e),
  7973. a.debug("visitCount = " + e),
  7974. e
  7975. } catch (t) {
  7976. e = "1",
  7977. a.debug("couldn't set local storage")
  7978. }
  7979. }()
  7980. , l = !1;
  7981. t.exports = {
  7982. isHelpDisabled: function() {
  7983. return "0" === n.valueFromHash("help", null) || l
  7984. },
  7985. isLargeHelpEnabled: function() {
  7986. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7987. },
  7988. isSmallHelpEnabled: function() {
  7989. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7990. },
  7991. isHelpEnabled: function() {
  7992. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7993. },
  7994. setAutoPlay: function(e) {
  7995. l = o.warp.auto >= 0 && e > 1
  7996. }
  7997. }
  7998. }
  7999. ).call(this, "/js/gui/helpManager.js")
  8000. }
  8001. , {
  8002. "../util/browser": 182,
  8003. "./../settings": 166,
  8004. "./../util/logger": 189
  8005. }],
  8006. 69: [function(e, t, i) {
  8007. "use strict";
  8008. function n(e, t, i, n) {
  8009. F = n,
  8010. r(e, t, i, F),
  8011. o(),
  8012. N = t.mode
  8013. }
  8014. function r(e, t, i, n) {
  8015. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  8016. e.controls[t].on(v.Move, a),
  8017. e.controls[t].on(v.LongTap, c)
  8018. }),
  8019. M.on("mousewheel DOMMouseScroll", a),
  8020. i.on(m.TagActivated, a),
  8021. i.on(m.TagNavigation, a),
  8022. t.on(A.FlyingEnded, s),
  8023. t.on(A.ModeChanging, function(e, t) {
  8024. B = t !== C.PANORAMA && e !== C.PANORAMA
  8025. }),
  8026. t.on(A.ModeChanged, function(e, i) {
  8027. N = t.mode,
  8028. i !== C.TRANSITIONING ? l() : a("modeChange")
  8029. }),
  8030. n.on(y.TourStart, function() {
  8031. L = !0,
  8032. a()
  8033. }),
  8034. n.on(y.TourEnd, function() {
  8035. L = !1,
  8036. l()
  8037. }),
  8038. n.on(y.ActionInterrupted, function() {
  8039. L = !1
  8040. }),
  8041. R.addEventListener("touchend", function() {
  8042. $("#pullTab").hasClass("opened") && !L && l()
  8043. }, !0)
  8044. }
  8045. function o() {
  8046. p.isMobile() ? (b.forEach(function(e) {
  8047. e.classList.add("mobile")
  8048. }),
  8049. w.click(l)) : (b.forEach(function(e) {
  8050. e.addEventListener("mouseleave", function() {
  8051. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  8052. }, !0)
  8053. }),
  8054. M.mouseleave(function() {
  8055. b[0].classList.contains("detectHover") && l()
  8056. }))
  8057. }
  8058. function a(e) {
  8059. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  8060. P = !0,
  8061. g.close(),
  8062. h(e),
  8063. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  8064. _.hasClass("playing") || (b.forEach(function(e) {
  8065. e.classList.add("detectHover")
  8066. }),
  8067. O = setTimeout(l, f.immersive.timeToShowAgain))))
  8068. }
  8069. function s() {
  8070. _.hasClass("playing") || (clearTimeout(O),
  8071. O = setTimeout(l, f.immersive.timeToShowAgain))
  8072. }
  8073. function l() {
  8074. clearTimeout(O),
  8075. P = !1,
  8076. I.forEach(function(e) {
  8077. e.classList.remove("drawerOpen")
  8078. }),
  8079. L || E.forEach(function(e) {
  8080. e.classList.remove("duringTour")
  8081. }),
  8082. b.forEach(function(e) {
  8083. e.classList.remove("detectHover")
  8084. })
  8085. }
  8086. function c() {
  8087. P ? l() : a(),
  8088. D = !0,
  8089. setTimeout(function() {
  8090. D = !1
  8091. }, f.immersive.uiStayDuration)
  8092. }
  8093. function h(e) {
  8094. !d(e) && L ? E.forEach(function(e) {
  8095. e.classList.remove("drawerOpen"),
  8096. e.classList.add("duringTour")
  8097. }) : _.hasClass("open") ? E.forEach(function(e) {
  8098. e.classList.remove("duringTour"),
  8099. e.classList.add("drawerOpen")
  8100. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  8101. e.classList.add("fadeOut")
  8102. })
  8103. }
  8104. function u() {
  8105. T.hasClass("duringTour") || (L = !1,
  8106. a("gui"),
  8107. l())
  8108. }
  8109. function d(e) {
  8110. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  8111. }
  8112. var p = e("../util/browser")
  8113. , f = e("../settings")
  8114. , g = e("./help/help")
  8115. , m = e("../enum/tagEvents")
  8116. , v = e("../enum/ControlEvents")
  8117. , A = e("../enum/PlayerEvents")
  8118. , y = e("../enum/DirectorEvents")
  8119. , A = e("../enum/PlayerEvents")
  8120. , C = e("../enum/Viewmode")
  8121. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  8122. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  8123. , b = $("#hover-bottom, #hover-top").toArray()
  8124. , w = ($("#pullTab").eq(0),
  8125. $("#playHead").eq(0),
  8126. $(".pinBottom-container").eq(0))
  8127. , _ = $("#drawer").eq(0)
  8128. , T = $("#drawer-container").eq(0)
  8129. , x = $("#meta-info").eq(0)
  8130. , S = $(".pinTop.left").eq(0)
  8131. , M = $("#player").eq(0)
  8132. , R = document.getElementById("pullTab")
  8133. , P = !1
  8134. , O = null
  8135. , L = !1
  8136. , D = !1
  8137. , N = null
  8138. , B = !1
  8139. , F = null;
  8140. t.exports.init = n,
  8141. t.exports.hideUi = a,
  8142. t.exports.resetDrawer = u
  8143. }
  8144. , {
  8145. "../enum/ControlEvents": 21,
  8146. "../enum/DirectorEvents": 23,
  8147. "../enum/tagEvents": 32,
  8148. "../enum/PlayerEvents": 40,
  8149. "../enum/Viewmode": 51,
  8150. "../settings": 166,
  8151. "../util/browser": 182,
  8152. "./help/help": 67
  8153. }],
  8154. 70: [function(e, t, i) {
  8155. (function(i) {
  8156. "use strict";
  8157. function n(e, t, i) {
  8158. l.debug("konami has the modelInstance");
  8159. var n = [];
  8160. $(window).on("keydown", function(e) {
  8161. n.push(e.which),
  8162. n.length > o.secretPanelWord.length && n.shift(),
  8163. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  8164. o.debug = !0)
  8165. }),
  8166. $(window).on("keydown", function n(r) {
  8167. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  8168. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  8169. })
  8170. }
  8171. var r = e("./../util/logger")
  8172. , o = e("./../settings")
  8173. , a = e("./debug")
  8174. , s = e("./../util/common")
  8175. , l = (e("./gui"),
  8176. new r(i));
  8177. o.console && $("body").append('<div id="debug-console"></div>'),
  8178. t.exports.init = n
  8179. }
  8180. ).call(this, "/js/gui/konami.js")
  8181. }
  8182. , {
  8183. "./../settings": 166,
  8184. "./../util/common": 185,
  8185. "./../util/logger": 189,
  8186. "./debug": 63,
  8187. "./gui": 65
  8188. }],
  8189. 71: [function(e, t, i) {
  8190. "use strict";
  8191. function n(e, t) {
  8192. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  8193. }
  8194. function r(e) {
  8195. var t = $.Deferred();
  8196. e || t.resolve();
  8197. var i = c.startupFlyinDelay;
  8198. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  8199. setTimeout(t.resolve.bind(t), i),
  8200. t
  8201. }
  8202. function o(e, t, i) {
  8203. var n = 0;
  8204. c.quickstart.enabled && (a(i),
  8205. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  8206. var r = function() {
  8207. e.once(g.Move, l),
  8208. t.once(f.TourStart, l)
  8209. };
  8210. s(n, r)
  8211. }
  8212. function a(e) {
  8213. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8214. v.before(y),
  8215. A = $(".quick-brand").toArray()),*/
  8216. m.addClass("fadeOut"),
  8217. setTimeout(function() {
  8218. A.forEach(function(e) {
  8219. e.classList.add("fadeIn")
  8220. })
  8221. }, c.quickstart.showTextDelay),
  8222. setTimeout(function() {
  8223. A.forEach(function(e) {
  8224. e.classList.add("fadeOut")
  8225. })
  8226. }, c.quickstart.fadeOutDelay),
  8227. !0
  8228. }
  8229. function s(e, t) {
  8230. setTimeout(function() {
  8231. if (h.isHelpEnabled()) {
  8232. if (t(),
  8233. u.init(),
  8234. C.addClass("fadeIn landing " + u.deviceType),
  8235. h.isSmallHelpEnabled())
  8236. return void C.addClass("small");
  8237. u.fill(I, d.LANDING[E]),
  8238. C.addClass(E)
  8239. }
  8240. }, e)
  8241. //csz 用户引导界面
  8242. var helpData = {
  8243. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8244. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8245. }
  8246. var navIcon = $(".nav-icon .icon");
  8247. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8248. function paging(id){
  8249. id.on("click",function(){
  8250. var navPage = null;
  8251. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8252. if(navPage > helpData.length || navPage < 1) return false
  8253. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8254. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8255. }else{
  8256. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8257. }
  8258. })
  8259. };
  8260. paging($(".next-button"));
  8261. paging($(".prev-button"));
  8262. }
  8263. function l() {
  8264. u.clear(I, d.LANDING[E]),
  8265. C.removeClass("fadeIn")
  8266. }
  8267. var c = e("../settings")
  8268. , h = (e("./help/help"),
  8269. e("./helpManager"))
  8270. , u = e("./populateModal")
  8271. , d = e("../enum/HelpModalType")
  8272. , p = e("../enum/Viewmode")
  8273. , f = e("../enum/DirectorEvents")
  8274. , g = e("../enum/PlayerEvents")
  8275. , m = $("#quick-blackout").eq(0)
  8276. , v = $("#quick-logo").eq(0)
  8277. , A = $(".quick-brand").toArray()
  8278. , y = $("#loaderCoBrand").eq(0)
  8279. , C = $("#interaction-modal").eq(0)
  8280. , I = C.find(".interaction").toArray()
  8281. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8282. "");
  8283. t.exports.delayLanding = r,
  8284. t.exports.showMessage = o,
  8285. t.exports.init = n,
  8286. t.exports.dismissModal = l
  8287. }
  8288. , {
  8289. "../enum/DirectorEvents": 23,
  8290. "../enum/HelpModalType": 28,
  8291. "../enum/PlayerEvents": 40,
  8292. "../enum/Viewmode": 51,
  8293. "../settings": 166,
  8294. "./help/help": 67,
  8295. "./helpManager": 68,
  8296. "./populateModal": 75
  8297. }],
  8298. 72: [function(e, t, i) {
  8299. "use strict";
  8300. var n = e("./circleLoader").circleLoader;
  8301. t.exports = {
  8302. element: $("#gui-loading"),
  8303. hide: function(e) {
  8304. n.done(),
  8305. this.element.fadeOut(1500, e)
  8306. },
  8307. show: function(e) {
  8308. this.element.fadeIn(500, function() {
  8309. this.element.css("display", "table"),
  8310. e && e()
  8311. }
  8312. .bind(this))
  8313. },
  8314. progress: function(e) {
  8315. n.set(e)
  8316. }
  8317. }
  8318. }
  8319. , {
  8320. "./circleLoader": 60
  8321. }],
  8322. 73: [function(e, t, i) {
  8323. "use strict";
  8324. var n = e("../settings")
  8325. , r = $("#memory-info")
  8326. , o = r.find("#memory-gpu")
  8327. , a = !1;
  8328. t.exports = {
  8329. show: function() {
  8330. n.profiling.enabled && (r.show(),
  8331. a = !0)
  8332. },
  8333. hide: function() {
  8334. r.hide(),
  8335. a = !1
  8336. },
  8337. toggle: function() {
  8338. a ? this.hide() : this.show()
  8339. },
  8340. update: function(e) {
  8341. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8342. }
  8343. }
  8344. }
  8345. , {
  8346. "../settings": 166
  8347. }],
  8348. 74: [function(e, t, i) {
  8349. "use strict";
  8350. var n = e("../util/browser")
  8351. , r = e("../analytics");
  8352. e("../settings");
  8353. t.exports = {
  8354. show: function(e, t) {
  8355. $("#gui-message").fadeOut(500, function() {
  8356. t()
  8357. })
  8358. }
  8359. }
  8360. }
  8361. , {
  8362. "../analytics": 4,
  8363. "../settings": 166,
  8364. "../util/browser": 182
  8365. }],
  8366. 75: [function(e, t, i) {
  8367. "use strict";
  8368. function n(e, t, i, n) {
  8369. function r(e) {
  8370. return e.classList.contains(a)
  8371. }
  8372. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8373. //for (var a in o) {
  8374. //var s = e.find(r);
  8375. //for (var l in o[a]) {
  8376. //var c = o[a][l];
  8377. //if ("top-info" === l || "bottom-info" === l) {
  8378. //var h = n ? c : "";
  8379. //czj 注释掉第一次打开的用户引导
  8380. //s.querySelector("." + l).textContent = h
  8381. //} else {
  8382. //var u = n ? c : "";
  8383. //, d = s.querySelector("." + l);
  8384. //d.src = u,
  8385. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8386. //}
  8387. //}
  8388. //}
  8389. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8390. // p.forEach(function(e) {
  8391. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8392. // })
  8393. }
  8394. var r = e("../util/browser")
  8395. , o = e("../localization/localize")
  8396. , a = e("../enum/HelpModalType")
  8397. , s = (e("../enum/HelpModalSize"),
  8398. e("../enum/Viewmode"));
  8399. t.exports = {
  8400. init: function() {
  8401. if (!this.hasInitialized) {
  8402. this.hasInitialized = !0,
  8403. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8404. this.assets = {},
  8405. this.assets[a.LANDING[s.PANORAMA]] = {
  8406. desktop: {
  8407. left: {
  8408. "top-info": o.ROTATE,
  8409. "big-image": "images/nav_help_mouse_drag_left.png",
  8410. keyboard: "images/nav_help_keyboard_left_right.png"
  8411. },
  8412. middle: {
  8413. "top-info": o.MOVE,
  8414. "big-image": "images/nav_help_mouse_click.png",
  8415. keyboard: "images/nav_help_keyboard_up_down.png"
  8416. },
  8417. right: {
  8418. "top-info": o.ZOOM,
  8419. "big-image": "images/nav_help_mouse_zoom.png",
  8420. keyboard: "images/nav_help_zoom_keys.png"
  8421. }
  8422. },
  8423. mobile: {
  8424. left: {
  8425. "top-info": o.ROTATE,
  8426. "big-image": "images/nav_help_gesture_drag.png"
  8427. },
  8428. middle: {
  8429. "top-info": o.MOVE,
  8430. "big-image": "images/nav_help_gesture_tap.png"
  8431. },
  8432. right: {
  8433. "top-info": o.ZOOM,
  8434. "big-image": "images/nav_help_gesture_pinch.png"
  8435. }
  8436. }
  8437. },
  8438. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8439. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8440. desktop: {
  8441. left: {
  8442. "top-info": o.ROTATE,
  8443. "big-image": "images/nav_help_mouse_drag_left.png",
  8444. keyboard: "images/nav_help_keyboard_left_right.png"
  8445. },
  8446. middle: {
  8447. "top-info": o.MOVE,
  8448. "big-image": "images/nav_help_mouse_position_right.png"
  8449. }
  8450. },
  8451. mobile: {
  8452. left: {
  8453. "top-info": o.ROTATE,
  8454. "big-image": "images/nav_help_gesture_drag.png"
  8455. },
  8456. middle: {
  8457. "top-info": o.MOVE,
  8458. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8459. }
  8460. }
  8461. },
  8462. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8463. desktop: {
  8464. left: {
  8465. "top-info": o.MOVE,
  8466. "big-image": "images/nav_help_mouse_position_left.png"
  8467. },
  8468. middle: {
  8469. "top-info": o.ROTATE,
  8470. "big-image": "images/nav_help_mouse_drag_right.png",
  8471. keyboard: "images/nav_help_keyboard_left_right.png"
  8472. }
  8473. },
  8474. mobile: {
  8475. left: {
  8476. "top-info": o.MOVE,
  8477. "big-image": "images/nav_help_gesture_position.png"
  8478. },
  8479. middle: {
  8480. "top-info": o.ROTATE,
  8481. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8482. }
  8483. }
  8484. };
  8485. var e = {
  8486. "top-info": o.INSIDE,
  8487. "big-image": "images/nav_help_click_inside.png",
  8488. keyboard: "images/nav_help_inside_key.png"
  8489. };
  8490. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8491. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8492. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8493. var t = {
  8494. "top-info": o.INSIDE,
  8495. "big-image": "images/nav_help_tap_inside.png"
  8496. };
  8497. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8498. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8499. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8500. this.assets[a.NAVIGATION] = {},
  8501. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8502. desktop: {
  8503. left: {
  8504. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8505. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8506. "big-image": "images/nav_help_mouse_drag_left.png",
  8507. keyboard: "images/nav_help_keyboard_left_right.png"
  8508. },
  8509. middle: {
  8510. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8511. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8512. "big-image": "images/nav_help_mouse_click.png",
  8513. keyboard: "images/nav_help_keyboard_up_down.png"
  8514. },
  8515. right: {
  8516. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8517. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8518. "big-image": "images/nav_help_mouse_zoom.png",
  8519. keyboard: "images/nav_help_zoom_keys.png"
  8520. }
  8521. },
  8522. mobile: {
  8523. left: {
  8524. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8525. "big-image": "images/nav_help_gesture_drag.png"
  8526. },
  8527. middle: {
  8528. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8529. "big-image": "images/nav_help_gesture_tap.png"
  8530. },
  8531. right: {
  8532. "top-info": o.HELP_MOBILE_3,
  8533. "big-image": "images/nav_help_gesture_pinch.png"
  8534. }
  8535. }
  8536. },
  8537. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8538. desktop: {
  8539. left: {
  8540. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8541. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8542. "big-image": "images/nav_help_mouse_drag_left.png",
  8543. keyboard: "images/nav_help_keyboard_all.png"
  8544. },
  8545. middle: {
  8546. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8547. "big-image": "images/nav_help_mouse_position_right.png"
  8548. },
  8549. right: {
  8550. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8551. "big-image": "images/nav_help_mouse_zoom.png"
  8552. }
  8553. },
  8554. mobile: {
  8555. left: {
  8556. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8557. "big-image": "images/nav_help_gesture_drag.png"
  8558. },
  8559. middle: {
  8560. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8561. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8562. },
  8563. right: {
  8564. "top-info": o.HELP_MOBILE_3,
  8565. "big-image": "images/nav_help_gesture_pinch.png"
  8566. }
  8567. }
  8568. },
  8569. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8570. desktop: {
  8571. left: {
  8572. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8573. "big-image": "images/nav_help_mouse_position_left.png"
  8574. },
  8575. middle: {
  8576. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8577. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8578. "big-image": "images/nav_help_mouse_drag_right.png",
  8579. keyboard: "images/nav_help_keyboard_left_right.png"
  8580. },
  8581. right: {
  8582. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8583. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8584. "big-image": "images/nav_help_mouse_zoom.png",
  8585. keyboard: "images/nav_help_keyboard_up_down.png"
  8586. }
  8587. },
  8588. mobile: {
  8589. left: {
  8590. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8591. "big-image": "images/nav_help_gesture_position.png"
  8592. },
  8593. middle: {
  8594. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8595. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8596. },
  8597. right: {
  8598. "top-info": o.HELP_MOBILE_3,
  8599. "big-image": "images/nav_help_gesture_pinch.png"
  8600. }
  8601. }
  8602. },
  8603. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8604. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8605. "top-info": o.HELP_DESKTOP_360_2A,
  8606. "bottom-info": o.HELP_DESKTOP_360_2B,
  8607. "big-image": "images/nav_help_click_inside.png",
  8608. keyboard: "images/nav_help_inside_key.png"
  8609. },
  8610. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8611. "top-info": o.HELP_MOBILE_360_2,
  8612. "big-image": "images/nav_help_tap_inside.png"
  8613. },
  8614. this.assets[a.MORE_HELP] = {
  8615. desktop: {
  8616. "more-help-hlr": {
  8617. "top-info": o.HELP_MORE_HLR_A,
  8618. "big-image": "images/nav_help_expand.svg",
  8619. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8620. },
  8621. "more-help-dollhouse": {
  8622. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8623. "big-image": "images/nav_help_dollhouse.svg",
  8624. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8625. },
  8626. "more-help-floors": {
  8627. "top-info": o.HELP_MORE_FLOORS_A,
  8628. "big-image": "images/nav_help_floor picker.svg",
  8629. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8630. },
  8631. "more-help-tag": {
  8632. "top-info": o.HELP_MORE_TAG_A,
  8633. "big-image": "images/nav_help_tag.svg",
  8634. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8635. },
  8636. "more-help-zoom": {
  8637. "top-info": o.HELP_MORE_ZOOM_A,
  8638. "big-image": "images/nav_help_zoom.svg",
  8639. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8640. },
  8641. "more-help-tour": {
  8642. "top-info": o.HELP_MORE_TOUR_A,
  8643. "big-image": "images/nav_help_play.png",
  8644. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8645. },
  8646. "more-help-inside": {
  8647. "top-info": o.HELP_MORE_INSIDE_A,
  8648. "big-image": "images/nav_help_inside.svg",
  8649. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8650. },
  8651. "more-help-vr": {
  8652. "top-info": o.HELP_MORE_VR_A,
  8653. "big-image": "images/nav_help_vr.svg",
  8654. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8655. },
  8656. "more-help-360": {
  8657. "top-info": o.HELP_MORE_360_A,
  8658. "big-image": "images/nav_help_360.svg",
  8659. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8660. },
  8661. "more-help-fullscreen": {
  8662. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8663. "big-image": "images/nav_help_fullscreen.svg",
  8664. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8665. }
  8666. },
  8667. mobile: {
  8668. "more-help-hlr": {
  8669. "top-info": o.HELP_MORE_HLR_A,
  8670. "big-image": "images/nav_help_expand.svg",
  8671. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8672. },
  8673. "more-help-dollhouse": {
  8674. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8675. "big-image": "images/nav_help_dollhouse.svg",
  8676. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8677. },
  8678. "more-help-floors": {
  8679. "top-info": o.HELP_MORE_FLOORS_A,
  8680. "big-image": "images/nav_help_floor picker.svg",
  8681. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8682. },
  8683. "more-help-tag": {
  8684. "top-info": o.HELP_MORE_TAG_A,
  8685. "big-image": "images/nav_help_tag.svg",
  8686. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8687. },
  8688. "more-help-tour": {
  8689. "top-info": o.HELP_MORE_TOUR_A,
  8690. "big-image": "images/nav_help_play.png",
  8691. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8692. },
  8693. "more-help-inside": {
  8694. "top-info": o.HELP_MORE_INSIDE_A,
  8695. "big-image": "images/nav_help_inside.svg",
  8696. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8697. },
  8698. "more-help-vr": {
  8699. "top-info": o.HELP_MORE_VR_A,
  8700. "big-image": "images/webvr.svg",
  8701. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8702. },
  8703. "more-help-360": {
  8704. "top-info": o.HELP_MORE_360_A,
  8705. "big-image": "images/nav_help_360.svg",
  8706. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8707. }
  8708. }
  8709. },
  8710. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8711. desktop: {
  8712. left: {
  8713. "top-info": o.ROTATE,
  8714. "big-image": "images/nav_help_mouse_drag_left.png",
  8715. keyboard: "images/nav_help_keyboard_left_right.png"
  8716. },
  8717. middle: {
  8718. "top-info": o.MOVE,
  8719. "big-image": "images/nav_help_mouse_click.png",
  8720. keyboard: "images/nav_help_keyboard_up_down.png"
  8721. },
  8722. right: {
  8723. "top-info": o.PLAY,
  8724. "big-image": "images/Desktop-help-play-button.svg",
  8725. keyboard: "images/Desktop-help-spacebar-2.svg"
  8726. }
  8727. },
  8728. mobile: {
  8729. left: {
  8730. "top-info": o.ROTATE,
  8731. "big-image": "images/nav_help_gesture_drag.png"
  8732. },
  8733. middle: {
  8734. "top-info": o.MOVE,
  8735. "big-image": "images/nav_help_gesture_tap.png"
  8736. },
  8737. right: {
  8738. "top-info": o.PLAY,
  8739. "big-image": "images/mobile-help-play-button.svg"
  8740. }
  8741. }
  8742. },
  8743. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8744. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8745. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8746. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8747. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8748. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8749. }
  8750. },
  8751. fill: function(e, t, i) {
  8752. n.call(this, e, t, i, !0)
  8753. },
  8754. clear: function(e, t, i) {
  8755. n.call(this, e, t, i, !1)
  8756. }
  8757. }
  8758. }
  8759. , {
  8760. "../enum/HelpModalSize": 27,
  8761. "../enum/HelpModalType": 28,
  8762. "../enum/Viewmode": 51,
  8763. "../localization/localize": 108,
  8764. "../util/browser": 182
  8765. }],
  8766. 76: [function(e, t, i) {
  8767. "use strict";
  8768. t.exports = Object.freeze({
  8769. OPENED: "share.open",
  8770. CLOSED: "share.closed",
  8771. LINK_CLICKED: "share.linked"
  8772. })
  8773. }
  8774. , {}],
  8775. 77: [function(e, t, i) {
  8776. "use strict";
  8777. function n(e) {
  8778. function t(t, i) {
  8779. var n = window.screenY + ($("#player").height() - i) / 2
  8780. , r = window.screenX + ($("#player").width() - t) / 2
  8781. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8782. I.emit(l.LINK_CLICKED, {
  8783. channel: e
  8784. }),
  8785. window.open(C[e], "shareWindow", o)
  8786. }
  8787. switch (e) {
  8788. case y.FACEBOOK:
  8789. t(580, 420);
  8790. break;
  8791. case y.TWITTER:
  8792. t(550, 440);
  8793. break;
  8794. case y.MAIL:
  8795. I.emit(l.LINK_CLICKED, {
  8796. channel: "email"
  8797. }),
  8798. window.open(C[e], "_blank");
  8799. break;
  8800. case y.LINKEDIN:
  8801. }
  8802. }
  8803. function r(e) {
  8804. I.emit(l.LINK_CLICKED, {
  8805. channel: "copylink"
  8806. });
  8807. var t = document.createRange();
  8808. t.selectNodeContents(v);
  8809. var i = window.getSelection();
  8810. i.removeAllRanges(),
  8811. i.addRange(t),
  8812. document.execCommand("copy"),
  8813. A.classList.remove("hidden"),
  8814. v.classList.add("highlighted")
  8815. }
  8816. function o(e) {
  8817. e && (e.stopPropagation(),
  8818. e.target === v) || (window.getSelection().removeAllRanges(),
  8819. v.classList.remove("highlighted"),
  8820. A.classList.add("hidden"))
  8821. }
  8822. var a = e("../../util/browser")
  8823. , s = e("../../localization/localize")
  8824. , l = e("./ShareEvents")
  8825. , c = e("../../util/common")
  8826. , h = e("events").EventEmitter
  8827. , u = document.getElementById("sharing")
  8828. , d = document.getElementById("share-modal")
  8829. , p = document.getElementById("share-close")
  8830. , f = document.getElementById("facebook-share")
  8831. , g = document.getElementById("twitter-share")
  8832. , m = document.getElementById("mail-share")
  8833. , v = document.getElementById("share-url-text")
  8834. , A = document.getElementById("copy-success")
  8835. , y = Object.freeze({
  8836. FACEBOOK: "facebook",
  8837. TWITTER: "twitter",
  8838. MAIL: "mail",
  8839. LINKEDIN: "linkedin"
  8840. })
  8841. , C = {};
  8842. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8843. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8844. C[y.MAIL] = "mailto:?subject=";
  8845. var I = {
  8846. init: function(e) {
  8847. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8848. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8849. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8850. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8851. u.addEventListener("click", this.toggle.bind(this)),
  8852. p.addEventListener("click", this.hide.bind(this)),
  8853. v.addEventListener("click", r),
  8854. d.addEventListener("click", o),
  8855. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8856. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8857. m.addEventListener("click", n.bind(this, y.MAIL)),
  8858. v.textContent = window.location.href + "&utm_source=4",
  8859. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8860. u.classList.remove("hidden")
  8861. },
  8862. show: function() {
  8863. this.emit(l.OPENED),
  8864. d.classList.add("fadeIn")
  8865. },
  8866. hide: function() {
  8867. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8868. document.selection && document.selection.empty(),
  8869. window.getSelection().removeAllRanges(),
  8870. o(),
  8871. d.classList.remove("fadeIn"))
  8872. },
  8873. toggle: function() {
  8874. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8875. }
  8876. };
  8877. c.extendObject(I, h.prototype),
  8878. t.exports = I
  8879. }
  8880. , {
  8881. "../../localization/localize": 108,
  8882. "../../util/browser": 182,
  8883. "../../util/common": 185,
  8884. "./ShareEvents": 76,
  8885. events: 202
  8886. }],
  8887. 78: [function(e, t, i) {
  8888. "use strict";
  8889. t.exports = Object.freeze({
  8890. OPENED: "terms.opened",
  8891. CLOSED: "terms.closed"
  8892. })
  8893. }
  8894. , {}],
  8895. 79: [function(e, t, i) {
  8896. "use strict";
  8897. var n = e("./TermsEvent")
  8898. , r = e("../../localization/localize")
  8899. , o = e("../../analytics")
  8900. , a = e("../../util/ajax")
  8901. , s = e("../../util/common")
  8902. , l = e("events").EventEmitter
  8903. , c = document.getElementById("terms-modal")
  8904. , h = {
  8905. init: function() {
  8906. $(".footer-terms").on("click", function(e) {
  8907. e.preventDefault(),
  8908. this.show()
  8909. }
  8910. .bind(this)),
  8911. $("#terms-modal .close").on("click", this.hide.bind(this))
  8912. },
  8913. show: function() {
  8914. this.emit(n.OPENED),
  8915. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8916. var t = $("#terms-text").html(e);
  8917. o.track("showcase_gui", {
  8918. gui_action: "click_terms_button",
  8919. interaction_source: "gui"
  8920. }),
  8921. t.find("a").attr("target", "_blank")
  8922. }).fail(function() {
  8923. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8924. }),
  8925. c.classList.add("fadeIn")
  8926. },
  8927. hide: function(e) {
  8928. e && e.preventDefault(),
  8929. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8930. c.classList.remove("fadeIn")
  8931. }
  8932. };
  8933. s.extendObject(h, l.prototype),
  8934. t.exports = h
  8935. }
  8936. , {
  8937. "../../analytics": 4,
  8938. "../../localization/localize": 108,
  8939. "../../util/ajax": 181,
  8940. "../../util/common": 185,
  8941. "./TermsEvent": 78,
  8942. events: 202
  8943. }],
  8944. 80: [function(e, t, i) {
  8945. "use strict";
  8946. t.exports = Object.freeze({
  8947. OPEN_INFO: "title.open.info",
  8948. CLOSE_INFO: "title.close.info",
  8949. SHOW_INFO: "title.show.info",
  8950. HIDE_INFO: "title.hide.info",
  8951. LINK_CLICKED: "title.link.click",
  8952. CONTACT_LINK_CLICKED: "title.contact.click",
  8953. ORIGIN_LINK_CLICKED: "title.origin.click"
  8954. })
  8955. }
  8956. , {}],
  8957. 81: [function(e, t, i) {
  8958. "use strict";
  8959. function n(e, t) {
  8960. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8961. }
  8962. function r(e, t) {
  8963. function i(i) {
  8964. e.shouldShowtags = "show" === this.value,
  8965. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8966. }
  8967. document.getElementById("tag-toggles").classList.remove("hidden"),
  8968. document.getElementById("radio-tag-show").checked = !0;
  8969. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8970. n[r].addEventListener("change", i)
  8971. }
  8972. var o = e("../../settings");
  8973. t.exports.init = n
  8974. }
  8975. , {
  8976. "../../settings": 166
  8977. }],
  8978. 82: [function(e, t, i) {
  8979. (function(i) {
  8980. "use strict";
  8981. function n(e, t) {
  8982. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8983. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8984. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8985. document.getElementById("gui-name").classList.add("noCoBrand"),
  8986. document.getElementById("cobrandTitle").classList.add("hidden")),
  8987. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8988. !1)
  8989. }
  8990. function r(e) {
  8991. return e ? (L = !0,
  8992. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8993. }
  8994. function o(e, t, i, n) {
  8995. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8996. return void T.classList.add("hidden");
  8997. L = !0;
  8998. var r = []
  8999. , o = c(r, "<br>");
  9000. if (e && o('<span id="contactName">' + e + "</span>"),
  9001. t) {
  9002. var a = n || t
  9003. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  9004. o(s)
  9005. }
  9006. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  9007. r[0] = "",
  9008. x.innerHTML = r.join("")
  9009. }
  9010. function a(e) {
  9011. if ("string" == typeof e)
  9012. try {
  9013. e = JSON.parse(e)
  9014. } catch (e) {
  9015. return y.warn("Unable to parse address data"),
  9016. void S.parentElement.classList.add("hidden")
  9017. }
  9018. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9019. return void S.parentElement.classList.add("hidden");
  9020. L = !0;
  9021. var t = []
  9022. , i = c(t, " ");
  9023. e.address_1 && i(e.address_1),
  9024. e.address_2 && i(e.address_2),
  9025. e.city && i(e.city, ", "),
  9026. e.state && i(e.state, ", "),
  9027. e.zip && i(e.zip, e.state ? " " : ", "),
  9028. t[0] = "",
  9029. S.innerText = t.join("")
  9030. }
  9031. function s(e) {
  9032. var t = document.createElement("a");
  9033. return t.id = "url",
  9034. t.target = "_blank",
  9035. t.href = e,
  9036. t.innerText = e,
  9037. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  9038. t
  9039. }
  9040. function l(e) {
  9041. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  9042. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  9043. P.appendChild(s(e)),
  9044. O.forEach(function(e) {
  9045. e.classList.add("share-link")
  9046. }),
  9047. !0)
  9048. }
  9049. function c(e, t) {
  9050. var i = e
  9051. , n = t;
  9052. return function(e, t) {
  9053. i.push(t || n, e)
  9054. }
  9055. }
  9056. function h() {
  9057. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  9058. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  9059. var e = [].slice.call(_.querySelectorAll("a"));
  9060. e.forEach(function(e) {
  9061. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  9062. });
  9063. var t = [].slice.call(T.querySelectorAll("a"));
  9064. t.forEach(function(e) {
  9065. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  9066. contact_type: e.getAttribute("id")
  9067. }))
  9068. })
  9069. }
  9070. var u = e("../../util/browser")
  9071. , d = e("../../util/common")
  9072. , p = e("../../util/logger")
  9073. , f = e("../../localization/localize")
  9074. , g = e("./titleBarSettings")
  9075. , m = e("../../settings")
  9076. , v = e("./TitleEvents")
  9077. , A = e("events").EventEmitter
  9078. , y = new p(i)
  9079. , C = document.querySelector(".pinTop.left")
  9080. , I = document.getElementsByClassName("title-container")[0]
  9081. , E = document.getElementById("title-toggle").querySelector("i")
  9082. , b = document.getElementById("meta-info-wrapper")
  9083. , w = document.getElementById("meta-info")
  9084. , _ = document.getElementById("meta-description")
  9085. , T = document.getElementsByClassName("contact-info")[0]
  9086. , x = document.getElementById("contact-data")
  9087. , S = document.getElementById("addressTxt")
  9088. , M = document.getElementById("tag-toggles")
  9089. , R = document.getElementById("share-origin")
  9090. , P = document.getElementById("share-link-wrapper")
  9091. , O = [w, b, I]
  9092. , L = !1
  9093. , D = !1
  9094. , N = {
  9095. populate: function(e) {
  9096. if (n(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  9097. if (r(e.description),
  9098. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  9099. a(e.address),
  9100. L) {
  9101. var t = document.createElement("br");
  9102. M.insertBefore(t, M.firstElementChild)
  9103. }
  9104. e.socialSharing && m.share.enabled && (D = l(e.url))
  9105. }
  9106. },
  9107. finishSetup: function(e) {
  9108. L = L || !!e,
  9109. h(),
  9110. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  9111. },
  9112. toggleMeta: function(e, t) {
  9113. var title = document.getElementById("model-title");
  9114. t && t.preventDefault();
  9115. var i = w.classList.contains("expand");
  9116. e && !i || (i ? (O.forEach(function(e) {
  9117. e.classList.remove("expand")
  9118. }),
  9119. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  9120. e.classList.add("expand");
  9121. }),
  9122. title.classList.add("expand"),
  9123. this.emit(v.OPEN_INFO)))
  9124. },
  9125. setupToggling: function() {
  9126. b.style.height = w.offsetHeight + "px",
  9127. w.addEventListener("transitionend", function() {
  9128. b.style.height = w.offsetHeight + "px"
  9129. })
  9130. },
  9131. toggleTitle: function(e) {
  9132. e && e.preventDefault(),
  9133. C.classList.contains("closed") ? (C.classList.add("open"),
  9134. E.classList.remove("icon-dpad-right"),
  9135. E.classList.add("icon-dpad-left"),
  9136. this.emit(v.SHOW_INFO),
  9137. setTimeout(function() {
  9138. C.classList.remove("closed"),
  9139. C.classList.remove("open")
  9140. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  9141. E.classList.remove("icon-dpad-left"),
  9142. E.classList.add("icon-dpad-right"),
  9143. this.emit(v.HIDE_INFO))
  9144. }
  9145. };
  9146. d.extendObject(N, A.prototype),
  9147. t.exports = N
  9148. }
  9149. ).call(this, "/js/gui/title/titleBar.js")
  9150. }
  9151. , {
  9152. "../../localization/localize": 108,
  9153. "../../settings": 166,
  9154. "../../util/browser": 182,
  9155. "../../util/common": 185,
  9156. "../../util/logger": 189,
  9157. "./TitleEvents": 80,
  9158. "./titleBarSettings": 83,
  9159. events: 202
  9160. }],
  9161. 83: [function(e, t, i) {
  9162. "use strict";
  9163. t.exports = Object.freeze({
  9164. minTooltipCharacters: 19,
  9165. removeAnimationClasses: 500
  9166. })
  9167. }
  9168. , {}],
  9169. 84: [function(e, t, i) {
  9170. "use strict";
  9171. function n(e) {
  9172. C = e,
  9173. P.forEach(function(e) {
  9174. b.addEventListener(e, u.bind(this, !1), !0),
  9175. w.addEventListener(e, u.bind(this, !0), !0),
  9176. E.addEventListener(e, o, !0),
  9177. S.forEach(function(t) {
  9178. t.addEventListener(e, a, !0)
  9179. }),
  9180. $("#drawer img").on(e, a)
  9181. }),
  9182. document.addEventListener("keydown", u.bind(this, !1), !0),
  9183. C.on(v.TourStart, function() {
  9184. E.classList.add("playing")
  9185. })
  9186. }
  9187. function r() {
  9188. C.playTour(),
  9189. I && clearTimeout(I),
  9190. d(),
  9191. _.removeClass("fadeIn")
  9192. }
  9193. function o() {
  9194. E.classList.contains("playing") && (C.stopTour(),
  9195. _.addClass("fadeIn"),
  9196. setTimeout(function() {
  9197. _.removeClass("fadeIn")
  9198. }, p.tourInteraction.showPauseButton),
  9199. O || (clearTimeout(I),
  9200. I = setTimeout(h, p.tourInteraction.showModal)),
  9201. setTimeout(function() {
  9202. E.classList.remove("playing")
  9203. }, p.tourInteraction.allowNextClick))
  9204. }
  9205. function a() {
  9206. C.tourInProgress && (C.stopTour(),
  9207. C.endTourProgress(),
  9208. E.classList.remove("playing"))
  9209. }
  9210. function s() {
  9211. T.is(":visible") ? r() : o()
  9212. }
  9213. function l() {
  9214. x.hasClass("playing") && (clearTimeout(I),
  9215. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  9216. }
  9217. function c() {
  9218. E.classList.remove("playing"),
  9219. h()
  9220. }
  9221. function h() {//去掉导览结束时的提示
  9222. /* if (!p.tourInteraction.disabled) {
  9223. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9224. M.addClass("fadeIn tour " + m.deviceType);
  9225. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9226. if (!p.tourInteraction.smallModal) {
  9227. var t;
  9228. 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,
  9229. m.fill(R, A.TOUR_INTERACTION[t]),
  9230. M.addClass(t)
  9231. }
  9232. M.addClass(e)
  9233. } */
  9234. }
  9235. function u(e, t) {
  9236. if (t) {
  9237. var i = "keydown" === t.type
  9238. , n = t.which === f.SPACE || C.tourIsPlaying;
  9239. i && n || e || (O = !0),
  9240. C.atEndOfTour() && d(),
  9241. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  9242. d(),
  9243. t.which !== f.SPACE && a()),
  9244. i && n && s()
  9245. }
  9246. }
  9247. function d() {
  9248. M.removeClass("fadeIn")
  9249. }
  9250. var p = (e("../util/browser"),
  9251. e("../settings"))
  9252. , f = e("../enum/Keys")
  9253. , g = e("../enum/Viewmode")
  9254. , m = (e("./helpManager"),
  9255. e("./populateModal"))
  9256. , v = e("../enum/DirectorEvents")
  9257. , A = e("../enum/HelpModalType")
  9258. , y = e("../enum/HelpModalSize")
  9259. , C = null
  9260. , I = null
  9261. , E = document.getElementById("pause-overlay")
  9262. , b = document.getElementById("player")
  9263. , w = document.getElementById("gui")
  9264. , _ = $("#pause-icon").eq(0)
  9265. , T = $("#play").eq(0)
  9266. , x = $("#playHead").eq(0)
  9267. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9268. , M = $("#interaction-modal").eq(0)
  9269. , R = $("#interaction-modal .interaction").toArray()
  9270. , P = ["touchstart", "mousedown", "pointerdown"]
  9271. , O = !1;
  9272. t.exports.init = n,
  9273. t.exports.play = r,
  9274. t.exports.pause = o,
  9275. t.exports.pauseWithoutCTA = a,
  9276. t.exports.togglePlay = s,
  9277. t.exports.stopTour = l,
  9278. t.exports.dismissModal = d
  9279. }
  9280. , {
  9281. "../enum/DirectorEvents": 23,
  9282. "../enum/HelpModalSize": 27,
  9283. "../enum/HelpModalType": 28,
  9284. "../enum/Keys": 30,
  9285. "../enum/Viewmode": 51,
  9286. "../settings": 166,
  9287. "../util/browser": 182,
  9288. "./helpManager": 68,
  9289. "./populateModal": 75
  9290. }],
  9291. 85: [function(e, t, i) {
  9292. "use strict";
  9293. t.exports = Object.freeze({
  9294. OPENED: "vr.modal.opened",
  9295. LAUNCH: "vr.modal.launch",
  9296. CLOSED: "vr.modal.closed",
  9297. NEXT: "vr.modal.next",
  9298. PREV: "vr.modal.prev",
  9299. STORE: "vr.modal.store",
  9300. falseICECHOSEN: "vr.modal.device"
  9301. })
  9302. }
  9303. , {}],
  9304. 86: [function(e, t, i) {
  9305. "use strict";
  9306. function n(e, t, i) {
  9307. function n(e, t, n, r) {
  9308. function o() {
  9309. return p + "&m=" + t + "&display=" + e
  9310. }
  9311. function s() {
  9312. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9313. , t = "&utm_source=" + u
  9314. , n = "&utm_showcase_session_id=" + i;
  9315. return e + t + n
  9316. }
  9317. function l() {
  9318. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9319. }
  9320. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9321. }
  9322. function r(e, t, i, r) {
  9323. var o = "https://api.branch.io/v1/url"
  9324. , a = n(e, t, i, r)
  9325. , s = {
  9326. responseType: "json",
  9327. data: {
  9328. branch_key: h.appConfig.branch_key,
  9329. data: {
  9330. m: t,
  9331. full_url: a,
  9332. $desktop_url: m,
  9333. $og_app_id: "331853976762864119",
  9334. $og_title: i,
  9335. $og_description: r,
  9336. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9337. $canonical_url: window.location.href
  9338. }
  9339. }
  9340. };
  9341. c.post(o, s).done(function(t) {
  9342. f[e] = t.url
  9343. }).fail(function(t) {
  9344. f[e] = t
  9345. }
  9346. .bind(this, a))
  9347. }
  9348. function o(e, t, i) {
  9349. for (var r in s) {
  9350. var o = s[r]
  9351. , a = n(o, e, t, i);
  9352. f[o] = a
  9353. }
  9354. }
  9355. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9356. , d = g + "/vr/dlist/?ret=" + u
  9357. , p = g + "/vr/show/?ret=" + u
  9358. , m = "";
  9359. switch (e) {
  9360. case l.IOS:
  9361. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9362. break;
  9363. default:
  9364. o(t.sid, t.name, t.summary)
  9365. }
  9366. }
  9367. function r(e) {
  9368. var t = f[e];
  9369. window.open(t, "_blank")
  9370. }
  9371. function o(e) {
  9372. var t = u[e];
  9373. window.open(t, "_blank")
  9374. }
  9375. var a = e("../../util/browser")
  9376. , s = e("../../enum/VRApps")
  9377. , l = e("../../enum/VRPlatforms")
  9378. , c = e("../../util/ajax")
  9379. , h = e("../../settings")
  9380. , u = {};
  9381. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9382. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9383. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9384. for (var d in s) {
  9385. var p = s[d];
  9386. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9387. }
  9388. var f = {}
  9389. , g = function() {
  9390. var e = window.location.host;
  9391. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9392. "https://" + e
  9393. }();
  9394. t.exports.init = n,
  9395. t.exports.launch = r,
  9396. t.exports.launchStore = o
  9397. }
  9398. , {
  9399. "../../enum/VRApps": 46,
  9400. "../../enum/VRPlatforms": 49,
  9401. "../../settings": 166,
  9402. "../../util/ajax": 181,
  9403. "../../util/browser": 182
  9404. }],
  9405. 87: [function(e, t, i) {
  9406. "use strict";
  9407. function n(e) {
  9408. var t;
  9409. switch (e) {
  9410. case m.IOS:
  9411. return t = p.iosVersion(),
  9412. t.major > 9 || 9 === t.major && t.minor >= 1;
  9413. case m.Android:
  9414. return t = p.androidVersion(),
  9415. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9416. }
  9417. return !1
  9418. }
  9419. function r(e, t) {
  9420. function i(e) {
  9421. K.emit(A.STORE, {
  9422. type: e
  9423. }),
  9424. f.launchStore(e)
  9425. }
  9426. function r(e) {
  9427. switch (e !== _.pageCount && (a(e),
  9428. N.text(e + 1 + " / " + _.pageCount)),
  9429. e) {
  9430. case _.Title:
  9431. O.css("display", "none"),
  9432. L.text(u[e]),
  9433. o(s);
  9434. break;
  9435. case _.Cardboard:
  9436. O.css("display", "block"),
  9437. L.text(u[e]),
  9438. M.filter(".cardboard").off(),
  9439. M.filter(".gearvr").off(),
  9440. c(e, s),
  9441. h(H, X, Z);
  9442. break;
  9443. case _.Gear:
  9444. L.text(u[e]),
  9445. c(e, s),
  9446. T.addClass("lastPage"),
  9447. h(G, X, Z);
  9448. break;
  9449. case _.pageCount:
  9450. T.removeClass("fadeIn"),
  9451. K.emit(A.CLOSED)
  9452. }
  9453. B.filter("[src='']").hide()
  9454. }
  9455. var s = function() {
  9456. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9457. w = ".show-supported",
  9458. m.Android) : (T.addClass("unsupported"),
  9459. w = ".show-unsupported",
  9460. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9461. w = ".show-ios",
  9462. _ = v.ios,
  9463. m.IOS) : (T.addClass("desktop"),
  9464. w = ".show-desktop",
  9465. m.Desktop)
  9466. }();
  9467. f.init(s, e, t),
  9468. s !== m.Desktop && T.addClass("mobile");
  9469. var l = function(e) {
  9470. K.emit(A.LAUNCH, {
  9471. vr_platform: s,
  9472. vr_app: e
  9473. }),
  9474. f.launch(e)
  9475. };
  9476. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9477. q.gear = l.bind(this, g.GearVR),
  9478. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9479. d(),
  9480. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9481. $(w).show();
  9482. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9483. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9484. s === m.IOS && (u.splice(1, 1),
  9485. y.splice(1, 1)),
  9486. $("#vr").on("click", function(e) {
  9487. e.preventDefault();
  9488. if(!window.vrEnabled) { // 开启VR
  9489. window.vrEnabled = true;
  9490. this.classList.add('active');
  9491. $('#gui div').not('#vrOff').addClass('vrHide');
  9492. $('#vrOffImg').css({'display':'inline-block'});
  9493. }else{
  9494. }
  9495. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  9496. // r(b),
  9497. // T.addClass("fadeIn"),
  9498. // K.emit(A.OPENED))
  9499. });
  9500. $('#vrOff').on('click', function(){
  9501. window.vrEnabled = false;
  9502. $('#gui div').not('#vrOff').removeClass('vrHide');
  9503. $('#vrOffImg').css({'display':'none'});
  9504. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9505. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9506. })
  9507. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9508. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9509. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9510. $("span.modelLink").text(I),
  9511. O.on("click", function(e) {
  9512. K.emit(A.PREV),
  9513. b--,
  9514. r(b)
  9515. }),
  9516. L.on("click", function(e) {
  9517. L.text();
  9518. K.emit(A.NEXT, {
  9519. nextAction: y[b]
  9520. }),
  9521. b++,
  9522. r(b)
  9523. }),
  9524. T.find(".close").on("click", K.dismiss)
  9525. }
  9526. function o(e) {
  9527. switch (e) {
  9528. case m.Android:
  9529. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9530. M.filter(".gearvr").off().on("click", q.gear),
  9531. s(H, G, "logo-button", "same-line");
  9532. break;
  9533. case m.UnsupportedAndroid:
  9534. s("", z, "", "");
  9535. break;
  9536. case m.IOS:
  9537. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9538. s(H, "", "logo-button", "");
  9539. break;
  9540. case m.Desktop:
  9541. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9542. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9543. s(H, G, "logo-button", "same-line"),
  9544. Q.cardboard()
  9545. }
  9546. }
  9547. function a(e) {
  9548. $(".p1, .p2, .p3").hide(),
  9549. x.insertAfter(S),
  9550. T.removeClass("front-page"),
  9551. T.removeClass("details-page"),
  9552. T.removeClass("lastPage"),
  9553. M.removeClass("logo-button"),
  9554. M.removeClass("same-line"),
  9555. S.removeClass("headsetOptions"),
  9556. R.attr("src", ""),
  9557. R.filter(".second").removeClass("gear"),
  9558. R.css("display", "inline-block"),
  9559. R.off(),
  9560. P.filter(".second").css("display", ""),
  9561. D.css("display", "none"),
  9562. $(".p" + (e + 1) + w).show(),
  9563. R.filter(".third").insertBefore(P.filter(".third"))
  9564. }
  9565. function s(e, t, i, n) {
  9566. T.addClass("front-page"),
  9567. R.filter(".first").attr("src", e),
  9568. R.filter(".second").attr("src", t),
  9569. M.filter(".first").addClass(i),
  9570. M.filter(".second").addClass(i),
  9571. M.addClass(n),
  9572. ".show-desktop" === w && S.insertAfter(x)
  9573. }
  9574. function l(e, t, i) {
  9575. S.addClass("headsetOptions"),
  9576. M.off(),
  9577. R.filter(".second").attr("src", t),
  9578. D.css("display", "block"),
  9579. P.filter(".second").css("display", "none"),
  9580. D.on("click", function() {
  9581. a(_.Title),
  9582. o(m.Desktop)
  9583. }),
  9584. e && (K.emit(A.falseICECHOSEN, {
  9585. name: g.GearVR
  9586. }),
  9587. R.filter(".first").attr("src", e),
  9588. R.filter(".second").addClass("gear"),
  9589. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9590. Q.gearvr()),
  9591. i && (K.emit(A.falseICECHOSEN, {
  9592. name: g.Cardboard
  9593. }),
  9594. R.filter(".third").attr("src", i),
  9595. R.filter(".third").show(),
  9596. R.filter(".third").insertAfter(R.filter(".second")),
  9597. R.filter(".third").addClass("link"),
  9598. R.filter(".second").addClass("link"),
  9599. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9600. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9601. Q.cardboard())
  9602. }
  9603. function c(e, t) {
  9604. switch (t) {
  9605. case m.IOS:
  9606. X = Y,
  9607. Z = j;
  9608. break;
  9609. case m.Desktop:
  9610. e === _.Cardboard ? (X = F,
  9611. Z = U,
  9612. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9613. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9614. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9615. Z = "");
  9616. break;
  9617. default:
  9618. e === _.Cardboard ? (X = z,
  9619. Z = j) : (X = k,
  9620. Z = W)
  9621. }
  9622. }
  9623. function h(e, t, i) {
  9624. T.find(".inner").addClass("details-page"),
  9625. T.addClass("details-page"),
  9626. R.filter(".first").attr("src", e),
  9627. R.filter(".second").attr("src", t),
  9628. R.filter(".third").attr("src", i)
  9629. }
  9630. function u() {
  9631. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9632. K.emit(A.CLOSED))
  9633. }
  9634. function d() {
  9635. var e = p.aspectRatio() > 1 && p.isMobile();
  9636. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9637. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9638. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9639. }
  9640. var p = e("../../util/browser")
  9641. , f = e("./vrLink")
  9642. , g = e("../../enum/VRApps")
  9643. , m = e("../../enum/VRPlatforms")
  9644. , v = e("../../enum/VRPages")
  9645. , A = e("./vrEvent")
  9646. , y = (e("../../settings"),
  9647. e("../../constants"))
  9648. , C = e("../../localization/localize")
  9649. , I = e("../../util/common")
  9650. , E = e("events").EventEmitter
  9651. , b = 0
  9652. , w = null
  9653. , _ = v.standard
  9654. , T = $(".vr-popup")
  9655. , x = T.find(".vr-popup-body")
  9656. , S = T.find(".vr-images")
  9657. , M = T.find(".img-container")
  9658. , R = T.find(".vr-sm-image")
  9659. , P = M.find(".vr-img-caption")
  9660. , O = $(".vr-buttons").find(".prev-button")
  9661. , L = $(".vr-buttons").find(".next-button")
  9662. , D = S.find(".front-close")
  9663. , N = $(".vr-page")
  9664. , B = T.find("img")
  9665. , F = "images/apple-store.png"
  9666. , V = "images/badge-oculus.png"
  9667. , U = "images/badge-cardboard.png"
  9668. , k = "images/logo-samsung.png"
  9669. , H = "images/headset-cardboard.png"
  9670. , G = "images/headset-gearvr.png"
  9671. , z = "images/ico-android-robot.png"
  9672. , W = "images/ico-gearvr.png"
  9673. , j = "images/ico-vr.png"
  9674. , Y = "images/apple-logo-white.svg"
  9675. , X = null
  9676. , Z = null
  9677. , q = {}
  9678. , K = {
  9679. init: r,
  9680. dismiss: u,
  9681. isDeviceSupported: n
  9682. };
  9683. I.extendObject(K, E.prototype),
  9684. $(window).resize(d);
  9685. var Q = function() {
  9686. var e = P.filter(".first").find(".cardboard")
  9687. , t = P.filter(".first").find(".gearvr");
  9688. return {
  9689. cardboard: function() {
  9690. t.addClass("hidden"),
  9691. e.removeClass("hidden")
  9692. },
  9693. gearvr: function() {
  9694. e.addClass("hidden"),
  9695. t.removeClass("hidden")
  9696. }
  9697. }
  9698. }();
  9699. t.exports = K
  9700. }
  9701. , {
  9702. "../../constants": 8,
  9703. "../../enum/VRApps": 46,
  9704. "../../enum/VRPages": 48,
  9705. "../../enum/VRPlatforms": 49,
  9706. "../../localization/localize": 108,
  9707. "../../settings": 166,
  9708. "../../util/browser": 182,
  9709. "../../util/common": 185,
  9710. "./vrEvent": 85,
  9711. "./vrLink": 86,
  9712. events: 202
  9713. }],
  9714. 88: [function(e, t, i) {
  9715. "use strict";
  9716. t.exports = Object.freeze({
  9717. OPENED: "webvr.modal.opened",
  9718. SHOW_TERMS: "webvr.footer.show.terms"
  9719. })
  9720. }
  9721. , {}],
  9722. 89: [function(e, t, i) {
  9723. (function(i) {
  9724. "use strict";
  9725. function n(e, t, i, n) {
  9726. function r(e) {
  9727. e.preventDefault(),
  9728. a(e.currentTarget.id)
  9729. }
  9730. function a(e) {
  9731. ne[e](),
  9732. Object.keys(ne).map(function(t, i) {
  9733. $("#" + t).toggleClass("tabs-underlined", t === e)
  9734. })
  9735. }
  9736. y = i,
  9737. v = t,
  9738. w.init(E.Android, e, n),
  9739. m();
  9740. var l = new RegExp("daydream","i")
  9741. , c = l.test(y.displayName);
  9742. c ? (a("tabdaydream"),
  9743. B.filter(".device-headset-side").attr("src", H),
  9744. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9745. B.filter(".device-headset-side").attr("src", Y),
  9746. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9747. $("#vr").on("click", function(e) {
  9748. e.preventDefault(),
  9749. g("click_webvr_button"),
  9750. L.is(":hidden") && (ie.emit(_.OPENED),
  9751. o())
  9752. }),
  9753. $(".webvr-popup .close").on("click", function(e) {
  9754. e.preventDefault(),
  9755. D.hasClass("hidden") ? (g("webvr_help_close"),
  9756. p()) : s()
  9757. }),
  9758. $("#tabcardboard").on("click", r),
  9759. $("#tabdaydream").on("click", r),
  9760. $("#tabnative").on("click", r),
  9761. $(".webvr-popup .open-with-app").on("click", function(e) {
  9762. e.preventDefault(),
  9763. g("webvr_learn_more"),
  9764. a("tabnative"),
  9765. p()
  9766. }),
  9767. $(".webvr-popup .help").on("click", function(e) {
  9768. e.preventDefault(),
  9769. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9770. p()
  9771. }),
  9772. $(".webvr-popup .terms").on("click", function(e) {
  9773. e.preventDefault(),
  9774. g("webvr_click_terms"),
  9775. s(),
  9776. ie.emit(_.SHOW_TERMS)
  9777. }),
  9778. F.on("click", function(e) {
  9779. e.preventDefault(),
  9780. g(ee),
  9781. window.open(J, "_blank")
  9782. }),
  9783. V.on("click", function(e) {
  9784. e.preventDefault(),
  9785. g("webvr_phone_link"),
  9786. window.open(te, "_blank")
  9787. }),
  9788. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9789. e.preventDefault(),
  9790. g("webvr_cardboard_link"),
  9791. w.launch(b.CardboardAndroid)
  9792. }),
  9793. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9794. e.preventDefault(),
  9795. g("webvr_oculus_link"),
  9796. w.launch(b.GearVR)
  9797. })
  9798. }
  9799. function r() {
  9800. function e() {
  9801. y.isPresenting || (f(),
  9802. window.removeEventListener("vrdisplaypresentchange", e))
  9803. }
  9804. R.info("Headset mounted"),
  9805. v.suspend();
  9806. var t = document.createElement("canvas");
  9807. for (t.getContext("webgl"),
  9808. t.className = "webvr-canvas",
  9809. document.bgColor = "#000",
  9810. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9811. document.body.removeChild(document.body.firstChild);
  9812. document.body.appendChild(t),
  9813. g("webvr_enter_app"),
  9814. y.requestPresent([{
  9815. source: t,
  9816. predistorted: !0
  9817. }]).catch(function(t) {
  9818. R.error("Failed to present: " + t),
  9819. g("webvr_exit_calibrate"),
  9820. e()
  9821. }),
  9822. A.then(function() {
  9823. window.dispatchEvent(new Event("vrapp-start"))
  9824. }),
  9825. window.addEventListener("vrdisplaypresentchange", e)
  9826. }
  9827. function o() {
  9828. O.fadeOut(I.guiAnimationSpeed),
  9829. L.fadeIn(I.guiAnimationSpeed),
  9830. a()
  9831. }
  9832. function a() {
  9833. if (!A) {
  9834. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9835. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9836. A = new Promise(function(e, i) {
  9837. var n = document.createElement("script");
  9838. n.type = "text/javascript",
  9839. n.src = t,
  9840. n.onload = e,
  9841. document.head.appendChild(n)
  9842. }
  9843. )
  9844. }
  9845. D.find(".enter-button").on("click", r)
  9846. }
  9847. function s() {
  9848. g("webvr_modal_close"),
  9849. D.find(".enter-button").off("click", r),
  9850. L.fadeOut(I.guiAnimationSpeed, function() {
  9851. D.toggleClass("hidden", !1),
  9852. N.toggleClass("hidden", !0),
  9853. C.exitFullscreen()
  9854. }),
  9855. O.fadeIn(I.guiAnimationSpeed)
  9856. }
  9857. function l() {
  9858. k.toggleClass("hidden", !1),
  9859. U.toggleClass("hidden", !0)
  9860. }
  9861. function c() {
  9862. k.toggleClass("hidden", !0),
  9863. U.toggleClass("hidden", !1)
  9864. }
  9865. function h() {
  9866. B.filter(".device-headset").attr("src", G),
  9867. B.filter(".device-phone").attr("src", z),
  9868. J = Z,
  9869. ee = K,
  9870. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9871. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9872. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9873. c()
  9874. }
  9875. function u() {
  9876. B.filter(".badge-cardboard").attr("src", j),
  9877. B.filter(".badge-oculus").attr("src", X),
  9878. l()
  9879. }
  9880. function d() {
  9881. B.filter(".device-headset").attr("src", Y),
  9882. B.filter(".device-phone").attr("src", W),
  9883. J = q,
  9884. ee = Q,
  9885. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9886. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9887. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9888. c()
  9889. }
  9890. function p() {
  9891. D.toggleClass("hidden"),
  9892. N.toggleClass("hidden")
  9893. }
  9894. function f() {
  9895. R.info("exiting webVR"),
  9896. g("webvr_exit_app"),
  9897. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9898. }
  9899. function g(e) {
  9900. var t = C.isLandscape() ? "landscape" : "portrait";
  9901. T.trackAlways("showcase_gui", {
  9902. gui_action: e,
  9903. orientation: t
  9904. })
  9905. }
  9906. function m() {
  9907. var e = C.isLandscape();
  9908. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9909. }
  9910. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9911. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9912. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9913. init: n
  9914. }, ne = {
  9915. tabcardboard: d,
  9916. tabdaydream: h,
  9917. tabnative: u
  9918. };
  9919. S.extendObject(ie, P.prototype),
  9920. $(window).resize(m),
  9921. t.exports = ie
  9922. }
  9923. ).call(this, "/js/gui/webvr/webVRgui.js")
  9924. }
  9925. , {
  9926. "../../analytics": 4,
  9927. "../../constants": 8,
  9928. "../../enum/VRApps": 46,
  9929. "../../enum/VRPlatforms": 49,
  9930. "../../localization/localize": 108,
  9931. "../../settings": 166,
  9932. "../../util/browser": 182,
  9933. "../../util/common": 185,
  9934. "../../util/logger": 189,
  9935. "./../gui": 65,
  9936. "./../vr/vrLink": 86,
  9937. "./WebVrEvent": 88,
  9938. events: 202
  9939. }],
  9940. 90: [function(e, t, i) {
  9941. "use strict";
  9942. function n(e, t, i, n, o) {
  9943. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9944. this.roomId = o || "",
  9945. this.labelId = e,
  9946. this.position = (new r.Vector3).copy(t),
  9947. this.text = i
  9948. }
  9949. var r = e("three")
  9950. , o = e("../util/browser");
  9951. n.prototype.build = function() {
  9952. var e = window.document.createElement("div");
  9953. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9954. var t = window.document.createElement("div");
  9955. t.setAttribute("class", "gui-floorplan-label-text");
  9956. var i = window.document.createTextNode(this.text);
  9957. t.appendChild(i),
  9958. e.appendChild(t),
  9959. window.document.body.appendChild(e),
  9960. this.labelGui = e,
  9961. this.textBlock = t,
  9962. $(this.labelGui).hide();
  9963. var n = window.getComputedStyle(this.labelGui);
  9964. this.initialTransform = n.transform || n.webkitTransform
  9965. }
  9966. ,
  9967. t.exports = n
  9968. }
  9969. , {
  9970. "../util/browser": 182,
  9971. three: 217
  9972. }],
  9973. 91: [function(e, t, i) {
  9974. "use strict";
  9975. function n() {
  9976. this.player = null,
  9977. this.modelManager = null,
  9978. this.container = null
  9979. }
  9980. var r = e("three")
  9981. , o = (e("../util/common"),
  9982. e("../enum/PlayerEvents"))
  9983. , a = (e("../enum/DirectorEvents"),
  9984. e("../enum/ModelManagerEvents"))
  9985. , s = e("../settings")
  9986. , l = e("../enum/Viewmode")
  9987. , c = (e("../enum/WarpStyle"),
  9988. e("../util/transitions"),
  9989. e("../util/lerp"),
  9990. e("../util/browser"));
  9991. //场景初始化
  9992. n.prototype.init = function(e, t, i) {
  9993. this.player = e,
  9994. this.modelManager = t,
  9995. this.container = i,
  9996. this.updateModel(),
  9997. this.bindEvents()
  9998. }
  9999. ,
  10000. n.prototype.bindEvents = function() {
  10001. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  10002. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  10003. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  10004. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  10005. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  10006. }
  10007. ,
  10008. n.prototype.updateModel = function() {
  10009. this.model = this.modelManager.getActiveModel()
  10010. }
  10011. ,
  10012. n.prototype.handlePlayerViewChanged = function() {
  10013. this.updateLabelVisibility(),
  10014. this.updateLabelDisplay()
  10015. }
  10016. ,
  10017. n.prototype.getLabelsForFloor = function(e, t) {
  10018. return t = t || [],
  10019. t.length = 0,
  10020. this.model.labels.forEach(function(i) {
  10021. this.labelVisibleForFloor(i, e) && t.push(i)
  10022. }
  10023. .bind(this)),
  10024. t
  10025. }
  10026. ,
  10027. n.prototype.getLabelsForCurrentFloor = function(e) {
  10028. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  10029. }
  10030. ,
  10031. n.prototype.labelVisibleForFloor = function(e, t) {
  10032. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  10033. if (!this.model.showingLabels || !e.labelGui || !i)
  10034. return !1;
  10035. var n = e.floorId === this.model.floors.size() - 1;
  10036. return this.model.allFloorsVisible ? n : e.floorId === t
  10037. }
  10038. ,
  10039. n.prototype.updateLabelVisibility = function(e) {
  10040. this.model.labels.forEach(function(e) {
  10041. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  10042. }
  10043. .bind(this))
  10044. }
  10045. ,
  10046. n.prototype.showAllLabels = function(e, t) {
  10047. this.model.labels.forEach(function(i) {
  10048. this.showLabel(i, e, t)
  10049. }
  10050. .bind(this))
  10051. }
  10052. ,
  10053. n.prototype.hideAllLabels = function(e, t) {
  10054. this.model.labels.forEach(function(i) {
  10055. this.hideLabel(i, e, t)
  10056. }
  10057. .bind(this))
  10058. }
  10059. ,
  10060. n.prototype.showLabel = function(e, t, i) {
  10061. this.model.showingLabels && (e.visible || (e.visible = !0,
  10062. e.labelGui.style.display = "block",
  10063. e.labelGui.style.opacity = 0,
  10064. $(e.labelGui).delay(t).fadeTo(i, 1)))
  10065. }
  10066. ,
  10067. n.prototype.hideLabel = function(e, t, i) {
  10068. e.visible && (e.visible = !1,
  10069. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  10070. }
  10071. ,
  10072. n.prototype.supportedMode = function() {
  10073. return this.player.mode === l.FLOORPLAN
  10074. }
  10075. ,
  10076. n.prototype.updateLabelDisplay = function() {
  10077. var e = (new r.Vector3,
  10078. new r.Vector3,
  10079. []);
  10080. return function() {
  10081. var t = this.player.getLabelScaleFactor()
  10082. , i = .6
  10083. , n = 1.2
  10084. , r = (1 - t) * n + i
  10085. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  10086. this.getLabelsForCurrentFloor(e);
  10087. for (var a = 0; a < e.length; a++) {
  10088. var l = e[a];
  10089. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  10090. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  10091. }
  10092. }
  10093. }(),
  10094. n.prototype.updateProjectedGuiElement = function() {
  10095. var e = new r.Vector3;
  10096. new r.Vector3;
  10097. return function(t, i, n, r, o) {
  10098. i.style.fontSize = 100 * o + "%";
  10099. var a = $("#player").width()
  10100. , s = $("#player").height()
  10101. , l = .5 * a
  10102. , c = .5 * s;
  10103. e.copy(n),
  10104. e.project(this.player.camera);
  10105. var h = e.x * l + l
  10106. , u = -(e.y * c) + c;
  10107. h -= t.offsetWidth / 2,
  10108. u -= t.offsetHeight / 2,
  10109. t.style.left = h + "px",
  10110. t.style.top = u + "px"
  10111. }
  10112. }(),
  10113. n.prototype.handleStartInside = function(e) {
  10114. this.updateLabelVisibility()
  10115. }
  10116. ,
  10117. n.prototype.handleStartOutside = function() {
  10118. this.updateLabelVisibility()
  10119. }
  10120. ,
  10121. t.exports = n
  10122. }
  10123. , {
  10124. "../enum/DirectorEvents": 23,
  10125. "../enum/ModelManagerEvents": 33,
  10126. "../enum/PlayerEvents": 40,
  10127. "../enum/Viewmode": 51,
  10128. "../enum/WarpStyle": 52,
  10129. "../settings": 166,
  10130. "../util/browser": 182,
  10131. "../util/common": 185,
  10132. "../util/lerp": 188,
  10133. "../util/transitions": 195,
  10134. three: 217
  10135. }],
  10136. 92: [function(e, t, i) {
  10137. "use strict";
  10138. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  10139. if (null == this)
  10140. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  10141. if ("function" != typeof e)
  10142. throw new TypeError("predicate must be a function");
  10143. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  10144. if (t = i[o],
  10145. e.call(r, t, o, i))
  10146. return o;
  10147. return -1
  10148. }
  10149. ),
  10150. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  10151. value: function(e) {
  10152. if (null == this)
  10153. throw new TypeError('"this" is null or not defined');
  10154. var t = Object(this)
  10155. , i = t.length >>> 0;
  10156. if ("function" != typeof e)
  10157. throw new TypeError("predicate must be a function");
  10158. for (var n = arguments[1], r = 0; r < i; ) {
  10159. var o = t[r];
  10160. if (e.call(n, o, r, t))
  10161. return o;
  10162. r++
  10163. }
  10164. }
  10165. })
  10166. }
  10167. , {}],
  10168. 93: [function(e, t, i) {
  10169. "use strict";
  10170. var n = n || {};
  10171. t.exports = n,
  10172. n.gui = n.gui || {},
  10173. n.utils = n.utils || {},
  10174. n.controllers = n.controllers || {},
  10175. n.dom = n.dom || {},
  10176. n.color = n.color || {},
  10177. n.utils.css = function() {
  10178. return {
  10179. load: function(e, t) {
  10180. t = t || document;
  10181. var i = t.createElement("link");
  10182. i.type = "text/css",
  10183. i.rel = "stylesheet",
  10184. i.href = e,
  10185. t.getElementsByTagName("head")[0].appendChild(i)
  10186. },
  10187. inject: function(e, t) {
  10188. t = t || document;
  10189. var i = document.createElement("style");
  10190. i.type = "text/css",
  10191. i.innerHTML = e,
  10192. t.getElementsByTagName("head")[0].appendChild(i)
  10193. }
  10194. }
  10195. }(),
  10196. n.utils.common = function() {
  10197. var e = Array.prototype.forEach
  10198. , t = Array.prototype.slice;
  10199. return {
  10200. BREAK: {},
  10201. extend: function(e) {
  10202. return this.each(t.call(arguments, 1), function(t) {
  10203. for (var i in t)
  10204. this.isUndefined(t[i]) || (e[i] = t[i])
  10205. }, this),
  10206. e
  10207. },
  10208. defaults: function(e) {
  10209. return this.each(t.call(arguments, 1), function(t) {
  10210. for (var i in t)
  10211. this.isUndefined(e[i]) && (e[i] = t[i])
  10212. }, this),
  10213. e
  10214. },
  10215. compose: function() {
  10216. var e = t.call(arguments);
  10217. return function() {
  10218. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  10219. i = [e[n].apply(this, i)];
  10220. return i[0]
  10221. }
  10222. },
  10223. each: function(t, i, n) {
  10224. if (t)
  10225. if (e && t.forEach && t.forEach === e)
  10226. t.forEach(i, n);
  10227. else if (t.length === t.length + 0) {
  10228. for (var r = 0, o = t.length; r < o; r++)
  10229. if (r in t && i.call(n, t[r], r) === this.BREAK)
  10230. return
  10231. } else
  10232. for (var r in t)
  10233. if (i.call(n, t[r], r) === this.BREAK)
  10234. return
  10235. },
  10236. defer: function(e) {
  10237. setTimeout(e, 0)
  10238. },
  10239. toArray: function(e) {
  10240. return e.toArray ? e.toArray() : t.call(e)
  10241. },
  10242. isUndefined: function(e) {
  10243. return void 0 === e
  10244. },
  10245. isNull: function(e) {
  10246. return null === e
  10247. },
  10248. isNaN: function(e) {
  10249. return e !== e
  10250. },
  10251. isArray: Array.isArray || function(e) {
  10252. return e.constructor === Array
  10253. }
  10254. ,
  10255. isObject: function(e) {
  10256. return e === Object(e)
  10257. },
  10258. isNumber: function(e) {
  10259. return e === e + 0
  10260. },
  10261. isString: function(e) {
  10262. return e === e + ""
  10263. },
  10264. isBoolean: function(e) {
  10265. return e === !1 || e === !0
  10266. },
  10267. isFunction: function(e) {
  10268. return "[object Function]" === Object.prototype.toString.call(e)
  10269. }
  10270. }
  10271. }(),
  10272. n.controllers.Controller = function(e) {
  10273. var t = function(e, t) {
  10274. this.initialValue = e[t],
  10275. this.domElement = document.createElement("div"),
  10276. this.object = e,
  10277. this.property = t,
  10278. this.__onChange = void 0,
  10279. this.__onFinishChange = void 0
  10280. };
  10281. return e.extend(t.prototype, {
  10282. onChange: function(e) {
  10283. return this.__onChange = e,
  10284. this
  10285. },
  10286. onFinishChange: function(e) {
  10287. return this.__onFinishChange = e,
  10288. this
  10289. },
  10290. setValue: function(e) {
  10291. return this.object[this.property] = e,
  10292. this.__onChange && this.__onChange.call(this, e),
  10293. this.updateDisplay(),
  10294. this
  10295. },
  10296. getValue: function() {
  10297. return this.object[this.property]
  10298. },
  10299. updateDisplay: function() {
  10300. return this
  10301. },
  10302. isModified: function() {
  10303. return this.initialValue !== this.getValue()
  10304. }
  10305. }),
  10306. t
  10307. }(n.utils.common),
  10308. n.dom.dom = function(e) {
  10309. function t(t) {
  10310. if ("0" === t || e.isUndefined(t))
  10311. return 0;
  10312. var i = t.match(r);
  10313. return e.isNull(i) ? 0 : parseFloat(i[1])
  10314. }
  10315. var i = {
  10316. HTMLEvents: ["change"],
  10317. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10318. KeyboardEvents: ["keydown"]
  10319. }
  10320. , n = {};
  10321. e.each(i, function(t, i) {
  10322. e.each(t, function(e) {
  10323. n[e] = i
  10324. })
  10325. });
  10326. var r = /(\d+(\.\d+)?)px/
  10327. , o = {
  10328. makeSelectable: function(e, t) {
  10329. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10330. return !1
  10331. }
  10332. : function() {}
  10333. ,
  10334. e.style.MozUserSelect = t ? "auto" : "none",
  10335. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10336. e.unselectable = t ? "on" : "off")
  10337. },
  10338. makeFullscreen: function(t, i, n) {
  10339. e.isUndefined(i) && (i = !0),
  10340. e.isUndefined(n) && (n = !0),
  10341. t.style.position = "absolute",
  10342. i && (t.style.left = 0,
  10343. t.style.right = 0),
  10344. n && (t.style.top = 0,
  10345. t.style.bottom = 0)
  10346. },
  10347. fakeEvent: function(t, i, r, o) {
  10348. r = r || {};
  10349. var a = n[i];
  10350. if (!a)
  10351. throw new Error("Event type " + i + " not supported.");
  10352. var s = document.createEvent(a);
  10353. switch (a) {
  10354. case "MouseEvents":
  10355. var l = r.x || r.clientX || 0
  10356. , c = r.y || r.clientY || 0;
  10357. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10358. break;
  10359. case "KeyboardEvents":
  10360. var h = s.initKeyboardEvent || s.initKeyEvent;
  10361. e.defaults(r, {
  10362. cancelable: !0,
  10363. ctrlKey: !1,
  10364. altKey: !1,
  10365. shiftKey: !1,
  10366. metaKey: !1,
  10367. keyCode: void 0,
  10368. charCode: void 0
  10369. }),
  10370. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10371. break;
  10372. default:
  10373. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10374. }
  10375. e.defaults(s, o),
  10376. t.dispatchEvent(s)
  10377. },
  10378. bind: function(e, t, i, n) {
  10379. return n = n || !1,
  10380. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10381. o
  10382. },
  10383. unbind: function(e, t, i, n) {
  10384. return n = n || !1,
  10385. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10386. o
  10387. },
  10388. addClass: function(e, t) {
  10389. if (void 0 === e.className)
  10390. e.className = t;
  10391. else if (e.className !== t) {
  10392. var i = e.className.split(/ +/);
  10393. i.indexOf(t) == -1 && (i.push(t),
  10394. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10395. }
  10396. return o
  10397. },
  10398. removeClass: function(e, t) {
  10399. if (t)
  10400. if (void 0 === e.className)
  10401. ;
  10402. else if (e.className === t)
  10403. e.removeAttribute("class");
  10404. else {
  10405. var i = e.className.split(/ +/)
  10406. , n = i.indexOf(t);
  10407. n != -1 && (i.splice(n, 1),
  10408. e.className = i.join(" "))
  10409. }
  10410. else
  10411. e.className = void 0;
  10412. return o
  10413. },
  10414. hasClass: function(e, t) {
  10415. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10416. },
  10417. getWidth: function(e) {
  10418. var i = getComputedStyle(e);
  10419. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10420. },
  10421. getHeight: function(e) {
  10422. var i = getComputedStyle(e);
  10423. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10424. },
  10425. getOffset: function(e) {
  10426. var t = {
  10427. left: 0,
  10428. top: 0
  10429. };
  10430. if (e.offsetParent)
  10431. do
  10432. t.left += e.offsetLeft,
  10433. t.top += e.offsetTop;
  10434. while (e = e.offsetParent);return t
  10435. },
  10436. isActive: function(e) {
  10437. return e === document.activeElement && (e.type || e.href)
  10438. }
  10439. };
  10440. return o
  10441. }(n.utils.common),
  10442. n.controllers.OptionController = function(e, t, i) {
  10443. var n = function(e, r, o) {
  10444. n.superclass.call(this, e, r);
  10445. var a = this;
  10446. if (this.__select = document.createElement("select"),
  10447. i.isArray(o)) {
  10448. var s = {};
  10449. i.each(o, function(e) {
  10450. s[e] = e
  10451. }),
  10452. o = s
  10453. }
  10454. i.each(o, function(e, t) {
  10455. var i = document.createElement("option");
  10456. i.innerHTML = t,
  10457. i.setAttribute("value", e),
  10458. a.__select.appendChild(i)
  10459. }),
  10460. this.updateDisplay(),
  10461. t.bind(this.__select, "change", function() {
  10462. var e = this.options[this.selectedIndex].value;
  10463. a.setValue(e)
  10464. }),
  10465. this.domElement.appendChild(this.__select)
  10466. };
  10467. return n.superclass = e,
  10468. i.extend(n.prototype, e.prototype, {
  10469. setValue: function(e) {
  10470. var t = n.superclass.prototype.setValue.call(this, e);
  10471. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10472. t
  10473. },
  10474. updateDisplay: function() {
  10475. return this.__select.value = this.getValue(),
  10476. n.superclass.prototype.updateDisplay.call(this)
  10477. }
  10478. }),
  10479. n
  10480. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10481. n.controllers.NumberController = function(e, t) {
  10482. function i(e) {
  10483. return e = e.toString(),
  10484. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10485. }
  10486. var n = function(e, r, o) {
  10487. n.superclass.call(this, e, r),
  10488. o = o || {},
  10489. this.__min = o.min,
  10490. this.__max = o.max,
  10491. this.__step = o.step,
  10492. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  10493. this.__precision = i(this.__impliedStep)
  10494. };
  10495. return n.superclass = e,
  10496. t.extend(n.prototype, e.prototype, {
  10497. setValue: function(e) {
  10498. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10499. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10500. n.superclass.prototype.setValue.call(this, e)
  10501. },
  10502. min: function(e) {
  10503. return this.__min = e,
  10504. this
  10505. },
  10506. max: function(e) {
  10507. return this.__max = e,
  10508. this
  10509. },
  10510. step: function(e) {
  10511. return this.__step = e,
  10512. this.__impliedStep = e,
  10513. this.__precision = i(e),
  10514. this
  10515. }
  10516. }),
  10517. n
  10518. }(n.controllers.Controller, n.utils.common),
  10519. n.controllers.NumberControllerBox = function(e, t, i) {
  10520. function n(e, t) {
  10521. var i = Math.pow(10, t);
  10522. return Math.round(e * i) / i
  10523. }
  10524. var r = function(e, n, o) {
  10525. function a() {
  10526. var e = parseFloat(d.__input.value);
  10527. i.isNaN(e) || d.setValue(e)
  10528. }
  10529. function s() {
  10530. a(),
  10531. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10532. }
  10533. function l(e) {
  10534. t.bind(window, "mousemove", c),
  10535. t.bind(window, "mouseup", h),
  10536. u = e.clientY
  10537. }
  10538. function c(e) {
  10539. var t = u - e.clientY;
  10540. d.setValue(d.getValue() + t * d.__impliedStep),
  10541. u = e.clientY
  10542. }
  10543. function h() {
  10544. t.unbind(window, "mousemove", c),
  10545. t.unbind(window, "mouseup", h)
  10546. }
  10547. this.__truncationSuspended = !1,
  10548. r.superclass.call(this, e, n, o);
  10549. var u, d = this;
  10550. this.__input = document.createElement("input"),
  10551. this.__input.setAttribute("type", "text"),
  10552. t.bind(this.__input, "change", a),
  10553. t.bind(this.__input, "blur", s),
  10554. t.bind(this.__input, "mousedown", l),
  10555. t.bind(this.__input, "keydown", function(e) {
  10556. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10557. this.blur(),
  10558. d.__truncationSuspended = !1)
  10559. }),
  10560. this.updateDisplay(),
  10561. this.domElement.appendChild(this.__input)
  10562. };
  10563. return r.superclass = e,
  10564. i.extend(r.prototype, e.prototype, {
  10565. updateDisplay: function() {
  10566. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10567. r.superclass.prototype.updateDisplay.call(this)
  10568. }
  10569. }),
  10570. r
  10571. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10572. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10573. function o(e, t, i, n, r) {
  10574. return n + (r - n) * ((e - t) / (i - t))
  10575. }
  10576. var a = function(e, i, n, r, s) {
  10577. function l(e) {
  10578. t.bind(window, "mousemove", c),
  10579. t.bind(window, "mouseup", h),
  10580. c(e)
  10581. }
  10582. function c(e) {
  10583. e.preventDefault();
  10584. var i = t.getOffset(u.__background)
  10585. , n = t.getWidth(u.__background);
  10586. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10587. !1
  10588. }
  10589. function h() {
  10590. t.unbind(window, "mousemove", c),
  10591. t.unbind(window, "mouseup", h),
  10592. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10593. }
  10594. a.superclass.call(this, e, i, {
  10595. min: n,
  10596. max: r,
  10597. step: s
  10598. });
  10599. var u = this;
  10600. this.__background = document.createElement("div"),
  10601. this.__foreground = document.createElement("div"),
  10602. t.bind(this.__background, "mousedown", l),
  10603. t.addClass(this.__background, "slider"),
  10604. t.addClass(this.__foreground, "slider-fg"),
  10605. this.updateDisplay(),
  10606. this.__background.appendChild(this.__foreground),
  10607. this.domElement.appendChild(this.__background)
  10608. };
  10609. return a.superclass = e,
  10610. a.useDefaultStyles = function() {
  10611. i.inject(r)
  10612. }
  10613. ,
  10614. n.extend(a.prototype, e.prototype, {
  10615. updateDisplay: function() {
  10616. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10617. return this.__foreground.style.width = 100 * e + "%",
  10618. a.superclass.prototype.updateDisplay.call(this)
  10619. }
  10620. }),
  10621. a
  10622. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\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}"),
  10623. n.controllers.FunctionController = function(e, t, i) {
  10624. var n = function(e, i, r) {
  10625. n.superclass.call(this, e, i);
  10626. var o = this;
  10627. this.__button = document.createElement("div"),
  10628. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10629. t.bind(this.__button, "click", function(e) {
  10630. return e.preventDefault(),
  10631. o.fire(),
  10632. !1
  10633. }),
  10634. t.addClass(this.__button, "button"),
  10635. this.domElement.appendChild(this.__button)
  10636. };
  10637. return n.superclass = e,
  10638. i.extend(n.prototype, e.prototype, {
  10639. fire: function() {
  10640. this.__onChange && this.__onChange.call(this),
  10641. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10642. this.getValue().call(this.object)
  10643. }
  10644. }),
  10645. n
  10646. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10647. n.controllers.BooleanController = function(e, t, i) {
  10648. var n = function(e, i) {
  10649. function r() {
  10650. o.setValue(!o.__prev)
  10651. }
  10652. n.superclass.call(this, e, i);
  10653. var o = this;
  10654. this.__prev = this.getValue(),
  10655. this.__checkbox = document.createElement("input"),
  10656. this.__checkbox.setAttribute("type", "checkbox"),
  10657. t.bind(this.__checkbox, "change", r, !1),
  10658. this.domElement.appendChild(this.__checkbox),
  10659. this.updateDisplay()
  10660. };
  10661. return n.superclass = e,
  10662. i.extend(n.prototype, e.prototype, {
  10663. setValue: function(e) {
  10664. var t = n.superclass.prototype.setValue.call(this, e);
  10665. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10666. this.__prev = this.getValue(),
  10667. t
  10668. },
  10669. updateDisplay: function() {
  10670. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10671. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10672. n.superclass.prototype.updateDisplay.call(this)
  10673. }
  10674. }),
  10675. n
  10676. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10677. n.color.toString = function(e) {
  10678. return function(t) {
  10679. if (1 == t.a || e.isUndefined(t.a)) {
  10680. for (var i = t.hex.toString(16); i.length < 6; )
  10681. i = "0" + i;
  10682. return "#" + i
  10683. }
  10684. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10685. }
  10686. }(n.utils.common),
  10687. n.color.interpret = function(e, t) {
  10688. var i, n, r = function() {
  10689. n = !1;
  10690. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10691. return t.each(o, function(r) {
  10692. if (r.litmus(e))
  10693. return t.each(r.conversions, function(r, o) {
  10694. if (i = r.read(e),
  10695. n === !1 && i !== !1)
  10696. return n = i,
  10697. i.conversionName = o,
  10698. i.conversion = r,
  10699. t.BREAK
  10700. }),
  10701. t.BREAK
  10702. }),
  10703. n
  10704. }, o = [{
  10705. litmus: t.isString,
  10706. conversions: {
  10707. THREE_CHAR_HEX: {
  10708. read: function(e) {
  10709. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10710. return null !== t && {
  10711. space: "HEX",
  10712. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10713. }
  10714. },
  10715. write: e
  10716. },
  10717. SIX_CHAR_HEX: {
  10718. read: function(e) {
  10719. var t = e.match(/^#([A-F0-9]{6})$/i);
  10720. return null !== t && {
  10721. space: "HEX",
  10722. hex: parseInt("0x" + t[1].toString())
  10723. }
  10724. },
  10725. write: e
  10726. },
  10727. CSS_RGB: {
  10728. read: function(e) {
  10729. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10730. return null !== t && {
  10731. space: "RGB",
  10732. r: parseFloat(t[1]),
  10733. g: parseFloat(t[2]),
  10734. b: parseFloat(t[3])
  10735. }
  10736. },
  10737. write: e
  10738. },
  10739. CSS_RGBA: {
  10740. read: function(e) {
  10741. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10742. return null !== t && {
  10743. space: "RGB",
  10744. r: parseFloat(t[1]),
  10745. g: parseFloat(t[2]),
  10746. b: parseFloat(t[3]),
  10747. a: parseFloat(t[4])
  10748. }
  10749. },
  10750. write: e
  10751. }
  10752. }
  10753. }, {
  10754. litmus: t.isNumber,
  10755. conversions: {
  10756. HEX: {
  10757. read: function(e) {
  10758. return {
  10759. space: "HEX",
  10760. hex: e,
  10761. conversionName: "HEX"
  10762. }
  10763. },
  10764. write: function(e) {
  10765. return e.hex
  10766. }
  10767. }
  10768. }
  10769. }, {
  10770. litmus: t.isArray,
  10771. conversions: {
  10772. RGB_ARRAY: {
  10773. read: function(e) {
  10774. return 3 == e.length && {
  10775. space: "RGB",
  10776. r: e[0],
  10777. g: e[1],
  10778. b: e[2]
  10779. }
  10780. },
  10781. write: function(e) {
  10782. return [e.r, e.g, e.b]
  10783. }
  10784. },
  10785. RGBA_ARRAY: {
  10786. read: function(e) {
  10787. return 4 == e.length && {
  10788. space: "RGB",
  10789. r: e[0],
  10790. g: e[1],
  10791. b: e[2],
  10792. a: e[3]
  10793. }
  10794. },
  10795. write: function(e) {
  10796. return [e.r, e.g, e.b, e.a]
  10797. }
  10798. }
  10799. }
  10800. }, {
  10801. litmus: t.isObject,
  10802. conversions: {
  10803. RGBA_OBJ: {
  10804. read: function(e) {
  10805. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10806. space: "RGB",
  10807. r: e.r,
  10808. g: e.g,
  10809. b: e.b,
  10810. a: e.a
  10811. }
  10812. },
  10813. write: function(e) {
  10814. return {
  10815. r: e.r,
  10816. g: e.g,
  10817. b: e.b,
  10818. a: e.a
  10819. }
  10820. }
  10821. },
  10822. RGB_OBJ: {
  10823. read: function(e) {
  10824. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10825. space: "RGB",
  10826. r: e.r,
  10827. g: e.g,
  10828. b: e.b
  10829. }
  10830. },
  10831. write: function(e) {
  10832. return {
  10833. r: e.r,
  10834. g: e.g,
  10835. b: e.b
  10836. }
  10837. }
  10838. },
  10839. HSVA_OBJ: {
  10840. read: function(e) {
  10841. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10842. space: "HSV",
  10843. h: e.h,
  10844. s: e.s,
  10845. v: e.v,
  10846. a: e.a
  10847. }
  10848. },
  10849. write: function(e) {
  10850. return {
  10851. h: e.h,
  10852. s: e.s,
  10853. v: e.v,
  10854. a: e.a
  10855. }
  10856. }
  10857. },
  10858. HSV_OBJ: {
  10859. read: function(e) {
  10860. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10861. space: "HSV",
  10862. h: e.h,
  10863. s: e.s,
  10864. v: e.v
  10865. }
  10866. },
  10867. write: function(e) {
  10868. return {
  10869. h: e.h,
  10870. s: e.s,
  10871. v: e.v
  10872. }
  10873. }
  10874. }
  10875. }
  10876. }];
  10877. return r
  10878. }(n.color.toString, n.utils.common),
  10879. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10880. function g(e, t, i, o) {
  10881. if (void 0 === t[i])
  10882. throw new Error("Object " + t + ' has no property "' + i + '"');
  10883. var a;
  10884. if (o.color)
  10885. a = new h(t,i);
  10886. else {
  10887. var s = [t, i].concat(o.factoryArgs);
  10888. a = n.apply(e, s)
  10889. }
  10890. o.before instanceof r && (o.before = o.before.__li),
  10891. A(e, a),
  10892. p.addClass(a.domElement, "c");
  10893. var l = document.createElement("span");
  10894. p.addClass(l, "property-name"),
  10895. l.innerHTML = a.property;
  10896. var c = document.createElement("div");
  10897. c.appendChild(l),
  10898. c.appendChild(a.domElement);
  10899. var u = m(e, c, o.before);
  10900. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10901. p.addClass(u, typeof a.getValue()),
  10902. v(e, u, a),
  10903. e.__controllers.push(a),
  10904. a
  10905. }
  10906. function m(e, t, i) {
  10907. var n = document.createElement("li");
  10908. return t && n.appendChild(t),
  10909. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10910. e.onResize(),
  10911. n
  10912. }
  10913. function v(e, t, i) {
  10914. if (i.__li = t,
  10915. i.__gui = e,
  10916. f.extend(i, {
  10917. options: function(t) {
  10918. return arguments.length > 1 ? (i.remove(),
  10919. g(e, i.object, i.property, {
  10920. before: i.__li.nextElementSibling,
  10921. factoryArgs: [f.toArray(arguments)]
  10922. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10923. g(e, i.object, i.property, {
  10924. before: i.__li.nextElementSibling,
  10925. factoryArgs: [t]
  10926. })) : void 0
  10927. },
  10928. name: function(e) {
  10929. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10930. i
  10931. },
  10932. listen: function() {
  10933. return i.__gui.listen(i),
  10934. i
  10935. },
  10936. remove: function() {
  10937. return i.__gui.remove(i),
  10938. i
  10939. }
  10940. }),
  10941. i instanceof l) {
  10942. var n = new s(i.object,i.property,{
  10943. min: i.__min,
  10944. max: i.__max,
  10945. step: i.__step
  10946. });
  10947. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10948. var t = i[e]
  10949. , r = n[e];
  10950. i[e] = n[e] = function() {
  10951. var e = Array.prototype.slice.call(arguments);
  10952. return t.apply(i, e),
  10953. r.apply(n, e)
  10954. }
  10955. }),
  10956. p.addClass(t, "has-slider"),
  10957. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10958. } else if (i instanceof s) {
  10959. var r = function(t) {
  10960. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10961. g(e, i.object, i.property, {
  10962. before: i.__li.nextElementSibling,
  10963. factoryArgs: [i.__min, i.__max, i.__step]
  10964. })) : t
  10965. };
  10966. i.min = f.compose(r, i.min),
  10967. i.max = f.compose(r, i.max)
  10968. } else
  10969. i instanceof o ? (p.bind(t, "click", function() {
  10970. p.fakeEvent(i.__checkbox, "click")
  10971. }),
  10972. p.bind(i.__checkbox, "click", function(e) {
  10973. e.stopPropagation()
  10974. })) : i instanceof a ? (p.bind(t, "click", function() {
  10975. p.fakeEvent(i.__button, "click")
  10976. }),
  10977. p.bind(t, "mouseover", function() {
  10978. p.addClass(i.__button, "hover")
  10979. }),
  10980. p.bind(t, "mouseout", function() {
  10981. p.removeClass(i.__button, "hover")
  10982. })) : i instanceof h && (p.addClass(t, "color"),
  10983. i.updateDisplay = f.compose(function(e) {
  10984. return t.style.borderLeftColor = i.__color.toString(),
  10985. e
  10986. }, i.updateDisplay),
  10987. i.updateDisplay());
  10988. i.setValue = f.compose(function(t) {
  10989. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10990. t
  10991. }, i.setValue)
  10992. }
  10993. function A(e, t) {
  10994. var i = e.getRoot()
  10995. , n = i.__rememberedObjects.indexOf(t.object);
  10996. if (n != -1) {
  10997. var r = i.__rememberedObjectIndecesToControllers[n];
  10998. if (void 0 === r && (r = {},
  10999. i.__rememberedObjectIndecesToControllers[n] = r),
  11000. r[t.property] = t,
  11001. i.load && i.load.remembered) {
  11002. var o, a = i.load.remembered;
  11003. if (a[e.preset])
  11004. o = a[e.preset];
  11005. else {
  11006. if (!a[L])
  11007. return;
  11008. o = a[L]
  11009. }
  11010. if (o[n] && void 0 !== o[n][t.property]) {
  11011. var s = o[n][t.property];
  11012. t.initialValue = s,
  11013. t.setValue(s)
  11014. }
  11015. }
  11016. }
  11017. }
  11018. function y(e, t) {
  11019. return document.location.href + "." + t
  11020. }
  11021. function C(e) {
  11022. var t = e.__save_row = document.createElement("li");
  11023. p.addClass(e.domElement, "has-save"),
  11024. e.__ul.insertBefore(t, e.__ul.firstChild),
  11025. p.addClass(t, "save-row");
  11026. var i = document.createElement("span");
  11027. i.innerHTML = "&nbsp;",
  11028. p.addClass(i, "button gears");
  11029. var n = document.createElement("span");
  11030. n.innerHTML = "Save",
  11031. p.addClass(n, "button"),
  11032. p.addClass(n, "save");
  11033. var r = document.createElement("span");
  11034. r.innerHTML = "New",
  11035. p.addClass(r, "button"),
  11036. p.addClass(r, "save-as");
  11037. var o = document.createElement("span");
  11038. o.innerHTML = "Revert",
  11039. p.addClass(o, "button"),
  11040. p.addClass(o, "revert");
  11041. var a = e.__preset_select = document.createElement("select");
  11042. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  11043. w(e, i, i == e.preset)
  11044. }) : w(e, L, !1),
  11045. p.bind(a, "change", function() {
  11046. for (var t = 0; t < e.__preset_select.length; t++)
  11047. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  11048. e.preset = this.value
  11049. }),
  11050. t.appendChild(a),
  11051. t.appendChild(i),
  11052. t.appendChild(n),
  11053. t.appendChild(r),
  11054. t.appendChild(o),
  11055. D) {
  11056. var s = document.getElementById("dg-save-locally")
  11057. , l = document.getElementById("dg-local-explain");
  11058. s.style.display = "block";
  11059. var c = document.getElementById("dg-local-storage");
  11060. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  11061. var h = function() {
  11062. l.style.display = e.useLocalStorage ? "block" : "none"
  11063. };
  11064. h(),
  11065. p.bind(c, "change", function() {
  11066. e.useLocalStorage = !e.useLocalStorage,
  11067. h()
  11068. })
  11069. }
  11070. var u = document.getElementById("dg-new-constructor");
  11071. p.bind(u, "keydown", function(e) {
  11072. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  11073. }),
  11074. p.bind(i, "click", function() {
  11075. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  11076. S.show(),
  11077. u.focus(),
  11078. u.select()
  11079. }),
  11080. p.bind(n, "click", function() {
  11081. e.save()
  11082. }),
  11083. p.bind(r, "click", function() {
  11084. var t = prompt("Enter a new preset name.");
  11085. t && e.saveAs(t)
  11086. }),
  11087. p.bind(o, "click", function() {
  11088. e.revert()
  11089. })
  11090. }
  11091. function I(e) {
  11092. function t(t) {
  11093. return t.preventDefault(),
  11094. r = t.clientX,
  11095. p.addClass(e.__closeButton, V.CLASS_DRAG),
  11096. p.bind(window, "mousemove", i),
  11097. p.bind(window, "mouseup", n),
  11098. !1
  11099. }
  11100. function i(t) {
  11101. return t.preventDefault(),
  11102. e.width += r - t.clientX,
  11103. e.onResize(),
  11104. r = t.clientX,
  11105. !1
  11106. }
  11107. function n() {
  11108. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  11109. p.unbind(window, "mousemove", i),
  11110. p.unbind(window, "mouseup", n)
  11111. }
  11112. e.__resize_handle = document.createElement("div"),
  11113. f.extend(e.__resize_handle.style, {
  11114. width: "6px",
  11115. marginLeft: "-3px",
  11116. height: "200px",
  11117. cursor: "ew-resize",
  11118. position: "absolute"
  11119. });
  11120. var r;
  11121. p.bind(e.__resize_handle, "mousedown", t),
  11122. p.bind(e.__closeButton, "mousedown", t),
  11123. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  11124. }
  11125. function E(e, t) {
  11126. e.domElement.style.width = t + "px",
  11127. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  11128. e.__closeButton && (e.__closeButton.style.width = t + "px")
  11129. }
  11130. function b(e, t) {
  11131. var i = {};
  11132. return f.each(e.__rememberedObjects, function(n, r) {
  11133. var o = {}
  11134. , a = e.__rememberedObjectIndecesToControllers[r];
  11135. f.each(a, function(e, i) {
  11136. o[i] = t ? e.initialValue : e.getValue()
  11137. }),
  11138. i[r] = o
  11139. }),
  11140. i
  11141. }
  11142. function w(e, t, i) {
  11143. var n = document.createElement("option");
  11144. n.innerHTML = t,
  11145. n.value = t,
  11146. e.__preset_select.appendChild(n),
  11147. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  11148. }
  11149. function _(e) {
  11150. for (var t = 0; t < e.__preset_select.length; t++)
  11151. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  11152. }
  11153. function T(e, t) {
  11154. var i = e.__preset_select[e.__preset_select.selectedIndex];
  11155. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  11156. }
  11157. function x(e) {
  11158. 0 != e.length && u(function() {
  11159. x(e)
  11160. }),
  11161. f.each(e, function(e) {
  11162. e.updateDisplay()
  11163. })
  11164. }
  11165. e.inject(i);
  11166. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  11167. try {
  11168. return "localStorage"in window && null !== window.localStorage
  11169. } catch (e) {
  11170. return !1
  11171. }
  11172. }(), N = !0, B = !1, F = [], V = function(e) {
  11173. function t() {
  11174. var e = i.getRoot();
  11175. e.width += 1,
  11176. f.defer(function() {
  11177. e.width -= 1
  11178. })
  11179. }
  11180. var i = this;
  11181. this.domElement = document.createElement("div"),
  11182. this.__ul = document.createElement("ul"),
  11183. this.domElement.appendChild(this.__ul),
  11184. p.addClass(this.domElement, R),
  11185. this.__folders = {},
  11186. this.__controllers = [],
  11187. this.__rememberedObjects = [],
  11188. this.__rememberedObjectIndecesToControllers = [],
  11189. this.__listening = [],
  11190. e = e || {},
  11191. e = f.defaults(e, {
  11192. autoPlace: !0,
  11193. width: V.DEFAULT_WIDTH
  11194. }),
  11195. e = f.defaults(e, {
  11196. resizable: e.autoPlace,
  11197. hideable: e.autoPlace
  11198. }),
  11199. f.isUndefined(e.load) ? e.load = {
  11200. preset: L
  11201. } : e.preset && (e.load.preset = e.preset),
  11202. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11203. e.resizable = f.isUndefined(e.parent) && e.resizable,
  11204. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  11205. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  11206. if (Object.defineProperties(this, {
  11207. parent: {
  11208. get: function() {
  11209. return e.parent
  11210. }
  11211. },
  11212. scrollable: {
  11213. get: function() {
  11214. return e.scrollable
  11215. }
  11216. },
  11217. autoPlace: {
  11218. get: function() {
  11219. return e.autoPlace
  11220. }
  11221. },
  11222. preset: {
  11223. get: function() {
  11224. return i.parent ? i.getRoot().preset : e.load.preset
  11225. },
  11226. set: function(t) {
  11227. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  11228. _(this),
  11229. i.revert()
  11230. }
  11231. },
  11232. width: {
  11233. get: function() {
  11234. return e.width
  11235. },
  11236. set: function(t) {
  11237. e.width = t,
  11238. E(i, t)
  11239. }
  11240. },
  11241. name: {
  11242. get: function() {
  11243. return e.name
  11244. },
  11245. set: function(t) {
  11246. e.name = t,
  11247. a && (a.innerHTML = e.name)
  11248. }
  11249. },
  11250. closed: {
  11251. get: function() {
  11252. return e.closed
  11253. },
  11254. set: function(t) {
  11255. e.closed = t,
  11256. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11257. this.onResize(),
  11258. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11259. }
  11260. },
  11261. load: {
  11262. get: function() {
  11263. return e.load
  11264. }
  11265. },
  11266. useLocalStorage: {
  11267. get: function() {
  11268. return r
  11269. },
  11270. set: function(e) {
  11271. D && (r = e,
  11272. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11273. localStorage.setItem(y(i, "isLocal"), e))
  11274. }
  11275. }
  11276. }),
  11277. f.isUndefined(e.parent)) {
  11278. if (e.closed = !1,
  11279. p.addClass(this.domElement, V.CLASS_MAIN),
  11280. p.makeSelectable(this.domElement, !1),
  11281. D && r) {
  11282. i.useLocalStorage = !0;
  11283. var o = localStorage.getItem(y(this, "gui"));
  11284. o && (e.load = JSON.parse(o))
  11285. }
  11286. this.__closeButton = document.createElement("div"),
  11287. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11288. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11289. this.domElement.appendChild(this.__closeButton),
  11290. p.bind(this.__closeButton, "click", function() {
  11291. i.closed = !i.closed
  11292. })
  11293. } else {
  11294. void 0 === e.closed && (e.closed = !0);
  11295. var a = document.createTextNode(e.name);
  11296. p.addClass(a, "controller-name");
  11297. var s = m(i, a)
  11298. , l = function(e) {
  11299. return e.preventDefault(),
  11300. i.closed = !i.closed,
  11301. !1
  11302. };
  11303. p.addClass(this.__ul, V.CLASS_CLOSED),
  11304. p.addClass(s, "title"),
  11305. p.bind(s, "click", l),
  11306. e.closed || (this.closed = !1)
  11307. }
  11308. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11309. p.addClass(M, R),
  11310. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11311. document.body.appendChild(M),
  11312. N = !1),
  11313. M.appendChild(this.domElement),
  11314. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11315. this.parent || E(i, e.width)),
  11316. p.bind(window, "resize", function() {
  11317. i.onResize()
  11318. }),
  11319. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11320. i.onResize()
  11321. }),
  11322. p.bind(this.__ul, "transitionend", function() {
  11323. i.onResize()
  11324. }),
  11325. p.bind(this.__ul, "oTransitionEnd", function() {
  11326. i.onResize()
  11327. }),
  11328. this.onResize(),
  11329. e.resizable && I(this),
  11330. n = function() {
  11331. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11332. }
  11333. ,
  11334. this.saveToLocalStorageIfPossible = n;
  11335. i.getRoot();
  11336. e.parent || t()
  11337. };
  11338. return V.toggleHide = function() {
  11339. B = !B,
  11340. f.each(F, function(e) {
  11341. e.domElement.style.zIndex = B ? -999 : 999,
  11342. e.domElement.style.opacity = B ? 0 : 1
  11343. })
  11344. }
  11345. ,
  11346. V.CLASS_AUTO_PLACE = "a",
  11347. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11348. V.CLASS_MAIN = "main",
  11349. V.CLASS_CONTROLLER_ROW = "cr",
  11350. V.CLASS_TOO_TALL = "taller-than-window",
  11351. V.CLASS_CLOSED = "closed",
  11352. V.CLASS_CLOSE_BUTTON = "close-button",
  11353. V.CLASS_DRAG = "drag",
  11354. V.DEFAULT_WIDTH = 245,
  11355. V.TEXT_CLOSED = "Close Controls",
  11356. V.TEXT_OPEN = "Open Controls",
  11357. p.bind(window, "keydown", function(e) {
  11358. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11359. }, !1),
  11360. f.extend(V.prototype, {
  11361. add: function(e, t) {
  11362. return g(this, e, t, {
  11363. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11364. })
  11365. },
  11366. addColor: function(e, t) {
  11367. return g(this, e, t, {
  11368. color: !0
  11369. })
  11370. },
  11371. remove: function(e) {
  11372. this.__ul.removeChild(e.__li),
  11373. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11374. var t = this;
  11375. f.defer(function() {
  11376. t.onResize()
  11377. })
  11378. },
  11379. destroy: function() {
  11380. this.autoPlace && M.removeChild(this.domElement)
  11381. },
  11382. addFolder: function(e) {
  11383. if (void 0 !== this.__folders[e])
  11384. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11385. var t = {
  11386. name: e,
  11387. parent: this
  11388. };
  11389. t.autoPlace = this.autoPlace,
  11390. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11391. t.load = this.load.folders[e]);
  11392. var i = new V(t);
  11393. this.__folders[e] = i;
  11394. var n = m(this, i.domElement);
  11395. return p.addClass(n, "folder"),
  11396. i
  11397. },
  11398. open: function() {
  11399. this.closed = !1
  11400. },
  11401. close: function() {
  11402. this.closed = !0
  11403. },
  11404. onResize: function() {
  11405. var e = this.getRoot();
  11406. if (e.scrollable) {
  11407. var t = p.getOffset(e.__ul).top
  11408. , i = 0;
  11409. f.each(e.__ul.childNodes, function(t) {
  11410. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11411. }),
  11412. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11413. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11414. e.__ul.style.height = "auto")
  11415. }
  11416. e.__resize_handle && f.defer(function() {
  11417. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11418. }),
  11419. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11420. },
  11421. remember: function() {
  11422. if (f.isUndefined(S) && (S = new d,
  11423. S.domElement.innerHTML = t),
  11424. this.parent)
  11425. throw new Error("You can only call remember on a top level GUI.");
  11426. var e = this;
  11427. f.each(Array.prototype.slice.call(arguments), function(t) {
  11428. 0 == e.__rememberedObjects.length && C(e),
  11429. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11430. }),
  11431. this.autoPlace && E(this, this.width)
  11432. },
  11433. getRoot: function() {
  11434. for (var e = this; e.parent; )
  11435. e = e.parent;
  11436. return e
  11437. },
  11438. getSaveObject: function() {
  11439. var e = this.load;
  11440. return e.closed = this.closed,
  11441. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11442. e.remembered || (e.remembered = {}),
  11443. e.remembered[this.preset] = b(this)),
  11444. e.folders = {},
  11445. f.each(this.__folders, function(t, i) {
  11446. e.folders[i] = t.getSaveObject()
  11447. }),
  11448. e
  11449. },
  11450. save: function() {
  11451. this.load.remembered || (this.load.remembered = {}),
  11452. this.load.remembered[this.preset] = b(this),
  11453. T(this, !1),
  11454. this.saveToLocalStorageIfPossible()
  11455. },
  11456. saveAs: function(e) {
  11457. this.load.remembered || (this.load.remembered = {},
  11458. this.load.remembered[L] = b(this, !0)),
  11459. this.load.remembered[e] = b(this),
  11460. this.preset = e,
  11461. w(this, e, !0),
  11462. this.saveToLocalStorageIfPossible()
  11463. },
  11464. revert: function(e) {
  11465. f.each(this.__controllers, function(t) {
  11466. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11467. }, this),
  11468. f.each(this.__folders, function(e) {
  11469. e.revert(e)
  11470. }),
  11471. e || T(this.getRoot(), !1)
  11472. },
  11473. listen: function(e) {
  11474. var t = 0 == this.__listening.length;
  11475. this.__listening.push(e),
  11476. t && x(this.__listening)
  11477. }
  11478. }),
  11479. V
  11480. }(n.utils.css, '<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>', ".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", n.controllers.factory = function(e, t, i, n, r, o, a) {
  11481. return function(s, l) {
  11482. var c = s[l];
  11483. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  11484. min: arguments[2],
  11485. max: arguments[3]
  11486. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11487. }
  11488. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11489. var n = function(e, i) {
  11490. function r() {
  11491. a.setValue(a.__input.value)
  11492. }
  11493. function o() {
  11494. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11495. }
  11496. n.superclass.call(this, e, i);
  11497. var a = this;
  11498. this.__input = document.createElement("input"),
  11499. this.__input.setAttribute("type", "text"),
  11500. t.bind(this.__input, "keyup", r),
  11501. t.bind(this.__input, "change", r),
  11502. t.bind(this.__input, "blur", o),
  11503. t.bind(this.__input, "keydown", function(e) {
  11504. 13 === e.keyCode && this.blur()
  11505. }),
  11506. this.updateDisplay(),
  11507. this.domElement.appendChild(this.__input)
  11508. };
  11509. return n.superclass = e,
  11510. i.extend(n.prototype, e.prototype, {
  11511. updateDisplay: function() {
  11512. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11513. n.superclass.prototype.updateDisplay.call(this)
  11514. }
  11515. }),
  11516. n
  11517. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  11518. function o(e, t, i, n) {
  11519. e.style.background = "",
  11520. r.each(l, function(r) {
  11521. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11522. })
  11523. }
  11524. function a(e) {
  11525. e.style.background = "",
  11526. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11527. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11528. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11529. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11530. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11531. }
  11532. var s = function(e, l) {
  11533. function c(e) {
  11534. p(e),
  11535. t.bind(window, "mousemove", p),
  11536. t.bind(window, "mouseup", h)
  11537. }
  11538. function h() {
  11539. t.unbind(window, "mousemove", p),
  11540. t.unbind(window, "mouseup", h)
  11541. }
  11542. function u() {
  11543. var e = n(this.value);
  11544. e !== !1 ? (g.__color.__state = e,
  11545. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11546. }
  11547. function d() {
  11548. t.unbind(window, "mousemove", f),
  11549. t.unbind(window, "mouseup", d)
  11550. }
  11551. function p(e) {
  11552. e.preventDefault();
  11553. var i = t.getWidth(g.__saturation_field)
  11554. , n = t.getOffset(g.__saturation_field)
  11555. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11556. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11557. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11558. r > 1 ? r = 1 : r < 0 && (r = 0),
  11559. g.__color.v = o,
  11560. g.__color.s = r,
  11561. g.setValue(g.__color.toOriginal()),
  11562. !1
  11563. }
  11564. function f(e) {
  11565. e.preventDefault();
  11566. var i = t.getHeight(g.__hue_field)
  11567. , n = t.getOffset(g.__hue_field)
  11568. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11569. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11570. g.__color.h = 360 * r,
  11571. g.setValue(g.__color.toOriginal()),
  11572. !1
  11573. }
  11574. s.superclass.call(this, e, l),
  11575. this.__color = new i(this.getValue()),
  11576. this.__temp = new i(0);
  11577. var g = this;
  11578. this.domElement = document.createElement("div"),
  11579. t.makeSelectable(this.domElement, !1),
  11580. this.__selector = document.createElement("div"),
  11581. this.__selector.className = "selector",
  11582. this.__saturation_field = document.createElement("div"),
  11583. this.__saturation_field.className = "saturation-field",
  11584. this.__field_knob = document.createElement("div"),
  11585. this.__field_knob.className = "field-knob",
  11586. this.__field_knob_border = "2px solid ",
  11587. this.__hue_knob = document.createElement("div"),
  11588. this.__hue_knob.className = "hue-knob",
  11589. this.__hue_field = document.createElement("div"),
  11590. this.__hue_field.className = "hue-field",
  11591. this.__input = document.createElement("input"),
  11592. this.__input.type = "text",
  11593. this.__input_textShadow = "0 1px 1px ",
  11594. t.bind(this.__input, "keydown", function(e) {
  11595. 13 === e.keyCode && u.call(this)
  11596. }),
  11597. t.bind(this.__input, "blur", u),
  11598. t.bind(this.__selector, "mousedown", function(e) {
  11599. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11600. t.removeClass(g.__selector, "drag")
  11601. })
  11602. });
  11603. var m = document.createElement("div");
  11604. r.extend(this.__selector.style, {
  11605. width: "122px",
  11606. height: "102px",
  11607. padding: "3px",
  11608. backgroundColor: "#222",
  11609. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11610. }),
  11611. r.extend(this.__field_knob.style, {
  11612. position: "absolute",
  11613. width: "12px",
  11614. height: "12px",
  11615. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11616. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11617. borderRadius: "12px",
  11618. zIndex: 1
  11619. }),
  11620. r.extend(this.__hue_knob.style, {
  11621. position: "absolute",
  11622. width: "15px",
  11623. height: "2px",
  11624. borderRight: "4px solid #fff",
  11625. zIndex: 1
  11626. }),
  11627. r.extend(this.__saturation_field.style, {
  11628. width: "100px",
  11629. height: "100px",
  11630. border: "1px solid #555",
  11631. marginRight: "3px",
  11632. display: "inline-block",
  11633. cursor: "pointer"
  11634. }),
  11635. r.extend(m.style, {
  11636. width: "100%",
  11637. height: "100%",
  11638. background: "none"
  11639. }),
  11640. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11641. r.extend(this.__hue_field.style, {
  11642. width: "15px",
  11643. height: "100px",
  11644. display: "inline-block",
  11645. border: "1px solid #555",
  11646. cursor: "ns-resize"
  11647. }),
  11648. a(this.__hue_field),
  11649. r.extend(this.__input.style, {
  11650. outline: "none",
  11651. textAlign: "center",
  11652. color: "#fff",
  11653. border: 0,
  11654. fontWeight: "bold",
  11655. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11656. }),
  11657. t.bind(this.__saturation_field, "mousedown", c),
  11658. t.bind(this.__field_knob, "mousedown", c),
  11659. t.bind(this.__hue_field, "mousedown", function(e) {
  11660. f(e),
  11661. t.bind(window, "mousemove", f),
  11662. t.bind(window, "mouseup", d)
  11663. }),
  11664. this.__saturation_field.appendChild(m),
  11665. this.__selector.appendChild(this.__field_knob),
  11666. this.__selector.appendChild(this.__saturation_field),
  11667. this.__selector.appendChild(this.__hue_field),
  11668. this.__hue_field.appendChild(this.__hue_knob),
  11669. this.domElement.appendChild(this.__input),
  11670. this.domElement.appendChild(this.__selector),
  11671. this.updateDisplay()
  11672. };
  11673. s.superclass = e,
  11674. r.extend(s.prototype, e.prototype, {
  11675. updateDisplay: function() {
  11676. var e = n(this.getValue());
  11677. if (e !== !1) {
  11678. var t = !1;
  11679. r.each(i.COMPONENTS, function(i) {
  11680. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11681. return t = !0,
  11682. {}
  11683. }, this),
  11684. t && r.extend(this.__color.__state, e)
  11685. }
  11686. r.extend(this.__temp.__state, this.__color.__state),
  11687. this.__temp.a = 1;
  11688. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11689. , s = 255 - a;
  11690. r.extend(this.__field_knob.style, {
  11691. marginLeft: 100 * this.__color.s - 7 + "px",
  11692. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11693. backgroundColor: this.__temp.toString(),
  11694. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11695. }),
  11696. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11697. this.__temp.s = 1,
  11698. this.__temp.v = 1,
  11699. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11700. r.extend(this.__input.style, {
  11701. backgroundColor: this.__input.value = this.__color.toString(),
  11702. color: "rgb(" + a + "," + a + "," + a + ")",
  11703. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11704. })
  11705. }
  11706. });
  11707. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11708. return s
  11709. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11710. function r(e, t, i) {
  11711. Object.defineProperty(e, t, {
  11712. get: function() {
  11713. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11714. this.__state[t])
  11715. },
  11716. set: function(e) {
  11717. "RGB" !== this.__state.space && (a(this, t, i),
  11718. this.__state.space = "RGB"),
  11719. this.__state[t] = e
  11720. }
  11721. })
  11722. }
  11723. function o(e, t) {
  11724. Object.defineProperty(e, t, {
  11725. get: function() {
  11726. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11727. this.__state[t])
  11728. },
  11729. set: function(e) {
  11730. "HSV" !== this.__state.space && (s(this),
  11731. this.__state.space = "HSV"),
  11732. this.__state[t] = e
  11733. }
  11734. })
  11735. }
  11736. function a(e, i, r) {
  11737. if ("HEX" === e.__state.space)
  11738. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11739. else {
  11740. if ("HSV" !== e.__state.space)
  11741. throw "Corrupted color state";
  11742. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11743. }
  11744. }
  11745. function s(e) {
  11746. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11747. n.extend(e.__state, {
  11748. s: i.s,
  11749. v: i.v
  11750. }),
  11751. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11752. }
  11753. var l = function() {
  11754. if (this.__state = e.apply(this, arguments),
  11755. this.__state === !1)
  11756. throw "Failed to interpret color arguments";
  11757. this.__state.a = this.__state.a || 1
  11758. };
  11759. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11760. n.extend(l.prototype, {
  11761. toString: function() {
  11762. return i(this)
  11763. },
  11764. toOriginal: function() {
  11765. return this.__state.conversion.write(this)
  11766. }
  11767. }),
  11768. r(l.prototype, "r", 2),
  11769. r(l.prototype, "g", 1),
  11770. r(l.prototype, "b", 0),
  11771. o(l.prototype, "h"),
  11772. o(l.prototype, "s"),
  11773. o(l.prototype, "v"),
  11774. Object.defineProperty(l.prototype, "a", {
  11775. get: function() {
  11776. return this.__state.a
  11777. },
  11778. set: function(e) {
  11779. this.__state.a = e
  11780. }
  11781. }),
  11782. Object.defineProperty(l.prototype, "hex", {
  11783. get: function() {
  11784. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11785. this.__state.hex
  11786. },
  11787. set: function(e) {
  11788. this.__state.space = "HEX",
  11789. this.__state.hex = e
  11790. }
  11791. }),
  11792. l
  11793. }(n.color.interpret, n.color.math = function() {
  11794. var e;
  11795. return {
  11796. hsv_to_rgb: function(e, t, i) {
  11797. var n = Math.floor(e / 60) % 6
  11798. , r = e / 60 - Math.floor(e / 60)
  11799. , o = i * (1 - t)
  11800. , a = i * (1 - r * t)
  11801. , s = i * (1 - (1 - r) * t)
  11802. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11803. return {
  11804. r: 255 * l[0],
  11805. g: 255 * l[1],
  11806. b: 255 * l[2]
  11807. }
  11808. },
  11809. rgb_to_hsv: function(e, t, i) {
  11810. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11811. return 0 == a ? {
  11812. h: NaN,
  11813. s: 0,
  11814. v: 0
  11815. } : (r = s / a,
  11816. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11817. n /= 6,
  11818. n < 0 && (n += 1),
  11819. {
  11820. h: 360 * n,
  11821. s: r,
  11822. v: a / 255
  11823. })
  11824. },
  11825. rgb_to_hex: function(e, t, i) {
  11826. var n = this.hex_with_component(0, 2, e);
  11827. return n = this.hex_with_component(n, 1, t),
  11828. n = this.hex_with_component(n, 0, i)
  11829. },
  11830. component_from_hex: function(e, t) {
  11831. return e >> 8 * t & 255
  11832. },
  11833. hex_with_component: function(t, i, n) {
  11834. return n << (e = 8 * i) | t & ~(255 << e)
  11835. }
  11836. }
  11837. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11838. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11839. window.setTimeout(e, 1e3 / 60)
  11840. }
  11841. }(), n.dom.CenteredDiv = function(e, t) {
  11842. var i = function() {
  11843. this.backgroundElement = document.createElement("div"),
  11844. t.extend(this.backgroundElement.style, {
  11845. backgroundColor: "rgba(0,0,0,0.8)",
  11846. top: 0,
  11847. left: 0,
  11848. display: "none",
  11849. zIndex: "1000",
  11850. opacity: 0,
  11851. WebkitTransition: "opacity 0.2s linear"
  11852. }),
  11853. e.makeFullscreen(this.backgroundElement),
  11854. this.backgroundElement.style.position = "fixed",
  11855. this.domElement = document.createElement("div"),
  11856. t.extend(this.domElement.style, {
  11857. position: "fixed",
  11858. display: "none",
  11859. zIndex: "1001",
  11860. opacity: 0,
  11861. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11862. }),
  11863. document.body.appendChild(this.backgroundElement),
  11864. document.body.appendChild(this.domElement);
  11865. var i = this;
  11866. e.bind(this.backgroundElement, "click", function() {
  11867. i.hide()
  11868. })
  11869. };
  11870. return i.prototype.show = function() {
  11871. var e = this;
  11872. this.backgroundElement.style.display = "block",
  11873. this.domElement.style.display = "block",
  11874. this.domElement.style.opacity = 0,
  11875. this.domElement.style.webkitTransform = "scale(1.1)",
  11876. this.layout(),
  11877. t.defer(function() {
  11878. e.backgroundElement.style.opacity = 1,
  11879. e.domElement.style.opacity = 1,
  11880. e.domElement.style.webkitTransform = "scale(1)"
  11881. })
  11882. }
  11883. ,
  11884. i.prototype.hide = function() {
  11885. var t = this
  11886. , i = function() {
  11887. t.domElement.style.display = "none",
  11888. t.backgroundElement.style.display = "none",
  11889. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11890. e.unbind(t.domElement, "transitionend", i),
  11891. e.unbind(t.domElement, "oTransitionEnd", i)
  11892. };
  11893. e.bind(this.domElement, "webkitTransitionEnd", i),
  11894. e.bind(this.domElement, "transitionend", i),
  11895. e.bind(this.domElement, "oTransitionEnd", i),
  11896. this.backgroundElement.style.opacity = 0,
  11897. this.domElement.style.opacity = 0,
  11898. this.domElement.style.webkitTransform = "scale(1.1)"
  11899. }
  11900. ,
  11901. i.prototype.layout = function() {
  11902. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11903. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11904. }
  11905. ,
  11906. i
  11907. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11908. }
  11909. , {}],
  11910. 94: [function(e, t, i) {
  11911. (function(e) {
  11912. "use strict";
  11913. function i(t) {
  11914. function i(e) {
  11915. for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], i = 0; i < 64; i++) {
  11916. var n = _((t[i] * e + 50) / 100);
  11917. n < 1 ? n = 1 : n > 255 && (n = 255),
  11918. T[G[i]] = n
  11919. }
  11920. for (var r = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
  11921. var a = _((r[o] * e + 50) / 100);
  11922. a < 1 ? a = 1 : a > 255 && (a = 255),
  11923. x[G[o]] = a
  11924. }
  11925. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11926. for (var h = 0; h < 8; h++)
  11927. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11928. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11929. l++
  11930. }
  11931. function n(e, t) {
  11932. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11933. for (var a = 1; a <= e[o]; a++)
  11934. r[t[n]] = [],
  11935. r[t[n]][0] = i,
  11936. r[t[n]][1] = o,
  11937. n++,
  11938. i++;
  11939. i *= 2
  11940. }
  11941. return r
  11942. }
  11943. function r() {
  11944. C = n(z, W),
  11945. I = n(X, Z),
  11946. E = n(j, Y),
  11947. b = n(q, K)
  11948. }
  11949. function o() {
  11950. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11951. for (var n = e; n < t; n++)
  11952. P[32767 + n] = i,
  11953. R[32767 + n] = [],
  11954. R[32767 + n][1] = i,
  11955. R[32767 + n][0] = n;
  11956. for (var r = -(t - 1); r <= -e; r++)
  11957. P[32767 + r] = i,
  11958. R[32767 + r] = [],
  11959. R[32767 + r][1] = i,
  11960. R[32767 + r][0] = t - 1 + r;
  11961. e <<= 1,
  11962. t <<= 1
  11963. }
  11964. }
  11965. function a() {
  11966. for (var e = 0; e < 256; e++)
  11967. H[e] = 19595 * e,
  11968. H[e + 256 >> 0] = 38470 * e,
  11969. H[e + 512 >> 0] = 7471 * e + 32768,
  11970. H[e + 768 >> 0] = -11059 * e,
  11971. H[e + 1024 >> 0] = -21709 * e,
  11972. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11973. H[e + 1536 >> 0] = -27439 * e,
  11974. H[e + 1792 >> 0] = -5329 * e
  11975. }
  11976. function s(e) {
  11977. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11978. t & 1 << i && (N |= 1 << B),
  11979. i--,
  11980. B--,
  11981. B < 0 && (255 == N ? (l(255),
  11982. l(0)) : l(N),
  11983. B = 7,
  11984. N = 0)
  11985. }
  11986. function l(e) {
  11987. D.push(e)
  11988. }
  11989. function c(e) {
  11990. l(e >> 8 & 255),
  11991. l(255 & e)
  11992. }
  11993. function h(e, t) {
  11994. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11995. for (h = 0; h < d; ++h) {
  11996. i = e[u],
  11997. n = e[u + 1],
  11998. r = e[u + 2],
  11999. o = e[u + 3],
  12000. a = e[u + 4],
  12001. s = e[u + 5],
  12002. l = e[u + 6],
  12003. c = e[u + 7];
  12004. var f = i + c
  12005. , g = i - c
  12006. , m = n + l
  12007. , v = n - l
  12008. , A = r + s
  12009. , y = r - s
  12010. , C = o + a
  12011. , I = o - a
  12012. , E = f + C
  12013. , b = f - C
  12014. , w = m + A
  12015. , _ = m - A;
  12016. e[u] = E + w,
  12017. e[u + 4] = E - w;
  12018. var T = .707106781 * (_ + b);
  12019. e[u + 2] = b + T,
  12020. e[u + 6] = b - T,
  12021. E = I + y,
  12022. w = y + v,
  12023. _ = v + g;
  12024. var x = .382683433 * (E - _)
  12025. , S = .5411961 * E + x
  12026. , M = 1.306562965 * _ + x
  12027. , R = .707106781 * w
  12028. , P = g + R
  12029. , L = g - R;
  12030. e[u + 5] = L + S,
  12031. e[u + 3] = L - S,
  12032. e[u + 1] = P + M,
  12033. e[u + 7] = P - M,
  12034. u += 8
  12035. }
  12036. for (u = 0,
  12037. h = 0; h < d; ++h) {
  12038. i = e[u],
  12039. n = e[u + 8],
  12040. r = e[u + 16],
  12041. o = e[u + 24],
  12042. a = e[u + 32],
  12043. s = e[u + 40],
  12044. l = e[u + 48],
  12045. c = e[u + 56];
  12046. var D = i + c
  12047. , N = i - c
  12048. , B = n + l
  12049. , F = n - l
  12050. , V = r + s
  12051. , U = r - s
  12052. , k = o + a
  12053. , H = o - a
  12054. , G = D + k
  12055. , z = D - k
  12056. , W = B + V
  12057. , j = B - V;
  12058. e[u] = G + W,
  12059. e[u + 32] = G - W;
  12060. var Y = .707106781 * (j + z);
  12061. e[u + 16] = z + Y,
  12062. e[u + 48] = z - Y,
  12063. G = H + U,
  12064. W = U + F,
  12065. j = F + N;
  12066. var X = .382683433 * (G - j)
  12067. , Z = .5411961 * G + X
  12068. , q = 1.306562965 * j + X
  12069. , K = .707106781 * W
  12070. , Q = N + K
  12071. , J = N - K;
  12072. e[u + 40] = J + Z,
  12073. e[u + 24] = J - Z,
  12074. e[u + 8] = Q + q,
  12075. e[u + 56] = Q - q,
  12076. u++
  12077. }
  12078. var $;
  12079. for (h = 0; h < p; ++h)
  12080. $ = e[h] * t[h],
  12081. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  12082. return O
  12083. }
  12084. function u() {
  12085. c(65504),
  12086. c(16),
  12087. l(74),
  12088. l(70),
  12089. l(73),
  12090. l(70),
  12091. l(0),
  12092. l(1),
  12093. l(1),
  12094. l(0),
  12095. c(1),
  12096. c(1),
  12097. l(0),
  12098. l(0)
  12099. }
  12100. function d(e, t) {
  12101. c(65472),
  12102. c(17),
  12103. l(8),
  12104. c(t),
  12105. c(e),
  12106. l(3),
  12107. l(1),
  12108. l(17),
  12109. l(0),
  12110. l(2),
  12111. l(17),
  12112. l(1),
  12113. l(3),
  12114. l(17),
  12115. l(1)
  12116. }
  12117. function p() {
  12118. c(65499),
  12119. c(132),
  12120. l(0);
  12121. for (var e = 0; e < 64; e++)
  12122. l(T[e]);
  12123. l(1);
  12124. for (var t = 0; t < 64; t++)
  12125. l(x[t])
  12126. }
  12127. function f() {
  12128. c(65476),
  12129. c(418),
  12130. l(0);
  12131. for (var e = 0; e < 16; e++)
  12132. l(z[e + 1]);
  12133. for (var t = 0; t <= 11; t++)
  12134. l(W[t]);
  12135. l(16);
  12136. for (var i = 0; i < 16; i++)
  12137. l(j[i + 1]);
  12138. for (var n = 0; n <= 161; n++)
  12139. l(Y[n]);
  12140. l(1);
  12141. for (var r = 0; r < 16; r++)
  12142. l(X[r + 1]);
  12143. for (var o = 0; o <= 11; o++)
  12144. l(Z[o]);
  12145. l(17);
  12146. for (var a = 0; a < 16; a++)
  12147. l(q[a + 1]);
  12148. for (var s = 0; s <= 161; s++)
  12149. l(K[s])
  12150. }
  12151. function g() {
  12152. c(65498),
  12153. c(12),
  12154. l(3),
  12155. l(1),
  12156. l(0),
  12157. l(2),
  12158. l(17),
  12159. l(3),
  12160. l(17),
  12161. l(0),
  12162. l(63),
  12163. l(0)
  12164. }
  12165. function m(e, t, i, n, r) {
  12166. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  12167. L[G[f]] = p[f];
  12168. var g = L[0] - i;
  12169. i = L[0],
  12170. 0 == g ? s(n[0]) : (o = 32767 + g,
  12171. s(n[P[o]]),
  12172. s(R[o]));
  12173. for (var m = 63; m > 0 && 0 == L[m]; m--)
  12174. ;
  12175. if (0 == m)
  12176. return s(a),
  12177. i;
  12178. for (var v, A = 1; A <= m; ) {
  12179. for (var y = A; 0 == L[A] && A <= m; ++A)
  12180. ;
  12181. var C = A - y;
  12182. if (C >= c) {
  12183. v = C >> 4;
  12184. for (var I = 1; I <= v; ++I)
  12185. s(l);
  12186. C &= 15
  12187. }
  12188. o = 32767 + L[A],
  12189. s(r[(C << 4) + P[o]]),
  12190. s(R[o]),
  12191. A++
  12192. }
  12193. return m != u && s(a),
  12194. i
  12195. }
  12196. function v() {
  12197. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  12198. k[t] = e(t)
  12199. }
  12200. function A(e) {
  12201. if (e <= 0 && (e = 1),
  12202. e > 100 && (e = 100),
  12203. w != e) {
  12204. var t = 0;
  12205. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  12206. i(t),
  12207. w = e
  12208. }
  12209. }
  12210. function y() {
  12211. var e = (new Date).getTime();
  12212. t || (t = 50),
  12213. v(),
  12214. r(),
  12215. o(),
  12216. a(),
  12217. A(t);
  12218. (new Date).getTime() - e
  12219. }
  12220. var C, I, E, b, w, _ = (Math.round,
  12221. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  12222. this.encode = function(t, i) {
  12223. var n = ((new Date).getTime(),
  12224. i.quality);
  12225. n && A(n),
  12226. D = new Array,
  12227. N = 0,
  12228. B = 7,
  12229. c(65496),
  12230. u(),
  12231. p(),
  12232. d(t.width, t.height),
  12233. f(),
  12234. g();
  12235. var r = 0
  12236. , o = 0
  12237. , a = 0;
  12238. N = 0,
  12239. B = 7,
  12240. this.encode.displayName = "_encode_";
  12241. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  12242. for (l = 0; l < G; ) {
  12243. for (w = G * z + l,
  12244. _ = w,
  12245. T = -1,
  12246. x = 0,
  12247. R = 0; R < 64; R++)
  12248. x = (k ? 63 - R : R) >> 3,
  12249. T = 4 * (7 & R),
  12250. _ = w + x * G + T,
  12251. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12252. l + T >= G && (_ -= l + T - G + 4),
  12253. h = P[_++],
  12254. v = P[_++],
  12255. y = P[_++],
  12256. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12257. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12258. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12259. r = m(F, S, r, C, E),
  12260. o = m(V, M, o, I, b),
  12261. a = m(U, M, a, I, b),
  12262. l += 32
  12263. }
  12264. z += W
  12265. }
  12266. if (B >= 0) {
  12267. var j = [];
  12268. j[1] = B + 1,
  12269. j[0] = (1 << B + 1) - 1,
  12270. s(j)
  12271. }
  12272. return c(65497),
  12273. new e(D)
  12274. }
  12275. ,
  12276. y()
  12277. }
  12278. function n(e, t) {
  12279. t = t || {},
  12280. t.quality = t.quality || 50;
  12281. var n = t.quality
  12282. , r = new i(n)
  12283. , o = r.encode(e, t);
  12284. return {
  12285. data: o,
  12286. width: e.width,
  12287. height: e.height
  12288. }
  12289. }
  12290. t.exports.encode = n
  12291. }
  12292. ).call(this, e("buffer").Buffer)
  12293. }
  12294. , {
  12295. buffer: 198
  12296. }],
  12297. 95: [function(e, t, i) {
  12298. "use strict";
  12299. !function() {
  12300. if ("performance"in window == !1 && (window.performance = {}),
  12301. Date.now = Date.now || function() {
  12302. return (new Date).getTime()
  12303. }
  12304. ,
  12305. "now"in window.performance == !1) {
  12306. var e = Date.now();
  12307. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12308. window.performance.now = function() {
  12309. return Date.now() - e
  12310. }
  12311. }
  12312. }()
  12313. }
  12314. , {}],
  12315. 96: [function(e, t, i) {
  12316. "use strict";
  12317. var n = e("three");
  12318. n.EffectComposer = function(e, t) {
  12319. if (this.renderer = e,
  12320. void 0 === t) {
  12321. var i = {
  12322. minFilter: n.LinearFilter,
  12323. magFilter: n.LinearFilter,
  12324. format: n.RGBAFormat,
  12325. stencilBuffer: !1
  12326. }
  12327. , r = e.getSize();
  12328. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12329. }
  12330. this.renderTarget1 = t,
  12331. this.renderTarget2 = t.clone(),
  12332. this.writeBuffer = this.renderTarget1,
  12333. this.readBuffer = this.renderTarget2,
  12334. this.passes = [],
  12335. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12336. this.copyPass = new n.ShaderPass(n.CopyShader)
  12337. }
  12338. ,
  12339. n.EffectComposer.prototype = {
  12340. swapBuffers: function() {
  12341. var e = this.readBuffer;
  12342. this.readBuffer = this.writeBuffer,
  12343. this.writeBuffer = e
  12344. },
  12345. addPass: function(e) {
  12346. this.passes.push(e)
  12347. },
  12348. insertPass: function(e, t) {
  12349. this.passes.splice(t, 0, e)
  12350. },
  12351. render: function(e) {
  12352. this.writeBuffer = this.renderTarget1,
  12353. this.readBuffer = this.renderTarget2;
  12354. var t, i, r = !1, o = this.passes.length;
  12355. for (i = 0; i < o; i++)
  12356. if (t = this.passes[i],
  12357. t.enabled) {
  12358. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12359. t.needsSwap) {
  12360. if (r) {
  12361. var a = this.renderer.context;
  12362. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12363. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12364. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12365. }
  12366. this.swapBuffers()
  12367. }
  12368. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12369. }
  12370. },
  12371. reset: function(e) {
  12372. if (void 0 === e) {
  12373. var t = this.renderer.getSize();
  12374. e = this.renderTarget1.clone(),
  12375. e.setSize(t.width, t.height)
  12376. }
  12377. this.renderTarget1.dispose(),
  12378. this.renderTarget2.dispose(),
  12379. this.renderTarget1 = e,
  12380. this.renderTarget2 = e.clone(),
  12381. this.writeBuffer = this.renderTarget1,
  12382. this.readBuffer = this.renderTarget2
  12383. },
  12384. setSize: function(e, t) {
  12385. this.renderTarget1.setSize(e, t),
  12386. this.renderTarget2.setSize(e, t)
  12387. }
  12388. }
  12389. }
  12390. , {
  12391. three: 217
  12392. }],
  12393. 97: [function(e, t, i) {
  12394. "use strict";
  12395. var n = e("three");
  12396. n.MaskPass = function(e, t) {
  12397. this.scene = e,
  12398. this.camera = t,
  12399. this.enabled = !0,
  12400. this.clear = !0,
  12401. this.needsSwap = !1,
  12402. this.inverse = !1
  12403. }
  12404. ,
  12405. n.MaskPass.prototype = {
  12406. render: function(e, t, i, n) {
  12407. var r = e.context;
  12408. r.colorMask(!1, !1, !1, !1),
  12409. r.depthMask(!1);
  12410. var o, a;
  12411. this.inverse ? (o = 0,
  12412. a = 1) : (o = 1,
  12413. a = 0),
  12414. r.enable(r.STENCIL_TEST),
  12415. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12416. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12417. r.clearStencil(a),
  12418. e.render(this.scene, this.camera, i, this.clear),
  12419. e.render(this.scene, this.camera, t, this.clear),
  12420. r.colorMask(!0, !0, !0, !0),
  12421. r.depthMask(!0),
  12422. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12423. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12424. }
  12425. },
  12426. n.ClearMaskPass = function() {
  12427. this.enabled = !0
  12428. }
  12429. ,
  12430. n.ClearMaskPass.prototype = {
  12431. render: function(e, t, i, n) {
  12432. var r = e.context;
  12433. r.disable(r.STENCIL_TEST)
  12434. }
  12435. }
  12436. }
  12437. , {
  12438. three: 217
  12439. }],
  12440. 98: [function(e, t, i) {
  12441. "use strict";
  12442. var n = e("three");
  12443. n.RenderPass = function(e, t, i, r, o) {
  12444. this.scene = e,
  12445. this.camera = t,
  12446. this.overrideMaterial = i,
  12447. this.clearColor = r,
  12448. this.clearAlpha = void 0 !== o ? o : 1,
  12449. this.oldClearColor = new n.Color,
  12450. this.oldClearAlpha = 1,
  12451. this.enabled = !0,
  12452. this.clear = !0,
  12453. this.needsSwap = !1
  12454. }
  12455. ,
  12456. n.RenderPass.prototype = {
  12457. render: function(e, t, i, n) {
  12458. this.scene.overrideMaterial = this.overrideMaterial,
  12459. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12460. this.oldClearAlpha = e.getClearAlpha(),
  12461. e.setClearColor(this.clearColor, this.clearAlpha)),
  12462. e.render(this.scene, this.camera, i, this.clear),
  12463. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12464. this.scene.overrideMaterial = null
  12465. }
  12466. }
  12467. }
  12468. , {
  12469. three: 217
  12470. }],
  12471. 99: [function(e, t, i) {
  12472. "use strict";
  12473. var n = e("three");
  12474. n.ShaderPass = function(e, t) {
  12475. this.textureID = void 0 !== t ? t : "tDiffuse",
  12476. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12477. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12478. this.material = new n.ShaderMaterial({
  12479. defines: e.defines || {},
  12480. uniforms: this.uniforms,
  12481. vertexShader: e.vertexShader,
  12482. fragmentShader: e.fragmentShader
  12483. })),
  12484. this.renderToScreen = !1,
  12485. this.enabled = !0,
  12486. this.needsSwap = !0,
  12487. this.clear = !1,
  12488. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12489. this.scene = new n.Scene,
  12490. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12491. this.scene.add(this.quad)
  12492. }
  12493. ,
  12494. n.ShaderPass.prototype = {
  12495. render: function(e, t, i, n) {
  12496. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12497. this.quad.material = this.material,
  12498. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12499. }
  12500. }
  12501. }
  12502. , {
  12503. three: 217
  12504. }],
  12505. 100: [function(e, t, i) {
  12506. "use strict";
  12507. var n = e("three");
  12508. n.CopyShader = {
  12509. uniforms: {
  12510. tDiffuse: {
  12511. type: "t",
  12512. value: null
  12513. },
  12514. opacity: {
  12515. type: "f",
  12516. value: 1
  12517. }
  12518. },
  12519. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12520. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12521. }
  12522. }
  12523. , {
  12524. three: 217
  12525. }],
  12526. 101: [function(e, t, i) {
  12527. "use strict";
  12528. var n = e("three");
  12529. n.HorizontalBlurShader = {
  12530. uniforms: {
  12531. tDiffuse: {
  12532. type: "t",
  12533. value: null
  12534. },
  12535. h: {
  12536. type: "f",
  12537. value: 1 / 512
  12538. }
  12539. },
  12540. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12541. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  12542. }
  12543. }
  12544. , {
  12545. three: 217
  12546. }],
  12547. 102: [function(e, t, i) {
  12548. "use strict";
  12549. var n = e("three");
  12550. n.VerticalBlurShader = {
  12551. uniforms: {
  12552. tDiffuse: {
  12553. type: "t",
  12554. value: null
  12555. },
  12556. v: {
  12557. type: "f",
  12558. value: 1 / 512
  12559. }
  12560. },
  12561. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12562. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  12563. }
  12564. }
  12565. , {
  12566. three: 217
  12567. }],
  12568. 103: [function(e, t, i) {
  12569. "use strict";
  12570. var n = e("three");
  12571. !function() {
  12572. if ("performance"in window == 0 && (window.performance = {}),
  12573. "now"in window.performance == 0) {
  12574. var e = Date.now();
  12575. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12576. window.performance.now = function() {
  12577. return Date.now() - e
  12578. }
  12579. }
  12580. }(),
  12581. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12582. var t, i = this.extensions, r = this.context;
  12583. if (e === n.RepeatWrapping)
  12584. return r.REPEAT;
  12585. if (e === n.ClampToEdgeWrapping)
  12586. return r.CLAMP_TO_EDGE;
  12587. if (e === n.MirroredRepeatWrapping)
  12588. return r.MIRRORED_REPEAT;
  12589. if (e === n.NearestFilter)
  12590. return r.NEAREST;
  12591. if (e === n.NearestMipMapNearestFilter)
  12592. return r.NEAREST_MIPMAP_NEAREST;
  12593. if (e === n.NearestMipMapLinearFilter)
  12594. return r.NEAREST_MIPMAP_LINEAR;
  12595. if (e === n.LinearFilter)
  12596. return r.LINEAR;
  12597. if (e === n.LinearMipMapNearestFilter)
  12598. return r.LINEAR_MIPMAP_NEAREST;
  12599. if (e === n.LinearMipMapLinearFilter)
  12600. return r.LINEAR_MIPMAP_LINEAR;
  12601. if (e === n.UnsignedByteType)
  12602. return r.UNSIGNED_BYTE;
  12603. if (e === n.UnsignedShort4444Type)
  12604. return r.UNSIGNED_SHORT_4_4_4_4;
  12605. if (e === n.UnsignedShort5551Type)
  12606. return r.UNSIGNED_SHORT_5_5_5_1;
  12607. if (e === n.UnsignedShort565Type)
  12608. return r.UNSIGNED_SHORT_5_6_5;
  12609. if (e === n.ByteType)
  12610. return r.BYTE;
  12611. if (e === n.ShortType)
  12612. return r.SHORT;
  12613. if (e === n.UnsignedShortType)
  12614. return r.UNSIGNED_SHORT;
  12615. if (e === n.IntType)
  12616. return r.INT;
  12617. if (e === n.UnsignedIntType)
  12618. return r.UNSIGNED_INT;
  12619. if (e === n.FloatType)
  12620. return r.FLOAT;
  12621. if (t = i.get("OES_texture_half_float"),
  12622. null !== t && e === n.HalfFloatType)
  12623. return t.HALF_FLOAT_OES;
  12624. if (e === n.AlphaFormat)
  12625. return r.ALPHA;
  12626. if (e === n.RGBFormat)
  12627. return r.RGB;
  12628. if (e === n.RGBAFormat)
  12629. return r.RGBA;
  12630. if (e === n.LuminanceFormat)
  12631. return r.LUMINANCE;
  12632. if (e === n.LuminanceAlphaFormat)
  12633. return r.LUMINANCE_ALPHA;
  12634. if (e === n.AddEquation)
  12635. return r.FUNC_ADD;
  12636. if (e === n.SubtractEquation)
  12637. return r.FUNC_SUBTRACT;
  12638. if (e === n.ReverseSubtractEquation)
  12639. return r.FUNC_REVERSE_SUBTRACT;
  12640. if (e === n.ZeroFactor)
  12641. return r.ZERO;
  12642. if (e === n.OneFactor)
  12643. return r.ONE;
  12644. if (e === n.SrcColorFactor)
  12645. return r.SRC_COLOR;
  12646. if (e === n.OneMinusSrcColorFactor)
  12647. return r.ONE_MINUS_SRC_COLOR;
  12648. if (e === n.SrcAlphaFactor)
  12649. return r.SRC_ALPHA;
  12650. if (e === n.OneMinusSrcAlphaFactor)
  12651. return r.ONE_MINUS_SRC_ALPHA;
  12652. if (e === n.DstAlphaFactor)
  12653. return r.DST_ALPHA;
  12654. if (e === n.OneMinusDstAlphaFactor)
  12655. return r.ONE_MINUS_DST_ALPHA;
  12656. if (e === n.DstColorFactor)
  12657. return r.DST_COLOR;
  12658. if (e === n.OneMinusDstColorFactor)
  12659. return r.ONE_MINUS_DST_COLOR;
  12660. if (e === n.SrcAlphaSaturateFactor)
  12661. return r.SRC_ALPHA_SATURATE;
  12662. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12663. null !== t) {
  12664. if (e === n.RGB_S3TC_DXT1_Format)
  12665. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12666. if (e === n.RGBA_S3TC_DXT1_Format)
  12667. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12668. if (e === n.RGBA_S3TC_DXT3_Format)
  12669. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12670. if (e === n.RGBA_S3TC_DXT5_Format)
  12671. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12672. }
  12673. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12674. null !== t) {
  12675. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12676. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12677. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12678. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12679. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12680. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12681. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12682. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12683. }
  12684. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12685. null !== t && e === n.RGB_ETC1_Format)
  12686. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12687. if (t = i.get("EXT_blend_minmax"),
  12688. null !== t) {
  12689. if (e === n.MinEquation)
  12690. return t.MIN_EXT;
  12691. if (e === n.MaxEquation)
  12692. return t.MAX_EXT
  12693. }
  12694. return 0
  12695. }
  12696. ,
  12697. n.WebGLState = function(e, t, i) {
  12698. var r = this
  12699. , o = new n.Vector4
  12700. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12701. , s = new Uint8Array(a)
  12702. , l = new Uint8Array(a)
  12703. , c = new Uint8Array(a)
  12704. , h = {}
  12705. , u = null
  12706. , d = null
  12707. , p = null
  12708. , f = null
  12709. , g = null
  12710. , m = null
  12711. , v = null
  12712. , A = null
  12713. , y = !1
  12714. , C = null
  12715. , I = null
  12716. , E = null
  12717. , b = null
  12718. , w = null
  12719. , _ = null
  12720. , T = null
  12721. , x = null
  12722. , S = null
  12723. , M = null
  12724. , R = null
  12725. , P = null
  12726. , O = null
  12727. , L = null
  12728. , D = null
  12729. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12730. , B = void 0
  12731. , F = {}
  12732. , V = new n.Vector4
  12733. , U = null
  12734. , k = null
  12735. , H = new n.Vector4
  12736. , G = new n.Vector4;
  12737. this.init = function() {
  12738. this.clearColor(0, 0, 0, 1),
  12739. this.clearDepth(1),
  12740. this.clearStencil(0),
  12741. this.enable(e.DEPTH_TEST),
  12742. e.depthFunc(e.LEQUAL),
  12743. e.frontFace(e.CCW),
  12744. e.cullFace(e.BACK),
  12745. this.enable(e.CULL_FACE),
  12746. this.enable(e.BLEND),
  12747. e.blendEquation(e.FUNC_ADD),
  12748. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12749. }
  12750. ,
  12751. this.initAttributes = function() {
  12752. for (var e = 0, t = s.length; e < t; e++)
  12753. s[e] = 0
  12754. }
  12755. ,
  12756. this.enableAttribute = function(i) {
  12757. if (s[i] = 1,
  12758. 0 === l[i] && (e.enableVertexAttribArray(i),
  12759. l[i] = 1),
  12760. 0 !== c[i]) {
  12761. var n = t.get("ANGLE_instanced_arrays");
  12762. n.vertexAttribDivisorANGLE(i, 0),
  12763. c[i] = 0
  12764. }
  12765. }
  12766. ,
  12767. this.enableAttributeAndDivisor = function(t, i, n) {
  12768. s[t] = 1,
  12769. 0 === l[t] && (e.enableVertexAttribArray(t),
  12770. l[t] = 1),
  12771. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12772. c[t] = i)
  12773. }
  12774. ,
  12775. this.disableUnusedAttributes = function() {
  12776. for (var t = 0, i = l.length; t < i; t++)
  12777. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12778. l[t] = 0)
  12779. }
  12780. ,
  12781. this.enable = function(t) {
  12782. h[t] !== !0 && (e.enable(t),
  12783. h[t] = !0)
  12784. }
  12785. ,
  12786. this.disable = function(t) {
  12787. h[t] !== !1 && (e.disable(t),
  12788. h[t] = !1)
  12789. }
  12790. ,
  12791. this.getCompressedTextureFormats = function() {
  12792. if (null === u && (u = [],
  12793. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12794. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12795. u.push(i[n]);
  12796. return u
  12797. }
  12798. ,
  12799. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12800. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12801. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12802. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12803. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12804. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12805. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12806. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12807. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12808. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12809. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12810. d = t,
  12811. y = h),
  12812. t === n.CustomBlending ? (s = s || r,
  12813. l = l || o,
  12814. c = c || a,
  12815. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12816. p = r,
  12817. m = s),
  12818. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12819. f = o,
  12820. g = a,
  12821. v = l,
  12822. A = c)) : (p = null,
  12823. f = null,
  12824. g = null,
  12825. m = null,
  12826. v = null,
  12827. A = null)
  12828. }
  12829. ,
  12830. this.setDepthFunc = function(t) {
  12831. if (C !== t) {
  12832. if (t)
  12833. switch (t) {
  12834. case n.NeverDepth:
  12835. e.depthFunc(e.NEVER);
  12836. break;
  12837. case n.AlwaysDepth:
  12838. e.depthFunc(e.ALWAYS);
  12839. break;
  12840. case n.LessDepth:
  12841. e.depthFunc(e.LESS);
  12842. break;
  12843. case n.LessEqualDepth:
  12844. e.depthFunc(e.LEQUAL);
  12845. break;
  12846. case n.EqualDepth:
  12847. e.depthFunc(e.EQUAL);
  12848. break;
  12849. case n.GreaterEqualDepth:
  12850. e.depthFunc(e.GEQUAL);
  12851. break;
  12852. case n.GreaterDepth:
  12853. e.depthFunc(e.GREATER);
  12854. break;
  12855. case n.NotEqualDepth:
  12856. e.depthFunc(e.NOTEQUAL);
  12857. break;
  12858. default:
  12859. e.depthFunc(e.LEQUAL)
  12860. }
  12861. else
  12862. e.depthFunc(e.LEQUAL);
  12863. C = t
  12864. }
  12865. }
  12866. ,
  12867. this.setDepthTest = function(t) {
  12868. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12869. }
  12870. ,
  12871. this.setDepthWrite = function(t) {
  12872. I !== t && (e.depthMask(t),
  12873. I = t)
  12874. }
  12875. ,
  12876. this.setColorWrite = function(t) {
  12877. E !== t && (e.colorMask(t, t, t, t),
  12878. E = t)
  12879. }
  12880. ,
  12881. this.setStencilFunc = function(t, i, n) {
  12882. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12883. w = t,
  12884. _ = i,
  12885. T = n)
  12886. }
  12887. ,
  12888. this.setStencilOp = function(t, i, n) {
  12889. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12890. x = t,
  12891. S = i,
  12892. M = n)
  12893. }
  12894. ,
  12895. this.setStencilTest = function(t) {
  12896. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12897. }
  12898. ,
  12899. this.setStencilWrite = function(t) {
  12900. b !== t && (e.stencilMask(t),
  12901. b = t)
  12902. }
  12903. ,
  12904. this.setFlipSided = function(t) {
  12905. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12906. R = t)
  12907. }
  12908. ,
  12909. this.setLineWidth = function(t) {
  12910. t !== P && (e.lineWidth(t),
  12911. P = t)
  12912. }
  12913. ,
  12914. this.setPolygonOffset = function(t, i, n) {
  12915. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12916. !t || O === i && L === n || (e.polygonOffset(i, n),
  12917. O = i,
  12918. L = n)
  12919. }
  12920. ,
  12921. this.getScissorTest = function() {
  12922. return D
  12923. }
  12924. ,
  12925. this.setScissorTest = function(t) {
  12926. D = t,
  12927. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12928. }
  12929. ,
  12930. this.activeTexture = function(t) {
  12931. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12932. B !== t && (e.activeTexture(t),
  12933. B = t)
  12934. }
  12935. ,
  12936. this.bindTexture = function(t, i) {
  12937. void 0 === B && r.activeTexture();
  12938. var n = F[B];
  12939. void 0 === n && (n = {
  12940. type: void 0,
  12941. texture: void 0
  12942. },
  12943. F[B] = n),
  12944. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12945. n.type = t,
  12946. n.texture = i)
  12947. }
  12948. ,
  12949. this.compressedTexImage2D = function() {
  12950. try {
  12951. e.compressedTexImage2D.apply(e, arguments)
  12952. } catch (e) {
  12953. console.error(e)
  12954. }
  12955. }
  12956. ,
  12957. this.texImage2D = function() {
  12958. try {
  12959. e.texImage2D.apply(e, arguments)
  12960. } catch (e) {
  12961. console.error(e)
  12962. }
  12963. }
  12964. ,
  12965. this.clearColor = function(t, i, n, r) {
  12966. o.set(t, i, n, r),
  12967. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12968. V.copy(o))
  12969. }
  12970. ,
  12971. this.clearDepth = function(t) {
  12972. U !== t && (e.clearDepth(t),
  12973. U = t)
  12974. }
  12975. ,
  12976. this.clearStencil = function(t) {
  12977. k !== t && (e.clearStencil(t),
  12978. k = t)
  12979. }
  12980. ,
  12981. this.scissor = function(t) {
  12982. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12983. H.copy(t))
  12984. }
  12985. ,
  12986. this.viewport = function(t) {
  12987. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12988. G.copy(t))
  12989. }
  12990. ,
  12991. this.reset = function() {
  12992. for (var t = 0; t < l.length; t++)
  12993. 1 === l[t] && (e.disableVertexAttribArray(t),
  12994. l[t] = 0);
  12995. h = {},
  12996. u = null,
  12997. B = void 0,
  12998. F = {},
  12999. d = null,
  13000. E = null,
  13001. I = null,
  13002. b = null,
  13003. R = null
  13004. }
  13005. }
  13006. }
  13007. , {
  13008. three: 217
  13009. }],
  13010. 104: [function(e, t, i) {
  13011. (function(i, n) {
  13012. "use strict";
  13013. function r(e) {
  13014. this.urls = e;
  13015. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  13016. this.builder = a.loadProto(t),
  13017. this.decoder = this.builder.build("binary_mesh")
  13018. }
  13019. var o = e("three")
  13020. , a = e("protobufjs")
  13021. , s = e("../util/logger")
  13022. , l = (e("../util/common"),
  13023. e("../util/ajax"))
  13024. , c = e("../objects/Chunk")
  13025. , h = new s(n);
  13026. r.prototype = {
  13027. constructor: r,
  13028. load: function(e, t, i, n) {
  13029. return h.time("download"),
  13030. l.get(e, {
  13031. responseType: "arraybuffer"
  13032. }).done(function(r) {
  13033. h.timeEnd("download"),
  13034. this.parse(r, e, t, i, n)
  13035. }
  13036. .bind(this)).fail(n)
  13037. },
  13038. parse: function(e, t, i, n, r) {
  13039. var o = this.readProtobuf(e);
  13040. if (!o)
  13041. return r();
  13042. try {
  13043. h.time("convert to webgl"),
  13044. this.convertProtobufToSceneObject(o, t, i, n, r),
  13045. h.timeEnd("convert to webgl")
  13046. } catch (e) {
  13047. return h.error("failed parsing .dam"),
  13048. h.error(e.message),
  13049. r()
  13050. }
  13051. },
  13052. readProtobuf: function(e) {
  13053. var t;
  13054. try {
  13055. h.time("parse proto"),
  13056. t = this.decoder.decode(e),
  13057. h.timeEnd("parse proto")
  13058. } catch (e) {
  13059. return h.error("failed parsing proto for .dam"),
  13060. h.error(e.message),
  13061. null
  13062. }
  13063. return t
  13064. },
  13065. convertProtobufToSceneObject: function(e, t, i, n, r) {
  13066. function a(e) {
  13067. var i = new o.BufferGeometry;
  13068. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  13069. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  13070. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  13071. i.applyMatrix(s),
  13072. i.computeBoundingBox(),
  13073. new c({
  13074. geometry: i,
  13075. textureName: e.material_name,
  13076. name: e.chunk_name,
  13077. meshUrl: t
  13078. })
  13079. }
  13080. if (0 === e.chunk.length)
  13081. return h.warn("No chunks in damfile..."),
  13082. i([]);
  13083. var s = new o.Matrix4;
  13084. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  13085. var l = e.chunk.map(a);
  13086. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  13087. r())
  13088. }
  13089. },
  13090. t.exports = r
  13091. }
  13092. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  13093. }
  13094. , {
  13095. "../objects/Chunk": 144,
  13096. "../util/ajax": 181,
  13097. "../util/common": 185,
  13098. "../util/logger": 189,
  13099. buffer: 198,
  13100. protobufjs: 214,
  13101. three: 217
  13102. }],
  13103. 105: [function(e, t, i) {
  13104. (function(i) {
  13105. "use strict";
  13106. var n = (e("three"),
  13107. e("../settings"),
  13108. e("../util/browser"),
  13109. e("./DamLoader"))
  13110. , r = e("../util/logger")
  13111. , o = (e("../ab"),
  13112. new r(i));
  13113. t.exports = {
  13114. getLoaders: function() {
  13115. return [["_50k", ".dam", n], ["", ".dam", n]]
  13116. },
  13117. load: function(e, t, i, n, r, a) {
  13118. var s = this.getLoaders();
  13119. a = a || 0;
  13120. var l = s[a];
  13121. if (!l)
  13122. return void (r && r("No suitable model file found..."));
  13123. var c = l[0]
  13124. , h = l[1]
  13125. , u = new l[2](t)
  13126. , d = t.get(e + c + h);
  13127. d ? (o.debug("Trying " + c + h),
  13128. u.load(d, i, n, function() {
  13129. this.load(e, t, i, n, r, ++a)
  13130. }
  13131. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  13132. this.load(e, t, i, n, r, ++a))
  13133. }
  13134. }
  13135. }
  13136. ).call(this, "/js/loaders/ModelLoader.js")
  13137. }
  13138. , {
  13139. "../ab": 3,
  13140. "../settings": 166,
  13141. "../util/browser": 182,
  13142. "../util/logger": 189,
  13143. "./DamLoader": 104,
  13144. three: 217
  13145. }],
  13146. 106: [function(e, t, i) {
  13147. (function(i) {
  13148. "use strict";
  13149. var n = e("../util/common")
  13150. , r = e("../util/texture")
  13151. , o = e("../util/browser")
  13152. , a = e("../util/logger")
  13153. , s = e("../settings")
  13154. , l = new a(i);
  13155. t.exports = {
  13156. load: function(e, t) {
  13157. function i(e, i) {
  13158. e || (t.push(i),
  13159. p++,
  13160. d.notify(p, a),
  13161. p === a && d.resolve())
  13162. }
  13163. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  13164. return $.when();
  13165. var a = n.countUnique(e.chunks.map(function(e) {
  13166. return e.textureName
  13167. }))
  13168. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  13169. , h = "_50k" === c ? "high" : "low";
  13170. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  13171. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  13172. h = "low"));
  13173. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  13174. , d = $.Deferred()
  13175. , p = 0;
  13176. return e.chunks.forEach(function(t) {
  13177. if (!t.material.map && t.textureName) {
  13178. var n = e.urls.get(u + t.textureName);
  13179. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  13180. }
  13181. }),
  13182. d.promise()
  13183. }
  13184. }
  13185. }
  13186. ).call(this, "/js/loaders/ModelTextureLoader.js")
  13187. }
  13188. , {
  13189. "../settings": 166,
  13190. "../util/browser": 182,
  13191. "../util/common": 185,
  13192. "../util/logger": 189,
  13193. "../util/texture": 194
  13194. }],
  13195. 107: [function(e, t, i) {
  13196. (function(i, n) {
  13197. "use strict";
  13198. function r(e) {
  13199. this.model = e,
  13200. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  13201. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  13202. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  13203. , n = o.loadProto(t);
  13204. this.decoder = n.build("VisionModeldata")
  13205. }
  13206. var o = e("protobufjs")
  13207. , a = e("../util/ajax")
  13208. , s = (e("../util/common"),
  13209. e("../util/math"))
  13210. , l = e("../util/logger")
  13211. , c = new l(n);
  13212. r.prototype.load = function() {
  13213. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  13214. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  13215. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  13216. $.when([]))
  13217. }
  13218. ,
  13219. r.prototype.loadVisionModelData = function() {
  13220. return a.get(this.modelDataPath, {
  13221. responseType: "arraybuffer"
  13222. }).then(function(e) {
  13223. var t;
  13224. try {
  13225. t = this.decoder.decode(e)
  13226. } catch (e) {
  13227. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  13228. this.loadSweepLocationsCSV()
  13229. }
  13230. var i = t.sweepLocations.map(function(e) {
  13231. return {
  13232. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13233. position: {
  13234. x: e.pose.translation.x,
  13235. y: e.pose.translation.y,
  13236. z: e.pose.translation.z
  13237. },
  13238. quaternion: {
  13239. x: e.pose.rotation.x,
  13240. y: e.pose.rotation.y,
  13241. z: e.pose.rotation.z,
  13242. w: e.pose.rotation.w
  13243. },
  13244. puck: {
  13245. x: e.puck.x,
  13246. y: e.puck.y,
  13247. z: e.puck.z
  13248. },
  13249. floor: e.group,
  13250. neighbours: e.visibles,
  13251. alignmentType: e.alignment_type
  13252. }
  13253. }).map(function(e) {
  13254. return e.position = s.convertVisionVector(e.position),
  13255. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13256. e.puck = s.convertVisionVector(e.puck),
  13257. e
  13258. });
  13259. return i.forEach(function(e) {
  13260. e.neighbours = e.neighbours.map(function(e) {
  13261. return i[e].uuid
  13262. })
  13263. }),
  13264. i
  13265. }
  13266. .bind(this), function() {
  13267. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13268. this.loadSweepLocationsCSV()
  13269. }
  13270. .bind(this))
  13271. }
  13272. ,
  13273. r.prototype.loadSweepLocationsCSV = function() {
  13274. return a.get(this.sweepLocationsPath).then(function(e) {
  13275. var t = e.split("\n").map(function(e) {
  13276. return e.split(", ")
  13277. }).filter(function(e) {
  13278. return e.length > 1
  13279. }).map(function(e) {
  13280. return {
  13281. uuid: e[0],
  13282. position: {
  13283. x: parseFloat(e[1]),
  13284. y: parseFloat(e[2]),
  13285. z: parseFloat(e[3])
  13286. },
  13287. quaternion: {
  13288. x: parseFloat(e[4]),
  13289. y: parseFloat(e[5]),
  13290. z: parseFloat(e[6]),
  13291. w: parseFloat(e[7])
  13292. }
  13293. }
  13294. }).map(function(e) {
  13295. return e.position = s.convertVisionVector(e.position),
  13296. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13297. e
  13298. });
  13299. return t
  13300. }).fail(function() {
  13301. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13302. })
  13303. }
  13304. ,
  13305. t.exports = r
  13306. }
  13307. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13308. }
  13309. , {
  13310. "../util/ajax": 181,
  13311. "../util/common": 185,
  13312. "../util/logger": 189,
  13313. "../util/math": 190,
  13314. buffer: 198,
  13315. protobufjs: 214
  13316. }],
  13317. 108: [function(e, t, i) {
  13318. (function(i) {
  13319. "use strict";
  13320. function n() {
  13321. this.locale = null
  13322. }
  13323. var r = e("../settings")
  13324. , o = e("../util/common")
  13325. , a = e("../util/logger")
  13326. , s = e("../enum/Locale")
  13327. , l = new a(i);
  13328. n.prototype.init = function() {
  13329. var t;
  13330. switch (r.languageTag) {
  13331. case null:
  13332. case "en":
  13333. case s.EN_US:
  13334. this.locale = s.EN_US,
  13335. t = e("./strings-en-US");
  13336. break;
  13337. case "es":
  13338. case s.ES_MX:
  13339. this.locale = s.ES_MX,
  13340. t = e("./strings-es-MX");
  13341. break;
  13342. case "fr":
  13343. case s.FR_FR:
  13344. this.locale = s.FR_FR,
  13345. t = e("./strings-fr-FR");
  13346. break;
  13347. case "de":
  13348. case s.DE_DE:
  13349. this.locale = s.DE_DE,
  13350. t = e("./strings-de-DE");
  13351. break;
  13352. case "ru":
  13353. case s.RU_RU:
  13354. this.locale = s.RU_RU,
  13355. t = e("./strings-ru-RU");
  13356. break;
  13357. case "cn":
  13358. case s.CN_CN:
  13359. this.locale = s.CN_CN,
  13360. t = e("./strings-cn-CN");
  13361. break;
  13362. case "jp":
  13363. case s.JP_JP:
  13364. this.locale = s.JP_JP,
  13365. t = e("./strings-jp-JP");
  13366. break;
  13367. default:
  13368. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13369. this.locale = s.EN_US,
  13370. t = e("./strings-en-US")
  13371. }
  13372. l.info("Using locale '" + this.locale + "'"),
  13373. o.extendObject(this, t)
  13374. }
  13375. ,
  13376. n.prototype.localizeGUI = function() {
  13377. var e = document.querySelector("#gui-parent");
  13378. this.localizeTree(e),
  13379. this.localizeLoadingText()
  13380. }
  13381. ,
  13382. n.prototype.localizeLoadingText = function() {
  13383. // var e = document.querySelector("#loader-cont")
  13384. // , t = e.getAttribute("title");
  13385. // e.removeAttribute("title"),
  13386. // e.setAttribute("data-status", t),
  13387. // e.classList.add(this.locale),
  13388. document.querySelector("#help-dialog").classList.add(this.locale),
  13389. document.querySelector("#interaction-modal").classList.add(this.locale),
  13390. document.querySelector("#gui").classList.add(this.locale);
  13391. }
  13392. ,
  13393. n.prototype.localizeTree = function(e) {
  13394. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13395. if (e.nodeType === Node.TEXT_NODE)
  13396. t = e.data.match(n),
  13397. t && (i = t[1],
  13398. e.data = this.localizeText(i) || i);
  13399. else if (e.nodeType === Node.ELEMENT_NODE) {
  13400. var r = e.getAttribute("title");
  13401. r && (t = r.match(n),
  13402. t && (i = t[1],
  13403. e.setAttribute("title", this.localizeText(i) || i)))
  13404. }
  13405. for (e = e.firstChild; e; )
  13406. this.localizeTree(e),
  13407. e = e.nextSibling
  13408. }
  13409. ,
  13410. n.prototype.localizeText = function(t) {
  13411. var i = this[t];
  13412. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13413. i = e("./strings-en-US")[t]),
  13414. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13415. i
  13416. }
  13417. ,
  13418. t.exports = new n
  13419. }
  13420. ).call(this, "/js/localization/localize.js")
  13421. }
  13422. , {
  13423. "../enum/Locale": 31,
  13424. "../settings": 166,
  13425. "../util/common": 185,
  13426. "../util/logger": 189,
  13427. "./strings-cn-CN": 109,
  13428. "./strings-de-DE": 110,
  13429. "./strings-en-US": 111,
  13430. "./strings-es-MX": 112,
  13431. "./strings-fr-FR": 113,
  13432. "./strings-jp-JP": 114,
  13433. "./strings-ru-RU": 115
  13434. }],
  13435. 109: [function(e, t, i) {
  13436. "use strict";
  13437. t.exports = {
  13438. PAGE_TITLE: "",
  13439. LOADING: "正在加载",
  13440. PRESENTED_BY_CAPS: "呈现者:",
  13441. POWERED_BY: "技术支持:",
  13442. POWERED_BY_CAPS: "技术支持:",
  13443. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13444. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13445. PRESENTED_BY: "呈现者:",
  13446. MORE: "更多 ",
  13447. LESS: "更少 ",
  13448. TAG_CONTENT: "tag™ 内容",
  13449. SHOW: "显示",
  13450. HIDE: "隐藏",
  13451. DOLLHOUSE: "场景屋",
  13452. FLOOR_PLAN: "楼层平面图",
  13453. OPEN_HIGHLIGHTS: "打开精彩片段",
  13454. CLOSE_HIGHLIGHTS: "关闭",
  13455. PREVIOUS: "上一个",
  13456. PLAY: "播放",
  13457. PAUSE: "暂停",
  13458. NEXT: "下一个",
  13459. EXPLORE_3D_SPACE: "探索 3D 空间",
  13460. VIEW_DOLLHOUSE: "观看场景屋",
  13461. SOCIAL_SHARING: "分享这个空间",
  13462. VIEW_IN_VR: "以 VR 观看",
  13463. VIEW_FULLSCREEN: "全屏观看",
  13464. EXIT_FULLSCREEN: " 退出全屏",
  13465. ZOOM_IN: "放大",
  13466. ZOOM_OUT: "缩小",
  13467. FLOOR_NAME: "楼层",
  13468. FLOOR_ALL: "ALL",
  13469. FLOOR_Lang: ["Floor",""],
  13470. TERMS: "条款",
  13471. PORT_TERMS: "port 条款",
  13472. TERMS_OF_USE: "使用条款",
  13473. CLOSE_TERMS: "关闭",
  13474. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13475. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13476. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13477. WEBVR_ENTER_WEBVR: "进入 VR",
  13478. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13479. WEBVR_LEARN_MORE: "了解更多",
  13480. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13481. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13482. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13483. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13484. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13485. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13486. VR_LEARN_MORE_CAPS: "了解更多",
  13487. VR_PREVIOUS_CAPS: "上一个’,",
  13488. VR_NEXT_CAPS: "下一个",
  13489. VR_GOT_IT_CAPS: "明白了",
  13490. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13491. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13492. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13493. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13494. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13495. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13496. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13497. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13498. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13499. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13500. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13501. VR_APP: "port VR 应用程序",
  13502. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13503. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13504. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13505. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13506. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13507. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13508. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13509. VR_ANDROID_DVICES: "Android 设备",
  13510. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13511. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13512. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13513. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13514. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13515. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13516. VR_DOWNLOAD_HERE: "在此下载",
  13517. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13518. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13519. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13520. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13521. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13522. SHARE_TO: "分享到",
  13523. SHARE_LINK: "直接链接",
  13524. SHARE_EXPLORE: "探索",
  13525. SHARE_AT: "在",
  13526. SHARE_WITH: "使用",
  13527. SHARE_3D: "以 3D",
  13528. SHARE_COPIED: "已复制!",
  13529. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13530. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13531. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13532. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13533. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13534. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13535. ERROR_GENERIC_ACTIONS_3: " 或",
  13536. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13537. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13538. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13539. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13540. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13541. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13542. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13543. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13544. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13545. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13546. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13547. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13548. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13549. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13550. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13551. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13552. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13553. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13554. LINK_TO_LOCATION: "地点链接",
  13555. MENU_COPY: "复制",
  13556. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13557. ROTATE: "旋转",
  13558. MOVE: "移动",
  13559. INSIDE: "内部",
  13560. ZOOM: "缩放",
  13561. HELP: "小帮手",
  13562. HELP_NAVIGATION_TAB: "导航",
  13563. HELP_MORE_HELP_TAB: "更多帮助",
  13564. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13565. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13566. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13567. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13568. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13569. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13570. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13571. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13572. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13573. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13574. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13575. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13576. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13577. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13578. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13579. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13580. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13581. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13582. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13583. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13584. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13585. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13586. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13587. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13588. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13589. HELP_MORE_HLR_A: "精彩片段集锦",
  13590. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13591. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13592. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13593. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13594. HELP_MORE_FLOORS_A: "楼层选择器",
  13595. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13596. HELP_MORE_TAG_A: "tag™ 贴文",
  13597. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13598. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13599. HELP_MORE_ZOOM_A: "缩放控件",
  13600. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13601. HELP_MORE_TOUR_A: "导览控件",
  13602. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13603. HELP_MORE_INSIDE_A: "内部视图",
  13604. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13605. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13606. HELP_MORE_VR_A: "VR 模式",
  13607. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13608. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13609. HELP_MORE_360_A: "360° 视图",
  13610. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13611. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13612. HELP_MORE_FULLSCREEN_A: "全屏",
  13613. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13614. CLOSE: "关闭"
  13615. }
  13616. }
  13617. , {}],
  13618. 110: [function(e, t, i) {
  13619. "use strict";
  13620. t.exports = {
  13621. PAGE_TITLE: "",
  13622. LOADING: "Lädt",
  13623. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13624. POWERED_BY: "Angetrieben von",
  13625. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13626. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13627. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13628. PRESENTED_BY: "Präsentiert von ",
  13629. MORE: "Mehr ",
  13630. LESS: "Weniger ",
  13631. TAG_CONTENT: "tag™ Inhalt",
  13632. SHOW: "Anzeigen",
  13633. HIDE: "Verbergen",
  13634. DOLLHOUSE: "Puppenhaus",
  13635. FLOOR_PLAN: "Grundriss",
  13636. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13637. CLOSE_HIGHLIGHTS: "Schließen",
  13638. PREVIOUS: "Vorheriges",
  13639. PLAY: "Abspielen",
  13640. PAUSE: "Pausieren",
  13641. NEXT: "Nächstes",
  13642. EXPLORE_3D_SPACE: "Innenraum betreten",
  13643. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13644. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13645. VIEW_IN_VR: "In VR ansehen",
  13646. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13647. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13648. ZOOM_IN: "Vergrößern",
  13649. ZOOM_OUT: "Verkleinern",
  13650. FLOOR_NAME: "Etage ",
  13651. FLOOR_ALL: "Alle",
  13652. TERMS: "Bedingungen",
  13653. PORT_TERMS: "port Bedingungen",
  13654. TERMS_OF_USE: "Nutzungsbedingungen",
  13655. TERMS_TEXT_FILE: "terms-de-DE.html",
  13656. CLOSE_TERMS: "Schließen",
  13657. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13658. HELP: "Hilfe",
  13659. HELP_NAVIGATION_TAB: "Navigation",
  13660. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13661. CLOSE: "Schließen",
  13662. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13663. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13664. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13665. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13666. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13667. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13668. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13669. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13670. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13671. HELP_DESKTOP_DOLLHOUSE_2A: "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  13672. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13673. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13674. HELP_DESKTOP_FLOORPLAN_1A: "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  13675. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13676. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13677. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13678. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13679. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13680. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13681. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13682. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13683. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13684. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13685. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13686. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13687. HELP_MORE_HLR_A: "Liste das Highlight",
  13688. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13689. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13690. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13691. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13692. HELP_MORE_FLOORS_A: "Etage auswählen",
  13693. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13694. HELP_MORE_TAG_A: "tag™ Posts",
  13695. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13696. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13697. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13698. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13699. HELP_MORE_TOUR_A: "Tour Steuerung",
  13700. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13701. HELP_MORE_INSIDE_A: "Innenansicht",
  13702. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13703. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13704. HELP_MORE_VR_A: "VR Modus",
  13705. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13706. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13707. HELP_MORE_360_A: "360° Views Ansicht ",
  13708. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13709. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13710. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13711. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13712. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13713. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13714. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13715. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13716. WEBVR_LEARN_MORE: "Mehr Infos",
  13717. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13718. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13719. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13720. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13721. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13722. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13723. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13724. VR_APP: "port VR App",
  13725. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13726. VR_COMPATIBLE_ANDROID_LONG: "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13727. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13728. VR_APP_FOR_ANDROID: "port VR app für Android",
  13729. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13730. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13731. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13732. VR_PREVIOUS_CAPS: "ZURÜCK",
  13733. VR_NEXT_CAPS: "WEITER",
  13734. VR_GOT_IT_CAPS: "VERSTANDEN",
  13735. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13736. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13737. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13738. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13739. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13740. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13741. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13742. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13743. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13744. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13745. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13746. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13747. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13748. VR_ANDROID_DVICES: "Android Geräte",
  13749. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13750. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13751. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13752. VR_DOWNLOAD_HERE: "Hier runterladen",
  13753. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13754. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13755. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13756. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13757. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13758. SHARE_TO: "Teilen auf",
  13759. SHARE_LINK: "Direkter Link",
  13760. SHARE_EXPLORE: "Umsehen",
  13761. SHARE_AT: "auf",
  13762. SHARE_WITH: "mit",
  13763. SHARE_3D: "in 3D",
  13764. SHARE_COPIED: "Kopiert!",
  13765. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13766. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13767. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13768. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13769. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13770. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13771. ERROR_GENERIC_ACTIONS_3: " oder ",
  13772. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13773. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13774. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13775. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13776. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13777. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13778. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13779. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13780. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13781. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13782. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13783. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13784. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13785. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13786. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13787. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13788. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13789. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13790. LINK_TO_LOCATION: "Link zu",
  13791. MENU_COPY: "Kopieren",
  13792. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13793. ROTATE: "Drehen",
  13794. INSIDE: "Drinnen",
  13795. MOVE: "Bewegen",
  13796. ZOOM: "Vergrößern"
  13797. }
  13798. }
  13799. , {}],
  13800. 111: [function(e, t, i) {
  13801. "use strict";
  13802. t.exports = {
  13803. PAGE_TITLE: "",
  13804. LOADING: "Loading",
  13805. PRESENTED_BY_CAPS: "PRESENTED BY",
  13806. POWERED_BY: "powered by ",
  13807. POWERED_BY_CAPS: "POWERED BY",
  13808. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13809. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13810. PRESENTED_BY: "Presented by ",
  13811. MORE: "More ",
  13812. LESS: "Less ",
  13813. TAG_CONTENT: "tag™ Content",
  13814. SHOW: "Show",
  13815. HIDE: "Hide",
  13816. DOLLHOUSE: "Dollhouse",
  13817. FLOOR_PLAN: "Floor plan",
  13818. OPEN_HIGHLIGHTS: "Open Highlights",
  13819. CLOSE_HIGHLIGHTS: "Close",
  13820. PREVIOUS: "Previous",
  13821. PLAY: "Play",
  13822. PAUSE: "Pause",
  13823. NEXT: "Next",
  13824. EXPLORE_3D_SPACE: "Explore 3D Space",
  13825. VIEW_DOLLHOUSE: "View dollhouse",
  13826. SOCIAL_SHARING: "Share this Space",
  13827. VIEW_IN_VR: "View in VR",
  13828. VIEW_FULLSCREEN: "全屏",
  13829. EXIT_FULLSCREEN: "退出全屏",
  13830. ZOOM_IN: "Zoom in",
  13831. ZOOM_OUT: "Zoom out",
  13832. FLOOR_NAME: "Floor ",
  13833. FLOOR_ALL: "全部",
  13834. TERMS: "Terms",
  13835. PORT_TERMS: "port terms",
  13836. TERMS_OF_USE: "Terms of Use",
  13837. TERMS_TEXT_FILE: "terms-en-US.html",
  13838. CLOSE_TERMS: "Close",
  13839. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13840. HELP: "Help",
  13841. HELP_NAVIGATION_TAB: "Navigation",
  13842. HELP_MORE_HELP_TAB: "More Help",
  13843. CLOSE: "Close",
  13844. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13845. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13846. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13847. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13848. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13849. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13850. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13851. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13852. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13853. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13854. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13855. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13856. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13857. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13858. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13859. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13860. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13861. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13862. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13863. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13864. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13865. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13866. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13867. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13868. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13869. HELP_MORE_HLR_A: "Highlight Reel",
  13870. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13871. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13872. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13873. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13874. HELP_MORE_FLOORS_A: "Floor Selector",
  13875. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13876. HELP_MORE_TAG_A: "tag™ Posts",
  13877. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13878. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13879. HELP_MORE_ZOOM_A: "Zoom Controls",
  13880. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13881. HELP_MORE_TOUR_A: "Tour Controls",
  13882. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13883. HELP_MORE_INSIDE_A: "Inside View",
  13884. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13885. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13886. HELP_MORE_VR_A: "VR Mode",
  13887. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13888. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13889. HELP_MORE_360_A: "360° Views",
  13890. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13891. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13892. HELP_MORE_FULLSCREEN_A: "Full screen",
  13893. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13894. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13895. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13896. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13897. WEBVR_ENTER_WEBVR: "ENTER VR",
  13898. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13899. WEBVR_LEARN_MORE: "Learn more",
  13900. WEBVR_VIEW_SPACE: "View Space in VR",
  13901. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13902. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13903. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13904. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13905. VR_PREVIOUS_CAPS: "PREVIOUS",
  13906. VR_NEXT_CAPS: "NEXT",
  13907. VR_GOT_IT_CAPS: "GOT IT",
  13908. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13909. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13910. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13911. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13912. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13913. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13914. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13915. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13916. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13917. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13918. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13919. VR_APP: "port VR App",
  13920. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13921. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13922. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13923. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13924. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13925. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13926. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13927. VR_ANDROID_DVICES: "Android Devices",
  13928. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13929. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13930. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13931. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13932. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13933. VR_APP_OPEN: "Open with the port VR app instead",
  13934. VR_DOWNLOAD_HERE: "Download here",
  13935. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13936. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13937. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13938. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13939. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13940. SHARE_TO: "Share to",
  13941. SHARE_LINK: "Direct Link",
  13942. SHARE_EXPLORE: "Explore ",
  13943. SHARE_AT: "at",
  13944. SHARE_WITH: "with",
  13945. SHARE_3D: " in 3D",
  13946. SHARE_COPIED: "Copied!",
  13947. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13948. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13949. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13950. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13951. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13952. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13953. ERROR_GENERIC_ACTIONS_3: " or ",
  13954. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13955. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13956. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13957. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13958. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13959. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13960. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13961. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13962. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13963. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13964. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13965. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13966. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13967. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13968. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13969. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13970. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13971. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13972. LINK_TO_LOCATION: "Link to location",
  13973. MENU_COPY: "Copy",
  13974. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13975. ROTATE: "Rotate",
  13976. INSIDE: "Inside",
  13977. MOVE: "Move",
  13978. ZOOM: "Zoom"
  13979. }
  13980. }
  13981. , {}],
  13982. 112: [function(e, t, i) {
  13983. "use strict";
  13984. t.exports = {
  13985. PAGE_TITLE: "",
  13986. LOADING: "Cargando",
  13987. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13988. POWERED_BY: "potenciando por ",
  13989. POWERED_BY_CAPS: "POTENCIADO POR ",
  13990. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13991. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13992. PRESENTED_BY: "Presentado por ",
  13993. MORE: "Más ",
  13994. LESS: "Menos ",
  13995. TAG_CONTENT: "Contenido de tag™",
  13996. SHOW: "Mostrar",
  13997. HIDE: "Ocultar",
  13998. DOLLHOUSE: "Dollhouse",
  13999. FLOOR_PLAN: "Planos",
  14000. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  14001. CLOSE_HIGHLIGHTS: "Cerrar",
  14002. PREVIOUS: "Anterior",
  14003. PLAY: "Play",
  14004. PAUSE: "Pausa",
  14005. NEXT: "Siguiente",
  14006. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  14007. VIEW_DOLLHOUSE: "Ver dollhouse",
  14008. SOCIAL_SHARING: "Compartir este espacio",
  14009. VIEW_IN_VR: "Ver en realidad virtual",
  14010. VIEW_FULLSCREEN: "Ver en pantalla completa",
  14011. EXIT_FULLSCREEN: "Salir de pantalla completa",
  14012. ZOOM_IN: "Acercar",
  14013. ZOOM_OUT: "Alejar",
  14014. FLOOR_NAME: "Piso ",
  14015. FLOOR_ALL: "Todas",
  14016. TERMS: "Condiciones",
  14017. PORT_TERMS: "port términos de uso",
  14018. TERMS_OF_USE: "Términos de uso",
  14019. TERMS_TEXT_FILE: "terms-es-MX.html",
  14020. CLOSE_TERMS: "Cerrar",
  14021. TERMS_FAIL: "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  14022. HELP: "Ayuda",
  14023. HELP_NAVIGATION_TAB: "Navegación",
  14024. HELP_MORE_HELP_TAB: "Más Ayuda",
  14025. CLOSE: "Cerrar",
  14026. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  14027. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  14028. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14029. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  14030. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  14031. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  14032. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  14033. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  14034. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  14035. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  14036. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14037. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  14038. HELP_DESKTOP_FLOORPLAN_1A: "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  14039. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  14040. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14041. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  14042. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  14043. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  14044. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  14045. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  14046. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  14047. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  14048. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  14049. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  14050. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  14051. HELP_MORE_HLR_A: "Galería destacada",
  14052. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  14053. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  14054. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  14055. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  14056. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  14057. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  14058. HELP_MORE_TAG_A: "tag™ Posts",
  14059. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  14060. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  14061. HELP_MORE_ZOOM_A: "Controles de zoom",
  14062. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  14063. HELP_MORE_TOUR_A: "Controles de recorrido",
  14064. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  14065. HELP_MORE_INSIDE_A: "Vista interior",
  14066. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  14067. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  14068. HELP_MORE_VR_A: "Modo de realidad virtual",
  14069. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  14070. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  14071. HELP_MORE_360_A: "360° Views",
  14072. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  14073. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  14074. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  14075. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  14076. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  14077. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  14078. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  14079. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  14080. WEBVR_LEARN_MORE: "Más información",
  14081. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  14082. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14083. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  14084. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  14085. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  14086. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  14087. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  14088. VR_APP: "port VR App",
  14089. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  14090. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  14091. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  14092. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  14093. VR_LEARN_MORE_CAPS: "SABER MÁS",
  14094. VR_PREVIOUS_CAPS: "ANTERIOR",
  14095. VR_NEXT_CAPS: "SIGUIENTE",
  14096. VR_GOT_IT_CAPS: "COMPRENDIDO",
  14097. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  14098. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  14099. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  14100. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  14101. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  14102. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  14103. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  14104. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14105. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14106. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14107. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  14108. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14109. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  14110. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  14111. VR_ANDROID_DVICES: "Dispositivos Android",
  14112. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  14113. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  14114. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  14115. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  14116. VR_DOWNLOAD_HERE: "Descargar aquí",
  14117. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  14118. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  14119. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  14120. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  14121. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  14122. SHARE_TO: "Compartir en",
  14123. SHARE_LINK: "Enlace directo",
  14124. SHARE_EXPLORE: "Explorar ",
  14125. SHARE_AT: "en",
  14126. SHARE_WITH: "con",
  14127. SHARE_3D: " en 3D",
  14128. SHARE_COPIED: "¡Copiado!",
  14129. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  14130. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  14131. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  14132. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  14133. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  14134. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  14135. ERROR_GENERIC_ACTIONS_3: " o ",
  14136. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  14137. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  14138. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  14139. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  14140. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  14141. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  14142. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  14143. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  14144. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  14145. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  14146. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  14147. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  14148. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  14149. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  14150. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  14151. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  14152. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  14153. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  14154. LINK_TO_LOCATION: "Enlace a la ubicación",
  14155. MENU_COPY: "Copiar",
  14156. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  14157. ROTATE: "Girar",
  14158. INSIDE: "Interior",
  14159. MOVE: "Moverse",
  14160. ZOOM: "Acercar o alejar"
  14161. }
  14162. }
  14163. , {}],
  14164. 113: [function(e, t, i) {
  14165. "use strict";
  14166. t.exports = {
  14167. PAGE_TITLE: "",
  14168. LOADING: "Chargement",
  14169. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  14170. POWERED_BY: "alimenté par ",
  14171. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  14172. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  14173. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  14174. PRESENTED_BY: "Présenté par ",
  14175. MORE: "Plus ",
  14176. LESS: "Moins ",
  14177. TAG_CONTENT: "Contenu tag™",
  14178. SHOW: "Montrer",
  14179. HIDE: "Cacher",
  14180. DOLLHOUSE: "Dollhouse",
  14181. FLOOR_PLAN: "Plan de sol",
  14182. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  14183. CLOSE_HIGHLIGHTS: "Fermer",
  14184. PREVIOUS: "Précédent",
  14185. PLAY: "Lecture",
  14186. PAUSE: "Pause",
  14187. NEXT: "Suivant",
  14188. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  14189. VIEW_DOLLHOUSE: "Voir dollhouse",
  14190. SOCIAL_SHARING: "Partager cet espace",
  14191. VIEW_IN_VR: "Voir en VR",
  14192. VIEW_FULLSCREEN: "Plein écran",
  14193. EXIT_FULLSCREEN: "Fermer plein écran",
  14194. ZOOM_IN: "Zoom avant",
  14195. ZOOM_OUT: "Zoom arrière",
  14196. FLOOR_NAME: "Étage ",
  14197. FLOOR_ALL: "Tous",
  14198. TERMS: "Mentions légales",
  14199. PORT_TERMS: "port mentions légales",
  14200. TERMS_OF_USE: "Conditions d'utilisation",
  14201. TERMS_TEXT_FILE: "terms-fr-FR.html",
  14202. CLOSE_TERMS: "Fermer",
  14203. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  14204. HELP: "Aide",
  14205. HELP_NAVIGATION_TAB: "Navigation",
  14206. HELP_MORE_HELP_TAB: "Aide",
  14207. CLOSE: "Fermer",
  14208. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  14209. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  14210. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  14211. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  14212. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  14213. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  14214. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14215. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  14216. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  14217. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  14218. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  14219. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  14220. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  14221. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  14222. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  14223. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  14224. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  14225. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  14226. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  14227. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  14228. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14229. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  14230. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  14231. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14232. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14233. HELP_MORE_HLR_A: "Carrousel",
  14234. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14235. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14236. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14237. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14238. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14239. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14240. HELP_MORE_TAG_A: "tag™ Posts",
  14241. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14242. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14243. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14244. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14245. HELP_MORE_TOUR_A: "Commandes de la visite",
  14246. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14247. HELP_MORE_INSIDE_A: "Vue intérieure",
  14248. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14249. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14250. HELP_MORE_VR_A: "Mode RV",
  14251. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14252. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14253. HELP_MORE_360_A: "Vues 360°",
  14254. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14255. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14256. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14257. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14258. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14259. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14260. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14261. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14262. WEBVR_LEARN_MORE: "En savoir plus",
  14263. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14264. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14265. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14266. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14267. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14268. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14269. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14270. VR_NEXT_CAPS: "SUIVANT",
  14271. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14272. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14273. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14274. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14275. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14276. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14277. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14278. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14279. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14280. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14281. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14282. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14283. VR_APP: "port VR App",
  14284. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14285. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14286. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14287. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14288. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14289. VR_COMPATIBLE_ANDROID_LONG: "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",
  14290. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14291. VR_ANDROID_DVICES: "Appareils Android",
  14292. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14293. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14294. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14295. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14296. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14297. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14298. VR_DOWNLOAD_HERE: "Télécharger ici",
  14299. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14300. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14301. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14302. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14303. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14304. SHARE_TO: "Partager sur",
  14305. SHARE_LINK: "Lien direct",
  14306. SHARE_EXPLORE: "Explorer ",
  14307. SHARE_AT: "à",
  14308. SHARE_WITH: "avec",
  14309. SHARE_3D: " en 3D",
  14310. SHARE_COPIED: "Copié!",
  14311. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14312. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14313. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14314. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14315. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14316. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14317. ERROR_GENERIC_ACTIONS_3: " ou ",
  14318. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14319. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14320. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14321. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14322. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14323. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14324. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14325. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14326. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14327. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14328. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14329. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14330. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14331. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14332. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14333. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14334. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14335. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14336. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14337. MENU_COPY: "Copie",
  14338. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14339. ROTATE: "Faire pivoter",
  14340. INSIDE: "Intérieure",
  14341. MOVE: "Se déplacer",
  14342. ZOOM: "Zoom"
  14343. }
  14344. }
  14345. , {}],
  14346. 114: [function(e, t, i) {
  14347. "use strict";
  14348. t.exports = {
  14349. PAGE_TITLE: "",
  14350. LOADING: "読み込み中",
  14351. PRESENTED_BY_CAPS: "PRESENTED BY",
  14352. POWERED_BY: "powered by",
  14353. POWERED_BY_CAPS: "POWERED BY",
  14354. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14355. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14356. PRESENTED_BY: "Presented by ",
  14357. MORE: "全て表示 ",
  14358. LESS: "閉じる ",
  14359. TAG_CONTENT: "tag™コンテンツ ",
  14360. SHOW: "表示",
  14361. HIDE: "非表示",
  14362. DOLLHOUSE: "ドールハウス",
  14363. FLOOR_PLAN: "フロアプラン",
  14364. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14365. CLOSE_HIGHLIGHTS: "閉じる",
  14366. PREVIOUS: "前へ",
  14367. PLAY: "再生",
  14368. PAUSE: "一時停止",
  14369. NEXT: "次へ",
  14370. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14371. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14372. SOCIAL_SHARING: "このSpaceを共有する",
  14373. VIEW_IN_VR: "VRで表示",
  14374. VIEW_FULLSCREEN: "フルスクリーン表示",
  14375. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14376. ZOOM_IN: "ズームイン",
  14377. ZOOM_OUT: "ズームアウト",
  14378. FLOOR_NAME: "フロア ",
  14379. FLOOR_ALL: "すべて",
  14380. TERMS: "規約",
  14381. PORT_TERMS: "port規約",
  14382. TERMS_OF_USE: "利用規約",
  14383. CLOSE_TERMS: "閉じる",
  14384. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14385. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14386. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14387. WEBVR_ENTER_WEBVR: "VRに入る",
  14388. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14389. WEBVR_LEARN_MORE: "もっと詳しく",
  14390. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14391. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14392. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14393. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14394. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14395. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14396. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14397. VR_PREVIOUS_CAPS: "前へ",
  14398. VR_NEXT_CAPS: "次へ",
  14399. VR_GOT_IT_CAPS: "了解",
  14400. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14401. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14402. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14403. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14404. VR_WHAT_YOU_NEED: "必要なもの",
  14405. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14406. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14407. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14408. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14409. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14410. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14411. VR_APP: "port VRアプリ",
  14412. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14413. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14414. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14415. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14416. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14417. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14418. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14419. VR_ANDROID_DVICES: "Androidデバイス",
  14420. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14421. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14422. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14423. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14424. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14425. VR_APP_OPEN: "port VRアプリで開く",
  14426. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14427. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14428. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14429. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14430. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14431. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14432. SHARE_TO: "共有先",
  14433. SHARE_LINK: "ダイレクトリンク",
  14434. SHARE_EXPLORE: "探索",
  14435. SHARE_AT: "場所",
  14436. SHARE_WITH: "使用アプリ",
  14437. SHARE_3D: "3Dで",
  14438. SHARE_COPIED: "コピーされました!",
  14439. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14440. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14441. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14442. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14443. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14444. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14445. ERROR_GENERIC_ACTIONS_3: "または",
  14446. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14447. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14448. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14449. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14450. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14451. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14452. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14453. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14454. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14455. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14456. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14457. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14458. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14459. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14460. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14461. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14462. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14463. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14464. LINK_TO_LOCATION: "ロケーションへのリンク",
  14465. MENU_COPY: "コピー",
  14466. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14467. ROTATE: "回転",
  14468. MOVE: "移動",
  14469. INSIDE: "内側",
  14470. ZOOM: "ズーム",
  14471. HELP: "ヘルプ",
  14472. HELP_NAVIGATION_TAB: "ナビゲーション",
  14473. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14474. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14475. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14476. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14477. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14478. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14479. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14480. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14481. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14482. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14483. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14484. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14485. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14486. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14487. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14488. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14489. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14490. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14491. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14492. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14493. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14494. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14495. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14496. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14497. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14498. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14499. HELP_MORE_HLR_A: "ハイライト",
  14500. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14501. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14502. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14503. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14504. HELP_MORE_FLOORS_A: "フロアセレクター",
  14505. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14506. HELP_MORE_TAG_A: "tag™ Posts",
  14507. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14508. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14509. HELP_MORE_ZOOM_A: "ズームコントロール",
  14510. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14511. HELP_MORE_TOUR_A: "ツアーコントロール",
  14512. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14513. HELP_MORE_INSIDE_A: "内側ビュー",
  14514. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14515. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14516. HELP_MORE_VR_A: "VRモード",
  14517. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14518. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14519. HELP_MORE_360_A: "360° Views",
  14520. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14521. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14522. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14523. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14524. CLOSE: "閉じる"
  14525. }
  14526. }
  14527. , {}],
  14528. 115: [function(e, t, i) {
  14529. "use strict";
  14530. t.exports = {
  14531. PAGE_TITLE: "",
  14532. LOADING: "Загрузка",
  14533. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14534. POWERED_BY: "разработано на платформе ",
  14535. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14536. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14537. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14538. PRESENTED_BY: "Представлено ",
  14539. MORE: "Больше ",
  14540. LESS: "Меньше ",
  14541. TAG_CONTENT: "tag™ Контент",
  14542. SHOW: "Показать",
  14543. HIDE: "Скрыть",
  14544. DOLLHOUSE: "Dollhouse",
  14545. FLOOR_PLAN: "Планировка",
  14546. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14547. CLOSE_HIGHLIGHTS: "Закрыть",
  14548. PREVIOUS: "Предыдущий",
  14549. PLAY: "Воспроизвести",
  14550. PAUSE: "Пауза",
  14551. NEXT: "Следующий",
  14552. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14553. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14554. SOCIAL_SHARING: "Поделиться этой моделью",
  14555. VIEW_IN_VR: "Посмотреть в VR",
  14556. VIEW_FULLSCREEN: "Полный экран",
  14557. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14558. ZOOM_IN: "Увеличить",
  14559. ZOOM_OUT: "Уменьшить",
  14560. FLOOR_NAME: "Этаж ",
  14561. FLOOR_ALL: "Все",
  14562. TERMS: "Условия",
  14563. PORT_TERMS: "Правила пользования",
  14564. TERMS_OF_USE: "Условия использования",
  14565. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14566. CLOSE_TERMS: "Закрыть",
  14567. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14568. HELP: "Помощь",
  14569. HELP_NAVIGATION_TAB: "Навигация",
  14570. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14571. CLOSE: "Закрыть",
  14572. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14573. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14574. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14575. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14576. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14577. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14578. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14579. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14580. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14581. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14582. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14583. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14584. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14585. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14586. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14587. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14588. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14589. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14590. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14591. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14592. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14593. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14594. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14595. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14596. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14597. HELP_MORE_HLR_A: "Фотоколлаж",
  14598. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14599. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14600. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14601. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14602. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14603. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14604. HELP_MORE_TAG_A: "tag™ Posts",
  14605. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14606. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14607. HELP_MORE_ZOOM_A: "Масштаб",
  14608. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14609. HELP_MORE_TOUR_A: "Управление Туром",
  14610. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14611. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14612. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14613. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14614. HELP_MORE_VR_A: "Режим VR",
  14615. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14616. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14617. HELP_MORE_360_A: "360° Views",
  14618. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14619. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14620. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14621. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14622. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14623. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14624. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14625. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14626. WEBVR_LEARN_MORE: "Узнать больше",
  14627. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14628. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14629. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14630. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14631. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14632. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14633. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14634. VR_APP: "port VR App",
  14635. VR_APP_OPEN: "Или открыть через приложение port VR",
  14636. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14637. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14638. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14639. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14640. VR_VIEW_SPACE: "Запустить модель в VR",
  14641. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14642. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14643. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14644. VR_GOT_IT_CAPS: "ЯСНО",
  14645. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14646. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14647. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14648. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14649. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14650. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14651. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14652. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14653. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14654. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14655. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14656. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14657. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14658. VR_ANDROID_DVICES: "Android устройства",
  14659. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14660. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14661. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14662. VR_DOWNLOAD_HERE: "Скачать здесь",
  14663. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14664. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14665. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14666. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14667. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14668. SHARE_TO: "Поделиться",
  14669. SHARE_LINK: "Прямая ссылка",
  14670. SHARE_EXPLORE: "просмотреть",
  14671. SHARE_AT: "на",
  14672. SHARE_WITH: "с",
  14673. SHARE_3D: "в 3D",
  14674. SHARE_COPIED: "Скопировано!",
  14675. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14676. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14677. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14678. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14679. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14680. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14681. ERROR_GENERIC_ACTIONS_3: " или ",
  14682. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14683. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14684. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14685. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14686. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14687. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14688. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14689. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14690. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14691. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14692. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14693. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14694. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14695. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14696. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14697. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14698. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14699. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14700. LINK_TO_LOCATION: "Ссылка на местоположение",
  14701. MENU_COPY: "Копировать",
  14702. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14703. ROTATE: "Вращать",
  14704. MOVE: "Передвигаться",
  14705. INSIDE: "Вид изнутри",
  14706. ZOOM: "Масштаб"
  14707. }
  14708. }
  14709. , {}],
  14710. 116: [function(e, t, i) {//main.js
  14711. (function(t) {
  14712. "use strict";
  14713. var modelProgressBase = 0.4;
  14714. var progressUpdate = function(e){ // 0 <= e <= 1
  14715. console.log('e1:'+e)
  14716. e = Math.round(modelProgressBase * e * 100);
  14717. console.log('e2:'+e)
  14718. var t = $('.progressbar');
  14719. t.find('.bar').css('width',e+'%');
  14720. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14721. t.find('.perc').text(e +'%'); //具体数字的百分比
  14722. }
  14723. $('#gui-loading').fadeIn(200);
  14724. progressUpdate(0.1)
  14725. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14726. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14727. var data = matcher(e);
  14728. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14729. data.user = {
  14730. "is_authenticated": false,
  14731. "flags": ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  14732. }
  14733. try{//处理一下导览数据
  14734. data.model.images = data.model.images.filter(e=>{
  14735. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14736. if(e.locations && e.locations.length == 0)return;
  14737. return e
  14738. })
  14739. }catch(e){console.log(e) }
  14740. window.MP_PREFETCHED_MODELDATA = data;
  14741. data.model.summary = data.summary
  14742. data.model.name = data.name
  14743. for(let i in data){
  14744. data[i] == "false" && (data[i] = false)
  14745. }
  14746. progressUpdate(0.7);
  14747. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14748. if(data.weixinDesc){
  14749. g_weixinObj.desc = data.weixinDesc;
  14750. }
  14751. if(data.shareImgUrl){
  14752. g_weixinObj.imgUrl = data.shareImgUrl
  14753. }
  14754. window.wx && manage.weixinShare();
  14755. //初始画面
  14756. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14757. function E(e) {
  14758. $("<img/>").attr("src", e).on("load", function() {
  14759. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14760. $(this).remove()
  14761. })
  14762. }
  14763. })
  14764. function StartLoad(){//当加载完data后
  14765. function i() {
  14766. var e = Y.getModelIDFromQueryString();
  14767. if (!e)
  14768. return b(null, "loading-failed");
  14769. var t = Y.parseSidUrl(e)
  14770. , i = l()
  14771. , a = c()
  14772. , s = o()
  14773. , u = V.quickstart.enabled
  14774. , g = null
  14775. , m = null
  14776. , v = null
  14777. , w = null
  14778. , T = null
  14779. , x = null
  14780. , S = null
  14781. , M = null
  14782. , R = null
  14783. , P = null
  14784. , O = null
  14785. , L = null
  14786. , N = new ue;
  14787. r(s);
  14788. h({ //MP开头写法
  14789. urlBase: t.urlBase
  14790. }).then(function() {
  14791. return re.init(),
  14792. d(t, e) //getModel and load
  14793. }).then(function(e) {
  14794. progressUpdate(0.9)
  14795. return P = e,
  14796. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14797. startSource: i,
  14798. autoplay: V.autoplay,
  14799. quickstart: u
  14800. }),
  14801. P.urls.init()
  14802. }).then(function() {
  14803. return P.loadPanos()
  14804. }).then(function() {
  14805. m = X.getStartCameraOptions(P, P.panos),
  14806. S = A(P),
  14807. O = y(u, m.mode),
  14808. v = O.controls,
  14809. w = O.player,
  14810. T = O.director,
  14811. x = O.tagManager,
  14812. M = O.tileDownloader,
  14813. R = O.qualityManager,
  14814. L = O.panoRenderer,
  14815. C(P, S, O, s),
  14816. w.director = T,//xzw add
  14817. P.supportsTiles && M.start(),
  14818. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14819. u = !1);
  14820. var e = null;
  14821. if (u) {
  14822. de.warn("Quickstart engaged. Hold on to your knickers.");
  14823. var t = v.controls[D.PANORAMA];
  14824. g = new ie(R,S.scene,S.camera,t,s),
  14825. _(S, s, P),
  14826. e = g.load(m).then(function() {
  14827. S.addComponent(g),
  14828. S.once(le.AfterRender, function() {
  14829. de.warn("First render after quickstart load finished.")
  14830. })
  14831. })
  14832. }
  14833. window.flyToFirst = function(){//xzw add
  14834. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14835. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14836. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14837. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14838. };
  14839. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14840. }).then(function() {
  14841. return f(P, U.onProgress, i, !u, a)
  14842. }).then(function() {
  14843. if (m.quickstart = u,
  14844. I(P, S, O, s),
  14845. S.started || _(S, s, P),
  14846. H.modelLoaded(P, w, v, V.autoplay),
  14847. E(w, P, m, V.autoplay).done(function() {
  14848. T.autoTour()
  14849. }),
  14850. !P.supportsTiles) {
  14851. var e = new Z(P,w);
  14852. e.start()
  14853. }
  14854. u && (S.removeComponent(g),
  14855. g.destroy(),
  14856. m.pano.enter()),
  14857. U.init(P, T, w, v, S, m, H.getSessionId()),
  14858. U.endLoading(P, T, x),
  14859. S.once(le.AfterRender, function() {
  14860. N.setAppReadyTime();
  14861. var e = N.calcFullLoadingTime();
  14862. de.warn("Total load time: " + e / 1e3),
  14863. H.loadComplete(e),
  14864. de.warn("First render after model load finished.")
  14865. }),
  14866. S.on(le.MemoryUsageUpdated, n)
  14867. }).fail(b.bind(this, e))
  14868. }
  14869. function n(e) {
  14870. ce.update(e)
  14871. }
  14872. function r(e) {
  14873. de.info("Version", "2.25.6-0-gd87e5b1"),
  14874. q.defaultMaxListeners = 1e3,
  14875. a(e),
  14876. s()
  14877. }
  14878. function o() {
  14879. return document.getElementById("player")
  14880. }
  14881. function a(e) {
  14882. e.addEventListener("dragenter", T, !1),
  14883. e.addEventListener("dragover", T, !1)
  14884. }
  14885. function s() {
  14886. F.valueFromHash("title", !0) || $(document).ready(function() {
  14887. var e = $(".model-title");
  14888. e.hide()
  14889. })
  14890. }
  14891. function l() {
  14892. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14893. }
  14894. function c() {
  14895. return {
  14896. panoElementsToLoad: 6,
  14897. modelElementsToLoad: 0,
  14898. totalElementsLoaded: 0,
  14899. totalElementsToLoad: 0,
  14900. totalPercentageLoaded: 0,
  14901. progressCallback: null
  14902. }
  14903. }
  14904. function h(e) {
  14905. return K.loadFeatureFlags(e).done(function(e) {
  14906. K.updateDependentSettings(e, V)
  14907. })
  14908. }
  14909. // function u(e) {
  14910. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14911. // responseType: "json",
  14912. // prefetchFrom: "config"
  14913. // }).then(function(e) {
  14914. // return e ? void j.extendObject(V.appConfig, e) : {}
  14915. // }, function(e) {
  14916. // return de.warn("Failed loading runtime config, using defaults."),
  14917. // $.when({})
  14918. // })
  14919. // }
  14920. function d(e, t) {
  14921. var i = B.getModel({
  14922. url: t,
  14923. floors: F.valueFromHash("f", !0),
  14924. autoload: !1
  14925. })
  14926. ;
  14927. return $.when(i, n).then(null, function(e) {
  14928. return this
  14929. })
  14930. }
  14931. function p(e, t, i, n, r) {
  14932. de.info("Model data loaded"),
  14933. de.debug("UUID: " + e.data.job.uuid),
  14934. J.init(K.getFlags()),
  14935. i && H.initKeen({
  14936. token: i,
  14937. appId: n
  14938. }),
  14939. H.initSegment({
  14940. model: e.sid,
  14941. version: "2.25.6-0-gd87e5b1",
  14942. startSource: r.startSource,
  14943. token: t,
  14944. autoplay: r.autoplay,
  14945. quickstart: r.quickstart
  14946. })
  14947. }
  14948. function f(e, t, i, n, r) {
  14949. return r.progressCallback = t,
  14950. H.sessionStart(),
  14951. e.load(n).progress(g.bind(this, r))
  14952. }
  14953. function g(e, t) {
  14954. e.modelElementsToLoad = t[1],
  14955. v(e),
  14956. m(e)
  14957. }
  14958. function m(e) {
  14959. e.totalElementsLoaded++,
  14960. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14961. //----许钟文-----------------模型进度条向后调整
  14962. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14963. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14964. console.log('pro:'+e.totalPercentageLoaded)
  14965. //---------------------------
  14966. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14967. }
  14968. function v(e) {
  14969. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14970. }
  14971. function A(e) {
  14972. var t = new x.PerspectiveCamera;
  14973. t.layers.enable(he.PANOMARKERS),
  14974. t.layers.enable(he.RETICULE),
  14975. t.layers.enable(he.TAG);
  14976. var i = new x.Scene
  14977. , n = new x.AmbientLight(16777215);
  14978. i.add(n),
  14979. // i.skybox = new W,
  14980. // i.add(i.skybox),
  14981. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14982. side: x.DoubleSide
  14983. })),
  14984. i.plane.position.y = 0,
  14985. i.plane.rotateX(-Math.PI / 2),
  14986. i.plane.material.visible = !1,
  14987. i.add(i.plane),
  14988. i.updateMatrixWorld(),
  14989. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14990. if (e.metadata && e.metadata.camera_position) {
  14991. var t = e.metadata.camera_position
  14992. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14993. n.position = t.clone(),
  14994. i.add(n);
  14995. var r = e.metadata.camera_quaternion
  14996. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14997. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14998. }
  14999. }),
  15000. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  15001. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  15002. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  15003. var r = new te(i,t,z);
  15004. return r
  15005. }
  15006. function y(e, t) {
  15007. var i = e ? 1 : 1e3
  15008. , n = J.tilegen || J.imgopt ? 6 : 2;
  15009. n = F.valueFromHash("tileconc", n);
  15010. var r = new ne
  15011. , o = new ae({
  15012. concurrentDownloads: n
  15013. })
  15014. , a = new se
  15015. , s = new P
  15016. , l = new M
  15017. , c = new S(t)
  15018. , h = new R
  15019. , u = new O(i)
  15020. , d = new L
  15021. , p = new oe;
  15022. return {
  15023. qualityManager: r,
  15024. panoRenderer: a,
  15025. tileDownloader: o,
  15026. player: c,
  15027. director: l,
  15028. modelManager: s,
  15029. tagManager: p,
  15030. displayController: u,
  15031. labelDisplayController: d,
  15032. controls: h
  15033. }
  15034. }
  15035. function C(e, t, i, n) {
  15036. var r = i.controls
  15037. , o = i.qualityManager
  15038. , a = i.panoRenderer
  15039. , s = i.tileDownloader
  15040. , l = i.modelManager;
  15041. r.init(n, l),
  15042. ee.init(i.director, r, i.player, l, t),
  15043. o.init(l),
  15044. s.init(o),
  15045. a.init(t, s, o),
  15046. l.init(s, a, o),
  15047. l.addModel(e),
  15048. t.addComponent(G)
  15049. }
  15050. function I(e, t, i, n) {
  15051. var r = i.qualityManager
  15052. , o = i.panoRenderer
  15053. , a = i.tileDownloader
  15054. , s = i.modelManager
  15055. , l = i.player
  15056. , c = i.director
  15057. , h = i.tagManager
  15058. , u = i.displayController
  15059. , d = i.labelDisplayController
  15060. , p = i.controls;
  15061. t.scene.add(e),
  15062. t.qualityManager = r;
  15063. var f = {
  15064. camera: t.camera,
  15065. director: c,
  15066. modelManager: s,
  15067. tileDownloader: a,
  15068. panoRenderer: o,
  15069. qualityManager: r,
  15070. tagManager: h,
  15071. container: n,
  15072. controls: p
  15073. };
  15074. l.init(f),
  15075. l.setScene(t.scene),
  15076. h.init(s, l),
  15077. c.init(l, s),
  15078. u.init(c, l, s, h, n),
  15079. d.init(l, s, n),
  15080. z.bindEvents(l),
  15081. t.addComponent(h),
  15082. t.addComponent(l),
  15083. t.addComponent(o),
  15084. l.sceneRenderer = t; //xzw add 方便resize
  15085. }
  15086. function E(e, t, i, n) {
  15087. return de.info("Starting player in " + i.mode),
  15088. H.report(t.sid, "started-playing", n, i.quickstart),
  15089. e.start(i)
  15090. }
  15091. function b(e, t) {
  15092. de.error(t),
  15093. k.error(t),
  15094. H.report(e, "error-" + t)
  15095. }
  15096. function w(e) {
  15097. var t = F.details();
  15098. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  15099. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  15100. H.report(e, "error-webgl-generic"))
  15101. }
  15102. function _(e, t, i) {
  15103. try {
  15104. e.start(t)
  15105. } catch (e) {
  15106. throw de.warn(e.message),
  15107. w(i.sid),
  15108. e
  15109. }
  15110. }
  15111. function T(e) {
  15112. e.stopPropagation(),
  15113. e.preventDefault()
  15114. }
  15115. //czj 判断someData 有没有hoticon字段 修改热点的样式
  15116. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  15117. g_HotImage = {
  15118. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  15119. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  15120. } ;
  15121. }
  15122. //czj 判断someData 有没有backgroundMusic 添加音乐
  15123. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  15124. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  15125. //else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  15126. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic
  15127. $("#volume").show();
  15128. }else if (g_version === "one"){
  15129. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  15130. //g_bgAudio.src = manage.dealURL(src) ;
  15131. }
  15132. //隐藏公司logo
  15133. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  15134. showLogo();
  15135. }
  15136. e("./lib/three75-shim"),
  15137. e("./lib/array-polyfill"),
  15138. e("./lib/performance-polyfill"),
  15139. e("./lib/shaders/CopyShader.js"),
  15140. e("./lib/shaders/HorizontalBlurShader.js"),
  15141. e("./lib/shaders/VerticalBlurShader.js"),
  15142. e("./lib/postprocessing/EffectComposer.js"),
  15143. e("./lib/postprocessing/RenderPass.js"),
  15144. e("./lib/postprocessing/MaskPass.js"),
  15145. e("./lib/postprocessing/ShaderPass.js"),
  15146. window.Promise || (window.Promise = e("promise-polyfill"));
  15147. var x = e("three")
  15148. , _x = e("three")
  15149. , S = (e("./util/sentry"),
  15150. e("./player"))
  15151. , M = e("./director")
  15152. , R = e("./controls/CameraControls")
  15153. , P = e("./model/ModelManager")
  15154. , O = e("./DisplayController")
  15155. , L = e("./label/LabelDisplayController")
  15156. , D = e("./enum/Viewmode")
  15157. , N = e("./util/logger")
  15158. , B = e("./showcase")
  15159. , F = e("./util/browser")
  15160. , V = e("./settings")
  15161. , U = e("./gui/gui")
  15162. , k = e("./gui/error")
  15163. , H = e("./analytics")
  15164. , G = e("./util/transitions")
  15165. , z = e("./effects")
  15166. , W = e("./objects/Skybox")
  15167. , j = e("./util/common")
  15168. , Y = (e("./util/PanoramaCollection"),
  15169. e("./util/math"),
  15170. e("./util/showcase"))
  15171. , X = e("./util/camera")
  15172. , Z = (e("./objects/Panorama"),
  15173. e("./cameras/PanoramaCamera"),
  15174. e("./preloaders"))
  15175. , q = e("events").EventEmitter
  15176. , K = e("./featureflags")
  15177. , Q = (e("./util/lerp"),
  15178. e("./util/ajax"))
  15179. , J = e("./ab")
  15180. , ee = e("./sdk/automation.js")
  15181. , te = e("./scene/SceneRenderer")
  15182. , ie = e("./scene/QuickstartManager")
  15183. , ne = e("./tile/QualityManager.js")
  15184. , re = e("./localization/localize")
  15185. , oe = e("./tag/tagManager")
  15186. , ae = e("./tile/TileDownloader")
  15187. , se = e("./tile/PanoRenderer")
  15188. , le = (e("./enum/PanoSizeClass"),
  15189. e("./enum/PanoramaEvents"),
  15190. e("./enum/SceneRendererEvents"))
  15191. , ce = e("./gui/memoryUsage")
  15192. , he = e("./enum/RenderLayers")
  15193. , ue = e("./TimingData")
  15194. , de = new N(t);
  15195. N.level = V.logLevel,
  15196. N.consoleEnabled = V.console,
  15197. i()
  15198. }
  15199. }
  15200. ).call(this, "/js/main.js")
  15201. }
  15202. , {
  15203. "./DisplayController": 1,
  15204. "./TimingData": 2,
  15205. "./ab": 3,
  15206. "./analytics": 4,
  15207. "./cameras/PanoramaCamera": 7,
  15208. "./controls/CameraControls": 9,
  15209. "./director": 15,
  15210. "./effects": 16,
  15211. "./enum/PanoSizeClass": 36,
  15212. "./enum/PanoramaEvents": 37,
  15213. "./enum/RenderLayers": 41,
  15214. "./enum/SceneRendererEvents": 43,
  15215. "./enum/Viewmode": 51,
  15216. "./featureflags": 59,
  15217. "./gui/error": 64,
  15218. "./gui/gui": 65,
  15219. "./gui/memoryUsage": 73,
  15220. "./label/LabelDisplayController": 91,
  15221. "./lib/array-polyfill": 92,
  15222. "./lib/performance-polyfill": 95,
  15223. "./lib/postprocessing/EffectComposer.js": 96,
  15224. "./lib/postprocessing/MaskPass.js": 97,
  15225. "./lib/postprocessing/RenderPass.js": 98,
  15226. "./lib/postprocessing/ShaderPass.js": 99,
  15227. "./lib/shaders/CopyShader.js": 100,
  15228. "./lib/shaders/HorizontalBlurShader.js": 101,
  15229. "./lib/shaders/VerticalBlurShader.js": 102,
  15230. "./lib/three75-shim": 103,
  15231. "./localization/localize": 108,
  15232. "./tag/tagManager": 124,
  15233. "./model/ModelManager": 140,
  15234. "./objects/Panorama": 148,
  15235. "./objects/Skybox": 152,
  15236. "./player": 155,
  15237. "./preloaders": 156,
  15238. "./scene/QuickstartManager": 157,
  15239. "./scene/SceneRenderer": 158,
  15240. "./sdk/automation.js": 164,
  15241. "./settings": 166,
  15242. "./showcase": 168,
  15243. "./tile/PanoRenderer": 169,
  15244. "./tile/QualityManager.js": 170,
  15245. "./tile/TileDownloader": 171,
  15246. "./util/PanoramaCollection": 178,
  15247. "./util/ajax": 181,
  15248. "./util/browser": 182,
  15249. "./util/camera": 183,
  15250. "./util/common": 185,
  15251. "./util/lerp": 188,
  15252. "./util/logger": 189,
  15253. "./util/math": 190,
  15254. "./util/sentry": 192,
  15255. "./util/showcase": 193,
  15256. "./util/transitions": 195,
  15257. events: 202,
  15258. "promise-polyfill": 213,
  15259. three: 217
  15260. }],
  15261. 117: [function(e, t, i) {
  15262. "use strict";
  15263. function n(e) {
  15264. e = e || {}
  15265. r.RawShaderMaterial.call(this, a.extendObject({
  15266. fragmentShader: o.cube.fragmentShader,
  15267. vertexShader: o.cube.vertexShader,
  15268. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15269. name: "CubemapMaterial",
  15270. }, e))
  15271. }
  15272. var r = e("three")
  15273. , o = e("../shaders")
  15274. , a = e("../util/common");
  15275. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15276. n.prototype.constructor = n,
  15277. t.exports = n
  15278. }
  15279. , {
  15280. "../shaders": 167,
  15281. "../util/common": 185,
  15282. three: 217
  15283. }],
  15284. 118: [function(e, t, i) {
  15285. "use strict";
  15286. function n(e) {
  15287. e = e || {}
  15288. r.RawShaderMaterial.call(this, a.extendObject({
  15289. fragmentShader: o.model.fragmentShader,
  15290. vertexShader: o.model.vertexShader,
  15291. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15292. name: "ModelTextureMaterial",
  15293. }, e))
  15294. }
  15295. var r = e("three")
  15296. , o = e("../shaders")
  15297. , a = e("../util/common");
  15298. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15299. n.prototype.constructor = n,
  15300. n.prototype.setProjectedPanos = function(e, t, i) {
  15301. i && (this.uniforms.progress.value = 0),
  15302. e.ensureSkyboxReadyForRender(),
  15303. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15304. this.uniforms.pano0Position.value.copy(e.position),
  15305. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15306. t.ensureSkyboxReadyForRender(),
  15307. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15308. this.uniforms.pano1Position.value.copy(t.position),
  15309. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15310. }
  15311. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15312. this.uniforms.eyeDir.value.copy(dir)
  15313. this.uniforms.eyePos.value.copy(pos)
  15314. }
  15315. n.prototype.setBendCameraQua = function(matrix) {//加
  15316. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15317. } */
  15318. ,
  15319. t.exports = n
  15320. }
  15321. , {
  15322. "../shaders": 167,
  15323. "../util/common": 185,
  15324. three: 217
  15325. }],
  15326. 119: [function(e, t, i) {
  15327. (function(i) {
  15328. "use strict";
  15329. function n(e, t, i, n) {
  15330. this.div = null,
  15331. this.body = null,
  15332. this.label = e,
  15333. this.description = t,
  15334. this.parsedDescription = [],
  15335. this.media = i || {
  15336. type: null
  15337. },
  15338. this.loadingSpinner = null,
  15339. this.parser = new r({
  15340. supportLinks: !u.valueFromHash("mls"),
  15341. keepLinkLabels: !0
  15342. }),
  15343. this.state = I.CLOSED,
  15344. this.orientation = "",
  15345. this.initialTransform = "",
  15346. this.hovering = !1,
  15347. this.openTransition = null,
  15348. this.closeTransition = null,
  15349. this.openPromise = null,
  15350. this.closePromise = null,
  15351. this.animationTransition = null,
  15352. this.animationScale = 0
  15353. }
  15354. var r = e("../Parser/DescriptionParser")
  15355. , o = e("../Media/Link")
  15356. , a = e("../Media/Image")
  15357. , s = e("../Media/EmbedlyPlayer")
  15358. , l = e("../Media/EmbedlyEmbed")
  15359. , c = e("../../util/transitions")
  15360. , h = e("../../util/lerp")
  15361. , u = e("../../util/browser")
  15362. , d = e("./BillboardEvent")
  15363. , p = e("../Media/MediaEvent")
  15364. , f = e("../Parser/DescriptionChunkType")
  15365. , g = e("events").EventEmitter
  15366. , m = e("./billboardSettings")
  15367. , v = e("./overlaySettings")
  15368. , A = e("../../util/logger")
  15369. , y = new A(i)
  15370. , C = document.getElementById("tag-billboards");
  15371. C.addEventListener("touchend", function(e) {
  15372. C.style.pointerEvents = "none"
  15373. }),
  15374. C.addEventListener("touchcancel", function(e) {
  15375. C.style.pointerEvents = "none"
  15376. });
  15377. var I = {
  15378. CLOSED: "closed",
  15379. OPENING: "opening",
  15380. OPEN: "open",
  15381. CLOSING: "closing",
  15382. ACTIVE: "active"
  15383. };
  15384. n.prototype = Object.create(g.prototype),
  15385. n.prototype.build = function(e) {
  15386. this.parsedDescription = this.parser.parse(this.description);
  15387. var t = document.createElement("div");
  15388. t.className = "tag-container has-hotzone",
  15389. this.div = t,
  15390. this.body = document.createElement("div"),
  15391. this.body.className = "tag-body";
  15392. var i = document.createElement("div");
  15393. i.classList.add("tag-content");
  15394. var n = document.createElement("div");
  15395. n.classList.add("tag-text-content");
  15396. var r = document.createElement("div");
  15397. r.className = "tag-label",
  15398. r.textContent = this.label,
  15399. n.appendChild(r);
  15400. var o = document.createElement("div");
  15401. o.className = "tag-desc",
  15402. n.appendChild(o),
  15403. i.appendChild(n),
  15404. this.body.appendChild(i),
  15405. this.appendDescriptionElements(this.parsedDescription, o),
  15406. this.appendMedia(),
  15407. t.appendChild(this.body),
  15408. C.appendChild(t),
  15409. this.bindEvents(t, this.body)
  15410. }
  15411. ,
  15412. n.prototype.bindEvents = function(e, t) {
  15413. var i = function(e) {
  15414. return function(t) {
  15415. if (!this.div.classList.contains("overlay")) {
  15416. var i, n = document.getElementById("player");
  15417. try {
  15418. i = new MouseEvent(e,t)
  15419. } catch (n) {
  15420. i = document.createEvent("MouseEvents"),
  15421. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  15422. }
  15423. n.dispatchEvent(i)
  15424. }
  15425. }
  15426. };
  15427. t.addEventListener("mousedown", function(e) {
  15428. e.stopPropagation()
  15429. }),
  15430. t.addEventListener("mouseup", function(e) {
  15431. e.stopPropagation()
  15432. }),
  15433. e.addEventListener("touchstart", function(e) {
  15434. C.style.pointerEvents = "auto"
  15435. }),
  15436. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15437. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15438. t.addEventListener("mouseover", function(t) {
  15439. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15440. }
  15441. .bind(this)),
  15442. e.addEventListener("mouseenter", function(e) {
  15443. this.state !== I.CLOSING && (this.hovering = !0,
  15444. this.emit(d.ENTER))
  15445. }
  15446. .bind(this)),
  15447. e.addEventListener("mouseleave", function(e) {
  15448. this.hovering = !1,
  15449. this.emit(d.LEAVE)
  15450. }
  15451. .bind(this)),
  15452. e.addEventListener("gesturestart", function(e) {
  15453. e.preventDefault()
  15454. });
  15455. var n = e.querySelector(".tag-text-content")
  15456. , r = 0;
  15457. n.addEventListener("touchstart", function(e) {
  15458. r = e.changedTouches[0].clientY
  15459. }),
  15460. n.addEventListener("touchmove", function(t) {
  15461. function i(e) {
  15462. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15463. }
  15464. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15465. }),
  15466. e.addEventListener("touchmove", function(e) {
  15467. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15468. })
  15469. }
  15470. ,
  15471. n.prototype.appendDescriptionElements = function(e, t) {
  15472. e.length > 0 && this.div.classList.add("has-text"),
  15473. e.forEach(function(e, i) {
  15474. switch (e.type) {
  15475. case f.TEXT:
  15476. t.appendChild(this.createTextElement(e.text));
  15477. break;
  15478. case f.LINK:
  15479. t.appendChild(this.createLinkElement(e.link))
  15480. }
  15481. }
  15482. .bind(this))
  15483. }
  15484. ,
  15485. n.prototype.appendLoadingSpinner = function() {
  15486. this.loadingSpinner = document.createElement("div"),
  15487. this.loadingSpinner.classList.add("loading-spinner");
  15488. var e = document.createElement("div");
  15489. e.classList.add("gui-spinner-icon"),
  15490. this.loadingSpinner.appendChild(e),
  15491. this.body.appendChild(this.loadingSpinner)
  15492. }
  15493. ,
  15494. n.prototype.onMediaLoadFinished = function() {
  15495. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15496. this.applyOrientation(this.orientation),
  15497. this.loadingSpinner = null)
  15498. }
  15499. ,
  15500. n.prototype.appendMedia = function() {
  15501. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15502. this.appendLoadingSpinner();
  15503. var e = document.createElement("div");
  15504. e.classList.add("tag-media-content");
  15505. var t = document.createElement("i");
  15506. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15507. t.classList.add(e)
  15508. }),
  15509. this.body.appendChild(t),
  15510. this.body.appendChild(e),
  15511. this.media.type) {
  15512. case f.IMAGE:
  15513. e.appendChild(this.createImageElement(this.media, this.body));
  15514. break;
  15515. case f.VIDEO:
  15516. e.appendChild(this.createVideoElement(this.media, this.body));
  15517. break;
  15518. case f.RICH:
  15519. e.appendChild(this.createEmbedElement(this.media, this.body))
  15520. }
  15521. }
  15522. }
  15523. ,
  15524. n.prototype.createTextElement = function(e) {
  15525. var t = document.createElement("span");
  15526. return t.textContent = e,
  15527. t
  15528. }
  15529. ;
  15530. n.prototype.createLinkElement = function(e) {
  15531. var t = new o(e);
  15532. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15533. t.createDomElement()
  15534. }
  15535. ,
  15536. n.prototype.createImageElement = function(e, t) {
  15537. function i() {
  15538. function e() {
  15539. m || (r.classList.remove("view-image"),
  15540. c.classList.add("overlay"),
  15541. i(),
  15542. window.addEventListener("resize", b),
  15543. c.addEventListener("click", a),
  15544. g.addEventListener("click", l),
  15545. f.addEventListener("click", s),
  15546. m = !0,
  15547. o.emit(p.IMAGE_OPENED))
  15548. }
  15549. function i() {
  15550. t.classList.add("show-info"),
  15551. h.classList.remove("collapsible"),
  15552. h.style.height = "";
  15553. var e = parseFloat(getComputedStyle(I).lineHeight)
  15554. , i = y + e
  15555. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15556. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15557. , s = a
  15558. , l = s * n.aspect;
  15559. l > r && (l = r,
  15560. s = l / n.aspect),
  15561. s > a && (s = a,
  15562. l = s * n.aspect),
  15563. l += C,
  15564. s += C + i,
  15565. t.style.width = l + "px",
  15566. t.style.height = s + "px",
  15567. u.style.paddingTop = e + C + "px",
  15568. o.description.length > 0 && (h.classList.add("collapsible"),
  15569. h.style.height = h.clientHeight + 12 + "px",
  15570. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15571. }
  15572. function a(e) {
  15573. e.target === c && s()
  15574. }
  15575. function s() {
  15576. m && (m = !1,
  15577. r.classList.add("view-image"),
  15578. c.classList.remove("overlay"),
  15579. h.style.height = "",
  15580. u.style.paddingTop = "",
  15581. t.style.width = "",
  15582. t.style.height = "",
  15583. window.removeEventListener("resize", b),
  15584. c.removeEventListener("click", a),
  15585. g.removeEventListener("click", l),
  15586. f.removeEventListener("click", s),
  15587. o.emit(p.IMAGE_CLOSED),
  15588. o.close(!0))
  15589. }
  15590. function l(e) {
  15591. t.classList.toggle("show-info")
  15592. }
  15593. var c = o.div
  15594. , h = c.getElementsByClassName("tag-content")[0]
  15595. , u = c.getElementsByClassName("tag-media-content")[0]
  15596. , f = t.getElementsByClassName("close")[0]
  15597. , g = h.getElementsByClassName("tag-label")[0];
  15598. c.classList.add("has-image"),
  15599. r.classList.add("view-image"),
  15600. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15601. o.applyOrientation(o.orientation);
  15602. var m = !1
  15603. , A = getComputedStyle(h)
  15604. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15605. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15606. , I = h.querySelector(".tag-label")
  15607. , E = h.querySelector(".tag-desc")
  15608. , b = function() {
  15609. var e, t, n = 0;
  15610. return function() {
  15611. clearInterval(e),
  15612. clearTimeout(t),
  15613. e = setInterval(function() {
  15614. var e = c.clientHeight;
  15615. n !== e && (i(),
  15616. n = e)
  15617. }, 100),
  15618. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15619. }
  15620. }();
  15621. n.on(p.IMAGE_OPENING, e),
  15622. o.on(d.ACTIVATE, e),
  15623. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15624. o.on(d.CLOSING, s)
  15625. }
  15626. var n = new a
  15627. , r = n.createDomElement();
  15628. this.once(d.OPENED, function() {
  15629. n.load(e.src).then(i).catch(function(t) {
  15630. y.warn("Failed to load image:", e.src),
  15631. y.warn("with error:", t)
  15632. }).then(this.onMediaLoadFinished.bind(this))
  15633. });
  15634. var o = this;
  15635. return r
  15636. }
  15637. ,
  15638. n.prototype.createVideoElement = function(e, t) {
  15639. var i = new s({
  15640. autoPlay: !0,
  15641. autoResume: !0,
  15642. startMuted: !1,
  15643. loop: !1
  15644. })
  15645. , n = i.createDomElement();
  15646. return this.once(d.OPENED, function() {
  15647. i.load(e.src).then(function() {
  15648. this.div.classList.add("has-video"),
  15649. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15650. i.play()),
  15651. this.on(d.OPENING, i.show.bind(i)),
  15652. this.on(d.OPENED, i.play.bind(i)),
  15653. this.on(d.CLOSING, i.pause.bind(i)),
  15654. this.on(d.CLOSED, i.hide.bind(i))
  15655. }
  15656. .bind(this)).catch(function(t) {
  15657. y.warn("Failed to embed video:", e.src),
  15658. y.warn("with error:", t)
  15659. }).then(this.onMediaLoadFinished.bind(this))
  15660. }
  15661. .bind(this)),
  15662. n
  15663. }
  15664. ,
  15665. n.prototype.createEmbedElement = function(e, t) {
  15666. var i = new l
  15667. , n = i.createDomElement();
  15668. return this.once(d.OPENED, function() {
  15669. i.load(e.src).then(function() {
  15670. this.div.classList.add("has-embed"),
  15671. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15672. this.applyOrientation(this.orientation),
  15673. this.on(d.OPENING, i.show.bind(i)),
  15674. this.on(d.CLOSED, i.hide.bind(i))
  15675. }
  15676. .bind(this)).catch(function(t) {
  15677. y.warn("Failed to embed:", e.src),
  15678. y.warn("with error:", t)
  15679. }).then(this.onMediaLoadFinished.bind(this))
  15680. }
  15681. .bind(this)),
  15682. n
  15683. }
  15684. ,
  15685. n.prototype.open = function(e) {
  15686. return this.openPromise = $.Deferred(),
  15687. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15688. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15689. this.state !== I.OPEN && (this.emit(d.OPENING),
  15690. e && this.emit(d.ACTIVATING),
  15691. this.state = I.OPENING,
  15692. this.animateOpen(function() {
  15693. e && this.setActiveState(),
  15694. this.openPromise.resolve()
  15695. }
  15696. .bind(this)))
  15697. }
  15698. .bind(this), m.animation.openDelay),
  15699. c.cancel(this.closeTransition),
  15700. this.closePromise && this.closePromise.reject(),
  15701. this.closeTransition = void 0,
  15702. this.openPromise.promise())
  15703. }
  15704. ,
  15705. n.prototype.close = function(e) {
  15706. return this.closePromise = $.Deferred(),
  15707. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15708. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15709. this.state = I.CLOSING,
  15710. this.animateClose())
  15711. }
  15712. .bind(this), m.animation.closeDelay)),
  15713. c.cancel(this.openTransition),
  15714. this.openPromise && this.openPromise.reject(),
  15715. this.openTransition = void 0,
  15716. this.closePromise.resolve(),
  15717. this.closePromise.promise())
  15718. }
  15719. ,
  15720. n.prototype.setActiveState = function() {
  15721. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15722. this.emit(d.ACTIVATE),
  15723. this.div.classList.remove("has-hotzone"))
  15724. }
  15725. ,
  15726. n.prototype.animateOpen = function(e) {
  15727. if (this.state === I.OPENING) {
  15728. if (c.cancel(this.animationTransition),
  15729. u.detectSamsungNative())
  15730. return this.boardOrientation = null,
  15731. this.div.style.visibility = "visible",
  15732. this.emit(d.OPENED),
  15733. this.state = I.OPEN,
  15734. void (e && e());
  15735. this.div.style.webkitTransform = "scale(0)",
  15736. this.div.style.transform = "scale(0)",
  15737. this.div.style.visibility = "visible",
  15738. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15739. this.emit(d.OPENED),
  15740. this.state = I.OPEN,
  15741. e && e()
  15742. }
  15743. .bind(this))
  15744. }
  15745. }
  15746. ,
  15747. n.prototype.animateClose = function(e) {
  15748. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15749. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15750. this.emit(d.CLOSED),
  15751. this.state = I.CLOSED,
  15752. this.div.style.visibility = "hidden",
  15753. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15754. e && e()
  15755. }
  15756. .bind(this)))
  15757. }
  15758. ,
  15759. n.prototype.needsUpdate = function() {
  15760. return this.state !== I.CLOSED
  15761. }
  15762. ,
  15763. n.prototype.update = function(e, t) {
  15764. if (this.needsUpdate()) {
  15765. var i = (this.updateOrientation(e),
  15766. this.calcScale(t))
  15767. , n = {
  15768. x: (e.x + 1) * $("#player").width() / 2,
  15769. y: (e.y + 1) * $("#player").height() / 2
  15770. };
  15771. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15772. this.div.style.webkitTransform = this.div.screenTransform,
  15773. this.div.style.transform = this.div.screenTransform
  15774. }
  15775. }
  15776. ,
  15777. n.prototype.getDimensions = function() {
  15778. return this.div.getBoundingClientRect()
  15779. }
  15780. ,
  15781. n.prototype.calcScale = function(e) {
  15782. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15783. }
  15784. ,
  15785. n.prototype.updateOrientation = function(e) {
  15786. if (this.state !== I.ACTIVE) {
  15787. var t = 1 / 3
  15788. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15789. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15790. , r = "";
  15791. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15792. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15793. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15794. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15795. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15796. }
  15797. }
  15798. ,
  15799. n.prototype.applyOrientation = function(e) {
  15800. this.div.style.transform = this.div.style.webkitTransform = "",
  15801. this.div.classList.remove("tag-container-" + this.orientation),
  15802. this.div.classList.add("tag-container-" + e);
  15803. var t = window.getComputedStyle(this.div);
  15804. this.initialTransform = t.transform || t.webkitTransform,
  15805. "none" === this.initialTransform && (this.initialTransform = "");
  15806. var i = t.transform.slice(7, -1).split(",")
  15807. , n = -i[4]
  15808. , r = -i[5];
  15809. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15810. this.div.style.transformOrigin = n + "px " + r + "px",
  15811. this.orientation = e
  15812. }
  15813. ,
  15814. t.exports = n
  15815. }
  15816. ).call(this, "/js/tag/Billboard/Billboard.js")
  15817. }
  15818. , {
  15819. "../../util/browser": 182,
  15820. "../../util/lerp": 188,
  15821. "../../util/logger": 189,
  15822. "../../util/transitions": 195,
  15823. "../Media/EmbedlyEmbed": 125,
  15824. "../Media/EmbedlyPlayer": 126,
  15825. "../Media/Image": 128,
  15826. "../Media/Link": 129,
  15827. "../Media/MediaEvent": 131,
  15828. "../Parser/DescriptionChunkType": 133,
  15829. "../Parser/DescriptionParser": 134,
  15830. "./BillboardEvent": 120,
  15831. "./billboardSettings": 121,
  15832. "./overlaySettings": 122,
  15833. events: 202
  15834. }],
  15835. 120: [function(e, t, i) {
  15836. "use strict";
  15837. t.exports = Object.freeze({
  15838. ENTER: "billboard.enter",
  15839. LEAVE: "billboard.leave",
  15840. OPENING: "billboard.opening",
  15841. OPENED: "billboard.open",
  15842. CLOSING: "billboard.closing",
  15843. CLOSED: "billboard.closed",
  15844. ACTIVATING: "billboard.activating",
  15845. ACTIVATE: "billboard.activate"
  15846. })
  15847. }
  15848. , {}],
  15849. 121: [function(e, t, i) {
  15850. "use strict";
  15851. t.exports = Object.freeze({
  15852. animation: Object.freeze({
  15853. hoverOnClosing: !1,
  15854. openDelay: 100,
  15855. closeDelay: 50,
  15856. openDuration: 200,
  15857. closeDuration: 100
  15858. }),
  15859. boardToDiscRatio: 1.2
  15860. })
  15861. }
  15862. , {}],
  15863. 122: [function(e, t, i) {
  15864. "use strict";
  15865. t.exports = Object.freeze({
  15866. boundaryWidth: 30,
  15867. boundaryHeight: 0
  15868. })
  15869. }
  15870. , {}],
  15871. /*********************************创建热点模型************************************************** */
  15872. "hot": [function(e, t, i) {//热点
  15873. "use strict";
  15874. function hot(sid,d,model){
  15875. this.sid = sid;
  15876. /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
  15877. if(d.quaternion){
  15878. this.quaternion = d.quaternion;
  15879. }else{
  15880. this.rotation = this.conversionArray(d.rotation)
  15881. } */
  15882. this.position = this.convertValue(d.position, r.Vector3)
  15883. if(d.quaternion){
  15884. this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
  15885. }else{
  15886. this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
  15887. }
  15888. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15889. this.isSprite = d.isSprite
  15890. this.actionType = (d.noAction ? 'noAction' : d.actionType) || "common"
  15891. this.linkType = d.linkType || "common"
  15892. this.link = d.link;
  15893. this.model = model;
  15894. this.size = d.size;
  15895. this.infoAttribute = d.infoAttribute || {};
  15896. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15897. this.transformAtPanos = d.transformAtPanos || {}
  15898. for (let i in this.transformAtPanos) {
  15899. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15900. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15901. }
  15902. this.build();
  15903. d.infoAttribute && d.infoAttribute.title && this.setTitleElem(d.infoAttribute.title)
  15904. this.changeTex()
  15905. this.visibleData = d.visiblePanos
  15906. //this.setVisiblePanos(d.visiblePanos);
  15907. }
  15908. var r = e("three")
  15909. , f = e("../shaders")
  15910. , a = e("../settings")
  15911. , s = e("../enum/Viewmode")
  15912. , p = e("../objects/Panorama")
  15913. , math = e("../util/math")
  15914. , te = e("../util/texture");
  15915. var raycaster = new r.Raycaster;
  15916. //热点大小
  15917. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15918. var defaultTex1 = te.load(g_HotImage.point);
  15919. var defaultTex2 = te.load(g_HotImage.point2);
  15920. hot.prototype.changeTex = function(){
  15921. var u = this.mesh.material.uniforms
  15922. if(this.styleImg.length){
  15923. u.texture1.value = te.load(this.styleImg[0].src);
  15924. u.texture2.value = te.load(this.styleImg[1]&&this.styleImg[1].src || this.styleImg[0].src);
  15925. }else{
  15926. u.texture1.value = defaultTex1;
  15927. u.texture2.value = defaultTex2;
  15928. }
  15929. }
  15930. hot.prototype.initStyleImg = function(t){
  15931. this.styleImg = []
  15932. t.styleImg = t.styleImg || [];
  15933. t.styleImg.forEach((src)=>{
  15934. this.styleImg.push({src:manage.dealURL(src)})
  15935. })
  15936. this.changeTex()
  15937. }
  15938. hot.prototype.update = function(camera) {
  15939. if(this.isSprite){
  15940. this.mesh.quaternion.copy(camera.quaternion)
  15941. }
  15942. //this.showTitle()
  15943. }
  15944. hot.prototype.setVisiblePanos = function(visibleData){
  15945. this.visiblePanos = [];
  15946. this.model.panos.list.forEach((pano)=>{// 模型遮挡的, 直接不可见
  15947. if(visibleData && !visibleData.includes(pano.id))return; //在热点可视中设置过,不可见
  15948. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15949. if(!isShelter){
  15950. this.visiblePanos.push(pano.id)
  15951. }
  15952. })
  15953. }
  15954. //绘制热点
  15955. hot.prototype.build = function(){
  15956. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15957. var shaderMaterial = new r.ShaderMaterial({
  15958. uniforms: t,
  15959. vertexShader: f.hot.vertexShader,
  15960. fragmentShader: f.hot.fragmentShader,
  15961. transparent: !0
  15962. })
  15963. var sprite = new r.Mesh( geometry, shaderMaterial );
  15964. var hotIconScale = parseFloat(this.infoAttribute.hotIconScale || window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15965. sprite.dynamic = true;
  15966. sprite.position.copy(this.position);
  15967. sprite.quaternion.copy(this.quaternion)
  15968. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15969. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15970. sprite.name = this.sid;
  15971. sprite.type = "hotSprite";
  15972. sprite.belongHot = this;
  15973. if(this.link) sprite.hotLink = this.link;
  15974. this.mesh = sprite;
  15975. this.model.add(sprite);
  15976. g_HotMeshes.push(sprite);
  15977. }
  15978. hot.prototype.setTitleElem = function(title){
  15979. var root = $("#hot");
  15980. var elem = $(`<div> ${title}</div>`)
  15981. root.append(elem);
  15982. this.titleElem = elem;
  15983. }
  15984. hot.prototype.showTitle = function(){
  15985. if(!this.titleElem)return;
  15986. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15987. if(pos.trueSide){//inSight
  15988. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15989. this.titleElem.css("display","block");
  15990. }else{
  15991. this.titleElem.css("display","none");
  15992. }
  15993. }
  15994. /* hot.prototype.showTitle = function(){//一直显示title的话
  15995. if(!this.titleElem)return;
  15996. var unvisi = ()=>{
  15997. this.titleElem.css("display","none");
  15998. }
  15999. var visi = ()=>{
  16000. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  16001. if(pos.trueSide){//inSight
  16002. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  16003. this.titleElem.css("display","block");
  16004. }else{
  16005. unvisi()
  16006. }
  16007. }
  16008. if(this.mesh.visible){
  16009. if(player.mode == 'panorama'){
  16010. visi()
  16011. }else{
  16012. var ifShelter = convertTool.ifShelter(this.position)
  16013. if(ifShelter)unvisi()
  16014. else visi()
  16015. }
  16016. }else{
  16017. unvisi()
  16018. }
  16019. }
  16020. */
  16021. hot.prototype.hideTitle = function(){
  16022. if(!this.titleElem)return;
  16023. this.titleElem.css("display","none");
  16024. }
  16025. hot.prototype.closestPanoTowardTag = function(e, t) {
  16026. var i = []
  16027. , o = []
  16028. , l = this.mesh.position;
  16029. if (e === s.PANORAMA) {
  16030. var c = .5
  16031. , h = t.position.clone().sub(l).normalize();
  16032. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  16033. // i.push(p.filters.isPanoAligned()),
  16034. // i.push(p.filters.inPanoDirection(l, h, c)),
  16035. // i.push(p.filters.isNeighbourPanoTo(t)),
  16036. o.push(p.scoreFunctions.direction(l, h))
  16037. }
  16038. var u = new r.Vector3
  16039. , d = function(e) {
  16040. u.copy(l).sub(e.position);
  16041. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16042. , i = a.tags.navigate.tiltTolerance;
  16043. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16044. }
  16045. , f = function(e) {
  16046. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16047. };
  16048. i.push(f, d, (pano)=>{ // add
  16049. return player.checkHasNeighbor(pano)
  16050. }),
  16051. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  16052. var g = t.model.panos.sortByScore(i, o);
  16053. if (g && a.tags.navigate.lineOfSight) {
  16054. for (var m = 0; m < g.length; m++) {
  16055. var v = g[m].pano
  16056. , A = v.position.distanceTo(l);
  16057. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16058. var y = raycaster.intersectObjects(t.model.colliders);
  16059. // return g[0].pano;
  16060. if (0 === y.length || y[0].distance > A) {
  16061. console.log(m);
  16062. return v
  16063. }
  16064. }
  16065. return null
  16066. }
  16067. return g && g.length > 0 && g[0].pano
  16068. }
  16069. var getLink = function(link){
  16070. var src = '';
  16071. var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
  16072. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
  16073. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  16074. return src
  16075. }
  16076. var musicOff = function(){
  16077. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16078. //g_bgAudio && g_bgAudio.pause();
  16079. if(g_bgAudio && !g_bgAudio.paused){
  16080. manage.switchBgmState(false);
  16081. g_bgAudio.pauseByHot = true
  16082. }
  16083. if(SoundOnVideo){
  16084. SoundOnVideo.pauseByHot = true
  16085. switchSoundBtn(SoundOnVideo)
  16086. }
  16087. if(g_tourAudio)g_tourAudio.pause()
  16088. }
  16089. hot.prototype.examine = function(e, options) {
  16090. try{
  16091. window.parent.postMessage("clickHot",'*')
  16092. //$("#app .aside li" , parent.document)[0].click();
  16093. }catch(e){
  16094. console.log(e)
  16095. }
  16096. options = options || {}
  16097. if(this.actionType == 'noAction' )return;
  16098. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  16099. var src = getLink(this.infoAttribute.iframe[0]);
  16100. if(this.linkType=="jumpLink"){
  16101. /* var newPage = window.open(src, "_blank" );
  16102. newPage.focus(); */
  16103. var href = window.location.href
  16104. var index = href.indexOf("&")
  16105. if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
  16106. history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
  16107. window.location.href = src
  16108. }else if(this.linkType=="iframeDiv"){
  16109. var div = document.createElement("div");
  16110. $("body").append(div);
  16111. div.style.position = 'fixed';
  16112. div.style.width = div.style.height = "100%";
  16113. div.style.left = div.style.top = '0';
  16114. div.style["z-index"] = "999"
  16115. exit = document.createElement("div");
  16116. exit.id ='myColne'
  16117. exit.style["background-image"] = "url(images/close1.png)";
  16118. exit.style.position = 'absolute';
  16119. exit.style.width = exit.style.height = "50px";
  16120. exit.style.right = '17px'; exit.style.top = "20px"
  16121. exit.style.cursor = "pointer";
  16122. exit.style["background-repeat"] = "no-repeat";
  16123. exit.style["background-size"] = "100%,100%";
  16124. exit.style["background-position"] = "center center";
  16125. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  16126. exit.style["border-radius"] = "50%";
  16127. exit.style["z-index"] = "3"
  16128. exit.onclick = ()=>{
  16129. $(div).remove()
  16130. if(g_bgAudio && g_bgAudio.pauseByHot){
  16131. manage.switchBgmState(true)
  16132. }
  16133. try{
  16134. window.parent.postMessage("closeHot",'*')
  16135. }catch(e){
  16136. console.log(e)
  16137. }
  16138. }
  16139. var myElement = document.createElement("iframe");
  16140. myElement.style.position = 'absolute';
  16141. myElement.style.width = myElement.style.height = "100%";
  16142. myElement.style.left = myElement.style.top = '0';
  16143. myElement.src = src
  16144. div.appendChild(exit);
  16145. div.appendChild(myElement)
  16146. musicOff()
  16147. /* //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16148. //g_bgAudio && g_bgAudio.pause();
  16149. if(g_bgAudio && !g_bgAudio.paused){
  16150. manage.switchBgmState(false);
  16151. g_bgAudio.pauseByHot = true
  16152. }
  16153. if(g_tourAudio)g_tourAudio.pause()
  16154. */
  16155. }
  16156. return;
  16157. }
  16158. if(settings.dontExamHot || this.actionType == 'dontExam'){
  16159. o();
  16160. return;
  16161. }
  16162. if(!player.currentPano)return;
  16163. var hotPop = document.getElementById('popup');
  16164. //获取那个热点的链接
  16165. if(this.link){
  16166. g_currentHot = this;
  16167. hotPop.style.display = "block";
  16168. hotPop.classList.add("wait");
  16169. var myElement = document.createElement("iframe");
  16170. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16171. //g_bgAudio && g_bgAudio.pause();
  16172. /* if(g_bgAudio && !g_bgAudio.paused){
  16173. manage.switchBgmState(false);
  16174. g_bgAudio.pauseByHot = true
  16175. }
  16176. if(g_tourAudio)g_tourAudio.pause()*/
  16177. musicOff()
  16178. var src = getLink(this.link )
  16179. myElement.src = src;
  16180. myElement.id = "id1";
  16181. myElement.allowTransparency = "true";
  16182. // myElement.scrolling = "no";
  16183. var element=document.getElementById("id1"); //判断页面是否有iframe
  16184. if (typeof(element)== "undefined" || element == null){
  16185. document.querySelector(".popup-content").appendChild(myElement);
  16186. //移动端自动播放
  16187. var videoLoaddingResult = false
  16188. window.loaddingSuccess = function() {
  16189. videoLoaddingResult = true
  16190. }
  16191. setTimeout(function func() {
  16192. if (videoLoaddingResult) {
  16193. var $iframe = document.querySelector('#id1').contentWindow.document;
  16194. if($iframe.querySelector('video')){
  16195. $iframe.querySelector('video').play();
  16196. // alert($iframe.querySelector('video'));
  16197. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  16198. $iframe.querySelector('.playPause').classList.add("fa-pause");
  16199. }
  16200. }
  16201. if($iframe.querySelector('audio')){
  16202. $iframe.querySelector('audio').play();
  16203. }
  16204. } else {
  16205. setTimeout(func, 300)
  16206. }
  16207. }, 800);
  16208. }
  16209. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  16210. }
  16211. // if(hotListSta) {
  16212. // hotPop.classList.remove("wait");
  16213. // return;
  16214. // }
  16215. var t = e.mode
  16216. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16217. , n = this.mesh.position;
  16218. e.flyingToTag = true;
  16219. var o = function() {
  16220. e.flyingToTag = false;
  16221. if(this.link){
  16222. hotPop.classList.remove("wait");
  16223. }
  16224. }.bind(this);
  16225. if(settings.dontExamHot){
  16226. o();
  16227. return;
  16228. }
  16229. if (t === s.PANORAMA){
  16230. var l = {
  16231. pano: i,
  16232. lookAtPoint: n,
  16233. duration: null,
  16234. maxDistanceOverride: null,
  16235. skipWarpingCheck: !1
  16236. };
  16237. e.flyToPano(l, o)
  16238. }else {
  16239. var c = {
  16240. pano: i
  16241. };
  16242. if (n) {
  16243. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16244. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16245. }
  16246. c.callback = o,
  16247. c.duration = 1500,
  16248. c.mode = s.PANORAMA,
  16249. e.flyToNewMode(c)
  16250. }
  16251. },
  16252. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  16253. // if(window.MP_PREFETCHED_MODELDATA.special){
  16254. // specialScene.special().beforeImplement();
  16255. // }
  16256. //czj 判断是否是数组 如果不是将对象转换为数组
  16257. /* hot.prototype.conversionArray = function(obj){
  16258. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  16259. var arr = []
  16260. for (var i in obj) {
  16261. arr.push(obj[i]); //属性
  16262. }
  16263. return arr
  16264. } */
  16265. hot.prototype.convertValue = function(v ,Type){
  16266. var value;
  16267. if(v instanceof Array){
  16268. v.forEach((v1)=>{v1 = parseFloat(v1)})
  16269. value = new Type().fromArray(v);
  16270. }else{
  16271. for(let i in v){v[i] = parseFloat(v[i])}
  16272. value = new Type().copy(v);
  16273. }
  16274. return value
  16275. }
  16276. t.exports = hot;
  16277. }
  16278. , {
  16279. three: 217,
  16280. "../shaders":167,
  16281. "../enum/Viewmode":51,
  16282. "../objects/Panorama":148,
  16283. "../util/texture":194,
  16284. "../settings":166,
  16285. "../util/math": 190,
  16286. }],
  16287. /************************************创建热点模型************************************ */
  16288. 123: [function(e, t, i) {//tag
  16289. (function(i) {
  16290. "use strict";
  16291. function n(e, t, i) {
  16292. var n = i.version || "0";
  16293. "0" !== n && I.info("tag defined using version " + n),
  16294. this.model = e,
  16295. this.sid = t,
  16296. this.color = (new r.Color).set(i.color || l.tagDefault),
  16297. this.hoverColor = l._darken(this.color, .2),
  16298. this.floor = null,
  16299. this.floorIndex = i.floor,
  16300. this.mode = s.PANORAMA,
  16301. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  16302. this.obj3d = null,
  16303. this.disc = null,
  16304. this.materials = {
  16305. disc: null,
  16306. pole: null
  16307. },
  16308. this.position = (new r.Vector3).copy(i.position),
  16309. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  16310. this.discWorldPosition = null,
  16311. this.discScale = .05,
  16312. this.poleEnabled = i.stem.enabled,
  16313. this.billboard = new o(i.label,i.description,i.media,this),
  16314. this.visibleTransition = null,
  16315. this.hoveringDisc = !1
  16316. }
  16317. var r = e("three")
  16318. , o = e("./Billboard/Billboard")
  16319. , a = e("../settings")
  16320. , s = e("../enum/Viewmode")
  16321. , l = e("../enum/Colors")
  16322. , c = e("../enum/RenderLayers")
  16323. , h = e("../enum/RenderOrder")
  16324. , u = (e("../util/common"),
  16325. e("../util/math"))
  16326. , d = e("../util/texture")
  16327. , p = e("../objects/Panorama")
  16328. , f = e("../shaders")
  16329. , g = e("../util/transitions")
  16330. , m = e("../util/lerp")
  16331. , v = e("../util/easing")
  16332. , A = e("./Billboard/BillboardEvent")
  16333. , y = e("events").EventEmitter
  16334. , C = e("../util/logger")
  16335. , I = new C(i)
  16336. , E = d.loadBase64("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==")
  16337. , b = d.loadBase64("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")
  16338. , w = new r.PlaneBufferGeometry(1,1);
  16339. n.prototype = Object.create(y.prototype),
  16340. n.raycaster = new r.Raycaster,
  16341. n.prototype.bindEvents = function() {
  16342. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  16343. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  16344. }
  16345. ,
  16346. n.prototype.build = function() {
  16347. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  16348. this.floor && (this.billboard.build(this.model.sid),
  16349. this.obj3d = this.buildObject3D(),
  16350. this.floor.add(this.obj3d)),
  16351. this
  16352. }
  16353. ,
  16354. n.prototype.buildObject3D = function() {
  16355. var e = new r.Object3D;
  16356. e.position.copy(this.position);
  16357. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  16358. t.bg.value = b,
  16359. t.mask.value = E,
  16360. t.color.value.copy(this.color),
  16361. this.materials.disc = new r.RawShaderMaterial({
  16362. transparent: !0,
  16363. vertexShader: f.tagDisc.vertexShader,
  16364. fragmentShader: f.tagDisc.fragmentShader,
  16365. uniforms: t
  16366. }),
  16367. this.disc = new r.Mesh(w,this.materials.disc),
  16368. this.disc.layers.set(c.TAG),
  16369. this.disc.position.copy(this.discPosition),
  16370. this.disc.renderOrder = h.tagDisc,
  16371. this.disc.tag = this;
  16372. var i = this.buildPole();
  16373. return i.layers.set(c.TAG),
  16374. i.renderOrder = h.tagStem,
  16375. e.add(i),
  16376. e.layers.set(c.TAG),
  16377. e.add(this.disc)
  16378. }
  16379. ,
  16380. n.prototype.buildPole = function() {
  16381. var e = new r.BufferGeometry
  16382. , t = new Float32Array(6);
  16383. return t[0] = t[1] = t[2] = 0,
  16384. t[3] = this.discPosition.x,
  16385. t[4] = this.discPosition.y,
  16386. t[5] = this.discPosition.z,
  16387. e.addAttribute("position", new r.BufferAttribute(t,3)),
  16388. this.materials.pole = new r.LineBasicMaterial({
  16389. linewidth: a.tags.pole.width,
  16390. color: a.tags.pole.color,
  16391. opacity: 0,
  16392. visible: this.poleEnabled,
  16393. transparent: !0,
  16394. depthWrite: !1
  16395. }),
  16396. new r.Line(e,this.materials.pole)
  16397. }
  16398. ,
  16399. n.prototype.setFreeState = function(e) {
  16400. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  16401. this.materials.disc.uniforms.color.value = this.color
  16402. }
  16403. .bind(this))
  16404. }
  16405. ,
  16406. n.prototype.setHoverState = function(e) {
  16407. this.billboard.open(e),
  16408. this.materials.disc.uniforms.color.value = this.hoverColor
  16409. }
  16410. ,
  16411. n.prototype.hide = function(e, t) {
  16412. var i = $.Deferred();
  16413. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  16414. return i.resolve().promise();
  16415. e = e || 0,
  16416. t = t || 0,
  16417. g.cancel(this.visibleTransition);
  16418. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  16419. , r = t + e
  16420. , o = t / r;
  16421. return this.visibleTransition = g.start(function(e) {
  16422. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  16423. , i = m.property(e.materials.pole, "opacity", 0);
  16424. return function(n) {
  16425. t(n),
  16426. e.materials.pole && i(n)
  16427. }
  16428. }(this), r * n, function() {
  16429. i.resolve()
  16430. }, o, v[a.warp.blendEasing]),
  16431. i.promise()
  16432. }
  16433. ,
  16434. n.prototype.show = function(e, t) {
  16435. var i = $.Deferred();
  16436. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  16437. return i.resolve().promise();
  16438. e = e || 0,
  16439. t = t || 0,
  16440. g.cancel(this.visibleTransition);
  16441. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  16442. , r = t + e
  16443. , o = t / r;
  16444. return this.visibleTransition = g.start(function(e) {
  16445. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  16446. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  16447. return function(n) {
  16448. t(n),
  16449. e.materials.pole && i(n)
  16450. }
  16451. }(this), r * n, function() {
  16452. i.resolve()
  16453. }, o, v[a.warp.blendEasing]),
  16454. i.promise()
  16455. }
  16456. ,
  16457. n.prototype.closestPanoTowardTag = function(e, t) {
  16458. var i = []
  16459. , o = []
  16460. , l = this.disc.getWorldPosition();
  16461. if (e === s.PANORAMA) {
  16462. var c = .5
  16463. , h = t.position.clone().sub(l).normalize();
  16464. i.push(p.filters.isPanoAligned()),
  16465. i.push(p.filters.inPanoDirection(l, h, c)),
  16466. i.push(p.filters.isNeighbourPanoTo(t)),
  16467. o.push(p.scoreFunctions.direction(l, h))
  16468. }
  16469. var u = new r.Vector3
  16470. , d = function(e) {
  16471. u.copy(l).sub(e.position);
  16472. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16473. , i = a.tags.navigate.tiltTolerance;
  16474. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16475. }
  16476. , f = function(e) {
  16477. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16478. };
  16479. i.push(f, d),
  16480. o.push(p.scoreFunctions.distanceSquared(this, -2));
  16481. var g = this.model.panos.sortByScore(i, o);
  16482. if (a.tags.navigate.lineOfSight) {
  16483. for (var m = 0; m < g.length; m++) {
  16484. var v = g[m].pano
  16485. , A = v.position.distanceTo(l);
  16486. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  16487. return null;
  16488. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16489. var y = n.raycaster.intersectObjects(this.model.colliders);
  16490. if (0 === y.length || y[0].distance > A)
  16491. return v
  16492. }
  16493. return null
  16494. }
  16495. return g.length > 0 && g[0].pano
  16496. }
  16497. ,
  16498. n.prototype.examine = function(e) {
  16499. var t = e.mode
  16500. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16501. , n = this.disc.getWorldPosition();
  16502. this.billboard.setActiveState();
  16503. var o = function() {
  16504. var t = this.billboard.getDimensions()
  16505. , n = new r.Vector3;
  16506. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  16507. n.unproject(e.camera),
  16508. e.flyToPano({
  16509. pano: i,
  16510. lookAtPoint: n
  16511. })
  16512. }
  16513. .bind(this);
  16514. if (t === s.PANORAMA)
  16515. if (i !== e.currentPano) {
  16516. var l = {
  16517. pano: i,
  16518. lookAtPoint: n,
  16519. duration: null,
  16520. maxDistanceOverride: null,
  16521. skipWarpingCheck: !1
  16522. };
  16523. e.flyToPano(l, o)
  16524. } else
  16525. setTimeout(function() {
  16526. this.billboard.open().then(function() {
  16527. o()
  16528. })
  16529. }
  16530. .bind(this), 0);
  16531. else {
  16532. var c = {
  16533. pano: i
  16534. };
  16535. if (n) {
  16536. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16537. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16538. }
  16539. c.callback = o,
  16540. c.duration = 1500,
  16541. c.mode = s.PANORAMA,
  16542. e.flyToNewMode(c)
  16543. }
  16544. }
  16545. ,
  16546. n.prototype.update = function(e, t) {
  16547. var i = new r.Vector3;
  16548. return function(e, t) {
  16549. this.discWorldPosition = this.disc.getWorldPosition(),
  16550. this.updateDisc(e, t),
  16551. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  16552. i.z < 1 && (i.y *= -1,
  16553. this.billboard.update(i, this.getDiscRadius(i, t))))
  16554. }
  16555. }(),
  16556. n.prototype.updateDisc = function(e, t) {
  16557. var i = new r.Vector3
  16558. , o = new r.Vector3
  16559. , l = new r.Vector3
  16560. , c = new r.Vector3
  16561. , h = new r.Vector3;
  16562. return function(e, t) {
  16563. var u = a.tags.visibility
  16564. , d = a.tags.disc.scale
  16565. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  16566. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  16567. this.obj3d.visible) {
  16568. this.disc.quaternion.copy(t.quaternion);
  16569. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  16570. i.copy(this.discWorldPosition).project(t),
  16571. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  16572. l.set(f / 2, 0, 0).add(o),
  16573. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  16574. h.copy(c).unproject(t);
  16575. var g = h.distanceTo(this.discWorldPosition)
  16576. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16577. this.discScale = g * m,
  16578. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16579. }
  16580. }
  16581. }(),
  16582. n.prototype.getDiscRadius = function(e, t) {
  16583. var i = new r.Vector3;
  16584. return function(e, t) {
  16585. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16586. Math.abs(e.x - i.x) * $("#player").width()
  16587. }
  16588. }(),
  16589. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16590. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16591. }
  16592. ,
  16593. n.prototype.offScreen = function(e, t) {
  16594. var i = e.getWorldPosition().project(t);
  16595. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16596. }
  16597. ,
  16598. n.viewportScale = function() {
  16599. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16600. n.viewportHeight = $("#player").height(),
  16601. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16602. n.currentViewportScale
  16603. }
  16604. ,
  16605. t.exports = n
  16606. }
  16607. ).call(this, "/js/tag/tag.js")
  16608. }
  16609. , {
  16610. "../enum/Colors": 19,
  16611. "../enum/RenderLayers": 41,
  16612. "../enum/RenderOrder": 42,
  16613. "../enum/Viewmode": 51,
  16614. "../objects/Panorama": 148,
  16615. "../settings": 166,
  16616. "../shaders": 167,
  16617. "../util/common": 185,
  16618. "../util/easing": 186,
  16619. "../util/lerp": 188,
  16620. "../util/logger": 189,
  16621. "../util/math": 190,
  16622. "../util/texture": 194,
  16623. "../util/transitions": 195,
  16624. "./Billboard/Billboard": 119,
  16625. "./Billboard/BillboardEvent": 120,
  16626. events: 202,
  16627. three: 217
  16628. }],
  16629. 124: [function(e, t, i) {
  16630. (function(i) {
  16631. "use strict";
  16632. function n() {
  16633. this.tagState = y.IDLE,
  16634. this.intersectTag = null,
  16635. this.hoveredTag = null,
  16636. this.activeTag = null,
  16637. this.tagDiscs = [],
  16638. this.raycaster = new r.Raycaster,
  16639. this.modelManager = null,
  16640. this.player = null,
  16641. this.totaltags = 0,
  16642. this.navigatingViaTag = !1,
  16643. this.enabled = !1
  16644. }
  16645. var r = e("three")
  16646. , o = e("../util/logger")
  16647. , a = e("../util/common")
  16648. , s = e("../controls/serializer")
  16649. , l = e("../objects/Snapshot")
  16650. , c = e("../settings")
  16651. , h = e("./Billboard/BillboardEvent")
  16652. , u = e("./Media/MediaEvent")
  16653. , d = e("./Media/LinkType")
  16654. , p = e("../enum/Viewmode")
  16655. , f = e("../enum/WarpStyle")
  16656. , g = e("../enum/BlackoutStyle")
  16657. , m = e("../enum/ModelManagerEvents")
  16658. , v = e("../enum/tagEvents")
  16659. , A = e("../enum/PlayerEvents")
  16660. , y = (e("../util/lerp"),
  16661. e("../enum/TagStates"))
  16662. , C = e("events").EventEmitter
  16663. , I = new o(i);
  16664. a.extend(n, C),
  16665. n.prototype.init = function(e, t) {
  16666. this.modelManager = e,
  16667. this.player = t,
  16668. this.updateModel(),
  16669. this.bindEvents()
  16670. }
  16671. ,
  16672. n.prototype.update = function(e) {
  16673. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16674. }
  16675. ,
  16676. n.prototype.updateTags = function(e, t, i, n) {
  16677. for (var r in this.model.tags)
  16678. this.model.tags[r].update(e, t, i, n)
  16679. }
  16680. ,
  16681. n.prototype.updateModel = function() {
  16682. this.model = this.modelManager.getActiveModel(),
  16683. this.gettagsFromModel(),
  16684. this.totaltags = Object.keys(this.model.tags).length
  16685. }
  16686. ,
  16687. n.prototype.gettagsFromModel = function() {
  16688. this.tagDiscs = [];
  16689. for (var e in this.model.tags) {
  16690. var t = this.model.tags[e].disc;
  16691. t && this.tagDiscs.push(t)
  16692. }
  16693. }
  16694. ,
  16695. n.prototype.bindEvents = function() {
  16696. function e() {
  16697. Object.keys(this.model.tags).forEach(function(e) {
  16698. var t = this.model.tags[e];
  16699. t.bindEvents(),
  16700. t.billboard.on(u.LINK_CLICK, function(e) {
  16701. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16702. }
  16703. .bind(this)),
  16704. t.billboard.on(u.IMAGE_OPENED, function() {
  16705. this.tagState = y.EXAMINE,
  16706. this.emit(u.IMAGE_OPENED)
  16707. }
  16708. .bind(this)),
  16709. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16710. }
  16711. .bind(this))
  16712. }
  16713. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16714. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16715. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16716. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16717. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16718. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16719. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16720. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16721. e.call(this)
  16722. }
  16723. ,
  16724. n.prototype.navigateViaLink = function(e) {
  16725. var t = s.deserialize(e);
  16726. if (t)
  16727. if (t.mode === p.PANORAMA) {
  16728. try {
  16729. this.player.model.panos.get(t.panoId)
  16730. } catch (e) {
  16731. return void I.warn("Unable to find panorama location", t.panoId)
  16732. }
  16733. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16734. } else {
  16735. var i = {
  16736. cameraMode: t.mode,
  16737. position: t.position,
  16738. quaternion: t.quaternion,
  16739. scanId: t.panoId,
  16740. orthoZoom: t.zoom,
  16741. floorVisibility: t.floorVisibility,
  16742. thumbUrl: null,
  16743. name: null
  16744. };
  16745. this.player.flyToNewMode({
  16746. mode: t.mode,
  16747. duration: c.warp.outsideTime,
  16748. warpDest: new l(i),
  16749. force: !0
  16750. })
  16751. }
  16752. }
  16753. ,
  16754. n.prototype.handleWarpStart = function(e, t, i, n) {
  16755. this.dismissExaminedTag(),
  16756. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16757. e && (i = g.END),
  16758. this.hideShowTagsForBlackoutStyle(i, n))
  16759. }
  16760. ,
  16761. n.prototype.handleWarpInterruption = function(e, t, i) {
  16762. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16763. this.hideShowTagsForBlackoutStyle(t, i)
  16764. }
  16765. ,
  16766. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16767. var i = 0
  16768. , n = 0
  16769. , r = t / 2;
  16770. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16771. e) {
  16772. case g.END:
  16773. this.hideAlltags(r);
  16774. break;
  16775. case g.BEGINNING:
  16776. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16777. break;
  16778. case g.NONE:
  16779. break;
  16780. case g.MIDDLE:
  16781. i = r,
  16782. n = r,
  16783. this.hideAlltags(n),
  16784. setTimeout(function() {
  16785. this.showAlltags(i)
  16786. }
  16787. .bind(this), n);
  16788. break;
  16789. case g.FADEIN:
  16790. setTimeout(function() {
  16791. this.showAlltags(r)
  16792. }
  16793. .bind(this), r)
  16794. }
  16795. }
  16796. ,
  16797. n.prototype.onPlayerModeChanging = function(e, t) {
  16798. t !== p.PANORAMA && this.dismissExaminedTag(),
  16799. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16800. var i = t !== p.OUTDOOR;
  16801. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16802. }
  16803. ,
  16804. n.prototype.onPanoChange = function(e, t) {
  16805. var i = this.navigatingViaTag;
  16806. if (this.navigatingViaTag = !1,
  16807. !i) {
  16808. this.dismissExaminedTag();
  16809. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16810. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16811. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16812. }
  16813. }
  16814. ,
  16815. n.prototype.onPlayerReady = function(e, t, i) {
  16816. this.startAlltags(e, t ? i : null)
  16817. }
  16818. ,
  16819. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16820. this.updateClosestTags(e)
  16821. }
  16822. ,
  16823. n.prototype.dismissExaminedTag = function() {
  16824. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16825. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16826. this.hoveredTag = null)
  16827. }
  16828. ,
  16829. n.prototype.startAlltags = function(e, t) {
  16830. this.model.shouldShowtags = c.tags.enabled,
  16831. this.enabled = !0,
  16832. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16833. t && setTimeout(function() {
  16834. this.activateTag(this.model.getTagBySid(t))
  16835. }
  16836. .bind(this), c.tags.startup.fadeInDuration / 2))
  16837. }
  16838. ,
  16839. n.prototype.showAlltags = function(e, t, i) {
  16840. function n() {
  16841. o++,
  16842. o === this.totaltags && (this.model.tagsShown = !0,
  16843. r.resolve())
  16844. }
  16845. var r = $.Deferred();
  16846. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16847. return r.resolve().promise();
  16848. var o = 0;
  16849. for (var a in this.model.tags) {
  16850. var s = this.model.tags[a];
  16851. s.show(e, t).done(n.bind(this))
  16852. }
  16853. return r.promise()
  16854. }
  16855. ,
  16856. n.prototype.hideAlltags = function(e, t) {
  16857. function i() {
  16858. r++,
  16859. r === this.totaltags && (this.model.tagsShown = !1,
  16860. n.resolve())
  16861. }
  16862. var n = $.Deferred()
  16863. , r = 0;
  16864. for (var o in this.model.tags) {
  16865. var a = this.model.tags[o];
  16866. a.hide(e, t).done(i.bind(this)),
  16867. a === this.activeTag && this.dismissActiveTag()
  16868. }
  16869. return n.promise()
  16870. }
  16871. ,
  16872. n.prototype.enableHovering = function() {
  16873. this.enabled = !0
  16874. }
  16875. ,
  16876. n.prototype.disableHovering = function() {
  16877. this.enabled = !1
  16878. }
  16879. ,
  16880. n.prototype.activateTag = function(e, t) {
  16881. t = t || y.EXAMINE,
  16882. this.activeTag = e,
  16883. this.activeTag.hoveringDisc = !0,
  16884. this.activeTag.setHoverState(t === y.EXAMINE),
  16885. this.tagState = t,
  16886. this.emit(v.TagActivated, e)
  16887. }
  16888. ,
  16889. n.prototype.dismissActiveTag = function() {
  16890. this.activeTag.hoveringDisc = !1,
  16891. this.activeTag.setFreeState(!0);
  16892. var e = this.activeTag;
  16893. this.activeTag = null,
  16894. this.tagState = y.IDLE,
  16895. this.emit(v.TagDismissed, e)
  16896. }
  16897. ,
  16898. n.prototype.clickedOnTag = function(e) {
  16899. var t = function() {
  16900. this.navigatingViaTag = !0,
  16901. this.activeTag.examine(this.player),
  16902. this.emit(v.TagNavigation, this.activeTag)
  16903. }
  16904. .bind(this);
  16905. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16906. this.activeTag = this.intersectTag,
  16907. t(),
  16908. !0) : (this.dismissActiveTag(),
  16909. !1)
  16910. }
  16911. ,
  16912. n.prototype.intersecttag = function() {
  16913. var e = new r.Vector3
  16914. , t = new r.Vector3
  16915. , i = new r.Vector3;
  16916. return function(n, r, o) {
  16917. if (!this.enabled)
  16918. return null;
  16919. var a = null
  16920. , s = this.tagDiscs.filter(function(e) {
  16921. return e.parent.visible
  16922. });
  16923. if (s.length > 0) {
  16924. var l = this.model.floors.reduce(function(e, t) {
  16925. return t.hidden ? e : e.concat(t.collider.children)
  16926. }, s);
  16927. e.set(n.x, n.y, -1).unproject(o),
  16928. t.set(n.x, n.y, 1).unproject(o),
  16929. i.copy(t).sub(e).normalize(),
  16930. this.raycaster.set(e, i);
  16931. var c = this.raycaster.intersectObjects(l);
  16932. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16933. }
  16934. return this.intersectTag = a,
  16935. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16936. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16937. this.hoveredTag = a
  16938. }
  16939. .bind(this)),
  16940. a.billboard.on(h.LEAVE, function() {
  16941. this.hoveredTag = null
  16942. }
  16943. .bind(this))),
  16944. this.activateTag(a, y.BROWSE))),
  16945. a
  16946. }
  16947. }(),
  16948. n.prototype.rankedtagInDirection = function() {
  16949. var e = []
  16950. , t = []
  16951. , i = new r.Vector3
  16952. , n = new r.Vector3
  16953. , o = new r.Vector3;
  16954. return function(r, a, s, l) {
  16955. var c = 0;
  16956. t.length = 0;
  16957. for (var h = 0; h < this.closesttags.length; h++) {
  16958. var u = this.closesttags[h];
  16959. n.copy(u.position),
  16960. n.add(u.discPosition),
  16961. i.copy(a),
  16962. i.sub(n).negate(),
  16963. i.normalize();
  16964. var d = i.dot(l);
  16965. if (d >= 0) {
  16966. o.copy(n),
  16967. o.project(s);
  16968. var p = this.intersecttag(o, !1, s);
  16969. if (p) {
  16970. if (c >= e.length)
  16971. for (var f = 0; f < 64; f++)
  16972. e.push({
  16973. tag: u,
  16974. dot: d
  16975. });
  16976. var g = e[c];
  16977. g.tag = u,
  16978. g.dot = d,
  16979. g.position = math.projectPositionToCanvas(n, s),
  16980. t.push(g),
  16981. c++
  16982. }
  16983. }
  16984. }
  16985. return t.sort(function(e, t) {
  16986. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16987. }),
  16988. r < t.length ? t[r].tag : null
  16989. }
  16990. }(),
  16991. n.prototype.updateClosestTags = function() {
  16992. var e = new r.Vector3
  16993. , t = 30;
  16994. return function(i) {
  16995. this.closesttags || (this.closesttags = []),
  16996. this.closesttags.length = 0;
  16997. var n = this.model.tags;
  16998. if (n)
  16999. for (var r in n)
  17000. if (n.hasOwnProperty(r)) {
  17001. var o = n[r]
  17002. , a = o.position;
  17003. e.copy(i),
  17004. e.sub(a).negate();
  17005. var s = e.lengthSq();
  17006. s < t && this.closesttags.push(o)
  17007. }
  17008. }
  17009. }(),
  17010. t.exports = n
  17011. }
  17012. ).call(this, "/js/tag/tagManager.js")
  17013. }
  17014. , {
  17015. "../controls/serializer": 14,
  17016. "../enum/BlackoutStyle": 18,
  17017. "../enum/tagEvents": 32,
  17018. "../enum/ModelManagerEvents": 33,
  17019. "../enum/PlayerEvents": 40,
  17020. "../enum/TagStates": 44,
  17021. "../enum/Viewmode": 51,
  17022. "../enum/WarpStyle": 52,
  17023. "../objects/Snapshot": 153,
  17024. "../settings": 166,
  17025. "../util/common": 185,
  17026. "../util/lerp": 188,
  17027. "../util/logger": 189,
  17028. "./Billboard/BillboardEvent": 120,
  17029. "./Media/LinkType": 130,
  17030. "./Media/MediaEvent": 131,
  17031. events: 202,
  17032. three: 217
  17033. }],
  17034. 125: [function(e, t, i) {
  17035. (function(i) {
  17036. "use strict";
  17037. function n() {
  17038. this.embedWrapper = null,
  17039. this.embedElement = null
  17040. }
  17041. var r = e("../../util/ajax")
  17042. , o = e("./mediaSettings")
  17043. , a = e("../../settings")
  17044. , s = e("../../util/logger")
  17045. , l = new s(i);
  17046. n.prototype.createDomElement = function() {
  17047. return this.embedWrapper = document.createElement("div"),
  17048. this.embedWrapper.classList.add("tag-embed"),
  17049. this.embedWrapper.classList.add("hidden"),
  17050. this.embedWrapper
  17051. }
  17052. ,
  17053. n.prototype.load = function(e) {
  17054. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  17055. return new Promise(function(e, i) {
  17056. r.get(t).then(function(t) {
  17057. if (t = JSON.parse(t),
  17058. t.html && t.html.indexOf("<script") === -1) {
  17059. this.embedWrapper.innerHTML = t.html;
  17060. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  17061. if (this.embedWrapper.style.width = n + "px",
  17062. t.height) {
  17063. var r = t.height / t.width;
  17064. this.embedWrapper.style.height = n * r + "px"
  17065. }
  17066. this.embedElement = this.embedWrapper.firstChild;
  17067. var a = [];
  17068. try {
  17069. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  17070. } catch (e) {
  17071. l.debug("Error getting `a` elements for embed; was it an iframe?")
  17072. }
  17073. a.forEach(function(e) {
  17074. e.setAttribute("target", "_blank")
  17075. }),
  17076. this.embedElement.classList.add("hidden"),
  17077. this.embedWrapper.classList.remove("hidden"),
  17078. e()
  17079. } else
  17080. i("Not a valid embed")
  17081. }
  17082. .bind(this), function(e) {
  17083. i(e.response)
  17084. })
  17085. }
  17086. .bind(this))
  17087. }
  17088. ,
  17089. n.prototype.show = function() {
  17090. this.embedElement && this.embedElement.classList.remove("hidden")
  17091. }
  17092. ,
  17093. n.prototype.hide = function() {
  17094. this.embedElement && this.embedElement.classList.add("hidden")
  17095. }
  17096. ,
  17097. t.exports = n
  17098. }
  17099. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  17100. }
  17101. , {
  17102. "../../settings": 166,
  17103. "../../util/ajax": 181,
  17104. "../../util/logger": 189,
  17105. "./mediaSettings": 132
  17106. }],
  17107. 126: [function(e, t, i) {
  17108. (function(i) {
  17109. "use strict";
  17110. function n(e) {
  17111. o.call(this),
  17112. this.options = e,
  17113. this.playerControls = null,
  17114. this.state = s.NOT_READY
  17115. }
  17116. var r = e("../../util/browser")
  17117. , o = e("./EmbedlyEmbed")
  17118. , a = e("../../util/logger")
  17119. , s = (new a(i),
  17120. Object.freeze({
  17121. NOT_READY: "player.not.ready",
  17122. CUED: "player.cued",
  17123. PLAYING: "player.playing",
  17124. PAUSED: "player.paused"
  17125. }));
  17126. n.prototype = Object.create(o.prototype),
  17127. n.prototype.createDomElement = function() {
  17128. return this.embedWrapper = document.createElement("div"),
  17129. this.embedWrapper.classList.add("tag-video"),
  17130. this.embedWrapper.classList.add("hidden"),
  17131. this.embedWrapper
  17132. }
  17133. ,
  17134. n.prototype.load = function(e) {
  17135. var t = function() {
  17136. function e(e) {
  17137. this.playerState = s.CUED,
  17138. this.options.startMuted && this.playerControls.mute()
  17139. }
  17140. function t(e) {
  17141. this.playerState = e
  17142. }
  17143. function i(e) {
  17144. this.playerControls.setCurrentTime(0),
  17145. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  17146. }
  17147. this.playerControls = new playerjs.Player(this.embedElement),
  17148. this.playerControls.on("ready", e.bind(this)),
  17149. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  17150. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  17151. this.playerControls.on("ended", i.bind(this))
  17152. }
  17153. .bind(this);
  17154. return o.prototype.load.call(this, e).then(t.bind(this))
  17155. }
  17156. ,
  17157. n.prototype.play = function() {
  17158. var e = r.isMobile();
  17159. return function() {
  17160. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  17161. }
  17162. }(),
  17163. n.prototype.pause = function() {
  17164. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  17165. }
  17166. ,
  17167. t.exports = n
  17168. }
  17169. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  17170. }
  17171. , {
  17172. "../../util/browser": 182,
  17173. "../../util/logger": 189,
  17174. "./EmbedlyEmbed": 125
  17175. }],
  17176. 127: [function(e, t, i) {
  17177. (function(i) {
  17178. "use strict";
  17179. function n(e) {
  17180. function t() {
  17181. return a.debug("requesting file from embedly:", e.href),
  17182. r.get(e.href, {
  17183. responseType: e.responseType
  17184. }).then(function(t) {
  17185. return a.debug("requesting file finished:", e.href),
  17186. t
  17187. })
  17188. }
  17189. function i() {}
  17190. return s = new Promise(function(e, n) {
  17191. s.catch(i).then(function() {
  17192. t().then(e, n)
  17193. })
  17194. }
  17195. )
  17196. }
  17197. var r = e("../../util/ajax")
  17198. , o = (e("./mediaSettings"),
  17199. e("../../util/logger"))
  17200. , a = new o(i)
  17201. , s = Promise.resolve();
  17202. t.exports.enqueue = n
  17203. }
  17204. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  17205. }
  17206. , {
  17207. "../../util/ajax": 181,
  17208. "../../util/logger": 189,
  17209. "./mediaSettings": 132
  17210. }],
  17211. 128: [function(e, t, i) {
  17212. (function(i) {
  17213. "use strict";
  17214. function n() {
  17215. this.imageWrapper = null,
  17216. this.width = 0,
  17217. this.height = 0,
  17218. this.aspect = 1
  17219. }
  17220. var r = e("./MediaEvent")
  17221. , o = e("./EmbedlyQueue")
  17222. , a = e("events").EventEmitter
  17223. , s = e("../../util/logger")
  17224. , l = e("../../settings");
  17225. new s(i);
  17226. n.prototype = Object.create(a.prototype),
  17227. n.prototype.createDomElement = function() {
  17228. return this.imageWrapper = document.createElement("div"),
  17229. this.imageWrapper.classList.add("tag-image"),
  17230. this.imageWrapper.classList.add("hidden"),
  17231. this.imageWrapper.addEventListener("click", function(e) {
  17232. e.stopPropagation(),
  17233. this.emit(r.IMAGE_OPENING),
  17234. this.imageWrapper.style.pointerEvents = "none"
  17235. }
  17236. .bind(this)),
  17237. this.imageWrapper
  17238. }
  17239. ,
  17240. n.prototype.onClosed = function() {
  17241. this.imageWrapper.style.pointerEvents = "auto"
  17242. }
  17243. ,
  17244. n.prototype.load = function(e) {
  17245. var t = Math.max(window.screen.height, window.screen.width)
  17246. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  17247. return new Promise(function(e, t) {
  17248. function n(t) {
  17249. var i = t.target;
  17250. this.width = i.naturalWidth,
  17251. this.height = i.naturalHeight,
  17252. this.aspect = this.width / this.height;
  17253. var n = t.target.src;
  17254. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  17255. this.imageWrapper.style.width = this.width + "px",
  17256. this.imageWrapper.style.height = this.height + "px",
  17257. this.imageWrapper.classList.remove("hidden"),
  17258. e()
  17259. }
  17260. o.enqueue({
  17261. href: i,
  17262. responseType: "arraybuffer"
  17263. }).then(function(e) {
  17264. var t = new Uint8Array(e)
  17265. , i = new Blob([t])
  17266. , r = new window.Image;
  17267. r.addEventListener("load", n.bind(this));
  17268. var o = URL.createObjectURL(i);
  17269. r.src = o
  17270. }
  17271. .bind(this), t)
  17272. }
  17273. .bind(this))
  17274. }
  17275. ,
  17276. t.exports = n
  17277. }
  17278. ).call(this, "/js/tag/Media/Image.js")
  17279. }
  17280. , {
  17281. "../../settings": 166,
  17282. "../../util/logger": 189,
  17283. "./EmbedlyQueue": 127,
  17284. "./MediaEvent": 131,
  17285. events: 202
  17286. }],
  17287. 129: [function(e, t, i) {
  17288. "use strict";
  17289. function n(e) {
  17290. this.label = e.label,
  17291. this.href = e.url,
  17292. this.type = this.updateLinkForType(),
  17293. this.domElement = null,
  17294. this.id = c++
  17295. }
  17296. var r = e("./LinkType")
  17297. , o = e("./MediaEvent")
  17298. , a = e("../../util/browser")
  17299. , s = e("../../analytics")
  17300. , l = e("events").EventEmitter
  17301. , c = 0;
  17302. n.prototype = Object.create(l.prototype),
  17303. n.prototype.updateLinkForType = function() {
  17304. function e(e) {
  17305. var t = new RegExp("[#&?]start=([^#&?]*)")
  17306. , i = t.exec(e);
  17307. return i[1]
  17308. }
  17309. function t(e) {
  17310. return e + "&play=1"
  17311. }
  17312. var i = a.valueFromHash("m") || a.valueFromHash("model");
  17313. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  17314. r.NAVIGATION) : (this.href = t(this.href),
  17315. r.MODEL) : r.EXT_LINK
  17316. }
  17317. ;
  17318. var h = {};
  17319. n.prototype.createDomElement = function() {
  17320. function e(e) {
  17321. switch (e.stopPropagation(),
  17322. h[this.id] = !0,
  17323. s.trackAlways("click_tag_link", {
  17324. link_type: this.type,
  17325. link_count: c,
  17326. links_clicked: Object.keys(h).length
  17327. }),
  17328. this.type) {
  17329. case r.MODEL:
  17330. window.location.replace(this.href);
  17331. break;
  17332. case r.EXT_LINK:
  17333. window.open(this.href, "_blank")
  17334. }
  17335. this.emit(o.LINK_CLICK, {
  17336. type: this.type,
  17337. url: this.href
  17338. })
  17339. }
  17340. if (this.domElement = document.createElement("a"),
  17341. this.domElement.classList.add("tag-link"),
  17342. this.domElement.textContent = this.label,
  17343. this.type === r.EXT_LINK) {
  17344. this.domElement.textContent += " ";
  17345. var t = document.createElement("i");
  17346. t.classList.add("icon-ext-link"),
  17347. t.title = "Link to external web site",
  17348. this.domElement.appendChild(t)
  17349. }
  17350. return this.domElement.addEventListener("click", e.bind(this)),
  17351. this.domElement
  17352. }
  17353. ,
  17354. t.exports = n
  17355. }
  17356. , {
  17357. "../../analytics": 4,
  17358. "../../util/browser": 182,
  17359. "./LinkType": 130,
  17360. "./MediaEvent": 131,
  17361. events: 202
  17362. }],
  17363. 130: [function(e, t, i) {
  17364. "use strict";
  17365. t.exports = {
  17366. NAVIGATION: "navigation",
  17367. MODEL: "model",
  17368. EXT_LINK: "ext-link"
  17369. }
  17370. }
  17371. , {}],
  17372. 131: [function(e, t, i) {
  17373. "use strict";
  17374. t.exports = Object.freeze({
  17375. LINK_CLICK: "mtmedia.link",
  17376. IMAGE_LOADED: "mtmedia.image.loaded",
  17377. IMAGE_OPENING: "mtmedia.image.opening",
  17378. IMAGE_OPENED: "mtmedia.image.opened",
  17379. IMAGE_CLOSING: "mtmedia.image.closing",
  17380. IMAGE_CLOSED: "mtmedia.image.closed",
  17381. VIDEO_START: "mtmedia.video.start",
  17382. VIDEO_PAUSE: "mtmedia.video.pause",
  17383. VIDEO_ENDED: "mtmedia.video.end"
  17384. })
  17385. }
  17386. , {}],
  17387. 132: [function(e, t, i) {
  17388. "use strict";
  17389. t.exports = Object.freeze({
  17390. maxEmbedWidth: 350,
  17391. defaultAspectRatio: .75
  17392. })
  17393. }
  17394. , {}],
  17395. 133: [function(e, t, i) {
  17396. "use strict";
  17397. t.exports = Object.freeze({
  17398. TEXT: "text",
  17399. LINK: "link",
  17400. IMAGE: "photo",
  17401. VIDEO: "video",
  17402. RICH: "rich"
  17403. })
  17404. }
  17405. , {}],
  17406. 134: [function(e, t, i) {
  17407. "use strict";
  17408. function n(e) {
  17409. this.capabilities = {
  17410. links: {
  17411. enable: e.supportLinks,
  17412. keepLabels: e.keepLinkLabels
  17413. }
  17414. }
  17415. }
  17416. var r = e("./DescriptionChunkType");
  17417. n.prototype.parse = function(e, t) {
  17418. var i = []
  17419. , n = e.split("[").map(function(e, t) {
  17420. return 0 === t ? e : "[" + e
  17421. });
  17422. return n.forEach(function(e) {
  17423. var n = this.findMarkdown(e);
  17424. if (n) {
  17425. if (n.url.indexOf("javascript:") !== -1)
  17426. return;
  17427. this.addLinkChunk(i, n, t),
  17428. this.addTextChunk(i, e.slice(n.markdown.length))
  17429. } else
  17430. this.addTextChunk(i, e)
  17431. }
  17432. .bind(this)),
  17433. i
  17434. }
  17435. ,
  17436. n.prototype.findMarkdown = function(e) {
  17437. var t = /\[([^\]]*)\]\((.*)\)/
  17438. , i = e.match(t);
  17439. if (i) {
  17440. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  17441. 0 !== r); )
  17442. o++;
  17443. var a = n.length - o;
  17444. return {
  17445. markdown: i[0].substring(0, i[0].length - a),
  17446. label: i[1],
  17447. url: i[2].substring(0, o)
  17448. }
  17449. }
  17450. }
  17451. ,
  17452. n.prototype.addTextChunk = function(e, t) {
  17453. 0 !== t.length && e.push({
  17454. type: r.TEXT,
  17455. text: t
  17456. })
  17457. }
  17458. ,
  17459. n.prototype.addLinkChunk = function(e, t) {
  17460. if (!this.capabilities.links.enable)
  17461. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  17462. var i = {
  17463. label: t.label,
  17464. url: t.url
  17465. };
  17466. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  17467. e.push({
  17468. type: r.LINK,
  17469. link: i
  17470. })
  17471. }
  17472. ,
  17473. t.exports = n
  17474. }
  17475. , {
  17476. "./DescriptionChunkType": 133
  17477. }],
  17478. 135: [function(e, t, i) {
  17479. (function(i) {
  17480. "use strict";
  17481. var n = e("../util/logger")
  17482. , r = new n(i)
  17483. , o = {
  17484. parseIdsFromChunkName: function(e, t) {
  17485. t.floorId = o.parseFloor(e),
  17486. t.roomId = o.parseRoom(e)
  17487. },
  17488. parseFloor: function(e) {
  17489. var t = e.match(/_group([0-9]+)/);
  17490. if (!t)
  17491. return 0;
  17492. try {
  17493. return parseInt(t[1], 10)
  17494. } catch (e) {
  17495. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  17496. 0
  17497. }
  17498. },
  17499. parseRoom: function(e) {
  17500. var t = e.match(/_sub([0-9]+)/);
  17501. if (!t)
  17502. return -1;
  17503. try {
  17504. return parseInt(t[1], 10)
  17505. } catch (e) {
  17506. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  17507. 0
  17508. }
  17509. }
  17510. };
  17511. t.exports = o
  17512. }
  17513. ).call(this, "/js/model/Chunks.js")
  17514. }
  17515. , {
  17516. "../util/logger": 189
  17517. }],
  17518. 136: [function(e, t, i) {
  17519. (function(i) {
  17520. "use strict";
  17521. function n(e) {
  17522. s.call(this),
  17523. this.model = e,
  17524. this.exploded = !1
  17525. }
  17526. var r = e("../objects/Floor")
  17527. , o = (e("../settings"),
  17528. e("../util/logger"))
  17529. , a = e("../util/transitions")
  17530. , s = e("../util/IndexedCollection")
  17531. , l = e("../util/common")
  17532. , c = e("../util/easing");
  17533. new o(i);
  17534. l.inherit(n, s),
  17535. n.prototype.add = function(e) {
  17536. s.prototype.add.call(this, e),
  17537. this.model.add(e)
  17538. }
  17539. ,
  17540. n.prototype.getIndex = function(e) {
  17541. return e.floorIndex
  17542. }
  17543. ,
  17544. n.prototype.build = function() {
  17545. this.list.forEach(function(e) {
  17546. e.build()
  17547. })
  17548. }
  17549. ,
  17550. n.prototype.size = function() {
  17551. return this.length
  17552. }
  17553. ,
  17554. n.prototype.sort = function() {
  17555. s.prototype.sort.call(this, function(e, t) {
  17556. return e.floorIndex - t.floorIndex
  17557. })
  17558. }
  17559. ,
  17560. n.prototype.nextFloor = function(e, t) {
  17561. return this.index[e.floorIndex + t] || null
  17562. }
  17563. ,
  17564. n.prototype.getFloorAtPoint = function(e) {
  17565. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  17566. var r = this.list[n]
  17567. , o = r.distanceToPoint(e);
  17568. (!t || i > o) && (i = o,
  17569. t = r)
  17570. }
  17571. return t
  17572. }
  17573. ,
  17574. n.prototype.getOrMakeFloor = function(e) {
  17575. var t = this.index[e];
  17576. return t || (t = new r(this.model,e),
  17577. this.add(t)),
  17578. t
  17579. }
  17580. ,
  17581. n.prototype.hide = function() {
  17582. this.list.forEach(function(e) {
  17583. e.hide()
  17584. })
  17585. }
  17586. ,
  17587. n.prototype.show = function() {
  17588. this.list.forEach(function(e) {
  17589. e.show()
  17590. })
  17591. }
  17592. ,
  17593. n.prototype.names = function() {
  17594. return this.list.reduce(function(e, t) {
  17595. return e.concat(t.name)
  17596. }, [])
  17597. }
  17598. ,
  17599. n.prototype.toggleExplodeHorizontal = function() {
  17600. function e(e, t) {
  17601. r.copy(e.position),
  17602. e.position.x = i[e.floorIndex] * t,
  17603. e.position.y = 1 * e.floorIndex * t,
  17604. r.sub(e.position).multiplyScalar(-1),
  17605. e.panos.forEach(function(e) {
  17606. e.translate(r)
  17607. })
  17608. }
  17609. var t, i = [], n = 0;
  17610. this.list.forEach(function(e, r, o) {
  17611. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17612. n += t,
  17613. i[r] = n
  17614. }),
  17615. i = i.map(function(e) {
  17616. return e - n / 2
  17617. });
  17618. var r = this.list[0].position.clone();
  17619. this.exploded ? this.list.forEach(function(t) {
  17620. a.start(function(i) {
  17621. e(t, 1 - i)
  17622. }, 1500, null, 0, c.easeOutExpo)
  17623. }) : this.list.forEach(function(t) {
  17624. a.start(function(i) {
  17625. e(t, i)
  17626. }, 1500, null, 0, c.easeOutExpo)
  17627. }),
  17628. this.exploded = !this.exploded
  17629. }
  17630. ,
  17631. n.prototype.toggleExplodeVertical = function() {
  17632. function e(e, i) {
  17633. var n = n.copy(e.position);
  17634. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17635. n.sub(e.position).multiplyScalar(-1),
  17636. e.panos.forEach(function(e) {
  17637. e.translate(n)
  17638. })
  17639. }
  17640. var t = this.model.size;
  17641. this.list[0].position.clone();
  17642. this.exploded ? this.list.forEach(function(t) {
  17643. a.start(function(i) {
  17644. e(t, 1 - i)
  17645. }, 1500, null, 0, c.easeOutExpo)
  17646. }) : this.list.forEach(function(t) {
  17647. a.start(function(i) {
  17648. e(t, i)
  17649. }, 1500, null, 0, c.easeOutExpo)
  17650. }),
  17651. this.exploded = !this.exploded
  17652. }
  17653. ,
  17654. t.exports = n
  17655. }
  17656. ).call(this, "/js/model/FloorCollection.js")
  17657. }
  17658. , {
  17659. "../objects/Floor": 146,
  17660. "../settings": 166,
  17661. "../util/IndexedCollection": 175,
  17662. "../util/common": 185,
  17663. "../util/easing": 186,
  17664. "../util/logger": 189,
  17665. "../util/transitions": 195
  17666. }],
  17667. 137: [function(e, t, i) {
  17668. (function(i) {
  17669. "use strict";
  17670. function n() {
  17671. c.call(this)
  17672. }
  17673. var r = e("../settings")
  17674. , o = e("../util/logger")
  17675. , a = e("../enum/Viewmode")
  17676. , s = e("../objects/Snapshot")
  17677. , l = (e("../util/math"),
  17678. e("../util/common"))
  17679. , c = e("../util/IndexedCollection")
  17680. , h = new o(i);
  17681. l.inherit(n, c),
  17682. n.prototype.getImage = function(e) {
  17683. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17684. }
  17685. ,
  17686. n.prototype.filterByModesAndReel = function(e, t) {
  17687. for (var i = [], n = 0; n < t.length; n += 1) {
  17688. var r = t[n]
  17689. , o = this.index[r.sid];
  17690. o && i.push(o)
  17691. }
  17692. var s = e[a.DOLLHOUSE]
  17693. , l = e[a.FLOORPLAN];
  17694. i = i.filter(function(e) {
  17695. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17696. return !0;
  17697. var t;
  17698. try {
  17699. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17700. } catch (e) {
  17701. return h.debug(e.message),
  17702. !1
  17703. }
  17704. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17705. }),
  17706. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17707. this.list = i,
  17708. this.reIndex()
  17709. }
  17710. ,
  17711. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17712. if (0 === this.list.length)
  17713. return [];
  17714. var locations = [];
  17715. var deal = (info, container)=>{
  17716. var src = info.thumbnail_signed_src,
  17717. o = info.name || "";
  17718. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17719. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17720. let a = panos.get(info.metadata.scan_id);
  17721. if (a && !a.isAligned()) return
  17722. }
  17723. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17724. if (cameraMode === a.MESH) return
  17725. if(window.isLocal)src = manage.dealURL(src)
  17726. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17727. var l = {
  17728. cameraMode: cameraMode,
  17729. position: info.metadata.camera_position,
  17730. quaternion: info.metadata.camera_quaternion,
  17731. zoom: info.metadata.zoom,
  17732. panoId: info.metadata.scan_id,
  17733. orthoZoom: info.metadata.ortho_zoom,
  17734. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17735. thumbUrl: src,
  17736. name: n.filterImageName(o),
  17737. sid: info.sid
  17738. }
  17739. var item = new s(l);
  17740. item.momentTour = info.momentTour
  17741. container.push(item)
  17742. return item
  17743. }
  17744. }
  17745. this.list.forEach(image=>{
  17746. if(image.images){
  17747. var folder = $.extend({}, image )
  17748. folder.heroLocations = [];
  17749. image.images.list.forEach(child=>{
  17750. deal(child, folder.heroLocations);
  17751. })
  17752. folder.musicInfo = folder.musicInfo || {}
  17753. locations.push(folder)
  17754. delete folder.images;
  17755. delete folder.locations;
  17756. }else{
  17757. var item = deal(image, locations);
  17758. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17759. }
  17760. })
  17761. return locations
  17762. }
  17763. ,
  17764. n.prototype.getIndex = function(e) {
  17765. return e.sid
  17766. }
  17767. ,
  17768. n.filterImageName = function(e) {
  17769. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17770. }
  17771. ,
  17772. t.exports = n
  17773. }
  17774. ).call(this, "/js/model/ImageCollection.js")
  17775. }
  17776. , {
  17777. "../enum/Viewmode": 51,
  17778. "../objects/Snapshot": 153,
  17779. "../settings": 166,
  17780. "../util/IndexedCollection": 175,
  17781. "../util/common": 185,
  17782. "../util/logger": 189,
  17783. "../util/math": 190
  17784. }],
  17785. 138: [function(e, t, i) {
  17786. (function(i) {
  17787. "use strict";
  17788. function n() {
  17789. u.call(this)
  17790. }
  17791. var r = e("../label/Label")
  17792. , o = e("../settings")
  17793. , a = e("../util/logger")
  17794. , s = e("../util/math")
  17795. , l = e("../util/ajax")
  17796. , c = e("./RoomCollection")
  17797. , h = e("../util/common")
  17798. , u = e("../util/IndexedCollection");
  17799. new a(i);
  17800. h.inherit(n, u),
  17801. n.prototype.getIndex = function(e) {
  17802. return e.labelId
  17803. }
  17804. ,
  17805. n.prototype.associateWithRooms = function(e) {
  17806. this.forEach(function(t) {
  17807. e.forEach(function(e) {
  17808. e.roomId === t.roomId && (t.room = e)
  17809. })
  17810. })
  17811. }
  17812. ,
  17813. n.prototype.createFromLabelData = function(e) {
  17814. e.forEach(function(e) {
  17815. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17816. t = c.generateRoomId(e.floorId, t);
  17817. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17818. i.position = s.convertWorkshopVector(i.position),
  17819. this.add(i),
  17820. i.build()
  17821. }
  17822. .bind(this))
  17823. }
  17824. ,
  17825. n.prototype.load = function(e, t) {
  17826. return l.get(e, {
  17827. responseType: "json",
  17828. auth: t ? o.authorizationHeader : null
  17829. }).done(function(e) {
  17830. var t = [];
  17831. for (var i in e) {
  17832. var n = e[i];
  17833. t.push(n)
  17834. }
  17835. this.createFromLabelData(t)
  17836. }
  17837. .bind(this))
  17838. }
  17839. ,
  17840. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17841. var t = -1;
  17842. if (e) {
  17843. if(typeof e == 'number'){
  17844. t = parseInt(e)
  17845. }else{
  17846. var i = e.split("_");
  17847. t = parseInt(i[0])
  17848. }
  17849. }
  17850. return t
  17851. }
  17852. ,
  17853. t.exports = n
  17854. }
  17855. ).call(this, "/js/model/LabelCollection.js")
  17856. }
  17857. , {
  17858. "../label/Label": 90,
  17859. "../settings": 166,
  17860. "../util/IndexedCollection": 175,
  17861. "../util/ajax": 181,
  17862. "../util/common": 185,
  17863. "../util/logger": 189,
  17864. "../util/math": 190,
  17865. "./RoomCollection": 141
  17866. }],
  17867. 139: [function(e, t, i) {
  17868. (function(i) {
  17869. "use strict";
  17870. function n(e, t) {
  17871. o.Object3D.call(this)
  17872. this.sid = window.number;//t.sid,
  17873. this.data = t,
  17874. this.options = e,
  17875. this.urls = new s(e.urlFiles),
  17876. this.isPublic = void 0 !== t.is_public && t.is_public,
  17877. //创建heroLocations
  17878. this.images = new _(this),
  17879. this.images.extend(t.images),
  17880. this.images.forEach((info)=>{
  17881. if(info.locations){
  17882. info.images = new _(this);
  17883. info.images.extend(info.locations)
  17884. }
  17885. })
  17886. this.heroLocations = []
  17887. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17888. this.outdoorPanoLocations = [],
  17889. this.floors = new d(this),
  17890. this.floorsEnabled = void 0 === e.floors || e.floors,
  17891. this.changingFloor = !1,
  17892. this.chunks = [],
  17893. this.panos = new A,
  17894. this.colliders = [],
  17895. this.loadPanosPromise = null,
  17896. this.loadMeshTexturesPromise = null,
  17897. this.auxDataPromise = null,
  17898. this.meshTexturesLoaded = !1,
  17899. this.meshTextures = [],
  17900. this.tags = {},
  17901. this.tagsShown = !1,
  17902. this.shouldShowtags = !1,
  17903. this.has360Views = !1,
  17904. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17905. this.supportedModes = {},
  17906. this.supportedModes[c.PANORAMA] = !0,
  17907. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17908. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17909. this.supportedModes[c.TRANSITIONING] = !0,
  17910. this.supportsTiles = this.configureTiling(),
  17911. // this.supportsVR = t.is_vr,
  17912. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17913. this.mode = c.DOLLHOUSE,
  17914. this.size = null,
  17915. this.center = null,
  17916. this.boundingBox = new o.Box3,
  17917. this.currentFloor = null,
  17918. this.allFloorsVisible = !0,
  17919. this.projectedPano0 = null,
  17920. this.projectedPano1 = null,
  17921. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17922. this.addFloor(new u(this,t,e.trim()))
  17923. }
  17924. .bind(this)),
  17925. this.waitQueue = [],
  17926. this.on("load", function(e) {
  17927. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17928. return !e.isLoadedCallback()
  17929. }),
  17930. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17931. }
  17932. .bind(this)),
  17933. this.setupCustomProperties()
  17934. this.hots = {};
  17935. }
  17936. function r() {
  17937. try {
  17938. var e = document.createElement("canvas")
  17939. , t = e.getContext("webgl");
  17940. t || (t = e.getContext("experimental-webgl"));
  17941. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17942. return i
  17943. } catch (e) {
  17944. return 0
  17945. }
  17946. }
  17947. var o = e("three")
  17948. , a = e("../util/ajax")
  17949. , s = e("../util/ModelUrls")
  17950. , l = e("../objects/BoundingTextureSkybox")
  17951. , c = e("../enum/Viewmode")
  17952. , h = e("../enum/RenderOrder")
  17953. , u = (e("../enum/AlignmentType"),
  17954. e("../objects/Floor"))
  17955. , d = e("./FloorCollection")
  17956. , p = e("../objects/Chunk")
  17957. , f = (e("../objects/Room"),
  17958. e("../objects/Snapshot"),
  17959. e("../label/Label"),
  17960. e("../util/math"),
  17961. e("../settings"))
  17962. ,ss = e("../shaders")
  17963. , g = e("../util/logger")
  17964. , m = e("../tag/tag")
  17965. , v = (e("../tag/tagManager"),
  17966. e("../objects/Panorama"))
  17967. , A = e("../util/PanoramaCollection")
  17968. , y = e("../loaders/ModelLoader")
  17969. , C = e("../loaders/ModelTextureLoader")
  17970. , I = e("../loaders/SweepDataLoader")
  17971. , E = e("../util/transitions")
  17972. , b = e("../util/common")
  17973. , es = e("../util/easing")
  17974. ,lerp = e("../util/lerp")
  17975. ,tex = e("../util/texture")
  17976. , w = e("./../util/browser")
  17977. , _ = e("./ImageCollection")
  17978. , T = e("./RoomCollection")
  17979. , x = e("./LabelCollection")
  17980. , S = e("./Chunks")
  17981. , M = e("./../util/showcase")
  17982. , R = e("../exception/BasicException")
  17983. , P = (e("../constants")
  17984. ,e("events").EventEmitter)
  17985. ,Hot = e("hot")
  17986. , O = new g(i);
  17987. n.prototype = Object.create(o.Object3D.prototype),
  17988. b.extend(n, P),
  17989. n.prototype.setupCustomProperties = function() {
  17990. var e = f.modelAlpha;
  17991. Object.defineProperty(this, "alpha", {
  17992. get: function() {
  17993. return e
  17994. },
  17995. set: function(t) {
  17996. e = t,
  17997. this.chunks.forEach(function(t) {
  17998. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17999. })
  18000. }
  18001. })
  18002. }
  18003. ,
  18004. n.prototype.configureTiling = function() {
  18005. var e = r();
  18006. if (e < 2048)
  18007. return !1;
  18008. O.warn("Max cube texture size: " + e);
  18009. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  18010. var i = f.tiling.tilingFlagNames[t];
  18011. if ("1" === w.valueFromHash(i, null))
  18012. return !0;
  18013. if ("0" === w.valueFromHash(i, null))
  18014. return !1
  18015. }
  18016. //--------------------------------------------许钟文-------------------------------------------
  18017. //return true;
  18018. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  18019. //--------------------------------------------e n d -------------------------------------------
  18020. }
  18021. ,
  18022. n.prototype.toggleAlpha = function() {
  18023. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  18024. }
  18025. ,
  18026. n.prototype.load = function(e) {
  18027. var t = function() {
  18028. return $.when(this.loadPanos(), this.loadMesh())
  18029. }
  18030. , i = this.urls.init().then(t.bind(this));
  18031. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  18032. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  18033. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  18034. }
  18035. ,
  18036. n.prototype.loadMesh = function() {
  18037. function e(e) {
  18038. O.error(e),
  18039. n.reject("loading-failed")
  18040. }
  18041. function t(e, t) {
  18042. n.notify(e, t)
  18043. }
  18044. function i(e, t) {
  18045. if (0 === e.length) {
  18046. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  18047. r.supportedModes[c.DOLLHOUSE] = !1,
  18048. r.supportedModes[c.FLOORPLAN] = !1;
  18049. var i = new p({
  18050. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  18051. });
  18052. i.material.visible = !1,
  18053. i.rotateX(-Math.PI / 2),
  18054. i.geometry.computeBoundingBox(),
  18055. e = [i]
  18056. }
  18057. e.forEach(function(e) {
  18058. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  18059. r.addChunk(t, e)
  18060. }),
  18061. r.floors.sort(),
  18062. n.resolve(r)
  18063. }
  18064. var n = $.Deferred()
  18065. , r = this;
  18066. return y.load(r.data.job.uuid, r.urls, i, t, e),
  18067. n.promise()
  18068. }
  18069. ,
  18070. n.prototype.loadMeshTextures = function() {
  18071. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  18072. this.meshTexturesLoaded = !0
  18073. }
  18074. .bind(this)),
  18075. this.loadTexturesPromise)
  18076. }
  18077. ,
  18078. /* n.prototype.loadtags = function() {//xzw改
  18079. var e = $.Deferred();
  18080. if (!f.tags.enabled)
  18081. return e.resolve();
  18082. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  18083. t = "data/" + this.sid + "/tags.json"
  18084. return a.get(t, {
  18085. responseType: "json",
  18086. auth: this.isPublic ? null : f.authorizationHeader
  18087. }).done(function(t) {
  18088. var i = 0
  18089. , n = 0;
  18090. for (var r in t) {
  18091. var o = t[r];
  18092. o.enabled && (n++,
  18093. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  18094. i++))
  18095. }
  18096. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  18097. e.resolve()
  18098. }
  18099. .bind(this)).fail(function() {
  18100. O.warn("Getting tags failed, not displaying tags."),
  18101. e.resolve()
  18102. }),
  18103. e
  18104. } */
  18105. n.prototype.shineHots = function(){ //xzw
  18106. E.trigger({
  18107. func: function(e) {
  18108. var opa = e <= .5 ? 2 * e : -2 * e + 2
  18109. for(var i in this.hots){
  18110. this.hots[i].mesh.material.uniforms.opac.value = opa;
  18111. }
  18112. }.bind(this),
  18113. cycling: true,
  18114. duration: 3000,
  18115. //easing: "easeInOutQuad",
  18116. name: "hotShine"
  18117. })
  18118. },
  18119. n.prototype.createHotItem = function(data, hots) {
  18120. var docFragment = document.createDocumentFragment();
  18121. var keyAry = Object.keys(data);
  18122. for(var i = 0; i < keyAry.length; i++){
  18123. var li = document.createElement('li');
  18124. var span = document.createElement('span');
  18125. span.innerHTML = data[keyAry[i]].title || data[keyAry[i]].infoAttribute.title || '热点';
  18126. // console.log(span.innerHTML);
  18127. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  18128. li.appendChild(span);
  18129. docFragment.appendChild(li);
  18130. }
  18131. var ul = document.querySelector('#hotListContent ul');
  18132. ul.appendChild(docFragment);
  18133. console.log(docFragment);
  18134. }
  18135. n.prototype.loadOverlays = function(overlays){
  18136. var overlays = window.data2 && window.data2.overlays
  18137. overlays && overlays.forEach((info)=>{
  18138. //if(info.file.includes('20210312_112357584.mp4') /* || info.animateInfo */ )return;
  18139. new Overlay(info)
  18140. })
  18141. setTimeout(Overlay.load, 300)
  18142. }
  18143. n.prototype.loadhots = function() {//xzw
  18144. var e = $.Deferred();
  18145. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  18146. return a.get(t, {
  18147. responseType: "json",
  18148. auth: this.isPublic ? null : f.authorizationHeader
  18149. }).done(function(t) {
  18150. window.data2 = t;
  18151. if(!t){
  18152. console.error("data2 is null")
  18153. }else{
  18154. g_data2 = hotMatcher(t);
  18155. this.hotsCount = 0;
  18156. /* for(var i in t.hots){
  18157. this.hotsCount ++;
  18158. this.hots[i] = new Hot(i, t.hots[i], this);
  18159. t.hots[i].infoAttribute || (t.hots[i].infoAttribute = {})
  18160. this.hots[i].initStyleImg(t.hots[i].infoAttribute);
  18161. };
  18162. window.hotData = t.hots
  18163. t.hots && this.createHotItem(t.hots, this.hots); */
  18164. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  18165. window.hotData = {}
  18166. if(t.hots){
  18167. var sids = Object.keys(t.hots).sort((a,b)=>{return t.hots[a].order - t.hots[b].order});
  18168. sids.forEach((sid)=>{
  18169. this.hotsCount++,
  18170. this.hots[sid] = new Hot(sid,t.hots[sid] ,this);
  18171. t.hots[sid].infoAttribute || (t.hots[sid].infoAttribute = {})
  18172. this.hots[sid].initStyleImg(t.hots[sid].infoAttribute);
  18173. window.hotData[sid] = t.hots[sid];
  18174. })
  18175. }
  18176. this.createHotItem(window.hotData, this.hots);
  18177. g_index = w.valueFromHash("m");
  18178. /* if(t.tourAudio){
  18179. g_tourAudio = new Audio;
  18180. g_tourAudio.loop = false;
  18181. g_tourAudio.addEventListener('ended', function () {
  18182. var ev = document.createEvent("MouseEvent");
  18183. ev.initEvent("tourAudioEnded",true,true);
  18184. window.dispatchEvent(ev);
  18185. });
  18186. }; */
  18187. }
  18188. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  18189. /* var dataJsPromise = $.Deferred();
  18190. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  18191. a.get(dataJsUrl,{
  18192. responseType: "json",
  18193. auth: this.isPublic ? null : f.authorizationHeader
  18194. }).done(function(data) {
  18195. window.hotData = data;
  18196. this.createHotItem(data, this.hots);
  18197. for(let i in this.hots){//add
  18198. data[i] && this.hots[i].initStyleImg(data[i]);
  18199. }
  18200. dataJsPromise.resolve();
  18201. }.bind(this)).fail(function(){
  18202. console.log('Data.js is empty');
  18203. dataJsPromise.resolve();
  18204. }) */
  18205. e.resolve();
  18206. }.bind(this)).fail(function() {
  18207. console.log('没有热点');
  18208. e.resolve()
  18209. }),
  18210. e
  18211. }
  18212. ,
  18213. n.prototype.loadPanos = function() {
  18214. if (this.loadPanosPromise)
  18215. return this.loadPanosPromise;
  18216. var e = new I(this);
  18217. return this.loadPanosPromise = e.load().then(function(e) {
  18218. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  18219. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  18220. else console.log(e.uuid)
  18221. }
  18222. .bind(this))),
  18223. this.panos.extend(e.map(function(e) {
  18224. return new v(this,e.uuid,e,this.supportsTiles)
  18225. }
  18226. .bind(this))),
  18227. this.panos.forEach(function(e) {
  18228. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  18229. var i = this.panos.get(t);
  18230. i && this.panos.setNeighbour(e, i, !0)
  18231. }
  18232. .bind(this)),
  18233. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  18234. }
  18235. .bind(this)),
  18236. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  18237. this.supportedModes[c.PANORAMA] = !1),
  18238. $.when(this)
  18239. }
  18240. .bind(this)),
  18241. this.loadPanosPromise
  18242. }
  18243. ,
  18244. n.prototype.loadHighlightReel = function() {//xzw
  18245. var e = $.Deferred()
  18246. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  18247. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  18248. return a.get(t, {
  18249. responseType: "json",
  18250. auth: this.isPublic ? null : f.authorizationHeader
  18251. }).done(function(t) {
  18252. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  18253. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  18254. e.resolve()
  18255. }
  18256. .bind(this)).fail(function() {
  18257. O.warn("Getting highlight reel failed, no highlights available"),
  18258. e.resolve()
  18259. }),
  18260. e
  18261. }
  18262. ,
  18263. n.prototype.waitForLoad = function(e, t) {
  18264. t() || (this.waitQueue.push({
  18265. object: e,
  18266. isLoadedCallback: t
  18267. }),
  18268. 1 === this.waitQueue.length && this.emit("waiting"))
  18269. }
  18270. ,
  18271. n.prototype.hide = function() {
  18272. this.floors.hide()
  18273. }
  18274. ,
  18275. n.prototype.show = function() {
  18276. this.floors.show()
  18277. }
  18278. ,
  18279. n.prototype.floorNames = function() {
  18280. return this.floors.names()
  18281. }
  18282. ,
  18283. n.prototype.warpDestFloors = function(e, t) {
  18284. if (!e || this.floors.length !== e.length)
  18285. return void this.toggleAllFloors(!0);
  18286. var i = e.findIndex(function(e) {
  18287. return e
  18288. }
  18289. .bind(this));
  18290. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  18291. }
  18292. ,
  18293. n.prototype.setFloor = function(e, t, i) {
  18294. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  18295. this.allFloorsVisible = !1,
  18296. this._setFloor(e, t, i)
  18297. }
  18298. ,
  18299. n.prototype.toggleAllFloors = function(e) {
  18300. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  18301. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  18302. this._setFloor(this.currentFloor)
  18303. }
  18304. ,
  18305. n.prototype._setFloor = function(e, t, i) {
  18306. t = t || this.mode,
  18307. this.emit("floor.changed", e, t, this.currentFloor),
  18308. this.currentFloor = e;
  18309. var n;
  18310. if (t === c.PANORAMA) {
  18311. if (this.show(),
  18312. this.shouldShowtags && this.tagsShown)
  18313. for (n in this.tags)
  18314. this.tags[n].show(f.showFloorDuration)
  18315. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  18316. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  18317. }
  18318. .bind(this)),
  18319. this.shouldShowtags && this.tagsShown))
  18320. for (n in this.tags) {
  18321. var r = this.tags[n];
  18322. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  18323. }
  18324. var o = this
  18325. , a = e;
  18326. E.start(function() {}, f.showFloorDelay, function() {
  18327. o.floors.forEach(function(e) {
  18328. e.chunks.forEach(function(t) {
  18329. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  18330. })
  18331. })
  18332. }
  18333. .bind(this))
  18334. }
  18335. ,
  18336. n.prototype.toggleExplode = function() {
  18337. this.floors.toggleExplodeHorizontal()
  18338. }
  18339. ,
  18340. n.prototype.toggleExplodeUp = function() {
  18341. this.floors.toggleExplodeVertical()
  18342. }
  18343. ,
  18344. n.prototype.nextFloor = function(e) {
  18345. return this.floors.nextFloor(this.currentFloor, e)
  18346. }
  18347. ,
  18348. n.prototype.addFloor = function(e) {
  18349. this.floors.add(e)
  18350. }
  18351. ,
  18352. n.prototype.getFloorAtPoint = function(e) {
  18353. return this.floors.getFloorAtPoint(e)
  18354. }
  18355. ,
  18356. n.prototype.getTagBySid = function(e) {
  18357. return this.tags[e]
  18358. }
  18359. ,
  18360. n.prototype.addChunk = function(e, t) {
  18361. this.floors.getOrMakeFloor(e).addChunk(t),
  18362. this.chunks.push(t)
  18363. }
  18364. ,
  18365. n.prototype.setMode = function(e) {
  18366. if (!this.supportedModes[e])
  18367. throw new R("Mode not supported for this model: " + e);
  18368. this.mode = e;
  18369. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  18370. this.chunks.forEach(function(t) {
  18371. t.setMode(e)
  18372. })
  18373. }
  18374. ,
  18375. n.prototype.build = function() {
  18376. this.heroLocations = this.images.getHeroLocations(this.panos);
  18377. var e = function() {
  18378. return !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  18379. }
  18380. .bind(this)();
  18381. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  18382. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  18383. }
  18384. .bind(this)) || e,
  18385. null === this.heroImage && O.warn("No hero image defined."),
  18386. this.currentFloor = this.floors.last(),
  18387. this.floors.build(),
  18388. this.colliders = this.floors.reduce(function(e, t) {
  18389. return e.concat(t.collider.children)
  18390. }, []),
  18391. this.panos.forEach(function(e) {
  18392. e.build1(),
  18393. e.on("enter", function() {
  18394. e.floor !== this.currentFloor && this.setFloor(e.floor)
  18395. }
  18396. .bind(this))
  18397. }
  18398. .bind(this)),
  18399. this.panos.forEach(function(e) {
  18400. e.build2()
  18401. }),
  18402. this.floors.forEach(function(e) {
  18403. this.boundingBox.union(e.boundingBox)
  18404. }
  18405. .bind(this)),
  18406. this.size = this.boundingBox.size(),
  18407. this.center = this.boundingBox.center(),
  18408. this.floors.forEach(function(e) {
  18409. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  18410. }
  18411. .bind(this)),
  18412. this.panos.populate_path_graph(),
  18413. this.skybox = new l(this.boundingBox),
  18414. this.skybox.matrixWorldNeedsUpdate = !0,
  18415. this.add(this.skybox);
  18416. setTimeout(function(){
  18417. this.hotsCount && this.shineHots();
  18418. }.bind(this),1300);//xzw 热点开始闪烁
  18419. for (var t in this.tags)
  18420. this.tags[t].build();
  18421. //add-----
  18422. for(let i in this.hots){
  18423. this.hots[i].setVisiblePanos(this.hots[i].visibleData);
  18424. }
  18425. //---------
  18426. this.createFloorLogo()
  18427. return O.debug("Done building model"),
  18428. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  18429. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  18430. this.buildRooms(),
  18431. this.labels.associateWithRooms(this.rooms),
  18432. $.when(this)
  18433. }
  18434. ,
  18435. n.prototype.createFloorLogo = function(){
  18436. console.log('createFloorLogo')
  18437. if(this.floorLogos || !settings.floorlogoURL)return;
  18438. var url = settings.floorlogoURL
  18439. var map = tex.load(url);//可以追加done
  18440. this.floorLogos = [];
  18441. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  18442. var material = new o.MeshBasicMaterial({
  18443. opacity:0,
  18444. map:map,
  18445. side: o.DoubleSide,
  18446. transparent: !0,
  18447. depthWrite: !1,
  18448. depthTest:false//改 在chunk\skybox外也可看到
  18449. });
  18450. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  18451. //var s = (Store.metadata.floorLogoSize || 100)/100;
  18452. //logo.scale.set(s,s,s);
  18453. logo.position.set(0,-1.5,0);
  18454. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  18455. logo.renderOrder = 100;//cover the videoSkybox
  18456. //logo.layers.set(0)
  18457. this.add(logo);
  18458. this.floorLogos.push(logo);
  18459. }
  18460. this.floorLogos[1].visible = false;
  18461. }
  18462. n.prototype.adjustfloorLogoHeight = function(o){
  18463. var h = player.currentPano.floorPosition.y + 0.01;
  18464. this.floorLogos[1].position.setY(h);
  18465. this.floorLogos[0].position.setY(h);
  18466. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  18467. },
  18468. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  18469. if(!this.floorLogos) return;
  18470. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  18471. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  18472. if(!o.dur){//立刻
  18473. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  18474. this.floorLogos[o.index].material.opacity = o.opa;
  18475. }else{
  18476. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  18477. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  18478. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  18479. }
  18480. },
  18481. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  18482. var lastQ, lastP;
  18483. var equals = function(v1, v2, min){
  18484. return Math.abs(v1-v2) < min
  18485. }
  18486. var isSame = function(now, last, k){//如果和上次相同就不改变
  18487. if(!last)return false;
  18488. var R = k.sceneRenderer;
  18489. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  18490. //暂时:
  18491. var min = 0.0008
  18492. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  18493. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  18494. return same;
  18495. }
  18496. return function(Q, k){
  18497. if(!Q)return;
  18498. /* if(Config.ifFish && window.lowFPS){
  18499. this.fLCompute++;
  18500. if(R.AFPS < 38){
  18501. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  18502. else if(k.flying && k.fLCompute%2 !=1) return;
  18503. k.fLCompute %= 4;
  18504. }else if(R.AFPS < 45){
  18505. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  18506. else if(k.flying && k.fLCompute%2 !=1) return;
  18507. k.fLCompute %= 6;
  18508. }else{
  18509. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  18510. //else if(k.flying && k.fLCompute%2 !=1) return;
  18511. k.fLCompute %= 2;
  18512. }
  18513. } */
  18514. var sameQ, sameP, quaternion, visible;
  18515. for(var i=0;i<2;i++){
  18516. var logo = this.floorLogos[i];
  18517. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18518. visible = true;
  18519. }
  18520. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18521. var c = k.cameraControls.activeControl;
  18522. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18523. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18524. for(var i=0;i<2;i++){
  18525. var logo = this.floorLogos[i];
  18526. if(!sameQ){
  18527. if(!quaternion){
  18528. var a = new THREE.Vector3(0,0,-1);
  18529. a.applyQuaternion(Q);
  18530. a.setY(0);
  18531. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18532. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18533. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18534. quaternion.multiply(a);
  18535. }
  18536. logo.quaternion.copy(quaternion);
  18537. }
  18538. }
  18539. }
  18540. }()
  18541. n.prototype.loadLabels = function() {//xzw
  18542. this.labels = new x(this);
  18543. var e = $.Deferred();
  18544. //加载俯视图的标签 注释这个备注就会加载
  18545. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18546. //window.MP_PREFETCHED_MODELDATA.showingLabels ? this.showingLabels = true : '';
  18547. /* if (!this.showingLabels)
  18548. return e.resolve(); */
  18549. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18550. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18551. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18552. O.warn("Getting labels failed, not displaying labels."),
  18553. e.resolve()
  18554. }),
  18555. e
  18556. }
  18557. ,
  18558. n.prototype.buildRooms = function() {
  18559. this.rooms = new T(this),
  18560. this.rooms.createFromChunks(this.chunks),
  18561. this.rooms.calcRoomBoundaries()
  18562. }
  18563. ,
  18564. n.prototype.updateProjectedPanos = function() {
  18565. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18566. }
  18567. ,
  18568. n.prototype.setProjectedPanos = function(e, t, i) {
  18569. void 0 !== i && null !== i || (i = !0),
  18570. i = !!i,
  18571. this.projectedPano0 = e,
  18572. this.projectedPano1 = t,
  18573. this.skybox.material.setProjectedPanos(e, t, i),
  18574. this.chunks.forEach(function(n) {
  18575. n.materialInside.setProjectedPanos(e, t, i)
  18576. })
  18577. }
  18578. ,
  18579. n.prototype.setSide = function(e) {
  18580. this.floors.forEach(function(t) {
  18581. t.collider.material.side = e
  18582. })
  18583. }
  18584. ,
  18585. n.prototype.heroCount = function() {
  18586. return this.heroLocations ? this.heroLocations.length : 0
  18587. }
  18588. ,
  18589. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18590. if (e[0] < 0)
  18591. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18592. null;
  18593. if (this.heroCount() < 1)
  18594. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18595. null;
  18596. var t = this.heroLocations[e[0]];
  18597. if(t.heroLocations && e[1]!=void 0){
  18598. t = t.heroLocations[e[1]];
  18599. }
  18600. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18601. null) : t
  18602. }
  18603. ,
  18604. n.prototype.findPanoramicHero = function() {
  18605. for (var e in this.heroLocations)
  18606. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18607. return this.heroLocations[e];
  18608. return null
  18609. }
  18610. ,
  18611. n.prototype.listImagePanos = function() {
  18612. var e = []
  18613. , t = this;
  18614. return this.images.forEach(function(i) {
  18615. if (i.metadata && i.metadata.scan_id) {
  18616. var n = t.panos.get(i.metadata.scan_id);
  18617. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18618. }
  18619. }),
  18620. e
  18621. }
  18622. ,
  18623. n.prototype.fadePanoMarkers = function(e, t) {
  18624. this.panos.fadeMarkerOpacity(e, t)
  18625. }
  18626. ,
  18627. n.prototype.setSweepVisibility = function(e) {
  18628. this.panos.forEach(function(t) {
  18629. t.marker && (t.marker.visible = e)
  18630. })
  18631. }
  18632. ,
  18633. n.prototype.outsideAllowed = function() {
  18634. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18635. }
  18636. ,
  18637. t.exports = n
  18638. }
  18639. ).call(this, "/js/model/Model.js")
  18640. }
  18641. , {
  18642. "../constants": 8,
  18643. "../enum/AlignmentType": 17,
  18644. "../enum/RenderOrder": 42,
  18645. "../enum/Viewmode": 51,
  18646. "../exception/BasicException": 55,
  18647. "../label/Label": 90,
  18648. "../loaders/ModelLoader": 105,
  18649. "../loaders/ModelTextureLoader": 106,
  18650. "../loaders/SweepDataLoader": 107,
  18651. "../tag/tag": 123,
  18652. "../tag/tagManager": 124,
  18653. "../objects/BoundingTextureSkybox": 143,
  18654. "../objects/Chunk": 144,
  18655. "../objects/Floor": 146,
  18656. "../objects/Panorama": 148,
  18657. "../objects/Room": 150,
  18658. "../objects/Snapshot": 153,
  18659. "../settings": 166,
  18660. "../shaders": 167,
  18661. "../util/ModelUrls": 177,
  18662. "../util/PanoramaCollection": 178,
  18663. "../util/ajax": 181,
  18664. "../util/common": 185,
  18665. "../util/easing": 186,
  18666. "../util/lerp": 188,
  18667. "../util/logger": 189,
  18668. "../util/math": 190,
  18669. "../util/texture": 194,
  18670. "../util/transitions": 195,
  18671. "./../util/browser": 182,
  18672. "./../util/showcase": 193,
  18673. "./Chunks": 135,
  18674. "./FloorCollection": 136,
  18675. "./ImageCollection": 137,
  18676. "./LabelCollection": 138,
  18677. "./RoomCollection": 141,
  18678. events: 202,
  18679. three: 217,
  18680. "hot": "hot"
  18681. }],
  18682. 140: [function(e, t, i) {
  18683. "use strict";
  18684. function n() {
  18685. this.modelMap = {},
  18686. this.activeModel = null,
  18687. this.modelCount = 0,
  18688. this.tileDownloader = null,
  18689. this.panoRenderer = null
  18690. }
  18691. var r = (e("three"),
  18692. e("../util/common"))
  18693. , o = e("../exception/BasicException")
  18694. , a = e("../enum/ModelManagerEvents")
  18695. , s = e("../enum/PanoRendererEvents")
  18696. , l = e("events").EventEmitter;
  18697. n.prototype.init = function(e, t, i) {
  18698. this.tileDownloader = e,
  18699. this.panoRenderer = t,
  18700. this.qualityManager = i,
  18701. this.bindEvents()
  18702. }
  18703. ,
  18704. n.prototype.bindEvents = function() {
  18705. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18706. }
  18707. ,
  18708. n.prototype.onTileRendered = function(e, t, i, n) {}
  18709. ,
  18710. n.prototype.addModel = function(e) {
  18711. this.modelMap[e.sid] = e,
  18712. 0 === this.modelCount && this.activateModel(e.sid),
  18713. this.modelCount++,
  18714. this.emit(a.ModelAdded)
  18715. }
  18716. ,
  18717. n.prototype.getModel = function(e) {
  18718. return this.modelMap[e]
  18719. }
  18720. ,
  18721. n.prototype.activateModel = function(e) {
  18722. var t = this.modelMap[e];
  18723. if (!t)
  18724. throw new o("Tried to activate invalid model!");
  18725. var i = this.activeModel;
  18726. this.activeModel = t,
  18727. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18728. this.tileDownloader.setUrls(t.urls),
  18729. t.panos.forEach(function(e) {
  18730. e.attachToPanoRenderer(this.panoRenderer),
  18731. e.tileDownloader = this.tileDownloader,
  18732. e.qualityManager = this.qualityManager
  18733. }
  18734. .bind(this)),
  18735. this.emit(a.ActiveModelChanged, {
  18736. oldModel: i,
  18737. model: t
  18738. })
  18739. }
  18740. ,
  18741. n.prototype.getActiveModel = function() {
  18742. return this.activeModel
  18743. }
  18744. ,
  18745. r.extend(n, l),
  18746. t.exports = n
  18747. }
  18748. , {
  18749. "../enum/ModelManagerEvents": 33,
  18750. "../enum/PanoRendererEvents": 35,
  18751. "../exception/BasicException": 55,
  18752. "../util/common": 185,
  18753. events: 202,
  18754. three: 217
  18755. }],
  18756. 141: [function(e, t, i) {
  18757. (function(i) {
  18758. "use strict";
  18759. function n() {
  18760. s.call(this)
  18761. }
  18762. var r = e("../objects/Room")
  18763. , o = (e("../settings"),
  18764. e("../util/logger"))
  18765. , a = (e("../util/transitions"),
  18766. e("../util/easing"),
  18767. e("../util/common"))
  18768. , s = e("../util/IndexedCollection")
  18769. , l = e("./Chunks");
  18770. new o(i);
  18771. a.inherit(n, s),
  18772. n.prototype.getIndex = function(e) {
  18773. return e.roomId
  18774. }
  18775. ,
  18776. n.prototype.calcRoomBoundaries = function() {
  18777. this.forEach(function(e) {
  18778. e.calcBoundaries()
  18779. })
  18780. }
  18781. ,
  18782. n.prototype.createFromChunks = function(e) {
  18783. var t = {
  18784. floorId: -1,
  18785. roomId: -1
  18786. }
  18787. , i = {};
  18788. e.forEach(function(e) {
  18789. l.parseIdsFromChunkName(e.name, t);
  18790. var o = i[t.roomId];
  18791. if (!o) {
  18792. var a = n.generateRoomId(t.floorId, t.roomId);
  18793. o = new r(t.floorId,a),
  18794. this.add(o),
  18795. i[t.roomId] = o
  18796. }
  18797. o.addChunk(e)
  18798. }
  18799. .bind(this)),
  18800. this.calcRoomBoundaries()
  18801. }
  18802. ,
  18803. n.generateRoomId = function(e, t) {
  18804. return e + "_" + t
  18805. }
  18806. ,
  18807. t.exports = n
  18808. }
  18809. ).call(this, "/js/model/RoomCollection.js")
  18810. }
  18811. , {
  18812. "../objects/Room": 150,
  18813. "../settings": 166,
  18814. "../util/IndexedCollection": 175,
  18815. "../util/common": 185,
  18816. "../util/easing": 186,
  18817. "../util/logger": 189,
  18818. "../util/transitions": 195,
  18819. "./Chunks": 135
  18820. }],
  18821. 142: [function(e, t, i) {
  18822. "use strict";
  18823. function n(e, t, i) {
  18824. e = e.clone().expandByScalar(0.01);//改
  18825. var n = e.size()
  18826. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18827. o.boundingBox = e,
  18828. r.Mesh.call(this, o, t),
  18829. this.position.copy(e.center()),
  18830. this.frustumCulled = !1,
  18831. i && this.add(new r.WireframeHelper(this))
  18832. }
  18833. var r = e("three");
  18834. n.prototype = Object.create(r.Mesh.prototype),
  18835. n.prototype.constructor = n,
  18836. t.exports = n
  18837. }
  18838. , {
  18839. three: 217
  18840. }],
  18841. 143: [function(e, t, i) {
  18842. (function(i) {
  18843. "use strict";
  18844. function n(e) {
  18845. h.time("Computing a nice bounding cubemap");
  18846. var t = new a({
  18847. side: r.BackSide,
  18848. transparent: !0
  18849. });
  18850. t.uniforms.modelAlpha.value = 0,
  18851. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18852. this.renderOrder = l.boundingSkybox,
  18853. o.call(this, e, t),
  18854. h.timeEnd("Computing a nice bounding cubemap")
  18855. }
  18856. var r = e("three")
  18857. , o = (e("../enum/Viewmode"),
  18858. e("../shaders"),
  18859. e("./BoundingMesh"))
  18860. , a = e("../materials/ModelTextureMaterial")
  18861. , s = e("../settings")
  18862. , l = e("../enum/RenderOrder")
  18863. , c = e("../util/logger")
  18864. , h = new c(i);
  18865. n.prototype = Object.create(o.prototype),
  18866. n.prototype.constructor = n,
  18867. t.exports = n
  18868. }
  18869. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18870. }
  18871. , {
  18872. "../enum/RenderOrder": 42,
  18873. "../enum/Viewmode": 51,
  18874. "../materials/ModelTextureMaterial": 118,
  18875. "../settings": 166,
  18876. "../shaders": 167,
  18877. "../util/logger": 189,
  18878. "./BoundingMesh": 142,
  18879. three: 217
  18880. }],
  18881. 144: [function(e, t, i) {
  18882. "use strict";
  18883. function n(e) {
  18884. this.materialInside = new s({
  18885. side: r.DoubleSide
  18886. });
  18887. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18888. this.materialOutside = new r.RawShaderMaterial({
  18889. fragmentShader: o.modelOutside.fragmentShader,
  18890. vertexShader: o.modelOutside.vertexShader,
  18891. uniforms: t,
  18892. side: r.FrontSide,
  18893. name: "chunkOut"
  18894. }),
  18895. r.Mesh.call(this, e.geometry, this.materialInside),
  18896. this.name = e.name || "",
  18897. this.textureName = e.textureName,
  18898. this.meshUrl = e.meshUrl
  18899. }
  18900. var r = e("three")
  18901. , o = e("../shaders")
  18902. , a = e("../enum/Viewmode")
  18903. , s = e("../materials/ModelTextureMaterial");
  18904. n.prototype = Object.create(r.Mesh.prototype),
  18905. n.prototype.setTextureMap = function(e) {
  18906. this.materialInside.uniforms.map.value = e,
  18907. this.materialOutside.uniforms.map.value = e
  18908. }
  18909. ,
  18910. n.prototype.setMode = function(e) {
  18911. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18912. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18913. t.transparent = this.material.transparent,
  18914. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18915. this.material = t
  18916. }
  18917. ,
  18918. t.exports = n
  18919. }
  18920. , {
  18921. "../enum/Viewmode": 51,
  18922. "../materials/ModelTextureMaterial": 118,
  18923. "../shaders": 167,
  18924. three: 217
  18925. }],
  18926. 145: [function(e, t, i) {
  18927. "use strict";
  18928. function n(e) {
  18929. this.chunksize = e || 10,
  18930. this.chunks = {},
  18931. this.boundingBoxes = {},
  18932. this.children = [],
  18933. this.offset = new r.Vector3(0,.5,0),
  18934. this.material = new r.MeshBasicMaterial({
  18935. color: 16777215 * Math.random(),
  18936. side: r.DoubleSide
  18937. })
  18938. }
  18939. var r = e("three");
  18940. e("../enum/Viewmode");
  18941. n.prototype.add = function(e) {
  18942. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18943. m ? (t = m.position.array,
  18944. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18945. n = e.faces);
  18946. var v = new r.Vector3;
  18947. if (i)
  18948. for (o = 0,
  18949. a = i.length; o < a; o += 3) {
  18950. var A = 3 * i[o]
  18951. , y = 3 * i[o + 1]
  18952. , C = 3 * i[o + 2];
  18953. s = (t[A] + t[y] + t[C]) / 3,
  18954. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18955. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18956. h = Math.floor(s / this.chunksize),
  18957. u = Math.floor(l / this.chunksize),
  18958. d = Math.floor(c / this.chunksize),
  18959. p = h + "." + u + "." + d,
  18960. p in this.chunks ? (g = this.chunks[p],
  18961. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18962. f = this.boundingBoxes[p] = new r.Box3),
  18963. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  18964. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18965. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18966. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18967. }
  18968. else
  18969. for (o = 0,
  18970. a = t.length; o < a; o += 9)
  18971. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18972. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18973. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18974. h = Math.floor(s / this.chunksize),
  18975. u = Math.floor(l / this.chunksize),
  18976. d = Math.floor(c / this.chunksize),
  18977. p = h + "." + u + "." + d,
  18978. p in this.chunks ? (g = this.chunks[p],
  18979. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18980. f = this.boundingBoxes[p] = new r.Box3),
  18981. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  18982. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18983. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18984. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18985. }
  18986. ,
  18987. n.prototype.build = function() {
  18988. var e = new r.Object3D;
  18989. e.material = this.material;
  18990. for (var t in this.chunks) {
  18991. var i = this.chunks[t]
  18992. , n = new r.BufferGeometry;
  18993. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18994. n.boundingBox = this.boundingBoxes[t];
  18995. var o = new r.Mesh(n,this.material);
  18996. o.material.visible = !1,
  18997. e.add(o),
  18998. this.chunks[t] = []
  18999. }
  19000. return e
  19001. }
  19002. ,
  19003. t.exports = n
  19004. }
  19005. , {
  19006. "../enum/Viewmode": 51,
  19007. three: 217
  19008. }],
  19009. 146: [function(e, t, i) {
  19010. "use strict";
  19011. var r = e("three")
  19012. , o = e("../settings")
  19013. , a = e("../util/common")
  19014. , s = e("../util/lerp")
  19015. , l = e("./ChunkedCollider")
  19016. , c = e("../util/transitions")
  19017. , h = e("../util/easing")
  19018. , u = (e("../objects/Panorama"),
  19019. e("../enum/RenderOrder"))
  19020. , d = e("../localization/localize");
  19021. function n(e, t, i) {
  19022. r.Object3D.call(this),
  19023. this.model = e,
  19024. this.floorIndex = t,
  19025. this.lang = o.languageTag,
  19026. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  19027. this.panos = [],
  19028. this.chunks = [],
  19029. this.colliderBuilder = new l(3),
  19030. this.collider = null,
  19031. this.center = null,
  19032. this.boundingBox = new r.Box3,
  19033. this.size = null,
  19034. this.hidden = !1,
  19035. this.conservativeBoundingBox = new r.Box3,
  19036. this.debugColor = 16777215 * Math.random(),
  19037. this.transition = null
  19038. }
  19039. n.prototype = Object.create(r.Object3D.prototype),
  19040. n.prototype.enter = function(e) {
  19041. this.model.setFloor(this, e)
  19042. }
  19043. ,
  19044. n.prototype.hide = function(e) {
  19045. if (!this.hidden || this.transition) {
  19046. this.chunks.forEach(function(e) {
  19047. e.material.transparent = !0
  19048. }),
  19049. c.cancel(this.transition);
  19050. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  19051. , i = e ? 0 : o.hideFloorDelay / t;
  19052. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  19053. this.hidden = !0
  19054. }
  19055. .bind(this), i, h.easeInOutQuad)
  19056. }
  19057. }
  19058. ,
  19059. n.prototype.show = function(e) {
  19060. if (this.hidden || this.transition) {
  19061. this.hidden = !1,
  19062. c.cancel(this.transition);
  19063. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  19064. , i = e ? 0 : o.showFloorDelay / t;
  19065. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  19066. this.hidden || this.chunks.forEach(function(e) {
  19067. e.material.transparent = !1
  19068. })
  19069. }
  19070. .bind(this), i, h.easeInOutQuad)
  19071. }
  19072. }
  19073. ,
  19074. n.prototype.toggle = function(e, t) {
  19075. e = void 0 === e ? this.hidden : e,
  19076. e ? this.show(t) : this.hide(t)
  19077. }
  19078. ,
  19079. n.prototype.containsPoint = function(e) {
  19080. return this.collider.children.some(function(t) {
  19081. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  19082. t.geometry.boundingBox.containsPoint(e)
  19083. })
  19084. }
  19085. ,
  19086. n.prototype.distanceToPoint = function(e) {
  19087. var t = null
  19088. , i = 1 / 0;
  19089. return this.collider.children.forEach(function(n) {
  19090. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  19091. var r = n.geometry.boundingBox.distanceToPoint(e);
  19092. (!t || i > r) && (i = r,
  19093. t = n)
  19094. }),
  19095. i
  19096. }
  19097. ,
  19098. n.prototype.addChunk = function(e) {
  19099. e.renderOrder = u.ghostFloor,
  19100. this.add(e),
  19101. this.chunks.push(e),
  19102. this.boundingBox.union(e.geometry.boundingBox),
  19103. this.size = this.boundingBox.size(),
  19104. this.colliderBuilder.add(e.geometry)
  19105. }
  19106. ,
  19107. n.prototype.addPano = function(e) {
  19108. this.panos.push(e),
  19109. this.add(e.skyboxMesh),
  19110. e.marker && this.add(e.marker);
  19111. var t = new r.Vector3(1,1,1)
  19112. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  19113. this.boundingBox.union(i)
  19114. }
  19115. ,
  19116. n.prototype.build = function() {
  19117. this.collider = this.colliderBuilder.build(!0),
  19118. this.add(this.collider),
  19119. this.center = this.boundingBox.center(),
  19120. this.conservativeBoundingBox.copy(this.boundingBox),
  19121. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  19122. return e.geometry.boundingBox.min.y
  19123. }), 5),
  19124. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  19125. return e.geometry.boundingBox.max.y
  19126. }), 5),
  19127. this.colliderBuilder = null
  19128. }
  19129. ,
  19130. n.prototype.toShortString = function() {
  19131. return a.nth(this.floorIndex + 1)
  19132. }
  19133. ,
  19134. n.prototype.toString = function() {
  19135. return this.name
  19136. }
  19137. ,
  19138. t.exports = n
  19139. }
  19140. , {
  19141. "../enum/RenderOrder": 42,
  19142. "../localization/localize": 108,
  19143. "./strings-cn-CN": 109,
  19144. "../objects/Panorama": 148,
  19145. "../settings": 166,
  19146. "../util/common": 185,
  19147. "../util/easing": 186,
  19148. "../util/lerp": 188,
  19149. "../util/transitions": 195,
  19150. "./ChunkedCollider": 145,
  19151. three: 217
  19152. }],
  19153. 147: [function(e, t, i) {
  19154. "use strict";
  19155. function n(e) {
  19156. this.player = e,
  19157. this.obj3d = null,
  19158. this.UP = new r.Vector3(0,1,0)
  19159. }
  19160. var r = e("three")
  19161. , o = e("../settings");
  19162. n.prototype.prefs = {
  19163. linewidth: 3,
  19164. height: .07,
  19165. opacity: .45,
  19166. endScale: .05
  19167. },
  19168. n.prototype.discard = function() {
  19169. if (this.obj3d) {
  19170. var e = this.obj3d.parent;
  19171. e && e.remove(this.obj3d)
  19172. }
  19173. this.obj3d = null
  19174. }
  19175. ,
  19176. n.prototype.draw = function() {
  19177. if (this.discard(),
  19178. o.showNeighbors) {
  19179. var e = this.player.currentPano.floor;
  19180. this.obj3d = new r.Object3D;
  19181. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  19182. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  19183. i.y += this.prefs.height;
  19184. var n = .1525
  19185. , a = .127
  19186. , s = .0127
  19187. , l = .1
  19188. , c = .19
  19189. , h = .2032
  19190. , u = .2286
  19191. , d = .255
  19192. , p = new r.Matrix4;
  19193. for (var f in t)
  19194. if (t[f]) {
  19195. var g = this.player.model.panos.get(f)
  19196. , m = (g.position.clone().sub(this.player.model.position),
  19197. g.position.clone().sub(g.floorPosition))
  19198. , v = g.floorPosition.clone().sub(this.player.model.position);
  19199. v.y += this.prefs.height;
  19200. var A = new r.Geometry;
  19201. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  19202. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  19203. p.identity().setPosition(m),
  19204. A.applyMatrix(p),
  19205. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  19206. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  19207. p.lookAt(v, i, this.UP).setPosition(v),
  19208. A.applyMatrix(p),
  19209. A.vertices.push(v, i);
  19210. var y = new r.Line(A,new r.LineBasicMaterial({
  19211. color: g.debugColor.getHex(),
  19212. transparent: !0,
  19213. opacity: this.prefs.opacity,
  19214. depthWrite: !1,
  19215. name: "sLine" + f,
  19216. linewidth: this.prefs.linewidth
  19217. }));
  19218. this.obj3d.add(y)
  19219. }
  19220. e.add(this.obj3d)
  19221. }
  19222. }
  19223. ,
  19224. n.prototype.update = function() {
  19225. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  19226. }
  19227. ,
  19228. t.exports = n
  19229. }
  19230. , {
  19231. "../settings": 166,
  19232. three: 217
  19233. }],
  19234. 148: [function(e, t, i) {
  19235. (function(i) {
  19236. "use strict";
  19237. function n(e, t, i, n) {
  19238. this.model = e,
  19239. this.id = t,
  19240. this.alignmentType = i.alignmentType || l.ALIGNED,
  19241. this.neighbourUUIDs = i.neighbours || null,
  19242. this.neighbourPanos = null,
  19243. this.floor = null,
  19244. this.floorIndex = i.floor,
  19245. this.failedLoadingAt = 0,
  19246. this.maxLoadRetries = 4,
  19247. this.origin = i.position.clone(),
  19248. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  19249. this.quaternion = i.quaternion.clone(),
  19250. this.skyboxMesh = new r.Mesh(E),
  19251. this.skyboxMesh.position.copy(this.position),
  19252. this.skyboxMesh.quaternion.copy(this.quaternion),
  19253. this.skyboxMesh.name = "skybox",
  19254. this.skyboxMesh.visible = !1,
  19255. this.skyboxMesh.updateMatrix(),
  19256. this.skyboxMesh.updateMatrixWorld(),
  19257. this.marker = null,
  19258. this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker;
  19259. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  19260. map: w,
  19261. side: r.DoubleSide,
  19262. opacity: 0,
  19263. transparent: !0,
  19264. depthWrite: !1
  19265. })),
  19266. this.marker.visible = this.showFloorMarker,
  19267. this.marker.renderOrder = s.panoMarker,
  19268. this.marker.name = "marker",
  19269. this.marker.pano = this,
  19270. this.marker.layers.set(v.PANOMARKERS),
  19271. this.marker.updateMatrixWorld(),
  19272. a.colorMarkerOnLoad && this.on("load", function() {
  19273. this.marker.material.color.set(65280)
  19274. })),
  19275. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19276. this.floorPosition = i.puck ? i.puck.clone() : null,
  19277. this.tiled = n,
  19278. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19279. this.solidSkybox.flipY = !1,
  19280. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19281. this.solidSkybox.magFilter = r.LinearFilter,
  19282. this.solidSkybox.generateMipmaps = !1)),
  19283. this.zoomed = !1,
  19284. this.panoRenderer = null,
  19285. this.qualityManager = null,
  19286. this.tileDownloader = null,
  19287. this.tiledPanoRenderTarget = null,
  19288. this.minimumTiledPanoLoaded = !1,
  19289. this.highestPartialTileRenderOpCompleted = 0,
  19290. this.highestFullTileRenderOpCompleted = 0,
  19291. this.shouldRedrawOnBaseLoaded = !1,
  19292. this.lockUntilRenderingComplete = !1,
  19293. a.colorMarkerOnLoad && this.on("load", function() {
  19294. this.marker.material.color.set(65280)
  19295. });
  19296. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19297. var e = new r.TextureLoader;
  19298. e.setCrossOrigin(!0);
  19299. var g = e.load("images/texture.jpg");
  19300. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19301. color: 16777215,
  19302. transparent: !0,
  19303. opacity: .75,
  19304. map: g
  19305. })),
  19306. this.vrMarker.boluoType = "vr",
  19307. this.vrMarker.position.z = 1,
  19308. this.vrMarker.enabled = !0,
  19309. this.vrMarker.visible = !1,
  19310. window.vrMarkers = window.vrMarkers || [],
  19311. window.vrMarkers.push(this.vrMarker),
  19312. this.marker && this.marker.add(this.vrMarker),
  19313. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19314. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19315. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19316. this.adjustAngleEnable) {
  19317. var i = new r.Quaternion;
  19318. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19319. this.skyboxMesh.quaternion.multiply(i);
  19320. var m = new r.Quaternion;
  19321. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19322. this.skyboxMesh.quaternion.multiply(m);
  19323. var n = new r.Quaternion;
  19324. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19325. this.skyboxMesh.quaternion.multiply(n),
  19326. this.skyboxMesh.updateMatrix(),
  19327. this.skyboxMesh.updateMatrixWorld(),
  19328. this.model.updateProjectedPanos()
  19329. }
  19330. /**************************************************************************************************************************************/
  19331. }
  19332. var r = e("three")
  19333. , o = e("../util/logger")
  19334. , a = e("../settings")
  19335. , s = (e("../enum/Viewmode"),
  19336. e("../enum/RenderOrder"))
  19337. , l = e("../enum/AlignmentType")
  19338. , c = (e("../util/common"),
  19339. e("../util/transitions"))
  19340. , h = e("../util/lerp")
  19341. , u = e("../util/ajax")
  19342. , d = e("../util/texture")
  19343. , p = e("../util/panorama")
  19344. , f = (e("../enum/TileDownloaderEvents"),
  19345. e("../enum/PanoramaEvents"))
  19346. , g = e("../enum/PanoRendererEvents")
  19347. , m = e("../enum/PanoSizeClass")
  19348. , v = e("../enum/RenderLayers")
  19349. , A = (e("../scene/SceneRenderer"),
  19350. e("../enum/GLCubeFaces"),
  19351. e("../exception/BasicException"))
  19352. , y = e("../tile/TileUtils")
  19353. , C = e("events").EventEmitter
  19354. , I = new o(i)
  19355. , E = new r.SphereBufferGeometry(.1)
  19356. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  19357. , w = d.load("images/marker-256x256.png");
  19358. n.prototype = Object.create(C.prototype),
  19359. n.prototype.enter = function() {
  19360. var e = null;
  19361. return function() {
  19362. this.setZoomed(!1),
  19363. this.emit("enter", {
  19364. oldPano: e,
  19365. newPano: this
  19366. }),
  19367. e = this
  19368. playMusic(this)
  19369. }
  19370. }(),
  19371. n.prototype.exit = function() {
  19372. this.tiled ? (this.clearWaitDeferreds(),
  19373. this.minimumTiledPanoLoaded = !1,
  19374. this.tiledPanoRenderTarget = null,
  19375. this.setZoomed(!1),
  19376. this.panoRenderer.deactivateTiledPano(this),
  19377. this.highestPartialTileRenderOpCompleted = 0,
  19378. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19379. this.solidSkybox.loaded = !1,
  19380. this.solidSkybox.version = 0),
  19381. this.emit("exit")
  19382. }
  19383. ,
  19384. n.prototype.hoverOn = function(e) {
  19385. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19386. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19387. }
  19388. ,
  19389. n.prototype.hoverOff = function(e) {
  19390. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19391. }
  19392. ,
  19393. n.prototype.build1 = function() {
  19394. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  19395. this.floor.addPano(this),
  19396. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19397. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19398. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19399. }
  19400. ,
  19401. n.prototype.build2 = function() {
  19402. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19403. this.height = this.position.distanceTo(this.floorPosition),
  19404. this.placeMarker()
  19405. }
  19406. ,
  19407. n.prototype.interpolateFloorPosition = function() {
  19408. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19409. return !!e.floorPosition
  19410. }).sort(function(e, t) {
  19411. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19412. }
  19413. .bind(this))
  19414. , t = this.position.clone();
  19415. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19416. t
  19417. }
  19418. ,
  19419. n.prototype.raycastFloorPosition = function() {
  19420. I.warn("Performance warning: Raycasting to find floor position");
  19421. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19422. , t = e.intersectObjects(this.model.colliders);
  19423. return t.length ? t[0].point : null
  19424. }
  19425. ,
  19426. n.prototype.raycastToFindFloor = function() {
  19427. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  19428. return function() {
  19429. I.warn("Performance warning: Raycasting to find floor index");
  19430. for (var t = 0; t < e.length; t++) {
  19431. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19432. , n = i.intersectObjects(this.model.colliders);
  19433. if (n.length)
  19434. return n[0].object.parent.parent
  19435. }
  19436. return null
  19437. }
  19438. }(),
  19439. n.prototype.placeMarker = function() {
  19440. this.marker && (this.marker.position.copy(this.floorPosition),
  19441. this.marker.position.y += .05,
  19442. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19443. }
  19444. ,
  19445. n.prototype.translate = function(e) {
  19446. this.position.add(e),
  19447. this.floorPosition.add(e)
  19448. }
  19449. ,
  19450. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19451. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19452. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19453. }
  19454. ,
  19455. n.prototype.attachToPanoRenderer = function(e) {
  19456. this.panoRenderer = e,
  19457. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19458. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19459. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19460. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19461. }
  19462. ;
  19463. var _ = {};
  19464. n.prototype.getWaitDeferred = function(e) {
  19465. var t = _[this.id];
  19466. t || (t = {},
  19467. _[this.id] = t);
  19468. var i = t[e];
  19469. return i || (i = {
  19470. deferred: $.Deferred(),
  19471. active: !1
  19472. },
  19473. t[e] = i),
  19474. i
  19475. }
  19476. ,
  19477. n.prototype.resetWaitDeferred = function(e) {
  19478. var t = this.getWaitDeferred(e);
  19479. t.active = !1,
  19480. t.deferred = $.Deferred()
  19481. }
  19482. ,
  19483. n.prototype.clearWaitDeferreds = function() {
  19484. var e = _[this.id];
  19485. e || (e = {},
  19486. _[this.id] = e);
  19487. for (var t in e)
  19488. if (e.hasOwnProperty(t)) {
  19489. var i = e[t];
  19490. i.active = !1,
  19491. i.deferred = $.Deferred()
  19492. }
  19493. }
  19494. ,
  19495. n.prototype.loadTiledPano = function() {
  19496. var e = (new r.Vector3,
  19497. [])
  19498. , t = [];
  19499. return function(i, n, r, o, a, s) {
  19500. null !== o && void 0 !== o || (o = !0),
  19501. null !== a && void 0 !== a || (a = !0);
  19502. var l = this.getWaitDeferred(i)
  19503. , c = l.deferred
  19504. , h = null
  19505. , u = null;
  19506. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19507. u = r.vFov)),
  19508. !this.isLoaded(i)) {
  19509. if (!l.active) {
  19510. if (l.active = !0,
  19511. r) {
  19512. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19513. e[this.id + ":" + i] = {
  19514. tileCount: 0,
  19515. targetTileCount: d
  19516. },
  19517. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19518. }
  19519. t[this.id] || (t[this.id] = !0,
  19520. this.on(f.LoadComplete, function(e, t) {
  19521. var i = this.getWaitDeferred(e).deferred;
  19522. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19523. this.resetWaitDeferred(e))
  19524. }
  19525. .bind(this)),
  19526. this.on(f.LoadFailed, function(e) {
  19527. var t = this.getWaitDeferred(e).deferred;
  19528. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19529. this.resetWaitDeferred(e))
  19530. }
  19531. .bind(this)),
  19532. this.on(f.TileLoaded, function(t, i, n) {
  19533. var r = this.getWaitDeferred(t).deferred;
  19534. if (r && "pending" === r.state()) {
  19535. r.notify(t, i, n);
  19536. var o = e[this.id + ":" + t];
  19537. o && (o.tileCount++,
  19538. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19539. r.resolve(t, n),
  19540. this.resetWaitDeferred(t)))
  19541. }
  19542. }
  19543. .bind(this)))
  19544. }
  19545. this.tileDownloader.clearForceQueue(),
  19546. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19547. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  19548. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19549. }
  19550. return c.promise()
  19551. }
  19552. }(),
  19553. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19554. if (e === this.id) {
  19555. var n = this.qualityManager.getPanoSize(m.BASE);
  19556. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19557. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19558. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19559. }
  19560. }
  19561. ,
  19562. n.prototype.onTileRendered = function(e, t, i, n) {
  19563. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19564. }
  19565. ,
  19566. n.prototype.onPanoRendered = function(e, t, i, n) {
  19567. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19568. this.updateSkyboxForZoomLevel(),
  19569. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19570. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19571. this.emit("load", t),
  19572. this.model.emit("load", this),
  19573. this.emit(f.LoadComplete, t, i))
  19574. }
  19575. ,
  19576. n.prototype.setZoomed = function(e) {
  19577. this.zoomed = e,
  19578. this.updateSkyboxForZoomLevel()
  19579. }
  19580. ,
  19581. n.prototype.ensureSkyboxReadyForRender = function() {
  19582. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19583. this.solidSkybox.loaded = !0)
  19584. }
  19585. ,
  19586. n.prototype.updateSkyboxForZoomLevel = function() {
  19587. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19588. }
  19589. ,
  19590. n.prototype.getSkyboxTexture = function() {
  19591. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19592. }
  19593. ,
  19594. n.prototype.onTileRenderFail = function(e, t, i) {
  19595. e === this.id && this.emit(f.LoadFailed, t)
  19596. }
  19597. ,
  19598. n.prototype.isLoaded = function(e) {
  19599. if (this.tiled) {
  19600. if (e && "string" == typeof e)
  19601. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19602. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19603. }
  19604. if (e && "number" == typeof e)
  19605. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19606. return !!this.solidSkybox.high || e in this.solidSkybox
  19607. }
  19608. ,
  19609. n.prototype.loadCube = function(e) {
  19610. if (this.isLoaded(e))
  19611. return I.info("Skipping load of pano, already loaded"),
  19612. $.when();
  19613. this.emit("loading", e),
  19614. this.model.emit("loading", this);
  19615. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19616. , i = t.filter(function(e) {
  19617. return !e
  19618. });
  19619. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19620. e = "high",
  19621. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19622. var n = 0
  19623. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19624. return u.getImage(t[i])
  19625. }
  19626. .bind(this));
  19627. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19628. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19629. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19630. this.solidSkybox.low = null),
  19631. this.solidSkybox.needsUpdate = !0,
  19632. this.emit("load", e),
  19633. this.model.emit("load", this),
  19634. this
  19635. }
  19636. .bind(this), function() {
  19637. I.error("Downloading cubemap for pano", this.id, "failed"),
  19638. this.failedLoadingAt = Date.now()
  19639. }
  19640. .bind(this), function() {
  19641. return $.when(++n, 6)
  19642. })
  19643. }
  19644. ,
  19645. n.raycastsSkipped = 0,
  19646. n.raycastsDone = 0,
  19647. n.prototype.findNeighourPanos = function() {
  19648. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19649. this.model.panos.forEach(function(e) {
  19650. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19651. var t = this.position.distanceTo(e.position);
  19652. if (t > a.panoramaNeighbourMaxDistance)
  19653. return this.model.panos.setNeighbour(this, e, !1),
  19654. void n.raycastsSkipped++;
  19655. var i = e.position.clone().sub(this.position).normalize()
  19656. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19657. , s = o.intersectObjects(this.model.colliders);
  19658. n.raycastsDone++,
  19659. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19660. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  19661. }
  19662. }
  19663. .bind(this)),
  19664. this.model.panos.neighbourMap[this.id]
  19665. }
  19666. ,
  19667. n.prototype.worldPosition = function() {
  19668. return this.position
  19669. }
  19670. ,
  19671. n.prototype.addTextSprite = function(e, t) {
  19672. this.removeTextSprite();
  19673. var i = document.createElement("canvas")
  19674. , n = i.getContext("2d");
  19675. i.width = 256,
  19676. i.height = 256;
  19677. var o = "Arial"
  19678. , a = 60;
  19679. n.font = "bold " + a + "px " + o,
  19680. n.fillStyle = "white";
  19681. var s = n.measureText(e).width;
  19682. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19683. var l = new r.Texture(i);
  19684. l.needsUpdate = !0;
  19685. var c = new r.SpriteMaterial({
  19686. map: l,
  19687. color: t || 16428055
  19688. });
  19689. this.text3d = new r.Sprite(c),
  19690. this.text3d.position.copy(this.skyboxMesh.position),
  19691. this.floor.add(this.text3d)
  19692. }
  19693. ,
  19694. n.prototype.removeTextSprite = function() {
  19695. this.text3d && (this.floor.remove(this.text3d),
  19696. this.text3d = null)
  19697. }
  19698. ,
  19699. n.prototype.isAligned = function() {
  19700. return this.alignmentType === l.ALIGNED
  19701. }
  19702. ,
  19703. n.filters = {
  19704. inDirection: function(e, t, i) {
  19705. return function(n) {
  19706. var r = n.position.clone().sub(e).normalize();
  19707. return r.dot(t) > i
  19708. }
  19709. },
  19710. inFloorDirection: function(e, t, i) {
  19711. return function(n) {
  19712. var r = n.floorPosition.clone().sub(e).normalize();
  19713. return r.dot(t) > i
  19714. }
  19715. },
  19716. inPanoDirection: function(e, t, i) {
  19717. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19718. function(n) {
  19719. var r = n.floorPosition.clone().sub(e).normalize()
  19720. , o = n.position.clone().sub(e).normalize();
  19721. return r.dot(t) > i || o.dot(t) > i
  19722. }
  19723. },
  19724. atFloor: function(e) {
  19725. return function(t) {
  19726. return !e || t.floor === e
  19727. }
  19728. },
  19729. not: function(e) {
  19730. return function(t) {
  19731. return t !== e
  19732. }
  19733. },
  19734. notIn: function(e) {
  19735. return function(t) {
  19736. return e.indexOf(t) === -1
  19737. }
  19738. },
  19739. isLoaded: function() {
  19740. return function(e) {
  19741. return e.isLoaded()
  19742. }
  19743. },
  19744. isNotLoaded: function() {
  19745. return function(e) {
  19746. return !e.isLoaded()
  19747. }
  19748. },
  19749. isCloseEnoughTo: function(e, t) {
  19750. return function(i) {
  19751. return e.distanceTo(i.floorPosition) < t
  19752. }
  19753. },
  19754. hasMinimumHeightDifferenceTo: function(e, t) {
  19755. return function(i) {
  19756. return Math.abs(i.position.y - e.y) > t
  19757. }
  19758. },
  19759. isNotBehindNormal: function(e, t) {
  19760. var i = new r.Vector3;
  19761. return t = t.clone(),
  19762. function(n) {
  19763. var r = i.copy(n.position).sub(e).normalize();
  19764. return r.dot(t) > 0
  19765. }
  19766. },
  19767. isNeighbourPanoTo: function(e) {
  19768. return function(t) {
  19769. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19770. }
  19771. },
  19772. isNeighbourOfNeighbourTo: function(e) {
  19773. return function(t) {
  19774. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19775. var n = e.model.panos.get(i);
  19776. return !!n && n.neighbourPanos[t.id]
  19777. })
  19778. }
  19779. },
  19780. isNotRecentlyFailed: function(e) {
  19781. return function(t) {
  19782. return Date.now() - t.failedLoadingAt > e
  19783. }
  19784. },
  19785. isOnVisibleFloor: function() {
  19786. return function(e) {
  19787. return !e.floor.hidden
  19788. }
  19789. },
  19790. isPanoAligned: function() {
  19791. return function(e) {
  19792. return e.isAligned()
  19793. }
  19794. }
  19795. },
  19796. n.sortFunctions = {
  19797. distanceToPoint: function(e) {
  19798. return function(t, i) {
  19799. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19800. }
  19801. },
  19802. floorDistanceToPoint: function(e) {
  19803. return function(t, i) {
  19804. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19805. }
  19806. },
  19807. choose: function(e) {
  19808. return function(t, i) {
  19809. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19810. }
  19811. }
  19812. },
  19813. n.scoreFunctions = {
  19814. distance: function(e, t) {
  19815. return t = t || a.navigation.distanceFactor,
  19816. function(i) {
  19817. return e ? e.position.distanceTo(i.position) * t : 0
  19818. }
  19819. },
  19820. distanceSquared: function(e, t) {
  19821. return t = t || a.navigation.distanceFactor,
  19822. function(i) {
  19823. return e ? e.position.distanceToSquared(i.position) * t : 0
  19824. }
  19825. },
  19826. direction: function(e, t) {
  19827. return function(i) {
  19828. var n = i.position.clone().sub(e).normalize();
  19829. return n.dot(t) * a.navigation.directionFactor
  19830. }
  19831. },
  19832. angle: function(e, t) {
  19833. return function(i) {
  19834. var n = i.position.clone().sub(e).normalize();
  19835. return n.angleTo(t) * a.navigation.angleFactor
  19836. }
  19837. },
  19838. inFieldOfView: function(e, t) {
  19839. return function(i) {
  19840. var n = i.position.clone().sub(e).normalize();
  19841. return n.dot(t) > .75 ? 10 : -1
  19842. }
  19843. },
  19844. optionality: function(e) {
  19845. return function(t) {
  19846. var i = t.neighbourUUIDs.filter(function(t) {
  19847. return !(t in e.neighbourUUIDs) && t !== e.id
  19848. });
  19849. return i.length * a.navigation.optionalityFactor
  19850. }
  19851. },
  19852. penalizeHeightDifferenceUnder: function(e, t) {
  19853. return function(i) {
  19854. return e.y - i.position.y < t ? -20 : 0
  19855. }
  19856. }
  19857. },
  19858. t.exports = n
  19859. }
  19860. ).call(this, "/js/objects/Panorama.js")
  19861. }
  19862. , {
  19863. "../enum/AlignmentType": 17,
  19864. "../enum/GLCubeFaces": 25,
  19865. "../enum/PanoRendererEvents": 35,
  19866. "../enum/PanoSizeClass": 36,
  19867. "../enum/PanoramaEvents": 37,
  19868. "../enum/RenderLayers": 41,
  19869. "../enum/RenderOrder": 42,
  19870. "../enum/TileDownloaderEvents": 45,
  19871. "../enum/Viewmode": 51,
  19872. "../exception/BasicException": 55,
  19873. "../scene/SceneRenderer": 158,
  19874. "../settings": 166,
  19875. "../tile/TileUtils": 174,
  19876. "../util/ajax": 181,
  19877. "../util/common": 185,
  19878. "../util/lerp": 188,
  19879. "../util/logger": 189,
  19880. "../util/panorama": 191,
  19881. "../util/texture": 194,
  19882. "../util/transitions": 195,
  19883. events: 202,
  19884. three: 217
  19885. }],
  19886. 149: [function(e, t, i) {
  19887. "use strict";
  19888. function n(e) {
  19889. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19890. t.map.value = d,
  19891. t.opacity.value = 0,
  19892. t.color.value.set(o.reticuleColor),
  19893. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  19894. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19895. side: r.DoubleSide,
  19896. depthWrite: !1,
  19897. depthTest: !1,
  19898. transparent: !0,
  19899. vertexShader: c.waypoint.vertexShader,
  19900. fragmentShader: c.waypoint.fragmentShader,
  19901. uniforms: t,
  19902. name: "waypoint",
  19903. opacity: 0,
  19904. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19905. })),
  19906. this.layers.set(h.RETICULE),
  19907. this.renderOrder = u.reticule,
  19908. this.player = e,
  19909. this.direction = new r.Vector3,
  19910. this.hidden = !0,
  19911. this.mouseLastMoveTime = Date.now()
  19912. }
  19913. var r = e("three")
  19914. , o = e("../settings")
  19915. , a = e("../util/transitions")
  19916. , s = e("../util/texture")
  19917. , l = e("../util/lerp")
  19918. , c = e("../shaders")
  19919. , h = e("../enum/RenderLayers")
  19920. , u = e("../enum/RenderOrder")
  19921. , d = s.load("images/reticule-256x256.png");
  19922. n.prototype = Object.create(r.Mesh.prototype),
  19923. n.prototype.move = function(e, t, i) {
  19924. this.hidden = i,
  19925. this.mouseLastMoveTime = Date.now()
  19926. }
  19927. ,
  19928. n.prototype.hide = function() {
  19929. this.hidden || (this.hidden = !0,
  19930. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19931. }
  19932. ,
  19933. n.prototype.show = function() {
  19934. this.hidden = !1,
  19935. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19936. }
  19937. ,
  19938. n.prototype.update = function() {
  19939. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19940. }
  19941. ,
  19942. n.prototype.updatePosition = function(e, t) {
  19943. if (!this.hidden) {
  19944. if (!t)
  19945. return this.hide();
  19946. var i = t.point
  19947. , n = e.distanceTo(i)
  19948. , r = 1 + .01 * n;
  19949. n < 1 && (r -= 1 - n),
  19950. this.show(),
  19951. this.scale.set(r, r, r),
  19952. this.direction = this.direction.multiplyScalar(.8),
  19953. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19954. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19955. this.lookAt(this.position.clone().add(this.direction))
  19956. }
  19957. }
  19958. ,
  19959. n.prototype.writeAstag = function() {
  19960. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19961. , t = new Date;
  19962. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19963. var i = {
  19964. enabled: !0,
  19965. version: "0",
  19966. created: t.toISOString(),
  19967. created_by: "APITest",
  19968. position: this.position.clone(),
  19969. stem: {
  19970. enabled: o.tags.pole.enabled,
  19971. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19972. },
  19973. label: "tag " + this.tagCount,
  19974. description: "Description " + e,
  19975. floor: function(e) {
  19976. if (e.currentFloor) {
  19977. var t = e.floors.indexOf(e.currentFloor);
  19978. return t > -1 ? t : void 0
  19979. }
  19980. }(this.player.model),
  19981. type: "info",
  19982. metadata: {
  19983. preferred_camera: {
  19984. mode: this.player.mode
  19985. }
  19986. }
  19987. };
  19988. console.log("--------------------------"),
  19989. console.log(JSON.stringify(i));
  19990. var n = this.player.model.addtag(e, i).build();
  19991. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19992. n.visible || n.show(o.tags.startup.fadeInDuration))
  19993. }
  19994. ,
  19995. t.exports = n
  19996. }
  19997. , {
  19998. "../enum/RenderLayers": 41,
  19999. "../enum/RenderOrder": 42,
  20000. "../settings": 166,
  20001. "../shaders": 167,
  20002. "../util/lerp": 188,
  20003. "../util/texture": 194,
  20004. "../util/transitions": 195,
  20005. three: 217
  20006. }],
  20007. 150: [function(e, t, i) {
  20008. "use strict";
  20009. function n(e, t) {
  20010. this.chunks = [],
  20011. this.floorId = e,
  20012. this.roomId = t,
  20013. this.position = new r.Vector3
  20014. }
  20015. var r = e("three");
  20016. n.prototype.addChunk = function(e) {
  20017. this.chunks.push(e)
  20018. }
  20019. ,
  20020. n.prototype.calcBoundaries = function() {
  20021. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  20022. var s = this.chunks[a]
  20023. , l = s.geometry.attributes.position;
  20024. if (l)
  20025. for (var c = 0; c < l.array.length; c += 3)
  20026. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  20027. t.add(e),
  20028. 0 === c ? (i.copy(e),
  20029. n.copy(e)) : (i.max(e),
  20030. n.min(e)),
  20031. o++
  20032. }
  20033. o > 0 ? (t.multiplyScalar(1 / o),
  20034. this.average = t) : this.average = null,
  20035. this.boundsMax = i,
  20036. this.boundsMin = n,
  20037. this.center = new r.Vector3,
  20038. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  20039. }
  20040. ,
  20041. t.exports = n
  20042. }
  20043. , {
  20044. three: 217
  20045. }],
  20046. 151: [function(e, t, i) {
  20047. (function(i) {
  20048. "use strict";
  20049. function n(e, t, i) {
  20050. this.obj3d = null,
  20051. this.nodes = [],
  20052. this.colorHull = [],
  20053. this.shortPaths = {},
  20054. this.floorHull = null,
  20055. this.cameraHull = null,
  20056. this.floorPathDistance = 0,
  20057. this.floorCurvePoints = null,
  20058. this.floorCurveColors = null,
  20059. this.camCurvePoints = null,
  20060. this.warpDestHeroLoc = null,
  20061. this.warpDestPano = null,
  20062. this.warpPathPoints = null,
  20063. this.warpPathLengths = [0],
  20064. this.warpLength = 0,
  20065. this.closeWarpDistance = 4,
  20066. this.UP = A.UP.clone(),
  20067. this.longestStep = 0,
  20068. this.upcomingTransType = null,
  20069. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  20070. this.prevNextDist = 0,
  20071. this.nextI = 0,
  20072. this.activeTransType = null,
  20073. this.lastTransType = null,
  20074. this.bunnyObj = null,
  20075. this.director = e,
  20076. this.player = t,
  20077. this.playerControls = i,
  20078. this.modelManager = t.modelManager,
  20079. this.updateModel(),
  20080. this.updateDefaultsFromModelData(),
  20081. this.bindEvents(),
  20082. this.warping = !1,
  20083. this.waitingToWarp = !1,
  20084. this.warpInterrupted = !1,
  20085. this.warpInterruptionBlackoutStyle = null,
  20086. this.warpInterruptionTravelTime = null
  20087. }
  20088. var r = e("three")
  20089. , o = e("../util/logger")
  20090. , a = e("../enum/Viewmode")
  20091. , s = e("../enum/RenderOrder")
  20092. , l = e("../enum/WarpStyle")
  20093. , c = e("../settings")
  20094. , h = e("../util/math")
  20095. , u = e("../util/lerp")
  20096. , d = e("../util/easing")
  20097. , p = e("../util/transitions")
  20098. , f = e("../objects/Snapshot")
  20099. , g = e("../effects")
  20100. , m = e("../shaders")
  20101. , v = (e("../gui/gui"),
  20102. e("../util/texture"))
  20103. , A = e("../enum/Vectors")
  20104. , y = (e("../model/ModelManager"),
  20105. new o(i))
  20106. , C = e("../enum/PlayerEvents")
  20107. , I = e("../enum/BlackoutStyle")
  20108. , E = e("../enum/ModelManagerEvents")
  20109. , b = e("../constants")
  20110. , w = {
  20111. path: v.loadBase64("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"),
  20112. pathEnd: v.load("images/End.png"),
  20113. pathStart: v.loadBase64("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==")
  20114. };
  20115. n.prototype.setScene = function(e) {
  20116. this.createCpm(e),
  20117. this.createBunnyObj(e)
  20118. }
  20119. ,
  20120. n.prototype.updateModel = function() {
  20121. this.model = this.modelManager.getActiveModel()
  20122. }
  20123. ,
  20124. n.prototype.bindEvents = function() {
  20125. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  20126. }
  20127. ,
  20128. n.prototype.updateDefaultsFromModelData = function() {
  20129. this.model.data
  20130. }
  20131. ,
  20132. n.prototype.pointPathDistance = function(e) {
  20133. for (var t = 0, i = 1; i < e.length; i += 1)
  20134. t += e[i - 1].distanceTo(e[i]);
  20135. return t
  20136. }
  20137. ,
  20138. n.prototype.pointPathLengths = function(e) {
  20139. for (var t = [0], i = 1; i < e.length; i += 1)
  20140. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  20141. return t
  20142. }
  20143. ,
  20144. n.prototype.interpAlongPath = function(e, t, i) {
  20145. var n, o = new r.Vector3, a = t[t.length - 1];
  20146. if (i < 1) {
  20147. n = i * a;
  20148. for (var s = 1; s < t.length; s += 1)
  20149. if (t[s] > n) {
  20150. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  20151. return o.copy(e[s]),
  20152. o.sub(e[s - 1]),
  20153. o.multiplyScalar(l),
  20154. o.add(e[s - 1]),
  20155. o
  20156. }
  20157. } else
  20158. o.copy(e[e.length - 1]);
  20159. return o
  20160. }
  20161. ,
  20162. n.prototype.pathHeight = function() {
  20163. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  20164. }
  20165. ,
  20166. n.prototype.createBunnyObj = function(e) {
  20167. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  20168. this.bunnyObj.visible = c.warp.showBunny),
  20169. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  20170. e.add(this.bunnyObj)
  20171. }
  20172. ,
  20173. n.prototype.createCpm = function(e) {
  20174. if (!this.currentPanoMarker) {
  20175. var t = this.makeWaypointObj(w.pathEnd, "Current");
  20176. t.material.uniforms.opacity.value = 0,
  20177. this.currentPanoMarker = {
  20178. mesh: t,
  20179. placed: !1
  20180. }
  20181. }
  20182. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20183. this.placeCpm(),
  20184. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20185. }
  20186. ,
  20187. n.prototype.placeCpm = function() {
  20188. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20189. var e = this.player.currentPano.floor;
  20190. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20191. e.add(this.currentPanoMarker.mesh)),
  20192. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20193. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  20194. this.currentPanoMarker.placed = !0
  20195. } else
  20196. this.popOutCpm()
  20197. }
  20198. ,
  20199. n.prototype.fadeInCpm = function(e) {
  20200. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  20201. }
  20202. ,
  20203. n.prototype.fadeOutCpm = function(e) {
  20204. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  20205. }
  20206. ,
  20207. n.prototype.popInCpm = function() {
  20208. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20209. }
  20210. ,
  20211. n.prototype.popOutCpm = function() {
  20212. this.fadeOutCpm(2)
  20213. }
  20214. ,
  20215. n.prototype.brushPrefs = {
  20216. linewidth: 7,
  20217. strokeWidth: 15,
  20218. cvSegments: 48,
  20219. paveStep: .1,
  20220. paveWidth: .2,
  20221. lookBlendDist: 3,
  20222. maxTurn: r.Math.degToRad(2)
  20223. },
  20224. n.prototype.panoPathDistance = function(e) {
  20225. var t = this.model.panos;
  20226. if (!e || e.length < 2)
  20227. return 0;
  20228. for (var i = [], n = 0; n < e.length; n += 1)
  20229. i.push(t.get(e[n]).floorPosition);
  20230. return this.pointPathDistance(i)
  20231. }
  20232. ,
  20233. n.prototype.loadTileTexture = function(e) {
  20234. var t = v.load(e, function(t) {
  20235. t.wrapS = r.RepeatWrapping,
  20236. t.wrapT = r.RepeatWrapping,
  20237. t.needsUpdate = !0,
  20238. y.debug('path texture "' + e + '" is ready')
  20239. }, function() {
  20240. y.error('path texture "' + e + '" failed')
  20241. });
  20242. return t.mapping = r.UVMapping,
  20243. t
  20244. }
  20245. ,
  20246. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20247. var a = {
  20248. cameraMode: n,
  20249. position: e,
  20250. quaternion: t,
  20251. panoId: i,
  20252. orthoZoom: o,
  20253. floorVisibility: r,
  20254. thumbUrl: null,
  20255. name: null
  20256. };
  20257. return new f(a)
  20258. }
  20259. ,
  20260. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20261. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20262. }
  20263. ,
  20264. n.prototype.setWarpDestination = function(e) {
  20265. this.warpDestHeroLoc = e
  20266. }
  20267. ,
  20268. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20269. var t = this.getHeroDescriptorByHeroIndex(e);
  20270. return null !== t && (this.setWarpDestination(t),
  20271. !0)
  20272. }
  20273. ,
  20274. n.prototype.setWarpDestinationByPano = function(e, t) {
  20275. var i = this.model.panos.get(e.id);
  20276. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20277. }
  20278. ,
  20279. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20280. var i = this.model.panos.get(e);
  20281. if (i) {
  20282. t = t || new r.Quaternion;
  20283. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20284. return this.setWarpDestination(n),
  20285. !0
  20286. }
  20287. return !1
  20288. }
  20289. ,
  20290. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20291. var t = this.model.heroCount();
  20292. /* if (null !== this.warpDestHeroLoc && t < 2)
  20293. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20294. this.model.getHeroDescriptorByIndex(0); */
  20295. var i = this.model.getHeroDescriptorByIndex(e);
  20296. if (i) {
  20297. var n = i.isPano() ? i.panoId : i.cameraMode;
  20298. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20299. }
  20300. return i
  20301. }
  20302. ,
  20303. n.prototype.getHeroDescriptorByPano = function(e) {
  20304. var t = this.model.panos.get(e.id);
  20305. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20306. }
  20307. ,
  20308. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20309. var t = this.getHeroIndexFromPanoId(e);
  20310. return this.getHeroDescriptorByHeroIndex(t)
  20311. }
  20312. ,
  20313. n.prototype.getHeroIndexFromPanoId = function(e) {
  20314. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20315. var i = this.model.heroLocations[t]
  20316. , n = this.getHeroId(i);
  20317. if (n && n === e)
  20318. return t
  20319. }
  20320. return -1
  20321. }
  20322. ,
  20323. n.prototype.getHeroPano = function(e) {
  20324. if (null === e)
  20325. return y.warn("getHeroPano(): no destination"),
  20326. null;
  20327. var t = this.getHeroId(e)
  20328. , i = this.model.panos.get(t);
  20329. return void 0 === i && (i = null,
  20330. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20331. i
  20332. }
  20333. ,
  20334. n.prototype.getHeroId = function(e) {
  20335. return e.panoId
  20336. }
  20337. ,
  20338. n.prototype.setWarpDestPano = function() {
  20339. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20340. this.warpDestPano
  20341. }
  20342. ,
  20343. n.prototype.brushToWarpPano = function(e, t) {
  20344. if (this.discardPathObject(),
  20345. !this.setWarpDestPano())
  20346. return !1;
  20347. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20348. !this.warpDestPano)
  20349. return y.info("No brush"),
  20350. !1;
  20351. if (!this.player.currentPano)
  20352. return y.debug("No current pano, visibility undefined"),
  20353. !1;
  20354. if (!this.warpDestPano)
  20355. return y.info("No wPano, visibility undefined"),
  20356. !1;
  20357. if (!this.warpDestPano.isAligned())
  20358. return y.debug("Cannot brush to unaligned pano"),
  20359. !1;
  20360. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20361. , n = !0;
  20362. if (this.player.currentPano.id === this.warpDestPano.id)
  20363. y.debug("Already at destination pano");
  20364. else {
  20365. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20366. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20367. this.obj3d = new r.Object3D,
  20368. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20369. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20370. e = t) : (this.setPathHulls(this.nodes),
  20371. this.setFloorCurves(),
  20372. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  20373. this.player.currentPano.floor.add(this.obj3d);
  20374. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20375. , s = e === l.STD;
  20376. if (!n && (i || s)) {
  20377. if (o) {
  20378. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20379. this.obj3d.add(h)
  20380. }
  20381. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20382. this.obj3d.add(u)
  20383. }
  20384. this.appearSlow()
  20385. }
  20386. return this.upcomingTransType = e,
  20387. !n
  20388. }
  20389. ,
  20390. n.prototype.findShortestPath = function(e, t) {
  20391. if (!e || !t)
  20392. return null;
  20393. var i = c.warp.walkExtraPanosDistance
  20394. , n = e.id + ":" + t.id + ":" + i;
  20395. if (this.shortPaths.hasOwnProperty(n))
  20396. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20397. var r = t.id + ":" + e.id + ":" + i;
  20398. if (this.shortPaths.hasOwnProperty(r))
  20399. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20400. var o = this.model.panos.aStarSearch(e, t);
  20401. return this.model.panos.includeNodesNearPath(o, i),
  20402. this.shortPaths[n] = o ? o.slice() : null,
  20403. o
  20404. }
  20405. ,
  20406. n.prototype.makePathHulls = function(e) {
  20407. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20408. t = u.get(e[0]),
  20409. r = t.floor.floorIndex;
  20410. for (var d = 0; d < e.length; d += 1)
  20411. t = u.get(e[d]),
  20412. i = t.floorPosition.clone().sub(this.model.position),
  20413. i.y += this.pathHeight(),
  20414. s.push(i),
  20415. l.push(t.position.clone()),
  20416. n = t.floor.floorIndex,
  20417. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20418. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20419. o > a && (a = o));
  20420. return a > this.longestStep && (this.longestStep = a,
  20421. y.debug("path contains " + a + " meter segment")),
  20422. {
  20423. floor: s,
  20424. camera: l,
  20425. color: h
  20426. }
  20427. }
  20428. ,
  20429. n.prototype.makeFloorCurves = function(e, t, i) {
  20430. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20431. , o = this.pointPathDistance(e) - 2 * n
  20432. , s = e.slice(0)
  20433. , l = s[1].clone().sub(s[0]);
  20434. l.y = 0,
  20435. l.normalize().multiplyScalar(n),
  20436. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20437. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20438. l.y = 0,
  20439. l.normalize().multiplyScalar(n),
  20440. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20441. var h = new r.CatmullRomCurve3(s)
  20442. , u = Math.floor(o / i);
  20443. u = 4 * Math.floor(u / 4),
  20444. u = Math.max(4, u);
  20445. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20446. f = 0,
  20447. d = g[A].distanceTo(e[0]);
  20448. for (var y = 1; y < e.length; y += 1)
  20449. v.copy(g[A]).sub(e[y]),
  20450. v.y *= 4,
  20451. p = v.length(),
  20452. p < d && (f = y);
  20453. m.push(t[f])
  20454. }
  20455. return {
  20456. distance: o,
  20457. points: g,
  20458. colors: m
  20459. }
  20460. }
  20461. ,
  20462. n.prototype.makeCameraCurvePoints = function(e, t) {
  20463. var i = this.pointPathDistance(e)
  20464. , n = new r.CatmullRomCurve3(e);
  20465. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20466. }
  20467. ,
  20468. n.prototype.makeCameraCurveTangents = function(e, t) {
  20469. var i = this.pointPathDistance(e)
  20470. , n = new r.CatmullRomCurve3(e)
  20471. , o = Math.max(2, Math.floor(i / t));
  20472. o || (o = 5);
  20473. for (var a = [], s = 0; s <= o; s++)
  20474. a.push(n.getTangentAt(s / o));
  20475. return a
  20476. }
  20477. ,
  20478. n.prototype.setPathHulls = function(e) {
  20479. var t = this.makePathHulls(e);
  20480. this.floorHull = t.floor,
  20481. this.cameraHull = t.camera,
  20482. this.colorHull = t.color
  20483. }
  20484. ,
  20485. n.prototype.setFloorCurves = function() {
  20486. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20487. this.floorPathDistance = e.distance,
  20488. this.floorCurvePoints = e.points,
  20489. this.floorCurveColors = e.colors
  20490. }
  20491. ,
  20492. n.prototype.setCameraCurvePoints = function() {
  20493. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20494. }
  20495. ,
  20496. n.prototype.chooseWarpPath = function(e) {
  20497. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20498. if (this.player.currentPano === this.warpDestPano || !e)
  20499. return this.warpPathPoints = null,
  20500. this.warpLength = 0,
  20501. !1;
  20502. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20503. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20504. t = this.warpDestPano.position.clone().sub(o.position),
  20505. i = t.clone().negate(),
  20506. t.multiplyScalar(.15).add(o.position),
  20507. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20508. t.y = o.position.y,
  20509. i.y = this.warpDestPano.position.y,
  20510. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20511. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20512. this.setCameraCurvePoints(),
  20513. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20514. this.warpLength = 0,
  20515. this.warpPathLengths = [0];
  20516. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  20517. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20518. var p = s.length();
  20519. s.y *= c.warp.climbEffort;
  20520. var f = s.length() / p;
  20521. if (d > 1) {
  20522. s.setY(0).normalize(),
  20523. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20524. var g = Math.min(1, s.dot(l))
  20525. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20526. f = Math.max(m, f)
  20527. }
  20528. this.warpLength += p * f,
  20529. this.warpPathLengths[d] = this.warpLength
  20530. }
  20531. return !0
  20532. }
  20533. ,
  20534. n.prototype.drawPathRibbon = function(e, t) {
  20535. this.bunnyObj.visible = c.warp.showBunny;
  20536. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  20537. h.copy(e[u]),
  20538. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20539. h.normalize(),
  20540. n.crossVectors(h, A.UP),
  20541. n.multiplyScalar(i);
  20542. var d = (new r.Vector3).copy(e[u]).add(o);
  20543. d.sub(n),
  20544. l.vertices.push(d),
  20545. d = (new r.Vector3).copy(e[u]).add(o),
  20546. d.add(n),
  20547. l.vertices.push(d)
  20548. }
  20549. var p, f = 0;
  20550. for (u = 0; u < e.length - 1; u += 1) {
  20551. var g = 2 * u
  20552. , v = f;
  20553. f += e[u + 1].distanceTo(e[u]);
  20554. var y = f
  20555. , C = t[u]
  20556. , I = t[u + 1];
  20557. p = new r.Face3(g,g + 1,g + 2),
  20558. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20559. l.faces.push(p),
  20560. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20561. p = new r.Face3(g + 2,g + 1,g + 3),
  20562. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20563. l.faces.push(p),
  20564. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20565. }
  20566. l.computeFaceNormals(),
  20567. l.computeVertexNormals();
  20568. var E, b;
  20569. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20570. b.map.value = w.path,
  20571. b.opacity.value = 0,
  20572. b.color.value.set(c.path.color),
  20573. E = new r.RawShaderMaterial({
  20574. side: r.DoubleSide,
  20575. depthWrite: !1,
  20576. transparent: !0,
  20577. vertexShader: m.ribbon.vertexShader,
  20578. fragmentShader: m.ribbon.fragmentShader,
  20579. uniforms: b,
  20580. name: "ribbonT",
  20581. opacity: 0
  20582. })) : E = new r.MeshBasicMaterial({
  20583. color: 16777215,
  20584. side: r.DoubleSide,
  20585. name: "ribbonOut",
  20586. vertexColors: r.VertexColors
  20587. });
  20588. var _ = new r.Mesh(l,E);
  20589. return _.name = "ribbon",
  20590. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20591. _
  20592. }
  20593. ,
  20594. n.prototype.drawPathPavement = function(e) {
  20595. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20596. s.copy(e[l]),
  20597. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20598. s.normalize(),
  20599. n.crossVectors(s, A.UP),
  20600. n.multiplyScalar(this.brushPrefs.paveWidth),
  20601. t = (new r.Vector3).copy(e[l]),
  20602. t.sub(n),
  20603. o.vertices.push(t),
  20604. o.vertices.push((new r.Vector3).copy(e[l])),
  20605. t = (new r.Vector3).copy(e[l]),
  20606. t.add(n),
  20607. o.vertices.push(t);
  20608. var h, u, d;
  20609. for (l = 0; l < e.length - 1; l += 1)
  20610. h = 3 * l + 1,
  20611. u = l * i,
  20612. d = u + i,
  20613. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20614. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20615. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20616. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20617. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20618. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20619. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20620. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20621. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20622. color: c.path.color,
  20623. side: r.DoubleSide,
  20624. transparent: !0,
  20625. depthWrite: !1,
  20626. opacity: 0,
  20627. name: "paveT",
  20628. map: w.path
  20629. }) : new r.MeshBasicMaterial({
  20630. color: c.path.color,
  20631. side: r.DoubleSide,
  20632. transparent: !0,
  20633. depthWrite: !1,
  20634. opacity: 1,
  20635. name: "paveO",
  20636. map: w.path
  20637. });
  20638. return new r.Mesh(o,p)
  20639. }
  20640. ,
  20641. n.prototype.hintPrefs = {
  20642. rad: .18,
  20643. width: .0125,
  20644. depth: .0625,
  20645. setBack: -.04,
  20646. markRad: .25,
  20647. markInnerRad: .16
  20648. },
  20649. n.prototype.makeWaypointObj = function(e, t) {
  20650. var i = new r.Geometry
  20651. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20652. , o = this.pathHeight();
  20653. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  20654. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20655. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20656. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20657. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20658. s.map.value = e,
  20659. s.opacity.value = 0,
  20660. s.color.value.set(c.path.color);
  20661. var l = {
  20662. side: r.DoubleSide,
  20663. depthWrite: !1,
  20664. transparent: !0,
  20665. vertexShader: m.waypoint.vertexShader,
  20666. fragmentShader: m.waypoint.fragmentShader,
  20667. uniforms: s,
  20668. name: "waypoint",
  20669. opacity: 0
  20670. };
  20671. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20672. l.name = "wayPtOut");
  20673. var h = new r.RawShaderMaterial(l)
  20674. , u = new r.Mesh(i,h);
  20675. return u.name = t,
  20676. u
  20677. }
  20678. ,
  20679. n.prototype.makeStartMarker = function(e, t) {
  20680. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20681. i.y = 0,
  20682. i.normalize();
  20683. var n = Math.acos(i.x)
  20684. , o = this.makeWaypointObj(w.pathStart, "Start");
  20685. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20686. o.position.copy(e),
  20687. o
  20688. }
  20689. ,
  20690. n.prototype.makeEndMarker = function(e) {
  20691. var t = this.makeWaypointObj(w.pathEnd, "End")
  20692. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20693. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20694. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20695. t.position.copy(e),
  20696. t
  20697. }
  20698. ,
  20699. n.prototype.pathClean = function(e) {
  20700. if (e) {
  20701. for (var t in e.children)
  20702. this.pathClean(e.children[t]);
  20703. e.geometry && e.geometry.dispose(),
  20704. e.material && e.material.dispose()
  20705. }
  20706. }
  20707. ,
  20708. n.prototype.discardPathObject = function() {
  20709. if (this.obj3d) {
  20710. var e = this.obj3d.parent;
  20711. e && e.remove(this.obj3d),
  20712. this.pathClean(this.obj3d)
  20713. }
  20714. this.obj3d = null,
  20715. this.popInCpm()
  20716. }
  20717. ,
  20718. n.prototype.discardSlow = function() {
  20719. if (this.obj3d) {
  20720. if (this.player.mode !== a.PANORAMA)
  20721. return void this.discardPathObject();
  20722. for (var e, t = this, i = 0, n = function() {
  20723. this.discardPathObject()
  20724. }
  20725. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20726. e = t.obj3d.children[r],
  20727. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  20728. i += 1,
  20729. n = null);
  20730. 0 === i && this.discardPathObject(),
  20731. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20732. }
  20733. }
  20734. ,
  20735. n.prototype.appearSlow = function() {
  20736. var e, t = this;
  20737. this.fadeOutCpm(c.path.fadeInTime);
  20738. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20739. e = t.obj3d.children[n],
  20740. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  20741. }
  20742. ,
  20743. n.prototype.update = function() {
  20744. this.obj3d && this.obj3d.updateMatrixWorld()
  20745. }
  20746. ,
  20747. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20748. var t = r.Math.degToRad(c.warp.burnsAngle);
  20749. if (this.player.mode === a.PANORAMA) {
  20750. var i = this.burnsDir * t;
  20751. if (this.upcomingTransType === l.BLACK)
  20752. return i;
  20753. var n = e;
  20754. if (null === n)
  20755. return y.warn("Transition request for non-highlight"),
  20756. i;
  20757. var o = this.getHeroDescriptorByHeroIndex(n);
  20758. if (null === o)
  20759. return i;
  20760. if (!o.isPano())
  20761. return i;
  20762. var s = this.getHeroPano(o)
  20763. , h = this.playerControls.cameras[a.PANORAMA]
  20764. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20765. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20766. , p = function(e) {
  20767. var i = Math.acos(Math.min(1, e.dot(u)))
  20768. , n = (new r.Vector3).crossVectors(u, e);
  20769. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20770. };
  20771. if (s === this.player.currentPano)
  20772. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20773. var f = this.findShortestPath(this.player.currentPano, s);
  20774. if (void 0 === f || null === f || f.length < 1)
  20775. return y.debug("Empty path ahead..."),
  20776. i;
  20777. var g = this.makePathHulls(f)
  20778. , m = new r.CatmullRomCurve3(g.camera)
  20779. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20780. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20781. }
  20782. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20783. }
  20784. ,
  20785. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20786. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20787. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20788. var n = new r.Euler
  20789. , o = new r.Vector3;
  20790. y.debug("Starting wait: " + (void 0 !== t));
  20791. var s = this.calcBurnsAmount(e)
  20792. , h = function() {
  20793. this.endWarpState(),
  20794. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20795. t && t()
  20796. }
  20797. .bind(this)
  20798. , u = function(e, t) {
  20799. if (this.warpInterrupted)
  20800. return h(),
  20801. !0;
  20802. var r = t || 1e3 / 60;
  20803. if (c.warp.doBurns)
  20804. if (this.player.mode === a.PANORAMA) {
  20805. var l = this.playerControls.cameras[a.PANORAMA];
  20806. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20807. var u = r * s / i;
  20808. //u = /* Math.sign(u) * */ Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20809. u = -1* Math.abs(u);
  20810. n.y += u,
  20811. o.set(0, 0, -1),
  20812. o.applyEuler(n),
  20813. o.add(l.position),
  20814. l.controls.lookAt(o),
  20815. l.controls.lookVector.copy(o)
  20816. ,l.lookAt(o)
  20817. } else
  20818. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20819. }
  20820. .bind(this);
  20821. this.startWarpState(),
  20822. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20823. }
  20824. ,
  20825. n.prototype.warpToNonPano = function(e) {
  20826. if (this.discardPathObject(),
  20827. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20828. var t = function() {
  20829. e && e()
  20830. }
  20831. .bind(this);
  20832. this.player.flyToNewMode({
  20833. mode: this.warpDestHeroLoc.cameraMode,
  20834. duration: c.warp.outsideTime,
  20835. warpDest: this.warpDestHeroLoc,
  20836. callback: t,
  20837. force: !0
  20838. })
  20839. } else
  20840. y.warn("no warp destination!!!"),
  20841. e && e()
  20842. }
  20843. ,
  20844. n.prototype._resetWarpShaderParams = function(e) {//
  20845. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20846. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20847. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20848. delete e.material.defines.newBlack;
  20849. e.material.needsUpdate = true
  20850. } */
  20851. }
  20852. ,
  20853. n.prototype._clearWarpShading = function() {
  20854. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20855. this._resetWarpShaderParams(e[t]),
  20856. e[t].visible = !0;
  20857. this._resetWarpShaderParams(this.model.skybox)
  20858. }
  20859. ,
  20860. n.prototype._warpStopFlying = function() {
  20861. this.activeTransType = null,
  20862. this.placeCpm()
  20863. }
  20864. ,
  20865. n.prototype._wrapupTravelOnlyBits = function() {
  20866. this._warpStopFlying(),
  20867. this.warpPathPoints && (this.player.currentPano.exit(),
  20868. this.warpDestPano.enter(),
  20869. this.player.currentPano = this.warpDestPano),
  20870. this.player.spider.draw(),
  20871. this.placeCpm()
  20872. }
  20873. ,
  20874. n.prototype._wrapupTravel = function(e) {
  20875. this._wrapupTravelOnlyBits(),
  20876. this.warpCameraAim(e)
  20877. }
  20878. ,
  20879. n.prototype._wrapupWarpShading = function(e) {
  20880. this._clearWarpShading(),
  20881. this._wrapupTravel(e)
  20882. }
  20883. ,
  20884. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20885. t !== I.END && this._clearWarpShading(),
  20886. this._wrapupTravelOnlyBits(),
  20887. this.upcomingTransType = null,
  20888. e && e()
  20889. }
  20890. ,
  20891. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20892. var i = this.warpDestHeroLoc.quaternion
  20893. , n = this.playerControls.cameras[a.PANORAMA]
  20894. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20895. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20896. , l = s.dot(o)
  20897. , u = r.Math.radToDeg(Math.acos(l))
  20898. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20899. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20900. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20901. m.y = h.constrainedTurn(m.y),
  20902. this.burnsDir = Math.sign(m.y);
  20903. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20904. , A = new r.Vector3
  20905. , C = function(e, t) {
  20906. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20907. v.y = g.y + e * m.y,
  20908. v.z = g.z + e * m.z,
  20909. A.set(0, 0, -1),
  20910. A.applyEuler(v),
  20911. A.add(n.position),
  20912. n.controls.lookAt(A),
  20913. n.controls.lookVector.copy(A),
  20914. void n.lookAt(A))
  20915. }
  20916. .bind(this);
  20917. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20918. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20919. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20920. ):
  20921. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20922. ,void (t && t())
  20923. ) */
  20924. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20925. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20926. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20927. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20928. ,void (t && t())
  20929. )
  20930. }
  20931. ,
  20932. n.prototype._warpBendAim = function(e, t, i, n) {
  20933. var o = n || 0
  20934. , s = this.playerControls.cameras[a.PANORAMA]
  20935. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20936. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20937. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20938. f.y = h.constrainedTurn(f.y);
  20939. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20940. f.x = g * Math.sign(f.x),
  20941. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20942. this.burnsDir = Math.sign(f.y),
  20943. g *= Math.sign(f.y),
  20944. f.y = g;
  20945. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20946. , v = new r.Vector3
  20947. , A = function(e, t) {
  20948. if (e < .5)
  20949. m.x = u.x + e * f.x,
  20950. m.y = u.y + e * f.y,
  20951. m.z = u.z + e * f.z;
  20952. else {
  20953. var i = (1 - e) * c.warp.softBendEnd;
  20954. m.x = l.x - i * f.x,
  20955. m.y = l.y - i * f.y,
  20956. m.z = l.z - i * f.z
  20957. }
  20958. v.set(0, 0, -1),
  20959. v.applyEuler(m),
  20960. v.add(s.position);
  20961. s.controls.lookAt(v),
  20962. s.controls.lookVector.copy(v),
  20963. s.lookAt(v);
  20964. }
  20965. .bind(this);
  20966. if(momentTourBlackNewType){
  20967. A(1)
  20968. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20969. }
  20970. ,
  20971. n.prototype._warpStepCameraAim = function(e, t, i) {
  20972. var n = this.playerControls.cameras[a.PANORAMA]
  20973. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20974. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20975. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20976. l.y = h.constrainedTurn(l.y),
  20977. this.burnsDir = Math.sign(l.y);
  20978. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20979. , f = new r.Vector3
  20980. , g = function(e, t) {
  20981. e < .5 ? u.copy(s) : u.copy(o),
  20982. f.set(0, 0, -1),
  20983. f.applyEuler(u),
  20984. f.add(n.position),
  20985. n.controls.lookAt(f),
  20986. n.controls.lookVector.copy(f),
  20987. n.lookAt(f)
  20988. }
  20989. .bind(this);
  20990. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20991. }
  20992. ,
  20993. n.prototype.setBurnsDir = function() {
  20994. var e = this.playerControls.cameras[a.PANORAMA]
  20995. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20996. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20997. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20998. n.y = h.constrainedTurn(n.y),
  20999. this.burnsDir = Math.sign(n.y)
  21000. }
  21001. ,
  21002. n.prototype.stepWarpPath = function(e, t) {
  21003. var i = this.playerControls.cameras[a.PANORAMA];
  21004. if (!this.warpPathPoints)
  21005. return i.position.copy(this.warpDestPano.position),
  21006. !0;
  21007. var n = this.warpPathPoints[0]
  21008. , o = this.warpDestPano.position;
  21009. if (null !== this.nodes && this.cameraHull.length > 1) {
  21010. var s = new r.Vector3;
  21011. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  21012. i.position.copy(s)
  21013. } else
  21014. e < .5 ? i.position.copy(n) : i.position.copy(o)
  21015. }
  21016. ,
  21017. n.prototype.interruptAndFastForward = function(e, t) {
  21018. this.warping && (this.warpInterrupted = !0,
  21019. this.warpInterruptionBlackoutStyle = e,
  21020. this.warpInterruptionTravelTime = t,
  21021. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  21022. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  21023. }
  21024. ,
  21025. n.prototype.warpCameraAim = function(e) {
  21026. var t = c.warp.minWarpTime;
  21027. if (this.upcomingTransType === l.BLACK)
  21028. t = c.warp.teleportTime;
  21029. else {
  21030. var i = this.playerControls.cameras[a.PANORAMA]
  21031. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  21032. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  21033. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  21034. s.y = h.constrainedTurn(s.y);
  21035. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  21036. t = Math.max(t, u)
  21037. }
  21038. var d = function() {
  21039. this._warpStopFlying(),
  21040. this.discardSlow(),
  21041. e && e()
  21042. }
  21043. .bind(this);
  21044. this._warpCameraAim(t, d)
  21045. }
  21046. ,
  21047. n.prototype.warpCommonParameters = function(e, t, i, n) {
  21048. this.model.skybox.material.uniforms.blackout.value = n;
  21049. var r = u.uniform(this.model.skybox, "progress", 1)
  21050. , o = u.allUniforms(this.model.chunks, "progress", 1)
  21051. , a = !1
  21052. , s = function() {
  21053. if (this.warpInterrupted)
  21054. return a = !0,
  21055. !0
  21056. }
  21057. .bind(this)
  21058. , l = function(e, t) {
  21059. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  21060. !0) : void r(e, t)
  21061. }
  21062. .bind(this)
  21063. , h = function(e, t) {
  21064. return i && a ? (o(0),
  21065. !0) : void o(e, t)
  21066. }
  21067. .bind(this);
  21068. p.start(s, e, null, t, null, "safeHaltWatch"),
  21069. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  21070. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  21071. }
  21072. ,
  21073. n.prototype.warpTravel_STD = function(e) {
  21074. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  21075. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  21076. w += this.warpLength * c.warp.timePerMeter,
  21077. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  21078. var _ = !1
  21079. , T = this.warpDestHeroLoc.quaternion
  21080. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  21081. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  21082. , M = S.dot(x)
  21083. , R = r.Math.radToDeg(Math.acos(M))
  21084. , P = function(e) {
  21085. var t = o
  21086. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  21087. return i
  21088. }
  21089. , O = function() {
  21090. return E.lookAt(C, t, A.UP),
  21091. s.setFromRotationMatrix(E, c.warp.eOrder),
  21092. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21093. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21094. h.constrainedTurn(b.y)
  21095. }
  21096. .bind(this)
  21097. , L = function(e, t) {
  21098. if (this.warpInterrupted)
  21099. return _ = !0,
  21100. !0
  21101. }
  21102. .bind(this)
  21103. , D = function(e, t) {
  21104. return _ || !this.warpPathPoints ? (g.blur(0),
  21105. !0) : void g.blur(e)
  21106. }
  21107. .bind(this)
  21108. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  21109. , B = function(e, t) {
  21110. return _ || !this.warpPathPoints ? (N(0),
  21111. !0) : void N(e, t)
  21112. }
  21113. .bind(this)
  21114. , F = function(e, t) {
  21115. if (!this.warpPathPoints)
  21116. return n.position.copy(this.warpDestPano.position),
  21117. !0;
  21118. if (_)
  21119. return !0;
  21120. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  21121. n.position.copy(i),
  21122. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  21123. }
  21124. .bind(this)
  21125. , V = function(e, n) {
  21126. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  21127. !0)
  21128. }
  21129. .bind(this)
  21130. , U = function(e, o) {
  21131. if (_)
  21132. return y.debug(">>>> Walkthrough interupted at t=" + e),
  21133. !0;
  21134. if (!this.warpPathPoints)
  21135. return !0;
  21136. var a = this.warpLength * e
  21137. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  21138. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  21139. c.warp.matchCam && (l *= 1 - u),
  21140. E.lookAt(C, t, A.UP),
  21141. s.setFromRotationMatrix(E, c.warp.eOrder),
  21142. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21143. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21144. b.y = h.constrainedTurn(b.y),
  21145. s.x = m.x + l * b.x,
  21146. s.y = m.y + l * b.y,
  21147. s.z = m.z + l * b.z,
  21148. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  21149. b.y = h.constrainedTurn(b.y);
  21150. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  21151. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  21152. v.x = v.x + b.x * c.warp.turnFriction,
  21153. v.y = v.y + b.y * c.warp.turnFriction,
  21154. v.z = v.z + b.z * c.warp.turnFriction,
  21155. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  21156. var p = t.clone().sub(C).normalize();
  21157. if (R < c.warp.maxAimRotation && u > 0) {
  21158. var g = 1 - u;
  21159. p.x = p.x * g + u * S.x,
  21160. p.y = p.y * g + u * S.y,
  21161. p.z = p.z * g + u * S.z,
  21162. p.normalize()
  21163. }
  21164. this.bunnyObj.position.copy(n.position).add(p),
  21165. f.set(0, 0, -1).applyEuler(v).normalize(),
  21166. f.multiplyScalar(8),
  21167. f.add(n.position),
  21168. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  21169. n.controls.lookVector.copy(f),
  21170. n.lookAt(f))
  21171. }
  21172. .bind(this)
  21173. , k = function() {
  21174. _ ? (this.discardSlow(),
  21175. this.upcomingTransType = l.BLACK,
  21176. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21177. }
  21178. .bind(this);
  21179. V(0);
  21180. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21181. w += H;
  21182. var G = H / w;
  21183. this.warpCommonParameters(w, G, !0, I.NONE),
  21184. p.start(L, w, null, 0, null, "_haltWatcher"),
  21185. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21186. p.start(D, w, null, G, P, "blurring")),
  21187. p.start(B, w, null, G, P, "modelAlpha"),
  21188. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21189. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21190. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21191. }
  21192. ,
  21193. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21194. var r = e || 0;
  21195. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21196. updateVideo({type:"beforeFlytopano", pano : player.currentPano, dur:t})//add
  21197. if(momentTourBlackNewType){
  21198. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  21199. var camera = this.playerControls.cameras[a.PANORAMA];
  21200. var end = this.warpDestHeroLoc.position
  21201. camera.position.copy(end)
  21202. setTimeout(()=>{
  21203. player.sceneRenderer.effects.transitionMaskPass.stop()
  21204. updateVideo({type:"flyDone", pano : player.currentPano})//add
  21205. this.wrapupWarpShadingOnly(n, i);
  21206. },t)
  21207. }else{
  21208. var o = function() {
  21209. this.wrapupWarpShadingOnly(n, i);
  21210. updateVideo({type:"flyDone", pano:player.currentPano})//add
  21211. }
  21212. .bind(this);
  21213. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21214. }
  21215. this.warpCommonParameters(t, r, !1, i)
  21216. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21217. if(window.momentTourBlackNewType){
  21218. e.material.uniforms.blackout.value = 5//i 改
  21219. //e.material.defines.newBlack = ''
  21220. //e.material.needsUpdate = true
  21221. }else{
  21222. e.material.uniforms.blackout.value = i
  21223. }
  21224. }),
  21225. this._warpBendAim(null, t, null, r);
  21226. }
  21227. ,
  21228. n.prototype.flightStepWalk = function(e, t, i) {
  21229. var n = .001
  21230. , o = 1
  21231. , a = 1.2
  21232. , s = new r.Vector3
  21233. , h = new r.Vector3
  21234. , u = function(e, t) {
  21235. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21236. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21237. h.copy(A.FORWARD),
  21238. this.player.getDirection(h),
  21239. s.copy(t).sub(e.position).normalize();
  21240. var l = s.dot(h)
  21241. , u = Math.acos(l)
  21242. , d = u / r;
  21243. return d > n && (r *= d / n,
  21244. u < o && (r *= a)),
  21245. r
  21246. };
  21247. return function(e, t, i) {
  21248. if (this.warpInterrupted)
  21249. i && i();
  21250. else if (this.activeTransType !== l.WALK)
  21251. this._clearWarpShading(),
  21252. this._warpStopFlying(),
  21253. this.player.spider.draw(),
  21254. this.placeCpm(),
  21255. i && i();
  21256. else if (this.player.currentPano !== e) {
  21257. var n = {
  21258. pano: e,
  21259. lookAtPoint: t,
  21260. duration: null,
  21261. maxDistanceOverride: c.warp.walkMaxDist,
  21262. skipWarpingCheck: !1,
  21263. constantMoveSpeed: !0
  21264. };
  21265. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21266. n.zoomLevel = this.warpDestHeroLoc.zoom
  21267. }
  21268. n.duration = u.call(this, e, t),
  21269. this.player.nonInterruptingFlyToPano(n, i)
  21270. } else
  21271. i && i()
  21272. }
  21273. }(),
  21274. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21275. return this.flightStepWalk.bind(this, e, t, i)
  21276. }
  21277. ,
  21278. n.prototype.warpTravel_WALK = function() {
  21279. var e = [];
  21280. return function(t) {
  21281. var i = this.player.model.panos;
  21282. e.length = 0;
  21283. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21284. var s = this.nodes[a]
  21285. , l = i.get(s);
  21286. a === this.nodes.length - 1;
  21287. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21288. n && o || (e.push(s),
  21289. n = l)
  21290. }
  21291. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21292. var h = e.length
  21293. , u = i.get(e[h - 1])
  21294. , d = new Array(h + 1);
  21295. d[d.length - 1] = function() {
  21296. t && t()
  21297. }
  21298. .bind(this);
  21299. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21300. var g = e[p];
  21301. u = i.get(g);
  21302. var m = new r.Vector3;
  21303. this.getLookAtForWalkingTourNode(e, p, m),
  21304. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21305. p--
  21306. }
  21307. d[0]()
  21308. }
  21309. }(),
  21310. n.prototype.getLookAtForWalkingTourNode = function() {
  21311. var e = new r.Vector3
  21312. , t = new r.Vector3
  21313. , i = new r.Vector3
  21314. , n = new r.Vector3
  21315. , o = new r.Vector3
  21316. , a = .65
  21317. , s = .75
  21318. , l = .2
  21319. , c = .4
  21320. , h = .2
  21321. , u = 3;
  21322. return function(r, d, p) {
  21323. var f = r.length;
  21324. if (d >= f)
  21325. return !1;
  21326. var g = 1
  21327. , m = 1;
  21328. t.set(0, 0, 0),
  21329. o.set(0, 0, 0);
  21330. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21331. if (v = this.player.model.panos.get(r[A]),
  21332. this.getOrientationForWalkingTourNode(r, A, i),
  21333. A === d && e.copy(i),
  21334. n.copy(i),
  21335. A > d) {
  21336. var y = n.dot(e) < a;
  21337. g *= y ? l : s,
  21338. m *= y ? h : c
  21339. }
  21340. i.multiplyScalar(g),
  21341. t.add(i),
  21342. o.lerp(v.position, m)
  21343. }
  21344. return t.normalize(),
  21345. p.copy(o),
  21346. p.add(t),
  21347. !0
  21348. }
  21349. }(),
  21350. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21351. var n = e.length;
  21352. if (t >= n)
  21353. return !1;
  21354. if (t === n - 1)
  21355. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21356. else {
  21357. var r = this.player.model.panos.get(e[t])
  21358. , o = this.player.model.panos.get(e[t + 1]);
  21359. i.copy(o.position).sub(r.position)
  21360. }
  21361. return i.normalize(),
  21362. !0
  21363. }
  21364. ,
  21365. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21366. if (this.activeTransType = this.upcomingTransType,
  21367. this.lastTransType = this.activeTransType,
  21368. this.upcomingTransType = null,
  21369. !e) {
  21370. var r = function() {
  21371. this._wrapupTravel(n)
  21372. }
  21373. .bind(this)
  21374. , o = {
  21375. pano: this.warpDestPano,
  21376. lookAtPoint: null,
  21377. duration: null,
  21378. maxDistanceOverride: null,
  21379. skipWarpingCheck: !1
  21380. };
  21381. return void this.player.flyToPano(o, r)
  21382. }
  21383. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21384. this._clearWarpShading(),
  21385. this._warpStopFlying(),
  21386. this.player.spider.draw(),
  21387. this.placeCpm(),
  21388. n && n()
  21389. }
  21390. .bind(this)) : this.warpTravel_STD(n)
  21391. }
  21392. ,
  21393. n.prototype.startWarpState = function() {
  21394. this.warping = !0,
  21395. this.warpInterrupted = !1,
  21396. this.warpInterruptionBlackoutStyle = null,
  21397. this.warpInterruptionTravelTime = null
  21398. }
  21399. ,
  21400. n.prototype.endWarpState = function() {
  21401. this.warping = !1
  21402. }
  21403. ,
  21404. n.prototype.warpToPano = function(e, t, i, n) {
  21405. if (this.warping)
  21406. return void y.warn("Cannot warp when already warping");
  21407. if (this.upcomingTransType = e,
  21408. this.activeTransType = null,
  21409. !this.setWarpDestPano())
  21410. return this.upcomingTransType = null,
  21411. void this.warpToNonPano(n);
  21412. if (this.player.mode !== a.PANORAMA)
  21413. return this.upcomingTransType = null,
  21414. this.discardSlow(),
  21415. void this.player.flyToNewMode({
  21416. mode: a.PANORAMA,
  21417. pano: this.warpDestPano,
  21418. duration: c.warp.outsideTime,
  21419. warpDest: this.warpDestHeroLoc,
  21420. callback: n,
  21421. force: !0
  21422. });
  21423. if (!this.warpDestPano)
  21424. return y.warn("no warp destination, callback dropped"),
  21425. void (this.upcomingTransType = null);
  21426. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  21427. , o = this.chooseWarpPath(r);
  21428. if (o && this.upcomingTransType !== l.WALK) {
  21429. var s = function() {
  21430. this.waitingToWarp = !1,
  21431. this.warpToPano(e, t, i, n)
  21432. }
  21433. .bind(this);
  21434. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21435. return void (this.waitingToWarp = !0)
  21436. }
  21437. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21438. this.player.currentPano = this.warpDestPano,
  21439. this.placeCpm(),
  21440. this.fadeOutCpm(c.path.fadeOutTime),
  21441. this.player.spider.draw()),
  21442. y.debug("Warping to pano ", this.warpDestPano.position),
  21443. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21444. this.startWarpState();
  21445. var h = function() {
  21446. this.endWarpState(),
  21447. n && n()
  21448. }
  21449. .bind(this);
  21450. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21451. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21452. }
  21453. ,
  21454. t.exports = n
  21455. }
  21456. ).call(this, "/js/objects/ShowPath.js")
  21457. }
  21458. , {
  21459. "../constants": 8,
  21460. "../effects": 16,
  21461. "../enum/BlackoutStyle": 18,
  21462. "../enum/ModelManagerEvents": 33,
  21463. "../enum/PlayerEvents": 40,
  21464. "../enum/RenderOrder": 42,
  21465. "../enum/Vectors": 50,
  21466. "../enum/Viewmode": 51,
  21467. "../enum/WarpStyle": 52,
  21468. "../gui/gui": 65,
  21469. "../model/ModelManager": 140,
  21470. "../objects/Snapshot": 153,
  21471. "../settings": 166,
  21472. "../shaders": 167,
  21473. "../util/easing": 186,
  21474. "../util/lerp": 188,
  21475. "../util/logger": 189,
  21476. "../util/math": 190,
  21477. "../util/texture": 194,
  21478. "../util/transitions": 195,
  21479. three: 217
  21480. }],
  21481. 152: [function(e, t, i) {
  21482. "use strict";
  21483. function n() {
  21484. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21485. , t = new r.RawShaderMaterial({
  21486. fragmentShader: o.skysphere.fragmentShader,
  21487. vertexShader: o.skysphere.vertexShader,
  21488. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21489. side: r.BackSide,
  21490. name: "skysphere"
  21491. });
  21492. t.uniforms.radius.value = e.parameters.radius,
  21493. r.Mesh.call(this, e, t)
  21494. }
  21495. var r = e("three")
  21496. , o = e("../shaders")
  21497. , a = e("../settings");
  21498. n.prototype = Object.create(r.Mesh.prototype),
  21499. n.prototype.constructor = n,
  21500. t.exports = n
  21501. }
  21502. , {
  21503. "../settings": 166,
  21504. "../shaders": 167,
  21505. three: 217
  21506. }],
  21507. 153: [function(e, t, i) {
  21508. (function(i) {
  21509. "use strict";
  21510. function n(e) {
  21511. o.call(this, e),
  21512. this.sid = e.sid,//xzw add
  21513. this.panoId = e.panoId,
  21514. this.orthoZoom = e.orthoZoom,
  21515. this.floorVisibility = e.floorVisibility,
  21516. this.thumbUrl = e.thumbUrl,
  21517. this.name = e.name,
  21518. this.zoom = e.zoom
  21519. }
  21520. var r = (e("three"),
  21521. e("../util/logger"))
  21522. , o = (e("../settings"),
  21523. e("../enum/Viewmode"),
  21524. e("../util/common"),
  21525. e("../util/transitions"),
  21526. e("../util/lerp"),
  21527. e("../util/ajax"),
  21528. e("../util/texture"),
  21529. e("./View"));
  21530. e("events").EventEmitter,
  21531. new r(i);
  21532. n.prototype = Object.create(o.prototype),
  21533. n.prototype.isPano = function() {
  21534. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21535. }
  21536. ,
  21537. t.exports = n
  21538. }
  21539. ).call(this, "/js/objects/Snapshot.js")
  21540. }
  21541. , {
  21542. "../enum/Viewmode": 51,
  21543. "../settings": 166,
  21544. "../util/ajax": 181,
  21545. "../util/common": 185,
  21546. "../util/lerp": 188,
  21547. "../util/logger": 189,
  21548. "../util/texture": 194,
  21549. "../util/transitions": 195,
  21550. "./View": 154,
  21551. events: 202,
  21552. three: 217
  21553. }],
  21554. 154: [function(e, t, i) {
  21555. (function(i) {
  21556. "use strict";
  21557. function n(e) {
  21558. e = e || {},
  21559. this.position = new r.Vector3,
  21560. this.quaternion = new r.Quaternion,
  21561. this.update(e)
  21562. }
  21563. var r = e("three")
  21564. , o = e("../util/logger")
  21565. , a = (e("../settings"),
  21566. e("../enum/Viewmode"),
  21567. e("../util/common"),
  21568. e("../util/transitions"),
  21569. e("../util/lerp"),
  21570. e("../util/ajax"),
  21571. e("../util/texture"),
  21572. e("events").EventEmitter);
  21573. new o(i);
  21574. n.prototype = Object.create(a.prototype),
  21575. n.prototype.isValid = function() {
  21576. return !!this.cameraMode
  21577. }
  21578. ,
  21579. n.prototype.update = function(e) {
  21580. return this.cameraMode = e.cameraMode || this.cameraMode,
  21581. this.pano = e.pano || this.pano,
  21582. e.position && this.position.copy(e.position),
  21583. e.quaternion && this.quaternion.copy(e.quaternion),
  21584. this
  21585. }
  21586. ,
  21587. t.exports = n
  21588. }
  21589. ).call(this, "/js/objects/View.js")
  21590. }
  21591. , {
  21592. "../enum/Viewmode": 51,
  21593. "../settings": 166,
  21594. "../util/ajax": 181,
  21595. "../util/common": 185,
  21596. "../util/lerp": 188,
  21597. "../util/logger": 189,
  21598. "../util/texture": 194,
  21599. "../util/transitions": 195,
  21600. events: 202,
  21601. three: 217
  21602. }],
  21603. 155: [function(e, t, i) {//player.js
  21604. (function(i) {
  21605. "use strict";
  21606. function n(e) {
  21607. this.currentPano = null,
  21608. this.nextPano = null,
  21609. this.camera = null,
  21610. this.paused = !1,
  21611. this.flying = !1,
  21612. this.sceneIntersectionPlane = null,
  21613. this.target = new r.Vector3,
  21614. this.mouse = new r.Vector3(1.1,1.1,.5),
  21615. this.mouseAtMouseDown = new r.Vector2,
  21616. this.mouseCouldBeClickToMove = !1,
  21617. this.mouseLastMoveTime = Date.now(),
  21618. this.mouseDown = !1,
  21619. this.mouseDownTimer = null,
  21620. this.couldBeLongTap = !1,
  21621. this.containsMouse = !1, //
  21622. this.isTouchEvent = !1,
  21623. this.isPanoHover = !1,
  21624. this.reticule = new a(this),
  21625. this.panoMarkers = [],
  21626. this.spider = new h(this),
  21627. this.quaternion = new r.Quaternion,
  21628. this.position = new r.Vector3(15,10,15),
  21629. this.previousState = null,
  21630. this.lastInsideView = new c,
  21631. this.last360View = new c,
  21632. this.raycaster = new r.Raycaster,
  21633. this.intersect = null,
  21634. this.lastChangeTime = Date.now(),
  21635. this.history = new I,
  21636. this.cameraControls = null,
  21637. this.path = null,
  21638. this.model = null,
  21639. this.domElement = null,
  21640. this.cachedPanoCandidates = null,
  21641. this.basePanoSize = 0,
  21642. this.standardPanoSize = 0,
  21643. this.highPanoSize = 0,
  21644. this.ultraHighPanoSize = 0,
  21645. this.zoomLevel = 1,
  21646. this.zooming = 0,
  21647. this.zoomSpeed = .5,
  21648. this.scrollZoomSpeed = .06,
  21649. this.zoomSpeedAdjust = .05,
  21650. this.defaultZoomIncrement = .2,
  21651. this.baseFov = f.insideFOV,
  21652. this.zoomFov = this.baseFov,
  21653. this.zoomEnabled = !0,
  21654. this.preRenderingEnabled = !1,
  21655. this.setupCustomProperties(e),
  21656. this.zoomStats = new L
  21657. }
  21658. var r = e("three")
  21659. , o = e("./util/logger")
  21660. , a = e("./objects/Reticule")
  21661. , s = e("./objects/Panorama")
  21662. , l = e("./objects/ShowPath")
  21663. , c = e("./objects/View")
  21664. , h = (e("./objects/Snapshot"),
  21665. e("./objects/NSpider"))
  21666. , u = e("./enum/Viewmode")
  21667. , d = (e("./enum/TagStates"),
  21668. e("./enum/Vectors"))
  21669. , p = e("./enum/Keys")
  21670. , f = (e("./enum/AlignmentType"),
  21671. e("./settings"))
  21672. , g = e("./util/common")
  21673. , m = (e("./util/browser"),
  21674. e("./util/math"))
  21675. , v = e("./util/lerp")
  21676. , A = e("./util/easing")
  21677. , y = e("./util/transitions")
  21678. , C = e("events").EventEmitter
  21679. , I = (e("./shaders"),
  21680. e("./util/history"))
  21681. , E = (e("./util/camera"),
  21682. e("./model/ModelManager"),
  21683. e("./enum/PathDiscardMode"))
  21684. , b = e("./enum/PathDisplayMode")
  21685. , w = e("./enum/PlayerEvents")
  21686. , _ = e("./enum/ControlEvents")
  21687. , T = e("./enum/ModelManagerEvents")
  21688. , x = e("./enum/WarpStyle")
  21689. , S = e("./enum/BlackoutStyle")
  21690. , M = e("./exception/BasicException")
  21691. , R = e("./enum/PanoSizeClass")
  21692. , P = (e("./tile/TileDownloader"),
  21693. e("./tile/TilePrioritizer"))
  21694. , O = (e("./enum/PanoramaEvents"),
  21695. e("./enum/ZoomEvents"))
  21696. , L = e("./util/ZoomStats")
  21697. , D = e("./constants")
  21698. , N = e("./util/common")
  21699. , B = e("./util/cameraLight")
  21700. , Hot = e('hot')
  21701. , F = new o(i)
  21702. , V = Object.freeze({
  21703. FlyToPano: y.getUniqueId(),
  21704. FlyToNewMode: y.getUniqueId(),
  21705. FlyToSameMode: y.getUniqueId(),
  21706. FlyToViewFloor: y.getUniqueId(),
  21707. LookTransition: y.getUniqueId(),
  21708. ZoomTransition: y.getUniqueId()
  21709. });
  21710. n.prototype = Object.create(C.prototype),
  21711. n.prototype.init = function(e) {
  21712. window.player = this
  21713. this.modelManager = e.modelManager,
  21714. this.tileDownloader = e.tileDownloader,
  21715. this.panoRenderer = e.panoRenderer,
  21716. this.qualityManager = e.qualityManager,
  21717. this.domElement = e.container,
  21718. this.camera = e.camera,
  21719. this.tagManager = e.tagManager,
  21720. this.cameraControls = e.controls,
  21721. this.path = new l(e.director,this,e.controls),
  21722. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21723. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21724. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21725. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21726. this.tileDownloader.processPriorityQueue = !1,
  21727. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21728. this.bindEvents(e.container),
  21729. this.updateModel()
  21730. }
  21731. //xzw add: 截图
  21732. function dataURLtoBlob(dataurl) {
  21733. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21734. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21735. while(n--){
  21736. u8arr[n] = bstr.charCodeAt(n);
  21737. };
  21738. return new Blob([u8arr], {type:mime});
  21739. }
  21740. n.prototype.screenShot = function(o){
  21741. if(this.flying || this.flyingToTag) return;
  21742. var R = this.sceneRenderer;
  21743. R.updateScreenSize(o);
  21744. for(var i in this.model.panos.index){
  21745. if(!this.model.panos.index[i].marker) continue;
  21746. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21747. this.model.panos.index[i].marker.visible = false;
  21748. }
  21749. for(var i in this.model.hots){
  21750. this.model.hots[i].mesh.visible = false;
  21751. }
  21752. this.reticule.visible = false;
  21753. this.reticule.forceUnvisible = true;
  21754. this.path.currentPanoMarker.mesh.visible = false;
  21755. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21756. R.renderer.clear(true,true,true);
  21757. R.renderer.render(R.scene, R.camera);
  21758. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21759. o.f && o.f(imgData)
  21760. R.updateScreenSize({resize:true});
  21761. this.reticule.visible = true;
  21762. for(var i in this.model.hots){
  21763. this.model.hots[i].mesh.visible = true;
  21764. }
  21765. for(var i in this.model.panos.index){
  21766. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21767. }
  21768. this.path.currentPanoMarker.mesh.visible = true;
  21769. R.renderer.render(R.scene, R.camera);
  21770. }.bind(this),30) //这个数字不能太小
  21771. }
  21772. var scaleImg = e("scaleImg");
  21773. var ResizeImg = function(img, option){
  21774. var img2; //不能直接改img 否则可能触发第二次img.onload
  21775. var compress = function(ratio,type){
  21776. var image = img2 || img;
  21777. var c = document.createElement('canvas');
  21778. c.width = image.width; c.height = image.height;
  21779. var ctx = c.getContext('2d');
  21780. ctx.drawImage(image,0,0,image.width,image.height);
  21781. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21782. }
  21783. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21784. var image = img2 || img;
  21785. var blob = dataURLtoBlob(image.src);
  21786. if(option.maxWeight && blob.size > option.maxWeight){
  21787. compress(option.maxWeight/blob.size, "jpeg")
  21788. blob = dataURLtoBlob(image.src);
  21789. }
  21790. if(!img2){
  21791. img2 = new Image();
  21792. }
  21793. img2.base64Src = image.src;
  21794. img2.src = window.URL.createObjectURL(blob);
  21795. }
  21796. var oldSize = Math.max(img.width, img.height);
  21797. if(option.toType != "png"){//不是非要png的话
  21798. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21799. if(oldSize > option.maxSize){
  21800. compress(option.maxSize/oldSize, "jpeg");
  21801. }
  21802. reCom();
  21803. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21804. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21805. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21806. reCom();
  21807. }
  21808. }
  21809. }else{
  21810. //?貌似png会越压缩越大?
  21811. }
  21812. return img2 || img;
  21813. }
  21814. var _fixType=function(type) {
  21815. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21816. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21817. return 'image/' + r;
  21818. };
  21819. var saveFile=function(data, filename){
  21820. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21821. save_link.href = data;
  21822. save_link.download = filename;
  21823. var event = document.createEvent('MouseEvents');
  21824. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21825. save_link.dispatchEvent(event);
  21826. };
  21827. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21828. var info = this.getSnapAngleInfo();
  21829. var str = ',{\r\t' + info;
  21830. var arg = arguments[0];
  21831. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21832. if (arg && arg.__callback) {
  21833. return arg.__callback(imgData, info)
  21834. }
  21835. var img = new Image();
  21836. img.src = imgData;
  21837. img.onload = function(){
  21838. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21839. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21840. var filename = "snap" + (new Date()).getTime();
  21841. saveFile(img2.src,filename + ".jpg");
  21842. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21843. str +=('\r\t"sid":"'+filename+'",');
  21844. str +=('\r\t"name":"'+filename+'"\r}');
  21845. logData(str)
  21846. }
  21847. }});
  21848. }
  21849. ,
  21850. n.prototype.getSnapAngleInfo = function(){
  21851. var info = {};
  21852. var str = '"metadata":{';
  21853. var q = this.camera.quaternion.clone();
  21854. switch (this.mode) {
  21855. case "panorama":
  21856. info.scan_id = this.currentPano.id;
  21857. str += ('"scan_id":"'+this.currentPano.id+'",');
  21858. break;
  21859. case "floorplan":
  21860. info.camera_mode = 1;
  21861. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21862. q.multiply(this.camera.quaternion);
  21863. str += ('"camera_mode":1,');
  21864. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21865. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21866. break;
  21867. case "dollhouse":
  21868. info.camera_mode = 2;
  21869. str += ('"camera_mode":2,');
  21870. break;
  21871. }
  21872. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21873. console.log(info.camera_position)
  21874. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21875. /**fyz 对相机截屏的角度进行校对 */
  21876. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21877. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21878. out.x *= -1;
  21879. out.w *= -1;
  21880. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21881. }else{
  21882. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21883. }
  21884. info.zoom = this.zoomLevel;
  21885. console.log(info.camera_quaternion)
  21886. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21887. // fyz 扩展编辑页面, 加上导览点缩放值
  21888. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21889. return str;
  21890. }
  21891. //------end
  21892. n.prototype.closePopup = function() {//xzw 关闭热点页面
  21893. if(!g_currentHot) return;
  21894. g_currentHot = null;
  21895. var hotPop = document.getElementById('popup');
  21896. hotPop.style.display = "none";
  21897. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  21898. $("#popup iframe:last").remove();
  21899. var _bgaudio = document.getElementById("bgaudio");
  21900. try{
  21901. window.parent.postMessage("closeHot",'*')
  21902. }catch(e){
  21903. console.log(e)
  21904. }
  21905. //判断音乐是否暂停或者是否存在
  21906. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  21907. {
  21908. //g_bgAudio.play();
  21909. manage.switchBgmState(true)
  21910. }; */
  21911. if(g_bgAudio && g_bgAudio.pauseByHot){
  21912. manage.switchBgmState(true)
  21913. }
  21914. playMusic(player.currentPano)
  21915. //$('#player').off("click",this.closePopup);
  21916. return false
  21917. }
  21918. n.prototype.setupCustomProperties = function(e) {
  21919. var t = e || u.PANORAMA;
  21920. Object.defineProperty(this, "mode", {
  21921. get: function() {
  21922. return t
  21923. },
  21924. set: function(e) {
  21925. var i = t;
  21926. t = e,
  21927. this.onModeUpdated(i, t)
  21928. }
  21929. })
  21930. }
  21931. ,
  21932. n.prototype.isInMode = function() {
  21933. for (var e = 0; e < arguments.length; e++)
  21934. if (this.mode === arguments[e])
  21935. return !0;
  21936. return !1
  21937. }
  21938. ,
  21939. n.prototype.isOutsideMode = function(e) {
  21940. return e = e || this.mode,
  21941. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21942. }
  21943. ,
  21944. n.prototype.is360View = function(e, t) {
  21945. return e === u.PANORAMA && t && !t.isAligned()
  21946. }
  21947. ,
  21948. n.prototype.setScene = function(e) {
  21949. this.sceneIntersectionPlane = e.plane,
  21950. this.path.setScene(e),
  21951. this.moveReticuleToScene(e)
  21952. }
  21953. ,
  21954. n.prototype.moveReticuleToScene = function(e) {
  21955. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21956. e.add(this.reticule)
  21957. }
  21958. ,
  21959. n.prototype.updateModel = function() {
  21960. function e(e, t, n) {
  21961. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21962. }
  21963. function t(e, t) {
  21964. if (this.mode === u.DOLLHOUSE) {
  21965. var n = e ? this.model.center.y : n = t.center.y;
  21966. i.call(this, n)
  21967. }
  21968. }
  21969. function i(e) {
  21970. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21971. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21972. , n = t.position.y + (e - i.target.y)
  21973. , r = f.showFloorDuration + f.showFloorDelay;
  21974. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21975. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21976. }
  21977. this.model = this.modelManager.getActiveModel(),
  21978. this.model.on("floor.changed", e.bind(this)),
  21979. this.model.on("allfloors.toggled", t.bind(this)),
  21980. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21981. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21982. var e2 = this;
  21983. this.model.panos.list.forEach(function(a) {
  21984. a.vrMarker.addEventListener("click", function() {
  21985. e2.flyToPano({
  21986. pano: a
  21987. })
  21988. })
  21989. })
  21990. /********************************************************************************************************************************************/
  21991. }
  21992. ,
  21993. n.prototype.updateModelDependentData = function() {
  21994. this.cameraControls.setModelForControls(this.model),
  21995. this.getPanoMarkersFromModel(this.model)
  21996. }
  21997. ,
  21998. n.prototype.onModelChanged = function() {
  21999. this.updateModel(),
  22000. this.updateModelDependentData()
  22001. }
  22002. ,
  22003. n.prototype.getPanoMarkersFromModel = function(e) {
  22004. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  22005. return t.marker ? e.concat(t.marker) : e
  22006. }, [])
  22007. }
  22008. ,
  22009. n.prototype.handleControlMove = function(e) {
  22010. this.emit(w.Move, e)
  22011. }
  22012. ,
  22013. n.prototype.handleControlInputStart = function(e) {
  22014. this.emit(w.InputStart, e)
  22015. }
  22016. ,
  22017. n.prototype.onModeUpdated = function(e, t) {
  22018. this.cameraControls.activateControls(t),
  22019. this.emit(w.ModeChanged, e, t)
  22020. }
  22021. ,
  22022. n.prototype.isWarping = function() {
  22023. return this.path.warping
  22024. }
  22025. ,
  22026. n.prototype.isWaitingToWarp = function() {
  22027. return this.path.waitingToWarp
  22028. }
  22029. ,
  22030. n.prototype.getLabelScaleFactor = function() {
  22031. if (this.isOutsideMode()) {
  22032. var e = 10
  22033. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  22034. return t
  22035. }
  22036. return .5
  22037. }
  22038. ,
  22039. n.prototype.changeMusic = function() {//xzw add
  22040. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  22041. g_playAudio = g_bgAudio;
  22042. //g_bgAudio.play();
  22043. manage.switchBgmState(true)
  22044. }else{
  22045. if(!g_play){
  22046. g_playAudio = g_bgAudio;
  22047. }else{//防止再次播放时重播一遍
  22048. g_playAudio = null;
  22049. }
  22050. } */
  22051. /* if(!this.director.tourIsPlaying && g_bgAudio){
  22052. manage.switchBgmState(true)
  22053. } */
  22054. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  22055. }
  22056. ,
  22057. n.prototype.bindEvents = function(e) {
  22058. e !== document && e.setAttribute("tabindex", -1),
  22059. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  22060. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  22061. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  22062. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  22063. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  22064. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  22065. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  22066. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  22067. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  22068. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  22069. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  22070. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  22071. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  22072. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  22073. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  22074. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  22075. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  22076. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  22077. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  22078. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  22079. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  22080. // lzb
  22081. window.getSeft && getSeft(this);
  22082. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  22083. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  22084. $('#closepop').on("touchstart",this.closePopup.bind(this));
  22085. }else{
  22086. $('#closepop').on("click",this.closePopup.bind(this));
  22087. }
  22088. }
  22089. ,
  22090. n.prototype.onMouseDown = function(e) {
  22091. e.currentTarget !== document && e.currentTarget.focus(),
  22092. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  22093. this.updateIntersect())
  22094. }
  22095. ,
  22096. n.prototype.onMouseMove = function(e) {
  22097. this.isTouchEvent = !1,
  22098. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  22099. }
  22100. ,
  22101. n.prototype.onMouseOver = function(e) {
  22102. this.containsMouse = !0,
  22103. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  22104. }
  22105. ,
  22106. n.prototype.onMouseOut = function(e) {
  22107. this.containsMouse = !1
  22108. }
  22109. ,
  22110. n.prototype.onMouseUp = function(e) {
  22111. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  22112. }
  22113. ,
  22114. n.prototype.onTouchStart = function(e) {
  22115. if (e.currentTarget !== document && e.currentTarget.focus(),
  22116. !this.mouseDown) {
  22117. this.couldBeLongTap = !0;
  22118. var t = g.average(e.changedTouches, "clientX")
  22119. , i = g.average(e.changedTouches, "clientY");
  22120. this.handleInputStart.call(this, t, i, !0),
  22121. this.mouseDownTimer = setTimeout(function() {
  22122. this.updateIntersect(),
  22123. this.handleInputEnd.call(this, t, i, !0)
  22124. }
  22125. .bind(this), f.input.longTapThreshold)
  22126. }
  22127. }
  22128. ,
  22129. n.prototype.onTouchMove = function(e) {
  22130. var t = g.average(e.changedTouches, "clientX")
  22131. , i = g.average(e.changedTouches, "clientY");
  22132. this.handleInputMove.call(this, t, i, !0)
  22133. }
  22134. ,
  22135. n.prototype.onTouchEnd = function(e) {
  22136. if (clearTimeout(this.mouseDownTimer),
  22137. this.mouseDown) {
  22138. this.couldBeLongTap = !1,
  22139. this.updateIntersect();
  22140. var t = g.average(e.changedTouches, "clientX")
  22141. , i = g.average(e.changedTouches, "clientY");
  22142. this.handleInputEnd.call(this, t, i, !0)
  22143. }
  22144. }
  22145. ,
  22146. n.prototype.onPointerDown = function(e) {
  22147. return e.currentTarget !== document && e.currentTarget.focus(),
  22148. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  22149. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  22150. void (this.mouseDownTimer = setTimeout(function() {
  22151. this.updateIntersect(),
  22152. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  22153. }
  22154. .bind(this), f.input.longTapThreshold)))
  22155. }
  22156. ,
  22157. n.prototype.onPointerMove = function(e) {
  22158. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  22159. }
  22160. ,
  22161. n.prototype.onPointerUp = function(e) {
  22162. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  22163. this.couldBeLongTap = !1,
  22164. this.updateIntersect(),
  22165. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  22166. }
  22167. ,
  22168. n.prototype.onPointerOut = function(e) {
  22169. this.mouseDown = !1
  22170. }
  22171. ,
  22172. n.prototype.onPointerCancel = function(e) {
  22173. this.mouseDown = !1
  22174. }
  22175. ,
  22176. n.prototype.onKeyDown = function(e) {
  22177. var t = function() {
  22178. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  22179. }
  22180. .bind(this)
  22181. , i = e.which;
  22182. switch (i) {
  22183. case p.F:
  22184. t(),
  22185. this.changeFloor(-1);
  22186. break;
  22187. case p.R:
  22188. t(),
  22189. this.changeFloor(1)
  22190. }
  22191. if (this.mode === u.PANORAMA)
  22192. switch (i) {
  22193. case p.UPARROW:
  22194. case p.W:
  22195. this.flyLocalDirection(d.FORWARD.clone());
  22196. break;
  22197. case p.DOWNARROW:
  22198. case p.S:
  22199. this.flyLocalDirection(d.BACK.clone());
  22200. break;
  22201. case p.A:
  22202. this.flyLocalDirection(d.LEFT.clone());
  22203. break;
  22204. case p.D:
  22205. this.flyLocalDirection(d.RIGHT.clone())
  22206. }
  22207. }
  22208. ,
  22209. n.prototype.handleScrollPinchZoom = function() {
  22210. return function(e) {
  22211. var t = e
  22212. , i = this.zoomLevel;
  22213. this.zoomBy(t),
  22214. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22215. }
  22216. }(),
  22217. n.prototype.handleControlPinch = function(e) {
  22218. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22219. }
  22220. ,
  22221. n.prototype.handleControlScroll = function(e) {
  22222. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22223. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22224. }
  22225. ,
  22226. n.prototype.handleInputStart = function(e, t, i) {
  22227. //许钟文加
  22228. var pad = this.handelPadding(e, t);
  22229. e = pad.x;
  22230. t = pad.y;
  22231. this.isTouchEvent = i,
  22232. m.convertScreenPositionToNDC(e, t, this.mouse),
  22233. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22234. this.mouseCouldBeClickToMove = !0,
  22235. this.mouseDown = !0;
  22236. if (this.mouseCouldBeClickToMove) {
  22237. //window.DownInterface && new DownInterface().state(this,Hot);
  22238. window.Hotpoint && new Hotpoint().state(this,Hot);
  22239. }
  22240. if(!this.overlayInitedPlay /* && !settings.isEdit */ && this.overlayGroup.children.length){
  22241. this.overlayGroup.children.forEach((overlay)=>{
  22242. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  22243. })
  22244. this.overlayInitedPlay = true
  22245. playVideo()//add
  22246. }
  22247. /* this.overlayGroup.children.forEach((overlay)=>{
  22248. overlay.overlayType == "video" && overlay.visible && overlay.inSight() && overlay.videoControl(true)
  22249. }) */
  22250. }
  22251. ,
  22252. n.prototype.handelPadding = function(x, y) {
  22253. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22254. if (!this.pad)
  22255. this.pad = {
  22256. x: dom.getOffset("left", $("#player")[0]),
  22257. y: dom.getOffset("top", $("#player")[0])
  22258. }
  22259. return {
  22260. x: x - this.pad.x,
  22261. y: y - this.pad.y
  22262. }
  22263. }
  22264. n.prototype.handleInputMove = function(e, t, i) {
  22265. //许钟文加
  22266. var pad = this.handelPadding(e, t);
  22267. e = pad.x;
  22268. t = pad.y;
  22269. this.isTouchEvent = i,
  22270. m.convertScreenPositionToNDC(e, t, this.mouse),
  22271. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22272. this.couldBeLongTap = !1,
  22273. clearTimeout(this.mouseDownTimer)),
  22274. this.mouseLastMoveTime = Date.now(),
  22275. this.reticule.move(e, t, i)
  22276. }
  22277. ,
  22278. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22279. if (this.isTouchEvent = i,
  22280. this.mouseDown = !1,
  22281. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22282. !i && this.couldBeLongTap)
  22283. return !0;
  22284. if (this.handleLongTap())
  22285. return !0;
  22286. if (this.mouseCouldBeClickToMove) {
  22287. if (this.flying)
  22288. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  22289. !0;
  22290. //add----
  22291. if(this.checkHotClick())//add
  22292. return !0;
  22293. if(checkSoundBtnClick(this.intersect))//add
  22294. return !0;
  22295. if(this.hoveringPlane){
  22296. this.clickOverlay(this.hoveringPlane)
  22297. return;
  22298. }
  22299. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22300. this.history.invalidate(),
  22301. this.intersect)
  22302. return this.flyToPanoClosestToMouse();
  22303. if (this.mode === u.PANORAMA) {
  22304. var n = this.closestPanoInDirection(this.getMouseDirection());
  22305. return n ? this.flyToPano({
  22306. pano: n
  22307. }) : this.bump(this.getMouseDirection())
  22308. }
  22309. }
  22310. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  22311. }
  22312. ,
  22313. n.prototype.handleLongTap = function() {
  22314. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22315. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22316. !0
  22317. }
  22318. ,
  22319. n.prototype.checktagClick = function() {
  22320. if (this.tagManager.intersectTag) {
  22321. var e = this.isTouchEvent
  22322. , t = this.tagManager.clickedOnTag(e, this);
  22323. return e || t || y.cancelById(V.LookTransition),
  22324. !0
  22325. }
  22326. if (this.tagManager.activeTag)
  22327. return this.tagManager.dismissActiveTag(),
  22328. !1
  22329. }
  22330. ,
  22331. n.prototype.rankedtagInDirection = function(e, t) {
  22332. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22333. }
  22334. ,
  22335. n.prototype.start = function(e) {
  22336. //-------------------
  22337. window.initOverlay(r)
  22338. this.model.loadOverlays()
  22339. loadVideo();//add
  22340. //-------------------
  22341. var t = e.mode
  22342. , i = e.pano
  22343. , n = e.position
  22344. , rr = e.quaternion
  22345. , o = e.tag
  22346. , a = e.quickstart
  22347. , s = $.Deferred();
  22348. this.updateModelDependentData(),
  22349. this.updateFromControls(),
  22350. this.findDefaultViews();
  22351. var l = this.is360View(t, i);
  22352. return !this.model.outsideAllowed() || l || a ? (updateVideo({type:"beforeFlyIn", pano:i, dur:0}),
  22353. this.startInside(i, n, rr, o, s)) : this.startOutside(e, s),
  22354. s.done(function(e) {
  22355. this.emit(w.Ready, l, e, o)
  22356. }
  22357. .bind(this)),
  22358. s.promise()
  22359. }
  22360. ,
  22361. n.prototype.startOutside = function(e, t) {
  22362. var i = e.mode
  22363. , n = e.pano
  22364. , r = e.position
  22365. , o = e.quaternion
  22366. , a = e.zoom
  22367. , s = e.floorVisibility
  22368. , l = e.tag;
  22369. this.emit(w.StartOutside, f[i].transitionTime),
  22370. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22371. y.cancelById(V.FlyToViewFloor),
  22372. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22373. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22374. }
  22375. ,
  22376. n.prototype.startInside = function(e, t, i, n, r) {
  22377. r = r || $.Deferred(),
  22378. this.currentPano = e;
  22379. var o = e && !e.isAligned();
  22380. if (t = o ? e.position : t || e.position,
  22381. i = i || e.quaternion,
  22382. e) {
  22383. var a = this.startInside.bind(this, e, t, i, n, r);
  22384. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22385. return
  22386. }
  22387. //add
  22388. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22389. this.updateHotVisible()
  22390. return this.mode = u.PANORAMA,
  22391. e.floor.enter(this.mode),
  22392. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22393. this.switchCameraMode(this.mode, i),
  22394. this.emit(w.StartInside, o),
  22395. r.resolve(!0),
  22396. r
  22397. }
  22398. ,
  22399. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22400. if (r = r || $.Deferred(),
  22401. this.dollhouseMode(),
  22402. !e)
  22403. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22404. r.resolve(!1),
  22405. r;
  22406. t = t || e.position;
  22407. var o = i || this.cameraControls.activeControl.camera.quaternion
  22408. , a = e.position;
  22409. return this.fitDollhouse(a, t, o),
  22410. setTimeout(function(t) {
  22411. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22412. var n = {
  22413. mode: u.PANORAMA,
  22414. pano: e,
  22415. quaternion: i,
  22416. callback: function() {
  22417. this.emit(w.FlyinFinished),
  22418. r.resolve(!0)
  22419. }
  22420. .bind(this)
  22421. };
  22422. this.flyToNewMode(n)
  22423. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22424. r
  22425. }
  22426. ,
  22427. n.prototype.checkAndWaitForPanoLoad = function() {
  22428. var e = {}
  22429. , t = {}
  22430. , i = 5e3
  22431. , n = function() {
  22432. for (var n in e)
  22433. if (e.hasOwnProperty(n) && e[n]) {
  22434. var r = performance.now() - t[n];
  22435. if (r < i)
  22436. return !0
  22437. }
  22438. return !1
  22439. };
  22440. return function(r, o, a, s, l, c, h, u, d, p) {
  22441. if (n())
  22442. return !0;
  22443. var f = function(t, i, n) {
  22444. N.delayOneFrame(function() {
  22445. e[t] = !1,
  22446. l && l(i, n)
  22447. }
  22448. .bind(this))
  22449. }
  22450. .bind(this, r.id)
  22451. , g = function(t, i) {
  22452. N.delayOneFrame(function() {
  22453. e[t] = !1,
  22454. c && c(i)
  22455. }
  22456. .bind(this))
  22457. }
  22458. .bind(this, r.id);
  22459. try {
  22460. return null !== u && void 0 !== u || (u = !0),
  22461. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  22462. e[r.id] && (t[r.id] = performance.now()),
  22463. e[r.id]
  22464. } catch (n) {
  22465. throw e[r.id] = !1,
  22466. t[r.id] = performance.now() - i,
  22467. n
  22468. }
  22469. }
  22470. }(),
  22471. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22472. if (!e)
  22473. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22474. return r && this.model.waitForLoad(e, function() {
  22475. return e.isLoaded(i)
  22476. }),
  22477. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22478. !0)
  22479. }
  22480. ,
  22481. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22482. var e = new r.Vector3;
  22483. return function(t, i, n, r, o, a, s, l) {
  22484. if (!t)
  22485. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22486. return e.copy(d.FORWARD),
  22487. this.getDirection(e),
  22488. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22489. return t.isLoaded(i)
  22490. }),
  22491. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22492. n && n(e, t)
  22493. }
  22494. .bind(this)).fail(function(e) {
  22495. r && r(e)
  22496. }
  22497. .bind(this)).progress(function(e, t, i) {
  22498. o && o(e, t, i)
  22499. }
  22500. .bind(this)),
  22501. !0)
  22502. }
  22503. }(),
  22504. n.prototype.switchCameraMode = function(e, t) {
  22505. var i = this.cameraControls.controls[e]
  22506. , n = i.camera;
  22507. switch (e) {
  22508. case u.PANORAMA:
  22509. n.position.copy(this.currentPano.position);
  22510. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22511. i.lookAt(o.add(n.position));
  22512. break;
  22513. case u.DOLLHOUSE:
  22514. /* var a = this.position.clone();
  22515. 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),
  22516. n.position.copy(a),
  22517. i.target.copy(this.target.clone().setY(this.model.center.y));
  22518. break; */
  22519. //for多楼层 且 让模型刚好适应屏幕
  22520. var box = this.model.boundingBox.clone();
  22521. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22522. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22523. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22524. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22525. console.log(boxSize.x,distance, boxSize.length() / 2)
  22526. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22527. if(this.mode === u.PANORAMA){
  22528. i.target.copy(this.model.center);
  22529. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22530. }else{
  22531. i.target.copy(this.target.clone().setY(this.model.center.y))
  22532. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22533. }
  22534. vec.multiplyScalar(distance )
  22535. n.position.copy(i.target.clone().add(vec))
  22536. break
  22537. case u.FLOORPLAN:
  22538. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22539. i.target.copy(this.model.center).setY(0),
  22540. i.zoomToContain(this.model.size),
  22541. i.rotateToView(this.model.size, this.getDirection())
  22542. }
  22543. i.update(0)
  22544. }
  22545. ,
  22546. n.prototype.update = function() {
  22547. var e = (new r.Vector3,
  22548. {})
  22549. , t = [];
  22550. return function(i) {
  22551. this.updatePersistentZooming(i),
  22552. this.updateFromControls(i),
  22553. this.getCurrentNodePanos(t)
  22554. if(this.hasChanged(e) ) {
  22555. this.lastChangeTime = Date.now(),
  22556. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22557. this.emit(w.ViewChanged),
  22558. this.intersectHot && this.intersectHot.showTitle()
  22559. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22560. }
  22561. if(e.cameraChanged){
  22562. //this.controlVideosPlay()
  22563. for(var i in this.model.hots){
  22564. this.model.hots[i].update(this.camera)
  22565. }
  22566. this.overlayGroup.children.forEach(overlay=>{
  22567. overlay.update()
  22568. })
  22569. }
  22570. this.model.supportsTiles && (this.updateTileDownloader(t),
  22571. this.updatePanoRenderer(t)),
  22572. this.updatePreRendering(t),
  22573. this.reticule.update(),
  22574. this.path.update(),
  22575. this.spider.update(),
  22576. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22577. this.updateControlLocks(),
  22578. this.model.supportsTiles && this.updateZoomPano()
  22579. }
  22580. }(),
  22581. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22582. var lastMode, lastPano;
  22583. return function(){
  22584. var mode = this.mode;
  22585. var pano = mode == "panorama" ? this.currentPano : "";
  22586. if(mode != "panorama" || pano != lastPano){
  22587. overlay.noBlock = null
  22588. }
  22589. this.overlayGroup.children.forEach((overlay)=>{
  22590. if(overlay.overlayType == "video" ){
  22591. var matrix = overlay.plane.matrixWorld;
  22592. var inSight = false;
  22593. var cameraDir = this.getDirection();
  22594. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22595. var vertexes = []
  22596. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22597. for(let i=0; i<4; i++){
  22598. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22599. vertexes.push(vertex)
  22600. if(overlay.noBlock == null){
  22601. if(!m.ifShelter(vertex)){
  22602. overlay.noBlock = true
  22603. }
  22604. inSight = true; break;
  22605. }else{
  22606. overlay.noBlock = true
  22607. }
  22608. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22609. inSight = true; break;
  22610. }
  22611. }
  22612. }
  22613. overlay.inSight = inSight
  22614. if(!inSight)overlay.plane.material.map.image.pause()
  22615. else overlay.plane.material.map.image.play()//maybe fail
  22616. }
  22617. })
  22618. lastMode = mode, lastPano = pano
  22619. }
  22620. }() */
  22621. n.prototype.updatePersistentZooming = function(e) {
  22622. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22623. }
  22624. ,
  22625. n.prototype.updateControlLocks = function() {
  22626. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22627. }
  22628. ,
  22629. n.prototype.updatePanoRenderer = function() {
  22630. var e = new r.Vector3;
  22631. return function(t) {
  22632. var i = this.nextPano || this.currentPano;
  22633. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22634. this.getDirection(e),
  22635. this.panoRenderer.updateDirection(e))
  22636. }
  22637. }(),
  22638. n.prototype.cleanupInactivePanos = function() {
  22639. var e = []
  22640. , t = [];
  22641. return function() {
  22642. e.length = 0,
  22643. e.push(this.currentPano),
  22644. this.nextPano && e.push(this.nextPano),
  22645. t.length = 0;
  22646. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22647. t.push(this.panoRenderer.activePanos[i]);
  22648. for (var n = 0; n < t.length; n++) {
  22649. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22650. r.id === e[a].id && (o = !1);
  22651. o && r.exit()
  22652. }
  22653. }
  22654. }(),
  22655. n.prototype.updatePreRendering = function() {
  22656. var e = {};
  22657. return function(t) {
  22658. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22659. var i = this.nextPano || this.currentPano;
  22660. if (i && t && t.length > 1) {
  22661. var n = t.findIndex(function(e) {
  22662. if (e.id === i.id)
  22663. return !0
  22664. });
  22665. if (n >= 0 && n + 1 < t.length) {
  22666. var r = t[n + 1];
  22667. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22668. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22669. window.setTimeout(function(t) {
  22670. e[t.id] = !1
  22671. }
  22672. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22673. }
  22674. .bind(this, r), f.tiling.panoPreRenderDelay),
  22675. e[r.id] = !0)
  22676. }
  22677. }
  22678. }
  22679. }
  22680. }(),
  22681. n.prototype.enablePreRendering = function() {
  22682. this.preRenderingEnabled = !0
  22683. }
  22684. ,
  22685. n.prototype.disablePreRendering = function() {
  22686. this.preRenderingEnabled = !1,
  22687. this.cleanupInactivePanos()
  22688. }
  22689. ,
  22690. n.prototype.updateTileDownloader = function() {
  22691. var e = new r.Vector3;
  22692. return function(t) {
  22693. var i = this.nextPano || this.currentPano;
  22694. i && (e.copy(d.FORWARD),
  22695. this.getDirection(e),
  22696. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22697. this.tileDownloader.processPriorityQueue = !0)
  22698. }
  22699. }(),
  22700. n.prototype.updateFromControls = function(e) {
  22701. null !== e && void 0 !== e || (e = 0),
  22702. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22703. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22704. this.position.copy(this.cameraControls.activeControl.camera.position),
  22705. this.target.copy(this.cameraControls.activeControl.target),
  22706. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22707. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22708. this.camera.position.copy(this.position),
  22709. this.camera.quaternion.copy(this.quaternion),
  22710. this.camera.updateMatrix(),
  22711. this.camera.updateMatrixWorld()
  22712. }
  22713. ,
  22714. n.prototype.hasChanged = function(e) {
  22715. /* if (!this.previousState)
  22716. return this.previousState = {
  22717. allFloorsVisible: this.model.allFloorsVisible,
  22718. position: this.position.clone(),
  22719. quaternion: this.quaternion.clone(),
  22720. mouse: this.mouse.clone(),
  22721. labelScaleFactor: this.getLabelScaleFactor(),
  22722. currentFloor: this.model.currentFloor,
  22723. projectionMatrix: this.camera.projectionMatrix.clone(),
  22724. worldMatrix: this.camera.matrixWorld.clone(),
  22725. mode: this.mode,
  22726. modelPosition: this.model.position.clone(),
  22727. modelCenter: this.model.center.clone(),
  22728. zoomLevel: this.zoomLevel
  22729. },
  22730. !0;
  22731. 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;
  22732. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22733. e.moved = !this.position.equals(this.previousState.position),
  22734. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22735. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22736. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22737. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22738. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22739. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22740. e.modeChanged = this.mode !== this.previousState.mode,
  22741. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22742. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22743. e.nextPanoActive = null !== this.nextPano,
  22744. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22745. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22746. this.previousState.position.copy(this.position),
  22747. this.previousState.quaternion.copy(this.quaternion),
  22748. this.previousState.mouse.copy(this.mouse),
  22749. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22750. this.previousState.currentFloor = this.model.currentFloor,
  22751. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22752. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22753. this.previousState.mode = this.mode,
  22754. this.previousState.modelPosition.copy(this.model.position),
  22755. this.previousState.modelCenter.copy(this.model.center),
  22756. this.previousState.zoomLevel = this.zoomLevel,
  22757. !t */
  22758. if (!this.previousState)
  22759. {
  22760. this.previousState = {
  22761. allFloorsVisible: this.model.allFloorsVisible,
  22762. position: this.position.clone(),
  22763. quaternion: this.quaternion.clone(),
  22764. mouse: this.mouse.clone(),
  22765. //labelScaleFactor: this.getLabelScaleFactor(),
  22766. currentFloor: this.model.currentFloor,
  22767. projectionMatrix: this.camera.projectionMatrix.clone(),
  22768. worldMatrix: this.camera.matrixWorld.clone(),
  22769. mode: this.mode,
  22770. modelPosition: this.model.position.clone(),
  22771. modelCenter: this.model.center.clone(),
  22772. zoomLevel: this.zoomLevel
  22773. };
  22774. return !0;
  22775. }
  22776. //许钟文改 分成相机是否改变cameraChanged 和其他
  22777. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  22778. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  22779. e.cameraChanged = !a;
  22780. /* if(!t){//主要判断相机是否旋转
  22781. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22782. }else e.cameraChanged2 = false */
  22783. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22784. e.moved = !this.position.equals(this.previousState.position),
  22785. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22786. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22787. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22788. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22789. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22790. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22791. e.modeChanged = this.mode !== this.previousState.mode,
  22792. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22793. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22794. e.nextPanoActive = null !== this.nextPano,
  22795. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22796. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22797. this.previousState.position.copy(this.position),
  22798. this.previousState.quaternion.copy(this.quaternion),
  22799. this.previousState.mouse.copy(this.mouse),
  22800. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22801. this.previousState.currentFloor = this.model.currentFloor,
  22802. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22803. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22804. this.previousState.mode = this.mode,
  22805. this.previousState.modelPosition.copy(this.model.position),
  22806. this.previousState.modelCenter.copy(this.model.center),
  22807. this.previousState.zoomLevel = this.zoomLevel;
  22808. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22809. return !t
  22810. }
  22811. ,
  22812. n.prototype.updateIntersect = function() {
  22813. var e = this.flying || this.isWarping()
  22814. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22815. , i = y.getById(V.LookTransition)
  22816. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22817. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  22818. this.intersect = this.getMouseIntersect(); //xzw change
  22819. this.intersect && this.updateClosestPano(this.intersect),
  22820. // this.intersect && console.log(this.intersect.point),
  22821. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22822. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22823. }
  22824. ,
  22825. n.prototype.checkHotClick = function() {
  22826. if(this.intersectHot){
  22827. this.intersectHot.examine(this)
  22828. /* g_touraudio.pause();
  22829. g_bgaudio = false;
  22830. document.getElementById("bgaudio").pause();
  22831. var sWidth = document.body.scrollWidth;
  22832. var sHeight = document.body.scrollHeight;
  22833. var pop1 = document.getElementById('popup');
  22834. pop1.style.display = "block";
  22835. var myElement = document.createElement("iframe");
  22836. myElement.src = g_HotMeshes[i].hotLink;
  22837. myElement.id = "id1";
  22838. myElement.allowTransparency = "true";
  22839. myElement.style.width = "100%";
  22840. myElement.style.height = "100%";
  22841. myElement.scrolling = "no";
  22842. var element=document.getElementById("id1");
  22843. if (typeof(element)== "undefined" || element == null){
  22844. document.getElementById("popup").appendChild(myElement);
  22845. }
  22846. var oClose = document.getElementById("closepop");
  22847. oClose.onclick = function() {
  22848. pop1.style.display = "none";
  22849. document.getElementById("popup").removeChild(document.getElementById("id1"));
  22850. $("#popup iframe:last").remove();
  22851. document.getElementById("bgaudio").play();
  22852. } */
  22853. return true;
  22854. }
  22855. },
  22856. n.prototype.getMouseDirection = function(e) {
  22857. e = e || this.mouse;
  22858. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22859. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22860. return i.sub(t).normalize()
  22861. }
  22862. ,
  22863. n.prototype.hoverOverlay = function(mesh){
  22864. if(!mesh){
  22865. this.hoveringPlane = null;
  22866. $("#player").css("cursor",this.currentCursor || "" );
  22867. }else{
  22868. var overlay = mesh.parent;
  22869. $("#player").css("cursor","pointer");
  22870. this.hoveringPlane = overlay;
  22871. return true;
  22872. }
  22873. },
  22874. n.prototype.clickOverlay = function(overlay){
  22875. if(this.openOverlay && !overlay)return;
  22876. if(overlay == window.videoPlane){
  22877. if(overlay.material.map.image.paused) playVideo(true)
  22878. else playVideo(false)
  22879. return
  22880. }
  22881. var plane = overlay.plane;
  22882. if(overlay.overlayType == "video"){
  22883. /* if(plane.material.map.image.paused) plane.material.map.image.play()
  22884. else plane.material.map.image.pause() */
  22885. overlay.switchPlay(!!overlay.pausedByUser)
  22886. }
  22887. /* if(window.EditOverlay &&EditOverlay.editing){
  22888. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22889. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22890. EditOverlay.endAddPlane();
  22891. EditOverlay.updateOverlayPanel(overlay)
  22892. EditOverlay.controlSelectOverlay(overlay)
  22893. return;
  22894. } */
  22895. },
  22896. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22897. e = e || this.mouse.clone(),
  22898. t = t || this.model.floors.reduce(function(e, t) {
  22899. return t.hidden ? e : e.concat(t.collider.children)
  22900. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22901. for(var i in this.model.hots){
  22902. t.push(this.model.hots[i].mesh);
  22903. }
  22904. window.videoPlane && t.push(window.videoPlane)
  22905. this.overlayGroup && (t = t.concat(this.overlayGroup.children.filter(e=>e.overlayType == "video")));
  22906. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22907. this.raycaster.set(i, this.getMouseDirection(e));
  22908. var n = this.raycaster.intersectObjects(t, true);//add true
  22909. // n[0] && console.log(n[0].point);
  22910. if(g_HotStatus=="add"){
  22911. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  22912. console.log(points[0]);
  22913. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  22914. }
  22915. this.intersectHot && this.intersectHot.hideTitle()
  22916. if (0 === n.length){
  22917. this.intersectHot = null; //add
  22918. if(g_HotStatus!="add") $("#player").css("cursor","");
  22919. return null;
  22920. }
  22921. var o = n[0];
  22922. if(o.object.type == "hotSprite"){ //add
  22923. this.intersectHot = o.object.belongHot;
  22924. this.intersectHot.showTitle()
  22925. this.intersectHot.actionType == 'noAction' || $("#player").css("cursor","pointer");
  22926. return;
  22927. }
  22928. this.intersectHot = null;
  22929. if(o.object == window.videoPlane){
  22930. this.hoveringPlane = window.videoPlane;
  22931. $("#player").css("cursor","pointer");
  22932. return
  22933. }
  22934. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  22935. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  22936. if (o.face) {
  22937. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  22938. var a = this.position.clone().sub(o.point);
  22939. a.dot(o.normal) < 0 && o.normal.negate(),
  22940. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22941. o.horizontal = o.normal.y > .8
  22942. }
  22943. // console.log(o.point);
  22944. return o
  22945. }
  22946. ,
  22947. n.prototype.updateClosestPano = function(e) {
  22948. var t = [s.filters.isPanoAligned()];
  22949. if (this.mode === u.PANORAMA) {
  22950. if (!this.currentPano)
  22951. return;
  22952. t.push(s.filters.not(this.currentPano)),
  22953. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22954. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22955. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22956. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22957. } else{
  22958. t.push((pano)=>{ // add
  22959. return this.checkHasNeighbor(pano)
  22960. })
  22961. t.push(s.filters.isOnVisibleFloor()),
  22962. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22963. }
  22964. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22965. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22966. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22967. this.closestPano = i) : this.isPanoHover = !1
  22968. }
  22969. ,
  22970. n.prototype.dollhouseMode = function(e, t) {
  22971. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22972. this.mode = u.DOLLHOUSE,
  22973. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22974. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22975. , n = new r.Vector3(15,10,15);
  22976. if (e && t) {
  22977. var o = d.FORWARD.clone().applyQuaternion(t)
  22978. , a = this.model.center.clone().sub(e)
  22979. , s = a.dot(o);
  22980. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22981. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22982. }
  22983. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22984. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22985. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22986. this.updateFromControls(),
  22987. this.model.alpha = 1,
  22988. this.model.skybox.material.uniforms.opacity.value = 0
  22989. }
  22990. ,
  22991. n.prototype.insideMode = function(e, t) {
  22992. var i = $.Deferred()
  22993. , n = t || null;
  22994. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22995. var r = [s.filters.isPanoAligned()];
  22996. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22997. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22998. this.flyToNewMode({
  22999. mode: u.PANORAMA,
  23000. pano: e,
  23001. callback: n
  23002. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  23003. } else {
  23004. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  23005. i.reject(o)
  23006. }
  23007. return i.promise()
  23008. }
  23009. ,
  23010. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  23011. //if(urlHasValue('oldEntry')){
  23012. //搬自一代。
  23013. var maxY = this.model.boundingBox.max.y;
  23014. var n = d.FORWARD.clone().applyQuaternion(i)
  23015. , i = n.clone().add(e);
  23016. this.cameraControls.activeControl.target.copy(i),
  23017. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  23018. //return;
  23019. /* //this.camera.position.copy(this.model.center);
  23020. //this.camera.updateMatrixWorld()
  23021. this.switchCameraMode("dollhouse", i) */
  23022. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  23023. //直接用一代的这个 效果和二代几乎一样,且不会甩
  23024. /* var n = d.FORWARD.clone().applyQuaternion(i);
  23025. this.cameraControls.activeControl.target.copy(n).add(e);
  23026. var o = d.RIGHT.clone().applyQuaternion(i)
  23027. , a = d.UP.clone()
  23028. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  23029. , l = this.model.boundingBox.max.clone()
  23030. , c = this.model.boundingBox.min.clone()
  23031. , 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)]
  23032. , u = 0
  23033. , p = 0
  23034. , g = 0;
  23035. h.forEach(function(e, t, i) {
  23036. var n = Math.abs(e.dot(o))
  23037. , r = e.dot(s);
  23038. n > u && (u = n,
  23039. p = r),
  23040. r > g && (g = r)
  23041. });
  23042. 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)))
  23043. , v = s.clone().multiplyScalar(p).add(t)
  23044. , A = s.clone().multiplyScalar(g).add(t);
  23045. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  23046. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  23047. p = Math.max(p, 10),
  23048. g = Math.max(g, 10);
  23049. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  23050. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  23051. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  23052. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  23053. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  23054. */
  23055. }
  23056. ,
  23057. n.prototype.floorplanMode = function(e, t, i) {
  23058. this.mode = u.FLOORPLAN;
  23059. var n = this.cameraControls.controls[u.FLOORPLAN];
  23060. n.reset();
  23061. var r = e ? e : this.model.center;
  23062. if (n.target.copy(r).setY(0),
  23063. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  23064. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  23065. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  23066. t) {
  23067. var o = d.LEFT.clone().applyQuaternion(t);
  23068. n.rotateLeft(-Math.atan2(o.x, o.z))
  23069. } else
  23070. n.rotateToView(this.model.size, this.getDirection());
  23071. n.update(0)
  23072. }
  23073. ,
  23074. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  23075. return e.skipWarpingCheck = !0,
  23076. this.flyToPano(e, t)
  23077. }
  23078. ,
  23079. n.prototype.updateMarkerVisi = function() {//加
  23080. if(this.mode != "panorama")return;
  23081. this.model.panos.list.forEach((pano)=>{
  23082. if(!pano.marker)return;
  23083. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  23084. })
  23085. }
  23086. ,
  23087. n.prototype.updateHotVisible = function(pano){
  23088. var hots = this.model.hots;
  23089. pano = pano || this.currentPano;
  23090. for (var index in hots){
  23091. var visible;
  23092. if(this.mode != "panorama"){
  23093. visible = true;
  23094. }else{
  23095. //hots[index].mesh.material.depthTest = false;
  23096. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  23097. }
  23098. hots[index].mesh.visible = visible;
  23099. }
  23100. }
  23101. n.prototype.flyToPano = function(e, t) {
  23102. var i = e.pano
  23103. , aim = e.lookAtPoint
  23104. , aimQua = e.quaternion //ADD
  23105. , o = e.duration
  23106. , a = e.aimDuration
  23107. , s = e.maxDistanceOverride
  23108. , l = e.skipWarpingCheck
  23109. , c = e.constantMoveSpeed
  23110. , h = null
  23111. , p = null
  23112. if (aim){
  23113. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  23114. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  23115. }
  23116. else aimQua = aimQua
  23117. var zoomLevel = e.zoomLevel || 1 //add
  23118. if(this.flying) return t && t(e)
  23119. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  23120. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  23121. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  23122. t && t(),
  23123. !1;
  23124. if (this.updateLastView(),
  23125. this.mode !== u.PANORAMA) {
  23126. var m;
  23127. void this.flyToNewMode({
  23128. mode: u.PANORAMA,
  23129. pano: i,
  23130. duration: o,
  23131. quaternion: aimQua ,
  23132. callback: t
  23133. })
  23134. }
  23135. if (!i || (h = g.deepExtend(e),
  23136. p = function() {
  23137. N.delayOneFrame(function() {
  23138. this.flyToPano(h, t)
  23139. }
  23140. .bind(this))
  23141. }
  23142. .bind(this),
  23143. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  23144. var C = function(e) {
  23145. t && t(e)
  23146. }
  23147. .bind(this);
  23148. this.currentPano || (this.currentPano = i,
  23149. this.path.placeCpm(),
  23150. this.path.fadeOutCpm(f.path.fadeOutTime),
  23151. this.spider.draw());
  23152. var I = o;
  23153. if ("number" != typeof o) {
  23154. var E = s || f.transition.flytimeMaxDistanceThreshold;
  23155. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  23156. }
  23157. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  23158. zoomLevel !== this.zoomLevel)
  23159. switch (f.zoom.transitionStyle) {
  23160. case 1:
  23161. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  23162. break;
  23163. case 2:
  23164. return h = g.deepExtend(e),
  23165. p = this.flyToPano.bind(this, h, t),
  23166. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  23167. }
  23168. if (aimQua) {
  23169. y.cancelById(V.LookTransition),
  23170. I *= f.transition.aimSlowFactor;
  23171. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  23172. , S = b.clone()
  23173. , M = new r.Vector3;
  23174. if (i === this.currentPano) {
  23175. var R = d.FORWARD.clone().applyQuaternion(b)
  23176. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  23177. , O = R.angleTo(P);
  23178. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  23179. void y.start(function(e) {
  23180. S.copy(b),
  23181. v.quaternion(S, aimQua)(e),
  23182. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23183. this.cameraControls.activeControl.lookAt(M)
  23184. }
  23185. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  23186. }
  23187. }
  23188. if (i === this.currentPano || this.flying)
  23189. return void C();
  23190. this.flying = !0;
  23191. var L = this.position.clone()
  23192. , D = this.currentPano;
  23193. F.debug("Flying to pano ", i.position),
  23194. this.emit(w.PanoChosen, this.currentPano, i),
  23195. this.emit(w.FlyingStarted, i.position, L, i, D)
  23196. //---------before fly--------------- add
  23197. this.updateHotVisible(i); //更新热点显示
  23198. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  23199. Overlay.updateVisibles([this.currentPano, i])
  23200. //地标变化
  23201. if(this.model.floorLogos){
  23202. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  23203. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  23204. //this.model.adjustfloorLogoHeight();
  23205. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  23206. this.model.floorLogos[1].visible = true;
  23207. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  23208. }
  23209. //=======================================
  23210. aimQua && y.start(function(e) {
  23211. S.copy(b),
  23212. v.quaternion(S, aimQua)(e),
  23213. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23214. this.cameraControls.activeControl.lookAt(M)
  23215. }
  23216. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  23217. var B = c ? null : A[f.transition.movementEasing];
  23218. this.nextPano = i
  23219. //===========================
  23220. updateVideo({type:"beforeFlytopano", pano:i, dur:I})//add
  23221. //===========================
  23222. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  23223. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  23224. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  23225. this.flying = !1,
  23226. this.currentPano !== i && this.currentPano.exit(),
  23227. i.enter(),
  23228. this.currentPano = i,
  23229. this.nextPano = null,
  23230. this.path.placeCpm(),
  23231. this.path.fadeOutCpm(f.path.fadeOutTime),
  23232. this.spider.draw(),
  23233. this.emit(w.FlyingEnded, i.position, L, i, D),
  23234. this.updateMarkerVisi(),//add
  23235. C(e)
  23236. //add:
  23237. if(this.mode == "panorama" ){
  23238. if(this.model.floorLogos){
  23239. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  23240. //this.model.adjustfloorLogoHeight()
  23241. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  23242. this.model.floorLogos[1].visible = false;
  23243. }
  23244. updateVideo({type:"flyDone", pano:i})//add
  23245. Overlay.updateVisibles([this.currentPano])//add
  23246. }
  23247. }
  23248. .bind(this), 0, B, "camFly", V.FlyToPano)
  23249. }
  23250. }
  23251. ,
  23252. window._transitionPosId = 9999
  23253. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23254. y.cancelById(_transitionPosId)
  23255. var begin = function(object, pos, qua, scale){
  23256. if(pos){
  23257. if(!same(object.position, pos, 0.01)){
  23258. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23259. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23260. }
  23261. if(qua && !same(object.quaternion, qua, 1e-6)){
  23262. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23263. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23264. }
  23265. if(scale && !same(object.scale, scale, 0.001)){
  23266. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23267. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23268. }
  23269. }
  23270. }
  23271. var same = function(vec1, vec2, diff){
  23272. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23273. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23274. return s
  23275. }
  23276. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23277. this.overlayGroup.children.forEach(overlay=>{
  23278. var panoData = overlay.transformAtPanos[sid]
  23279. var useCustom = !panoData
  23280. //if(overlay.usingTransformData || !useCustom){
  23281. var pos = useCustom ? overlay.posCustom : panoData.pos;
  23282. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  23283. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  23284. overlay.getScaleBySize(panoData.width , panoData.height)
  23285. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  23286. begin(overlay, pos, qua, scale )
  23287. //}
  23288. overlay.usingTransformData = !useCustom
  23289. })
  23290. for(let i in this.model.hots){//是否判断visible?
  23291. var hot = this.model.hots[i];
  23292. var panoData = hot.transformAtPanos[sid];
  23293. var useCustom = !panoData
  23294. //if(hot.usingTransformData || !useCustom){
  23295. var pos = useCustom ? hot.position : panoData.pos;
  23296. var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  23297. begin(hot.mesh, pos, qua )
  23298. //}
  23299. hot.usingTransformData = !useCustom;
  23300. }
  23301. }
  23302. window._tranOutsideFocus = 4399
  23303. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23304. console.log("focusPoint")
  23305. if(this.mode == "floorplan"){
  23306. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23307. var control = this.cameraControls.controls.floorplan;
  23308. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23309. var currentScale = control.absoluteScale;
  23310. var currentTarget = control.target.clone()
  23311. y.cancelById(window._tranOutsideFocus, true);
  23312. y.start(function(progress){
  23313. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23314. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23315. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23316. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23317. }else if(player.mode == "dollhouse"){
  23318. var control = player.cameraControls.controls.dollhouse;
  23319. var radius = o.radius || 8;
  23320. var currentTarget = control.target.clone()
  23321. var dir = control.offset.clone().normalize()
  23322. var currentRadius = control.offset.length();
  23323. y.cancelById(window._tranOutsideFocus, true);
  23324. y.start(function(progress){
  23325. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23326. let radius_ = radius*progress+currentRadius*(1-progress)
  23327. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23328. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23329. }else if(this.mode == 'panorama'){
  23330. this.flyToPano({
  23331. lookAtPoint: o.aim.clone() ,
  23332. pano: this.currentPano,
  23333. aimDuration: o.dur || 600
  23334. })
  23335. }
  23336. }
  23337. n.prototype.fastForwardActivePanoFlight = function(e) {
  23338. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  23339. y.adjustSpeed(V.FlyToPano, e),
  23340. y.adjustSpeed(V.LookTransition, e)
  23341. }
  23342. ,
  23343. n.prototype.flyToPanoClosestToMouse = function() {
  23344. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23345. this.intersect && this.updateClosestPano(this.intersect)),
  23346. this.closestPano)
  23347. return this.flyToPano({
  23348. pano: this.closestPano
  23349. });
  23350. var e = this.getMouseDirection();
  23351. this.flyDirection(e) || this.flyToPano({
  23352. pano: this.currentPano
  23353. })
  23354. }
  23355. ,
  23356. n.prototype.flyLocalDirection = function(e) {
  23357. var t = this.getDirection(e)
  23358. , i = 1 === e.z ? .4 : .75
  23359. , n = 1 === Math.abs(e.x);
  23360. return this.flyDirection(t, i, n)
  23361. }
  23362. ,
  23363. n.prototype.flyDirection = function(e, t, i) {
  23364. this.closePopup();//xzw add
  23365. var n = $.Deferred();
  23366. this.history.invalidate();
  23367. var r = this.closestPanoInDirection(e, t, i);
  23368. return r ? this.flyToPano({
  23369. pano: r
  23370. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23371. n.resolve(!1)),
  23372. n.promise()
  23373. }
  23374. ,
  23375. n.prototype.closestPanoInDirection = function(e, t, i) {
  23376. return this.rankedPanoInDirection(0, e, t, i)
  23377. }
  23378. ,
  23379. n.prototype.rankedPanoInDirection = function() {
  23380. var e = {
  23381. pano: null,
  23382. candidates: []
  23383. };
  23384. return function(t, i, n, r) {
  23385. t || (t = 0),
  23386. n = void 0 !== n ? n : .75;
  23387. var o = r ? "angle" : "direction";
  23388. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  23389. this.cachedPanoCandidates = e.candidates,
  23390. e.pano
  23391. }
  23392. }(),
  23393. n.prototype.bump = function(e) {
  23394. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23395. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  23396. if (s)
  23397. t = function() {
  23398. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23399. }
  23400. .bind(this),
  23401. i = function() {
  23402. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23403. }
  23404. .bind(this);
  23405. else {
  23406. var l = this.camera.position.clone()
  23407. , c = e.clone();
  23408. this.raycaster.set(l, c);
  23409. var h = this.model.floors.reduce(function(e, t) {
  23410. return e.concat(t.collider.children)
  23411. }, [])
  23412. , d = this.raycaster.intersectObjects(h)
  23413. , p = d.length > 0 ? d[0].distance / 25 : .04
  23414. , g = l.clone().add(c.multiplyScalar(p));
  23415. t = function() {
  23416. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23417. }
  23418. .bind(this),
  23419. i = function() {
  23420. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23421. }
  23422. .bind(this)
  23423. }
  23424. n = function() {
  23425. this.flying = !1
  23426. }
  23427. .bind(this),
  23428. this.flying = !0,
  23429. t()
  23430. }
  23431. }
  23432. ,
  23433. n.prototype.changeFloor = function(e) {
  23434. if (!this.is360View(this.mode, this.currentPano))
  23435. if (this.mode === u.PANORAMA) {
  23436. var t = this.history.reversePano(e);
  23437. t && t.isAligned() ? this.flyToPano({
  23438. pano: t
  23439. }) : this.changeFloorByScore(e)
  23440. } else
  23441. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23442. }
  23443. ,
  23444. n.prototype.changeFloorByScore = function() {
  23445. var e = {
  23446. pano: null,
  23447. candidates: []
  23448. };
  23449. return function(t) {
  23450. var i = this.model.nextFloor(t);
  23451. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  23452. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23453. this.history.push(t, this.currentPano),
  23454. this.flyToPano({
  23455. pano: e.pano
  23456. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23457. }
  23458. }(),
  23459. n.prototype.gotoFloor = function(e) {
  23460. var t = e - this.model.currentFloor.floorIndex;
  23461. this.changeFloor(t)
  23462. }
  23463. ,
  23464. n.prototype.getDirection = function(e) {
  23465. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23466. e.applyQuaternion(this.camera.quaternion)
  23467. }
  23468. ,
  23469. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23470. if (o = o || $.Deferred(),
  23471. this.mode === u.TRANSITIONING)
  23472. return F.warn("should not be transitioning here"),
  23473. n && n(!1),
  23474. o.reject().promise();
  23475. var a = i || !1
  23476. , s = i ? i.position : this.position
  23477. , l = this.position.clone()
  23478. , c = this.currentPano;
  23479. if (F.debug("New pose in mode " + this.mode),
  23480. !e || (retryCallback = function() {
  23481. N.delayOneFrame(function() {
  23482. this.flyToSameMode(e, t, i, n, o)
  23483. }
  23484. .bind(this))
  23485. }
  23486. .bind(this),
  23487. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23488. var h = function() {
  23489. this.emit(w.FlyingEnded, s, l, e, c),
  23490. n && n(!0)
  23491. }
  23492. .bind(this)
  23493. , d = f[this.mode]
  23494. , p = void 0 !== t ? t : d.transitionTime
  23495. , g = new r.Vector3
  23496. , C = new r.Vector3;
  23497. if (this.emit(w.FlyingStarted, s, l, e, c),
  23498. this.mode === u.PANORAMA)
  23499. F.warn("we should not be here for panorama views");
  23500. else if (this.mode === u.DOLLHOUSE)
  23501. if (a) {
  23502. var I = new r.Vector3(0,1,0);
  23503. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23504. this.model.warpDestFloors(i.floorVisibility),
  23505. C.copy(i.position);
  23506. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23507. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23508. , _ = b.intersectObjects(this.model.colliders)
  23509. , T = 3;
  23510. _.length ? (g.copy(_[0].point),
  23511. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23512. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23513. var x = (new r.Matrix4).lookAt(C, g, I)
  23514. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23515. , M = g.distanceTo(C)
  23516. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23517. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23518. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23519. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23520. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23521. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23522. this.path.burnsDir = Math.sign(L.y);
  23523. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23524. , B = new r.Vector3;
  23525. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23526. y.start(function(e, t) {
  23527. D.x = P.x + e * L.x,
  23528. D.y = P.y + e * L.y,
  23529. D.z = P.z + e * L.z;
  23530. var i = O + e * (M - O);
  23531. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23532. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23533. }
  23534. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23535. y.start(function(e, t) {
  23536. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23537. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23538. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23539. }
  23540. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23541. } else
  23542. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23543. else if (this.path.placeCpm(),
  23544. this.path.fadeInCpm(f.path.fadeInTime),
  23545. i) {
  23546. this.model.warpDestFloors(i.floorVisibility);
  23547. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23548. , k = this.cameraControls.controls[u.FLOORPLAN]
  23549. , H = k.target.clone()
  23550. , G = i.position.clone().sub(H)
  23551. , z = U.position.clone().sub(k.target)
  23552. , W = z.length()
  23553. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23554. , Y = Math.atan2(k.offset.x, k.offset.z)
  23555. , X = Math.atan2(j.x, j.z)
  23556. , Z = k.absoluteScale
  23557. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23558. y.start(function(e, t) {
  23559. k.target.copy(G).multiplyScalar(e).add(H);
  23560. var i = Y + (X - Y) * e;
  23561. k.offset.x = W * Math.sin(i),
  23562. k.offset.z = W * Math.cos(i),
  23563. U.position.copy(k.target).add(k.offset),
  23564. k.absoluteScale = Z + e * (q - Z),
  23565. k.update(),
  23566. this.quaternion.copy(U.quaternion),
  23567. this.position.copy(U.position),
  23568. this.target.copy(k.target),
  23569. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23570. }
  23571. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23572. } else
  23573. F.info("flyToSameMode() funny floorplan view? skipping");
  23574. return y.setTimeout(function(e) {
  23575. this.mode = e,
  23576. h(),
  23577. o.resolve(!0)
  23578. }
  23579. .bind(this, this.mode), p, V.FlyToSameMode),
  23580. this.mode = u.TRANSITIONING,
  23581. o.promise()
  23582. }
  23583. }
  23584. ,
  23585. n.prototype.flyToNewMode = function(e, t) {
  23586. e = e || {};
  23587. var i = e.mode
  23588. , n = e.pano
  23589. , o = e.duration
  23590. , a = e.warpDest
  23591. , s = e.callback
  23592. , l = e.force
  23593. , c = e.quaternion;
  23594. if (t = t || $.Deferred(),
  23595. this.isWarping())
  23596. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23597. s && s(!1),
  23598. t.reject("Cannot change mode during tour transition").promise();
  23599. if (this.mode === u.TRANSITIONING)
  23600. return s && s(!1),
  23601. t.reject("Cannot change mode during mode transition").promise();
  23602. if (i === this.mode)
  23603. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23604. t.promise()) : (s && s(!1),
  23605. t.reject("Already in " + i + " mode").promise());
  23606. var h = a || !1;
  23607. F.debug("Switching mode to " + i);
  23608. var d = function() {
  23609. N.delayOneFrame(function() {
  23610. this.flyToNewMode(e, t)
  23611. }
  23612. .bind(this))
  23613. }
  23614. .bind(this);
  23615. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23616. return t.promise();
  23617. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23618. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23619. this.model.waitForLoad(this.model, function() {
  23620. return this.model.meshTexturesLoaded;
  23621. }
  23622. .bind(this)),
  23623. this.model.loadMeshTextures().done(d),
  23624. t.promise();
  23625. this.history.invalidate(),
  23626. this.updateLastView();
  23627. var p = this.mode
  23628. , C = this.cameraControls.cameras[i];
  23629. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23630. var I = void 0 !== o ? o : e.transitionTime;
  23631. this.emit(w.ModeChanging, p, i, n),
  23632. n && (this.currentPano = n),
  23633. this.switchCameraMode(i, c),
  23634. y.cancelById(V.LookTransition);
  23635. //before fly---------------------
  23636. if(this.mode == "panorama"){
  23637. if(this.model.floorLogos){
  23638. this.model.floorLogos[0].visible = false;
  23639. this.model.floorLogos[1].visible = false;
  23640. }
  23641. }
  23642. if(i == "panorama"){
  23643. updateVideo({type:"beforeFlyIn", pano:this.currentPano, dur:I})//add
  23644. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23645. }else{
  23646. updateVideo({type:"beforeFlyOut", dur:I})//add
  23647. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23648. }
  23649. //------------------------------------
  23650. var _ = (new r.Vector3).copy(this.position);
  23651. if (i === u.PANORAMA){
  23652. this.emit(w.PanoChosen, n, n),
  23653. setTimeout(function() {
  23654. n.floor.enter(i)
  23655. }
  23656. .bind(this), I / 2),
  23657. this.path.fadeOutCpm(f.path.fadeOutTime);
  23658. if(this.model.floorLogos){
  23659. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23660. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23661. }
  23662. }else if (i === u.DOLLHOUSE) {
  23663. if (h && (this.model.stayPut = !0),
  23664. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23665. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23666. this.path.placeCpm(),
  23667. this.path.fadeInCpm(f.path.fadeInTime),
  23668. h) {
  23669. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23670. _.set(15, 10, 15);
  23671. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23672. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23673. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23674. P.length ? (T.copy(P[0].point),
  23675. _.copy(a.position),
  23676. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  23677. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23678. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23679. _.add(this.model.position),
  23680. C.position.copy(_),
  23681. this.cameraControls.controls[u.DOLLHOUSE].update()
  23682. }
  23683. } else if (this.path.placeCpm(),
  23684. this.path.fadeInCpm(f.path.fadeInTime),
  23685. a) {
  23686. this.model.warpDestFloors(a.floorVisibility);
  23687. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23688. , L = this.cameraControls.controls[u.FLOORPLAN]
  23689. , D = O.position.clone().sub(L.target)
  23690. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23691. , U = Math.atan2(B.x, B.z);
  23692. L.target.copy(a.position);
  23693. var k = D.length();
  23694. L.offset.x = k * Math.sin(U),
  23695. L.offset.y = 0,
  23696. L.offset.z = k * Math.cos(U),
  23697. O.position.copy(L.target).add(L.offset);
  23698. L.target.clone().sub(C.position);
  23699. C.quaternion.copy(a.quaternion),
  23700. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23701. L.absoluteScale = L.currentScale,
  23702. L.update()
  23703. } else
  23704. this.model.currentFloor.enter(i);
  23705. var H = this.currentPano
  23706. , G = this.position.clone();
  23707. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23708. this.flying = !0,
  23709. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23710. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23711. C.controls.update()),
  23712. e.blackoutStyle = S.FADEIN,
  23713. I = f.show360Views.transitionTime,
  23714. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23715. this.mode = i,
  23716. this.path && this.path.popOutCpm(),
  23717. e.blackoutStyle = S.END,
  23718. I = f.show360Views.transitionTime,
  23719. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23720. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23721. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23722. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23723. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23724. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23725. y.setTimeout(function() {
  23726. this.flying = !1,
  23727. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23728. this.currentPano.enter(),
  23729. this.path.placeCpm(),
  23730. this.path.fadeOutCpm(f.path.fadeOutTime),
  23731. this.spider.draw()),
  23732. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23733. this.mode = i,
  23734. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23735. //add:
  23736. this.updateMarkerVisi() ;
  23737. (this.mode == u.PANORAMA) && this.updateHotVisible(),
  23738. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23739. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23740. this.model.floorLogos[0].visible = true
  23741. )
  23742. if(this.mode == u.PANORAMA){
  23743. Overlay.updateVisibles([this.currentPano])
  23744. updateVideo({type:"flyDone", pano:this.currentPano})//add
  23745. }else{
  23746. Overlay.updateVisibles(true)
  23747. }
  23748. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23749. t.resolve())
  23750. }
  23751. .bind(this), I, V.FlyToNewMode),
  23752. this.mode = u.TRANSITIONING,
  23753. p == "panorama" && this.updateHotVisible(),
  23754. t.promise()
  23755. }
  23756. ,
  23757. n.prototype.fade360View = function(e, t, i) {
  23758. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23759. $(this.domElement).fadeOut(.5 * e, function() {
  23760. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23761. this.model.alpha = i.modelAlpha,
  23762. this.position.copy(t.position),
  23763. this.quaternion.copy(t.quaternion),
  23764. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23765. $(this.domElement).fadeIn(.5 * e)
  23766. }
  23767. .bind(this))
  23768. }
  23769. ,
  23770. n.prototype.findDefaultViews = function() {
  23771. this.findDefaultView(this.lastInsideView, !0),
  23772. this.findDefaultView(this.last360View, !1)
  23773. }
  23774. ,
  23775. n.prototype.findDefaultView = function(e, t) {
  23776. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23777. if (e.cameraMode !== u.PANORAMA)
  23778. return !1;
  23779. var i = r.get(e.panoId);
  23780. return i && i.isAligned() === t
  23781. });
  23782. o >= 0 ? (i = r.get(n[o].panoId),
  23783. e.update({
  23784. cameraMode: u.PANORAMA,
  23785. pano: i,
  23786. position: n[o].position,
  23787. quaternion: n[o].quaternion
  23788. })) : (o = r.list.findIndex(function(e) {
  23789. return e.isAligned() === t
  23790. }),
  23791. o >= 0 ? (i = r.list[o],
  23792. e.update({
  23793. cameraMode: u.PANORAMA,
  23794. pano: i,
  23795. position: i.position
  23796. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23797. }
  23798. ,
  23799. n.prototype.updateLastView = function() {
  23800. if (this.mode === u.PANORAMA) {
  23801. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23802. e.update({
  23803. pano: this.currentPano,
  23804. position: this.position,
  23805. quaternion: this.quaternion
  23806. })
  23807. }
  23808. }
  23809. ,
  23810. n.prototype.goToLastView = function(e, t) {
  23811. var i = $.Deferred()
  23812. , n = i.resolve.bind(i)
  23813. , r = i.reject.bind(i)
  23814. , o = e ? this.lastInsideView : this.last360View;
  23815. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23816. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23817. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23818. mode: o.cameraMode,
  23819. pano: o.pano,
  23820. quaternion: o.quaternion,
  23821. callback: t
  23822. }).done(n).fail(r),
  23823. i.promise()
  23824. }
  23825. ,
  23826. n.prototype.fadeToView = function(e, t, i, n) {
  23827. var r = $.Deferred()
  23828. , o = r.resolve.bind(r)
  23829. , a = r.reject.bind(r);
  23830. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23831. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23832. a("Cannot go to illegal view"),
  23833. r.promise();
  23834. var s = (f[t.cameraMode],
  23835. function() {
  23836. $(this.domElement).fadeIn(.5 * i),
  23837. n && n(),
  23838. o()
  23839. }
  23840. .bind(this))
  23841. , l = e ? S.FADEIN : S.END;
  23842. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23843. $(this.domElement).fadeOut(.5 * i, function() {
  23844. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23845. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23846. pano: t.pano,
  23847. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23848. duration: 0
  23849. }, s) : this.flyToNewMode({
  23850. mode: t.cameraMode,
  23851. quaternion: t.quaternion,
  23852. duration: 0,
  23853. callback: s
  23854. })
  23855. }
  23856. .bind(this)),
  23857. r.promise()
  23858. }
  23859. ,
  23860. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23861. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23862. this.flying)
  23863. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23864. o && o(),
  23865. !1;
  23866. null !== e && void 0 !== e || (e = b.Show),
  23867. this.history.invalidate()
  23868. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23869. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23870. return this.emit(w.WarpStarted, a, i, n, r),
  23871. n = n || S.MIDDLE,
  23872. this.path.warpToPano(i, n, r, function() {
  23873. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23874. this.emit(w.WarpEnded, i),
  23875. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23876. o && o()
  23877. }
  23878. .bind(this)),
  23879. e === b.Hide && this.path.discardPathObject(),
  23880. !0
  23881. }
  23882. ,
  23883. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23884. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23885. s && s(),
  23886. !1)
  23887. }
  23888. ,
  23889. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23890. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23891. a && a(),
  23892. !1)
  23893. }
  23894. ,
  23895. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23896. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23897. }
  23898. ,
  23899. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23900. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23901. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23902. t && t(),
  23903. !1)
  23904. }
  23905. ,
  23906. n.prototype.aimTourCamera = function(e, t, i, n) {
  23907. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23908. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23909. }
  23910. ,
  23911. n.prototype.showPathToHeroLocation = function(e) {
  23912. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23913. }
  23914. ,
  23915. n.prototype.tourInterlude = function(e, t) {
  23916. this.history.invalidate();
  23917. this.path.discardSlow();
  23918. //xzw:
  23919. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23920. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23921. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23922. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  23923. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23924. var timeEachItem = 2000;//假设每个item飞的时间
  23925. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23926. }
  23927. rotTime = Math.max(0, rotTime)
  23928. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  23929. this.path.waitNextStep(e, function() {
  23930. t && t()
  23931. }.bind(this), rotTime)
  23932. }
  23933. ,
  23934. n.prototype.stopInterlude = function() {
  23935. this.interruptAndFastForward(null, 0)
  23936. }
  23937. ,
  23938. n.prototype.interruptAndFastForward = function(e, t) {
  23939. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23940. this.flying && this.emit(w.FlyingInterrupted),
  23941. this.path.interruptAndFastForward(e, t)
  23942. }
  23943. ,
  23944. n.prototype.setSize = function(e, t) {
  23945. var i = e / t;
  23946. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23947. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23948. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23949. for (var r in this.cameraControls.cameras) {
  23950. var o = this.cameraControls.cameras[r];
  23951. o.fov = this.baseFov * (1 / this.zoomLevel),
  23952. o.updateAspect(i)
  23953. }
  23954. }
  23955. ,
  23956. n.prototype.toJSON = function() {
  23957. var e = {};
  23958. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23959. e.camera_mode = u.toInt(this.mode),
  23960. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23961. return e.hidden ? 0 : 1
  23962. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23963. e) : e
  23964. }
  23965. ,
  23966. n.prototype.getCurrentNodePanos = function(e) {
  23967. this.model.panos.map;
  23968. if (e.length = 0, this.path.nodes){
  23969. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23970. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23971. if(this.path.nodes.length){
  23972. e.push(this.model.panos.get(this.path.nodes[0]))
  23973. }
  23974. if(this.path.nodes.length>1){
  23975. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23976. }
  23977. }else{
  23978. for (var t = 0; t < this.path.nodes.length; t++) {
  23979. var i = this.path.nodes[t];
  23980. e.push(this.model.panos.get(i))
  23981. }
  23982. }
  23983. }
  23984. }
  23985. ,
  23986. n.prototype.zoomIncrementally = function(e) {
  23987. var t = this.zoomLevel;
  23988. this.zoomTo(this.zoomLevel + e),
  23989. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23990. }
  23991. ,
  23992. n.prototype.zoomInIncrementally = function(e) {
  23993. e = e || this.defaultZoomIncrement,
  23994. this.zoomIncrementally(e)
  23995. }
  23996. ,
  23997. n.prototype.zoomOutIncrementally = function(e) {
  23998. e = e || -this.defaultZoomIncrement,
  23999. this.zoomIncrementally(e)
  24000. }
  24001. ,
  24002. n.prototype.zoomBy = function(e) {
  24003. this.zoomTo(this.zoomLevel * e)
  24004. }
  24005. ,
  24006. n.prototype.zoomIn = function() {
  24007. this.zoomBy(1 + this.zoomSpeed)
  24008. }
  24009. ,
  24010. n.prototype.zoomOut = function() {
  24011. this.zoomBy(1 - this.zoomSpeed)
  24012. }
  24013. ,
  24014. n.prototype.zoomTo = function(e, t) {
  24015. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  24016. if (e < f.zoom.min && (e = f.zoom.min),
  24017. e > f.zoom.max && (e = f.zoom.max),
  24018. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  24019. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  24020. e === f.zoom.min && this.emit(O.ZoomMin)),
  24021. this.cameraControls.activeControl) {
  24022. var i = this.cameraControls.activeControl.camera;
  24023. this.zoomLevel = e,
  24024. i.fov = this.baseFov * (1 / this.zoomLevel),
  24025. i.updateProjectionMatrix(),
  24026. this.zoomFov = i.fov
  24027. }
  24028. }
  24029. }
  24030. ,
  24031. n.prototype.increaseZoomSpeed = function() {
  24032. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  24033. }
  24034. ,
  24035. n.prototype.decreaseZoomSpeed = function() {
  24036. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  24037. }
  24038. ,
  24039. n.prototype.clampZoomSpeed = function(e) {
  24040. return e < 0 ? 0 : e
  24041. }
  24042. ,
  24043. n.prototype.activatePersistentZooming = function(e) {
  24044. this.zooming = e ? 1 : -1
  24045. }
  24046. ,
  24047. n.prototype.deactivatePersistentZooming = function() {
  24048. this.zooming = 0
  24049. }
  24050. ,
  24051. n.prototype.zoomDefault = function() {
  24052. this.zoomTo(1, !0)
  24053. }
  24054. ,
  24055. window.fovTranId = 333;//add
  24056. n.prototype.smoothZoomToDefault = function(e, t) {
  24057. y.cancelById(window.fovTranId)
  24058. var i, n = this.zoomLevel,
  24059. r = function(e) {
  24060. e > 1 && (e = 1),
  24061. i = n * (1 - e) + e,
  24062. this.zoomTo(i, !0)
  24063. }.bind(this),
  24064. o = function() {
  24065. this.zoomDefault(),
  24066. t && window.setTimeout(t, 50)
  24067. }.bind(this);
  24068. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  24069. }
  24070. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  24071. y.cancelById(window.fovTranId)
  24072. console.log("smoothZoomFovTo "+zoomLevel)
  24073. var i,
  24074. n = this.zoomLevel,
  24075. aimLevel = zoomLevel || this.baseFov / fov
  24076. if (n == aimLevel) return
  24077. var fun = function (e) {
  24078. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  24079. this.zoomTo(i, !0)
  24080. }.bind(this)
  24081. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  24082. }
  24083. ,
  24084. n.prototype.updateZoomPano = function() {
  24085. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  24086. var e = this.currentPano;
  24087. if (e) {
  24088. var t = this.zoomLevel > f.zoom.activationThreshold
  24089. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  24090. , n = !i && !this.isWarping()
  24091. , r = t /*&& n*/; // 允许flying状态下加载4K图
  24092. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  24093. this.panoRenderer.setZoomingActive(r, e, !0);
  24094. var o = function(e, t) {
  24095. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  24096. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  24097. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  24098. e.setZoomed(t)
  24099. }
  24100. .bind(this);
  24101. r && !e.zoomed ? (o(e, !0),
  24102. this.panoRenderer.enableUltraHighQualityMode(function() {
  24103. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  24104. r && o(e, !0)
  24105. }
  24106. .bind(this))) : !t && e.zoomed && o(e, !1)
  24107. }
  24108. }
  24109. },
  24110. n.prototype.checkHasNeighbor = function(pano){//add
  24111. for(var i in pano.neighbourPanos ){
  24112. if(i == pano.id)continue;
  24113. if(pano.neighbourPanos[i]){
  24114. return true;
  24115. }
  24116. }
  24117. }
  24118. ,
  24119. t.exports = n
  24120. }
  24121. ).call(this, "/js/player.js")
  24122. }
  24123. , {
  24124. "./constants": 8,
  24125. "./enum/AlignmentType": 17,
  24126. "./enum/BlackoutStyle": 18,
  24127. "./enum/ControlEvents": 21,
  24128. "./enum/Keys": 30,
  24129. "./enum/ModelManagerEvents": 33,
  24130. "./enum/PanoSizeClass": 36,
  24131. "./enum/PanoramaEvents": 37,
  24132. "./enum/PathDiscardMode": 38,
  24133. "./enum/PathDisplayMode": 39,
  24134. "./enum/PlayerEvents": 40,
  24135. "./enum/TagStates": 44,
  24136. "./enum/Vectors": 50,
  24137. "./enum/Viewmode": 51,
  24138. "./enum/WarpStyle": 52,
  24139. "./enum/ZoomEvents": 53,
  24140. "./exception/BasicException": 55,
  24141. "./model/ModelManager": 140,
  24142. "./objects/NSpider": 147,
  24143. "./objects/Panorama": 148,
  24144. "./objects/Reticule": 149,
  24145. "./objects/ShowPath": 151,
  24146. "./objects/Snapshot": 153,
  24147. "./objects/View": 154,
  24148. "./settings": 166,
  24149. "./shaders": 167,
  24150. "./tile/TileDownloader": 171,
  24151. "./tile/TilePrioritizer": 172,
  24152. "./util/ZoomStats": 179,
  24153. "./util/browser": 182,
  24154. "./util/camera": 183,
  24155. "./util/cameraLight": 184,
  24156. "./util/common": 185,
  24157. "./util/easing": 186,
  24158. "./util/history": 187,
  24159. "./util/lerp": 188,
  24160. "./util/logger": 189,
  24161. "./util/math": 190,
  24162. "./util/transitions": 195,
  24163. "hot":"hot",
  24164. "scaleImg":"scaleImg",
  24165. events: 202,
  24166. three: 217
  24167. }],
  24168. "scaleImg":[function(t, e){// xzw
  24169. var OUTPUT = e;
  24170. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  24171. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24172. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  24173. return G.getImageData(0,0,s,f)}
  24174. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  24175. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24176. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24177. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  24178. else
  24179. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  24180. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  24181. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24182. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  24183. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  24184. W=new Float32Array(at);else
  24185. for(W=[],et=0;at>et;++et)
  24186. W[et]=0;for(b=0;w>b;b++)
  24187. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  24188. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  24189. delete p,h(),J=n(W)}
  24190. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  24191. if("png-src"===i||"jpeg-src"===i)
  24192. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24193. return B}
  24194. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24195. OUTPUT.exports = c;
  24196. }, {}
  24197. ],
  24198. 156: [function(e, t, i) {
  24199. (function(i) {
  24200. "use strict";
  24201. function n(e, t) {
  24202. this.model = e,
  24203. this.panos = e.panos,
  24204. this.player = t,
  24205. this.imagePanos = this.listImagePanos(),
  24206. this.retryMinimumTime = 1e4
  24207. }
  24208. var r = (e("three"),
  24209. e("./enum/Viewmode"))
  24210. , o = (e("./settings"),
  24211. e("./objects/Panorama"))
  24212. , a = e("./util/logger")
  24213. , s = new a(i);
  24214. n.prototype.start = function() {
  24215. this.loadNextPano(function(e) {
  24216. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24217. setTimeout(function() {
  24218. this.start()
  24219. }
  24220. .bind(this), 1e3))
  24221. }
  24222. .bind(this))
  24223. }
  24224. ,
  24225. n.prototype.validLoadTarget = function(e) {
  24226. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24227. }
  24228. ,
  24229. n.prototype.listImagePanos = function() {
  24230. var e = []
  24231. , t = this;
  24232. return this.model.images.forEach(function(i) {
  24233. if (i.metadata && i.metadata.scan_id) {
  24234. var n = t.model.panos.get(i.metadata.scan_id);
  24235. n && !n.isLoaded("high") && e.push(n)
  24236. }
  24237. }),
  24238. e
  24239. }
  24240. ,
  24241. n.prototype.nextNotLoadedImage = function() {
  24242. for (; this.imagePanos.length > 0; ) {
  24243. var e = this.imagePanos[0];
  24244. if (!e.isLoaded("high"))
  24245. return e;
  24246. this.imagePanos.shift()
  24247. }
  24248. return null
  24249. }
  24250. ,
  24251. n.prototype.loadNextPano = function(e) {
  24252. var t, i, n = this.model.waitQueue.filter(function(e) {
  24253. return e.object instanceof o
  24254. });
  24255. n.length > 0 ? (t = n[0].object,
  24256. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24257. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24258. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24259. t = this.imagePanos[0],
  24260. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  24261. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24262. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24263. s.debug("Preloading " + i + "-res pano " + t.id),
  24264. t.loadCube(i).done(e).fail(function() {
  24265. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24266. e()
  24267. })) : e && e(null)
  24268. }
  24269. ,
  24270. t.exports = n
  24271. }
  24272. ).call(this, "/js/preloaders.js")
  24273. }
  24274. , {
  24275. "./enum/Viewmode": 51,
  24276. "./objects/Panorama": 148,
  24277. "./settings": 166,
  24278. "./util/logger": 189,
  24279. three: 217
  24280. }],
  24281. 157: [function(e, t, i) {
  24282. (function(i) {
  24283. "use strict";
  24284. function n(e, t, i, n, r) {
  24285. this.qualityManager = e,
  24286. this.scene = t,
  24287. this.camera = i,
  24288. this.container = r,
  24289. this.controls = n,
  24290. this.controls.enabled = !0,
  24291. this.controls.locked = !0,
  24292. this.quickstartCamera = n.camera,
  24293. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24294. this.skybox = null
  24295. }
  24296. var r = e("three")
  24297. , o = e("../util/logger")
  24298. , a = e("../constants")
  24299. , s = (e("../util/transitions"),
  24300. e("../util/lerp"),
  24301. e("../util/easing"),
  24302. e("../enum/Vectors"))
  24303. , l = e("../enum/PanoSizeClass")
  24304. , c = (e("../materials/ModelTextureMaterial"),
  24305. e("../materials/CubemapMaterial"))
  24306. , h = (e("../cameras/PanoramaCamera"),
  24307. e("../controls/PanoramaControls"),
  24308. e("../tile/TileUtils"),
  24309. e("../util/camera"),
  24310. e("../util/cameraLight"))
  24311. , u = (e("../util/browser"),
  24312. e("../settings"),
  24313. e("../gui/helpManager"),
  24314. new o(i));
  24315. n.prototype.load = function(e) {
  24316. e.pano.shouldRedrawOnBaseLoaded = !0;
  24317. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24318. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24319. var a = this.qualityManager.getPanoSize(l.BASE)
  24320. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24321. if (e.pano.tiled) {
  24322. u.warn("Loading startPano, TILED", e.pano.id);
  24323. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24324. , p = this.quickstartCamera.fov;
  24325. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24326. t = e.pano.loadTiledPano(c, r, {
  24327. hFov: d,
  24328. vFov: p
  24329. }, !1, !1, !0),
  24330. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24331. } else
  24332. u.warn("Loading startPano", e.pano.id),
  24333. t = e.pano.loadCube("high");
  24334. return $.when(t).then(function() {
  24335. n.init(e.pano, e.quaternion),
  24336. e.pano.tiled ? i.done(function() {
  24337. e.pano.lockUntilRenderingComplete = !1,
  24338. this.controls.locked = !1
  24339. }
  24340. .bind(this)) : this.controls.locked = !1
  24341. }
  24342. .bind(this))
  24343. }
  24344. ,
  24345. n.prototype.init = function(e, t) {
  24346. u.info("Quickstart done loading, adding scene objects"),
  24347. e.lockUntilRenderingComplete = !0,
  24348. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24349. side: r.BackSide
  24350. })),
  24351. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24352. this.skybox.quaternion.copy(e.quaternion),
  24353. this.scene.add(this.skybox),
  24354. $(this.container).show()
  24355. }
  24356. ,
  24357. n.prototype.update = function(e) {
  24358. this.controls.update(e),
  24359. this.camera.copy(this.quickstartCamera)
  24360. }
  24361. ,
  24362. n.prototype.setSize = function(e, t) {
  24363. this.quickstartCamera.updateAspect(e / t)
  24364. }
  24365. ,
  24366. n.prototype.destroy = function() {
  24367. this.scene.remove(this.skybox)
  24368. }
  24369. ,
  24370. t.exports = n
  24371. }
  24372. ).call(this, "/js/scene/QuickstartManager.js")
  24373. }
  24374. , {
  24375. "../cameras/PanoramaCamera": 7,
  24376. "../constants": 8,
  24377. "../controls/PanoramaControls": 13,
  24378. "../enum/PanoSizeClass": 36,
  24379. "../enum/Vectors": 50,
  24380. "../gui/helpManager": 68,
  24381. "../materials/CubemapMaterial": 117,
  24382. "../materials/ModelTextureMaterial": 118,
  24383. "../settings": 166,
  24384. "../tile/TileUtils": 174,
  24385. "../util/browser": 182,
  24386. "../util/camera": 183,
  24387. "../util/cameraLight": 184,
  24388. "../util/easing": 186,
  24389. "../util/lerp": 188,
  24390. "../util/logger": 189,
  24391. "../util/transitions": 195,
  24392. three: 217
  24393. }],
  24394. 158: [function(e, t, i) {
  24395. "use strict";
  24396. function n(e, t, i) {
  24397. this.scene = e,
  24398. this.camera = t,
  24399. this.renderer = null,
  24400. this.effects = i,
  24401. this.animateCallback = null,
  24402. this.composer = null,
  24403. this.qualityManager = null,
  24404. e.renderWidth = 0,
  24405. e.renderHeight = 0,
  24406. this.updateClock = new r.Clock,
  24407. this.components = [],
  24408. this.updateListeners = [],
  24409. this.resizeListeners = [],
  24410. this.forceUpdateSize = !1,
  24411. this.started = !1,
  24412. this.textures = {},
  24413. this.suspendedObjects = []
  24414. }
  24415. var r = e("three")
  24416. , o = e("../shaders")
  24417. , a = e("../enum/SceneRendererEvents")
  24418. , s = e("../enum/GLTextureType")
  24419. , l = e("../enum/GLCubeFaces")
  24420. , c = e("../exception/BasicException")
  24421. , h = e("../exception/RendererCreationException")
  24422. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24423. , m = e("../util/browser")
  24424. /**************************************************************************************************************************************************/
  24425. , u = e("../settings")
  24426. , d = e("events").EventEmitter;
  24427. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24428. n.prototype = Object.create(d.prototype),
  24429. n.prototype.addComponent = function(e) {
  24430. this.components.push(e),
  24431. e.update && this.updateListeners.push(e),
  24432. e.setSize && (this.resizeListeners.push(e),
  24433. this.forceUpdateSize = !0)
  24434. }
  24435. ,
  24436. n.prototype.removeComponent = function(e) {
  24437. var t = function(t) {
  24438. return t !== e
  24439. };
  24440. this.components = this.components.filter(t),
  24441. this.updateListeners = this.updateListeners.filter(t),
  24442. this.resizeListeners = this.resizeListeners.filter(t)
  24443. }
  24444. ,
  24445. n.prototype.start = function(e) {
  24446. if (this.started)
  24447. throw new c("Can't start SceneRenderer, already started");
  24448. this.createContext(e),
  24449. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24450. m.isMobile() && this.boluoVrInit(),
  24451. /*******************************************************************************************************************************/
  24452. this.initComposer(),
  24453. this.started = !0,
  24454. (p = p.bind(this))()
  24455. }
  24456. ,
  24457. n.prototype.createContext = function(e) {
  24458. try {
  24459. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:true}),//透明
  24460. this.renderer.autoClear = !0,
  24461. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24462. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24463. this.renderer.setClearColor( 0x000000, 0 ); //透明
  24464. this.emit(a.ContextCreated)
  24465. } catch (e) {
  24466. throw new h("Unable to create a WebGL rendering context")
  24467. }
  24468. u.profiling.enabled && this.overrideTextures(),
  24469. e.appendChild(this.renderer.domElement)
  24470. /* window.stats = new Stats();
  24471. e.appendChild( stats.dom ); */
  24472. }
  24473. ,
  24474. n.prototype.overrideTextures = function() {
  24475. var e = this.renderer.context
  24476. , t = 0
  24477. , i = e.createTexture;
  24478. e.createTexture = function() {
  24479. var n = i.call(e);
  24480. return n.id = t++,
  24481. this.textures[n.id] = n,
  24482. n
  24483. }
  24484. .bind(this);
  24485. var n = e.texImage2D;
  24486. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24487. var d, p = this.getTextureTypeFromTarget(e, t);
  24488. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24489. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24490. h = a,
  24491. u = l,
  24492. o = u.naturalWidth,
  24493. a = u.naturalHeight,
  24494. n.call(e, t, i, r, c, h, u));
  24495. var f = this.textures[d.id];
  24496. f.width = p === s.TextureCube ? 6 * o : o,
  24497. f.height = a
  24498. }
  24499. .bind(this);
  24500. var r = e.deleteTexture;
  24501. e.deleteTexture = function(t) {
  24502. delete this.textures[t.id],
  24503. r.call(e, t)
  24504. }
  24505. .bind(this)
  24506. }
  24507. ,
  24508. n.prototype.updateTextureMemory = function() {
  24509. var e = null;
  24510. return function() {
  24511. var t = 0;
  24512. for (var i in this.textures) {
  24513. var n = this.textures[i];
  24514. n.width && n.height && (t += n.width * n.height * 4)
  24515. }
  24516. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24517. e = t
  24518. }
  24519. }(),
  24520. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24521. switch (t) {
  24522. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24523. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24524. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24525. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24526. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24527. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24528. return s.TextureCube;
  24529. case e.TEXTURE_2D:
  24530. return s.Texture2D;
  24531. default:
  24532. return null
  24533. }
  24534. }
  24535. ,
  24536. n.prototype.initComposer = function() {
  24537. this.composer = new r.EffectComposer(this.renderer),
  24538. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24539. //this.composer.addPass(this.effects.hblurPass),
  24540. //this.composer.addPass(this.effects.vblurPass)
  24541. this.composer.addPass(this.effects.transitionMaskPass)//add
  24542. }
  24543. ,
  24544. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24545. this.renderWidth = e,
  24546. this.renderHeight = t,
  24547. this.effects.aspect = e / t,
  24548. /* this.renderer.setSize(e, t), -----MP */
  24549. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24550. this.composer.setSize(e, t);
  24551. for (var i = 0; i < this.resizeListeners.length; i++)
  24552. this.resizeListeners[i].setSize(e, t)
  24553. }
  24554. ,
  24555. n.prototype.render = function() {
  24556. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24557. //this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24558. }
  24559. /******************************************************************************************************徐世廷**********************************************************************/
  24560. var vrPermission = {};
  24561. var vrPermissionCallBack = function(info1,info2){
  24562. if(info1 == "reset"){
  24563. vrPermission = {};
  24564. }else{
  24565. vrPermission[info1] = info2
  24566. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24567. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24568. }
  24569. }
  24570. }
  24571. n.prototype.boluoVrInit = function() {
  24572. console.log("boluoVrInit")
  24573. this.isHuawei5X = m.detectHUAWEI5X(),
  24574. this.oldRenderer = this.renderer,
  24575. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24576. window.panoCamera = this.camera;
  24577. var a = this;
  24578. window._vrEnabled = !1,
  24579. Object.defineProperty(window, "vrEnabled", {
  24580. get: function() {
  24581. return window._vrEnabled
  24582. },
  24583. set: function(b) {
  24584. b = !!b,
  24585. b ? (a.renderer = a.newRenderer,
  24586. window.vrMarkers.forEach(function(a) {
  24587. a.visible = !0
  24588. })) : (a.renderer = a.oldRenderer,
  24589. window.vrMarkers.forEach(function(a) {
  24590. a.visible = !1
  24591. })),
  24592. a.cursor.visible = b,
  24593. a.setSize(window.innerWidth, window.innerHeight),
  24594. window._vrEnabled = b
  24595. if(b){
  24596. setTimeout(function(){
  24597. console.log("orientEnable"+window.orientEnable)
  24598. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24599. if(m.detectIOS()/* && m.detectSafari() */){
  24600. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24601. console.log("开始获取权限 major"+b.major)
  24602. if(b.major == 12 && b.minor>=2){
  24603. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24604. else{//app??
  24605. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24606. }
  24607. }else if(b.major >= 13){
  24608. if(!window.location.href.includes("https://")){
  24609. console.log("需要https");
  24610. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24611. return;
  24612. }
  24613. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24614. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24615. if(!window.vrEnabled || window.orientEnable)return;
  24616. vrPermissionCallBack("reset")
  24617. console.log(window.DeviceMotionEvent)
  24618. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24619. console.log("开始获取权限1")
  24620. ///注意:需要https 本地服务器permissionState会得到denied
  24621. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24622. console.log("permissionState1: "+permissionState)
  24623. vrPermissionCallBack("deviceMotion", permissionState)
  24624. }).catch(function(e){
  24625. vrPermissionCallBack("deviceMotion", false)
  24626. console.log(e)
  24627. })
  24628. }else{
  24629. console.log("window.DeviceMotionEvent undefined")
  24630. vrPermissionCallBack("deviceMotion", false)
  24631. }
  24632. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24633. console.log("开始获取权限2")
  24634. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24635. console.log("permissionState2: "+permissionState)
  24636. vrPermissionCallBack("deviceOrientation", permissionState)
  24637. }).catch(function(e){
  24638. vrPermissionCallBack("deviceOrientation", false)
  24639. console.log(e)
  24640. })
  24641. }else{
  24642. console.log("window.DeviceOrientationEvent undefined")
  24643. vrPermissionCallBack("deviceOrientation", false)
  24644. }
  24645. },hasFailed ? 0 : 150)
  24646. /* /* setTimeout(function(){
  24647. if(settings.vrEnabled && !window.orientEnable){
  24648. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24649. }
  24650. },4000) */
  24651. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24652. }else{
  24653. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24654. }
  24655. }else{
  24656. //已经触发了
  24657. }
  24658. },200);
  24659. }
  24660. }
  24661. }),
  24662. this.createCursor(.5, !1, 1, 16777215, 0);
  24663. var b = {
  24664. setSize: function(b, c) {
  24665. a.camera.aspect = b / c
  24666. }
  24667. };
  24668. this.resizeListeners.push(b),
  24669. this.vrLoadingInit()
  24670. }
  24671. ,
  24672. n.prototype.vrLoadingInit = function() {
  24673. var a = function(camera) {
  24674. var a = this
  24675. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24676. , c = new r.MeshBasicMaterial({
  24677. color: 4967932,
  24678. side: r.DoubleSide
  24679. })
  24680. , d = new r.Mesh(b,c);
  24681. this.mesh = d,
  24682. d.position.z = -2,
  24683. d.scale.set(.08, .08, .08),
  24684. d.visible = !1,
  24685. camera.add(d),
  24686. //window.player.camera.add(d),
  24687. a.enabled = !1,
  24688. this.update = function(b) {
  24689. 1 == a.enabled && (d.rotation.z += 15 * b)
  24690. }
  24691. }
  24692. , a = new a(this.camera);
  24693. window.Loading = a,
  24694. this.updateListeners.push(a)
  24695. }
  24696. ,
  24697. n.prototype.createCursor = function(a, b, c, d, e) {
  24698. var g, h = new r.SpriteMaterial({
  24699. opacity: c,
  24700. color: d,
  24701. transparent: b,
  24702. map: this.boluoGetTexture("images/cursor.png"),
  24703. needsUpdate: !0,
  24704. side: r.DoubleSide
  24705. });
  24706. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24707. h.map.repeat = new r.Vector2(1 / 17,1),
  24708. h.depthTest = !1,
  24709. h.blending = r.AdditiveBlending,
  24710. g = new r.Sprite(h),
  24711. // g.scale.set(a, a, a),
  24712. g.scale.set(.3,.3,.3)
  24713. g.position.z = -2,
  24714. g.visible = !1,
  24715. g.name = "cursor",
  24716. this.camera.add(g),
  24717. this.scene.add(this.camera),
  24718. this.cursor = g;
  24719. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24720. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24721. this.updateListeners.push(i)
  24722. }
  24723. ,
  24724. window.orientEnable = 0; //是否能触发deviceorientation
  24725. n.prototype.CursorAnimation = function(a, b, c) {
  24726. function d() {
  24727. g.orient = r.Math.degToRad(window.orientation || 0)
  24728. }
  24729. function e(a) {
  24730. if(!window.vrEnabled && window.orientEnable) return;
  24731. window.orientEnable || (window.orientEnable = 1);
  24732. var b = r.Math.degToRad(a.alpha)
  24733. , c = r.Math.degToRad(a.beta)
  24734. , d = r.Math.degToRad(a.gamma);
  24735. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24736. -1e3 === g.beta && (g.beta = c),
  24737. -1e3 === g.gamma && (g.gamma = d),
  24738. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24739. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24740. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24741. g.beta = c,
  24742. g.gamma = d),
  24743. n.vrDebug) {
  24744. $("#info-device-orientation").css("display", "block");
  24745. var e = "";
  24746. e += "alpha=(" + g.alpha + ")<BR/>",
  24747. e += "beta=(" + g.beta + ")<BR/>",
  24748. e += "gamma=" + g.gamma + "<BR/>",
  24749. document.getElementById("info-device-orientation").innerHTML = e
  24750. }
  24751. }
  24752. this.cursor = b,
  24753. this.raycaster = new r.Raycaster,
  24754. this.targetEventObj = {},
  24755. this.type = 1,
  24756. this.tweenFlag = !0;
  24757. var g = this;
  24758. this.target = c,
  24759. console.log(c.uuid),
  24760. this.euler = new r.Euler,
  24761. this.q0 = new r.Quaternion,
  24762. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24763. this.zee = new r.Vector3(0,0,1),
  24764. this.alpha = -1e3,
  24765. this.beta = -1e3,
  24766. this.gamma = -1e3,
  24767. this.orient = r.Math.degToRad(window.orientation || 0),
  24768. window.addEventListener("orientationchange", d),
  24769. window.addEventListener("deviceorientation", e),
  24770. this.setObjectQuaternion = function(a, b, d, e, f) {
  24771. g.euler.set(d, b, -e, "YXZ"),
  24772. a.setFromEuler(g.euler),
  24773. a.multiply(g.q1),
  24774. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24775. c.updateMatrixWorld()
  24776. }
  24777. ,
  24778. parent !== window && window.addEventListener("message", function(a) {
  24779. var b = JSON.parse(a.data)
  24780. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24781. b && b.alpha && b.beta && b.gamma && function(a) {
  24782. var c = r.Math.degToRad(b.alpha)
  24783. , d = r.Math.degToRad(b.beta)
  24784. , e = r.Math.degToRad(b.gamma);
  24785. a ? (-1e3 === g.alpha && (g.alpha = c),
  24786. -1e3 === g.beta && (g.beta = d),
  24787. -1e3 === g.gamma && (g.gamma = e),
  24788. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24789. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24790. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24791. g.beta = d,
  24792. g.gamma = e)
  24793. }(c)
  24794. }),
  24795. this.update = function(a) {
  24796. TWEEN.update();
  24797. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24798. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24799. this.triggerTargetEvent())
  24800. }
  24801. ,
  24802. this.triggerTargetEvent = function() {
  24803. var a = this.choseObj()
  24804. , b = a ? a.object : void 0;
  24805. this.targetEventObj.currentObj = b,
  24806. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24807. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24808. b && b.enabled && this.startAnimate(function() {
  24809. this.clickCallback(b)
  24810. }
  24811. .bind(this))) : this.type,
  24812. this.targetEventObj.lastObj = b)
  24813. }
  24814. ,
  24815. this.choseObj = function() {
  24816. this.raycaster.setFromCamera({
  24817. x: 0,
  24818. y: 0
  24819. }, c);
  24820. var a = (this.raycaster.ray,
  24821. window.vrMarkers)
  24822. , b = this.raycaster.intersectObjects(a);
  24823. if (b.length > 0)
  24824. return b[0]
  24825. }
  24826. ,
  24827. this.clickCallback = function(a) {
  24828. this.runTHREEAction(a, "onclick")
  24829. }
  24830. ,
  24831. this.runTHREEAction = function(a, b) {
  24832. switch (b) {
  24833. case "onclick":
  24834. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24835. a()
  24836. });
  24837. break;
  24838. case "onhover":
  24839. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24840. a()
  24841. });
  24842. break;
  24843. case "onout":
  24844. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24845. a()
  24846. })
  24847. }
  24848. }
  24849. ,
  24850. this.startAnimate = function(a) {
  24851. this.tweenFlag && this.initAnimation(a)
  24852. }
  24853. ,
  24854. this.initAnimation = function(a) {
  24855. var b = this
  24856. , c = this.cursor.material.map.offset
  24857. , d = function(a) {
  24858. return Math.floor(17 * a) / 17
  24859. };
  24860. b.tweenFlag = !1,
  24861. this.cursorAnimate = new TWEEN.Tween(c).to({
  24862. x: 1
  24863. }, 1e3).onStart(function() {
  24864. b.tweenFlag = !1
  24865. }).onStop(function() {
  24866. b.tweenFlag = !0,
  24867. this.x = 0,
  24868. c.x = 0
  24869. }).onUpdate(function() {}).onComplete(function() {
  24870. a(),
  24871. c.x = 0,
  24872. setTimeout(function() {
  24873. b.tweenFlag = !0
  24874. }, 1500)
  24875. }),
  24876. this.cursorAnimate.easing(d),
  24877. this.cursorAnimate.start()
  24878. }
  24879. ,
  24880. this.autoCursorPosition = function(a) {
  24881. // var b = Math.abs(a.distance - 10);
  24882. // this.cursor.position.z = -b,
  24883. // b /= 10;
  24884. // alert(b);
  24885. // this.cursor.scale.set(b, b, b)
  24886. this.cursor.scale.set(.3,.3,.3)
  24887. }
  24888. }
  24889. ,
  24890. n.prototype.vrRenderer = function(a, b, c) {
  24891. var d = new b.vrCamera(c);
  24892. d.bananaAspect = .8,
  24893. this.width,
  24894. this.height;
  24895. var b = this;
  24896. this.setSize = function(c, d) {
  24897. a.setSize.call(this, c, d),
  24898. b.width = c,
  24899. b.height = d
  24900. }
  24901. ,
  24902. this.render = function(b, c, e, f) {
  24903. window.cameraQua = c.quaternion.clone();
  24904. var g, h;
  24905. if (c.__RESS__SKIP__STEREO__)
  24906. return a.render(b, c, e, f);
  24907. if ("PerspectiveCamera" === c.type)
  24908. g = d.cameraL,
  24909. h = d.cameraR,
  24910. b.updateMatrixWorld(),
  24911. null === c.parent && c.updateMatrixWorld(),
  24912. d.vrCameraUpdate(c);
  24913. else {
  24914. if ("OrthographicCamera" !== c.type)
  24915. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24916. g = h = c
  24917. }
  24918. a.setScissorTest(!0),
  24919. a.setScissor(0, 0, this.width / 2, this.height),
  24920. a.setViewport(0, 0, this.width / 2, this.height),
  24921. a.render.call(this, b, g, e, f),
  24922. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24923. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24924. a.render.call(this, b, h, e, f),
  24925. a.setScissorTest(!1)
  24926. }
  24927. ,
  24928. this.__proto__ = {
  24929. __proto__: a
  24930. }
  24931. }
  24932. ,
  24933. n.prototype.vrCamera = function(a) {
  24934. this.type = "StereoCamera",
  24935. this._aspect = 1,
  24936. this._overlap = .064,
  24937. this.cameraL = new r.PerspectiveCamera,
  24938. this.cameraL.layers.enable(1),
  24939. this.cameraL.near = 0.01,//xzw add
  24940. this.cameraL.matrixAutoUpdate = !1,
  24941. this.cameraR = new r.PerspectiveCamera,
  24942. this.cameraR.layers.enable(2),
  24943. this.cameraR.near = 0.01,//xzw add
  24944. this.cameraR.matrixAutoUpdate = !1,
  24945. this.eyeRight = new r.Matrix4,
  24946. this.eyeLeft = new r.Matrix4,
  24947. this.vrCameraNeedsUpdate = !0,
  24948. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24949. Object.defineProperty(this, "bananaAspect", {
  24950. get: function() {
  24951. return this._aspect
  24952. },
  24953. set: function(a) {
  24954. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24955. this._aspect = a
  24956. }
  24957. }),
  24958. Object.defineProperty(this, "overlap", {
  24959. get: function() {
  24960. return this._overlap
  24961. },
  24962. set: function(a) {
  24963. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24964. this._overlap = a
  24965. }
  24966. }),
  24967. this.vrCameraUpdate = function(a) {
  24968. this.vrCameraNeedsUpdate = true;
  24969. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24970. this.vrCameraNeedsUpdate) {
  24971. this.vrCameraNeedsUpdate = !1,
  24972. //console.debug("vrCameraUpdate"),
  24973. this.bananaFocus = a.focus,
  24974. this.bananaFov = a.fov,
  24975. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24976. this.bananaNear = a.near,
  24977. this.bananaFar = a.far,
  24978. //console.debug(a.aspect),
  24979. this.bananaFocus = 10;
  24980. var b, c, d = a.projectionMatrix.clone(), e = this.overlap / 2, f = e * this.bananaNear / this.bananaFocus, g = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  24981. this.eyeLeft.elements[12] = -e,
  24982. this.eyeRight.elements[12] = e,
  24983. b = -g * this.bananaReal_aspect + f,
  24984. c = g * this.bananaReal_aspect + f,
  24985. d.elements[0] = 2 * this.bananaNear / (c - b),
  24986. d.elements[8] = (c + b) / (c - b),
  24987. this.cameraL.projectionMatrix.copy(d),
  24988. b = -g * this.bananaReal_aspect - f,
  24989. c = g * this.bananaReal_aspect - f,
  24990. d.elements[0] = 2 * this.bananaNear / (c - b),
  24991. d.elements[8] = (c + b) / (c - b),
  24992. this.cameraR.projectionMatrix.copy(d)
  24993. }
  24994. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24995. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24996. }
  24997. }
  24998. ,
  24999. n.prototype.boluoGetTexture = function(a) {
  25000. var b = new r.TextureLoader;
  25001. return b.crossOrigin = "anonymous",
  25002. b.load(a)
  25003. }
  25004. ,
  25005. /***********************************************************************************************************************************************************************************/
  25006. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25007. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25008. return function(o){
  25009. var render = false;
  25010. var ratio;
  25011. var w, h; //记录应当render的大小
  25012. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25013. w = o.width, h = o.height, render = true, ratio=1;
  25014. }else{
  25015. w = $('#player').width();
  25016. h = $('#player').height();
  25017. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25018. (w !== W || h !== H || this.forceUpdateSize) &&
  25019. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25020. }
  25021. if(render){
  25022. this.setSize(w, h, ratio);
  25023. this.forceUpdateSize = !1
  25024. }
  25025. }
  25026. }()
  25027. ,
  25028. n.prototype.updateComponents = function() {
  25029. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25030. this.updateListeners[t].update(e)
  25031. }
  25032. ,
  25033. n.prototype.suspend = function() {
  25034. this.started = !1,
  25035. this.suspendedObjects = this.scene.children.map(function(e) {
  25036. return this.scene.remove(e),
  25037. e
  25038. }
  25039. .bind(this)),
  25040. this.render()
  25041. }
  25042. ,
  25043. n.prototype.resume = function() {
  25044. this.suspendedObjects.forEach(function(e) {
  25045. this.scene.add(e)
  25046. }
  25047. .bind(this)),
  25048. this.suspendedObjects = [],
  25049. this.started = !0,
  25050. p()
  25051. }
  25052. ;
  25053. var p = function() {
  25054. this.started && (window.requestAnimationFrame(p),
  25055. this.updateScreenSize(), // fyz resize
  25056. this.updateComponents(),
  25057. this.updateTextureMemory(),
  25058. this.render(),
  25059. window.stats && (window.fps = stats.update()),
  25060. this.emit(a.AfterRender))
  25061. };
  25062. n.prototype.getImageData = function() {
  25063. var e = document.createElement("canvas")
  25064. , t = e.getContext("2d");
  25065. return function(i, n, r) {
  25066. return e.width === n && e.height === r || (e.width = n,
  25067. e.height = r),
  25068. t.drawImage(i, 0, 0, n, r),
  25069. t.getImageData(0, 0, n, r)
  25070. }
  25071. }(),
  25072. n.prototype.initSizedTexture2D = function(e, t, i) {
  25073. var n = this.renderer
  25074. , o = n.context
  25075. , a = n.state
  25076. , s = new r.Texture(null);
  25077. s.flipY = !1,
  25078. i !== !0 && (i = !1),
  25079. s.generateMipmaps = i;
  25080. var l = n.paramThreeToGL(s.format)
  25081. , c = n.paramThreeToGL(s.type)
  25082. , h = n.properties.get(s)
  25083. , u = o.createTexture();
  25084. a.bindTexture(o.TEXTURE_2D, u),
  25085. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25086. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25087. s.wrapS = t,
  25088. s.wrapT = t;
  25089. var d = n.paramThreeToGL(t);
  25090. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25091. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25092. i ? (s.magFilter = r.LinearFilter,
  25093. s.minFilter = r.LinearMipMapLinearFilter,
  25094. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25095. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25096. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25097. s.minFilter = r.LinearFilter,
  25098. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25099. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25100. a.bindTexture(o.TEXTURE_2D, null),
  25101. h.__webglTexture = u,
  25102. s
  25103. }
  25104. ,
  25105. n.prototype.initSizedCubeMap = function(e, t) {
  25106. var i = this.renderer
  25107. , n = i.context
  25108. , o = i.state
  25109. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25110. a.flipY = !1,
  25111. a.generateMipmaps = t;
  25112. var s = i.paramThreeToGL(a.format)
  25113. , l = i.paramThreeToGL(a.type)
  25114. , c = i.properties.get(a)
  25115. , h = n.createTexture();
  25116. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25117. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25118. for (var u = 0; u < 6; u++)
  25119. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25120. return t ? (a.magFilter = r.LinearFilter,
  25121. a.minFilter = r.LinearMipMapLinearFilter,
  25122. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25123. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25124. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25125. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25126. a.minFilter = r.LinearFilter,
  25127. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25128. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25129. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25130. c.__image__webglTextureCube = h,
  25131. a
  25132. }
  25133. ,
  25134. n.prototype.deallocateCubeTexture = function(e) {
  25135. var t = this.renderer
  25136. , i = t.context
  25137. , n = t.properties.get(e);
  25138. i.deleteTexture(n.__image__webglTextureCube)
  25139. }
  25140. ,
  25141. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25142. var a = this.renderer
  25143. , s = a.context
  25144. , l = a.state
  25145. , c = a.properties.get(t);
  25146. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25147. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25148. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25149. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25150. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25151. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25152. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25153. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25154. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25155. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25156. l.bindTexture(s.TEXTURE_2D, null)
  25157. }
  25158. ,
  25159. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25160. var s = this.renderer
  25161. , l = s.context
  25162. , c = s.state
  25163. , h = s.properties.get(t);
  25164. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25165. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25166. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25167. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25168. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25169. }
  25170. ,
  25171. n.prototype.rebuildMipMaps2D = function(e) {
  25172. var t = this.renderer
  25173. , i = t.context
  25174. , n = t.state;
  25175. t.properties.get(e);
  25176. i.generateMipmap(i.TEXTURE_2D),
  25177. n.bindTexture(i.TEXTURE_2D, null)
  25178. }
  25179. ,
  25180. n.prototype.rebuildMipMaps3D = function(e) {
  25181. var t = this.renderer
  25182. , i = t.context
  25183. , n = t.state
  25184. , r = t.properties.get(e);
  25185. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25186. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25187. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25188. }
  25189. ,
  25190. n.prototype.renderToCubeMap = function() {
  25191. var e = !1
  25192. , t = null
  25193. , i = null
  25194. , n = null
  25195. , a = null
  25196. , s = null
  25197. , l = 1;
  25198. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25199. var _ = this.renderer;
  25200. _.context;
  25201. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25202. i.position.z = 150,
  25203. t = new r.Scene,
  25204. t.add(i),
  25205. n = new r.ShaderMaterial({
  25206. uniforms: {
  25207. tDiffuse: {
  25208. type: "t",
  25209. value: null
  25210. },
  25211. alpha: {
  25212. type: "f",
  25213. value: 1
  25214. }
  25215. },
  25216. vertexShader: o.basicTextured.vertexShader,
  25217. fragmentShader: o.basicTextured.fragmentShader,
  25218. depthWrite: !1,
  25219. depthTest: !1,
  25220. side: r.DoubleSide
  25221. }),
  25222. a = new r.PlaneBufferGeometry(l,l),
  25223. s = new r.Mesh(a,n),
  25224. s.position.z = 0,
  25225. t.add(s),
  25226. e = !0);
  25227. var T = a.getAttribute("uv");
  25228. T.setDynamic(!0),
  25229. T.needsUpdate = !0;
  25230. var x = T.array
  25231. , S = p / u
  25232. , M = f / d
  25233. , R = g / u
  25234. , P = m / d;
  25235. x[0] = S,
  25236. x[1] = M + P,
  25237. x[2] = S + R,
  25238. x[3] = M + P,
  25239. x[4] = S,
  25240. x[5] = M,
  25241. x[6] = S + R,
  25242. x[7] = M;
  25243. var O = a.getAttribute("position");
  25244. O.setDynamic(!0),
  25245. O.needsUpdate = !0;
  25246. var L = O.array
  25247. , D = v / h.width - l / 2
  25248. , N = A / h.height - l / 2
  25249. , B = y / h.width
  25250. , F = C / h.height;
  25251. L[0] = D,
  25252. L[1] = N + F,
  25253. L[3] = D + B,
  25254. L[4] = N + F,
  25255. L[6] = D,
  25256. L[7] = N,
  25257. L[9] = D + B,
  25258. L[10] = N;
  25259. this.renderer.properties.get(c);
  25260. n.uniforms.tDiffuse.value = c,
  25261. n.blending = E || r.NoBlending,
  25262. n.transparent = !!b,
  25263. void 0 !== w && null !== w || (w = 1),
  25264. n.uniforms.alpha.value = w,
  25265. n.needUpdate = !0,
  25266. h.activeCubeFace = I,
  25267. h.viewport.set(0, 0, h.width, h.height);
  25268. var V = this.renderer.autoClear;
  25269. this.renderer.autoClear = !1,
  25270. this.renderer.render(t, i, h, !1),
  25271. this.renderer.autoClear = V
  25272. }
  25273. }(),
  25274. n.prototype.copyCubeMap = function() {
  25275. var e = !1
  25276. , t = null
  25277. , i = null
  25278. , a = null
  25279. , s = null
  25280. , l = null
  25281. , c = new r.Euler;
  25282. new r.Vector3;
  25283. return function(h, u, d, p, f, g, m, v, A) {
  25284. this.renderer;
  25285. if (!e) {
  25286. var y = 2;
  25287. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25288. i.position.set(0, 0, 0),
  25289. t = new r.Scene,
  25290. t.add(i),
  25291. a = new r.ShaderMaterial({
  25292. uniforms: {
  25293. tDiffuse: {
  25294. type: "t",
  25295. value: null
  25296. },
  25297. alpha: {
  25298. type: "f",
  25299. value: 1
  25300. }
  25301. },
  25302. vertexShader: o.copyCubeMap.vertexShader,
  25303. fragmentShader: o.copyCubeMap.fragmentShader,
  25304. depthWrite: !1,
  25305. depthTest: !1,
  25306. side: r.DoubleSide
  25307. }),
  25308. s = new r.BoxGeometry(y,y,y),
  25309. l = new r.Mesh(s,a),
  25310. t.add(l),
  25311. e = !0
  25312. }
  25313. for (var C = 0; C < 6; C++)
  25314. n.getCubeOrientationForCubeFace(C, c),
  25315. l.rotation.copy(c),
  25316. l.matrixWorldNeedsUpdate = !0,
  25317. l.updateMatrixWorld(),
  25318. a.uniforms.tDiffuse.value = h,
  25319. a.blending = m || r.NoBlending,
  25320. a.transparent = !!v,
  25321. void 0 !== A && null !== A || (A = 1),
  25322. a.uniforms.alpha.value = A,
  25323. a.needUpdate = !0,
  25324. u.activeCubeFace = C,
  25325. u.viewport.set(0, 0, f, g),
  25326. this.renderer.render(t, i, u, !1)
  25327. }
  25328. }(),
  25329. n.getLookAtForCubeFace = function(e, t) {
  25330. switch (e) {
  25331. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25332. t.set(1, 0, 0);
  25333. break;
  25334. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25335. t.set(-1, 0, 0);
  25336. break;
  25337. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25338. t.set(0, 1, 0);
  25339. break;
  25340. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25341. t.set(0, -1, 0);
  25342. break;
  25343. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25344. t.set(0, 0, 1);
  25345. break;
  25346. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25347. t.set(0, 0, -1)
  25348. }
  25349. }
  25350. ,
  25351. n.getCubeOrientationForCubeFace = function(e, t) {
  25352. switch (e) {
  25353. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25354. t.set(0, -Math.PI / 2, 0);
  25355. break;
  25356. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25357. t.set(0, Math.PI / 2, 0);
  25358. break;
  25359. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25360. t.set(Math.PI / 2, Math.PI, 0);
  25361. break;
  25362. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25363. t.set(-Math.PI / 2, Math.PI, 0);
  25364. break;
  25365. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25366. t.set(0, -Math.PI, 0);
  25367. break;
  25368. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25369. t.set(0, 0, 0)
  25370. }
  25371. }
  25372. ,
  25373. t.exports = n
  25374. }
  25375. , {
  25376. "../enum/GLCubeFaces": 25,
  25377. "../enum/GLTextureType": 26,
  25378. "../enum/SceneRendererEvents": 43,
  25379. "../exception/BasicException": 55,
  25380. "../exception/RendererCreationException": 57,
  25381. "../settings": 166,
  25382. "../shaders": 167,
  25383. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25384. "../util/browser": 182,
  25385. /************************************************************************************************************************************************/
  25386. events: 202,
  25387. three: 217
  25388. }],
  25389. 159: [function(e, t, i) {
  25390. "use strict";
  25391. function n(e) {
  25392. this.messenger = new a(e),
  25393. this.clientKey = null
  25394. }
  25395. var r = e("../util/ajax")
  25396. , o = e("./PostMessageType")
  25397. , a = e("./postmessage")
  25398. , s = e("./VersionInfo")
  25399. , l = e("events").EventEmitter
  25400. , c = window.location.origin + "/api/v1/user/";
  25401. n.prototype = Object.create(l.prototype),
  25402. n.prototype.bindEvents = function() {
  25403. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25404. }
  25405. ,
  25406. n.prototype.waitForConnection = function() {
  25407. var e = new Promise(function(e, t) {
  25408. this.messenger.on(o.CONNECT, function(i) {
  25409. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25410. }
  25411. .bind(this))
  25412. }
  25413. .bind(this));
  25414. return e
  25415. }
  25416. ,
  25417. n.prototype.onConnectionReceived = function(e) {
  25418. return this.messenger.setTarget(e.source, e.origin),
  25419. this.verifyConnection(e).then(function(t, i) {
  25420. this.messenger.send({
  25421. type: o.ACCEPT,
  25422. toId: e.fromId,
  25423. warning: i
  25424. }),
  25425. this.clientKey = t,
  25426. this.messenger.removeAllListeners(o.CONNECT),
  25427. this.bindEvents()
  25428. }
  25429. .bind(this), function(t) {
  25430. this.messenger.send({
  25431. type: o.REJECT,
  25432. toId: e.fromId,
  25433. reason: t
  25434. }),
  25435. this.messenger.setTarget()
  25436. }
  25437. .bind(this))
  25438. }
  25439. ,
  25440. n.prototype.verifyConnection = function(e) {
  25441. return new Promise(function(t, i) {
  25442. var n;
  25443. if (s.isDeprecated(e.sdkVersion))
  25444. n = "这个版本正在被弃用";
  25445. else if (!s.isSupported(e.sdkVersion))
  25446. return i("不支持此版本的SDK");
  25447. var o = {
  25448. cache: !1,
  25449. headers: {
  25450. "X-port-Application-Key": e.applicationKey,
  25451. "X-port-Referrer": e.origin
  25452. }
  25453. };
  25454. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25455. }
  25456. )
  25457. }
  25458. ,
  25459. n.prototype.onMessageReceived = function(e) {
  25460. if (this.validateClientApplicationKey(e.applicationKey)) {
  25461. var t = this;
  25462. e.onDone = function(i) {
  25463. i.toId = e.fromId,
  25464. i.uid = e.uid,
  25465. i.type = o.RESPONSE,
  25466. t.messenger.send(i)
  25467. }
  25468. ,
  25469. this.emit(o.ACTION, e)
  25470. }
  25471. }
  25472. ,
  25473. n.prototype.validateClientApplicationKey = function(e) {
  25474. return this.clientKey === e
  25475. }
  25476. ,
  25477. n.prototype.sendEvent = function(e, t) {
  25478. this.messenger.send({
  25479. type: o.EVENT,
  25480. eventType: e,
  25481. eventData: t
  25482. })
  25483. }
  25484. ,
  25485. t.exports = n
  25486. }
  25487. , {
  25488. "../util/ajax": 181,
  25489. "./PostMessageType": 160,
  25490. "./VersionInfo": 163,
  25491. "./postmessage": 165,
  25492. events: 202
  25493. }],
  25494. 160: [function(e, t, i) {
  25495. "use strict";
  25496. t.exports = Object.freeze({
  25497. CONNECT: "postmessage.connect",
  25498. ACCEPT: "postmessage.accept",
  25499. REJECT: "postmessage.reject",
  25500. ACTION: "postmessage.action",
  25501. RESPONSE: "postmessage.response",
  25502. EVENT: "postmessage.event"
  25503. })
  25504. }
  25505. , {}],
  25506. 161: [function(e, t, i) {
  25507. "use strict";
  25508. t.exports = Object.freeze({
  25509. MOVE: "sdk.move",
  25510. ENTER_PANO: "sdk.enterpano",
  25511. MODEL_LOADED: "sdk.modelloaded"
  25512. })
  25513. }
  25514. , {}],
  25515. 162: [function(e, t, i) {
  25516. "use strict";
  25517. t.exports = Object.freeze({
  25518. FLY: "transition.fly",
  25519. FADEOUT: "transition.fade",
  25520. INSTANT: "transition.instant"
  25521. })
  25522. }
  25523. , {}],
  25524. 163: [function(e, t, i) {
  25525. "use strict";
  25526. t.exports = {
  25527. current: "1.0",
  25528. supported: ["1.0"],
  25529. deprecated: [],
  25530. isSupported: function(e) {
  25531. return this.supported.indexOf(e) !== -1
  25532. },
  25533. isDeprecated: function(e) {
  25534. return this.deprecated.indexOf(e) !== -1
  25535. },
  25536. isValid: function(e) {
  25537. return this.isSupported(e) || this.isDeprecated(e)
  25538. }
  25539. }
  25540. }
  25541. , {}],
  25542. 164: [function(e, t, i) {
  25543. (function(i) {
  25544. "use strict";
  25545. function n(e, t, i) {
  25546. e && (e = e.toLowerCase().trim());
  25547. var n = new I.UP.clone
  25548. , r = Math.PI / 3
  25549. , o = Math.PI / 2;
  25550. switch (e) {
  25551. case "left":
  25552. i.copy(t),
  25553. i.applyAxisAngle(n, o);
  25554. break;
  25555. case "right":
  25556. i.copy(t),
  25557. i.applyAxisAngle(n, -o);
  25558. break;
  25559. case "forwardleft":
  25560. i.copy(t),
  25561. i.applyAxisAngle(n, r);
  25562. break;
  25563. case "forwardright":
  25564. i.copy(t),
  25565. i.applyAxisAngle(n, -r);
  25566. break;
  25567. case "forward":
  25568. default:
  25569. i.copy(t)
  25570. }
  25571. return i
  25572. }
  25573. function r(e, t) {
  25574. if (e) {
  25575. var i = {
  25576. pano: e,
  25577. lookAtPoint: null,
  25578. duration: null,
  25579. maxDistanceOverride: null,
  25580. skipWarpingCheck: !1
  25581. };
  25582. this.player.flyToPano(i, function() {
  25583. t && t({
  25584. success: !0,
  25585. message: "Transition complete."
  25586. })
  25587. })
  25588. } else
  25589. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25590. t && t({
  25591. success: !1,
  25592. error: "Unable to find pano."
  25593. })
  25594. }
  25595. function o(e, t) {
  25596. var i = this.findRankedPano(e, t);
  25597. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25598. null)
  25599. }
  25600. function a(e, t) {
  25601. var i = this.findRankedtag(e, t);
  25602. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25603. null)
  25604. }
  25605. function s(e, t) {
  25606. t.copy(I.FORWARD),
  25607. e.getDirection(t)
  25608. }
  25609. function l(e) {
  25610. function t(e) {
  25611. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25612. return {
  25613. x: c.Math.radToDeg(t._x),
  25614. y: c.Math.radToDeg(t._y),
  25615. z: c.Math.radToDeg(t._z)
  25616. }
  25617. }
  25618. var i = function(e) {
  25619. return e.alignmentType !== m.ALIGNED ? null : {
  25620. x: e.position.x,
  25621. y: e.position.y,
  25622. z: e.position.z
  25623. }
  25624. };
  25625. return {
  25626. panos: e.panos.list.map(function(n) {
  25627. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25628. return {
  25629. uuid: n.id,
  25630. aligned: n.alignmentType === m.ALIGNED,
  25631. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25632. position: i(n),
  25633. rotation: t(n),
  25634. thumbnail: r
  25635. }
  25636. })
  25637. }
  25638. }
  25639. var c = e("three")
  25640. , h = e("./ApiHost")
  25641. , u = e("../util/logger")
  25642. , d = e("../util/common")
  25643. , p = e("../util/math")
  25644. , f = e("../enum/ModelManagerEvents")
  25645. , g = e("./PostMessageType")
  25646. , m = e("../enum/AlignmentType")
  25647. , v = e("../enum/Direction")
  25648. , A = e("./TransitionStyles")
  25649. , y = e("../util/panorama")
  25650. , C = e("../enum/GLCubeFaces")
  25651. , I = e("../enum/Vectors")
  25652. , E = e("../enum/Viewmode")
  25653. , b = e("../enum/WarpStyle")
  25654. , w = (e("../enum/Keys"),
  25655. e("../enum/PlayerEvents"))
  25656. , _ = e("../sdk/SdkEvents")
  25657. , I = e("../enum/Vectors")
  25658. , T = e("../enum/ControlEvents")
  25659. , x = e("../enum/RenderLayers")
  25660. , S = (e("../constants"),
  25661. e("../settings"))
  25662. , M = e("../lib/jpeg_encoder")
  25663. , R = new u(i)
  25664. , P = function() {
  25665. var e = function e() {
  25666. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25667. e.player.getDirection(e.playerDirection),
  25668. e.projectVectors();
  25669. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25670. if (e.angleTravelled += Math.abs(t),
  25671. e.angleTravelled >= Math.abs(e.angle)) {
  25672. if (e.active = !1,
  25673. e.onDone) {
  25674. var i = e.onDone;
  25675. i()
  25676. }
  25677. } else
  25678. e.lastFacingDirection.copy(e.playerDirection),
  25679. window.setTimeout(e, 4)
  25680. };
  25681. return e.active = !1,
  25682. e.angle = 0,
  25683. e.angleTravelled = 0,
  25684. e.playerDirection = new c.Vector3,
  25685. e.lastFacingDirection = new c.Vector3,
  25686. e.onDone = null,
  25687. e.player = null,
  25688. e.start = function(t, i, n, r) {
  25689. e.active = !0,
  25690. t && i && (i = 0),
  25691. e.angle = t || i,
  25692. e.xAngle = t,
  25693. e.yAngle = i,
  25694. e.angleTravelled = 0,
  25695. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25696. n.getDirection(e.playerDirection),
  25697. e.lastFacingDirection.copy(e.playerDirection),
  25698. e.projectVectors(),
  25699. e.onDone = r,
  25700. e.player = n,
  25701. e()
  25702. }
  25703. ,
  25704. e.projectVectors = function() {
  25705. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25706. e.lastFacingDirection.projectOnPlane(I.UP))
  25707. }
  25708. ,
  25709. e
  25710. }()
  25711. , O = function() {
  25712. var e = new c.Vector3;
  25713. return function(t) {
  25714. t ? (e.copy(t.position),
  25715. e.add(t.discPosition),
  25716. p.projectPositionToCanvas(e, this.player.camera, e),
  25717. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25718. }
  25719. }()
  25720. , L = function() {
  25721. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25722. }
  25723. , D = function() {
  25724. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25725. }
  25726. , N = function(e) {
  25727. var t = new c.Vector3;
  25728. return function(e) {
  25729. var i = this.player.getDirection();
  25730. t.copy(i);
  25731. var n = t.y;
  25732. t.y = 0,
  25733. t.normalize();
  25734. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25735. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25736. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25737. 0;
  25738. this.player.mode === E.DOLLHOUSE && (r = -r);
  25739. var o = L.call(this) - .1
  25740. , a = D.call(this) + .1
  25741. , s = r + e;
  25742. s > o ? s = o : s < a && (s = a);
  25743. var l = s - r;
  25744. return e > 0 && l < .01 && (l = 0),
  25745. e < 0 && l > -.01 && (l = 0),
  25746. l
  25747. }
  25748. }()
  25749. , B = function() {
  25750. var e = new c.Euler;
  25751. return function(t) {
  25752. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25753. {
  25754. position: {
  25755. x: t.position.x,
  25756. y: t.position.y,
  25757. z: t.position.z
  25758. },
  25759. rotation: {
  25760. x: c.Math.radToDeg(e.x),
  25761. y: c.Math.radToDeg(e.y),
  25762. z: 0
  25763. },
  25764. pano: t.currentPano ? t.currentPano.id : null,
  25765. mode: t.mode
  25766. }
  25767. }
  25768. }()
  25769. , F = null;
  25770. t.exports = {
  25771. init: function(e, t, i, n, r) {
  25772. V.init(e, t, i, r),
  25773. F = new Promise(function(e, t) {
  25774. i.on(w.Ready, function() {
  25775. e()
  25776. })
  25777. }
  25778. .bind(this));
  25779. var o = new h(window)
  25780. , a = o.waitForConnection();
  25781. a.then(function(e) {
  25782. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25783. });
  25784. var s = function() {
  25785. var e = Date.now();
  25786. return function() {
  25787. if (!(Date.now() - e < 100)) {
  25788. var t = B(i);
  25789. o.sendEvent(_.MOVE, {
  25790. state: t
  25791. }),
  25792. e = Date.now()
  25793. }
  25794. }
  25795. }();
  25796. i.on(w.Move, s),
  25797. i.on(w.ViewChanged, s),
  25798. n.on(f.ActiveModelChanged, function(e) {
  25799. function t(e) {
  25800. var t, i = e.newPano.id;
  25801. e.oldPano && (t = e.oldPano.id),
  25802. i !== t && o.sendEvent(_.ENTER_PANO, {
  25803. oldPano: t,
  25804. newPano: i
  25805. })
  25806. }
  25807. var i = e.model
  25808. , n = e.oldModel;
  25809. V.model = i,
  25810. a.then(function() {
  25811. o.sendEvent(_.MODEL_LOADED, {
  25812. metadata: l(i)
  25813. })
  25814. }),
  25815. n && n.panos.forEach(function(e) {
  25816. e.removeEventListener("enter", t)
  25817. }),
  25818. i.panos.forEach(function(e) {
  25819. e.on("enter", t)
  25820. })
  25821. })
  25822. }
  25823. };
  25824. var V = {
  25825. director: null,
  25826. player: null,
  25827. controls: null,
  25828. sceneRenderer: null,
  25829. model: null,
  25830. init: function(e, t, i, n) {
  25831. this.director = e,
  25832. this.player = i,
  25833. this.controls = t,
  25834. this.sceneRenderer = n
  25835. },
  25836. handleToObject: {},
  25837. objectToHandle: {},
  25838. handleCount: 0,
  25839. onMessageReceive: function(e) {
  25840. if (e) {
  25841. var t = e.targetFunction
  25842. , i = e.params
  25843. , n = e.onDone;
  25844. t && this[t] && this[t](i, n)
  25845. }
  25846. },
  25847. waitForInit: function(e, t) {
  25848. F.then(t.bind({
  25849. success: !0,
  25850. message: "Init complete."
  25851. }))
  25852. },
  25853. moveToPano: function(e, t) {
  25854. var i = new c.Euler(0,0,0,"YXZ")
  25855. , n = new c.Quaternion;
  25856. return function(e, t) {
  25857. var r = e.pano
  25858. , o = e.rotation
  25859. , a = e.transition;
  25860. if (!this.model)
  25861. return t({
  25862. success: !1,
  25863. error: "The model has not been loaded yet"
  25864. });
  25865. var s = this.model.panos.get(r);
  25866. if (!s)
  25867. return t({
  25868. success: !1,
  25869. error: r + " does not exist in this model"
  25870. });
  25871. if (!o)
  25872. return t({
  25873. sucess: !1,
  25874. erorr: o + " is not a valid rotation"
  25875. });
  25876. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25877. console.log(o.z);
  25878. var l = {
  25879. success: !0,
  25880. message: r
  25881. };
  25882. if (a === A.FADEOUT)
  25883. n.setFromEuler(i),
  25884. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25885. else {
  25886. var h, u;
  25887. a === A.INSTANT && (h = 0,
  25888. u = 0);
  25889. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25890. this.player.flyToPano({
  25891. pano: s,
  25892. lookAtPoint: d,
  25893. duration: h,
  25894. aimDuration: u
  25895. }, t.bind(this, l))
  25896. }
  25897. }
  25898. }(),
  25899. moveInDirection: function(e, t) {
  25900. var i = e.direction;
  25901. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25902. void (t && t({
  25903. success: !1,
  25904. error: "Invalid direction."
  25905. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25906. t(e ? {
  25907. success: !0,
  25908. message: "moved " + i
  25909. } : {
  25910. success: !1,
  25911. error: "Cannot move in direction: " + i
  25912. })
  25913. })
  25914. },
  25915. getPose: function(e, t) {
  25916. this.player.camera.position,
  25917. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25918. return t({
  25919. success: !0,
  25920. message: B(this.player)
  25921. })
  25922. },
  25923. takeScreenShot: function() {
  25924. var e = new c.PerspectiveCamera
  25925. , t = new c.WebGLRenderTarget;
  25926. return function(i, n) {
  25927. if (!i.resolution)
  25928. return n({
  25929. success: !1,
  25930. error: "An invalid resolution was specified"
  25931. });
  25932. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25933. var r = this.sceneRenderer.renderer.getSize();
  25934. i.resolution.width = r.width,
  25935. i.resolution.height = r.height
  25936. }
  25937. e.layers.set(x.DEFAULT),
  25938. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25939. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25940. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25941. var o = i.resolution.width
  25942. , a = i.resolution.height
  25943. , s = o / a;
  25944. e.position.copy(this.sceneRenderer.camera.position),
  25945. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25946. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25947. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25948. t.setSize(o, a),
  25949. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25950. var l = new Uint8Array(o * a * 4);
  25951. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25952. var c = M.encode({
  25953. data: l,
  25954. width: o,
  25955. height: a,
  25956. heading: 180,
  25957. pitch: 0
  25958. }, {
  25959. quality: 75,
  25960. flipY: !0
  25961. })
  25962. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25963. n({
  25964. success: !0,
  25965. message: h
  25966. })
  25967. }
  25968. }(),
  25969. findRankedPano: function(e, t) {
  25970. var i = new c.Vector3
  25971. , r = new c.Vector3;
  25972. return function(e, t) {
  25973. s(this.player, r),
  25974. n(t, r, i);
  25975. var o = this.player.rankedPanoInDirection(e, i);
  25976. if (o) {
  25977. var a = this.objectToHandle[o.id];
  25978. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25979. this.handleToObject[a] = o),
  25980. a
  25981. }
  25982. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25983. -1
  25984. }
  25985. }(),
  25986. findRankedtag: function(e, t) {
  25987. var i = new c.Vector3
  25988. , r = new c.Vector3;
  25989. return function(e, t) {
  25990. s(this.player, r),
  25991. n(t, r, i);
  25992. var o = this.player.rankedtagInDirection(e, i);
  25993. if (o) {
  25994. var a = this.objectToHandle[o.sid];
  25995. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25996. this.handleToObject[a] = o),
  25997. a
  25998. }
  25999. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26000. -1
  26001. }
  26002. }(),
  26003. clickNearesttag: function(e) {
  26004. this.clickRankedtag(0, e)
  26005. },
  26006. clickRankedtag: function(e, t) {
  26007. var i = a.call(this, e, t);
  26008. i && O.call(this, i)
  26009. },
  26010. clickNearestPano: function(e, t) {
  26011. this.clickRankedPano(0, e, t)
  26012. },
  26013. clickRankedPano: function(e, t, i) {
  26014. var n = o.call(this, e, t);
  26015. n ? r.call(this, n, i) : i(null)
  26016. },
  26017. clickPano: function(e, t) {
  26018. var i = this.handleTable[e];
  26019. i ? r.call(this, i, t) : t(null)
  26020. },
  26021. rotateDirection: function() {
  26022. return function(e, t) {
  26023. var i = e.direction
  26024. , n = e.angle;
  26025. if (!P.active) {
  26026. var r = 0
  26027. , o = 0
  26028. , a = 0
  26029. , s = 0;
  26030. if (!n || isNaN(n))
  26031. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26032. void (t && t({
  26033. success: !1,
  26034. error: "Invalid rotation angle."
  26035. }));
  26036. if (this.player.mode === E.TRANSITIONING)
  26037. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26038. void (t && t({
  26039. success: !1,
  26040. error: "Cannot rotate while transitioning"
  26041. }));
  26042. if (i === v.RIGHT || i === v.LEFT)
  26043. i === v.RIGHT && (n = -n),
  26044. r = n > 0 ? -1 : 1,
  26045. a = n;
  26046. else {
  26047. if (i !== v.UP && i !== v.DOWN)
  26048. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26049. void (t && t({
  26050. success: !1,
  26051. error: "Invalid direction for rotation."
  26052. }));
  26053. if (this.player.mode === E.FLOORPLAN)
  26054. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26055. void (t && t({
  26056. success: !1,
  26057. error: "Cannot rotate " + i + " in floorplan mode"
  26058. }));
  26059. if (i === v.DOWN && (n = -n),
  26060. n = N.call(this, n),
  26061. 0 === n)
  26062. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26063. void (t && t({
  26064. success: !1,
  26065. error: "Already at maximum rotation in direction: " + i
  26066. }));
  26067. o = n > 0 ? 1 : -1,
  26068. s = n
  26069. }
  26070. var l = n;
  26071. n = c.Math.degToRad(n),
  26072. a = c.Math.degToRad(a),
  26073. s = c.Math.degToRad(s);
  26074. var h = this.controls.activeControl
  26075. , u = function() {
  26076. h.stopRotating(!0),
  26077. t && t({
  26078. success: !0,
  26079. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26080. })
  26081. };
  26082. h.startRotating(r, o),
  26083. P.start(a, s, this.player, u)
  26084. }
  26085. }
  26086. }(),
  26087. rotate: function() {
  26088. var e = new c.Vector3
  26089. , t = new c.Vector3;
  26090. return function(i, n) {
  26091. var r = i.xAngle
  26092. , o = i.yAngle;
  26093. if (!P.active) {
  26094. if (r = r || 0,
  26095. o = o || 0,
  26096. isNaN(r) || isNaN(o))
  26097. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26098. void (n && n({
  26099. success: !1,
  26100. error: "Invalid rotation angle."
  26101. }));
  26102. if (this.player.mode === E.TRANSITIONING)
  26103. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26104. void (n && n({
  26105. success: !1,
  26106. error: "Cannot rotate while transitioning"
  26107. }));
  26108. Math.abs(r) < .01 && (r = 0),
  26109. Math.abs(o) < .01 && (o = 0);
  26110. var a = o;
  26111. o = N.call(this, o),
  26112. r = -r;
  26113. var s = a > 0 ? "UP" : "DOWN";
  26114. if (!r && a && !o)
  26115. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26116. void (n && n({
  26117. success: !1,
  26118. error: "Already at maximum rotation in direction: " + s
  26119. }));
  26120. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26121. var l = o;
  26122. o = c.Math.degToRad(o),
  26123. r = c.Math.degToRad(r),
  26124. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26125. this.player.getDirection(e),
  26126. t.copy(e).applyAxisAngle(I.UP, r),
  26127. t.applyAxisAngle(I.RIGHT, o);
  26128. var h = (e.angleTo(t),
  26129. r > 0 ? -1 : r < 0 ? 1 : 0)
  26130. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26131. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26132. var d = this.controls.activeControl
  26133. , p = function() {
  26134. d.stopRotating(!0),
  26135. n && n({
  26136. success: !0,
  26137. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26138. })
  26139. };
  26140. d.startRotating(h, u),
  26141. P.start(r, o, this.player, p)
  26142. }
  26143. }
  26144. }(),
  26145. panCamera: function(e, t) {
  26146. function i(e) {
  26147. switch (r.removeAllListeners(T.AutoPanComplete),
  26148. r.removeAllListeners(T.AutoPanInterrupt),
  26149. r.removeAllListeners(T.AutoPanClamped),
  26150. e) {
  26151. case T.AutoPanInterrupt:
  26152. t({
  26153. success: !0,
  26154. message: "Camera panning interrupted."
  26155. });
  26156. break;
  26157. case T.AutoPanClamped:
  26158. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26159. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26160. return void t({
  26161. success: !1,
  26162. error: "Already at edge of current model bounds."
  26163. });
  26164. var i = "The view point is outside the bounds for the current model. ";
  26165. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26166. console.warn(i)
  26167. }
  26168. case T.AutoPanComplete:
  26169. t({
  26170. success: !0,
  26171. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26172. })
  26173. }
  26174. }
  26175. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26176. return t({
  26177. success: !1,
  26178. error: "Camera panning is not available in the current mode: " + this.player.mode
  26179. });
  26180. var n = e.position
  26181. , r = this.player.control;
  26182. r.setAutoPanPosition(n.x, n.z),
  26183. r.autoPan = !0;
  26184. var o = function(e, t) {
  26185. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26186. };
  26187. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26188. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26189. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26190. },
  26191. click: function(e, t) {
  26192. var i = e.x
  26193. , n = e.y
  26194. , r = e.percentage;
  26195. r === !0 && (i = i / 100 * $("#player").width(),
  26196. n = n / 100 * $("#player").height()),
  26197. this.player.handleInputStart(i, n),
  26198. this.player.updateIntersect(),
  26199. this.player.handleInputEnd(i, n)
  26200. },
  26201. mouseOver: function(e, t) {
  26202. var i = e.x
  26203. , n = e.y
  26204. , r = e.percentage;
  26205. r === !0 && (i = i / 100 * $("#player").width(),
  26206. n = n / 100 * $("#player").height()),
  26207. this.player.handleInputMove(i, n),
  26208. this.player.updateIntersect()
  26209. },
  26210. moveToMode: function(e, t) {
  26211. function i(e) {
  26212. t(e ? {
  26213. success: !1,
  26214. error: "Failed to load new mode: " + e
  26215. } : {
  26216. success: !0,
  26217. message: "Moved to new mode: " + n
  26218. })
  26219. }
  26220. var n = e.mode;
  26221. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26222. i()
  26223. }, function(e) {
  26224. i(e)
  26225. }) : t({
  26226. success: !1,
  26227. error: "Invalid mode selection"
  26228. })
  26229. }
  26230. }
  26231. }
  26232. ).call(this, "/js/sdk/automation.js")
  26233. }
  26234. , {
  26235. "../constants": 8,
  26236. "../enum/AlignmentType": 17,
  26237. "../enum/ControlEvents": 21,
  26238. "../enum/Direction": 22,
  26239. "../enum/GLCubeFaces": 25,
  26240. "../enum/Keys": 30,
  26241. "../enum/ModelManagerEvents": 33,
  26242. "../enum/PlayerEvents": 40,
  26243. "../enum/RenderLayers": 41,
  26244. "../enum/Vectors": 50,
  26245. "../enum/Viewmode": 51,
  26246. "../enum/WarpStyle": 52,
  26247. "../lib/jpeg_encoder": 94,
  26248. "../sdk/SdkEvents": 161,
  26249. "../settings": 166,
  26250. "../util/common": 185,
  26251. "../util/logger": 189,
  26252. "../util/math": 190,
  26253. "../util/panorama": 191,
  26254. "./ApiHost": 159,
  26255. "./PostMessageType": 160,
  26256. "./TransitionStyles": 162,
  26257. three: 217
  26258. }],
  26259. 165: [function(e, t, i) {
  26260. "use strict";
  26261. function n(e) {
  26262. this.sourceWindow = e,
  26263. this.targetWindow = null,
  26264. this.targetOrigin = null,
  26265. this.id = Math.floor(1e5 * Math.random()),
  26266. this.bindEvents()
  26267. }
  26268. var r = e("./PostMessageType")
  26269. , o = e("events").EventEmitter;
  26270. n.prototype = Object.create(o.prototype),
  26271. n.prototype.bindEvents = function() {
  26272. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26273. }
  26274. ,
  26275. n.prototype.setTarget = function(e, t) {
  26276. this.targetWindow = e,
  26277. this.targetOrigin = t
  26278. }
  26279. ,
  26280. n.prototype.onPostmessageReceived = function(e) {
  26281. var t = e.origin || e.originalEvent.origin
  26282. , i = e.source;
  26283. switch (e.data.type) {
  26284. case r.CONNECT:
  26285. break;
  26286. case r.RESPONSE:
  26287. if (this.id !== e.data.toId)
  26288. return;
  26289. default:
  26290. if (!this.validateMessageOrigin(t))
  26291. return
  26292. }
  26293. var n = e.data;
  26294. n.source = i,
  26295. n.origin = t,
  26296. n.timestamp = Date.now(),
  26297. this.emit(e.data.type, n)
  26298. }
  26299. ,
  26300. n.prototype.validateMessageOrigin = function(e) {
  26301. return "*" === this.targetOrigin || e === this.targetOrigin
  26302. }
  26303. ,
  26304. n.prototype.send = function(e) {
  26305. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26306. this.targetWindow.postMessage(e, this.targetOrigin))
  26307. }
  26308. ,
  26309. t.exports = n
  26310. }
  26311. , {
  26312. "./PostMessageType": 160,
  26313. events: 202
  26314. }],
  26315. 166: [function(e, t, i) {
  26316. "use strict";
  26317. var n = e("three")
  26318. , r = e("./util/browser")
  26319. , o = e("./enum/Viewmode")
  26320. , a = e("./enum/VROption")
  26321. , s = e("./enum/Colors")
  26322. , l = e("./enum/WarpStyle")
  26323. , c = e("./util/easing")
  26324. , h = e("./util/common")
  26325. , u = e("./util/showcase")
  26326. , d = e("./constants")
  26327. , p = {
  26328. debug: !1,
  26329. version: "2.25.6-0-gd87e5b1",
  26330. languageTag: r.valueFromHash("lang", null),
  26331. pageTitle: "四维虚拟漫游",
  26332. authorizationHeader: u.getAuthorizationHeader(),
  26333. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26334. logLevel: r.valueFromHash("log", 2),
  26335. skyboxRadius: 2500,
  26336. modelBoundsPadding: 5,
  26337. showNeighbors: !1,
  26338. brand: r.valueFromHash("brand", !0),
  26339. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26340. startHighlights: r.valueFromHash("hl", -1),
  26341. specialEdition: r.valueFromHash("bn", 0),
  26342. useWheel: r.valueFromHash("wh", !0),
  26343. crossOrigin: "anonymous",
  26344. fancierTransition: !1,
  26345. wireframe: !1,
  26346. skyboxWireframe: !1,
  26347. modelAlpha: 1,
  26348. highlightPanoSelection: !1,
  26349. showSweeps: !0,
  26350. showSkyboxes: !1,
  26351. showMesh: !0,
  26352. showFloors: !1,
  26353. showFloorDuration: 300,
  26354. showFloorDelay: 300,
  26355. hideFloorDuration: 300,
  26356. hideFloorDelay: 0,
  26357. reticuleOpacityTransitionTime: 250,
  26358. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26359. markerOpacityTransitionTime: 500,
  26360. guiAnimationSpeed: 250,
  26361. highlightAnimationDuration: 500,
  26362. modelComponentLoadSpinnerDelay: 150,
  26363. captureErrors: !1,
  26364. maxMobileTextures: 6,
  26365. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26366. startupFlyinDelay: 3e3,
  26367. dollhouseDefault: {
  26368. minDistance: 15,
  26369. maxDistance: 50,
  26370. minPolarAngle: n.Math.degToRad(10),
  26371. maxPolarAngle: n.Math.degToRad(90)
  26372. },
  26373. hideReticuleTimeout: 1e3,
  26374. analytics: {
  26375. inactivityThreshold: 30,
  26376. sessionTrackingRate: .15,
  26377. maxTrackedErrors: 20,
  26378. sessionDurationPingFrequency: 10,
  26379. sessionDurationTimeout: 15
  26380. },
  26381. flydown: {
  26382. movementEasing: "easeInOutQuad",
  26383. movementDelay: .001,
  26384. rotationEasing: "easeInOutQuad",
  26385. rotationDelay: .5,
  26386. modelTextureDelay: .75,
  26387. skyboxDelay: .75
  26388. },
  26389. transition: {
  26390. flySpeed: .001,
  26391. flyTime: 750,
  26392. flytimeMaxDistanceThreshold: 5,
  26393. flytimeDistanceMultiplier: 150,
  26394. aimTime: 1500,
  26395. aimSlowFactor: 1.5,
  26396. blur: 0.8,
  26397. movementEasing: "easeInOutQuad",
  26398. blendEasing: "easeInOutQuad",
  26399. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  26400. },
  26401. show360Views: {
  26402. enabled: !0,
  26403. transitionTime: 1e3
  26404. },
  26405. quickstart: {
  26406. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26407. animation: 1400,
  26408. showTextDelay: 500,
  26409. fadeOutDelay: 3e3,
  26410. fovChange: 10
  26411. },
  26412. appConfig: {
  26413. webvr_version: null,
  26414. segment_key: null,
  26415. embedly_key: null,
  26416. branch_key: null,
  26417. keen_write_key: null,
  26418. keen_project_id: null
  26419. },
  26420. vr: {
  26421. enabled: !0,
  26422. allowWebVR: !1,
  26423. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26424. },
  26425. share: {
  26426. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26427. },
  26428. input: {
  26429. longTapThreshold: 200,
  26430. moveToleranceNDC: .08,
  26431. touchMoveThreshold: 25
  26432. },
  26433. help: {
  26434. modalStayDuration: 600
  26435. },
  26436. immersive: {
  26437. timeToShowAgain: 1250,
  26438. uiStayDuration: 600
  26439. },
  26440. tourInteraction: {
  26441. disabled: "0" === r.valueFromHash("tourcta", null),
  26442. showPauseButton: 1e3,
  26443. showModal: 1500,
  26444. allowNextClick: 200,
  26445. largeModal: "1" === r.valueFromHash("tourcta", null),
  26446. smallModal: "2" === r.valueFromHash("tourcta", null)
  26447. },
  26448. labels: {
  26449. enabled: !1,
  26450. hideUntilStart: !0,
  26451. fadeInDuration: 250,
  26452. fadeInDelay: 250,
  26453. fadeOutDuration: 250,
  26454. fadeOutDelay: 0,
  26455. zoomHideThreshhold: {
  26456. mobile: r.isSmallScreen() ? .45 : .6,
  26457. desktop: 2
  26458. },
  26459. zoomTruncateThreshhold: {
  26460. mobile: r.isSmallScreen() ? .35 : .45,
  26461. desktop: .85
  26462. },
  26463. minLengthForTruncate: 16,
  26464. truncateLength: 12,
  26465. truncateSuffix: "..."
  26466. },
  26467. tags: {
  26468. enabled: r.valueFromHash("mt", 1),
  26469. startup: {
  26470. hideUntilStart: !0,
  26471. fadeInDuration: 500,
  26472. fadeInDelay: 100
  26473. },
  26474. visibility: {
  26475. anyDistance: !0,
  26476. visibleDistance: 8,
  26477. cameraClearance: .1,
  26478. alphaTestLevel: .05,
  26479. hideViaFloor: !0,
  26480. hideOffScreenDisc: !1,
  26481. hideOffScreenObject: !1
  26482. },
  26483. disc: {
  26484. opacity: 1,
  26485. disabledOpacity: .5,
  26486. scale: {
  26487. nearBound: 1.5,
  26488. farBound: 4.8,
  26489. linkFarBound: !1,
  26490. linkPercent: 40,
  26491. maxSize: 80,
  26492. minSize: 40,
  26493. baseViewportSize: 800,
  26494. responsiveness: 100
  26495. }
  26496. },
  26497. pole: {
  26498. enabled: !0,
  26499. height: .5,
  26500. width: 2,
  26501. opacity: .5,
  26502. color: "white"
  26503. },
  26504. navigate: {
  26505. nearestPano: !0,
  26506. lineOfSight: !0,
  26507. reactivate: !0,
  26508. aimAt: "disc",
  26509. tiltTolerance: 25,
  26510. rotateSpeedFactor: .6
  26511. }
  26512. },
  26513. path: {
  26514. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26515. colorUp: s._desat(s.newBlue, .5),
  26516. colorDown: s._darken(s.newBlue, .35),
  26517. opacity: .5,
  26518. style: "ribbon",
  26519. height: .025,
  26520. ribbonWidth: .24,
  26521. outsideHeight: .5,
  26522. waypointRadius: .5,
  26523. waypointIndoorRadius: .24,
  26524. waypointPulse: 1e3,
  26525. typ: l.BLACK,
  26526. meshFree: r.valueFromHash("mf", 1),
  26527. mapGuides: r.valueFromHash("guides", !0),
  26528. fadeInTime: 400,
  26529. fadeOutTime: 300
  26530. },
  26531. warp: {
  26532. nearPanoDist: .1,
  26533. matchCam: !1,
  26534. blur: .33,
  26535. fastTime: 1500,
  26536. teleportTime: 1500,
  26537. outsideTime: 2e3,
  26538. lookAheadMax: .3,
  26539. lookAheadDist: 2.5,
  26540. softPushDist: .37,
  26541. softPushEnd: .3,
  26542. softBendAngle: 8,
  26543. softBendTilt: 4,
  26544. softBendEnd: .3,
  26545. doBurns: true, //r.valueFromHash("kb", !0),
  26546. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26547. minBurnsAngle: 35,
  26548. minDownAngle: -35,
  26549. maxTurnPerSec: 280,
  26550. maxAimPerSec: 35,
  26551. minRotation: 12,
  26552. maxAimRotation: 33.2,
  26553. turnFriction: .2,
  26554. flySpeed: .01,
  26555. minWarpTime: 1200,
  26556. warpInterruptionRedirectTime: 500,
  26557. tourStepDelay: r.valueFromHash("st", 0),
  26558. walkDelay: 0,
  26559. walkMaxDist: 50,
  26560. walkMinDist: .8,
  26561. walkSlideShowThreshhold: 3000,
  26562. walkExtraPanosDistance: .4,
  26563. timePerMeter: 1200,
  26564. motionLeadTime: 5000,
  26565. movementEasing: "easeInOutQuad",
  26566. blendEasing: "easeInOutQuad",
  26567. showBunny: !1,
  26568. loop: r.valueFromHash("lp", !1),
  26569. auto: r.valueFromHash("ts", -1),
  26570. eOrder: 'YXZ', //"YXZ",
  26571. stepFactor: .25,
  26572. brakeStrength: 2,
  26573. minBrakeAngle: .1,
  26574. maxBrakeAngle: 1.8,
  26575. climbEffort: 4
  26576. },
  26577. rotationFriction: .05,
  26578. rotationAccelerationInside: 4.5,
  26579. rotationAccelerationOutside: .15,
  26580. rotationAfterMoveMultiplier: 40,
  26581. rotationAfterMoveHistoryCount: 5,
  26582. panFriction: .09,
  26583. panAccelerationOutside: 60,
  26584. onload: r.valueFromHash("onload", o.PANORAMA),
  26585. zoomNearLimit: .1,
  26586. zoomFarLimit: 50,
  26587. navigation: {
  26588. panoScores: !1,
  26589. mouseDirection: !0,
  26590. filterStrictness: .75,
  26591. angleFactor: -30,
  26592. directionFactor: 10,
  26593. distanceFactor: -1,
  26594. optionalityFactor: 3
  26595. },
  26596. sdkInit: !1,
  26597. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26598. console: r.valueFromHash("console", !1),
  26599. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26600. panoramaNeighbourMaxDistance: 5,
  26601. panoFloorClickRadius: .35,
  26602. showScreenshotLocations: !1,
  26603. showAxis: !1,
  26604. showNeighbourRaycasts: !1,
  26605. colorMarkerOnLoad: !1,
  26606. colorMarkerByFloor: !1,
  26607. tiling: {
  26608. panoPreRenderRepeatDelay: 2500,
  26609. panoPreRenderDelay: 500,
  26610. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26611. tilingFlagNames: ["usetiles", "tiles"],
  26612. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26613. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26614. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26615. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26616. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26617. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  26618. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26619. customCompression: r.valueFromHash("tilecustcomp", 0),
  26620. // mobileHighQualityOverride: !1,
  26621. mobileHighQualityOverride: 1,
  26622. allowUltraHighResolution: true
  26623. },
  26624. zoom: {
  26625. enabled: true,
  26626. forceOff: r.valueFromHash("nozoom", 0),
  26627. overridemax: r.valueFromHash("maxzoom", null),
  26628. overridemin: r.valueFromHash("minzoom", null),
  26629. max: d.highQualityMaxZoom,
  26630. min: 1,
  26631. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26632. activationThreshold: 1.1,
  26633. restoreTime: 500
  26634. },
  26635. profiling: {
  26636. enabled: r.valueFromHash("mem", !1)
  26637. }
  26638. };
  26639. p = h.deepExtend(p, d, {
  26640. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26641. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26642. panorama: {
  26643. transitionTime: 1e3,
  26644. modelAlpha: 0,
  26645. modelAlphaDelay: p.flydown.modelTextureDelay,
  26646. modelAlphaLength: 1,
  26647. skyboxOpacity: 1,
  26648. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26649. skyboxOpacityLength: .9,
  26650. fovLength: 1,
  26651. fovDelay: 0,
  26652. cameraMatrixDuration: .8,
  26653. cameraMatrixDelay: 0,
  26654. cameraMatrixEase: c.easeInCubic,
  26655. reticuleOpacity: 1,
  26656. markerOpacity: .3,
  26657. markerOpacityOnHover: 1
  26658. },
  26659. dollhouse: {
  26660. transitionTime: 1e3,
  26661. modelAlpha: 1,
  26662. modelAlphaDelay: 0,
  26663. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26664. skyboxOpacity: 0,
  26665. skyboxOpacityDelay: 0,
  26666. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26667. fovLength: 1,
  26668. fovDelay: 0,
  26669. cameraMatrixDuration: .8,
  26670. cameraMatrixDelay: .3,
  26671. cameraMatrixEase: c.easeInCubic,
  26672. reticuleOpacity: 1,
  26673. markerOpacity: 0,
  26674. markerOpacityOnHover: 0
  26675. },
  26676. floorplan: {
  26677. transitionTime: 1e3,
  26678. modelAlpha: 1,
  26679. modelAlphaDelay: 0,
  26680. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26681. skyboxOpacity: 0,
  26682. skyboxOpacityDelay: 0,
  26683. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26684. fovLength: 1,
  26685. fovDelay: 0,
  26686. cameraMatrixDuration: .5,
  26687. cameraMatrixDelay: 0,
  26688. cameraMatrixEase: c.easeOutCubic,
  26689. reticuleOpacity: 1,
  26690. markerOpacity: 0,
  26691. markerOpacityOnHover: 0,
  26692. cameraHeight: 50
  26693. },
  26694. transitioning: {
  26695. reticuleOpacity: 0,
  26696. markerOpacity: .3,
  26697. markerOpacityOnHover: 1
  26698. },
  26699. "floorplan-dollhouse": {
  26700. rotationDelay: 0,
  26701. rotationDuration: 1
  26702. },
  26703. "floorplan-panorama": {
  26704. rotationDelay: .5,
  26705. rotationDuration: 1
  26706. },
  26707. "dollhouse-panorama": {
  26708. rotationDelay: .5,
  26709. rotationDuration: 1
  26710. },
  26711. "dollhouse-floorplan": {
  26712. rotationDelay: 0,
  26713. rotationDuration: 1,
  26714. cameraMatrixDuration: 1.05,
  26715. cameraMatrixDelay: .5
  26716. },
  26717. "panorama-dollhouse": {
  26718. rotationDelay: 0,
  26719. rotationDuration: .5
  26720. },
  26721. "panorama-floorplan": {
  26722. transitionTime: 1500,
  26723. rotationDelay: 0,
  26724. rotationDuration: .5
  26725. }
  26726. }),
  26727. p.path.meshFree && (p.path.typ = l.WALK),
  26728. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26729. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26730. t.exports = p
  26731. }
  26732. , {
  26733. "./constants": 8,
  26734. "./enum/Colors": 19,
  26735. "./enum/VROption": 47,
  26736. "./enum/Viewmode": 51,
  26737. "./enum/WarpStyle": 52,
  26738. "./util/browser": 182,
  26739. "./util/common": 185,
  26740. "./util/easing": 186,
  26741. "./util/showcase": 193,
  26742. three: 217
  26743. }],
  26744. 167: [function(e, t, i) {
  26745. "use strict";
  26746. var n = e("three")
  26747. , r = e("./settings")
  26748. , o = "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"
  26749. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26750. t.exports = {
  26751. basicTextured: {
  26752. uniforms: {
  26753. tDiffuse: {
  26754. type: "t",
  26755. value: null
  26756. },
  26757. alpha: {
  26758. type: "f",
  26759. value: 1
  26760. }
  26761. },
  26762. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26763. fragmentShader: "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}"
  26764. },
  26765. copyCubeMap: {
  26766. uniforms: {
  26767. tDiffuse: {
  26768. type: "t",
  26769. value: null
  26770. },
  26771. alpha: {
  26772. type: "f",
  26773. value: 1
  26774. }
  26775. },
  26776. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26777. fragmentShader: "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}"
  26778. },
  26779. cube: {
  26780. uniforms: {
  26781. map: {
  26782. type: "t",
  26783. value: null
  26784. },
  26785. opacity: {
  26786. type: "f",
  26787. value: 1
  26788. }
  26789. },
  26790. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26791. fragmentShader: a + "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"
  26792. },
  26793. model: {
  26794. uniforms: {
  26795. map: {
  26796. type: "t",
  26797. value: null
  26798. },
  26799. modelAlpha: {
  26800. type: "f",
  26801. value: r.modelAlpha
  26802. },
  26803. opacity: {
  26804. type: "f",
  26805. value: 1
  26806. },
  26807. progress: {
  26808. type: "f",
  26809. value: 0
  26810. },
  26811. blackout: {
  26812. type: "i",
  26813. value: 0
  26814. },
  26815. pano0Map: {
  26816. type: "t",
  26817. value: null
  26818. },
  26819. pano0Position: {
  26820. type: "v3",
  26821. value: new n.Vector3
  26822. },
  26823. pano0Matrix: {
  26824. type: "m4",
  26825. value: new n.Matrix4
  26826. },
  26827. pano1Map: {
  26828. type: "t",
  26829. value: null
  26830. },
  26831. pano1Position: {
  26832. type: "v3",
  26833. value: new n.Vector3
  26834. },
  26835. pano1Matrix: {
  26836. type: "m4",
  26837. value: new n.Matrix4
  26838. }
  26839. },
  26840. vertexShader: o + `uniform vec3 pano0Position;
  26841. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26842. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26843. varying vec3 vWorldPosition0;
  26844. varying vec3 vWorldPosition1;
  26845. uniform int blackout;
  26846. void main() {
  26847. vUv = uv;
  26848. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26849. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26850. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26851. vWorldPosition0.x *= -1.0;
  26852. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26853. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26854. vWorldPosition1.x *= -1.0;
  26855. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26856. }`,
  26857. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26858. 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
  26859. void main() {
  26860. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26861. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26862. vec4 colorFromPanos;
  26863. if (blackout == 5){
  26864. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26865. }else{
  26866. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26867. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26868. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26869. else if (blackout == 1) {
  26870. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26871. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26872. }
  26873. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26874. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26875. }
  26876. vec4 colorFromTexture = texture2D( map, vUv );
  26877. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26878. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26879. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26880. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26881. }`
  26882. },
  26883. hot:{
  26884. uniforms:{
  26885. color:{
  26886. type: "c",
  26887. value: new n.Color( 0xff2200 )
  26888. },
  26889. opac:{
  26890. type: "f",
  26891. value: 0
  26892. },
  26893. texture1:{
  26894. type: "t",
  26895. value: null
  26896. },
  26897. texture2:{
  26898. type: "t",
  26899. value: null
  26900. }
  26901. },
  26902. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26903. fragmentShader:"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"
  26904. },
  26905. modelOutside: {
  26906. uniforms: {
  26907. map: {
  26908. type: "t",
  26909. value: null
  26910. },
  26911. opacity: {
  26912. type: "f",
  26913. value: 1
  26914. }
  26915. },
  26916. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26917. fragmentShader: a + "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"
  26918. },
  26919. ribbon: {
  26920. uniforms: {
  26921. map: {
  26922. type: "t",
  26923. value: null
  26924. },
  26925. opacity: {
  26926. type: "f",
  26927. value: 1
  26928. },
  26929. color: {
  26930. type: "c",
  26931. value: new n.Color(r.path.color)
  26932. }
  26933. },
  26934. vertexShader: o + "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",
  26935. fragmentShader: a + "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"
  26936. },
  26937. waypoint: {
  26938. uniforms: {
  26939. map: {
  26940. type: "t",
  26941. value: null
  26942. },
  26943. opacity: {
  26944. type: "f",
  26945. value: 1
  26946. },
  26947. pulse: {
  26948. type: "f",
  26949. value: 1
  26950. },
  26951. nearFade: {
  26952. type: "v2",
  26953. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26954. },
  26955. color: {
  26956. type: "c",
  26957. value: new n.Color(r.reticuleColor)
  26958. }
  26959. },
  26960. vertexShader: o + "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",
  26961. fragmentShader: a + "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"
  26962. },
  26963. modelDebug: {
  26964. uniforms: {
  26965. map: {
  26966. type: "t",
  26967. value: null
  26968. },
  26969. modelAlpha: {
  26970. type: "f",
  26971. value: r.modelAlpha
  26972. },
  26973. depthmapRatio: {
  26974. type: "f",
  26975. value: 0
  26976. },
  26977. opacity: {
  26978. type: "f",
  26979. value: 1
  26980. },
  26981. progress: {
  26982. type: "f",
  26983. value: 0
  26984. },
  26985. considerOcclusion: {
  26986. type: "i",
  26987. value: r.fancierTransition
  26988. },
  26989. highlightPanoSelection: {
  26990. type: "i",
  26991. value: 0
  26992. },
  26993. useThirdPano: {
  26994. type: "i",
  26995. value: r.useThirdPano
  26996. },
  26997. pano0Map: {
  26998. type: "t",
  26999. value: null
  27000. },
  27001. pano0Depth: {
  27002. type: "t",
  27003. value: null
  27004. },
  27005. pano0Position: {
  27006. type: "v3",
  27007. value: new n.Vector3
  27008. },
  27009. pano0Matrix: {
  27010. type: "m4",
  27011. value: new n.Matrix4
  27012. },
  27013. pano0Weight: {
  27014. type: "f",
  27015. value: r.transition.pano0Weight
  27016. },
  27017. pano1Map: {
  27018. type: "t",
  27019. value: null
  27020. },
  27021. pano1Depth: {
  27022. type: "t",
  27023. value: null
  27024. },
  27025. pano1Position: {
  27026. type: "v3",
  27027. value: new n.Vector3
  27028. },
  27029. pano1Matrix: {
  27030. type: "m4",
  27031. value: new n.Matrix4
  27032. },
  27033. pano1Weight: {
  27034. type: "f",
  27035. value: r.transition.pano1Weight
  27036. },
  27037. pano2Map: {
  27038. type: "t",
  27039. value: null
  27040. },
  27041. pano2Depth: {
  27042. type: "t",
  27043. value: null
  27044. },
  27045. pano2Position: {
  27046. type: "v3",
  27047. value: new n.Vector3
  27048. },
  27049. pano2Matrix: {
  27050. type: "m4",
  27051. value: new n.Matrix4
  27052. },
  27053. pano2Weight: {
  27054. type: "f",
  27055. value: r.transition.pano2Weight
  27056. }
  27057. },
  27058. vertexShader: o + "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",
  27059. fragmentShader: a + "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"
  27060. },
  27061. customDepth: {
  27062. uniforms: {
  27063. panoPosition: {
  27064. type: "v3",
  27065. value: new n.Vector3
  27066. }
  27067. },
  27068. vertexShader: o + "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",
  27069. fragmentShader: a + "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"
  27070. },
  27071. skysphere: {
  27072. uniforms: {
  27073. radius: {
  27074. type: "f",
  27075. value: 0
  27076. }
  27077. },
  27078. vertexShader: o + "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",
  27079. fragmentShader: a + "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"
  27080. },
  27081. tagDisc: {
  27082. uniforms: {
  27083. opacity: {
  27084. type: "f",
  27085. value: 0
  27086. },
  27087. color: {
  27088. type: "c",
  27089. value: new n.Color
  27090. },
  27091. bg: {
  27092. type: "t",
  27093. value: null
  27094. },
  27095. mask: {
  27096. type: "t",
  27097. value: null
  27098. }
  27099. },
  27100. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27101. fragmentShader: a + "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"
  27102. }
  27103. }
  27104. }
  27105. , {
  27106. "./settings": 166,
  27107. three: 217
  27108. }],
  27109. 168: [function(e, t, i) {
  27110. (function(i) {
  27111. "use strict";
  27112. var n = e("three")
  27113. , r = (e("url"),
  27114. e("./util/ajax"))
  27115. , o = e("./settings")
  27116. , a = e("./util/logger")
  27117. , s = e("./util/math")
  27118. , l = e("./util/showcase")
  27119. , c = e("./objects/Panorama")
  27120. , h = new a(i)
  27121. , u = e("./model/Model")
  27122. , d = e("./shaders")
  27123. , p = e("./util/transitions")
  27124. , f = e("./objects/Chunk")
  27125. , g = e("./objects/Reticule")
  27126. , m = e("./objects/Skybox")
  27127. , v = e("./objects/Floor")
  27128. , A = e("./cameras/DollhouseCamera")
  27129. , y = e("./cameras/FloorplanCamera")
  27130. , C = e("./cameras/PanoramaCamera")
  27131. , I = e("./controls/DollhouseControls")
  27132. , E = e("./controls/FloorplanControls")
  27133. , b = e("./controls/PanoramaControls");
  27134. n.ImageUtils.crossOrigin = o.crossOrigin,
  27135. t.exports = {
  27136. shaders: d,
  27137. transitions: p,
  27138. Model: u,
  27139. Chunk: f,
  27140. Floor: v,
  27141. Skybox: m,
  27142. Reticule: g,
  27143. Panorama: c,
  27144. DollhouseCamera: A,
  27145. FloorplanCamera: y,
  27146. PanoramaCamera: C,
  27147. DollhouseControls: I,
  27148. FloorplanControls: E,
  27149. PanoramaControls: b,
  27150. getModel: function(e) {
  27151. if (!e.url)
  27152. throw 'getModel(): missing parameter "url"';
  27153. e.autoload = void 0 === e.autoload || e.autoload;
  27154. var t = l.parseSidUrl(e.url);
  27155. e.urlBase = t.urlBase,
  27156. e.urlModel = t.urlModel,
  27157. e.urlFiles = t.urlFiles;
  27158. var i = this._getPlatformError();
  27159. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27160. this._loadModel().then(this._buildModel.bind(this)))
  27161. },
  27162. _getPlatformError: function() {
  27163. return "IE" === $.ua.browser.name && parseInt($.ua.browser.major) < 11 ? "webgl-unsupported" : "iOS" === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version) ? "webgl-ios" : Modernizr.webgl ? null : "webgl-unsupported"
  27164. },
  27165. _loadModel: function() {
  27166. return r.get(this.options.urlModel, {
  27167. responseType: "json",
  27168. prefetchFrom: "model",
  27169. auth: l.getAuthorizationHeader()
  27170. }).then(null, function() {
  27171. return h.warn("Model loading failed at initial metadata load"),
  27172. "loading-failed"
  27173. })
  27174. },
  27175. _buildModel: function(e) {
  27176. e = l.normalizeModeldata(e, s);
  27177. var t = new u(this.options,e);
  27178. return this.options.autoload ? t.load(!0) : $.when(t)
  27179. }
  27180. }
  27181. }
  27182. ).call(this, "/js/showcase.js")
  27183. }
  27184. , {
  27185. "./cameras/DollhouseCamera": 5,
  27186. "./cameras/FloorplanCamera": 6,
  27187. "./cameras/PanoramaCamera": 7,
  27188. "./controls/DollhouseControls": 10,
  27189. "./controls/FloorplanControls": 11,
  27190. "./controls/PanoramaControls": 13,
  27191. "./model/Model": 139,
  27192. "./objects/Chunk": 144,
  27193. "./objects/Floor": 146,
  27194. "./objects/Panorama": 148,
  27195. "./objects/Reticule": 149,
  27196. "./objects/Skybox": 152,
  27197. "./settings": 166,
  27198. "./shaders": 167,
  27199. "./util/ajax": 181,
  27200. "./util/logger": 189,
  27201. "./util/math": 190,
  27202. "./util/showcase": 193,
  27203. "./util/transitions": 195,
  27204. three: 217,
  27205. url: 208
  27206. }],
  27207. 169: [function(e, t, i) {
  27208. "use strict";
  27209. function n() {
  27210. var e = {
  27211. renderTarget: null,
  27212. inUse: !1,
  27213. size: -1,
  27214. pano: null
  27215. };
  27216. return e
  27217. }
  27218. function r(e) {
  27219. M.push(e)
  27220. }
  27221. function o(e) {
  27222. var t = n();
  27223. return t.inUse = !0,
  27224. t.size = e,
  27225. r(t),
  27226. t
  27227. }
  27228. function a(e) {
  27229. for (var t = 0; t < M.length; t++) {
  27230. var i = M[t];
  27231. if (!i.inUse && i.size === e)
  27232. return i.inUse = !0,
  27233. i
  27234. }
  27235. return null
  27236. }
  27237. function s(e) {
  27238. for (var t = 0; t < M.length; t++) {
  27239. var i = M[t];
  27240. if (i.renderTarget === e)
  27241. return i.inUse = !1,
  27242. !0
  27243. }
  27244. return !1
  27245. }
  27246. function l() {
  27247. this.tileDirectory = {},
  27248. this.activeRenderTargetDescriptors = {},
  27249. this.activePanos = [],
  27250. this.panoLODDescriptors = {},
  27251. this.panoDescriptors = {},
  27252. this.tileTrees = {},
  27253. this.sceneRenderer = null,
  27254. this.tileDownloader = null,
  27255. this.forceQueue = [],
  27256. this.uploadQueues = {},
  27257. this.uploadInterval = null,
  27258. this.uploadIntervalCancelled = !1,
  27259. this.usingTileOverlay = !1,
  27260. this.overlayTilesLoaded = !1,
  27261. this.overlayTileBase = null,
  27262. this.overlayTilesBasic = {},
  27263. this.overlayTilesEnhanced = {},
  27264. this.zoomRenderTarget = null,
  27265. this.zoomPano = null,
  27266. this.zoomingActive = !1,
  27267. this.zoomPanoId = null,
  27268. this.zoomPanoRenderingDisabled = !1,
  27269. this.direction = new h.Vector3,
  27270. this.initTime = -1,
  27271. this.maxBaseUploadsPerFrame = x,
  27272. this.maxNonBaseUploadsPerFrame = T
  27273. }
  27274. function c() {
  27275. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27276. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27277. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27278. }
  27279. var h = e("three")
  27280. , u = e("../exception/BasicException")
  27281. , d = e("../settings")
  27282. , p = e("../enum/PanoSizeClass")
  27283. , f = (e("../objects/Panorama"),
  27284. e("../enum/PanoRendererEvents"))
  27285. , g = e("../enum/SceneRendererEvents")
  27286. , m = e("../enum/TileDownloaderEvents")
  27287. , v = e("../enum/Vectors")
  27288. , A = (e("../enum/GLCubeFaces"),
  27289. e("../objects/Panorama"),
  27290. e("./TileTree"))
  27291. , y = (e("./TileDownloader"),
  27292. e("./TilePrioritizer"))
  27293. , C = e("./TileUtils")
  27294. , p = e("../enum/PanoSizeClass")
  27295. , I = (e("../util/browser"),
  27296. e("../util/panorama"))
  27297. , E = e("events").EventEmitter
  27298. , b = !1
  27299. , w = d.tiling.uploadIntervalDelay
  27300. , _ = d.tiling.initialIntervalDelay
  27301. , T = d.tiling.maxNonBaseUploadsPerFrame
  27302. , x = d.tiling.maxBaseUploadsPerFrame
  27303. , S = {
  27304. Base: 0,
  27305. Remaining: 1
  27306. }
  27307. , M = [];
  27308. l.prototype = Object.create(E.prototype),
  27309. l.prototype.init = function(e, t, i) {
  27310. this.sceneRenderer = e,
  27311. this.tileDownloader = t,
  27312. this.qualityManager = i,
  27313. this.bindEvents(),
  27314. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27315. this.initTime = performance.now()
  27316. }
  27317. ,
  27318. l.prototype.getActivePanoTextures = function(e) {
  27319. e = e || [];
  27320. for (var t = 0; t < M.length; t++) {
  27321. var i = M[t];
  27322. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27323. }
  27324. }
  27325. ,
  27326. l.prototype.hasQueuedTiles = function() {
  27327. var e = this.peekNextFromUploadQueue();
  27328. return null !== e && void 0 !== e
  27329. }
  27330. ,
  27331. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27332. return this.activeRenderTargetDescriptors[e]
  27333. }
  27334. ,
  27335. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27336. this.activeRenderTargetDescriptors[e] = t
  27337. }
  27338. ,
  27339. l.prototype.loadOverlayTiles = function() {
  27340. if (0 !== d.tiling.overlayStyle) {
  27341. var e = 0
  27342. , t = function(t, n, r) {
  27343. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27344. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27345. e++,
  27346. e === i.length && (this.overlayTilesLoaded = !0)
  27347. }
  27348. .bind(this)
  27349. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  27350. i.forEach(function(e) {
  27351. this.tileDownloader.loadImage(e[0], 0, e[1])
  27352. }
  27353. .bind(this)),
  27354. this.usingTileOverlay = !0
  27355. } else
  27356. this.usingTileOverlay = !1
  27357. }
  27358. ,
  27359. l.prototype.bindEvents = function() {
  27360. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27361. }
  27362. ,
  27363. l.prototype.setupZoomRenderTarget = function() {
  27364. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27365. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27366. return;
  27367. var e = this.zoomRenderTarget;
  27368. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  27369. e) {
  27370. var t = e.width
  27371. , i = this.zoomRenderTarget.width;
  27372. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27373. e.texture.dispose(),
  27374. e.texture.loaded = !1,
  27375. e.texture.version = 0,
  27376. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27377. e.texture = null
  27378. }
  27379. this.zoomPanoRenderingDisabled = !1
  27380. } else
  27381. this.zoomPanoRenderingDisabled = !0
  27382. }
  27383. ,
  27384. l.prototype.enableUltraHighQualityMode = function(e) {
  27385. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27386. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27387. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27388. t && (this.qualityManager.enableUltraHighQualityMode(),
  27389. this.setupZoomRenderTarget(),
  27390. e())
  27391. }
  27392. .bind(this))
  27393. }
  27394. }
  27395. ,
  27396. l.prototype.activateTiledPano = function(e, t, i) {
  27397. i && this.clearAllQueuedUploads();
  27398. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27399. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27400. this.linkAllTilesAndNodes(e);
  27401. var r = this.getActiveRenderTargetDescriptor(e.id)
  27402. , l = t;
  27403. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27404. !r || l !== r.size) {
  27405. if (r && s(r.renderTarget),
  27406. r = a(l),
  27407. !r) {
  27408. var c = this.initTiledPano(l, !1);
  27409. r = o(c.width),
  27410. r.renderTarget = c
  27411. }
  27412. r.pano = e,
  27413. this.resetPanoDescriptor(e.id),
  27414. this.resetPanoLODDescriptors(e.id),
  27415. this.resetRenderStatus(e.id, !0, !0)
  27416. }
  27417. this.setActiveRenderTargetDescriptor(e.id, r);
  27418. var h = i ? 0 : 1;
  27419. return this.updateActivePanos(e, h),
  27420. r.renderTarget
  27421. }
  27422. ,
  27423. l.prototype.deactivateTiledPano = function(e) {
  27424. var t = this.getActiveRenderTargetDescriptor(e.id);
  27425. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27426. this.setActiveRenderTargetDescriptor(e.id, null);
  27427. var i = this.getUploadQueueForPano(e.id);
  27428. this.clearUploadQueue(i),
  27429. this.updateActivePanos()
  27430. }
  27431. ,
  27432. l.prototype.updateActivePanos = function() {
  27433. var e = [];
  27434. return function(t, i) {
  27435. e.length = 0;
  27436. for (var n = 0; n < this.activePanos.length; n++) {
  27437. t && e.length === i && e.push(t);
  27438. var r = this.activePanos[n]
  27439. , o = this.getActiveRenderTargetDescriptor(r.id);
  27440. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27441. }
  27442. t && i >= e.length && e.push(t),
  27443. this.activePanos.length = 0,
  27444. this.activePanos.push.apply(this.activePanos, e)
  27445. }
  27446. }(),
  27447. l.prototype.getActivePanoCount = function() {
  27448. return this.activePanos.length
  27449. }
  27450. ,
  27451. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27452. var r = null;
  27453. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27454. for (var o = function(e, n, r, o) {
  27455. i && (n.tile.zoomUploaded = !1),
  27456. t && (n.tile.uploaded = !1)
  27457. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27458. var s = this.getTileTree(e, a);
  27459. s.breadthFirst({
  27460. callback: o.bind(this, a),
  27461. minLevel: r
  27462. })
  27463. }
  27464. }
  27465. ,
  27466. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27467. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27468. t.tile.zoomUploaded = t.tile.uploaded,
  27469. t.zoomCovered = t.covered
  27470. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27471. var r = this.getTileTree(e, n);
  27472. r.breadthFirst({
  27473. callback: i.bind(this, n),
  27474. maxLevel: t
  27475. })
  27476. }
  27477. }
  27478. ,
  27479. l.prototype.renderPanoTiles = function() {
  27480. var e = [];
  27481. return function(t, i, n, r) {
  27482. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27483. i = i || this.direction || v.FORWARD;
  27484. var o = this.getActiveRenderTargetDescriptor(t);
  27485. if (!this.isRenderTargetDescriptorValid(o))
  27486. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27487. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27488. var s = this.getTileTree(t, a);
  27489. e.length = 0,
  27490. s.breadthFirst({
  27491. saveVisited: e
  27492. });
  27493. for (var l = 0; l < e.length; l++) {
  27494. var c = e[l];
  27495. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27496. }
  27497. }
  27498. this.updateDirection(i)
  27499. }
  27500. }(),
  27501. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27502. return e && e.renderTarget
  27503. }
  27504. ,
  27505. l.prototype.isPanoActive = function(e) {
  27506. var t = this.getActiveRenderTargetDescriptor(e);
  27507. return this.isRenderTargetDescriptorValid(t)
  27508. }
  27509. ,
  27510. l.prototype.isPanoZoomed = function(e) {
  27511. return this.zoomingActive && this.zoomPanoId === e
  27512. }
  27513. ,
  27514. l.prototype.initTileTree = function(e, t, i) {
  27515. var n = this.tileTrees[e];
  27516. n || (n = [],
  27517. this.tileTrees[e] = n);
  27518. var r = n[t];
  27519. if (!r) {
  27520. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27521. r = new A(C.TILE_SIZE,o),
  27522. n[t] = r
  27523. }
  27524. }
  27525. ,
  27526. l.prototype.getTileTree = function(e, t) {
  27527. var i = this.tileTrees[e];
  27528. if (!i)
  27529. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27530. var n = i[t];
  27531. if (!n)
  27532. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27533. return n
  27534. }
  27535. ,
  27536. l.prototype.initTiledPano = function(e, t) {
  27537. var i = this.sceneRenderer.renderer
  27538. , n = (i.context,
  27539. new h.WebGLRenderTargetCube(e,e,{
  27540. stencilBuffer: !1
  27541. }))
  27542. , r = new h.CubeTexture([]);
  27543. n.texture = r,
  27544. r.image = [null, null, null, null, null, null],
  27545. r.flipY = !0,
  27546. t ? (r.generateMipmaps = !0,
  27547. r.magFilter = h.LinearFilter,
  27548. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27549. r.magFilter = h.LinearFilter,
  27550. r.minFilter = h.LinearFilter),
  27551. r.format = h.RGBAFormat,
  27552. i.setRenderTarget(n),
  27553. i.setRenderTarget(null);
  27554. var o = i.properties.get(r);
  27555. return o.__image__webglTextureCube = o.__webglTexture,
  27556. n
  27557. }
  27558. ,
  27559. l.prototype.getUploadQueueForPano = function(e) {
  27560. var t = this.uploadQueues[e];
  27561. return t || (t = [],
  27562. this.uploadQueues[e] = t),
  27563. t
  27564. }
  27565. ,
  27566. l.prototype.isTileUploaded = function(e) {
  27567. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27568. }
  27569. ,
  27570. l.prototype.setUploaded = function(e, t) {
  27571. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27572. }
  27573. ,
  27574. l.prototype.queueTileUpload = function(e, t, i) {
  27575. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27576. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27577. var r = this.getUploadQueueForPano(e.panoId);
  27578. i ? this.uploadTile(e, !1) : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  27579. e.uploadQueued = !0,
  27580. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27581. }
  27582. }
  27583. ,
  27584. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27585. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27586. }
  27587. ,
  27588. l.prototype.getTopUploadQueue = function() {
  27589. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27590. for (var n = 0; n < this.activePanos.length; n++)
  27591. if (e = this.activePanos[n],
  27592. t = this.getUploadQueueForPano(e.id),
  27593. t.length > 0)
  27594. switch (i) {
  27595. case S.Base:
  27596. if (0 === t[0].level)
  27597. return t;
  27598. break;
  27599. case S.Remaining:
  27600. return t
  27601. }
  27602. return null
  27603. }
  27604. ,
  27605. l.prototype.getNextFromUploadQueue = function() {
  27606. var e = function(e) {
  27607. var t = e.shift();
  27608. return t.uploadQueued = !1,
  27609. t
  27610. };
  27611. return function() {
  27612. if (this.forceQueue.length > 0)
  27613. return e(this.forceQueue);
  27614. var t = this.getTopUploadQueue();
  27615. return t && t.length > 0 ? e(t) : null
  27616. }
  27617. }(),
  27618. l.prototype.peekNextFromUploadQueue = function() {
  27619. if (this.forceQueue.length > 0)
  27620. return this.forceQueue[0];
  27621. var e = this.getTopUploadQueue();
  27622. return e && e.length > 0 ? e[0] : null
  27623. }
  27624. ,
  27625. l.prototype.clearAllQueuedUploads = function() {
  27626. this.clearAllUploadQueues(null, 0)
  27627. }
  27628. ,
  27629. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27630. this.clearAllUploadQueues(e, 0)
  27631. }
  27632. ,
  27633. l.prototype.clearAllUploadQueues = function(e, t) {
  27634. if (e)
  27635. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27636. this.clearUploadQueue(this.forceQueue, t, e);
  27637. else {
  27638. for (var i = 0; i < this.activePanos.length; i++) {
  27639. var n = this.activePanos[i];
  27640. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27641. }
  27642. this.clearUploadQueue(this.forceQueue, t)
  27643. }
  27644. }
  27645. ,
  27646. l.prototype.clearUploadQueue = function(e, t, i) {
  27647. void 0 !== t && null !== t || (t = 0);
  27648. for (var n = 0; n < e.length; ) {
  27649. var r = e[n];
  27650. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27651. e.splice(n, 1)) : n++
  27652. }
  27653. }
  27654. ,
  27655. l.prototype.refreshUploadInterval = function() {
  27656. var e = null;
  27657. return function(t) {
  27658. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27659. null !== t && void 0 !== t || (t = w),
  27660. b || (t = _),
  27661. this.uploadInterval = window.setTimeout(e, t),
  27662. this.uploadIntervalDelay = t)
  27663. }
  27664. }(),
  27665. l.prototype.update = function() {
  27666. var e = performance.now()
  27667. , t = 0;
  27668. return function() {
  27669. this.uploadIntervalCancelled = !0,
  27670. window.clearTimeout(this.uploadInterval),
  27671. this.uploadInterval = null;
  27672. var i = performance.now() - e;
  27673. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27674. e = performance.now()),
  27675. t++
  27676. }
  27677. }(),
  27678. l.prototype.updateUploadQueue = function(e, t) {
  27679. e || (e = 1);
  27680. for (var i = 0, n = 0; ; ) {
  27681. if (n >= t || i >= e)
  27682. break;
  27683. var r = this.getNextFromUploadQueue();
  27684. if (!r)
  27685. break;
  27686. if (0 !== r.level ? i++ : n++,
  27687. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27688. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27689. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27690. }
  27691. }
  27692. }
  27693. ,
  27694. l.prototype.updateDirection = function(e) {
  27695. if (e = e || this.direction) {
  27696. this.direction = e;
  27697. for (var t = 0; t < this.activePanos.length; t++) {
  27698. var i = this.activePanos[t]
  27699. , n = this.getUploadQueueForPano(i.id);
  27700. y.sortPanoTiles(n, i, this.direction)
  27701. }
  27702. }
  27703. }
  27704. ,
  27705. l.prototype.uploadTile = function() {
  27706. var e = {}
  27707. , t = (new h.Vector4,
  27708. d.tiling.overlayStyle);
  27709. return function(i, n) {
  27710. var r = i.panoId
  27711. , o = i.image
  27712. , a = i.tileSize
  27713. , s = i.panoSize
  27714. , l = i.tileIndex
  27715. , c = (i.faceTileIndex,
  27716. i.totalTiles)
  27717. , u = (i.face,
  27718. i.tileX)
  27719. , d = i.tileY
  27720. , p = !0
  27721. , g = !1
  27722. , m = (this.getPanoDescriptor(r),
  27723. this.getPanoLODDescriptor(r, s))
  27724. , v = this.getActiveRenderTargetDescriptor(r)
  27725. , A = v.renderTarget
  27726. , y = v.size;
  27727. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27728. y = this.qualityManager.getMaxZoomPanoSize()),
  27729. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27730. g = !1),
  27731. n || (this.anyUploaded(i.node) && (p = !1,
  27732. g = !0),
  27733. this.isTileUploaded(i) && (p = !1,
  27734. g = !1)),
  27735. p) {
  27736. var C = u * a
  27737. , I = d * a
  27738. , E = a / s * y
  27739. , b = C / s * y
  27740. , w = I / s * y;
  27741. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27742. var _ = e[a];
  27743. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  27744. 1 === t || 2 === t) {
  27745. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27746. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27747. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27748. } else
  27749. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27750. m.uploadCount++,
  27751. this.emit(f.TileRenderSuccess, r, s, l, c),
  27752. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27753. this.setUploaded(i, !0),
  27754. this.addCoverageForNode(i.node)
  27755. } else
  27756. this.setUploaded(i, !1);
  27757. return i.uploadAttempted || (m.uploadAttempts++,
  27758. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27759. i.uploadAttempted = !0,
  27760. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27761. g
  27762. }
  27763. }(),
  27764. l.prototype.linkTileAndNode = function(e, t) {
  27765. t.tile = e,
  27766. e.node = t
  27767. }
  27768. ,
  27769. l.prototype.linkAllTilesAndNodes = function(e) {
  27770. for (var t = function(t, i, n, r, o) {
  27771. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27772. this.linkTileAndNode(a, n)
  27773. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27774. var n = this.getTileTree(e.id, i);
  27775. n.breadthFirst({
  27776. callback: t.bind(this, n, i)
  27777. })
  27778. }
  27779. }
  27780. ,
  27781. l.prototype.anyUploaded = function(e) {
  27782. if (!e)
  27783. return !1;
  27784. if (e.tile && this.isTileUploaded(e.tile))
  27785. return !0;
  27786. if (e.children)
  27787. for (var t = 0; t < e.children.length; t++) {
  27788. var i = e.children[t];
  27789. if (this.anyUploaded(i))
  27790. return !0
  27791. }
  27792. return !1
  27793. }
  27794. ,
  27795. l.prototype.setNodeCovered = function(e, t) {
  27796. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27797. }
  27798. ,
  27799. l.prototype.isNodeCovered = function(e) {
  27800. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27801. }
  27802. ,
  27803. l.prototype.addCoverageForNode = function(e) {
  27804. if (this.setNodeCovered(e, !0),
  27805. e.parent && e.covered) {
  27806. var t = e.parent;
  27807. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27808. }
  27809. }
  27810. ,
  27811. l.prototype.calcFullCoverage = function(e) {
  27812. var t = !1;
  27813. if (e.children)
  27814. for (var i = 0; i < e.children.length; i++) {
  27815. var n = e.children[i];
  27816. t = t || this.calcFullCoverage(n)
  27817. }
  27818. e.covered = e.tile.uploaded || t
  27819. }
  27820. ,
  27821. l.prototype.nodeSubcovered = function(e) {
  27822. if (!e.children)
  27823. return !1;
  27824. for (var t = 0; t < e.children.length; t++)
  27825. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27826. return !1;
  27827. return !0
  27828. }
  27829. ,
  27830. l.prototype.resetPanoDescriptor = function(e) {
  27831. this.getPanoDescriptor(e)
  27832. }
  27833. ,
  27834. l.prototype.getPanoDescriptor = function(e) {
  27835. var t = this.panoDescriptors[e];
  27836. return t || (t = {},
  27837. this.panoDescriptors[e] = t),
  27838. t
  27839. }
  27840. ,
  27841. l.prototype.resetPanoLODDescriptors = function(e) {
  27842. var t = this.getPanoLODDescriptors(e);
  27843. for (var i in t)
  27844. if (t.hasOwnProperty(i)) {
  27845. var n = t[i];
  27846. n.uploadCount = 0,
  27847. n.uploadAttempts = 0
  27848. }
  27849. }
  27850. ,
  27851. l.prototype.getPanoLODDescriptor = function(e, t) {
  27852. var i = this.getPanoLODDescriptors(e)
  27853. , n = i[t];
  27854. return n || (n = {
  27855. uploadCount: 0,
  27856. uploadAttempts: 0
  27857. },
  27858. i[t] = n),
  27859. n
  27860. }
  27861. ,
  27862. l.prototype.getPanoLODDescriptors = function(e) {
  27863. var t = this.panoLODDescriptors[e];
  27864. return t || (t = {},
  27865. this.panoLODDescriptors[e] = t),
  27866. t
  27867. }
  27868. ,
  27869. l.prototype.onTileDownloaded = function(e) {
  27870. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27871. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27872. if (i.downloaded = !0,
  27873. i.image = e.image,
  27874. i.panoSize = e.panoSize,
  27875. i.tileX = e.tileX,
  27876. i.tileY = e.tileY,
  27877. i.totalTiles = e.totalTiles,
  27878. i.tileIndex = e.tileIndex,
  27879. i.faceTileIndex = e.faceTileIndex,
  27880. i.face = e.face,
  27881. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27882. i.panoId = e.panoId,
  27883. i.tileSize = e.tileSize,
  27884. i.direction = (new h.Vector3).copy(e.direction),
  27885. i.node = null,
  27886. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27887. this.isPanoActive(i.panoId)) {
  27888. var n = this.getTileTree(i.panoId, i.face)
  27889. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27890. this.linkTileAndNode(i, r),
  27891. this.queueTileUpload(i, !0)
  27892. }
  27893. }
  27894. ,
  27895. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27896. var r = this.tileDirectory[e];
  27897. r || (r = {},
  27898. this.tileDirectory[e] = r);
  27899. var o = 16384 * t + 1024 * i + n
  27900. , a = r[o];
  27901. return a || (a = {
  27902. downloaded: !1,
  27903. uploaded: !1,
  27904. zoomUploaded: !1
  27905. },
  27906. r[o] = a),
  27907. a._key = e + ":" + t + ":" + i + ":" + n,
  27908. a._tileKey = o,
  27909. a
  27910. }
  27911. ,
  27912. l.prototype.setZoomingActive = function(e, t, i) {
  27913. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27914. this.zoomPanoId = t.id,
  27915. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27916. }
  27917. ,
  27918. l.prototype.updateZoomedPanoFromBase = function(e) {
  27919. if (!this.zoomPanoRenderingDisabled) {
  27920. var t = this.getActiveRenderTargetDescriptor(e.id);
  27921. if (t && t.renderTarget) {
  27922. var i = this.qualityManager.getMaxZoomPanoSize()
  27923. , n = t.renderTarget
  27924. , r = t.size;
  27925. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27926. this.copyBaseRenderStatusToZoomed(e.id)
  27927. }
  27928. }
  27929. }
  27930. ,
  27931. t.exports = l
  27932. }
  27933. , {
  27934. "../enum/GLCubeFaces": 25,
  27935. "../enum/PanoRendererEvents": 35,
  27936. "../enum/PanoSizeClass": 36,
  27937. "../enum/SceneRendererEvents": 43,
  27938. "../enum/TileDownloaderEvents": 45,
  27939. "../enum/Vectors": 50,
  27940. "../exception/BasicException": 55,
  27941. "../objects/Panorama": 148,
  27942. "../settings": 166,
  27943. "../util/browser": 182,
  27944. "../util/panorama": 191,
  27945. "./TileDownloader": 171,
  27946. "./TilePrioritizer": 172,
  27947. "./TileTree": 173,
  27948. "./TileUtils": 174,
  27949. events: 202,
  27950. three: 217
  27951. }],
  27952. 170: [function(e, t, i) {
  27953. "use strict";
  27954. function n(e, t, i) {
  27955. this.maxNavPanoSize = -1,
  27956. this.maxZoomPanoSize = -1,
  27957. this.devicePixelDensity = e,
  27958. this.deviceScreenSize = t,
  27959. this.clientBandwidth = i,
  27960. this.panoSizeClassMap = {},
  27961. this.useHighResolutionPanos = !0,
  27962. this.useUltraHighResolutionPanos = !1,
  27963. this.modelHasUltraHighPanos = !1
  27964. }
  27965. var r = e("../enum/PanoSizeClass")
  27966. , o = e("../settings")
  27967. , a = e("../util/browser")
  27968. , s = e("../constants")
  27969. , l = e("../util/showcase")
  27970. , c = e("../enum/ModelManagerEvents");
  27971. n.prototype.init = function(e) {
  27972. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27973. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27974. this.highSize = this.getPanoSize(r.HIGH),
  27975. this.standardSize = this.getPanoSize(r.STANDARD),
  27976. this.baseSize = this.getPanoSize(r.BASE),
  27977. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27978. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27979. this.updateMaximums(),
  27980. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27981. }
  27982. ,
  27983. n.prototype.updateFromModel = function(e) {
  27984. this.updateHighResolutionSettings(e),
  27985. this.updateUltraHighResolutionSettings(e)
  27986. }
  27987. ,
  27988. n.prototype.updateHighResolutionSettings = function(e) {
  27989. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27990. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27991. //this.useHighResolutionPanos = !0;
  27992. //----------------------e n d -----------------------------------------------------------------
  27993. this.updateMaximums()
  27994. }
  27995. ,
  27996. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27997. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27998. this.updateMaximums()
  27999. }
  28000. ,
  28001. n.prototype.enableUltraHighQualityMode = function() {
  28002. this.modelHasUltraHighPanos = !0,
  28003. this.updateUltraHighResolutionSettings(null)
  28004. }
  28005. ,
  28006. n.prototype.ultraHighQualityModeEnabled = function() {
  28007. return this.modelHasUltraHighPanos
  28008. }
  28009. ,
  28010. n.prototype.onModelChanged = function(e) {
  28011. this.updateFromModel(e.model),
  28012. this.updateMaximums()
  28013. }
  28014. ,
  28015. n.prototype.updateMaximums = function() {
  28016. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28017. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28018. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28019. }
  28020. ,
  28021. n.prototype.buildPanoSizeClassMap = function() {
  28022. this.panoSizeClassMap[r.BASE] = 512,
  28023. this.panoSizeClassMap[r.STANDARD] = 1024,
  28024. this.panoSizeClassMap[r.HIGH] = 2048,
  28025. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28026. }
  28027. ,
  28028. n.prototype.getPanoSize = function(e) {
  28029. return this.panoSizeClassMap[e]
  28030. }
  28031. ,
  28032. n.prototype.getMaxPossiblePanoSize = function() {
  28033. return this.getPanoSize(r.ULTRAHIGH)
  28034. }
  28035. ,
  28036. n.prototype.getMaxPanoSize = function() {
  28037. return this.maxZoomPanoSize
  28038. }
  28039. ,
  28040. n.prototype.getMaxNavPanoSize = function() {
  28041. return this.maxNavPanoSize
  28042. }
  28043. ,
  28044. n.prototype.getMaxZoomPanoSize = function() {
  28045. return this.maxZoomPanoSize
  28046. }
  28047. ,
  28048. n.prototype.detectMaxNavPanoSizeClass = function() {
  28049. if(settings.mobileNavHigh)return r.HIGH //改
  28050. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28051. }
  28052. ,
  28053. n.prototype.detectMaxNavPanoSize = function() {
  28054. var e = this.detectMaxNavPanoSizeClass();
  28055. return this.getPanoSize(e)
  28056. }
  28057. ,
  28058. n.prototype.detectMaxZoomPanoSize = function() {
  28059. 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)
  28060. }
  28061. ,
  28062. t.exports = n
  28063. }
  28064. , {
  28065. "../constants": 8,
  28066. "../enum/ModelManagerEvents": 33,
  28067. "../enum/PanoSizeClass": 36,
  28068. "../settings": 166,
  28069. "../util/browser": 182,
  28070. "../util/showcase": 193
  28071. }],
  28072. 171: [function(e, t, i) {
  28073. (function(i) {
  28074. "use strict";
  28075. function n(e) {
  28076. this.panos = null,
  28077. this.retryMinimumTime = 1e4,
  28078. this.urls = null,
  28079. this.panoLoadCallbacks = {},
  28080. this.downloadDescriptors = {},
  28081. this.priorityQueue = [],
  28082. this.forceQueue = [],
  28083. this.activeDownloads = [],
  28084. this.qualityManager = null,
  28085. this.tilePrioritizer = null,
  28086. this.refreshInterval = null,
  28087. this.processPriorityQueue = !1,
  28088. this.concurrentDownloads = e.concurrentDownloads || 1,
  28089. this.downloadTestResults = {}
  28090. }
  28091. var r = e("three")
  28092. , o = (e("../enum/Viewmode"),
  28093. e("../settings"))
  28094. , a = (e("../objects/Panorama"),
  28095. e("../util/logger"))
  28096. , s = (e("../enum/Vectors"),
  28097. e("../enum/PanoSizeClass"),
  28098. e("../enum/TileDownloaderEvents"))
  28099. , l = e("./TilePrioritizer")
  28100. , c = e("./TileUtils")
  28101. , h = (e("../enum/GLCubeFaces"),
  28102. e("../enum/DownloadStatus"))
  28103. , u = e("../util/panorama")
  28104. , d = e("../util/ajax")
  28105. , p = e("../ab")
  28106. , f = e("events").EventEmitter
  28107. , g = (new a(i),
  28108. Object.freeze({
  28109. Testing: 1,
  28110. Success: 2,
  28111. Fail: 3
  28112. }));
  28113. n.prototype = Object.create(f.prototype),
  28114. n.IDLE_REFRESH_DELAY = 500,
  28115. n.ACTIVE_REFRESH_DELAY = 16,
  28116. n.DOWNLOAD_RETRIES = 4,
  28117. n.prototype.init = function(e) {
  28118. this.qualityManager = e
  28119. }
  28120. ,
  28121. n.prototype.setUrls = function(e) {
  28122. this.urls = e
  28123. }
  28124. ,
  28125. n.prototype.setPanoData = function(e, t, i) {
  28126. this.panos = e,
  28127. this.imagePanos = t,
  28128. this.panoGroupId = i
  28129. }
  28130. ,
  28131. n.prototype.start = function() {
  28132. this.refreshUpdateInterval(0)
  28133. }
  28134. ,
  28135. n.prototype.stop = function() {
  28136. window.cancel(this.refreshInterval)
  28137. }
  28138. ,
  28139. n.prototype.refreshUpdateInterval = function(e) {
  28140. e || (e = 0),
  28141. this.refreshInterval = window.setTimeout(function() {
  28142. var e = this.update();
  28143. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28144. }
  28145. .bind(this), e)
  28146. }
  28147. ,
  28148. n.prototype.update = function() {
  28149. var e = this.forceQueue.length > 0;
  28150. return this.processQueueForDownloading(this.forceQueue),
  28151. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28152. this.priorityQueue.length > 0 && (e = !0),
  28153. this.processQueueForDownloading(this.priorityQueue)),
  28154. e
  28155. }
  28156. ,
  28157. n.prototype.forceQueueTilesForPano = function() {
  28158. var e = []
  28159. , t = [];
  28160. return function(i, n, r, o, a, s) {
  28161. e.length = 0;
  28162. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28163. var p = u[d];
  28164. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28165. }
  28166. if (r && e.length > 0) {
  28167. l.sortPanoTiles(e, i, r),
  28168. t.length = 0,
  28169. c.matchingTilesInDirection(i, n, r, o, a, t);
  28170. for (var f = 0, g = function(e) {
  28171. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28172. }; f < e.length; ) {
  28173. var m = e[f]
  28174. , v = t.findIndex(g);
  28175. v < 0 ? e.splice(f, 1) : f++
  28176. }
  28177. }
  28178. for (var A = 0; A < e.length; A++)
  28179. this.forceQueue.push(e[A]);
  28180. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28181. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28182. s && this.processQueueForDownloading(this.forceQueue, !0)
  28183. }
  28184. }(),
  28185. n.prototype.clearForceQueue = function() {
  28186. this.clearQueue(this.forceQueue)
  28187. }
  28188. ,
  28189. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28190. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28191. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28192. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28193. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28194. }
  28195. ,
  28196. n.prototype.clearQueue = function(e) {
  28197. this.setStatusForAllDescriptors(e, h.None),
  28198. e.length = 0
  28199. }
  28200. ,
  28201. n.prototype.clearFromQueue = function(e, t, i) {
  28202. for (var n = 0; n < e.length; n++) {
  28203. var r = e[n];
  28204. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28205. }
  28206. }
  28207. ,
  28208. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28209. for (var i = 0; i < e.length; i++) {
  28210. var n = e[i];
  28211. n && (n.status = t)
  28212. }
  28213. }
  28214. ,
  28215. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28216. for (var i = 0; i < e.length; i++) {
  28217. var n = e[i];
  28218. n && (n.status !== t ? n.status = t : e[i] = null)
  28219. }
  28220. }
  28221. ,
  28222. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28223. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28224. , n = i[t];
  28225. return n || (n = this.buildDownloadDescriptorArray(t),
  28226. i[t] = n,
  28227. this.initTileDownloadDescriptors(n, e, t)),
  28228. n
  28229. }
  28230. ,
  28231. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28232. var t = this.downloadDescriptors[e.id];
  28233. return t || (t = {},
  28234. this.downloadDescriptors[e.id] = t),
  28235. t
  28236. }
  28237. ,
  28238. n.prototype.processQueueForDownloading = function(e, t) {
  28239. if (this.cleanupActiveDownloads(),
  28240. this.activeDownloads.length < this.concurrentDownloads || t)
  28241. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28242. var o = e.shift();
  28243. o && (this.startDownload(o),
  28244. n++)
  28245. }
  28246. }
  28247. ,
  28248. n.prototype.testDownload = function(e, t, i) {
  28249. var n = this.downloadTestResults[e];
  28250. if (n)
  28251. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28252. this.downloadTestResults[e] = g.Testing;
  28253. var r = this.panos.list[0]
  28254. , o = this.getTileUrl(r.id, e, t, 0)
  28255. , a = function(t) {
  28256. this.downloadTestResults[e] = g.Success,
  28257. i(!0)
  28258. }
  28259. .bind(this)
  28260. , s = function() {
  28261. this.downloadTestResults[e] = g.Fail,
  28262. i(!1)
  28263. }
  28264. .bind(this);
  28265. this.loadImage(o, 0, a, s)
  28266. }
  28267. ,
  28268. n.prototype.startDownload = function(e) {
  28269. e.status = h.Downloading;
  28270. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28271. this.activeDownloads.push(e),
  28272. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28273. }
  28274. ,
  28275. n.prototype.downloadFailed = function(e, t) {}
  28276. ,
  28277. n.prototype.downloadComplete = function(e, t) {
  28278. if (e.panoGroupId === this.panoGroupId) {
  28279. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28280. e.status = h.Downloaded,
  28281. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28282. var n = {
  28283. panoId: e.pano.id,
  28284. image: t,
  28285. tileSize: e.tileSize,
  28286. panoSize: e.panoSize,
  28287. tileIndex: e.tileIndex,
  28288. faceTileIndex: e.faceTileIndex,
  28289. totalTiles: e.totalTiles,
  28290. face: e.face,
  28291. tileX: e.tileX,
  28292. tileY: e.tileY,
  28293. direction: e.direction
  28294. };
  28295. e.image = t,
  28296. this.emit(s.TileDownloadSuccess, n),
  28297. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28298. panoId: e.pano.id,
  28299. tileSize: e.tileSize,
  28300. panoSize: e.panoSize
  28301. },
  28302. this.emit(s.PanoDownloadComplete, n),
  28303. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28304. }
  28305. }
  28306. ,
  28307. n.prototype.cleanupActiveDownloads = function() {
  28308. var e = [];
  28309. return function() {
  28310. e.length = 0;
  28311. for (var t = 0; t < this.activeDownloads.length; t++) {
  28312. var i = this.activeDownloads[t];
  28313. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28314. }
  28315. this.activeDownloads.length = 0,
  28316. this.activeDownloads.push.apply(this.activeDownloads, e)
  28317. }
  28318. }(),
  28319. n.prototype.isPanoDownloaded = function(e, t) {
  28320. var i = this.getTileDownloadDescriptors(e, t);
  28321. if (i.length <= 0)
  28322. return !1;
  28323. for (var n = 0; n < i.length; n++) {
  28324. var r = i[n];
  28325. if (r.status !== h.Downloaded)
  28326. return !1
  28327. }
  28328. return !0
  28329. }
  28330. ,
  28331. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28332. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28333. this.panoLoadCallbacks[o] = {
  28334. onLoad: i,
  28335. onFail: n,
  28336. onProgress: r
  28337. }
  28338. }
  28339. ,
  28340. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28341. var i = e.id + ":" + t;
  28342. return this.panoLoadCallbacks[i]
  28343. }
  28344. ,
  28345. n.prototype.buildDownloadDescriptorArray = function(e) {
  28346. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28347. var r = this.buildDownloadDescriptor();
  28348. i.push(r)
  28349. }
  28350. return i
  28351. }
  28352. ,
  28353. n.prototype.buildDownloadDescriptor = function() {
  28354. var e = {
  28355. panoGroupId: null,
  28356. pano: null,
  28357. panoSize: -1,
  28358. tileSize: -1,
  28359. tileIndex: -1,
  28360. totalTiles: -1,
  28361. faceTileIndex: -1,
  28362. status: h.None,
  28363. url: null,
  28364. image: null,
  28365. direction: new r.Vector3,
  28366. face: -1,
  28367. cubeFace: -1,
  28368. tileX: -1,
  28369. tileY: -1
  28370. };
  28371. return e
  28372. }
  28373. ,
  28374. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28375. for (var n = 0; n < e.length; n++) {
  28376. var r = e[n];
  28377. this.initTileDownloadDescriptor(r, t, i, n)
  28378. }
  28379. }
  28380. ,
  28381. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28382. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28383. e.face = c.getFaceForTile(i, n),
  28384. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28385. e.panoGroupId = this.panoGroupId,
  28386. e.pano = t,
  28387. e.panoSize = i,
  28388. e.tileSize = r,
  28389. e.tileIndex = n,
  28390. e.totalTiles = c.getTileCountForSize(i),
  28391. e.status = h.None,
  28392. e.image = null,
  28393. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28394. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28395. }
  28396. ,
  28397. n.prototype.getTileUrl = function() {
  28398. var e = {
  28399. 256: "256",
  28400. 512: "512",
  28401. 1024: "1k",
  28402. 2048: "2k",
  28403. 4096: "4k"
  28404. }
  28405. , t = {
  28406. face: -1,
  28407. faceTileIndex: -1,
  28408. tileX: -1,
  28409. tileY: -1
  28410. };
  28411. return function(i, n, r, a) {
  28412. c.getTileLocation(n, a, t);
  28413. var s = Math.floor(n / r)
  28414. , l = s * s
  28415. , h = Math.floor(a / l)
  28416. , u = "";
  28417. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28418. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28419. return d = p.changeIfTileGenerating(d)
  28420. }
  28421. }(),
  28422. n.prototype.loadImage = function(e, t, i, n) {
  28423. d.getImage(e, t).then(function(e) {
  28424. i(e)
  28425. }).fail(n)
  28426. }
  28427. ,
  28428. t.exports = n
  28429. }
  28430. ).call(this, "/js/tile/TileDownloader.js")
  28431. }
  28432. , {
  28433. "../ab": 3,
  28434. "../enum/DownloadStatus": 24,
  28435. "../enum/GLCubeFaces": 25,
  28436. "../enum/PanoSizeClass": 36,
  28437. "../enum/TileDownloaderEvents": 45,
  28438. "../enum/Vectors": 50,
  28439. "../enum/Viewmode": 51,
  28440. "../objects/Panorama": 148,
  28441. "../settings": 166,
  28442. "../util/ajax": 181,
  28443. "../util/logger": 189,
  28444. "../util/panorama": 191,
  28445. "./TilePrioritizer": 172,
  28446. "./TileUtils": 174,
  28447. events: 202,
  28448. three: 217
  28449. }],
  28450. 172: [function(e, t, i) {
  28451. (function(i) {
  28452. "use strict";
  28453. function n(e, t, i, o, a) {
  28454. this.qualityManager = e,
  28455. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28456. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28457. this.baseSize = t,
  28458. this.standardSize = i,
  28459. this.highSize = o,
  28460. this.ultraHighSize = a,
  28461. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28462. }
  28463. var r = e("three")
  28464. , o = (e("../enum/Viewmode"),
  28465. e("../settings"),
  28466. e("../settings"),
  28467. e("../objects/Panorama"))
  28468. , a = e("../util/logger")
  28469. , s = (e("../enum/Vectors"),
  28470. e("../enum/PanoSizeClass"),
  28471. e("../enum/ModelManagerEvents"),
  28472. e("../enum/GLCubeFaces"),
  28473. e("../enum/DownloadStatus"))
  28474. , l = (e("../util/browser"),
  28475. e("./TileUtils"))
  28476. , c = e("../util/math")
  28477. , h = (e("events").EventEmitter,
  28478. new a(i),
  28479. Object.freeze({
  28480. None: 0,
  28481. DirectionalFOV: 1
  28482. }));
  28483. n.PriorityCriteria = function(e, t, i, n, o) {
  28484. this.pano = e,
  28485. this.cameraPosition = (new r.Vector3).copy(t),
  28486. this.cameraDir = (new r.Vector3).copy(i),
  28487. this.panoSpaceDir = (new r.Vector3).copy(n),
  28488. this.upcomingPanos = o,
  28489. this.copy = function(e) {
  28490. this.pano = e.pano,
  28491. this.cameraPosition.copy(e.cameraPosition),
  28492. this.cameraDir.copy(e.cameraDir),
  28493. this.panoSpaceDir.copy(e.panoSpaceDir),
  28494. this.upcomingPanos = o
  28495. }
  28496. ,
  28497. this.zoomingActive = !1
  28498. }
  28499. ,
  28500. n.DIRECTIONAL_FOV = 180,
  28501. n.DIRECTIONAL_FOV_NARROW = 120,
  28502. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28503. n.MAX_SCORED_PANOS_TOADD = 2,
  28504. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28505. n.DIRECTION_SCORE_STRICTNESS = .75,
  28506. n.appendQueue = function(e, t) {
  28507. if (e && t)
  28508. for (var i = 0; i < t.length; i++)
  28509. e.push(t[i])
  28510. }
  28511. ,
  28512. n.prototype.updateCriteria = function(e, t, i, n) {
  28513. this.priorityCriteria.pano = e,
  28514. this.priorityCriteria.cameraPosition.copy(t),
  28515. this.priorityCriteria.cameraDir.copy(i),
  28516. this.priorityCriteria.upcomingPanos = n,
  28517. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28518. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28519. }
  28520. ,
  28521. n.prototype.filterAndPrioritize = function() {
  28522. var e = []
  28523. , t = []
  28524. , i = [];
  28525. return function(r, o, a) {
  28526. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28527. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28528. var s = this.baseSize
  28529. , l = this.standardSize
  28530. , c = this.highSize
  28531. , h = this.ultraHighSize;
  28532. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28533. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28534. i.length = 0,
  28535. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28536. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28537. n.appendQueue(r, i),
  28538. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28539. i.length = 0,
  28540. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28541. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28542. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28543. n.appendQueue(r, i),
  28544. i.length = 0,
  28545. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28546. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28547. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28548. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28549. n.appendQueue(r, i),
  28550. this.queueTilesForPanos(r, e, a, s)
  28551. }
  28552. }(),
  28553. n.prototype.canDownloadSize = function(e) {
  28554. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28555. }
  28556. ,
  28557. n.prototype.populateNeighborPanos = function(e, t, i) {
  28558. i = i || [],
  28559. i.length = 0;
  28560. var n = t.getNeighbours(e);
  28561. for (var r in n)
  28562. if (n.hasOwnProperty(r)) {
  28563. var o = t.get(r);
  28564. i.push(o)
  28565. }
  28566. return i
  28567. }
  28568. ,
  28569. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28570. i = i || [],
  28571. i.length = 0;
  28572. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28573. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28574. , c = t.sortByScore(s, l);
  28575. if (c)
  28576. for (var h = 0; h < c.length && h < a; h++) {
  28577. var u = c[h].pano;
  28578. i.push(u)
  28579. }
  28580. return i
  28581. }
  28582. ,
  28583. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28584. for (var o = 0, a = 0; a < t.length; a++) {
  28585. var s = t[a]
  28586. , l = this.queueTilesForPano(e, i, s, n);
  28587. if (o += l > 0 ? 1 : 0,
  28588. r && o >= r)
  28589. break
  28590. }
  28591. return o
  28592. }
  28593. ,
  28594. n.prototype.queueTilesForPano = function() {
  28595. var e = {
  28596. filter: h.None
  28597. };
  28598. return function(t, i, n, r) {
  28599. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28600. }
  28601. }(),
  28602. n.prototype.queueTilesForPanosInDirection = function() {
  28603. var e = new r.Vector3;
  28604. return function(t, i, n, r, o, a, s, l) {
  28605. for (var h = 0, u = 0; u < n.length; u++) {
  28606. var d = n[u];
  28607. e.copy(d.position),
  28608. e.sub(o),
  28609. e.normalize();
  28610. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28611. , f = c.getFOVDotThreshold(s);
  28612. if (p >= f) {
  28613. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28614. if (h += g > 0 ? 1 : 0,
  28615. l && h >= l)
  28616. break
  28617. }
  28618. }
  28619. return h
  28620. }
  28621. }(),
  28622. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28623. for (var l = 0, c = 0; c < i.length; c++) {
  28624. var h = i[c]
  28625. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28626. if (l += u > 0 ? 1 : 0,
  28627. s && l >= s)
  28628. break
  28629. }
  28630. return l
  28631. }
  28632. ,
  28633. n.prototype.queueTilesInDirectionForPano = function() {
  28634. var e = {
  28635. filter: h.DirectionalFOV,
  28636. direction: new r.Vector3,
  28637. fov: 60
  28638. }
  28639. , t = new r.Vector3;
  28640. return function(i, n, r, o, a, s, c) {
  28641. return t.copy(s),
  28642. l.getRelativeDirection(r.quaternion, t),
  28643. e.direction.copy(t),
  28644. e.fov = c,
  28645. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28646. }
  28647. }(),
  28648. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28649. var e = [];
  28650. return function(t, i, n, r, o) {
  28651. var a = i.getTileDownloadDescriptors(n, r);
  28652. e.length = 0,
  28653. this.filterTileDownloadDescriptors(n, a, e, o);
  28654. for (var s = 0, l = 0; l < e.length; l++) {
  28655. var c = e[l];
  28656. c && (t.push(c),
  28657. s++)
  28658. }
  28659. return s
  28660. }
  28661. }(),
  28662. n.prototype.filterTileDownloadDescriptors = function() {
  28663. new r.Vector3;
  28664. return function(e, t, i, n) {
  28665. var r, o;
  28666. switch (n.filter) {
  28667. case h.DirectionalFOV:
  28668. for (r = 0; r < t.length; r++)
  28669. o = t[r],
  28670. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28671. break;
  28672. default:
  28673. for (r = 0; r < t.length; r++)
  28674. o = t[r],
  28675. i.push(o)
  28676. }
  28677. for (r = 0; r < i.length; r++)
  28678. o = i[r],
  28679. this.canIncludeDescriptor(o) || (i[r] = null)
  28680. }
  28681. }(),
  28682. n.prototype.canIncludeDescriptor = function(e) {
  28683. return e.status !== s.Downloading && e.status !== s.Downloaded
  28684. }
  28685. ,
  28686. n.prototype.canIncludePano = function(e, t) {
  28687. return !e.isLoaded(t)
  28688. }
  28689. ,
  28690. n.getFOVDotThreshold = function(e) {
  28691. return Math.cos(r.Math.degToRad(e / 2))
  28692. }
  28693. ;
  28694. var u = function() {
  28695. var e = function e(t, i) {
  28696. var n = e._panoSpaceDir
  28697. , r = e._fovThreshold
  28698. , o = e._fovThresholdNarrow
  28699. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28700. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28701. return t._dot = a,
  28702. i._dot = s,
  28703. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  28704. };
  28705. return e._panoSpaceDir = new r.Vector3,
  28706. e._fovThreshold = -1,
  28707. e._fovThresholdNarrow = -1,
  28708. e
  28709. }();
  28710. n.sortPanoTiles = function(e, t, i) {
  28711. u._panoSpaceDir.copy(i),
  28712. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28713. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28714. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28715. e.sort(u)
  28716. }
  28717. ,
  28718. n.insertSortedPanoTile = function(e, t, i, r) {
  28719. u._panoSpaceDir.copy(r),
  28720. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28721. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28722. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28723. for (var o = -1, a = 0; a < e.length; a++) {
  28724. var s = u(t, e[a]);
  28725. if (s <= 0) {
  28726. o = a;
  28727. break
  28728. }
  28729. }
  28730. if (o === -1)
  28731. e[e.length] = t;
  28732. else {
  28733. for (var h = e.length; h > o; h--)
  28734. e[h] = e[h - 1];
  28735. e[o] = t
  28736. }
  28737. }
  28738. ,
  28739. n.prototype.setZoomingActive = function(e) {
  28740. e !== this.zoomingActive && (this.zoomingActive = e)
  28741. }
  28742. ,
  28743. t.exports = n
  28744. }
  28745. ).call(this, "/js/tile/TilePrioritizer.js")
  28746. }
  28747. , {
  28748. "../enum/DownloadStatus": 24,
  28749. "../enum/GLCubeFaces": 25,
  28750. "../enum/ModelManagerEvents": 33,
  28751. "../enum/PanoSizeClass": 36,
  28752. "../enum/Vectors": 50,
  28753. "../enum/Viewmode": 51,
  28754. "../objects/Panorama": 148,
  28755. "../settings": 166,
  28756. "../util/browser": 182,
  28757. "../util/logger": 189,
  28758. "../util/math": 190,
  28759. "./TileUtils": 174,
  28760. events: 202,
  28761. three: 217
  28762. }],
  28763. 173: [function(e, t, i) {
  28764. "use strict";
  28765. function n(e, t) {
  28766. this.levels = t,
  28767. this.tileSize = e,
  28768. this.root = null,
  28769. this.allNodes = [],
  28770. a(this)
  28771. }
  28772. function r(e, t) {
  28773. this.tree = e,
  28774. this.parent = t,
  28775. this.children = [],
  28776. this.id = ++u
  28777. }
  28778. function o(e, t, i, r, a, s, l, h) {
  28779. if (e) {
  28780. l = l || n.TraversalType.PreOrder;
  28781. var u = r * c + i;
  28782. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28783. s && s.push(e)),
  28784. e.children && 0 !== e.children.length) {
  28785. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28786. for (var g = 0; g < c; g++)
  28787. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28788. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28789. s && s.push(e))
  28790. }
  28791. }
  28792. }
  28793. function a(e) {
  28794. e.root = s(e, null, 0)
  28795. }
  28796. function s(e, t, i) {
  28797. if (i > e.levels)
  28798. return null;
  28799. var n = new r(e,t);
  28800. e.allNodes.push(n);
  28801. for (var o = 0; o < h; o++)
  28802. n.children[o] = s(e, n, i + 1);
  28803. return n
  28804. }
  28805. function l(e, t, i, n, r) {
  28806. if (!e)
  28807. return null;
  28808. if (0 === i)
  28809. return e;
  28810. if (!e.children || 0 === e.children.length)
  28811. return null;
  28812. var o = Math.pow(c, i)
  28813. , a = o / c
  28814. , s = n % a
  28815. , h = r % a
  28816. , u = Math.floor(r / a)
  28817. , d = Math.floor(n / a)
  28818. , p = u * c + d
  28819. , f = e.children[p];
  28820. return l(f, t + 1, i - 1, s, h)
  28821. }
  28822. var c = (e("three"),
  28823. e("./TileUtils"),
  28824. e("../objects/Panorama"),
  28825. e("../util/panorama"),
  28826. e("events").EventEmitter,
  28827. 2)
  28828. , h = c * c;
  28829. n.TraversalType = Object.freeze({
  28830. PreOrder: 0,
  28831. PostOrder: 1
  28832. });
  28833. var u = 0;
  28834. n.getLevelCountForSize = function(e, t) {
  28835. var i = 0;
  28836. for (t < e && (t = e); ; ) {
  28837. if (t /= c,
  28838. t < e)
  28839. break;
  28840. i++
  28841. }
  28842. return i
  28843. }
  28844. ,
  28845. n.getSizeForLevel = function(e, t) {
  28846. return Math.pow(c, t) * e
  28847. }
  28848. ,
  28849. n.prototype.getSubNode = function(e, t, i) {
  28850. (!t || e < this.tileSize) && (t = 0),
  28851. (!i || e < this.tileSize) && (i = 0),
  28852. e < this.tileSize && (e = this.tileSize);
  28853. var r = n.getLevelCountForSize(this.tileSize, e)
  28854. , o = l(this.root, 0, r, t, i);
  28855. return o
  28856. }
  28857. ,
  28858. n.prototype.breadthFirst = function(e) {
  28859. e = e || {};
  28860. var t = !!e.nullLevelEnd
  28861. , i = e.maxLevel
  28862. , n = e.minLevel
  28863. , r = e.callback
  28864. , o = e.saveVisited
  28865. , a = []
  28866. , s = {}
  28867. , l = 0
  28868. , c = 0;
  28869. for (a.push(this.root),
  28870. a.push(s); a.length > 0 && !(i && l > i); ) {
  28871. var h = a.shift();
  28872. if (h === s)
  28873. (!n || l >= n) && (r && t && r(null),
  28874. o && t && o.push(null)),
  28875. a.length > 0 && a.push(s),
  28876. l++,
  28877. c = 0;
  28878. else {
  28879. if (h.children)
  28880. for (var u = 0; u < h.children.length; u++) {
  28881. var d = h.children[u];
  28882. d && a.push(h.children[u])
  28883. }
  28884. var p = this.getFaceIndexFromNode(h);
  28885. (!n || l >= n) && (r && r(h, l, p),
  28886. o && o.push(h)),
  28887. c++
  28888. }
  28889. }
  28890. }
  28891. ,
  28892. n.prototype.getFaceIndexFromNode = function(e) {
  28893. if (!e)
  28894. return -1;
  28895. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28896. var o = i.parent;
  28897. if (!o)
  28898. break;
  28899. for (var a = -1, s = 0; s < o.children.length; s++)
  28900. o.children[s] === i && (a = s);
  28901. var l = a % c
  28902. , h = Math.floor(a / c);
  28903. n = l * t + n,
  28904. r = h * t + r,
  28905. t *= c,
  28906. i = o
  28907. }
  28908. return r * t + n
  28909. }
  28910. ,
  28911. n.prototype.depthFirst = function(e, t, i) {
  28912. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28913. }
  28914. ,
  28915. t.exports = n
  28916. }
  28917. , {
  28918. "../objects/Panorama": 148,
  28919. "../util/panorama": 191,
  28920. "./TileUtils": 174,
  28921. events: 202,
  28922. three: 217
  28923. }],
  28924. 174: [function(e, t, i) {
  28925. "use strict";
  28926. var n = e("../enum/GLCubeFaces")
  28927. , r = e("../util/MathLight")
  28928. , o = {};
  28929. o.TILE_SIZE = 512,
  28930. o.FACES_PER_PANO = 6,
  28931. o.LocationOnTile = {
  28932. Center: 0,
  28933. UpperLeft: 1,
  28934. UpperRight: 2,
  28935. LowerRight: 3,
  28936. LowerLeft: 4
  28937. },
  28938. o.getTileVector = function() {
  28939. return function(e, t, i, a, s, l, c, h) {
  28940. l = l || o.LocationOnTile.Center;
  28941. var u = e / t
  28942. , d = a / u;
  28943. s = -s + (u - 1);
  28944. var p = s / u
  28945. , f = t / e
  28946. , g = 2 * f
  28947. , m = g / 2
  28948. , v = 2 * d - 1 + m
  28949. , A = 2 * p - 1 + m;
  28950. switch (l) {
  28951. case o.LocationOnTile.UpperLeft:
  28952. v -= m,
  28953. A += m,
  28954. v += c * g;
  28955. break;
  28956. case o.LocationOnTile.UpperRight:
  28957. v += m,
  28958. A += m,
  28959. A -= c * g;
  28960. break;
  28961. case o.LocationOnTile.LowerRight:
  28962. v += m,
  28963. A -= m,
  28964. v -= c * g;
  28965. break;
  28966. case o.LocationOnTile.LowerLeft:
  28967. v -= m,
  28968. A -= m,
  28969. A += c * g;
  28970. break;
  28971. case o.LocationOnTile.Center:
  28972. }
  28973. switch (i) {
  28974. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28975. r.setVector(h, -1, A, -v);
  28976. break;
  28977. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28978. r.setVector(h, 1, A, v);
  28979. break;
  28980. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28981. r.setVector(h, -v, 1, -A);
  28982. break;
  28983. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28984. r.setVector(h, -v, -1, A);
  28985. break;
  28986. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28987. r.setVector(h, -v, A, 1);
  28988. break;
  28989. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28990. r.setVector(h, v, A, -1)
  28991. }
  28992. r.normalize(h)
  28993. }
  28994. }(),
  28995. o.getFaceForTile = function(e, t) {
  28996. var i = o.TILE_SIZE;
  28997. e < o.TILE_SIZE && (i = e);
  28998. var n = Math.floor(e / i)
  28999. , r = n * n;
  29000. return Math.floor(t / r)
  29001. }
  29002. ,
  29003. o.getTileLocation = function(e, t, i) {
  29004. var n = o.TILE_SIZE;
  29005. e < o.TILE_SIZE && (n = e);
  29006. var r = o.getFaceForTile(e, t)
  29007. , a = Math.floor(e / n)
  29008. , s = a * a
  29009. , l = t - r * s;
  29010. i.tileX = l % a,
  29011. i.tileY = Math.floor(l / a),
  29012. i.face = r,
  29013. i.faceTileIndex = l
  29014. }
  29015. ,
  29016. o.getTileCountForSize = function(e) {
  29017. if (e <= o.TILE_SIZE)
  29018. return o.FACES_PER_PANO;
  29019. var t = Math.floor(e / o.TILE_SIZE)
  29020. , i = t * t
  29021. , n = i * o.FACES_PER_PANO;
  29022. return n
  29023. }
  29024. ,
  29025. o.getRelativeDirection = function() {
  29026. var e = new r.Matrix4
  29027. , t = new r.Quaternion;
  29028. return function(i, n) {
  29029. t.copy(i),
  29030. t.inverse(),
  29031. e.makeRotationFromQuaternion(t),
  29032. e.applyToVector3(n),
  29033. r.normalize(n)
  29034. }
  29035. }(),
  29036. o.matchingTilesInDirection = function() {
  29037. var e = new r.Vector3
  29038. , t = new r.Vector3(0,0,-1)
  29039. , i = new r.Quaternion
  29040. , n = function(e, t) {
  29041. e.push({
  29042. face: t.face,
  29043. faceTileIndex: t.faceTileIndex,
  29044. tileX: t.tileX,
  29045. tileY: t.tileY
  29046. })
  29047. }
  29048. , a = function() {
  29049. var e = {
  29050. face: -1,
  29051. faceTileIndex: -1,
  29052. tileX: -1,
  29053. tileY: -1
  29054. };
  29055. return function(t, i, r) {
  29056. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29057. o.getTileLocation(t, l, e),
  29058. i && !i(e) || (s++,
  29059. r && n(r, e));
  29060. return s
  29061. }
  29062. }();
  29063. return function(n, s, l, c, h, u) {
  29064. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29065. o.getTileCountForSize(s);
  29066. if (!c && !h)
  29067. return a(s, null, u);
  29068. var p = !!h;
  29069. if (h = h || c,
  29070. h = Math.max(0, Math.min(h, 360)),
  29071. c = Math.max(0, Math.min(c, 360)),
  29072. r.copyVector(l, e),
  29073. o.getRelativeDirection(n.quaternion, e),
  29074. p) {
  29075. i.setFromUnitVectors(e, t);
  29076. var f = function(e) {
  29077. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29078. };
  29079. return a(s, f, u)
  29080. }
  29081. var g = function(t) {
  29082. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29083. };
  29084. return a(s, g, u)
  29085. }
  29086. }(),
  29087. o.isTileWithinFrustum = function() {
  29088. var e = new r.Vector3
  29089. , t = 1e-5;
  29090. return function(i, n, a, s, l, c, h, u) {
  29091. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  29092. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29093. r.applyQuaternionToVector(c, e),
  29094. e.z >= -t)
  29095. I++;
  29096. else {
  29097. var w = -1 / e.z
  29098. , _ = e.x * w
  29099. , T = e.y * w;
  29100. T > d ? v++ : T < p && A++,
  29101. _ > f ? y++ : _ < g && C++,
  29102. E++
  29103. }
  29104. return A !== E && v !== E && y !== E && C !== E
  29105. }
  29106. }(),
  29107. o.isTileWithinFOV = function() {
  29108. var e = new r.Vector3
  29109. , t = new r.Vector3(0,1,0)
  29110. , i = new r.Vector3(1,0,0);
  29111. return function(n, a, s, l, c, h, u) {
  29112. var d = o.mapFaceToCubemapFace(s);
  29113. if (r.cross(h, t, i),
  29114. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29115. o.isWithinFOV(e, h, u, null))
  29116. return !0;
  29117. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29118. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29119. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29120. o.isWithinFOV(e, h, u, null))
  29121. return !0;
  29122. g += p
  29123. }
  29124. return !1
  29125. }
  29126. }(),
  29127. o.isWithinFOV = function() {
  29128. var e = new r.Vector3
  29129. , t = new r.Vector3;
  29130. return function(i, n, o, a) {
  29131. if (r.copyVector(i, t),
  29132. a) {
  29133. r.copyVector(a, e),
  29134. r.normalize(e);
  29135. var s = r.dot(e, i);
  29136. e.x *= s,
  29137. e.y *= s,
  29138. e.z *= s,
  29139. r.subVector(t, e)
  29140. }
  29141. var l = o / 2 * r.RADIANS_PER_DEGREE
  29142. , c = Math.cos(l)
  29143. , h = r.dot(t, n);
  29144. return h >= c
  29145. }
  29146. }(),
  29147. o.mapFaceToCubemapFace = function() {
  29148. var e = {
  29149. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29150. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29151. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29152. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29153. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29154. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29155. };
  29156. return function(t) {
  29157. return e[t]
  29158. }
  29159. }(),
  29160. t.exports = o
  29161. }
  29162. , {
  29163. "../enum/GLCubeFaces": 25,
  29164. "../util/MathLight": 176
  29165. }],
  29166. 175: [function(e, t, i) {
  29167. (function(i) {
  29168. "use strict";
  29169. function n() {
  29170. this.list = [],
  29171. this.index = {},
  29172. Object.defineProperty(this, "length", {
  29173. get: function() {
  29174. return this.list.length
  29175. }
  29176. })
  29177. }
  29178. var r = (e("./common"),
  29179. e("./logger"));
  29180. new r(i);
  29181. n.prototype.forEach = function(e) {
  29182. this.list.forEach(e)
  29183. }
  29184. ,
  29185. n.prototype.add = function(e) {
  29186. this.list.push(e),
  29187. this.index[this.getIndex(e)] = e
  29188. }
  29189. ,
  29190. n.prototype.getIndex = function(e) {
  29191. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29192. }
  29193. ,
  29194. n.prototype.extend = function(e) {
  29195. for (var t = 0; t < e.length; t++)
  29196. this.add(e[t])
  29197. }
  29198. ,
  29199. n.prototype.get = function(e) {
  29200. return this.index[e]
  29201. }
  29202. ,
  29203. n.prototype.first = function() {
  29204. return this.list[0]
  29205. }
  29206. ,
  29207. n.prototype.last = function() {
  29208. return this.list[this.list.length - 1]
  29209. }
  29210. ,
  29211. n.prototype.reIndex = function() {
  29212. this.index = {};
  29213. var e = this;
  29214. this.forEach(function(t) {
  29215. e.index[e.getIndex(t)] = t
  29216. })
  29217. }
  29218. ,
  29219. n.prototype.filter = function(e) {
  29220. var t = this.list.filter(e);
  29221. return this.reIndex(),
  29222. t
  29223. }
  29224. ,
  29225. n.prototype.reduce = function(e, t) {
  29226. return this.list.reduce(e, t)
  29227. }
  29228. ,
  29229. n.prototype.sort = function(e) {
  29230. return this.list.sort(e)
  29231. }
  29232. ,
  29233. n.prototype.indexOf = function(e) {
  29234. for (var t = 0; t < this.list.length; ++t)
  29235. if (this.list[t] === e)
  29236. return t;
  29237. return -1
  29238. }
  29239. ,
  29240. t.exports = n
  29241. }
  29242. ).call(this, "/js/util/IndexedCollection.js")
  29243. }
  29244. , {
  29245. "./common": 185,
  29246. "./logger": 189
  29247. }],
  29248. 176: [function(e, t, i) {
  29249. "use strict";
  29250. var n = e("../constants")
  29251. , r = {};
  29252. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29253. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29254. r.Vector3 = function(e, t, i) {
  29255. this.x = e || 0,
  29256. this.y = t || 0,
  29257. this.z = i || 0
  29258. }
  29259. ,
  29260. r.Matrix4 = function() {
  29261. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29262. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29263. }
  29264. ,
  29265. r.Matrix4.prototype = {
  29266. identity: function() {
  29267. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29268. this
  29269. },
  29270. copy: function(e) {
  29271. return this.elements.set(e.elements),
  29272. this
  29273. },
  29274. applyToVector3: function(e) {
  29275. var t = e.x
  29276. , i = e.y
  29277. , n = e.z
  29278. , r = this.elements;
  29279. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29280. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29281. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29282. this
  29283. },
  29284. getInverse: function(e, t) {
  29285. var i = this.elements
  29286. , n = e.elements
  29287. , r = n[0]
  29288. , o = n[1]
  29289. , a = n[2]
  29290. , s = n[3]
  29291. , l = n[4]
  29292. , c = n[5]
  29293. , h = n[6]
  29294. , u = n[7]
  29295. , d = n[8]
  29296. , p = n[9]
  29297. , f = n[10]
  29298. , g = n[11]
  29299. , m = n[12]
  29300. , v = n[13]
  29301. , A = n[14]
  29302. , y = n[15]
  29303. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29304. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29305. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29306. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29307. , w = r * C + o * I + a * E + s * b;
  29308. if (0 === w) {
  29309. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29310. if (t)
  29311. throw new Error(_);
  29312. return console.warn(_),
  29313. this.identity()
  29314. }
  29315. var T = 1 / w;
  29316. return i[0] = C * T,
  29317. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29318. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29319. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29320. i[4] = I * T,
  29321. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29322. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29323. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29324. i[8] = E * T,
  29325. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29326. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29327. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29328. i[12] = b * T,
  29329. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29330. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29331. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29332. this
  29333. },
  29334. makeRotationFromQuaternion: function(e) {
  29335. var t = this.elements
  29336. , i = e.x
  29337. , n = e.y
  29338. , r = e.z
  29339. , o = e.w
  29340. , a = i + i
  29341. , s = n + n
  29342. , l = r + r
  29343. , c = i * a
  29344. , h = i * s
  29345. , u = i * l
  29346. , d = n * s
  29347. , p = n * l
  29348. , f = r * l
  29349. , g = o * a
  29350. , m = o * s
  29351. , v = o * l;
  29352. return t[0] = 1 - (d + f),
  29353. t[4] = h - v,
  29354. t[8] = u + m,
  29355. t[1] = h + v,
  29356. t[5] = 1 - (c + f),
  29357. t[9] = p - g,
  29358. t[2] = u - m,
  29359. t[6] = p + g,
  29360. t[10] = 1 - (c + d),
  29361. t[3] = 0,
  29362. t[7] = 0,
  29363. t[11] = 0,
  29364. t[12] = 0,
  29365. t[13] = 0,
  29366. t[14] = 0,
  29367. t[15] = 1,
  29368. this
  29369. }
  29370. },
  29371. r.Quaternion = function(e, t, i, n) {
  29372. this._x = e || 0,
  29373. this._y = t || 0,
  29374. this._z = i || 0,
  29375. this._w = void 0 !== n ? n : 1
  29376. }
  29377. ,
  29378. r.Quaternion.prototype = {
  29379. get x() {
  29380. return this._x
  29381. },
  29382. set x(e) {
  29383. this._x = e
  29384. },
  29385. get y() {
  29386. return this._y
  29387. },
  29388. set y(e) {
  29389. this._y = e
  29390. },
  29391. get z() {
  29392. return this._z
  29393. },
  29394. set z(e) {
  29395. this._z = e
  29396. },
  29397. get w() {
  29398. return this._w
  29399. },
  29400. set w(e) {
  29401. this._w = e
  29402. },
  29403. copy: function(e) {
  29404. this._x = e.x,
  29405. this._y = e.y,
  29406. this._z = e.z,
  29407. this._w = e.w
  29408. },
  29409. inverse: function() {
  29410. return this.conjugate().normalize()
  29411. },
  29412. conjugate: function() {
  29413. return this._x *= -1,
  29414. this._y *= -1,
  29415. this._z *= -1,
  29416. this
  29417. },
  29418. length: function() {
  29419. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29420. },
  29421. normalize: function() {
  29422. var e = this.length();
  29423. return 0 === e ? (this._x = 0,
  29424. this._y = 0,
  29425. this._z = 0,
  29426. this._w = 1) : (e = 1 / e,
  29427. this._x = this._x * e,
  29428. this._y = this._y * e,
  29429. this._z = this._z * e,
  29430. this._w = this._w * e),
  29431. this
  29432. },
  29433. setFromAxisAngle: function(e, t) {
  29434. var i = t / 2
  29435. , n = Math.sin(i);
  29436. return this._x = e.x * n,
  29437. this._y = e.y * n,
  29438. this._z = e.z * n,
  29439. this._w = Math.cos(i),
  29440. this
  29441. },
  29442. setFromUnitVectors: function() {
  29443. var e, t, i = 1e-6;
  29444. return function(n, o) {
  29445. return void 0 === e && (e = new r.Vector3),
  29446. t = r.dot(n, o) + 1,
  29447. t < i ? (t = 0,
  29448. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  29449. this._x = e.x,
  29450. this._y = e.y,
  29451. this._z = e.z,
  29452. this._w = t,
  29453. this.normalize()
  29454. }
  29455. }(),
  29456. multiply: function(e) {
  29457. return this.multiplyQuaternions(this, e)
  29458. },
  29459. premultiply: function(e) {
  29460. return this.multiplyQuaternions(e, this)
  29461. },
  29462. multiplyQuaternions: function(e, t) {
  29463. var i = e._x
  29464. , n = e._y
  29465. , r = e._z
  29466. , o = e._w
  29467. , a = t._x
  29468. , s = t._y
  29469. , l = t._z
  29470. , c = t._w;
  29471. return this._x = i * c + o * a + n * l - r * s,
  29472. this._y = n * c + o * s + r * a - i * l,
  29473. this._z = r * c + o * l + i * s - n * a,
  29474. this._w = o * c - i * a - n * s - r * l,
  29475. this
  29476. }
  29477. },
  29478. r.convertWorkshopVector = function(e) {
  29479. return new r.Vector3(-e.x,e.y,e.z)
  29480. }
  29481. ,
  29482. r.convertWorkshopQuaternion = function(e) {
  29483. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29484. }
  29485. ;
  29486. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29487. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29488. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29489. }
  29490. ,
  29491. r.convertWorkshopPanoramaQuaternion = function(e) {
  29492. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  29493. }
  29494. ,
  29495. r.normalize = function(e) {
  29496. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29497. , i = Math.sqrt(t);
  29498. e.x /= i,
  29499. e.y /= i,
  29500. e.z /= i
  29501. }
  29502. ,
  29503. r.dot = function(e, t) {
  29504. return e.x * t.x + e.y * t.y + e.z * t.z
  29505. }
  29506. ,
  29507. r.cross = function(e, t, i) {
  29508. var n = e.x
  29509. , r = e.y
  29510. , o = e.z;
  29511. i.x = r * t.z - o * t.y,
  29512. i.y = o * t.x - n * t.z,
  29513. i.z = n * t.y - r * t.x
  29514. }
  29515. ,
  29516. r.setVector = function(e, t, i, n) {
  29517. e.x = t,
  29518. e.y = i,
  29519. e.z = n
  29520. }
  29521. ,
  29522. r.copyVector = function(e, t) {
  29523. t.x = e.x,
  29524. t.y = e.y,
  29525. t.z = e.z
  29526. }
  29527. ,
  29528. r.addVector = function(e, t) {
  29529. e.x += t.x,
  29530. e.y += t.y,
  29531. e.z += t.z
  29532. }
  29533. ,
  29534. r.subVector = function(e, t) {
  29535. e.x -= t.x,
  29536. e.y -= t.y,
  29537. e.z -= t.z
  29538. }
  29539. ,
  29540. r.applyQuaternionToVector = function(e, t) {
  29541. var i = t.x
  29542. , n = t.y
  29543. , r = t.z
  29544. , o = e.x
  29545. , a = e.y
  29546. , s = e.z
  29547. , l = e.w
  29548. , c = l * i + a * r - s * n
  29549. , h = l * n + s * i - o * r
  29550. , u = l * r + o * n - a * i
  29551. , d = -o * i - a * n - s * r;
  29552. t.x = c * l + d * -o + h * -s - u * -a,
  29553. t.y = h * l + d * -a + u * -o - c * -s,
  29554. t.z = u * l + d * -s + c * -a - h * -o
  29555. }
  29556. ,
  29557. r.angleBetweenVectors = function(e, t) {
  29558. return Math.acos(r.dot(e, t))
  29559. }
  29560. ,
  29561. t.exports = r
  29562. }
  29563. , {
  29564. "../constants": 8
  29565. }],
  29566. 177: [function(e, t, i) {
  29567. (function(i) {
  29568. "use strict";
  29569. function n(e) {
  29570. this.cache = null,
  29571. this.expires = 0
  29572. }
  29573. function r() {
  29574. this.baseUrl = null,
  29575. this.cache = null,
  29576. this.expires = 0
  29577. }
  29578. function o() {
  29579. this.baseUrl = null,
  29580. this.expires = 0
  29581. }
  29582. function a(e) {
  29583. this.initialLoadingPromise = null,
  29584. this.endpoint = e + "?type=3",
  29585. this.urlContainer = null,
  29586. this.authorizationHeader = h.getAuthorizationHeader(),
  29587. this.containerClasses = [o, r, n]
  29588. }
  29589. var s = e("./ajax")
  29590. , l = e("./logger")
  29591. , c = e("../constants")
  29592. , h = e("./showcase")
  29593. , u = (e("../ab"),
  29594. new l(i));
  29595. n.prototype = {
  29596. version: 1,
  29597. validate: function(e) {
  29598. return "catalog.json"in e && Object.keys(e).length > 0
  29599. },
  29600. update: function(e) {
  29601. return this.cache = e,
  29602. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29603. $.when()
  29604. },
  29605. get: function(e) {
  29606. return this.cache[e]
  29607. }
  29608. },
  29609. r.prototype = {
  29610. version: 2,
  29611. validate: function(e) {
  29612. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29613. },
  29614. update: function(e) {
  29615. return this.baseUrl = e["base.url"],
  29616. this.cache = e,
  29617. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29618. $.when()
  29619. },
  29620. get: function(e) {
  29621. var t = this.cache[e];
  29622. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29623. }
  29624. },
  29625. o.prototype = {
  29626. version: 3,
  29627. validate: function(e) {
  29628. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29629. },
  29630. update: function(e) {
  29631. return this.baseUrl = e.templates[0],
  29632. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29633. $.when()
  29634. },
  29635. get: function(e) {
  29636. return this.baseUrl.replace("{{filename}}", e)
  29637. }
  29638. },
  29639. a.prototype = {
  29640. init: function() {
  29641. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29642. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29643. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29644. this.refresh().done(function() {
  29645. u.debug("Refreshed")
  29646. }).fail(function() {
  29647. u.error("Failed url refresh, urls might go stale soon")
  29648. }))
  29649. }
  29650. .bind(this), c.signedUrlCheckInterval),
  29651. this.initialLoadingPromise = this.refresh(),
  29652. this.initialLoadingPromise)
  29653. },
  29654. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29655. e = e || {};
  29656. /*var t = void 0 === e.cache || e.cache;
  29657. return s.get( this.endpoint , { //file
  29658. responseType: "json",
  29659. prefetchFrom: t ? "files" : null,
  29660. cache: t,
  29661. auth: this.authorizationHeader
  29662. }).then(function(e) {
  29663. if (this.urlContainer && this.urlContainer.validate(e))
  29664. return this.urlContainer.update(e);
  29665. for (var i = 0; i < this.containerClasses.length; i++) {
  29666. var n = this.containerClasses[i]
  29667. , r = new n;
  29668. if (r.validate(e))
  29669. return u.info("Using urls version " + r.version),
  29670. this.urlContainer = r,
  29671. this.urlContainer.update(e)
  29672. }
  29673. return t ? this.refresh({
  29674. cache: !1
  29675. }) : $.Deferred().reject("missing-urls")
  29676. }
  29677. .bind(this), function(e) {
  29678. return "loading-failed"
  29679. }) */
  29680. return $.Deferred().resolve();
  29681. },
  29682. get: function(e) {
  29683. //return this.urlContainer.get(e)
  29684. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  29685. }
  29686. },
  29687. t.exports = a
  29688. }
  29689. ).call(this, "/js/util/ModelUrls.js")
  29690. }
  29691. , {
  29692. "../ab": 3,
  29693. "../constants": 8,
  29694. "./ajax": 181,
  29695. "./logger": 189,
  29696. "./showcase": 193
  29697. }],
  29698. 178: [function(e, t, i) {
  29699. (function(i) {
  29700. "use strict";
  29701. function n() {
  29702. u.call(this),
  29703. this.neighbourMap = {},
  29704. this.map = null
  29705. }
  29706. var r = e("three")
  29707. , o = e("./common")
  29708. , a = e("../settings")
  29709. , s = e("../objects/Panorama")
  29710. , a = e("../settings")
  29711. , l = e("./aStar")
  29712. , c = e("./logger")
  29713. , h = new c(i)
  29714. , u = e("./IndexedCollection")
  29715. , d = e("./transitions");
  29716. o.inherit(n, u),
  29717. n.prototype.getIndex = function(e) {
  29718. return e.id
  29719. }
  29720. ,
  29721. n.prototype.find = function(e, t) {
  29722. var i = o.filterAll(this.list, e);
  29723. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29724. i = o.stableSort(i, e)
  29725. }),
  29726. i[0])
  29727. }
  29728. ,
  29729. n.prototype.sortByScore = function(e, t) {
  29730. var i = o.filterAll(this.list, e);
  29731. return 0 === i.length ? null : i = i.map(function(e) {
  29732. return {
  29733. pano: e,
  29734. score: t.reduce(function(t, i) {
  29735. return t + i(e)
  29736. }, 0)
  29737. }
  29738. }).sort(function(e, t) {
  29739. return t.score - e.score;
  29740. })
  29741. }
  29742. ,
  29743. n.prototype.lowestByScore = function(e, t, i) {
  29744. return this.findRankedByScore(0, e, t, i)
  29745. }
  29746. ,
  29747. n.prototype.findRankedByScore = function(e, t, i, n) {
  29748. n && (n.candidates = null,
  29749. n.pano = null),
  29750. e || (e = 0);
  29751. var r = this.sortByScore(t, i);
  29752. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29753. n.pano = r[e].pano),
  29754. r[e].pano)
  29755. }
  29756. ,
  29757. n.prototype.showPanoScores = function(e) {
  29758. this.list.forEach(function(e) {
  29759. e.removeTextSprite()
  29760. });
  29761. var t = 6344768;
  29762. e.forEach(function(e) {
  29763. e.pano.addTextSprite(e.score.toFixed(2), t),
  29764. t = 16428055
  29765. })
  29766. }
  29767. ,
  29768. n.prototype.isNeighbour = function(e, t) {
  29769. return this.neighbourMap[e.id][t.id]
  29770. }
  29771. ,
  29772. n.prototype.getNeighbours = function(e) {
  29773. return this.neighbourMap[e.id]
  29774. }
  29775. ,
  29776. n.prototype.setNeighbour = function(e, t, i) {
  29777. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29778. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29779. this.neighbourMap[e.id][e.id] = !0,
  29780. this.neighbourMap[t.id][t.id] = !0,
  29781. this.neighbourMap[e.id][t.id] = i,
  29782. this.neighbourMap[t.id][e.id] = i,
  29783. this.neighbourMap[e.id]
  29784. }
  29785. ,
  29786. n.prototype.findClosest = function(e, t) {
  29787. var i = [s.filters.isPanoAligned()];
  29788. return t && i.push(s.filters.inDirection(e, t, .75)),
  29789. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29790. }
  29791. ,
  29792. n.prototype.dualNeighbors = function(e, t) {
  29793. var i, n = [];
  29794. for (i in this.neighbourMap[e.id])
  29795. this.neighbourMap[t.id][i] && n.push(i);
  29796. return n
  29797. }
  29798. ,
  29799. n.prototype.populate_path_graph = function() {
  29800. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  29801. for (e = 0; e < this.list.length; e += 1) {
  29802. o = this.list[e],
  29803. s = {},
  29804. l = !1,
  29805. i = o.neighbourPanos || o.findNeighourPanos();
  29806. for (t in i)
  29807. if (i[t]) {
  29808. a = this.index[t],
  29809. p.copy(o.floorPosition),
  29810. p.sub(a.floorPosition);
  29811. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29812. , v = (Math.abs(p.y) / Math.max(m, .01),
  29813. Math.max(0, Math.abs(p.y) - .2));
  29814. v > 0 ? (f += 1,
  29815. v = Math.pow(4 * v, 2),
  29816. m = Math.pow(m, 2),
  29817. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29818. n = p.length()),
  29819. s[a.id] = n,
  29820. l = !0
  29821. }
  29822. l ? u[o.id] = s : d += 1
  29823. }
  29824. this.map = u,
  29825. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29826. }
  29827. ,
  29828. n.prototype.aStarSearch = function(e, t) {
  29829. var i = Date.now()
  29830. , n = new l({
  29831. start: e,
  29832. isEnd: function(e) {
  29833. return e === t
  29834. },
  29835. neighbor: function(e) {
  29836. var t = e.neighbourPanos || e.findNeighourPanos()
  29837. , i = [];
  29838. for (var n in t)
  29839. t[n] && i.push(this.index[n]); //add: t[n] &&
  29840. return i
  29841. }
  29842. .bind(this),
  29843. distance: function(e, t) {
  29844. var i = this.map[e.id]
  29845. , n = i[t.id];
  29846. return n
  29847. }
  29848. .bind(this),
  29849. heuristic: function(e, t) {
  29850. return 1
  29851. }
  29852. .bind(this),
  29853. hash: function(e) {
  29854. return e.id
  29855. },
  29856. timeout: 5e3
  29857. });
  29858. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29859. "success" !== n.status)
  29860. return h.debug("Did not find A* path from " + e + " to " + t),
  29861. null;
  29862. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29863. var r = [];
  29864. return n.path.forEach(function(e) {
  29865. r.push(e.id)
  29866. }),
  29867. r
  29868. }
  29869. ,
  29870. n.prototype.includeNodesNearPath = function() {
  29871. var e = new r.Vector3
  29872. , t = new r.Vector3
  29873. , i = new r.Vector3
  29874. , n = new r.Vector3
  29875. , o = new r.Vector3
  29876. , a = new r.Vector3
  29877. , s = new r.Vector3
  29878. , l = new r.Vector3
  29879. , c = []
  29880. , h = new r.Vector3
  29881. , u = new r.Vector3;
  29882. return function(r, d) {
  29883. if (r)
  29884. for (var p = function(e, t, i) {
  29885. return o.copy(t).sub(e),
  29886. o.dot(i)
  29887. }, f = function(e, t) {
  29888. return p(h, e.position, i) - p(h, t.position, i)
  29889. }, g = 0; g < r.length - 1; ) {
  29890. var m = r[g]
  29891. , v = r[g + 1]
  29892. , A = this.index[m]
  29893. , y = this.index[v];
  29894. h.copy(A.position),
  29895. u.copy(y.position),
  29896. c.length = 0,
  29897. e.copy(u).sub(h),
  29898. i.copy(e).normalize();
  29899. for (var C = 0; C < this.list.length; C++) {
  29900. var I = this.list[C];
  29901. o.copy(I.position).sub(h);
  29902. var E = o.dot(i);
  29903. if (E > 0) {
  29904. s.copy(i),
  29905. s.multiplyScalar(E),
  29906. a.copy(o),
  29907. a.sub(s);
  29908. var b = a.length();
  29909. if (b < d) {
  29910. t.copy(e).negate(),
  29911. n.copy(t).normalize(),
  29912. l.copy(I.position).sub(u);
  29913. var w = l.dot(n);
  29914. w > 0 && c.push(I)
  29915. }
  29916. }
  29917. }
  29918. if (c.length > 0) {
  29919. c.sort(f);
  29920. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29921. r[_] = r[_ - c.length];
  29922. for (var T = 0; T < c.length; T++)
  29923. r[T + g + 1] = c[T].id
  29924. }
  29925. g += c.length + 1
  29926. }
  29927. }
  29928. }(),
  29929. n.prototype.fadeMarkerOpacity = function(e, t) {
  29930. var i = void 0 === e ? a.panorama.markerOpacity : e
  29931. , n = this.list.findIndex(function(e) {
  29932. return e.marker
  29933. });
  29934. if (!(n < 0)) {
  29935. var r = this.list[n].marker.material.opacity;
  29936. if (r !== e) {
  29937. var o = i - r;
  29938. d.trigger({
  29939. func: function(e, t) {
  29940. var i = r + e * o;
  29941. this.forEach(function(e) {
  29942. e.marker && (e.marker.material.opacity = i)
  29943. })
  29944. }
  29945. .bind(this),
  29946. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29947. name: "_fpm"
  29948. })
  29949. }
  29950. }
  29951. }
  29952. ,
  29953. t.exports = n
  29954. }
  29955. ).call(this, "/js/util/PanoramaCollection.js")
  29956. }
  29957. , {
  29958. "../objects/Panorama": 148,
  29959. "../settings": 166,
  29960. "./IndexedCollection": 175,
  29961. "./aStar": 180,
  29962. "./common": 185,
  29963. "./logger": 189,
  29964. "./transitions": 195,
  29965. three: 217
  29966. }],
  29967. 179: [function(e, t, i) {
  29968. "use strict";
  29969. function n() {
  29970. this.actionSequence = [],
  29971. this.actionSequenceInProgress = !1
  29972. }
  29973. function r(e, t, i, n) {
  29974. s.trackAlways("zoom_" + e, {
  29975. from: t,
  29976. to: i,
  29977. pano: n
  29978. })
  29979. }
  29980. function o(e, t) {
  29981. r("initial", 1, e, t)
  29982. }
  29983. function a(e, t, i) {
  29984. r("followup", e, t, i)
  29985. }
  29986. var s = e("../analytics");
  29987. n.prototype.reset = function(e) {
  29988. this.actionSequenceInProgress = !1,
  29989. this.actionSequence.length = 0
  29990. }
  29991. ,
  29992. n.prototype.addZoomAction = function() {
  29993. var e = null
  29994. , t = null
  29995. , i = !1
  29996. , n = function() {
  29997. if (e = null,
  29998. this.actionSequence.length > 0) {
  29999. var i = this.actionSequence[0].start
  30000. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30001. 1 === i ? o(n, t) : a(i, n, t)
  30002. }
  30003. this.reset()
  30004. };
  30005. return function(r, o, a) {
  30006. if (r !== o) {
  30007. i || (n = n.bind(this),
  30008. i = !0),
  30009. e && (window.clearTimeout(e),
  30010. e = null),
  30011. a === t && this.actionSequenceInProgress || (this.reset(),
  30012. t = a),
  30013. this.actionSequenceInProgress = !0;
  30014. var s = {
  30015. start: r,
  30016. end: o
  30017. };
  30018. this.actionSequence.push(s),
  30019. e = window.setTimeout(n, 150)
  30020. }
  30021. }
  30022. }(),
  30023. t.exports = n
  30024. }
  30025. , {
  30026. "../analytics": 4
  30027. }],
  30028. 180: [function(e, t, i) {
  30029. "use strict";
  30030. function n(e) {
  30031. void 0 === e.timeout && (e.timeout = 1 / 0);
  30032. var t = e.hash || o
  30033. , i = {
  30034. data: e.start,
  30035. g: 0,
  30036. h: e.heuristic(e.start)
  30037. }
  30038. , n = i;
  30039. i.f = i.h;
  30040. var h = new s
  30041. , u = new l(a)
  30042. , d = c();
  30043. u.push(i),
  30044. d.set(t(i.data), i);
  30045. for (var p = new Date; u.size(); ) {
  30046. if (new Date - p > e.timeout)
  30047. return {
  30048. status: "timeout",
  30049. cost: n.g,
  30050. path: r(n)
  30051. };
  30052. var f = u.pop();
  30053. if (d.delete(t(f.data)),
  30054. e.isEnd(f.data))
  30055. return {
  30056. status: "success",
  30057. cost: f.g,
  30058. path: r(f)
  30059. };
  30060. h.add(t(f.data));
  30061. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30062. var v = g[m];
  30063. if (!h.contains(t(v))) {
  30064. var A = f.g + e.distance(f.data, v)
  30065. , y = d.get(t(v))
  30066. , C = !1;
  30067. if (void 0 === y)
  30068. y = {
  30069. data: v
  30070. },
  30071. d.set(t(v), y);
  30072. else {
  30073. if (y.g < A)
  30074. continue;
  30075. C = !0
  30076. }
  30077. y.parent = f,
  30078. y.g = A,
  30079. y.h = e.heuristic(v),
  30080. y.f = A + y.h,
  30081. y.h < n.h && (n = y),
  30082. C ? u.heapify() : u.push(y)
  30083. }
  30084. }
  30085. }
  30086. return {
  30087. status: "noPath",
  30088. cost: n.g,
  30089. path: r(n)
  30090. }
  30091. }
  30092. function r(e) {
  30093. if (void 0 !== e.parent) {
  30094. var t = r(e.parent);
  30095. return t.push(e.data),
  30096. t
  30097. }
  30098. return [e.data]
  30099. }
  30100. function o(e) {
  30101. return e.toString()
  30102. }
  30103. function a(e, t) {
  30104. return e.f - t.f
  30105. }
  30106. var s = e("Set")
  30107. , l = e("heap")
  30108. , c = e("dict");
  30109. t.exports = n
  30110. }
  30111. , {
  30112. Set: 196,
  30113. dict: 210,
  30114. heap: 211
  30115. }],
  30116. 181: [function(e, t, i) {
  30117. (function(i) {
  30118. "use strict";
  30119. function n(e, t, i) {
  30120. var n = new XMLHttpRequest;
  30121. if (i && "withCredentials"in n)
  30122. n.open(e, t, i);
  30123. else if ("undefined" != typeof XDomainRequest)
  30124. n = new XDomainRequest,
  30125. n.open(e, t);
  30126. else {
  30127. if (i)
  30128. throw "Browser does not support CORS!";
  30129. n.open(e, t)
  30130. }
  30131. return n
  30132. }
  30133. function r(e, t, i) {
  30134. function o() {
  30135. u.warn("Retrying ", t),
  30136. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30137. }
  30138. function a(e, t) {
  30139. var i = e.response;
  30140. if ("json" === t && "object" != typeof i)
  30141. try {
  30142. i = JSON.parse(e.responseText)
  30143. } catch (e) {
  30144. return void c.reject({
  30145. error: "Failed parsing JSON"
  30146. })
  30147. }
  30148. else if ("image/jpeg" === t) {
  30149. var n = new Uint8Array(e.response)
  30150. , r = new Blob([n],{
  30151. type: "image/jpeg"
  30152. })
  30153. , o = URL.createObjectURL(r);
  30154. i = new Image,
  30155. i.src = o,
  30156. i.crossOrigin = "Anonymous",
  30157. i.onload = function() {
  30158. URL.revokeObjectURL(o)
  30159. }
  30160. }
  30161. return i
  30162. }
  30163. var s = n(e, t, !1);
  30164. if (i = i || {},
  30165. i.retries = void 0 !== i.retries ? i.retries : 0,
  30166. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30167. i.responseType)
  30168. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30169. s.responseType = i.responseType;
  30170. else {
  30171. if ("image/jpeg" !== i.responseType)
  30172. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30173. s.responseType = "arraybuffer"
  30174. }
  30175. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30176. i.auth && s.setRequestHeader("Authorization", i.auth),
  30177. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30178. s.setRequestHeader("Content-Type", "application/json")),
  30179. "object" == typeof i.headers)
  30180. for (var l in i.headers)
  30181. s.setRequestHeader(l, i.headers[l]);
  30182. var c = $.Deferred();
  30183. return s.onreadystatechange = function(e) {
  30184. if (4 === this.readyState)
  30185. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30186. i.retries++,
  30187. setTimeout(o, 1e3);
  30188. else if (200 === this.status) {
  30189. var t = a(this, i.responseType);
  30190. c.resolve(t)
  30191. } else
  30192. c.reject(this)
  30193. }
  30194. ,
  30195. s.onprogress = function(e) {
  30196. c.notify(e)
  30197. }
  30198. ,
  30199. s.send(i.data),
  30200. c.promise()
  30201. }
  30202. function o(e) {
  30203. return Object.keys(e).sort().map(function(t) {
  30204. return {
  30205. key: t,
  30206. value: e[t]
  30207. }
  30208. })
  30209. }
  30210. function a(e, t) {
  30211. var i = t.responseType || null
  30212. , n = t.auth || null
  30213. , r = t.prefetchFrom || null
  30214. , a = e + "__" + i + "__" + n + "__" + r;
  30215. return t.headers && o(t.headers).forEach(function(e) {
  30216. a += "__" + e.key + ":" + e.value
  30217. }),
  30218. a
  30219. }
  30220. function s(e, t) {
  30221. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30222. }
  30223. function l(e, t, i) {
  30224. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30225. }
  30226. var c = e("./logger")
  30227. , h = e("../ab")
  30228. , u = new c(i);
  30229. window.URL = window.URL || window.webkitURL,
  30230. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30231. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  30232. /* setTimeout(function() {//MP-- xzw delete
  30233. window.MP_REQUEST_CACHE = null,
  30234. window.MP_PREFETCHED_MODELDATA = {}
  30235. }, 6e4),
  30236. window.onpageshow = function(e) {
  30237. e.persisted && (window.MP_REQUEST_CACHE = null,
  30238. window.MP_PREFETCHED_MODELDATA = {})
  30239. } */
  30240. ,
  30241. t.exports = {
  30242. get: function(e, t) {
  30243. t = t || {};
  30244. var i = void 0 === t.cache || t.cache;
  30245. if (i) {
  30246. var n = s(e, t);
  30247. if (n)
  30248. return n
  30249. }
  30250. var o;
  30251. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  30252. i && l(e, t, o),
  30253. o
  30254. },
  30255. post: function(e, t) {
  30256. return r("POST", e, t)
  30257. },
  30258. patch: function(e, t) {
  30259. return r("PATCH", e, t)
  30260. },
  30261. getImage: function(e, t) {
  30262. function i() {
  30263. u.warn("Retrying ", e),
  30264. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30265. }
  30266. var n = $.Deferred()
  30267. , r = new Image
  30268. , o = this;
  30269. return e = h.changeIfImageOptimzing(e),
  30270. null !== t && void 0 !== t || (t = 3),
  30271. r.onerror = function() {
  30272. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30273. }
  30274. ,
  30275. r.onload = function() {
  30276. n.resolve(r)
  30277. }
  30278. ,
  30279. r.crossOrigin = "anonymous",
  30280. r.src = e,
  30281. n
  30282. }
  30283. }
  30284. }
  30285. ).call(this, "/js/util/ajax.js")
  30286. }
  30287. , {
  30288. "../ab": 3,
  30289. "./logger": 189
  30290. }],
  30291. 182: [function(e, t, i) {
  30292. "use strict";
  30293. function n(e, t) {
  30294. var i = window.navigator.userAgent
  30295. , n = i.match(e);
  30296. return n = n ? n[1].split(t) : [],
  30297. {
  30298. major: parseInt(n[0]) || 0,
  30299. minor: parseInt(n[1]) || 0,
  30300. patch: parseInt(n[2]) || 0
  30301. }
  30302. }
  30303. var r = e("../exception/DeviceMismatchException");
  30304. window.browser = t.exports = {
  30305. isFullscreen: function() {
  30306. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  30307. },
  30308. supportsFullscreen: function() {
  30309. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30310. },
  30311. isPointerLocked: function() {
  30312. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30313. },
  30314. requestFullscreen: function(e, t) {
  30315. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30316. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30317. },
  30318. requestPointerLock: function() {
  30319. var e;
  30320. if (document.fullscreenElement)
  30321. e = document.fullscreenElement();
  30322. else if (document.mozFullscreenElement)
  30323. e = document.mozFullscreenElement();
  30324. else if (document.mozFullScreenElement)
  30325. e = document.mozFullScreenElement();
  30326. else {
  30327. if (!document.webkitFullscreenElement)
  30328. return;
  30329. e = document.webkitFullscreenElement()
  30330. }
  30331. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30332. e.requestPointerLock(),
  30333. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30334. },
  30335. exitPointerLock: function() {
  30336. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30337. document.exitPointerLock()
  30338. },
  30339. exitFullscreen: function() {
  30340. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30341. },
  30342. details: function() {
  30343. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30344. return e ? {
  30345. name: e[1],
  30346. version: parseInt(e[2]),
  30347. platform: navigator.platform
  30348. } : {}
  30349. },
  30350. is: function(e) {
  30351. return this.details() && this.details().name === e
  30352. },
  30353. inIframe: function() {
  30354. return window.parent !== window
  30355. },
  30356. aspectRatio: function() {
  30357. var e = $("#player").width() / $("#player").height();
  30358. return isFinite(e) ? e : 0
  30359. },
  30360. userAgent: function() {
  30361. return window.navigator.userAgent
  30362. },
  30363. isMobile: function() {
  30364. var e = navigator.userAgent || navigator.vendor || window.opera;
  30365. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  30366. },
  30367. isLandscape: function() {
  30368. return this.isMobile && this.aspectRatio() > 1
  30369. },
  30370. isSmallScreen: function() {
  30371. var e = screen.width / window.devicePixelRatio;
  30372. return e < 240
  30373. },
  30374. detectIE: function() {
  30375. var e = window.navigator.userAgent
  30376. , t = e.indexOf("MSIE ");
  30377. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30378. },
  30379. detectSafari: function() {
  30380. var e = window.navigator.userAgent
  30381. , t = e.indexOf("Safari");
  30382. return t !== -1 && !this.detectChrome()
  30383. },
  30384. detectFirefox: function() {
  30385. var e = window.navigator.userAgent;
  30386. return e.indexOf("Firefox") !== -1
  30387. },
  30388. detectChrome: function() {
  30389. var e = window.navigator.userAgent;
  30390. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30391. },
  30392. detectOpera: function() {
  30393. var e = window.navigator.userAgent;
  30394. return e.indexOf("OPR") !== -1
  30395. },
  30396. detectIOS: function() {
  30397. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30398. },
  30399. detectIPad: function() {
  30400. var e = window.navigator.userAgent
  30401. , t = /iPad/;
  30402. return t.test(e)
  30403. },
  30404. detectIPod: function() {
  30405. var e = window.navigator.userAgent
  30406. , t = /iPod/;
  30407. return t.test(e)
  30408. },
  30409. detectIPhone: function() {
  30410. var e = window.navigator.userAgent
  30411. , t = /iPhone/;
  30412. return t.test(e)
  30413. },
  30414. detectAndroid: function() {
  30415. var e = window.navigator.userAgent;
  30416. return e.indexOf("Android") !== -1
  30417. },
  30418. detectAndroidMobile: function() {
  30419. var e = window.navigator.userAgent;
  30420. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30421. },
  30422. detectSamsungNative: function() {
  30423. var e = window.navigator.userAgent;
  30424. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30425. },
  30426. detectSamsungS6: function() {
  30427. var e = window.navigator.userAgent;
  30428. return e.indexOf("SM-G92") !== -1
  30429. },
  30430. /************************************************************fyz改from徐世廷*************************************************************/
  30431. detectHUAWEI5X: function() {
  30432. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30433. },
  30434. /*******************************************************************************************************************************/
  30435. detectWebVR: function() {
  30436. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30437. },
  30438. getVRDisplay: function() {
  30439. var e = $.Deferred();
  30440. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30441. t.length >= 1 && e.resolve(t[0]),
  30442. e.reject(null)
  30443. }),
  30444. e) : e.reject(null)
  30445. },
  30446. iosVersion: function() {
  30447. if (!this.detectIOS())
  30448. throw new r("Did not detect an iDevice");
  30449. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30450. , t = "_";
  30451. return n(e, t)
  30452. },
  30453. androidVersion: function() {
  30454. if (!this.detectAndroid())
  30455. throw new r("Did not detect an Android based device");
  30456. var e = /Android ((?:\d+\.?){1,3})/
  30457. , t = ".";
  30458. return n(e, t)
  30459. },
  30460. valueFromCookie: function(e, t) {
  30461. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30462. if (!i)
  30463. return t;
  30464. var n = i[1];
  30465. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30466. },
  30467. valueFromHash: function(e, t) {
  30468. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  30469. , n = i.exec(window.location.href);
  30470. if (!n)
  30471. return t;
  30472. var r = n[1];
  30473. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  30474. }
  30475. }
  30476. //changeLog()
  30477. }
  30478. , {
  30479. "../exception/DeviceMismatchException": 56
  30480. }],
  30481. 183: [function(e, t, i) {
  30482. (function(i) {
  30483. "use strict";
  30484. function n(e, t) {
  30485. var i = r(t);
  30486. var replaceAll = function (str, f, e) {
  30487. //f全部替换成e
  30488. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30489. return str.replace(reg, e);
  30490. };
  30491. var urlFirstView = c.valueFromHash('firstView');
  30492. if(urlFirstView){
  30493. try{
  30494. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30495. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30496. urlFirstView = "{"+urlFirstView+"]}"
  30497. let info = JSON.parse(urlFirstView);
  30498. i.pano = t.index[info.pano] //panos.get(info.pano)
  30499. if(!i.pano){
  30500. urlFirstView = false
  30501. console.error('检测到firstView但是 找不到该pano')
  30502. }else{
  30503. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30504. i.zoom = -1;
  30505. i.mode = "panorama"
  30506. i.setByUrl = true
  30507. }
  30508. }catch(e){
  30509. urlFirstView = false
  30510. console.error('检测到firstView但是解析出错'+e)
  30511. }
  30512. }
  30513. if (Object.keys(i).length > 0)
  30514. return i;
  30515. if (e.heroImage)
  30516. i = o(e, t);
  30517. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  30518. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  30519. try {
  30520. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30521. i.position = n.camera.position,
  30522. //i.quaternion = n.camera.quaternion,
  30523. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30524. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30525. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30526. d.debug("Using camera_start"),
  30527. d.debug("Modeldata pano: ", i.pano.quaternion),
  30528. d.debug("Camera start pano: ", n.pano.quaternion)),
  30529. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30530. } catch (e) {
  30531. d.warn(e.message)
  30532. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30533. }
  30534. }
  30535. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30536. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30537. i.pano = t.findClosest(i.position),
  30538. i.quaternion = i.pano.quaternion),
  30539. 0 === Object.keys(i).length) {
  30540. var a = t.list[0];
  30541. a && (i.mode = h.PANORAMA,
  30542. i.pano = a,
  30543. i.position = a.position,
  30544. i.quaternion = a.quaternion,
  30545. d.info("Starting at 1st pano " + a.id))
  30546. }
  30547. return i.mode = i.mode || h.DOLLHOUSE,
  30548. i
  30549. }
  30550. function r(e) {
  30551. var t = c.valueFromHash("start", "")
  30552. , i = {};
  30553. if ("" !== t) {
  30554. d.debug("Start override found in parameters, trying to parse..."),
  30555. i = a(t) || {};
  30556. var n = c.valueFromHash("tag", null);
  30557. n && (i.tag = n),
  30558. i.panoId && (i.pano = e.get(i.panoId))
  30559. }
  30560. return i
  30561. }
  30562. function o(e, t) {
  30563. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30564. return {};
  30565. var i = {}
  30566. , n = e.heroImage.metadata;
  30567. d.debug("Using start position from thumbnail image"),
  30568. i.position = n.camera_position,
  30569. i.quaternion = n.camera_quaternion;
  30570. try {
  30571. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30572. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30573. } catch (e) {
  30574. d.debug(e.message)
  30575. }
  30576. return i
  30577. }
  30578. function a(e) {
  30579. return s.deserialize(e)
  30580. }
  30581. var s = e("../controls/serializer")
  30582. , l = e("../util/math")
  30583. , c = e("./browser")
  30584. , h = e("../enum/Viewmode")
  30585. , u = e("../util/logger")
  30586. , th = e("three")//xzw
  30587. , d = new u(i);
  30588. t.exports = {
  30589. getStartCameraOptions: n
  30590. }
  30591. }
  30592. ).call(this, "/js/util/camera.js")
  30593. }
  30594. , {
  30595. "../controls/serializer": 14,
  30596. "../enum/Viewmode": 51,
  30597. "../util/logger": 189,
  30598. "../util/math": 190,
  30599. "./browser": 182,
  30600. "three": 217
  30601. }],
  30602. 184: [function(e, t, i) {
  30603. "use strict";
  30604. function n(e, t, i) {
  30605. return o(e.fov, t, i)
  30606. }
  30607. var r = e("./MathLight")
  30608. , o = function(e, t, i) {
  30609. var n = t
  30610. , o = i
  30611. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30612. return a
  30613. }
  30614. , a = function(e, t, i) {
  30615. var n = t
  30616. , o = i
  30617. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30618. return a
  30619. }
  30620. , s = function(e, t, i, n) {
  30621. var r = o(e, i, n);
  30622. return r > t ? a(t, i, n) : e
  30623. };
  30624. t.exports = {
  30625. clampVFOV: s,
  30626. getHFOVForCamera: n,
  30627. getHFOVFromVFOV: o,
  30628. getVFOVFromHFOV: a
  30629. }
  30630. window.MathLight = t.exports
  30631. }
  30632. , {
  30633. "./MathLight": 176
  30634. }],
  30635. 185: [function(e, t, i) {
  30636. "use strict";
  30637. var n = e("three");
  30638. t.exports = {
  30639. delayOneFrame: function(e) {
  30640. window.setTimeout(e, 1)
  30641. },
  30642. normalizeUrl: function(e) {
  30643. return e.replace("https://", "http://")
  30644. },
  30645. domainFromUrl: function(e) {
  30646. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30647. return t ? t[3] : e
  30648. },
  30649. average: function(e, t) {
  30650. if (0 === e.length)
  30651. return null;
  30652. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30653. var o = t ? e[r][t] : e[r];
  30654. i += o,
  30655. n++
  30656. }
  30657. return i / n
  30658. },
  30659. countUnique: function(e) {
  30660. for (var t = {}, i = 0; i < e.length; i++)
  30661. t[e[i]] = 1 + (t[e[i]] || 0);
  30662. return Object.keys(t).length
  30663. },
  30664. averageVectors: function(e, t) {
  30665. var i = new n.Vector3;
  30666. if (0 === e.length)
  30667. return i;
  30668. for (var r = 0, o = 0; o < e.length; o++) {
  30669. var a = t ? e[o][t] : e[o];
  30670. i.add(a),
  30671. r++
  30672. }
  30673. return i.divideScalar(r)
  30674. },
  30675. equalLists: function(e, t) {
  30676. if (e.length !== t.length)
  30677. return !1;
  30678. for (var i = 0; i < e.length; i++)
  30679. if (e[i] !== t[i])
  30680. return !1;
  30681. return !0
  30682. },
  30683. lowerMedian: function(e, t) {
  30684. if (0 === e.length)
  30685. return null;
  30686. t = t || 2,
  30687. e.sort(function(e, t) {
  30688. return e - t
  30689. });
  30690. var i = Math.floor(e.length / t);
  30691. return e[i]
  30692. },
  30693. stableSort: function(e, t) {
  30694. return e.map(function(e, t) {
  30695. return {
  30696. value: e,
  30697. index: t
  30698. }
  30699. }).sort(function(e, i) {
  30700. var n = t(e.value, i.value);
  30701. return 0 !== n ? n : e.index - i.index
  30702. }).map(function(e) {
  30703. return e.value
  30704. })
  30705. },
  30706. filterAll: function(e, t) {
  30707. return e.filter(function(e) {
  30708. return t.every(function(t) {
  30709. return t(e)
  30710. })
  30711. })
  30712. },
  30713. formatDate: function(e) {
  30714. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30715. },
  30716. formatDatetime: function(e) {
  30717. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30718. },
  30719. randomString: function(e) {
  30720. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30721. t += i.charAt(Math.floor(Math.random() * i.length));
  30722. return t
  30723. },
  30724. uint8ToBase64: function(e, t) {
  30725. t && "number" == typeof t || (t = 8192);
  30726. for (var i = [], n = 0; n < e.length; n += t)
  30727. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30728. return btoa(i.join(""))
  30729. },
  30730. uuid4: function e(t) {
  30731. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30732. },
  30733. nth: function(e) {
  30734. return e %= 10,
  30735. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30736. },
  30737. extendObject: function(e, t) {
  30738. return Object.keys(t).forEach(function(i) {
  30739. e[i] = t[i]
  30740. }),
  30741. e
  30742. },
  30743. deepExtend: function e(t) {
  30744. t = t || {};
  30745. for (var i = 1; i < arguments.length; i++) {
  30746. var n = arguments[i];
  30747. if (n)
  30748. for (var r in n)
  30749. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30750. }
  30751. return t
  30752. },
  30753. inherit: function(e, t) {
  30754. e.prototype = Object.create(t.prototype),
  30755. e.prototype.constructor = e
  30756. },
  30757. extend: function(e, t) {
  30758. for (var i in t.prototype)
  30759. e.prototype[i] = t.prototype[i]
  30760. }
  30761. ,
  30762. getVisiblePano : function(positions = [], options={}){//add
  30763. var visiblePanos = [];
  30764. var panos = options.panos || player.model.panos.list;
  30765. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  30766. panos.forEach((pano)=>{
  30767. if(!pano.isAligned())return;
  30768. var A = pano.position.clone();
  30769. var posB = options.posAtPanos[pano.id] || positions;
  30770. var posLength = posB.length
  30771. for(let i=0;i<posLength;i++){
  30772. var B = posB[i];
  30773. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  30774. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  30775. if (!o || !o.length){ //只要有一点可见,就算整体可见
  30776. visiblePanos.push(pano );
  30777. break;
  30778. }
  30779. }
  30780. })
  30781. return visiblePanos
  30782. }
  30783. ,
  30784. sortByScore : function(list, request, rank) {
  30785. var i = this.filterAll(list, request);
  30786. return 0 === i.length ? null : i = i.map(function(e) {
  30787. return {
  30788. item: e,
  30789. score: rank.reduce(function(t, i) {
  30790. return t + i(e);
  30791. }, 0)
  30792. };
  30793. }).sort(function(e, t) {
  30794. return t.score - e.score;
  30795. });
  30796. }
  30797. },
  30798. Math.sign = function(e) {
  30799. return e < 0 ? -1 : 1
  30800. }
  30801. window.common = t.exports
  30802. }
  30803. , {
  30804. three: 217
  30805. }],
  30806. 186: [function(e, t, i) {
  30807. "use strict";
  30808. var n = {};
  30809. n.linearTween = function(e, t, i, n) {
  30810. return i * e / n + t
  30811. }
  30812. ,
  30813. n.easeInQuad = function(e, t, i, n) {
  30814. return e /= n,
  30815. i * e * e + t
  30816. }
  30817. ,
  30818. n.easeOutQuad = function(e, t, i, n) {
  30819. return e /= n,
  30820. -i * e * (e - 2) + t
  30821. }
  30822. ,
  30823. n.easeInOutQuad = function(e, t, i, n) {
  30824. return e /= n / 2,
  30825. e < 1 ? i / 2 * e * e + t : (e--,
  30826. -i / 2 * (e * (e - 2) - 1) + t)
  30827. }
  30828. ,
  30829. n.easeInCubic = function(e, t, i, n) {
  30830. return e /= n,
  30831. i * e * e * e + t
  30832. }
  30833. ,
  30834. n.easeOutCubic = function(e, t, i, n) {
  30835. return e /= n,
  30836. e--,
  30837. i * (e * e * e + 1) + t
  30838. }
  30839. ,
  30840. n.easeInOutCubic = function(e, t, i, n) {
  30841. return e /= n / 2,
  30842. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30843. i / 2 * (e * e * e + 2) + t)
  30844. }
  30845. ,
  30846. n.easeInQuart = function(e, t, i, n) {
  30847. return e /= n,
  30848. i * e * e * e * e + t
  30849. }
  30850. ,
  30851. n.easeOutQuart = function(e, t, i, n) {
  30852. return e /= n,
  30853. e--,
  30854. -i * (e * e * e * e - 1) + t
  30855. }
  30856. ,
  30857. n.easeInOutQuart = function(e, t, i, n) {
  30858. return e /= n / 2,
  30859. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30860. -i / 2 * (e * e * e * e - 2) + t)
  30861. }
  30862. ,
  30863. n.easeInQuint = function(e, t, i, n) {
  30864. return e /= n,
  30865. i * e * e * e * e * e + t
  30866. }
  30867. ,
  30868. n.easeOutQuint = function(e, t, i, n) {
  30869. return e /= n,
  30870. e--,
  30871. i * (e * e * e * e * e + 1) + t
  30872. }
  30873. ,
  30874. n.easeInOutQuint = function(e, t, i, n) {
  30875. return e /= n / 2,
  30876. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30877. i / 2 * (e * e * e * e * e + 2) + t)
  30878. }
  30879. ,
  30880. n.easeInSine = function(e, t, i, n) {
  30881. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30882. }
  30883. ,
  30884. n.easeOutSine = function(e, t, i, n) {
  30885. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30886. }
  30887. ,
  30888. n.easeInOutSine = function(e, t, i, n) {
  30889. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30890. }
  30891. ,
  30892. n.easeInExpo = function(e, t, i, n) {
  30893. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30894. }
  30895. ,
  30896. n.easeOutExpo = function(e, t, i, n) {
  30897. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30898. }
  30899. ,
  30900. n.easeInOutExpo = function(e, t, i, n) {
  30901. return e /= n / 2,
  30902. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30903. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30904. }
  30905. ,
  30906. n.easeInCirc = function(e, t, i, n) {
  30907. return e /= n,
  30908. -i * (Math.sqrt(1 - e * e) - 1) + t
  30909. }
  30910. ,
  30911. n.easeOutCirc = function(e, t, i, n) {
  30912. return e /= n,
  30913. e--,
  30914. i * Math.sqrt(1 - e * e) + t
  30915. }
  30916. ,
  30917. n.easeInOutCirc = function(e, t, i, n) {
  30918. return e /= n / 2,
  30919. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30920. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30921. }
  30922. ,
  30923. n.easeInElastic = function(e, t, i, n) {
  30924. var r = 1.70158
  30925. , o = 0
  30926. , a = i;
  30927. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30928. a < Math.abs(i) ? (a = i,
  30929. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30930. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30931. }
  30932. ,
  30933. n.easeOutElastic = function(e, t, i, n) {
  30934. var r = 1.70158
  30935. , o = 0
  30936. , a = i;
  30937. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30938. a < Math.abs(i) ? (a = i,
  30939. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30940. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30941. }
  30942. ,
  30943. n.easeInOutElastic = function(e, t, i, n) {
  30944. var r = 1.70158
  30945. , o = 0
  30946. , a = i;
  30947. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30948. a < Math.abs(i) ? (a = i,
  30949. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30950. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  30951. }
  30952. ,
  30953. n.easeInBack = function(e, t, i, n, r) {
  30954. return void 0 === r && (r = 1.70158),
  30955. i * (e /= n) * e * ((r + 1) * e - r) + t
  30956. }
  30957. ,
  30958. n.easeOutBack = function(e, t, i, n, r) {
  30959. return void 0 === r && (r = 1.70158),
  30960. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30961. }
  30962. ,
  30963. n.easeInOutBack = function(e, t, i, n, r) {
  30964. return void 0 === r && (r = 1.70158),
  30965. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  30966. }
  30967. ,
  30968. n.easeOutBounce = function(e, t, i, n) {
  30969. return (e /= n) < 1 / 2.75 ? i * (7.5625 * e * e) + t : e < 2 / 2.75 ? i * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? i * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : i * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  30970. }
  30971. ,
  30972. n.easeInBounce = function(e, t, i, r) {
  30973. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30974. }
  30975. ,
  30976. n.easeInOutBounce = function(e, t, i, r) {
  30977. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  30978. }
  30979. ,
  30980. t.exports = n
  30981. window.easing = n
  30982. }
  30983. , {}],
  30984. 187: [function(e, t, i) {
  30985. "use strict";
  30986. function n() {
  30987. this.events = [],
  30988. this.valid = !1
  30989. }
  30990. var r = e("../enum/Joystick");
  30991. n.prototype.push = function(e, t) {
  30992. this.events.push({
  30993. direction: e,
  30994. pano: t
  30995. }),
  30996. this.valid = !0
  30997. }
  30998. ,
  30999. n.prototype.pop = function(e) {
  31000. var t = this.events.pop();
  31001. return this.events.length < 1 && (this.valid = !1),
  31002. t
  31003. }
  31004. ,
  31005. n.prototype.peek = function() {
  31006. return this.events.length ? this.events[this.events.length - 1] : {
  31007. direction: null,
  31008. pano: null
  31009. }
  31010. }
  31011. ,
  31012. n.prototype.invalidate = function() {
  31013. this.events = [],
  31014. this.valid = !1
  31015. }
  31016. ,
  31017. n.prototype.reversePano = function(e) {
  31018. if (!this.valid)
  31019. return null;
  31020. var t = this.peek();
  31021. return r.opposite(e) === t.direction ? (this.pop(),
  31022. t.pano) : null
  31023. }
  31024. ,
  31025. t.exports = n
  31026. }
  31027. , {
  31028. "../enum/Joystick": 29
  31029. }],
  31030. 188: [function(e, t, i) {
  31031. "use strict";
  31032. window.lerp = t.exports = {
  31033. vector: function(e, t) {
  31034. var i = e.clone();
  31035. return t = t.clone(),
  31036. function(n) {
  31037. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31038. }
  31039. },
  31040. quaternion: function(e, t) {
  31041. var i = e.clone();
  31042. return function(n) {
  31043. e.copy(i).slerp(t, n)
  31044. }
  31045. },
  31046. property: function(e, t, i, n) {
  31047. var r = e[t];
  31048. return function(o) {
  31049. e[t] = r * (1 - o) + i * o,
  31050. n && n(e[t])
  31051. }
  31052. },
  31053. uniform: function(e, t, i) {
  31054. var n = e.material.uniforms[t].value;
  31055. return function(r) {
  31056. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31057. }
  31058. },
  31059. matrix4: function(e, t) {
  31060. var i = e.clone();
  31061. return function(n) {
  31062. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31063. r[s] = o[s] * (1 - n) + a[s] * n
  31064. }
  31065. },
  31066. allUniforms: function(e, t, i) {
  31067. var n = e.map(function(e) {
  31068. return this.uniform(e, t, i)
  31069. }
  31070. .bind(this));
  31071. return function(e) {
  31072. n.forEach(function(t) {
  31073. t(e)
  31074. })
  31075. }
  31076. }
  31077. }
  31078. }
  31079. , {}],
  31080. 189: [function(e, t, i) {
  31081. "use strict";
  31082. function n(e) {
  31083. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31084. if (n.consoleEnabled) {
  31085. var h = function(e) {
  31086. $("#debug-console").append("<p>" + e + "</p>"),
  31087. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31088. };
  31089. t = function(e) {
  31090. h(Array.prototype.slice.call(arguments).join(" "))
  31091. }
  31092. ,
  31093. i = function(e) {
  31094. h(Array.prototype.slice.call(arguments).join(" "))
  31095. }
  31096. ,
  31097. o = function(e) {
  31098. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31099. }
  31100. ,
  31101. a = function(e) {
  31102. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31103. }
  31104. } else
  31105. console.log ? (t = console.log,
  31106. i = console.info ? console.info : console.log,
  31107. o = console.warn ? console.warn : console.log,
  31108. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31109. ;
  31110. var u = function(e) {
  31111. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31112. }
  31113. , d = function(t, i) {
  31114. if (r) {
  31115. var o = Array.prototype.slice.call(t).join(" ");
  31116. r.captureMessage(o, {
  31117. level: i,
  31118. path: e,
  31119. timestamp: n.timestamp()
  31120. })
  31121. }
  31122. }
  31123. , p = function(t, i) {
  31124. if (r) {
  31125. var o = Array.prototype.slice.call(t).join(" ");
  31126. r.captureException(new Error(o), {
  31127. level: i,
  31128. path: e,
  31129. timestamp: n.timestamp()
  31130. })
  31131. }
  31132. };
  31133. return {
  31134. debug: function() {
  31135. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31136. },
  31137. info: function() {
  31138. n.level >= n.levels.info && i.apply(console, u(arguments))
  31139. },
  31140. warn: function() {
  31141. d(arguments, "warn"),
  31142. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31143. },
  31144. error: function() {
  31145. p(arguments, "error"),
  31146. n.level >= n.levels.error && a.apply(console, u(arguments))
  31147. },
  31148. v3str: function(e, t) {
  31149. var i = void 0 === t ? 2 : t;
  31150. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31151. },
  31152. eulstr: function(e, t) {
  31153. var i = void 0 === t ? 2 : t;
  31154. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31155. },
  31156. time: function(e) {
  31157. n.level >= n.levels.debug && (c[e] = Date.now())
  31158. },
  31159. timeEnd: function(e) {
  31160. if (n.level >= n.levels.debug) {
  31161. var t = c[e];
  31162. if (!t)
  31163. return;
  31164. var i = (Date.now() - t) / 1e3;
  31165. this.debug(e, i + "s")
  31166. }
  31167. }
  31168. }
  31169. }
  31170. var r = window.Raven;
  31171. n.timestamp = function() {
  31172. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31173. }
  31174. ,
  31175. n.levels = {
  31176. debug: 3,
  31177. info: 2,
  31178. warn: 1,
  31179. error: 0
  31180. },
  31181. n.level = n.levels.info,
  31182. t.exports = n
  31183. }
  31184. , {}],
  31185. 190: [function(e, t, i) {
  31186. "use strict";
  31187. var n = e("three")
  31188. , r = e("../enum/GLCubeFaces")
  31189. , o = e("../constants");
  31190. t.exports = {
  31191. convertVisionVector: function(e) {
  31192. return new n.Vector3(e.x,e.z,-e.y)
  31193. },
  31194. convertVisionQuaternion: function(e) {
  31195. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  31196. },
  31197. convertWorkshopVector: function(e) {
  31198. return new n.Vector3(-e.x,e.y,e.z)
  31199. },
  31200. convertWorkshopQuaternion: function(e) {
  31201. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  31202. },
  31203. convertWorkshopPanoramaQuaternion: function(e) {
  31204. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  31205. },
  31206. convertWorkshopOrthoZoom: function(e) {// xzw
  31207. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31208. //return e;
  31209. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31210. },
  31211. toPrecision: function(e, t) {//xzw change
  31212. var f = function(e, t){
  31213. var i = Math.pow(10, t);
  31214. return Math.round(e * i) / i
  31215. }
  31216. if(e instanceof Array){
  31217. for(var s=0; s<e.length; s++){
  31218. e[s] = f(e[s],t);
  31219. }
  31220. return e;
  31221. }
  31222. else return f(e,t)
  31223. },
  31224. isEmptyQuaternion: function(e) {
  31225. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31226. },
  31227. projectPositionToCanvas: function(e, t, i) {
  31228. i = i || new n.Vector3,
  31229. i.copy(e);
  31230. var r = .5 * $("#player").width()
  31231. , o = .5 * $("#player").height();
  31232. return i.project(t),
  31233. i.x = i.x * r + r,
  31234. i.y = -(i.y * o) + o,
  31235. i
  31236. },
  31237. convertScreenPositionToNDC: function(e, t, i) {
  31238. return i = i || new n.Vector2,
  31239. i.x = e / $("#player").width() * 2 - 1,
  31240. i.y = 2 * -(t / $("#player").height()) + 1,
  31241. i
  31242. },
  31243. constrainedTurn: function(e) {
  31244. var t = e % (2 * Math.PI);
  31245. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31246. },
  31247. getFOVDotThreshold: function(e) {
  31248. return Math.cos(n.Math.degToRad(e / 2))
  31249. },
  31250. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31251. switch (e) {
  31252. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31253. i.set(1, t.y, t.x);
  31254. break;
  31255. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31256. i.set(-1, t.y, -t.x);
  31257. break;
  31258. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31259. i.set(-t.x, 1, -t.y);
  31260. break;
  31261. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31262. i.set(-t.x, -1, t.y);
  31263. break;
  31264. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31265. i.set(-t.x, t.y, 1);
  31266. break;
  31267. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31268. i.set(t.x, t.y, -1)
  31269. }
  31270. n && i.normalize()
  31271. },
  31272. //add:
  31273. getPos2d : function(point, camera, dom){
  31274. var camera = camera ;
  31275. var dom = dom;
  31276. 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);
  31277. var x,y;
  31278. x = (pos.x + 1) / 2 * dom.clientWidth;
  31279. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31280. var inSight = x <= dom.clientWidth && x >= 0
  31281. && y <= dom.clientHeight && y >= 0
  31282. return {
  31283. pos: new THREE.Vector2(x,y),
  31284. vector: pos,
  31285. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31286. inSight : inSight //在屏幕范围内可见
  31287. };
  31288. }
  31289. }
  31290. window.math = t.exports
  31291. }
  31292. , {
  31293. "../constants": 8,
  31294. "../enum/GLCubeFaces": 25,
  31295. three: 217
  31296. }],
  31297. 191: [function(e, t, i) {
  31298. "use strict";
  31299. function n(e, t, i) {
  31300. return a.map(function(n, o) {
  31301. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31302. }
  31303. .bind(this))
  31304. }
  31305. function r(e) {
  31306. return s[e]
  31307. }
  31308. var o = e("../enum/GLCubeFaces")
  31309. , a = [0, 1, 2, 3, 4, 5]
  31310. , s = {
  31311. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31312. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31313. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31314. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31315. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31316. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31317. };
  31318. t.exports = {
  31319. mapFaceToCubemapFace: r,
  31320. getCubemapUrls: n
  31321. }
  31322. }
  31323. , {
  31324. "../enum/GLCubeFaces": 25
  31325. }],
  31326. 192: [function(e, t, i) {
  31327. "use strict";
  31328. t.exports = {
  31329. captureErrors: function(e, t, i) {
  31330. if ("Raven"in window) {
  31331. Raven.config(e, t).install(),
  31332. i && Raven.setTagsContext(i);
  31333. var n = console.warn
  31334. , r = console.error;
  31335. console.warn = function() {
  31336. var e = Array.prototype.slice.call(arguments);
  31337. Raven.captureMessage(e.join(" "), {
  31338. level: "warning"
  31339. }),
  31340. n.apply(console, e)
  31341. }
  31342. ,
  31343. console.error = function() {
  31344. var e = Array.prototype.slice.call(arguments);
  31345. Raven.captureException(new Error(e.join(" ")), {
  31346. level: "error"
  31347. }),
  31348. r.apply(console, e)
  31349. }
  31350. } else
  31351. console.error("Raven not found, not capturing errors.")
  31352. }
  31353. }
  31354. }
  31355. , {}],
  31356. 193: [function(e, t, i) {
  31357. (function(i) {
  31358. "use strict";
  31359. var n = e("./browser")
  31360. , r = e("../constants")
  31361. , o = e("url")
  31362. , a = e("./logger")
  31363. , ss = e('three')
  31364. , s = new a(i)
  31365. , l = {
  31366. getAuthorizationHeader: function() {
  31367. var e = n.valueFromHash("auth");
  31368. if (e)
  31369. return e.replace(",", " ");
  31370. var t = n.valueFromCookie("token");
  31371. return t ? "Token " + t : null
  31372. },
  31373. parseSidUrl: function(e) {
  31374. var t, i;
  31375. t=g_Prefix;
  31376. if (e = e || "",
  31377. e.match(/^https?/)) {
  31378. var n = o.parse(e);
  31379. t = g_Prefix,
  31380. i = e
  31381. } else{
  31382. //xzw 原先的不能用
  31383. //t = window.location.protocol + "//" + window.location.host, //MP
  31384. t = g_Prefix
  31385. //i = t + "/api/player/models/" + e; //MP
  31386. i = t + "data/" + e;
  31387. }
  31388. return {
  31389. urlBase: t,
  31390. urlModel: i,
  31391. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31392. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31393. }
  31394. },
  31395. getModelIDFromQueryString: function() {
  31396. return n.valueFromHash("model") || n.valueFromHash("m")
  31397. },
  31398. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31399. e = JSON.parse(JSON.stringify(e));
  31400. var i = null;
  31401. if (e.images.forEach(function(n) {
  31402. if(!n.metadata) return;
  31403. if ("string" == typeof n.metadata)
  31404. try {
  31405. n.metadata = JSON.parse(n.metadata)
  31406. } catch (e) {
  31407. s.warn("Unable to parse image metadata"),
  31408. n.metadata = null
  31409. }
  31410. else{
  31411. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31412. }
  31413. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31414. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31415. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31416. }else{
  31417. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31418. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31419. n.metadata.zoom = n.metadata.zoom || 1;
  31420. }
  31421. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31422. }),
  31423. //icon初始视角的:
  31424. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31425. var n = {};
  31426. n.pano = {
  31427. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31428. position: t.convertWorkshopVector(i.scan_position),
  31429. uuid: i.scan_id
  31430. },
  31431. n.camera = {
  31432. quaternion: i.camera_quaternion,
  31433. position: i.camera_position
  31434. },
  31435. e.startPano = n
  31436. }
  31437. return e
  31438. },
  31439. */
  31440. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31441. e = JSON.parse(JSON.stringify(e));
  31442. var i = null;
  31443. var deal = function(n) {
  31444. if(!n.metadata) return;
  31445. if ("string" == typeof n.metadata)
  31446. try {
  31447. n.metadata = JSON.parse(n.metadata)
  31448. } catch (e) {
  31449. s.warn("Unable to parse image metadata"),
  31450. n.metadata = null
  31451. }
  31452. else{
  31453. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31454. }
  31455. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31456. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31457. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31458. }else{
  31459. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31460. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31461. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31462. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31463. }
  31464. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31465. }
  31466. //改
  31467. e.images.forEach(info=>{
  31468. if(info.locations){
  31469. info.locations.forEach(a=>deal(a))
  31470. }else{
  31471. deal(info)
  31472. }
  31473. })
  31474. //icon初始视角的:
  31475. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31476. var n = {};
  31477. n.pano = {
  31478. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31479. position: t.convertWorkshopVector(i.scan_position),
  31480. uuid: i.scan_id
  31481. },
  31482. n.camera = {
  31483. quaternion: i.camera_quaternion,
  31484. position: i.camera_position
  31485. },
  31486. e.startPano = n
  31487. }
  31488. return e
  31489. },
  31490. visionVersionToInt: function() {
  31491. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31492. return function(t) {
  31493. if (!t)
  31494. throw new Error("Vision version is required");
  31495. var i = e.exec(t);
  31496. if (null === i)
  31497. throw new Error("String is not a vision version: " + t);
  31498. return parseInt(i[1])
  31499. }
  31500. }(),
  31501. modelDataPromisesTiles: function(e) {
  31502. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  31503. if (vision_version)
  31504. try {
  31505. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31506. } catch (t) {
  31507. s.warn("Invalid vision version: " + vision_version)
  31508. }
  31509. // var t = e.created ? new Date(e.created) : null;
  31510. // return t && t >= r.visionTilingStartDate
  31511. return false
  31512. }
  31513. };
  31514. t.exports = l
  31515. }
  31516. ).call(this, "/js/util/showcase.js")
  31517. }
  31518. , {
  31519. "../constants": 8,
  31520. "./browser": 182,
  31521. "./logger": 189,
  31522. three:217,
  31523. url: 208
  31524. }],
  31525. 194: [function(e, t, i) {
  31526. "use strict";
  31527. var n = e("../util/ajax")
  31528. , r = e("three")
  31529. , o = e("../settings")
  31530. , a = {};
  31531. t.exports = {
  31532. load: function(e, t, i) {
  31533. var s = a[e];
  31534. return s ? (t && setTimeout(function() {
  31535. t(s)
  31536. }, 1),
  31537. s) : (s = new r.Texture,
  31538. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31539. s.magFilter = r.LinearFilter,
  31540. s.generateMipmaps = !1),
  31541. s.sourceFile = e,
  31542. a[e] = s,
  31543. n.getImage(e).then(function(e) {
  31544. s.image = e,
  31545. s.needsUpdate = !0,
  31546. t && t(s)
  31547. }).fail(i),
  31548. s)
  31549. },
  31550. loadBase64: function(e, t) {
  31551. t = t || "png";
  31552. var i = new r.Texture;
  31553. return i.image = document.createElement("img"),
  31554. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31555. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31556. i.magFilter = r.LinearFilter,
  31557. i.generateMipmaps = !1),
  31558. i.needsUpdate = !0,
  31559. i
  31560. },
  31561. isLoaded: function(e) {
  31562. return !!a[e]
  31563. }
  31564. }
  31565. window.Texture = t.exports
  31566. }
  31567. , {
  31568. "../settings": 166,
  31569. "../util/ajax": 181,
  31570. three: 217
  31571. }],
  31572. 195: [function(e, t, i) {
  31573. "use strict";
  31574. var n = e("./easing");
  31575. window.transitions = t.exports = {
  31576. globalDone: null,
  31577. funcs: [],
  31578. counter: 0,
  31579. uniqueID: 0,
  31580. start: function(e, t, i, r, o, a, s) {
  31581. return r = r || 0,
  31582. this.funcs.push({
  31583. func: e,
  31584. current: -r * Math.abs(t),
  31585. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31586. done: i,
  31587. easing: o || n.linearTween,
  31588. cycling: t < 0,
  31589. running: !0,
  31590. debug: r < 0,
  31591. name: a || "T" + this.counter,
  31592. id: void 0 === s ? this.counter : s,
  31593. paused: !1
  31594. }),
  31595. e(0, 16),
  31596. this.counter += 1,
  31597. e
  31598. },
  31599. trigger: function(e) {
  31600. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31601. , i = e.func || function() {}
  31602. , r = void 0 === e.duration ? 0 : e.duration;
  31603. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31604. var o = e.done || null
  31605. , a = e.easing || n.linearTween
  31606. , s = e.name || "R" + this.counter
  31607. , l = void 0 === e.id ? this.counter : e.id;
  31608. return this.start(i, r, o, t, a, s, l)
  31609. },
  31610. setTimeout: function(e, t, i) {
  31611. var n = void 0 === i ? this.counter : i;
  31612. return this.trigger({
  31613. done: e,
  31614. duration: void 0 === t ? 0 : t,
  31615. name: "O" + this.counter,
  31616. id: n
  31617. })
  31618. },
  31619. pause: function() {
  31620. this.paused = !0
  31621. },
  31622. resume: function() {
  31623. this.paused = !1
  31624. },
  31625. update: function(e) {
  31626. this.funcs.forEach(function(t) {
  31627. if (!(t.paused || (t.current += 1e3 * e,
  31628. t.current < 0)))
  31629. if (t.current >= t.duration && !t.cycling) {
  31630. var i = t.easing(1, 0, 1, 1);
  31631. t.func(i, 1e3 * e),
  31632. t.done && t.done(),
  31633. t.running = !1
  31634. } else {
  31635. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31636. , r = t.func(n, 1e3 * e) || !1;
  31637. r && (t.done && t.done(),
  31638. t.running = !1)
  31639. }
  31640. });
  31641. var t = this.funcs.length;
  31642. this.funcs = this.funcs.filter(function(e) {
  31643. return e.running
  31644. });
  31645. var i = this.funcs.length;
  31646. if (t > 0 && 0 === i && this.globalDone) {
  31647. var n = this.globalDone;
  31648. this.globalDone = null,
  31649. n()
  31650. }
  31651. },
  31652. adjustSpeed: function(e, t) {
  31653. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31654. var r = i[n];
  31655. r.duration /= t,
  31656. r.current /= t
  31657. }
  31658. },
  31659. getById: function(e) {
  31660. return this.funcs.filter(function(t) {
  31661. return e === t.id
  31662. })
  31663. },
  31664. get: function(e) {
  31665. for (var t = 0; t < this.funcs.length; t += 1)
  31666. if (this.funcs[t].func === e)
  31667. return this.funcs[t];
  31668. return null
  31669. },
  31670. isRunning: function(e) {
  31671. var t = this.get(e);
  31672. return null !== t && t.running
  31673. },
  31674. countActive: function() {
  31675. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31676. e += this.funcs[t].running;
  31677. return e
  31678. },
  31679. listActive: function() {
  31680. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31681. this.funcs[t].running && e.push(this.funcs[t].name);
  31682. return e
  31683. },
  31684. done: function(e) {
  31685. this.globalDone = e
  31686. },
  31687. cancelById: function(e) {
  31688. var t = void 0 === e ? 0 : e;
  31689. this.funcs = this.funcs.filter(function(e) {
  31690. return e.id !== t
  31691. })
  31692. },
  31693. cancel: function(e) {
  31694. this.funcs = this.funcs.filter(function(t) {
  31695. return t.func !== e
  31696. })
  31697. },
  31698. getUniqueId: function() {
  31699. return this.uniqueID -= 1,
  31700. this.uniqueID
  31701. }
  31702. }
  31703. }
  31704. , {
  31705. "./easing": 186
  31706. }],
  31707. 196: [function(e, t, i) {
  31708. function n(e) {
  31709. if (this.set = {},
  31710. this.infContains = function() {
  31711. return !0
  31712. }
  31713. ,
  31714. "object" == typeof e)
  31715. if (e instanceof Array)
  31716. for (var t = 0; t < e.length; t++)
  31717. this.set[e[t]] = !0;
  31718. else
  31719. this.set = e;
  31720. else if ("function" == typeof e)
  31721. this.infContains = e;
  31722. else if ("undefined" != typeof e)
  31723. throw new Error("set must be either an array or an object.")
  31724. }
  31725. t.exports = n,
  31726. n.prototype.contains = function(e) {
  31727. return !!this.set[e]
  31728. }
  31729. ,
  31730. n.prototype.has = n.prototype.contains,
  31731. n.prototype.add = function(e) {
  31732. if (1 == arguments.length)
  31733. this.set[e] = !0;
  31734. else
  31735. for (var t = 0; t < arguments.length; t++)
  31736. this.set[arguments[t]] = !0
  31737. }
  31738. ,
  31739. n.prototype.addAll = function(e) {
  31740. if ("object" != typeof e && !(e instanceof Array))
  31741. throw new Error("arr must be an array.");
  31742. for (var t = 0; t < e.length; t++)
  31743. this.add(e[t])
  31744. }
  31745. ,
  31746. n.prototype.remove = function(e) {
  31747. if (1 == arguments.length)
  31748. delete this.set[e];
  31749. else
  31750. for (var t = 0; t < arguments.length; t++)
  31751. delete this.set[arguments[t]]
  31752. }
  31753. ,
  31754. n.prototype.delete = n.prototype.remove,
  31755. n.prototype.clear = function() {
  31756. this.set = {}
  31757. }
  31758. ,
  31759. n.prototype.size = function() {
  31760. return Object.keys(this.set).length
  31761. }
  31762. ,
  31763. n.prototype.toString = function() {
  31764. return "{" + Object.keys(this.set).toString() + "}"
  31765. }
  31766. ,
  31767. n.prototype.toArray = function() {
  31768. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31769. }
  31770. ,
  31771. n.prototype["*values"] = n.prototype.toArray
  31772. }
  31773. , {}],
  31774. 197: [function(e, t, i) {}
  31775. , {}],
  31776. 198: [function(e, t, i) {
  31777. (function(t) {
  31778. "use strict";
  31779. function n() {
  31780. try {
  31781. var e = new Uint8Array(1);
  31782. return e.__proto__ = {
  31783. __proto__: Uint8Array.prototype,
  31784. foo: function() {
  31785. return 42
  31786. }
  31787. },
  31788. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31789. } catch (e) {
  31790. return !1
  31791. }
  31792. }
  31793. function r() {
  31794. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31795. }
  31796. function o(e, t) {
  31797. if (r() < t)
  31798. throw new RangeError("Invalid typed array length");
  31799. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31800. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31801. e.length = t),
  31802. e
  31803. }
  31804. function a(e, t, i) {
  31805. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31806. return new a(e,t,i);
  31807. if ("number" == typeof e) {
  31808. if ("string" == typeof t)
  31809. throw new Error("If encoding is specified then the first argument must be a string");
  31810. return h(this, e)
  31811. }
  31812. return s(this, e, t, i)
  31813. }
  31814. function s(e, t, i, n) {
  31815. if ("number" == typeof t)
  31816. throw new TypeError('"value" argument must not be a number');
  31817. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31818. }
  31819. function l(e) {
  31820. if ("number" != typeof e)
  31821. throw new TypeError('"size" argument must be a number');
  31822. if (e < 0)
  31823. throw new RangeError('"size" argument must not be negative')
  31824. }
  31825. function c(e, t, i, n) {
  31826. return l(t),
  31827. t <= 0 ? o(e, t) : void 0 !== i ? "string" == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i) : o(e, t)
  31828. }
  31829. function h(e, t) {
  31830. if (l(t),
  31831. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31832. !a.TYPED_ARRAY_SUPPORT)
  31833. for (var i = 0; i < t; ++i)
  31834. e[i] = 0;
  31835. return e
  31836. }
  31837. function u(e, t, i) {
  31838. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31839. !a.isEncoding(i))
  31840. throw new TypeError('"encoding" must be a valid string encoding');
  31841. var n = 0 | v(t, i);
  31842. e = o(e, n);
  31843. var r = e.write(t, i);
  31844. return r !== n && (e = e.slice(0, r)),
  31845. e
  31846. }
  31847. function d(e, t) {
  31848. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31849. e = o(e, i);
  31850. for (var n = 0; n < i; n += 1)
  31851. e[n] = 255 & t[n];
  31852. return e
  31853. }
  31854. function p(e, t, i, n) {
  31855. if (t.byteLength,
  31856. i < 0 || t.byteLength < i)
  31857. throw new RangeError("'offset' is out of bounds");
  31858. if (t.byteLength < i + (n || 0))
  31859. throw new RangeError("'length' is out of bounds");
  31860. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31861. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31862. e.__proto__ = a.prototype) : e = d(e, t),
  31863. e
  31864. }
  31865. function f(e, t) {
  31866. if (a.isBuffer(t)) {
  31867. var i = 0 | g(t.length);
  31868. return e = o(e, i),
  31869. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31870. e)
  31871. }
  31872. if (t) {
  31873. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31874. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31875. if ("Buffer" === t.type && $(t.data))
  31876. return d(e, t.data)
  31877. }
  31878. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31879. }
  31880. function g(e) {
  31881. if (e >= r())
  31882. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31883. return 0 | e
  31884. }
  31885. function m(e) {
  31886. return +e != e && (e = 0),
  31887. a.alloc(+e)
  31888. }
  31889. function v(e, t) {
  31890. if (a.isBuffer(e))
  31891. return e.length;
  31892. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31893. return e.byteLength;
  31894. "string" != typeof e && (e = "" + e);
  31895. var i = e.length;
  31896. if (0 === i)
  31897. return 0;
  31898. for (var n = !1; ; )
  31899. switch (t) {
  31900. case "ascii":
  31901. case "latin1":
  31902. case "binary":
  31903. return i;
  31904. case "utf8":
  31905. case "utf-8":
  31906. case void 0:
  31907. return j(e).length;
  31908. case "ucs2":
  31909. case "ucs-2":
  31910. case "utf16le":
  31911. case "utf-16le":
  31912. return 2 * i;
  31913. case "hex":
  31914. return i >>> 1;
  31915. case "base64":
  31916. return Z(e).length;
  31917. default:
  31918. if (n)
  31919. return j(e).length;
  31920. t = ("" + t).toLowerCase(),
  31921. n = !0
  31922. }
  31923. }
  31924. function A(e, t, i) {
  31925. var n = !1;
  31926. if ((void 0 === t || t < 0) && (t = 0),
  31927. t > this.length)
  31928. return "";
  31929. if ((void 0 === i || i > this.length) && (i = this.length),
  31930. i <= 0)
  31931. return "";
  31932. if (i >>>= 0,
  31933. t >>>= 0,
  31934. i <= t)
  31935. return "";
  31936. for (e || (e = "utf8"); ; )
  31937. switch (e) {
  31938. case "hex":
  31939. return L(this, t, i);
  31940. case "utf8":
  31941. case "utf-8":
  31942. return M(this, t, i);
  31943. case "ascii":
  31944. return P(this, t, i);
  31945. case "latin1":
  31946. case "binary":
  31947. return O(this, t, i);
  31948. case "base64":
  31949. return S(this, t, i);
  31950. case "ucs2":
  31951. case "ucs-2":
  31952. case "utf16le":
  31953. case "utf-16le":
  31954. return D(this, t, i);
  31955. default:
  31956. if (n)
  31957. throw new TypeError("Unknown encoding: " + e);
  31958. e = (e + "").toLowerCase(),
  31959. n = !0
  31960. }
  31961. }
  31962. function y(e, t, i) {
  31963. var n = e[t];
  31964. e[t] = e[i],
  31965. e[i] = n
  31966. }
  31967. function C(e, t, i, n, r) {
  31968. if (0 === e.length)
  31969. return -1;
  31970. if ("string" == typeof i ? (n = i,
  31971. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31972. i = +i,
  31973. isNaN(i) && (i = r ? 0 : e.length - 1),
  31974. i < 0 && (i = e.length + i),
  31975. i >= e.length) {
  31976. if (r)
  31977. return -1;
  31978. i = e.length - 1
  31979. } else if (i < 0) {
  31980. if (!r)
  31981. return -1;
  31982. i = 0
  31983. }
  31984. if ("string" == typeof t && (t = a.from(t, n)),
  31985. a.isBuffer(t))
  31986. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31987. if ("number" == typeof t)
  31988. return t &= 255,
  31989. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  31990. throw new TypeError("val must be string, number or Buffer")
  31991. }
  31992. function I(e, t, i, n, r) {
  31993. function o(e, t) {
  31994. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31995. }
  31996. var a = 1
  31997. , s = e.length
  31998. , l = t.length;
  31999. if (void 0 !== n && (n = String(n).toLowerCase(),
  32000. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32001. if (e.length < 2 || t.length < 2)
  32002. return -1;
  32003. a = 2,
  32004. s /= 2,
  32005. l /= 2,
  32006. i /= 2
  32007. }
  32008. var c;
  32009. if (r) {
  32010. var h = -1;
  32011. for (c = i; c < s; c++)
  32012. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32013. if (h === -1 && (h = c),
  32014. c - h + 1 === l)
  32015. return h * a
  32016. } else
  32017. h !== -1 && (c -= c - h),
  32018. h = -1
  32019. } else
  32020. for (i + l > s && (i = s - l),
  32021. c = i; c >= 0; c--) {
  32022. for (var u = !0, d = 0; d < l; d++)
  32023. if (o(e, c + d) !== o(t, d)) {
  32024. u = !1;
  32025. break
  32026. }
  32027. if (u)
  32028. return c
  32029. }
  32030. return -1
  32031. }
  32032. function E(e, t, i, n) {
  32033. i = Number(i) || 0;
  32034. var r = e.length - i;
  32035. n ? (n = Number(n),
  32036. n > r && (n = r)) : n = r;
  32037. var o = t.length;
  32038. if (o % 2 !== 0)
  32039. throw new TypeError("Invalid hex string");
  32040. n > o / 2 && (n = o / 2);
  32041. for (var a = 0; a < n; ++a) {
  32042. var s = parseInt(t.substr(2 * a, 2), 16);
  32043. if (isNaN(s))
  32044. return a;
  32045. e[i + a] = s
  32046. }
  32047. return a
  32048. }
  32049. function b(e, t, i, n) {
  32050. return q(j(t, e.length - i), e, i, n)
  32051. }
  32052. function w(e, t, i, n) {
  32053. return q(Y(t), e, i, n)
  32054. }
  32055. function _(e, t, i, n) {
  32056. return w(e, t, i, n)
  32057. }
  32058. function T(e, t, i, n) {
  32059. return q(Z(t), e, i, n)
  32060. }
  32061. function x(e, t, i, n) {
  32062. return q(X(t, e.length - i), e, i, n)
  32063. }
  32064. function S(e, t, i) {
  32065. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32066. }
  32067. function M(e, t, i) {
  32068. i = Math.min(e.length, i);
  32069. for (var n = [], r = t; r < i; ) {
  32070. var o = e[r]
  32071. , a = null
  32072. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32073. if (r + s <= i) {
  32074. var l, c, h, u;
  32075. switch (s) {
  32076. case 1:
  32077. o < 128 && (a = o);
  32078. break;
  32079. case 2:
  32080. l = e[r + 1],
  32081. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32082. u > 127 && (a = u));
  32083. break;
  32084. case 3:
  32085. l = e[r + 1],
  32086. c = e[r + 2],
  32087. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32088. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32089. break;
  32090. case 4:
  32091. l = e[r + 1],
  32092. c = e[r + 2],
  32093. h = e[r + 3],
  32094. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32095. u > 65535 && u < 1114112 && (a = u))
  32096. }
  32097. }
  32098. null === a ? (a = 65533,
  32099. s = 1) : a > 65535 && (a -= 65536,
  32100. n.push(a >>> 10 & 1023 | 55296),
  32101. a = 56320 | 1023 & a),
  32102. n.push(a),
  32103. r += s
  32104. }
  32105. return R(n)
  32106. }
  32107. function R(e) {
  32108. var t = e.length;
  32109. if (t <= ee)
  32110. return String.fromCharCode.apply(String, e);
  32111. for (var i = "", n = 0; n < t; )
  32112. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32113. return i
  32114. }
  32115. function P(e, t, i) {
  32116. var n = "";
  32117. i = Math.min(e.length, i);
  32118. for (var r = t; r < i; ++r)
  32119. n += String.fromCharCode(127 & e[r]);
  32120. return n
  32121. }
  32122. function O(e, t, i) {
  32123. var n = "";
  32124. i = Math.min(e.length, i);
  32125. for (var r = t; r < i; ++r)
  32126. n += String.fromCharCode(e[r]);
  32127. return n
  32128. }
  32129. function L(e, t, i) {
  32130. var n = e.length;
  32131. (!t || t < 0) && (t = 0),
  32132. (!i || i < 0 || i > n) && (i = n);
  32133. for (var r = "", o = t; o < i; ++o)
  32134. r += W(e[o]);
  32135. return r
  32136. }
  32137. function D(e, t, i) {
  32138. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32139. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32140. return r
  32141. }
  32142. function N(e, t, i) {
  32143. if (e % 1 !== 0 || e < 0)
  32144. throw new RangeError("offset is not uint");
  32145. if (e + t > i)
  32146. throw new RangeError("Trying to access beyond buffer length")
  32147. }
  32148. function B(e, t, i, n, r, o) {
  32149. if (!a.isBuffer(e))
  32150. throw new TypeError('"buffer" argument must be a Buffer instance');
  32151. if (t > r || t < o)
  32152. throw new RangeError('"value" argument is out of bounds');
  32153. if (i + n > e.length)
  32154. throw new RangeError("Index out of range")
  32155. }
  32156. function F(e, t, i, n) {
  32157. t < 0 && (t = 65535 + t + 1);
  32158. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32159. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32160. }
  32161. function V(e, t, i, n) {
  32162. t < 0 && (t = 4294967295 + t + 1);
  32163. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32164. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32165. }
  32166. function U(e, t, i, n, r, o) {
  32167. if (i + n > e.length)
  32168. throw new RangeError("Index out of range");
  32169. if (i < 0)
  32170. throw new RangeError("Index out of range")
  32171. }
  32172. function k(e, t, i, n, r) {
  32173. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32174. J.write(e, t, i, n, 23, 4),
  32175. i + 4
  32176. }
  32177. function H(e, t, i, n, r) {
  32178. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32179. J.write(e, t, i, n, 52, 8),
  32180. i + 8
  32181. }
  32182. function G(e) {
  32183. if (e = z(e).replace(te, ""),
  32184. e.length < 2)
  32185. return "";
  32186. for (; e.length % 4 !== 0; )
  32187. e += "=";
  32188. return e
  32189. }
  32190. function z(e) {
  32191. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32192. }
  32193. function W(e) {
  32194. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32195. }
  32196. function j(e, t) {
  32197. t = t || 1 / 0;
  32198. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32199. if (i = e.charCodeAt(a),
  32200. i > 55295 && i < 57344) {
  32201. if (!r) {
  32202. if (i > 56319) {
  32203. (t -= 3) > -1 && o.push(239, 191, 189);
  32204. continue
  32205. }
  32206. if (a + 1 === n) {
  32207. (t -= 3) > -1 && o.push(239, 191, 189);
  32208. continue
  32209. }
  32210. r = i;
  32211. continue
  32212. }
  32213. if (i < 56320) {
  32214. (t -= 3) > -1 && o.push(239, 191, 189),
  32215. r = i;
  32216. continue
  32217. }
  32218. i = (r - 55296 << 10 | i - 56320) + 65536
  32219. } else
  32220. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32221. if (r = null,
  32222. i < 128) {
  32223. if ((t -= 1) < 0)
  32224. break;
  32225. o.push(i)
  32226. } else if (i < 2048) {
  32227. if ((t -= 2) < 0)
  32228. break;
  32229. o.push(i >> 6 | 192, 63 & i | 128)
  32230. } else if (i < 65536) {
  32231. if ((t -= 3) < 0)
  32232. break;
  32233. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32234. } else {
  32235. if (!(i < 1114112))
  32236. throw new Error("Invalid code point");
  32237. if ((t -= 4) < 0)
  32238. break;
  32239. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32240. }
  32241. }
  32242. return o
  32243. }
  32244. function Y(e) {
  32245. for (var t = [], i = 0; i < e.length; ++i)
  32246. t.push(255 & e.charCodeAt(i));
  32247. return t
  32248. }
  32249. function X(e, t) {
  32250. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32251. i = e.charCodeAt(a),
  32252. n = i >> 8,
  32253. r = i % 256,
  32254. o.push(r),
  32255. o.push(n);
  32256. return o
  32257. }
  32258. function Z(e) {
  32259. return Q.toByteArray(G(e))
  32260. }
  32261. function q(e, t, i, n) {
  32262. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32263. t[r + i] = e[r];
  32264. return r
  32265. }
  32266. function K(e) {
  32267. return e !== e
  32268. }
  32269. var Q = e("base64-js")
  32270. , J = e("ieee754")
  32271. , $ = e("isarray");
  32272. i.Buffer = a,
  32273. i.SlowBuffer = m,
  32274. i.INSPECT_MAX_BYTES = 50,
  32275. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32276. i.kMaxLength = r(),
  32277. a.poolSize = 8192,
  32278. a._augment = function(e) {
  32279. return e.__proto__ = a.prototype,
  32280. e
  32281. }
  32282. ,
  32283. a.from = function(e, t, i) {
  32284. return s(null, e, t, i)
  32285. }
  32286. ,
  32287. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32288. a.__proto__ = Uint8Array,
  32289. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32290. value: null,
  32291. configurable: !0
  32292. })),
  32293. a.alloc = function(e, t, i) {
  32294. return c(null, e, t, i)
  32295. }
  32296. ,
  32297. a.allocUnsafe = function(e) {
  32298. return h(null, e)
  32299. }
  32300. ,
  32301. a.allocUnsafeSlow = function(e) {
  32302. return h(null, e)
  32303. }
  32304. ,
  32305. a.isBuffer = function(e) {
  32306. return !(null == e || !e._isBuffer)
  32307. }
  32308. ,
  32309. a.compare = function(e, t) {
  32310. if (!a.isBuffer(e) || !a.isBuffer(t))
  32311. throw new TypeError("Arguments must be Buffers");
  32312. if (e === t)
  32313. return 0;
  32314. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32315. if (e[r] !== t[r]) {
  32316. i = e[r],
  32317. n = t[r];
  32318. break
  32319. }
  32320. return i < n ? -1 : n < i ? 1 : 0
  32321. }
  32322. ,
  32323. a.isEncoding = function(e) {
  32324. switch (String(e).toLowerCase()) {
  32325. case "hex":
  32326. case "utf8":
  32327. case "utf-8":
  32328. case "ascii":
  32329. case "latin1":
  32330. case "binary":
  32331. case "base64":
  32332. case "ucs2":
  32333. case "ucs-2":
  32334. case "utf16le":
  32335. case "utf-16le":
  32336. return !0;
  32337. default:
  32338. return !1
  32339. }
  32340. }
  32341. ,
  32342. a.concat = function(e, t) {
  32343. if (!$(e))
  32344. throw new TypeError('"list" argument must be an Array of Buffers');
  32345. if (0 === e.length)
  32346. return a.alloc(0);
  32347. var i;
  32348. if (void 0 === t)
  32349. for (t = 0,
  32350. i = 0; i < e.length; ++i)
  32351. t += e[i].length;
  32352. var n = a.allocUnsafe(t)
  32353. , r = 0;
  32354. for (i = 0; i < e.length; ++i) {
  32355. var o = e[i];
  32356. if (!a.isBuffer(o))
  32357. throw new TypeError('"list" argument must be an Array of Buffers');
  32358. o.copy(n, r),
  32359. r += o.length
  32360. }
  32361. return n
  32362. }
  32363. ,
  32364. a.byteLength = v,
  32365. a.prototype._isBuffer = !0,
  32366. a.prototype.swap16 = function() {
  32367. var e = this.length;
  32368. if (e % 2 !== 0)
  32369. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32370. for (var t = 0; t < e; t += 2)
  32371. y(this, t, t + 1);
  32372. return this
  32373. }
  32374. ,
  32375. a.prototype.swap32 = function() {
  32376. var e = this.length;
  32377. if (e % 4 !== 0)
  32378. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32379. for (var t = 0; t < e; t += 4)
  32380. y(this, t, t + 3),
  32381. y(this, t + 1, t + 2);
  32382. return this
  32383. }
  32384. ,
  32385. a.prototype.swap64 = function() {
  32386. var e = this.length;
  32387. if (e % 8 !== 0)
  32388. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32389. for (var t = 0; t < e; t += 8)
  32390. y(this, t, t + 7),
  32391. y(this, t + 1, t + 6),
  32392. y(this, t + 2, t + 5),
  32393. y(this, t + 3, t + 4);
  32394. return this
  32395. }
  32396. ,
  32397. a.prototype.toString = function() {
  32398. var e = 0 | this.length;
  32399. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32400. }
  32401. ,
  32402. a.prototype.equals = function(e) {
  32403. if (!a.isBuffer(e))
  32404. throw new TypeError("Argument must be a Buffer");
  32405. return this === e || 0 === a.compare(this, e)
  32406. }
  32407. ,
  32408. a.prototype.inspect = function() {
  32409. var e = ""
  32410. , t = i.INSPECT_MAX_BYTES;
  32411. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32412. this.length > t && (e += " ... ")),
  32413. "<Buffer " + e + ">"
  32414. }
  32415. ,
  32416. a.prototype.compare = function(e, t, i, n, r) {
  32417. if (!a.isBuffer(e))
  32418. throw new TypeError("Argument must be a Buffer");
  32419. if (void 0 === t && (t = 0),
  32420. void 0 === i && (i = e ? e.length : 0),
  32421. void 0 === n && (n = 0),
  32422. void 0 === r && (r = this.length),
  32423. t < 0 || i > e.length || n < 0 || r > this.length)
  32424. throw new RangeError("out of range index");
  32425. if (n >= r && t >= i)
  32426. return 0;
  32427. if (n >= r)
  32428. return -1;
  32429. if (t >= i)
  32430. return 1;
  32431. if (t >>>= 0,
  32432. i >>>= 0,
  32433. n >>>= 0,
  32434. r >>>= 0,
  32435. this === e)
  32436. return 0;
  32437. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  32438. if (c[u] !== h[u]) {
  32439. o = c[u],
  32440. s = h[u];
  32441. break
  32442. }
  32443. return o < s ? -1 : s < o ? 1 : 0
  32444. }
  32445. ,
  32446. a.prototype.includes = function(e, t, i) {
  32447. return this.indexOf(e, t, i) !== -1
  32448. }
  32449. ,
  32450. a.prototype.indexOf = function(e, t, i) {
  32451. return C(this, e, t, i, !0)
  32452. }
  32453. ,
  32454. a.prototype.lastIndexOf = function(e, t, i) {
  32455. return C(this, e, t, i, !1)
  32456. }
  32457. ,
  32458. a.prototype.write = function(e, t, i, n) {
  32459. if (void 0 === t)
  32460. n = "utf8",
  32461. i = this.length,
  32462. t = 0;
  32463. else if (void 0 === i && "string" == typeof t)
  32464. n = t,
  32465. i = this.length,
  32466. t = 0;
  32467. else {
  32468. if (!isFinite(t))
  32469. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32470. t |= 0,
  32471. isFinite(i) ? (i |= 0,
  32472. void 0 === n && (n = "utf8")) : (n = i,
  32473. i = void 0)
  32474. }
  32475. var r = this.length - t;
  32476. if ((void 0 === i || i > r) && (i = r),
  32477. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32478. throw new RangeError("Attempt to write outside buffer bounds");
  32479. n || (n = "utf8");
  32480. for (var o = !1; ; )
  32481. switch (n) {
  32482. case "hex":
  32483. return E(this, e, t, i);
  32484. case "utf8":
  32485. case "utf-8":
  32486. return b(this, e, t, i);
  32487. case "ascii":
  32488. return w(this, e, t, i);
  32489. case "latin1":
  32490. case "binary":
  32491. return _(this, e, t, i);
  32492. case "base64":
  32493. return T(this, e, t, i);
  32494. case "ucs2":
  32495. case "ucs-2":
  32496. case "utf16le":
  32497. case "utf-16le":
  32498. return x(this, e, t, i);
  32499. default:
  32500. if (o)
  32501. throw new TypeError("Unknown encoding: " + n);
  32502. n = ("" + n).toLowerCase(),
  32503. o = !0
  32504. }
  32505. }
  32506. ,
  32507. a.prototype.toJSON = function() {
  32508. return {
  32509. type: "Buffer",
  32510. data: Array.prototype.slice.call(this._arr || this, 0)
  32511. }
  32512. }
  32513. ;
  32514. var ee = 4096;
  32515. a.prototype.slice = function(e, t) {
  32516. var i = this.length;
  32517. e = ~~e,
  32518. t = void 0 === t ? i : ~~t,
  32519. e < 0 ? (e += i,
  32520. e < 0 && (e = 0)) : e > i && (e = i),
  32521. t < 0 ? (t += i,
  32522. t < 0 && (t = 0)) : t > i && (t = i),
  32523. t < e && (t = e);
  32524. var n;
  32525. if (a.TYPED_ARRAY_SUPPORT)
  32526. n = this.subarray(e, t),
  32527. n.__proto__ = a.prototype;
  32528. else {
  32529. var r = t - e;
  32530. n = new a(r,void 0);
  32531. for (var o = 0; o < r; ++o)
  32532. n[o] = this[o + e]
  32533. }
  32534. return n
  32535. }
  32536. ,
  32537. a.prototype.readUIntLE = function(e, t, i) {
  32538. e |= 0,
  32539. t |= 0,
  32540. i || N(e, t, this.length);
  32541. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32542. n += this[e + o] * r;
  32543. return n
  32544. }
  32545. ,
  32546. a.prototype.readUIntBE = function(e, t, i) {
  32547. e |= 0,
  32548. t |= 0,
  32549. i || N(e, t, this.length);
  32550. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32551. n += this[e + --t] * r;
  32552. return n
  32553. }
  32554. ,
  32555. a.prototype.readUInt8 = function(e, t) {
  32556. return t || N(e, 1, this.length),
  32557. this[e]
  32558. }
  32559. ,
  32560. a.prototype.readUInt16LE = function(e, t) {
  32561. return t || N(e, 2, this.length),
  32562. this[e] | this[e + 1] << 8
  32563. }
  32564. ,
  32565. a.prototype.readUInt16BE = function(e, t) {
  32566. return t || N(e, 2, this.length),
  32567. this[e] << 8 | this[e + 1]
  32568. }
  32569. ,
  32570. a.prototype.readUInt32LE = function(e, t) {
  32571. return t || N(e, 4, this.length),
  32572. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32573. }
  32574. ,
  32575. a.prototype.readUInt32BE = function(e, t) {
  32576. return t || N(e, 4, this.length),
  32577. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32578. }
  32579. ,
  32580. a.prototype.readIntLE = function(e, t, i) {
  32581. e |= 0,
  32582. t |= 0,
  32583. i || N(e, t, this.length);
  32584. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32585. n += this[e + o] * r;
  32586. return r *= 128,
  32587. n >= r && (n -= Math.pow(2, 8 * t)),
  32588. n
  32589. }
  32590. ,
  32591. a.prototype.readIntBE = function(e, t, i) {
  32592. e |= 0,
  32593. t |= 0,
  32594. i || N(e, t, this.length);
  32595. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32596. o += this[e + --n] * r;
  32597. return r *= 128,
  32598. o >= r && (o -= Math.pow(2, 8 * t)),
  32599. o
  32600. }
  32601. ,
  32602. a.prototype.readInt8 = function(e, t) {
  32603. return t || N(e, 1, this.length),
  32604. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32605. }
  32606. ,
  32607. a.prototype.readInt16LE = function(e, t) {
  32608. t || N(e, 2, this.length);
  32609. var i = this[e] | this[e + 1] << 8;
  32610. return 32768 & i ? 4294901760 | i : i
  32611. }
  32612. ,
  32613. a.prototype.readInt16BE = function(e, t) {
  32614. t || N(e, 2, this.length);
  32615. var i = this[e + 1] | this[e] << 8;
  32616. return 32768 & i ? 4294901760 | i : i
  32617. }
  32618. ,
  32619. a.prototype.readInt32LE = function(e, t) {
  32620. return t || N(e, 4, this.length),
  32621. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32622. }
  32623. ,
  32624. a.prototype.readInt32BE = function(e, t) {
  32625. return t || N(e, 4, this.length),
  32626. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32627. }
  32628. ,
  32629. a.prototype.readFloatLE = function(e, t) {
  32630. return t || N(e, 4, this.length),
  32631. J.read(this, e, !0, 23, 4)
  32632. }
  32633. ,
  32634. a.prototype.readFloatBE = function(e, t) {
  32635. return t || N(e, 4, this.length),
  32636. J.read(this, e, !1, 23, 4)
  32637. }
  32638. ,
  32639. a.prototype.readDoubleLE = function(e, t) {
  32640. return t || N(e, 8, this.length),
  32641. J.read(this, e, !0, 52, 8)
  32642. }
  32643. ,
  32644. a.prototype.readDoubleBE = function(e, t) {
  32645. return t || N(e, 8, this.length),
  32646. J.read(this, e, !1, 52, 8)
  32647. }
  32648. ,
  32649. a.prototype.writeUIntLE = function(e, t, i, n) {
  32650. if (e = +e,
  32651. t |= 0,
  32652. i |= 0,
  32653. !n) {
  32654. var r = Math.pow(2, 8 * i) - 1;
  32655. B(this, e, t, i, r, 0)
  32656. }
  32657. var o = 1
  32658. , a = 0;
  32659. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32660. this[t + a] = e / o & 255;
  32661. return t + i
  32662. }
  32663. ,
  32664. a.prototype.writeUIntBE = function(e, t, i, n) {
  32665. if (e = +e,
  32666. t |= 0,
  32667. i |= 0,
  32668. !n) {
  32669. var r = Math.pow(2, 8 * i) - 1;
  32670. B(this, e, t, i, r, 0)
  32671. }
  32672. var o = i - 1
  32673. , a = 1;
  32674. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32675. this[t + o] = e / a & 255;
  32676. return t + i
  32677. }
  32678. ,
  32679. a.prototype.writeUInt8 = function(e, t, i) {
  32680. return e = +e,
  32681. t |= 0,
  32682. i || B(this, e, t, 1, 255, 0),
  32683. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32684. this[t] = 255 & e,
  32685. t + 1
  32686. }
  32687. ,
  32688. a.prototype.writeUInt16LE = function(e, t, i) {
  32689. return e = +e,
  32690. t |= 0,
  32691. i || B(this, e, t, 2, 65535, 0),
  32692. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32693. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32694. t + 2
  32695. }
  32696. ,
  32697. a.prototype.writeUInt16BE = function(e, t, i) {
  32698. return e = +e,
  32699. t |= 0,
  32700. i || B(this, e, t, 2, 65535, 0),
  32701. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32702. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32703. t + 2
  32704. }
  32705. ,
  32706. a.prototype.writeUInt32LE = function(e, t, i) {
  32707. return e = +e,
  32708. t |= 0,
  32709. i || B(this, e, t, 4, 4294967295, 0),
  32710. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32711. this[t + 2] = e >>> 16,
  32712. this[t + 1] = e >>> 8,
  32713. this[t] = 255 & e) : V(this, e, t, !0),
  32714. t + 4
  32715. }
  32716. ,
  32717. a.prototype.writeUInt32BE = function(e, t, i) {
  32718. return e = +e,
  32719. t |= 0,
  32720. i || B(this, e, t, 4, 4294967295, 0),
  32721. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32722. this[t + 1] = e >>> 16,
  32723. this[t + 2] = e >>> 8,
  32724. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32725. t + 4
  32726. }
  32727. ,
  32728. a.prototype.writeIntLE = function(e, t, i, n) {
  32729. if (e = +e,
  32730. t |= 0,
  32731. !n) {
  32732. var r = Math.pow(2, 8 * i - 1);
  32733. B(this, e, t, i, r - 1, -r)
  32734. }
  32735. var o = 0
  32736. , a = 1
  32737. , s = 0;
  32738. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32739. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32740. this[t + o] = (e / a >> 0) - s & 255;
  32741. return t + i
  32742. }
  32743. ,
  32744. a.prototype.writeIntBE = function(e, t, i, n) {
  32745. if (e = +e,
  32746. t |= 0,
  32747. !n) {
  32748. var r = Math.pow(2, 8 * i - 1);
  32749. B(this, e, t, i, r - 1, -r)
  32750. }
  32751. var o = i - 1
  32752. , a = 1
  32753. , s = 0;
  32754. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32755. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32756. this[t + o] = (e / a >> 0) - s & 255;
  32757. return t + i
  32758. }
  32759. ,
  32760. a.prototype.writeInt8 = function(e, t, i) {
  32761. return e = +e,
  32762. t |= 0,
  32763. i || B(this, e, t, 1, 127, -128),
  32764. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32765. e < 0 && (e = 255 + e + 1),
  32766. this[t] = 255 & e,
  32767. t + 1
  32768. }
  32769. ,
  32770. a.prototype.writeInt16LE = function(e, t, i) {
  32771. return e = +e,
  32772. t |= 0,
  32773. i || B(this, e, t, 2, 32767, -32768),
  32774. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32775. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32776. t + 2
  32777. }
  32778. ,
  32779. a.prototype.writeInt16BE = function(e, t, i) {
  32780. return e = +e,
  32781. t |= 0,
  32782. i || B(this, e, t, 2, 32767, -32768),
  32783. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32784. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32785. t + 2
  32786. }
  32787. ,
  32788. a.prototype.writeInt32LE = function(e, t, i) {
  32789. return e = +e,
  32790. t |= 0,
  32791. i || B(this, e, t, 4, 2147483647, -2147483648),
  32792. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32793. this[t + 1] = e >>> 8,
  32794. this[t + 2] = e >>> 16,
  32795. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32796. t + 4
  32797. }
  32798. ,
  32799. a.prototype.writeInt32BE = function(e, t, i) {
  32800. return e = +e,
  32801. t |= 0,
  32802. i || B(this, e, t, 4, 2147483647, -2147483648),
  32803. e < 0 && (e = 4294967295 + e + 1),
  32804. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32805. this[t + 1] = e >>> 16,
  32806. this[t + 2] = e >>> 8,
  32807. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32808. t + 4
  32809. }
  32810. ,
  32811. a.prototype.writeFloatLE = function(e, t, i) {
  32812. return k(this, e, t, !0, i)
  32813. }
  32814. ,
  32815. a.prototype.writeFloatBE = function(e, t, i) {
  32816. return k(this, e, t, !1, i)
  32817. }
  32818. ,
  32819. a.prototype.writeDoubleLE = function(e, t, i) {
  32820. return H(this, e, t, !0, i)
  32821. }
  32822. ,
  32823. a.prototype.writeDoubleBE = function(e, t, i) {
  32824. return H(this, e, t, !1, i)
  32825. }
  32826. ,
  32827. a.prototype.copy = function(e, t, i, n) {
  32828. if (i || (i = 0),
  32829. n || 0 === n || (n = this.length),
  32830. t >= e.length && (t = e.length),
  32831. t || (t = 0),
  32832. n > 0 && n < i && (n = i),
  32833. n === i)
  32834. return 0;
  32835. if (0 === e.length || 0 === this.length)
  32836. return 0;
  32837. if (t < 0)
  32838. throw new RangeError("targetStart out of bounds");
  32839. if (i < 0 || i >= this.length)
  32840. throw new RangeError("sourceStart out of bounds");
  32841. if (n < 0)
  32842. throw new RangeError("sourceEnd out of bounds");
  32843. n > this.length && (n = this.length),
  32844. e.length - t < n - i && (n = e.length - t + i);
  32845. var r, o = n - i;
  32846. if (this === e && i < t && t < n)
  32847. for (r = o - 1; r >= 0; --r)
  32848. e[r + t] = this[r + i];
  32849. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32850. for (r = 0; r < o; ++r)
  32851. e[r + t] = this[r + i];
  32852. else
  32853. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32854. return o
  32855. }
  32856. ,
  32857. a.prototype.fill = function(e, t, i, n) {
  32858. if ("string" == typeof e) {
  32859. if ("string" == typeof t ? (n = t,
  32860. t = 0,
  32861. i = this.length) : "string" == typeof i && (n = i,
  32862. i = this.length),
  32863. 1 === e.length) {
  32864. var r = e.charCodeAt(0);
  32865. r < 256 && (e = r)
  32866. }
  32867. if (void 0 !== n && "string" != typeof n)
  32868. throw new TypeError("encoding must be a string");
  32869. if ("string" == typeof n && !a.isEncoding(n))
  32870. throw new TypeError("Unknown encoding: " + n)
  32871. } else
  32872. "number" == typeof e && (e &= 255);
  32873. if (t < 0 || this.length < t || this.length < i)
  32874. throw new RangeError("Out of range index");
  32875. if (i <= t)
  32876. return this;
  32877. t >>>= 0,
  32878. i = void 0 === i ? this.length : i >>> 0,
  32879. e || (e = 0);
  32880. var o;
  32881. if ("number" == typeof e)
  32882. for (o = t; o < i; ++o)
  32883. this[o] = e;
  32884. else {
  32885. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32886. , l = s.length;
  32887. for (o = 0; o < i - t; ++o)
  32888. this[o + t] = s[o % l]
  32889. }
  32890. return this
  32891. }
  32892. ;
  32893. var te = /[^+\/0-9A-Za-z-_]/g
  32894. }
  32895. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32896. }
  32897. , {
  32898. "base64-js": 199,
  32899. ieee754: 200,
  32900. isarray: 201
  32901. }],
  32902. 199: [function(e, t, i) {
  32903. "use strict";
  32904. function n(e) {
  32905. var t = e.length;
  32906. if (t % 4 > 0)
  32907. throw new Error("Invalid string. Length must be a multiple of 4");
  32908. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32909. }
  32910. function r(e) {
  32911. return 3 * e.length / 4 - n(e)
  32912. }
  32913. function o(e) {
  32914. var t, i, r, o, a, s, l = e.length;
  32915. a = n(e),
  32916. s = new u(3 * l / 4 - a),
  32917. r = a > 0 ? l - 4 : l;
  32918. var c = 0;
  32919. for (t = 0,
  32920. i = 0; t < r; t += 4,
  32921. i += 3)
  32922. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32923. s[c++] = o >> 16 & 255,
  32924. s[c++] = o >> 8 & 255,
  32925. s[c++] = 255 & o;
  32926. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32927. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32928. s[c++] = o >> 8 & 255,
  32929. s[c++] = 255 & o),
  32930. s
  32931. }
  32932. function a(e) {
  32933. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32934. }
  32935. function s(e, t, i) {
  32936. for (var n, r = [], o = t; o < i; o += 3)
  32937. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32938. r.push(a(n));
  32939. return r.join("")
  32940. }
  32941. function l(e) {
  32942. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32943. o.push(s(e, l, l + a > h ? h : l + a));
  32944. return 1 === n ? (t = e[i - 1],
  32945. r += c[t >> 2],
  32946. r += c[t << 4 & 63],
  32947. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32948. r += c[t >> 10],
  32949. r += c[t >> 4 & 63],
  32950. r += c[t << 2 & 63],
  32951. r += "="),
  32952. o.push(r),
  32953. o.join("")
  32954. }
  32955. i.byteLength = r,
  32956. i.toByteArray = o,
  32957. i.fromByteArray = l;
  32958. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32959. c[p] = d[p],
  32960. h[d.charCodeAt(p)] = p;
  32961. h["-".charCodeAt(0)] = 62,
  32962. h["_".charCodeAt(0)] = 63
  32963. }
  32964. , {}],
  32965. 200: [function(e, t, i) {
  32966. i.read = function(e, t, i, n, r) {
  32967. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  32968. for (u += d,
  32969. o = p & (1 << -h) - 1,
  32970. p >>= -h,
  32971. h += s; h > 0; o = 256 * o + e[t + u],
  32972. u += d,
  32973. h -= 8)
  32974. ;
  32975. for (a = o & (1 << -h) - 1,
  32976. o >>= -h,
  32977. h += n; h > 0; a = 256 * a + e[t + u],
  32978. u += d,
  32979. h -= 8)
  32980. ;
  32981. if (0 === o)
  32982. o = 1 - c;
  32983. else {
  32984. if (o === l)
  32985. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32986. a += Math.pow(2, n),
  32987. o -= c
  32988. }
  32989. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32990. }
  32991. ,
  32992. i.write = function(e, t, i, n, r, o) {
  32993. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  32994. for (t = Math.abs(t),
  32995. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32996. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32997. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32998. l *= 2),
  32999. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33000. t * l >= 2 && (a++,
  33001. l /= 2),
  33002. a + u >= h ? (s = 0,
  33003. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33004. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33005. a = 0)); r >= 8; e[i + p] = 255 & s,
  33006. p += f,
  33007. s /= 256,
  33008. r -= 8)
  33009. ;
  33010. for (a = a << r | s,
  33011. c += r; c > 0; e[i + p] = 255 & a,
  33012. p += f,
  33013. a /= 256,
  33014. c -= 8)
  33015. ;
  33016. e[i + p - f] |= 128 * g
  33017. }
  33018. }
  33019. , {}],
  33020. 201: [function(e, t, i) {
  33021. var n = {}.toString;
  33022. t.exports = Array.isArray || function(e) {
  33023. return "[object Array]" == n.call(e)
  33024. }
  33025. }
  33026. , {}],
  33027. 202: [function(e, t, i) {
  33028. function n() {
  33029. this._events = this._events || {},
  33030. this._maxListeners = this._maxListeners || void 0
  33031. }
  33032. function r(e) {
  33033. return "function" == typeof e
  33034. }
  33035. function o(e) {
  33036. return "number" == typeof e
  33037. }
  33038. function a(e) {
  33039. return "object" == typeof e && null !== e
  33040. }
  33041. function s(e) {
  33042. return void 0 === e
  33043. }
  33044. t.exports = n,
  33045. n.EventEmitter = n,
  33046. n.prototype._events = void 0,
  33047. n.prototype._maxListeners = void 0,
  33048. n.defaultMaxListeners = 10,
  33049. n.prototype.setMaxListeners = function(e) {
  33050. if (!o(e) || e < 0 || isNaN(e))
  33051. throw TypeError("n must be a positive number");
  33052. return this._maxListeners = e,
  33053. this
  33054. }
  33055. ,
  33056. n.prototype.emit = function(e) {
  33057. var t, i, n, o, l, c;
  33058. if (this._events || (this._events = {}),
  33059. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33060. if (t = arguments[1],
  33061. t instanceof Error)
  33062. throw t;
  33063. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33064. throw h.context = t,
  33065. h
  33066. }
  33067. if (i = this._events[e],
  33068. s(i))
  33069. return !1;
  33070. if (r(i))
  33071. switch (arguments.length) {
  33072. case 1:
  33073. i.call(this);
  33074. break;
  33075. case 2:
  33076. i.call(this, arguments[1]);
  33077. break;
  33078. case 3:
  33079. i.call(this, arguments[1], arguments[2]);
  33080. break;
  33081. default:
  33082. o = Array.prototype.slice.call(arguments, 1),
  33083. i.apply(this, o)
  33084. }
  33085. else if (a(i))
  33086. for (o = Array.prototype.slice.call(arguments, 1),
  33087. c = i.slice(),
  33088. n = c.length,
  33089. l = 0; l < n; l++)
  33090. c[l].apply(this, o);
  33091. return !0
  33092. }
  33093. ,
  33094. n.prototype.addListener = function(e, t) {
  33095. var i;
  33096. if (!r(t))
  33097. throw TypeError("listener must be a function");
  33098. return this._events || (this._events = {}),
  33099. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33100. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33101. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33102. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33103. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33104. "function" == typeof console.trace && console.trace())),
  33105. this
  33106. }
  33107. ,
  33108. n.prototype.on = n.prototype.addListener,
  33109. n.prototype.once = function(e, t) {
  33110. function i() {
  33111. this.removeListener(e, i),
  33112. n || (n = !0,
  33113. t.apply(this, arguments))
  33114. }
  33115. if (!r(t))
  33116. throw TypeError("listener must be a function");
  33117. var n = !1;
  33118. return i.listener = t,
  33119. this.on(e, i),
  33120. this
  33121. }
  33122. ,
  33123. n.prototype.removeListener = function(e, t) {
  33124. var i, n, o, s;
  33125. if (!r(t))
  33126. throw TypeError("listener must be a function");
  33127. if (!this._events || !this._events[e])
  33128. return this;
  33129. if (i = this._events[e],
  33130. o = i.length,
  33131. n = -1,
  33132. i === t || r(i.listener) && i.listener === t)
  33133. delete this._events[e],
  33134. this._events.removeListener && this.emit("removeListener", e, t);
  33135. else if (a(i)) {
  33136. for (s = o; s-- > 0; )
  33137. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33138. n = s;
  33139. break
  33140. }
  33141. if (n < 0)
  33142. return this;
  33143. 1 === i.length ? (i.length = 0,
  33144. delete this._events[e]) : i.splice(n, 1),
  33145. this._events.removeListener && this.emit("removeListener", e, t)
  33146. }
  33147. return this
  33148. }
  33149. ,
  33150. n.prototype.removeAllListeners = function(e) {
  33151. var t, i;
  33152. if (!this._events)
  33153. return this;
  33154. if (!this._events.removeListener)
  33155. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33156. this;
  33157. if (0 === arguments.length) {
  33158. for (t in this._events)
  33159. "removeListener" !== t && this.removeAllListeners(t);
  33160. return this.removeAllListeners("removeListener"),
  33161. this._events = {},
  33162. this
  33163. }
  33164. if (i = this._events[e],
  33165. r(i))
  33166. this.removeListener(e, i);
  33167. else if (i)
  33168. for (; i.length; )
  33169. this.removeListener(e, i[i.length - 1]);
  33170. return delete this._events[e],
  33171. this
  33172. }
  33173. ,
  33174. n.prototype.listeners = function(e) {
  33175. var t;
  33176. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33177. }
  33178. ,
  33179. n.prototype.listenerCount = function(e) {
  33180. if (this._events) {
  33181. var t = this._events[e];
  33182. if (r(t))
  33183. return 1;
  33184. if (t)
  33185. return t.length
  33186. }
  33187. return 0
  33188. }
  33189. ,
  33190. n.listenerCount = function(e, t) {
  33191. return e.listenerCount(t)
  33192. }
  33193. }
  33194. , {}],
  33195. 203: [function(e, t, i) {
  33196. function n() {
  33197. throw new Error("setTimeout has not been defined")
  33198. }
  33199. function r() {
  33200. throw new Error("clearTimeout has not been defined")
  33201. }
  33202. function o(e) {
  33203. if (u === setTimeout)
  33204. return setTimeout(e, 0);
  33205. if ((u === n || !u) && setTimeout)
  33206. return u = setTimeout,
  33207. setTimeout(e, 0);
  33208. try {
  33209. return u(e, 0)
  33210. } catch (t) {
  33211. try {
  33212. return u.call(null, e, 0)
  33213. } catch (t) {
  33214. return u.call(this, e, 0)
  33215. }
  33216. }
  33217. }
  33218. function a(e) {
  33219. if (d === clearTimeout)
  33220. return clearTimeout(e);
  33221. if ((d === r || !d) && clearTimeout)
  33222. return d = clearTimeout,
  33223. clearTimeout(e);
  33224. try {
  33225. return d(e)
  33226. } catch (t) {
  33227. try {
  33228. return d.call(null, e)
  33229. } catch (t) {
  33230. return d.call(this, e)
  33231. }
  33232. }
  33233. }
  33234. function s() {
  33235. m && f && (m = !1,
  33236. f.length ? g = f.concat(g) : v = -1,
  33237. g.length && l())
  33238. }
  33239. function l() {
  33240. if (!m) {
  33241. var e = o(s);
  33242. m = !0;
  33243. for (var t = g.length; t; ) {
  33244. for (f = g,
  33245. g = []; ++v < t; )
  33246. f && f[v].run();
  33247. v = -1,
  33248. t = g.length
  33249. }
  33250. f = null,
  33251. m = !1,
  33252. a(e)
  33253. }
  33254. }
  33255. function c(e, t) {
  33256. this.fun = e,
  33257. this.array = t
  33258. }
  33259. function h() {}
  33260. var u, d, p = t.exports = {};
  33261. !function() {
  33262. try {
  33263. u = "function" == typeof setTimeout ? setTimeout : n
  33264. } catch (e) {
  33265. u = n
  33266. }
  33267. try {
  33268. d = "function" == typeof clearTimeout ? clearTimeout : r
  33269. } catch (e) {
  33270. d = r
  33271. }
  33272. }();
  33273. var f, g = [], m = !1, v = -1;
  33274. p.nextTick = function(e) {
  33275. var t = new Array(arguments.length - 1);
  33276. if (arguments.length > 1)
  33277. for (var i = 1; i < arguments.length; i++)
  33278. t[i - 1] = arguments[i];
  33279. g.push(new c(e,t)),
  33280. 1 !== g.length || m || o(l)
  33281. }
  33282. ,
  33283. c.prototype.run = function() {
  33284. this.fun.apply(null, this.array)
  33285. }
  33286. ,
  33287. p.title = "browser",
  33288. p.browser = !0,
  33289. p.env = {},
  33290. p.argv = [],
  33291. p.version = "",
  33292. p.versions = {},
  33293. p.on = h,
  33294. p.addListener = h,
  33295. p.once = h,
  33296. p.off = h,
  33297. p.removeListener = h,
  33298. p.removeAllListeners = h,
  33299. p.emit = h,
  33300. p.binding = function(e) {
  33301. throw new Error("process.binding is not supported")
  33302. }
  33303. ,
  33304. p.cwd = function() {
  33305. return "/"
  33306. }
  33307. ,
  33308. p.chdir = function(e) {
  33309. throw new Error("process.chdir is not supported")
  33310. }
  33311. ,
  33312. p.umask = function() {
  33313. return 0
  33314. }
  33315. }
  33316. , {}],
  33317. 204: [function(e, t, i) {
  33318. (function(e) {
  33319. !function(n) {
  33320. function r(e) {
  33321. throw new RangeError(L[e])
  33322. }
  33323. function o(e, t) {
  33324. for (var i = e.length, n = []; i--; )
  33325. n[i] = t(e[i]);
  33326. return n
  33327. }
  33328. function a(e, t) {
  33329. var i = e.split("@")
  33330. , n = "";
  33331. i.length > 1 && (n = i[0] + "@",
  33332. e = i[1]),
  33333. e = e.replace(O, ".");
  33334. var r = e.split(".")
  33335. , a = o(r, t).join(".");
  33336. return n + a
  33337. }
  33338. function s(e) {
  33339. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33340. t = e.charCodeAt(r++),
  33341. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33342. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33343. r--)) : n.push(t);
  33344. return n
  33345. }
  33346. function l(e) {
  33347. return o(e, function(e) {
  33348. var t = "";
  33349. return e > 65535 && (e -= 65536,
  33350. t += B(e >>> 10 & 1023 | 55296),
  33351. e = 56320 | 1023 & e),
  33352. t += B(e)
  33353. }).join("")
  33354. }
  33355. function c(e) {
  33356. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33357. }
  33358. function h(e, t) {
  33359. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33360. }
  33361. function u(e, t, i) {
  33362. var n = 0;
  33363. for (e = i ? N(e / T) : e >> 1,
  33364. e += N(e / t); e > D * w >> 1; n += E)
  33365. e = N(e / D);
  33366. return N(n + (D + 1) * e / (e + _))
  33367. }
  33368. function d(e) {
  33369. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33370. for (i = e.lastIndexOf(M),
  33371. i < 0 && (i = 0),
  33372. n = 0; n < i; ++n)
  33373. e.charCodeAt(n) >= 128 && r("not-basic"),
  33374. g.push(e.charCodeAt(n));
  33375. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33376. for (a = v,
  33377. s = 1,
  33378. h = E; o >= m && r("invalid-input"),
  33379. d = c(e.charCodeAt(o++)),
  33380. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33381. v += d * s,
  33382. p = h <= y ? b : h >= y + w ? w : h - y,
  33383. !(d < p); h += E)
  33384. f = E - p,
  33385. s > N(I / f) && r("overflow"),
  33386. s *= f;
  33387. t = g.length + 1,
  33388. y = u(v - a, t, 0 == a),
  33389. N(v / t) > I - A && r("overflow"),
  33390. A += N(v / t),
  33391. v %= t,
  33392. g.splice(v++, 0, A)
  33393. }
  33394. return l(g)
  33395. }
  33396. function p(e) {
  33397. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33398. for (e = s(e),
  33399. m = e.length,
  33400. t = S,
  33401. i = 0,
  33402. a = x,
  33403. l = 0; l < m; ++l)
  33404. g = e[l],
  33405. g < 128 && C.push(B(g));
  33406. for (n = o = C.length,
  33407. o && C.push(M); n < m; ) {
  33408. for (c = I,
  33409. l = 0; l < m; ++l)
  33410. g = e[l],
  33411. g >= t && g < c && (c = g);
  33412. for (v = n + 1,
  33413. c - t > N((I - i) / v) && r("overflow"),
  33414. i += (c - t) * v,
  33415. t = c,
  33416. l = 0; l < m; ++l)
  33417. if (g = e[l],
  33418. g < t && ++i > I && r("overflow"),
  33419. g == t) {
  33420. for (d = i,
  33421. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33422. !(d < f); p += E)
  33423. y = d - f,
  33424. A = E - f,
  33425. C.push(B(h(f + y % A, 0))),
  33426. d = N(y / A);
  33427. C.push(B(h(d, 0))),
  33428. a = u(i, v, n == o),
  33429. i = 0,
  33430. ++n
  33431. }
  33432. ++i,
  33433. ++t
  33434. }
  33435. return C.join("")
  33436. }
  33437. function f(e) {
  33438. return a(e, function(e) {
  33439. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33440. })
  33441. }
  33442. function g(e) {
  33443. return a(e, function(e) {
  33444. return P.test(e) ? "xn--" + p(e) : e
  33445. })
  33446. }
  33447. var m = "object" == typeof i && i && !i.nodeType && i
  33448. , v = "object" == typeof t && t && !t.nodeType && t
  33449. , A = "object" == typeof e && e;
  33450. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33451. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  33452. overflow: "Overflow: input needs wider integers to process",
  33453. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33454. "invalid-input": "Invalid input"
  33455. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33456. if (y = {
  33457. version: "1.4.1",
  33458. ucs2: {
  33459. decode: s,
  33460. encode: l
  33461. },
  33462. decode: d,
  33463. encode: p,
  33464. toASCII: g,
  33465. toUnicode: f
  33466. },
  33467. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33468. define("punycode", function() {
  33469. return y
  33470. });
  33471. else if (m && v)
  33472. if (t.exports == m)
  33473. v.exports = y;
  33474. else
  33475. for (C in y)
  33476. y.hasOwnProperty(C) && (m[C] = y[C]);
  33477. else
  33478. n.punycode = y
  33479. }(this)
  33480. }
  33481. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33482. }
  33483. , {}],
  33484. 205: [function(e, t, i) {
  33485. "use strict";
  33486. function n(e, t) {
  33487. return Object.prototype.hasOwnProperty.call(e, t)
  33488. }
  33489. t.exports = function(e, t, i, o) {
  33490. t = t || "&",
  33491. i = i || "=";
  33492. var a = {};
  33493. if ("string" != typeof e || 0 === e.length)
  33494. return a;
  33495. var s = /\+/g;
  33496. e = e.split(t);
  33497. var l = 1e3;
  33498. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33499. var c = e.length;
  33500. l > 0 && c > l && (c = l);
  33501. for (var h = 0; h < c; ++h) {
  33502. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33503. m >= 0 ? (u = g.substr(0, m),
  33504. d = g.substr(m + 1)) : (u = g,
  33505. d = ""),
  33506. p = decodeURIComponent(u),
  33507. f = decodeURIComponent(d),
  33508. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33509. }
  33510. return a
  33511. }
  33512. ;
  33513. var r = Array.isArray || function(e) {
  33514. return "[object Array]" === Object.prototype.toString.call(e)
  33515. }
  33516. }
  33517. , {}],
  33518. 206: [function(e, t, i) {
  33519. "use strict";
  33520. function n(e, t) {
  33521. if (e.map)
  33522. return e.map(t);
  33523. for (var i = [], n = 0; n < e.length; n++)
  33524. i.push(t(e[n], n));
  33525. return i
  33526. }
  33527. var r = function(e) {
  33528. switch (typeof e) {
  33529. case "string":
  33530. return e;
  33531. case "boolean":
  33532. return e ? "true" : "false";
  33533. case "number":
  33534. return isFinite(e) ? e : "";
  33535. default:
  33536. return ""
  33537. }
  33538. };
  33539. t.exports = function(e, t, i, s) {
  33540. return t = t || "&",
  33541. i = i || "=",
  33542. null === e && (e = void 0),
  33543. "object" == typeof e ? n(a(e), function(a) {
  33544. var s = encodeURIComponent(r(a)) + i;
  33545. return o(e[a]) ? n(e[a], function(e) {
  33546. return s + encodeURIComponent(r(e))
  33547. }).join(t) : s + encodeURIComponent(r(e[a]))
  33548. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33549. }
  33550. ;
  33551. var o = Array.isArray || function(e) {
  33552. return "[object Array]" === Object.prototype.toString.call(e)
  33553. }
  33554. , a = Object.keys || function(e) {
  33555. var t = [];
  33556. for (var i in e)
  33557. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33558. return t
  33559. }
  33560. }
  33561. , {}],
  33562. 207: [function(e, t, i) {
  33563. "use strict";
  33564. i.decode = i.parse = e("./decode"),
  33565. i.encode = i.stringify = e("./encode")
  33566. }
  33567. , {
  33568. "./decode": 205,
  33569. "./encode": 206
  33570. }],
  33571. 208: [function(e, t, i) {
  33572. "use strict";
  33573. function n() {
  33574. this.protocol = null,
  33575. this.slashes = null,
  33576. this.auth = null,
  33577. this.host = null,
  33578. this.port = null,
  33579. this.hostname = null,
  33580. this.hash = null,
  33581. this.search = null,
  33582. this.query = null,
  33583. this.pathname = null,
  33584. this.path = null,
  33585. this.href = null
  33586. }
  33587. function r(e, t, i) {
  33588. if (e && c.isObject(e) && e instanceof n)
  33589. return e;
  33590. var r = new n;
  33591. return r.parse(e, t, i),
  33592. r
  33593. }
  33594. function o(e) {
  33595. return c.isString(e) && (e = r(e)),
  33596. e instanceof n ? e.format() : n.prototype.format.call(e)
  33597. }
  33598. function a(e, t) {
  33599. return r(e, !1, !0).resolve(t)
  33600. }
  33601. function s(e, t) {
  33602. return e ? r(e, !1, !0).resolveObject(t) : t
  33603. }
  33604. var l = e("punycode")
  33605. , c = e("./util");
  33606. i.parse = r,
  33607. i.resolve = a,
  33608. i.resolveObject = s,
  33609. i.format = o,
  33610. i.Url = n;
  33611. var h = /^([a-z0-9.+-]+:)/i
  33612. , u = /:[0-9]*$/
  33613. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33614. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33615. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33616. , g = ["'"].concat(f)
  33617. , m = ["%", "/", "?", ";", "#"].concat(g)
  33618. , v = ["/", "?", "#"]
  33619. , A = 255
  33620. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33621. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33622. , I = {
  33623. javascript: !0,
  33624. "javascript:": !0
  33625. }
  33626. , E = {
  33627. javascript: !0,
  33628. "javascript:": !0
  33629. }
  33630. , b = {
  33631. http: !0,
  33632. https: !0,
  33633. ftp: !0,
  33634. gopher: !0,
  33635. file: !0,
  33636. "http:": !0,
  33637. "https:": !0,
  33638. "ftp:": !0,
  33639. "gopher:": !0,
  33640. "file:": !0
  33641. }
  33642. , w = e("querystring");
  33643. n.prototype.parse = function(e, t, i) {
  33644. if (!c.isString(e))
  33645. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33646. var n = e.indexOf("?")
  33647. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33648. , o = e.split(r)
  33649. , a = /\\/g;
  33650. o[0] = o[0].replace(a, "/"),
  33651. e = o.join(r);
  33652. var s = e;
  33653. if (s = s.trim(),
  33654. !i && 1 === e.split("#").length) {
  33655. var u = d.exec(s);
  33656. if (u)
  33657. return this.path = s,
  33658. this.href = s,
  33659. this.pathname = u[1],
  33660. u[2] ? (this.search = u[2],
  33661. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33662. this.query = {}),
  33663. this
  33664. }
  33665. var p = h.exec(s);
  33666. if (p) {
  33667. p = p[0];
  33668. var f = p.toLowerCase();
  33669. this.protocol = f,
  33670. s = s.substr(p.length)
  33671. }
  33672. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33673. var _ = "//" === s.substr(0, 2);
  33674. !_ || p && E[p] || (s = s.substr(2),
  33675. this.slashes = !0)
  33676. }
  33677. if (!E[p] && (_ || p && !b[p])) {
  33678. for (var T = -1, x = 0; x < v.length; x++) {
  33679. var S = s.indexOf(v[x]);
  33680. S !== -1 && (T === -1 || S < T) && (T = S)
  33681. }
  33682. var M, R;
  33683. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33684. R !== -1 && (M = s.slice(0, R),
  33685. s = s.slice(R + 1),
  33686. this.auth = decodeURIComponent(M)),
  33687. T = -1;
  33688. for (var x = 0; x < m.length; x++) {
  33689. var S = s.indexOf(m[x]);
  33690. S !== -1 && (T === -1 || S < T) && (T = S)
  33691. }
  33692. T === -1 && (T = s.length),
  33693. this.host = s.slice(0, T),
  33694. s = s.slice(T),
  33695. this.parseHost(),
  33696. this.hostname = this.hostname || "";
  33697. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33698. if (!P)
  33699. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33700. var D = O[x];
  33701. if (D && !D.match(y)) {
  33702. for (var N = "", B = 0, F = D.length; B < F; B++)
  33703. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33704. if (!N.match(y)) {
  33705. var V = O.slice(0, x)
  33706. , U = O.slice(x + 1)
  33707. , k = D.match(C);
  33708. k && (V.push(k[1]),
  33709. U.unshift(k[2])),
  33710. U.length && (s = "/" + U.join(".") + s),
  33711. this.hostname = V.join(".");
  33712. break
  33713. }
  33714. }
  33715. }
  33716. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33717. P || (this.hostname = l.toASCII(this.hostname));
  33718. var H = this.port ? ":" + this.port : ""
  33719. , G = this.hostname || "";
  33720. this.host = G + H,
  33721. this.href += this.host,
  33722. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33723. "/" !== s[0] && (s = "/" + s))
  33724. }
  33725. if (!I[f])
  33726. for (var x = 0, L = g.length; x < L; x++) {
  33727. var z = g[x];
  33728. if (s.indexOf(z) !== -1) {
  33729. var W = encodeURIComponent(z);
  33730. W === z && (W = escape(z)),
  33731. s = s.split(z).join(W)
  33732. }
  33733. }
  33734. var j = s.indexOf("#");
  33735. j !== -1 && (this.hash = s.substr(j),
  33736. s = s.slice(0, j));
  33737. var Y = s.indexOf("?");
  33738. if (Y !== -1 ? (this.search = s.substr(Y),
  33739. this.query = s.substr(Y + 1),
  33740. t && (this.query = w.parse(this.query)),
  33741. s = s.slice(0, Y)) : t && (this.search = "",
  33742. this.query = {}),
  33743. s && (this.pathname = s),
  33744. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33745. this.pathname || this.search) {
  33746. var H = this.pathname || ""
  33747. , X = this.search || "";
  33748. this.path = H + X
  33749. }
  33750. return this.href = this.format(),
  33751. this
  33752. }
  33753. ,
  33754. n.prototype.format = function() {
  33755. var e = this.auth || "";
  33756. e && (e = encodeURIComponent(e),
  33757. e = e.replace(/%3A/i, ":"),
  33758. e += "@");
  33759. var t = this.protocol || ""
  33760. , i = this.pathname || ""
  33761. , n = this.hash || ""
  33762. , r = !1
  33763. , o = "";
  33764. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33765. this.port && (r += ":" + this.port)),
  33766. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33767. var a = this.search || o && "?" + o || "";
  33768. return t && ":" !== t.substr(-1) && (t += ":"),
  33769. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33770. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33771. n && "#" !== n.charAt(0) && (n = "#" + n),
  33772. a && "?" !== a.charAt(0) && (a = "?" + a),
  33773. i = i.replace(/[?#]/g, function(e) {
  33774. return encodeURIComponent(e)
  33775. }),
  33776. a = a.replace("#", "%23"),
  33777. t + r + i + a + n
  33778. }
  33779. ,
  33780. n.prototype.resolve = function(e) {
  33781. return this.resolveObject(r(e, !1, !0)).format()
  33782. }
  33783. ,
  33784. n.prototype.resolveObject = function(e) {
  33785. if (c.isString(e)) {
  33786. var t = new n;
  33787. t.parse(e, !1, !0),
  33788. e = t
  33789. }
  33790. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33791. var a = r[o];
  33792. i[a] = this[a]
  33793. }
  33794. if (i.hash = e.hash,
  33795. "" === e.href)
  33796. return i.href = i.format(),
  33797. i;
  33798. if (e.slashes && !e.protocol) {
  33799. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33800. var h = s[l];
  33801. "protocol" !== h && (i[h] = e[h])
  33802. }
  33803. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33804. i.href = i.format(),
  33805. i
  33806. }
  33807. if (e.protocol && e.protocol !== i.protocol) {
  33808. if (!b[e.protocol]) {
  33809. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33810. var p = u[d];
  33811. i[p] = e[p]
  33812. }
  33813. return i.href = i.format(),
  33814. i
  33815. }
  33816. if (i.protocol = e.protocol,
  33817. e.host || E[e.protocol])
  33818. i.pathname = e.pathname;
  33819. else {
  33820. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33821. ;
  33822. e.host || (e.host = ""),
  33823. e.hostname || (e.hostname = ""),
  33824. "" !== f[0] && f.unshift(""),
  33825. f.length < 2 && f.unshift(""),
  33826. i.pathname = f.join("/")
  33827. }
  33828. if (i.search = e.search,
  33829. i.query = e.query,
  33830. i.host = e.host || "",
  33831. i.auth = e.auth,
  33832. i.hostname = e.hostname || e.host,
  33833. i.port = e.port,
  33834. i.pathname || i.search) {
  33835. var g = i.pathname || ""
  33836. , m = i.search || "";
  33837. i.path = g + m
  33838. }
  33839. return i.slashes = i.slashes || e.slashes,
  33840. i.href = i.format(),
  33841. i
  33842. }
  33843. var v = i.pathname && "/" === i.pathname.charAt(0)
  33844. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33845. , y = A || v || i.host && e.pathname
  33846. , C = y
  33847. , I = i.pathname && i.pathname.split("/") || []
  33848. , f = e.pathname && e.pathname.split("/") || []
  33849. , w = i.protocol && !b[i.protocol];
  33850. if (w && (i.hostname = "",
  33851. i.port = null,
  33852. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33853. i.host = "",
  33854. e.protocol && (e.hostname = null,
  33855. e.port = null,
  33856. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33857. e.host = null),
  33858. y = y && ("" === f[0] || "" === I[0])),
  33859. A)
  33860. i.host = e.host || "" === e.host ? e.host : i.host,
  33861. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33862. i.search = e.search,
  33863. i.query = e.query,
  33864. I = f;
  33865. else if (f.length)
  33866. I || (I = []),
  33867. I.pop(),
  33868. I = I.concat(f),
  33869. i.search = e.search,
  33870. i.query = e.query;
  33871. else if (!c.isNullOrUndefined(e.search)) {
  33872. if (w) {
  33873. i.hostname = i.host = I.shift();
  33874. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33875. _ && (i.auth = _.shift(),
  33876. i.host = i.hostname = _.shift())
  33877. }
  33878. return i.search = e.search,
  33879. i.query = e.query,
  33880. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33881. i.href = i.format(),
  33882. i
  33883. }
  33884. if (!I.length)
  33885. return i.pathname = null,
  33886. i.search ? i.path = "/" + i.search : i.path = null,
  33887. i.href = i.format(),
  33888. i;
  33889. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  33890. T = I[M],
  33891. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33892. S++) : S && (I.splice(M, 1),
  33893. S--);
  33894. if (!y && !C)
  33895. for (; S--; S)
  33896. I.unshift("..");
  33897. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33898. x && "/" !== I.join("/").substr(-1) && I.push("");
  33899. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33900. if (w) {
  33901. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33902. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33903. _ && (i.auth = _.shift(),
  33904. i.host = i.hostname = _.shift())
  33905. }
  33906. return y = y || i.host && I.length,
  33907. y && !R && I.unshift(""),
  33908. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33909. i.path = null),
  33910. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33911. i.auth = e.auth || i.auth,
  33912. i.slashes = i.slashes || e.slashes,
  33913. i.href = i.format(),
  33914. i
  33915. }
  33916. ,
  33917. n.prototype.parseHost = function() {
  33918. var e = this.host
  33919. , t = u.exec(e);
  33920. t && (t = t[0],
  33921. ":" !== t && (this.port = t.substr(1)),
  33922. e = e.substr(0, e.length - t.length)),
  33923. e && (this.hostname = e)
  33924. }
  33925. }
  33926. , {
  33927. "./util": 209,
  33928. punycode: 204,
  33929. querystring: 207
  33930. }],
  33931. 209: [function(e, t, i) {
  33932. "use strict";
  33933. t.exports = {
  33934. isString: function(e) {
  33935. return "string" == typeof e
  33936. },
  33937. isObject: function(e) {
  33938. return "object" == typeof e && null !== e
  33939. },
  33940. isNull: function(e) {
  33941. return null === e
  33942. },
  33943. isNullOrUndefined: function(e) {
  33944. return null == e
  33945. }
  33946. }
  33947. }
  33948. , {}],
  33949. 210: [function(e, t, i) {
  33950. "use strict";
  33951. function n(e) {
  33952. return l + e
  33953. }
  33954. function r(e) {
  33955. return e.substring(l.length)
  33956. }
  33957. function o(e, t) {
  33958. for (var i in t)
  33959. Object.defineProperty(e, i, {
  33960. value: t[i],
  33961. configurable: !0,
  33962. writable: !0
  33963. })
  33964. }
  33965. function a(e) {
  33966. if ("string" != typeof e)
  33967. throw new TypeError("key must be a string.")
  33968. }
  33969. var s = Object.prototype.hasOwnProperty
  33970. , l = "~";
  33971. t.exports = function(e) {
  33972. var t = Object.create(null)
  33973. , i = 0
  33974. , l = {};
  33975. return o(l, {
  33976. get: function(e, i) {
  33977. a(e);
  33978. var r = n(e);
  33979. return r in t ? t[r] : i
  33980. },
  33981. set: function(e, r) {
  33982. a(e);
  33983. var o = n(e);
  33984. return o in t || ++i,
  33985. t[o] = r
  33986. },
  33987. has: function(e) {
  33988. return a(e),
  33989. n(e)in t
  33990. },
  33991. delete: function(e) {
  33992. a(e);
  33993. var r = n(e);
  33994. return r in t && (--i,
  33995. delete t[r],
  33996. !0)
  33997. },
  33998. clear: function() {
  33999. t = Object.create(null),
  34000. i = 0
  34001. },
  34002. forEach: function(e, i) {
  34003. if ("function" != typeof e)
  34004. throw new TypeError("`callback` must be a function");
  34005. for (var n in t)
  34006. if (s.call(t, n)) {
  34007. var o = r(n)
  34008. , a = t[n];
  34009. e.call(i, a, o, l)
  34010. }
  34011. }
  34012. }),
  34013. Object.defineProperty(l, "size", {
  34014. get: function() {
  34015. return i
  34016. },
  34017. configurable: !0
  34018. }),
  34019. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34020. l.set(t, e[t])
  34021. }),
  34022. l
  34023. }
  34024. }
  34025. , {}],
  34026. 211: [function(e, t, i) {
  34027. t.exports = e("./lib/heap")
  34028. }
  34029. , {
  34030. "./lib/heap": 212
  34031. }],
  34032. 212: [function(e, t, i) {
  34033. (function() {
  34034. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34035. r = Math.floor,
  34036. u = Math.min,
  34037. n = function(e, t) {
  34038. return e < t ? -1 : e > t ? 1 : 0
  34039. }
  34040. ,
  34041. h = function(e, t, i, o, a) {
  34042. var s;
  34043. if (null == i && (i = 0),
  34044. null == a && (a = n),
  34045. i < 0)
  34046. throw new Error("lo must be non-negative");
  34047. for (null == o && (o = e.length); i < o; )
  34048. s = r((i + o) / 2),
  34049. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34050. return [].splice.apply(e, [i, i - i].concat(t)),
  34051. t
  34052. }
  34053. ,
  34054. s = function(e, t, i) {
  34055. return null == i && (i = n),
  34056. e.push(t),
  34057. g(e, 0, e.length - 1, i)
  34058. }
  34059. ,
  34060. a = function(e, t) {
  34061. var i, r;
  34062. return null == t && (t = n),
  34063. i = e.pop(),
  34064. e.length ? (r = e[0],
  34065. e[0] = i,
  34066. m(e, 0, t)) : r = i,
  34067. r
  34068. }
  34069. ,
  34070. c = function(e, t, i) {
  34071. var r;
  34072. return null == i && (i = n),
  34073. r = e[0],
  34074. e[0] = t,
  34075. m(e, 0, i),
  34076. r
  34077. }
  34078. ,
  34079. l = function(e, t, i) {
  34080. var r;
  34081. return null == i && (i = n),
  34082. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34083. t = r[0],
  34084. e[0] = r[1],
  34085. m(e, 0, i)),
  34086. t
  34087. }
  34088. ,
  34089. o = function(e, t) {
  34090. var i, o, a, s, l, c;
  34091. for (null == t && (t = n),
  34092. s = function() {
  34093. c = [];
  34094. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34095. c.push(t);
  34096. return c
  34097. }
  34098. .apply(this).reverse(),
  34099. l = [],
  34100. o = 0,
  34101. a = s.length; o < a; o++)
  34102. i = s[o],
  34103. l.push(m(e, i, t));
  34104. return l
  34105. }
  34106. ,
  34107. f = function(e, t, i) {
  34108. var r;
  34109. if (null == i && (i = n),
  34110. r = e.indexOf(t),
  34111. r !== -1)
  34112. return g(e, 0, r, i),
  34113. m(e, r, i)
  34114. }
  34115. ,
  34116. d = function(e, t, i) {
  34117. var r, a, s, c, h;
  34118. if (null == i && (i = n),
  34119. a = e.slice(0, t),
  34120. !a.length)
  34121. return a;
  34122. for (o(a, i),
  34123. h = e.slice(t),
  34124. s = 0,
  34125. c = h.length; s < c; s++)
  34126. r = h[s],
  34127. l(a, r, i);
  34128. return a.sort(i).reverse()
  34129. }
  34130. ,
  34131. p = function(e, t, i) {
  34132. var r, s, l, c, d, p, f, g, m, v;
  34133. if (null == i && (i = n),
  34134. 10 * t <= e.length) {
  34135. if (c = e.slice(0, t).sort(i),
  34136. !c.length)
  34137. return c;
  34138. for (l = c[c.length - 1],
  34139. g = e.slice(t),
  34140. d = 0,
  34141. f = g.length; d < f; d++)
  34142. r = g[d],
  34143. i(r, l) < 0 && (h(c, r, 0, null, i),
  34144. c.pop(),
  34145. l = c[c.length - 1]);
  34146. return c
  34147. }
  34148. for (o(e, i),
  34149. v = [],
  34150. s = p = 0,
  34151. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34152. v.push(a(e, i));
  34153. return v
  34154. }
  34155. ,
  34156. g = function(e, t, i, r) {
  34157. var o, a, s;
  34158. for (null == r && (r = n),
  34159. o = e[i]; i > t && (s = i - 1 >> 1,
  34160. a = e[s],
  34161. r(o, a) < 0); )
  34162. e[i] = a,
  34163. i = s;
  34164. return e[i] = o
  34165. }
  34166. ,
  34167. m = function(e, t, i) {
  34168. var r, o, a, s, l;
  34169. for (null == i && (i = n),
  34170. o = e.length,
  34171. l = t,
  34172. a = e[t],
  34173. r = 2 * t + 1; r < o; )
  34174. s = r + 1,
  34175. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34176. e[t] = e[r],
  34177. t = r,
  34178. r = 2 * t + 1;
  34179. return e[t] = a,
  34180. g(e, l, t, i)
  34181. }
  34182. ,
  34183. e = function() {
  34184. function e(e) {
  34185. this.cmp = null != e ? e : n,
  34186. this.nodes = []
  34187. }
  34188. return e.push = s,
  34189. e.pop = a,
  34190. e.replace = c,
  34191. e.pushpop = l,
  34192. e.heapify = o,
  34193. e.updateItem = f,
  34194. e.nlargest = d,
  34195. e.nsmallest = p,
  34196. e.prototype.push = function(e) {
  34197. return s(this.nodes, e, this.cmp)
  34198. }
  34199. ,
  34200. e.prototype.pop = function() {
  34201. return a(this.nodes, this.cmp)
  34202. }
  34203. ,
  34204. e.prototype.peek = function() {
  34205. return this.nodes[0]
  34206. }
  34207. ,
  34208. e.prototype.contains = function(e) {
  34209. return this.nodes.indexOf(e) !== -1
  34210. }
  34211. ,
  34212. e.prototype.replace = function(e) {
  34213. return c(this.nodes, e, this.cmp)
  34214. }
  34215. ,
  34216. e.prototype.pushpop = function(e) {
  34217. return l(this.nodes, e, this.cmp)
  34218. }
  34219. ,
  34220. e.prototype.heapify = function() {
  34221. return o(this.nodes, this.cmp)
  34222. }
  34223. ,
  34224. e.prototype.updateItem = function(e) {
  34225. return f(this.nodes, e, this.cmp)
  34226. }
  34227. ,
  34228. e.prototype.clear = function() {
  34229. return this.nodes = []
  34230. }
  34231. ,
  34232. e.prototype.empty = function() {
  34233. return 0 === this.nodes.length
  34234. }
  34235. ,
  34236. e.prototype.size = function() {
  34237. return this.nodes.length
  34238. }
  34239. ,
  34240. e.prototype.clone = function() {
  34241. var t;
  34242. return t = new e,
  34243. t.nodes = this.nodes.slice(0),
  34244. t
  34245. }
  34246. ,
  34247. e.prototype.toArray = function() {
  34248. return this.nodes.slice(0)
  34249. }
  34250. ,
  34251. e.prototype.insert = e.prototype.push,
  34252. e.prototype.top = e.prototype.peek,
  34253. e.prototype.front = e.prototype.peek,
  34254. e.prototype.has = e.prototype.contains,
  34255. e.prototype.copy = e.prototype.clone,
  34256. e
  34257. }(),
  34258. function(e, n) {
  34259. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34260. }(this, function() {
  34261. return e
  34262. })
  34263. }
  34264. ).call(this)
  34265. }
  34266. , {}],
  34267. 213: [function(e, t, i) {
  34268. !function(e) {
  34269. function i() {}
  34270. function n(e, t) {
  34271. return function() {
  34272. e.apply(t, arguments)
  34273. }
  34274. }
  34275. function r(e) {
  34276. if ("object" != typeof this)
  34277. throw new TypeError("Promises must be constructed via new");
  34278. if ("function" != typeof e)
  34279. throw new TypeError("not a function");
  34280. this._state = 0,
  34281. this._handled = !1,
  34282. this._value = void 0,
  34283. this._deferreds = [],
  34284. h(e, this)
  34285. }
  34286. function o(e, t) {
  34287. for (; 3 === e._state; )
  34288. e = e._value;
  34289. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34290. void r._immediateFn(function() {
  34291. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34292. if (null === i)
  34293. return void (1 === e._state ? a : s)(t.promise, e._value);
  34294. var n;
  34295. try {
  34296. n = i(e._value)
  34297. } catch (e) {
  34298. return void s(t.promise, e)
  34299. }
  34300. a(t.promise, n)
  34301. }))
  34302. }
  34303. function a(e, t) {
  34304. try {
  34305. if (t === e)
  34306. throw new TypeError("A promise cannot be resolved with itself.");
  34307. if (t && ("object" == typeof t || "function" == typeof t)) {
  34308. var i = t.then;
  34309. if (t instanceof r)
  34310. return e._state = 3,
  34311. e._value = t,
  34312. void l(e);
  34313. if ("function" == typeof i)
  34314. return void h(n(i, t), e)
  34315. }
  34316. e._state = 1,
  34317. e._value = t,
  34318. l(e)
  34319. } catch (t) {
  34320. s(e, t)
  34321. }
  34322. }
  34323. function s(e, t) {
  34324. e._state = 2,
  34325. e._value = t,
  34326. l(e)
  34327. }
  34328. function l(e) {
  34329. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34330. e._handled || r._unhandledRejectionFn(e._value)
  34331. });
  34332. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34333. o(e, e._deferreds[t]);
  34334. e._deferreds = null
  34335. }
  34336. function c(e, t, i) {
  34337. this.onFulfilled = "function" == typeof e ? e : null,
  34338. this.onRejected = "function" == typeof t ? t : null,
  34339. this.promise = i
  34340. }
  34341. function h(e, t) {
  34342. var i = !1;
  34343. try {
  34344. e(function(e) {
  34345. i || (i = !0,
  34346. a(t, e))
  34347. }, function(e) {
  34348. i || (i = !0,
  34349. s(t, e))
  34350. })
  34351. } catch (e) {
  34352. if (i)
  34353. return;
  34354. i = !0,
  34355. s(t, e)
  34356. }
  34357. }
  34358. var u = setTimeout;
  34359. r.prototype.catch = function(e) {
  34360. return this.then(null, e)
  34361. }
  34362. ,
  34363. r.prototype.then = function(e, t) {
  34364. var n = new this.constructor(i);
  34365. return o(this, new c(e,t,n)),
  34366. n
  34367. }
  34368. ,
  34369. r.all = function(e) {
  34370. var t = Array.prototype.slice.call(e);
  34371. return new r(function(e, i) {
  34372. function n(o, a) {
  34373. try {
  34374. if (a && ("object" == typeof a || "function" == typeof a)) {
  34375. var s = a.then;
  34376. if ("function" == typeof s)
  34377. return void s.call(a, function(e) {
  34378. n(o, e)
  34379. }, i)
  34380. }
  34381. t[o] = a,
  34382. 0 === --r && e(t)
  34383. } catch (e) {
  34384. i(e)
  34385. }
  34386. }
  34387. if (0 === t.length)
  34388. return e([]);
  34389. for (var r = t.length, o = 0; o < t.length; o++)
  34390. n(o, t[o])
  34391. }
  34392. )
  34393. }
  34394. ,
  34395. r.resolve = function(e) {
  34396. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34397. t(e)
  34398. }
  34399. )
  34400. }
  34401. ,
  34402. r.reject = function(e) {
  34403. return new r(function(t, i) {
  34404. i(e)
  34405. }
  34406. )
  34407. }
  34408. ,
  34409. r.race = function(e) {
  34410. return new r(function(t, i) {
  34411. for (var n = 0, r = e.length; n < r; n++)
  34412. e[n].then(t, i)
  34413. }
  34414. )
  34415. }
  34416. ,
  34417. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34418. setImmediate(e)
  34419. }
  34420. || function(e) {
  34421. u(e, 0)
  34422. }
  34423. ,
  34424. r._unhandledRejectionFn = function(e) {
  34425. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34426. }
  34427. ,
  34428. r._setImmediateFn = function(e) {
  34429. r._immediateFn = e
  34430. }
  34431. ,
  34432. r._setUnhandledRejectionFn = function(e) {
  34433. r._unhandledRejectionFn = e
  34434. }
  34435. ,
  34436. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34437. }(this)
  34438. }
  34439. , {}],
  34440. 214: [function(e, t, i) {
  34441. (function(i) {
  34442. !function(i, n) {
  34443. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  34444. }(this, function(t, n) {
  34445. "use strict";
  34446. var r = {};
  34447. return r.ByteBuffer = t,
  34448. r.Long = t.Long || null,
  34449. r.VERSION = "5.0.1",
  34450. r.WIRE_TYPES = {},
  34451. r.WIRE_TYPES.VARINT = 0,
  34452. r.WIRE_TYPES.BITS64 = 1,
  34453. r.WIRE_TYPES.LDELIM = 2,
  34454. r.WIRE_TYPES.STARTGROUP = 3,
  34455. r.WIRE_TYPES.ENDGROUP = 4,
  34456. r.WIRE_TYPES.BITS32 = 5,
  34457. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34458. r.TYPES = {
  34459. int32: {
  34460. name: "int32",
  34461. wireType: r.WIRE_TYPES.VARINT,
  34462. defaultValue: 0
  34463. },
  34464. uint32: {
  34465. name: "uint32",
  34466. wireType: r.WIRE_TYPES.VARINT,
  34467. defaultValue: 0
  34468. },
  34469. sint32: {
  34470. name: "sint32",
  34471. wireType: r.WIRE_TYPES.VARINT,
  34472. defaultValue: 0
  34473. },
  34474. int64: {
  34475. name: "int64",
  34476. wireType: r.WIRE_TYPES.VARINT,
  34477. defaultValue: r.Long ? r.Long.ZERO : void 0
  34478. },
  34479. uint64: {
  34480. name: "uint64",
  34481. wireType: r.WIRE_TYPES.VARINT,
  34482. defaultValue: r.Long ? r.Long.UZERO : void 0
  34483. },
  34484. sint64: {
  34485. name: "sint64",
  34486. wireType: r.WIRE_TYPES.VARINT,
  34487. defaultValue: r.Long ? r.Long.ZERO : void 0
  34488. },
  34489. bool: {
  34490. name: "bool",
  34491. wireType: r.WIRE_TYPES.VARINT,
  34492. defaultValue: !1
  34493. },
  34494. double: {
  34495. name: "double",
  34496. wireType: r.WIRE_TYPES.BITS64,
  34497. defaultValue: 0
  34498. },
  34499. string: {
  34500. name: "string",
  34501. wireType: r.WIRE_TYPES.LDELIM,
  34502. defaultValue: ""
  34503. },
  34504. bytes: {
  34505. name: "bytes",
  34506. wireType: r.WIRE_TYPES.LDELIM,
  34507. defaultValue: null
  34508. },
  34509. fixed32: {
  34510. name: "fixed32",
  34511. wireType: r.WIRE_TYPES.BITS32,
  34512. defaultValue: 0
  34513. },
  34514. sfixed32: {
  34515. name: "sfixed32",
  34516. wireType: r.WIRE_TYPES.BITS32,
  34517. defaultValue: 0
  34518. },
  34519. fixed64: {
  34520. name: "fixed64",
  34521. wireType: r.WIRE_TYPES.BITS64,
  34522. defaultValue: r.Long ? r.Long.UZERO : void 0
  34523. },
  34524. sfixed64: {
  34525. name: "sfixed64",
  34526. wireType: r.WIRE_TYPES.BITS64,
  34527. defaultValue: r.Long ? r.Long.ZERO : void 0
  34528. },
  34529. float: {
  34530. name: "float",
  34531. wireType: r.WIRE_TYPES.BITS32,
  34532. defaultValue: 0
  34533. },
  34534. enum: {
  34535. name: "enum",
  34536. wireType: r.WIRE_TYPES.VARINT,
  34537. defaultValue: 0
  34538. },
  34539. message: {
  34540. name: "message",
  34541. wireType: r.WIRE_TYPES.LDELIM,
  34542. defaultValue: null
  34543. },
  34544. group: {
  34545. name: "group",
  34546. wireType: r.WIRE_TYPES.STARTGROUP,
  34547. defaultValue: null
  34548. }
  34549. },
  34550. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  34551. r.ID_MIN = 1,
  34552. r.ID_MAX = 536870911,
  34553. r.convertFieldsToCamelCase = !1,
  34554. r.populateAccessors = !0,
  34555. r.populateDefaults = !0,
  34556. r.Util = function() {
  34557. var t = {};
  34558. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34559. t.XHR = function() {
  34560. for (var e = [function() {
  34561. return new XMLHttpRequest
  34562. }
  34563. , function() {
  34564. return new ActiveXObject("Msxml2.XMLHTTP")
  34565. }
  34566. , function() {
  34567. return new ActiveXObject("Msxml3.XMLHTTP")
  34568. }
  34569. , function() {
  34570. return new ActiveXObject("Microsoft.XMLHTTP")
  34571. }
  34572. ], t = null, i = 0; i < e.length; i++) {
  34573. try {
  34574. t = e[i]()
  34575. } catch (e) {
  34576. continue
  34577. }
  34578. break
  34579. }
  34580. if (!t)
  34581. throw Error("XMLHttpRequest is not supported");
  34582. return t
  34583. }
  34584. ,
  34585. t.fetch = function(i, n) {
  34586. if (n && "function" != typeof n && (n = null),
  34587. t.IS_NODE) {
  34588. var r = e("fs");
  34589. if (n)
  34590. r.readFile(i, function(e, t) {
  34591. n(e ? null : "" + t)
  34592. });
  34593. else
  34594. try {
  34595. return r.readFileSync(i)
  34596. } catch (e) {
  34597. return null
  34598. }
  34599. } else {
  34600. var o = t.XHR();
  34601. if (o.open("GET", i, !!n),
  34602. o.setRequestHeader("Accept", "text/plain"),
  34603. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34604. !n)
  34605. return o.send(null),
  34606. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34607. if (o.onreadystatechange = function() {
  34608. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34609. }
  34610. ,
  34611. 4 == o.readyState)
  34612. return;
  34613. o.send(null)
  34614. }
  34615. }
  34616. ,
  34617. t.toCamelCase = function(e) {
  34618. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34619. return t.toUpperCase()
  34620. })
  34621. }
  34622. ,
  34623. t
  34624. }(),
  34625. r.Lang = {
  34626. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34627. RULE: /^(?:required|optional|repeated|map)$/,
  34628. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34629. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34630. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34631. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34632. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34633. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34634. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34635. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34636. NUMBER_OCT: /^0[0-7]+$/,
  34637. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34638. BOOL: /^(?:true|false)$/i,
  34639. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34640. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34641. WHITESPACE: /\s/,
  34642. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34643. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34644. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34645. },
  34646. r.DotProto = function(e, t) {
  34647. function i(e, i) {
  34648. var n = -1
  34649. , r = 1;
  34650. if ("-" == e.charAt(0) && (r = -1,
  34651. e = e.substring(1)),
  34652. t.NUMBER_DEC.test(e))
  34653. n = parseInt(e);
  34654. else if (t.NUMBER_HEX.test(e))
  34655. n = parseInt(e.substring(2), 16);
  34656. else {
  34657. if (!t.NUMBER_OCT.test(e))
  34658. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34659. n = parseInt(e.substring(1), 8)
  34660. }
  34661. if (n = r * n | 0,
  34662. !i && n < 0)
  34663. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34664. return n
  34665. }
  34666. function n(e) {
  34667. var i = 1;
  34668. if ("-" == e.charAt(0) && (i = -1,
  34669. e = e.substring(1)),
  34670. t.NUMBER_DEC.test(e))
  34671. return i * parseInt(e, 10);
  34672. if (t.NUMBER_HEX.test(e))
  34673. return i * parseInt(e.substring(2), 16);
  34674. if (t.NUMBER_OCT.test(e))
  34675. return i * parseInt(e.substring(1), 8);
  34676. if ("inf" === e)
  34677. return i * (1 / 0);
  34678. if ("nan" === e)
  34679. return NaN;
  34680. if (t.NUMBER_FLT.test(e))
  34681. return i * parseFloat(e);
  34682. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34683. }
  34684. function r(e, t, i) {
  34685. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34686. e[t].push(i))
  34687. }
  34688. var o = {}
  34689. , a = function(e) {
  34690. this.source = e + "",
  34691. this.index = 0,
  34692. this.line = 1,
  34693. this.stack = [],
  34694. this._stringOpen = null
  34695. }
  34696. , s = a.prototype;
  34697. s._readString = function() {
  34698. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34699. e.lastIndex = this.index - 1;
  34700. var i = e.exec(this.source);
  34701. if (!i)
  34702. throw Error("unterminated string");
  34703. return this.index = e.lastIndex,
  34704. this.stack.push(this._stringOpen),
  34705. this._stringOpen = null,
  34706. i[1]
  34707. }
  34708. ,
  34709. s.next = function() {
  34710. if (this.stack.length > 0)
  34711. return this.stack.shift();
  34712. if (this.index >= this.source.length)
  34713. return null;
  34714. if (null !== this._stringOpen)
  34715. return this._readString();
  34716. var e, i, n;
  34717. do {
  34718. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34719. if ("\n" === n && ++this.line,
  34720. ++this.index === this.source.length)
  34721. return null;
  34722. if ("/" === this.source.charAt(this.index))
  34723. if (++this.index,
  34724. "/" === this.source.charAt(this.index)) {
  34725. for (; "\n" !== this.source.charAt(++this.index); )
  34726. if (this.index == this.source.length)
  34727. return null;
  34728. ++this.index,
  34729. ++this.line,
  34730. e = !0
  34731. } else {
  34732. if ("*" !== (n = this.source.charAt(this.index)))
  34733. return "/";
  34734. do {
  34735. if ("\n" === n && ++this.line,
  34736. ++this.index === this.source.length)
  34737. return null;
  34738. i = n,
  34739. n = this.source.charAt(this.index)
  34740. } while ("*" !== i || "/" !== n);++this.index,
  34741. e = !0
  34742. }
  34743. } while (e);if (this.index === this.source.length)
  34744. return null;
  34745. var r = this.index;
  34746. t.DELIM.lastIndex = 0;
  34747. var o = t.DELIM.test(this.source.charAt(r++));
  34748. if (!o)
  34749. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34750. ++r;
  34751. var a = this.source.substring(this.index, this.index = r);
  34752. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34753. a
  34754. }
  34755. ,
  34756. s.peek = function() {
  34757. if (0 === this.stack.length) {
  34758. var e = this.next();
  34759. if (null === e)
  34760. return null;
  34761. this.stack.push(e)
  34762. }
  34763. return this.stack[0]
  34764. }
  34765. ,
  34766. s.skip = function(e) {
  34767. var t = this.next();
  34768. if (t !== e)
  34769. throw Error("illegal '" + t + "', '" + e + "' expected")
  34770. }
  34771. ,
  34772. s.omit = function(e) {
  34773. return this.peek() === e && (this.next(),
  34774. !0)
  34775. }
  34776. ,
  34777. s.toString = function() {
  34778. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34779. }
  34780. ,
  34781. o.Tokenizer = a;
  34782. var l = function(e) {
  34783. this.tn = new a(e),
  34784. this.proto3 = !1
  34785. }
  34786. , c = l.prototype;
  34787. return c.parse = function() {
  34788. var e, i, n = {
  34789. name: "[ROOT]",
  34790. package: null,
  34791. messages: [],
  34792. enums: [],
  34793. imports: [],
  34794. options: {},
  34795. services: []
  34796. }, r = !0;
  34797. try {
  34798. for (; e = this.tn.next(); )
  34799. switch (e) {
  34800. case "package":
  34801. if (!r || null !== n.package)
  34802. throw Error("unexpected 'package'");
  34803. if (e = this.tn.next(),
  34804. !t.TYPEREF.test(e))
  34805. throw Error("illegal package name: " + e);
  34806. this.tn.skip(";"),
  34807. n.package = e;
  34808. break;
  34809. case "import":
  34810. if (!r)
  34811. throw Error("unexpected 'import'");
  34812. e = this.tn.peek(),
  34813. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34814. e = this._readString(),
  34815. this.tn.skip(";"),
  34816. i || n.imports.push(e);
  34817. break;
  34818. case "syntax":
  34819. if (!r)
  34820. throw Error("unexpected 'syntax'");
  34821. this.tn.skip("="),
  34822. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34823. this.tn.skip(";");
  34824. break;
  34825. case "message":
  34826. this._parseMessage(n, null),
  34827. r = !1;
  34828. break;
  34829. case "enum":
  34830. this._parseEnum(n),
  34831. r = !1;
  34832. break;
  34833. case "option":
  34834. this._parseOption(n);
  34835. break;
  34836. case "service":
  34837. this._parseService(n);
  34838. break;
  34839. case "extend":
  34840. this._parseExtend(n);
  34841. break;
  34842. default:
  34843. throw Error("unexpected '" + e + "'")
  34844. }
  34845. } catch (e) {
  34846. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34847. e
  34848. }
  34849. return delete n.name,
  34850. n
  34851. }
  34852. ,
  34853. l.parse = function(e) {
  34854. return new l(e).parse()
  34855. }
  34856. ,
  34857. c._readString = function() {
  34858. var e, t, i = "";
  34859. do {
  34860. if (t = this.tn.next(),
  34861. "'" !== t && '"' !== t)
  34862. throw Error("illegal string delimiter: " + t);
  34863. i += this.tn.next(),
  34864. this.tn.skip(t),
  34865. e = this.tn.peek()
  34866. } while ('"' === e || '"' === e);return i
  34867. }
  34868. ,
  34869. c._readValue = function(e) {
  34870. var i = this.tn.peek();
  34871. if ('"' === i || "'" === i)
  34872. return this._readString();
  34873. if (this.tn.next(),
  34874. t.NUMBER.test(i))
  34875. return n(i);
  34876. if (t.BOOL.test(i))
  34877. return "true" === i.toLowerCase();
  34878. if (e && t.TYPEREF.test(i))
  34879. return i;
  34880. throw Error("illegal value: " + i)
  34881. }
  34882. ,
  34883. c._parseOption = function(e, i) {
  34884. var n = this.tn.next()
  34885. , r = !1;
  34886. if ("(" === n && (r = !0,
  34887. n = this.tn.next()),
  34888. !t.TYPEREF.test(n))
  34889. throw Error("illegal option name: " + n);
  34890. var o = n;
  34891. r && (this.tn.skip(")"),
  34892. o = "(" + o + ")",
  34893. n = this.tn.peek(),
  34894. t.FQTYPEREF.test(n) && (o += n,
  34895. this.tn.next())),
  34896. this.tn.skip("="),
  34897. this._parseOptionValue(e, o),
  34898. i || this.tn.skip(";")
  34899. }
  34900. ,
  34901. c._parseOptionValue = function(e, i) {
  34902. var n = this.tn.peek();
  34903. if ("{" !== n)
  34904. r(e.options, i, this._readValue(!0));
  34905. else
  34906. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34907. if (!t.NAME.test(n))
  34908. throw Error("illegal option name: " + i + "." + n);
  34909. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34910. }
  34911. }
  34912. ,
  34913. c._parseService = function(e) {
  34914. var i = this.tn.next();
  34915. if (!t.NAME.test(i))
  34916. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34917. var n = i
  34918. , r = {
  34919. name: n,
  34920. rpc: {},
  34921. options: {}
  34922. };
  34923. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34924. if ("option" === i)
  34925. this._parseOption(r);
  34926. else {
  34927. if ("rpc" !== i)
  34928. throw Error("illegal service token: " + i);
  34929. this._parseServiceRPC(r)
  34930. }
  34931. this.tn.omit(";"),
  34932. e.services.push(r)
  34933. }
  34934. ,
  34935. c._parseServiceRPC = function(e) {
  34936. var i = "rpc"
  34937. , n = this.tn.next();
  34938. if (!t.NAME.test(n))
  34939. throw Error("illegal rpc service method name: " + n);
  34940. var r = n
  34941. , o = {
  34942. request: null,
  34943. response: null,
  34944. request_stream: !1,
  34945. response_stream: !1,
  34946. options: {}
  34947. };
  34948. if (this.tn.skip("("),
  34949. n = this.tn.next(),
  34950. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34951. n = this.tn.next()),
  34952. !t.TYPEREF.test(n))
  34953. throw Error("illegal rpc service request type: " + n);
  34954. if (o.request = n,
  34955. this.tn.skip(")"),
  34956. n = this.tn.next(),
  34957. "returns" !== n.toLowerCase())
  34958. throw Error("illegal rpc service request type delimiter: " + n);
  34959. if (this.tn.skip("("),
  34960. n = this.tn.next(),
  34961. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34962. n = this.tn.next()),
  34963. o.response = n,
  34964. this.tn.skip(")"),
  34965. n = this.tn.peek(),
  34966. "{" === n) {
  34967. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34968. if ("option" !== n)
  34969. throw Error("illegal rpc service token: " + n);
  34970. this._parseOption(o)
  34971. }
  34972. this.tn.omit(";")
  34973. } else
  34974. this.tn.skip(";");
  34975. "undefined" == typeof e[i] && (e[i] = {}),
  34976. e[i][r] = o
  34977. }
  34978. ,
  34979. c._parseMessage = function(e, n) {
  34980. var r = !!n
  34981. , o = this.tn.next()
  34982. , a = {
  34983. name: "",
  34984. fields: [],
  34985. enums: [],
  34986. messages: [],
  34987. options: {},
  34988. services: [],
  34989. oneofs: {}
  34990. };
  34991. if (!t.NAME.test(o))
  34992. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34993. for (a.name = o,
  34994. r && (this.tn.skip("="),
  34995. n.id = i(this.tn.next()),
  34996. a.isGroup = !0),
  34997. o = this.tn.peek(),
  34998. "[" === o && n && this._parseFieldOptions(n),
  34999. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35000. if (t.RULE.test(o))
  35001. this._parseMessageField(a, o);
  35002. else if ("oneof" === o)
  35003. this._parseMessageOneOf(a);
  35004. else if ("enum" === o)
  35005. this._parseEnum(a);
  35006. else if ("message" === o)
  35007. this._parseMessage(a);
  35008. else if ("option" === o)
  35009. this._parseOption(a);
  35010. else if ("service" === o)
  35011. this._parseService(a);
  35012. else if ("extensions" === o)
  35013. a.extensions = this._parseExtensionRanges();
  35014. else if ("reserved" === o)
  35015. this._parseIgnored();
  35016. else if ("extend" === o)
  35017. this._parseExtend(a);
  35018. else {
  35019. if (!t.TYPEREF.test(o))
  35020. throw Error("illegal message token: " + o);
  35021. if (!this.proto3)
  35022. throw Error("illegal field rule: " + o);
  35023. this._parseMessageField(a, "optional", o)
  35024. }
  35025. return this.tn.omit(";"),
  35026. e.messages.push(a),
  35027. a
  35028. }
  35029. ,
  35030. c._parseIgnored = function() {
  35031. for (; ";" !== this.tn.peek(); )
  35032. this.tn.next();
  35033. this.tn.skip(";")
  35034. }
  35035. ,
  35036. c._parseMessageField = function(e, n, r) {
  35037. if (!t.RULE.test(n))
  35038. throw Error("illegal message field rule: " + n);
  35039. var o, a = {
  35040. rule: n,
  35041. type: "",
  35042. name: "",
  35043. options: {},
  35044. id: 0
  35045. };
  35046. if ("map" === n) {
  35047. if (r)
  35048. throw Error("illegal type: " + r);
  35049. if (this.tn.skip("<"),
  35050. o = this.tn.next(),
  35051. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35052. throw Error("illegal message field type: " + o);
  35053. if (a.keytype = o,
  35054. this.tn.skip(","),
  35055. o = this.tn.next(),
  35056. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35057. throw Error("illegal message field: " + o);
  35058. if (a.type = o,
  35059. this.tn.skip(">"),
  35060. o = this.tn.next(),
  35061. !t.NAME.test(o))
  35062. throw Error("illegal message field name: " + o);
  35063. a.name = o,
  35064. this.tn.skip("="),
  35065. a.id = i(this.tn.next()),
  35066. o = this.tn.peek(),
  35067. "[" === o && this._parseFieldOptions(a),
  35068. this.tn.skip(";")
  35069. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35070. "group" === r) {
  35071. var s = this._parseMessage(e, a);
  35072. if (!/^[A-Z]/.test(s.name))
  35073. throw Error("illegal group name: " + s.name);
  35074. a.type = s.name,
  35075. a.name = s.name.toLowerCase(),
  35076. this.tn.omit(";")
  35077. } else {
  35078. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35079. throw Error("illegal message field type: " + r);
  35080. if (a.type = r,
  35081. o = this.tn.next(),
  35082. !t.NAME.test(o))
  35083. throw Error("illegal message field name: " + o);
  35084. a.name = o,
  35085. this.tn.skip("="),
  35086. a.id = i(this.tn.next()),
  35087. o = this.tn.peek(),
  35088. "[" === o && this._parseFieldOptions(a),
  35089. this.tn.skip(";")
  35090. }
  35091. return e.fields.push(a),
  35092. a
  35093. }
  35094. ,
  35095. c._parseMessageOneOf = function(e) {
  35096. var i = this.tn.next();
  35097. if (!t.NAME.test(i))
  35098. throw Error("illegal oneof name: " + i);
  35099. var n, r = i, o = [];
  35100. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35101. n = this._parseMessageField(e, "optional", i),
  35102. n.oneof = r,
  35103. o.push(n.id);
  35104. this.tn.omit(";"),
  35105. e.oneofs[r] = o
  35106. }
  35107. ,
  35108. c._parseFieldOptions = function(e) {
  35109. this.tn.skip("[");
  35110. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35111. i || this.tn.skip(","),
  35112. this._parseOption(e, !0),
  35113. i = !1;
  35114. this.tn.next()
  35115. }
  35116. ,
  35117. c._parseEnum = function(e) {
  35118. var n = {
  35119. name: "",
  35120. values: [],
  35121. options: {}
  35122. }
  35123. , r = this.tn.next();
  35124. if (!t.NAME.test(r))
  35125. throw Error("illegal name: " + r);
  35126. for (n.name = r,
  35127. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35128. if ("option" === r)
  35129. this._parseOption(n);
  35130. else {
  35131. if (!t.NAME.test(r))
  35132. throw Error("illegal name: " + r);
  35133. this.tn.skip("=");
  35134. var o = {
  35135. name: r,
  35136. id: i(this.tn.next(), !0)
  35137. };
  35138. r = this.tn.peek(),
  35139. "[" === r && this._parseFieldOptions({
  35140. options: {}
  35141. }),
  35142. this.tn.skip(";"),
  35143. n.values.push(o)
  35144. }
  35145. this.tn.omit(";"),
  35146. e.enums.push(n)
  35147. }
  35148. ,
  35149. c._parseExtensionRanges = function() {
  35150. var t, i, r, o = [];
  35151. do {
  35152. for (i = []; ; ) {
  35153. switch (t = this.tn.next()) {
  35154. case "min":
  35155. r = e.ID_MIN;
  35156. break;
  35157. case "max":
  35158. r = e.ID_MAX;
  35159. break;
  35160. default:
  35161. r = n(t)
  35162. }
  35163. if (i.push(r),
  35164. 2 === i.length)
  35165. break;
  35166. if ("to" !== this.tn.peek()) {
  35167. i.push(r);
  35168. break
  35169. }
  35170. this.tn.next()
  35171. }
  35172. o.push(i)
  35173. } while (this.tn.omit(","));return this.tn.skip(";"),
  35174. o
  35175. }
  35176. ,
  35177. c._parseExtend = function(e) {
  35178. var i = this.tn.next();
  35179. if (!t.TYPEREF.test(i))
  35180. throw Error("illegal extend reference: " + i);
  35181. var n = {
  35182. ref: i,
  35183. fields: []
  35184. };
  35185. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35186. if (t.RULE.test(i))
  35187. this._parseMessageField(n, i);
  35188. else {
  35189. if (!t.TYPEREF.test(i))
  35190. throw Error("illegal extend token: " + i);
  35191. if (!this.proto3)
  35192. throw Error("illegal field rule: " + i);
  35193. this._parseMessageField(n, "optional", i)
  35194. }
  35195. return this.tn.omit(";"),
  35196. e.messages.push(n),
  35197. n
  35198. }
  35199. ,
  35200. c.toString = function() {
  35201. return "Parser at line " + this.tn.line
  35202. }
  35203. ,
  35204. o.Parser = l,
  35205. o
  35206. }(r, r.Lang),
  35207. r.Reflect = function(e) {
  35208. function i(i) {
  35209. if ("string" == typeof i && (i = e.TYPES[i]),
  35210. "undefined" == typeof i.defaultValue)
  35211. throw Error("default value for type " + i.name + " is not supported");
  35212. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35213. }
  35214. function n(t, i) {
  35215. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35216. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35217. if ("string" == typeof t)
  35218. return e.Long.fromString(t, i || !1, 10);
  35219. if ("number" == typeof t)
  35220. return e.Long.fromNumber(t, i || !1);
  35221. throw Error("not convertible to Long")
  35222. }
  35223. function r(t, i) {
  35224. var n = i.readVarint32()
  35225. , o = 7 & n
  35226. , a = n >>> 3;
  35227. switch (o) {
  35228. case e.WIRE_TYPES.VARINT:
  35229. do
  35230. n = i.readUint8();
  35231. while (128 === (128 & n));break;
  35232. case e.WIRE_TYPES.BITS64:
  35233. i.offset += 8;
  35234. break;
  35235. case e.WIRE_TYPES.LDELIM:
  35236. n = i.readVarint32(),
  35237. i.offset += n;
  35238. break;
  35239. case e.WIRE_TYPES.STARTGROUP:
  35240. r(a, i);
  35241. break;
  35242. case e.WIRE_TYPES.ENDGROUP:
  35243. if (a === t)
  35244. return !1;
  35245. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35246. case e.WIRE_TYPES.BITS32:
  35247. i.offset += 4;
  35248. break;
  35249. default:
  35250. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35251. }
  35252. return !0
  35253. }
  35254. var o = {}
  35255. , a = function(e, t, i) {
  35256. this.builder = e,
  35257. this.parent = t,
  35258. this.name = i,
  35259. this.className
  35260. }
  35261. , s = a.prototype;
  35262. s.fqn = function() {
  35263. for (var e = this.name, t = this; ; ) {
  35264. if (t = t.parent,
  35265. null == t)
  35266. break;
  35267. e = t.name + "." + e
  35268. }
  35269. return e
  35270. }
  35271. ,
  35272. s.toString = function(e) {
  35273. return (e ? this.className + " " : "") + this.fqn()
  35274. }
  35275. ,
  35276. s.build = function() {
  35277. throw Error(this.toString(!0) + " cannot be built directly")
  35278. }
  35279. ,
  35280. o.T = a;
  35281. var l = function(e, t, i, n, r) {
  35282. a.call(this, e, t, i),
  35283. this.className = "Namespace",
  35284. this.children = [],
  35285. this.options = n || {},
  35286. this.syntax = r || "proto2"
  35287. }
  35288. , c = l.prototype = Object.create(a.prototype);
  35289. c.getChildren = function(e) {
  35290. if (e = e || null,
  35291. null == e)
  35292. return this.children.slice();
  35293. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35294. this.children[i]instanceof e && t.push(this.children[i]);
  35295. return t
  35296. }
  35297. ,
  35298. c.addChild = function(e) {
  35299. var t;
  35300. if (t = this.getChild(e.name))
  35301. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35302. t.name = t.originalName;
  35303. else {
  35304. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35305. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35306. e.name = e.originalName
  35307. }
  35308. this.children.push(e)
  35309. }
  35310. ,
  35311. c.getChild = function(e) {
  35312. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35313. if (this.children[i][t] === e)
  35314. return this.children[i];
  35315. return null
  35316. }
  35317. ,
  35318. c.resolve = function(e, t) {
  35319. var i = "string" == typeof e ? e.split(".") : e
  35320. , n = this
  35321. , r = 0;
  35322. if ("" === i[r]) {
  35323. for (; null !== n.parent; )
  35324. n = n.parent;
  35325. r++
  35326. }
  35327. var a;
  35328. do {
  35329. do {
  35330. if (!(n instanceof o.Namespace)) {
  35331. n = null;
  35332. break
  35333. }
  35334. if (a = n.getChild(i[r]),
  35335. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35336. n = null;
  35337. break
  35338. }
  35339. n = a,
  35340. r++
  35341. } while (r < i.length);if (null != n)
  35342. break;
  35343. if (null !== this.parent)
  35344. return this.parent.resolve(e, t)
  35345. } while (null != n);return n
  35346. }
  35347. ,
  35348. c.qn = function(e) {
  35349. var t = []
  35350. , i = e;
  35351. do
  35352. t.unshift(i.name),
  35353. i = i.parent;
  35354. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35355. var r = t.slice(t.length - n);
  35356. if (e === this.resolve(r, e instanceof o.Namespace))
  35357. return r.join(".")
  35358. }
  35359. return e.fqn()
  35360. }
  35361. ,
  35362. c.build = function() {
  35363. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35364. e = i[n],
  35365. e instanceof l && (t[e.name] = e.build());
  35366. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35367. value: this.buildOpt()
  35368. }),
  35369. t
  35370. }
  35371. ,
  35372. c.buildOpt = function() {
  35373. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35374. var r = t[i]
  35375. , o = this.options[t[i]];
  35376. e[r] = o
  35377. }
  35378. return e
  35379. }
  35380. ,
  35381. c.getOption = function(e) {
  35382. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35383. }
  35384. ,
  35385. o.Namespace = l;
  35386. var h = function(t, i, n, r) {
  35387. if (this.type = t,
  35388. this.resolvedType = i,
  35389. this.isMapKey = n,
  35390. this.syntax = r,
  35391. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35392. throw Error("Invalid map key type: " + t.name)
  35393. }
  35394. , u = h.prototype;
  35395. h.defaultFieldValue = i,
  35396. u.verifyValue = function(i) {
  35397. function r(e, t) {
  35398. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35399. }
  35400. var o = this;
  35401. switch (this.type) {
  35402. case e.TYPES.int32:
  35403. case e.TYPES.sint32:
  35404. case e.TYPES.sfixed32:
  35405. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35406. i > 4294967295 ? 0 | i : i;
  35407. case e.TYPES.uint32:
  35408. case e.TYPES.fixed32:
  35409. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35410. i < 0 ? i >>> 0 : i;
  35411. case e.TYPES.int64:
  35412. case e.TYPES.sint64:
  35413. case e.TYPES.sfixed64:
  35414. if (e.Long)
  35415. try {
  35416. return n(i, !1)
  35417. } catch (e) {
  35418. r(typeof i, e.message)
  35419. }
  35420. else
  35421. r(typeof i, "requires Long.js");
  35422. case e.TYPES.uint64:
  35423. case e.TYPES.fixed64:
  35424. if (e.Long)
  35425. try {
  35426. return n(i, !0)
  35427. } catch (e) {
  35428. r(typeof i, e.message)
  35429. }
  35430. else
  35431. r(typeof i, "requires Long.js");
  35432. case e.TYPES.bool:
  35433. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35434. i;
  35435. case e.TYPES.float:
  35436. case e.TYPES.double:
  35437. return "number" != typeof i && r(typeof i, "not a number"),
  35438. i;
  35439. case e.TYPES.string:
  35440. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35441. "" + i;
  35442. case e.TYPES.bytes:
  35443. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35444. case e.TYPES.enum:
  35445. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35446. for (l = 0; l < a.length; l++) {
  35447. if (a[l].name == i)
  35448. return a[l].id;
  35449. if (a[l].id == i)
  35450. return a[l].id
  35451. }
  35452. if ("proto3" === this.syntax)
  35453. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35454. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35455. i;
  35456. r(i, "not a valid enum value");
  35457. case e.TYPES.group:
  35458. case e.TYPES.message:
  35459. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35460. i instanceof this.resolvedType.clazz)
  35461. return i;
  35462. if (i instanceof e.Builder.Message) {
  35463. var s = {};
  35464. for (var l in i)
  35465. i.hasOwnProperty(l) && (s[l] = i[l]);
  35466. i = s
  35467. }
  35468. return new this.resolvedType.clazz(i)
  35469. }
  35470. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35471. }
  35472. ,
  35473. u.calculateLength = function(i, n) {
  35474. if (null === n)
  35475. return 0;
  35476. var r;
  35477. switch (this.type) {
  35478. case e.TYPES.int32:
  35479. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35480. case e.TYPES.uint32:
  35481. return t.calculateVarint32(n);
  35482. case e.TYPES.sint32:
  35483. return t.calculateVarint32(t.zigZagEncode32(n));
  35484. case e.TYPES.fixed32:
  35485. case e.TYPES.sfixed32:
  35486. case e.TYPES.float:
  35487. return 4;
  35488. case e.TYPES.int64:
  35489. case e.TYPES.uint64:
  35490. return t.calculateVarint64(n);
  35491. case e.TYPES.sint64:
  35492. return t.calculateVarint64(t.zigZagEncode64(n));
  35493. case e.TYPES.fixed64:
  35494. case e.TYPES.sfixed64:
  35495. return 8;
  35496. case e.TYPES.bool:
  35497. return 1;
  35498. case e.TYPES.enum:
  35499. return t.calculateVarint32(n);
  35500. case e.TYPES.double:
  35501. return 8;
  35502. case e.TYPES.string:
  35503. return r = t.calculateUTF8Bytes(n),
  35504. t.calculateVarint32(r) + r;
  35505. case e.TYPES.bytes:
  35506. if (n.remaining() < 0)
  35507. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35508. return t.calculateVarint32(n.remaining()) + n.remaining();
  35509. case e.TYPES.message:
  35510. return r = this.resolvedType.calculate(n),
  35511. t.calculateVarint32(r) + r;
  35512. case e.TYPES.group:
  35513. return r = this.resolvedType.calculate(n),
  35514. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35515. }
  35516. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35517. }
  35518. ,
  35519. u.encodeValue = function(i, n, r) {
  35520. if (null === n)
  35521. return r;
  35522. switch (this.type) {
  35523. case e.TYPES.int32:
  35524. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35525. break;
  35526. case e.TYPES.uint32:
  35527. r.writeVarint32(n);
  35528. break;
  35529. case e.TYPES.sint32:
  35530. r.writeVarint32ZigZag(n);
  35531. break;
  35532. case e.TYPES.fixed32:
  35533. r.writeUint32(n);
  35534. break;
  35535. case e.TYPES.sfixed32:
  35536. r.writeInt32(n);
  35537. break;
  35538. case e.TYPES.int64:
  35539. case e.TYPES.uint64:
  35540. r.writeVarint64(n);
  35541. break;
  35542. case e.TYPES.sint64:
  35543. r.writeVarint64ZigZag(n);
  35544. break;
  35545. case e.TYPES.fixed64:
  35546. r.writeUint64(n);
  35547. break;
  35548. case e.TYPES.sfixed64:
  35549. r.writeInt64(n);
  35550. break;
  35551. case e.TYPES.bool:
  35552. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35553. break;
  35554. case e.TYPES.enum:
  35555. r.writeVarint32(n);
  35556. break;
  35557. case e.TYPES.float:
  35558. r.writeFloat32(n);
  35559. break;
  35560. case e.TYPES.double:
  35561. r.writeFloat64(n);
  35562. break;
  35563. case e.TYPES.string:
  35564. r.writeVString(n);
  35565. break;
  35566. case e.TYPES.bytes:
  35567. if (n.remaining() < 0)
  35568. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35569. var o = n.offset;
  35570. r.writeVarint32(n.remaining()),
  35571. r.append(n),
  35572. n.offset = o;
  35573. break;
  35574. case e.TYPES.message:
  35575. var a = (new t).LE();
  35576. this.resolvedType.encode(n, a),
  35577. r.writeVarint32(a.offset),
  35578. r.append(a.flip());
  35579. break;
  35580. case e.TYPES.group:
  35581. this.resolvedType.encode(n, r),
  35582. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35583. break;
  35584. default:
  35585. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35586. }
  35587. return r
  35588. }
  35589. ,
  35590. u.decode = function(t, i, n) {
  35591. if (i != this.type.wireType)
  35592. throw Error("Unexpected wire type for element");
  35593. var r, o;
  35594. switch (this.type) {
  35595. case e.TYPES.int32:
  35596. return 0 | t.readVarint32();
  35597. case e.TYPES.uint32:
  35598. return t.readVarint32() >>> 0;
  35599. case e.TYPES.sint32:
  35600. return 0 | t.readVarint32ZigZag();
  35601. case e.TYPES.fixed32:
  35602. return t.readUint32() >>> 0;
  35603. case e.TYPES.sfixed32:
  35604. return 0 | t.readInt32();
  35605. case e.TYPES.int64:
  35606. return t.readVarint64();
  35607. case e.TYPES.uint64:
  35608. return t.readVarint64().toUnsigned();
  35609. case e.TYPES.sint64:
  35610. return t.readVarint64ZigZag();
  35611. case e.TYPES.fixed64:
  35612. return t.readUint64();
  35613. case e.TYPES.sfixed64:
  35614. return t.readInt64();
  35615. case e.TYPES.bool:
  35616. return !!t.readVarint32();
  35617. case e.TYPES.enum:
  35618. return t.readVarint32();
  35619. case e.TYPES.float:
  35620. return t.readFloat();
  35621. case e.TYPES.double:
  35622. return t.readDouble();
  35623. case e.TYPES.string:
  35624. return t.readVString();
  35625. case e.TYPES.bytes:
  35626. if (o = t.readVarint32(),
  35627. t.remaining() < o)
  35628. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35629. return r = t.clone(),
  35630. r.limit = r.offset + o,
  35631. t.offset += o,
  35632. r;
  35633. case e.TYPES.message:
  35634. return o = t.readVarint32(),
  35635. this.resolvedType.decode(t, o);
  35636. case e.TYPES.group:
  35637. return this.resolvedType.decode(t, -1, n)
  35638. }
  35639. throw Error("[INTERNAL] Illegal decode type")
  35640. }
  35641. ,
  35642. u.valueFromString = function(i) {
  35643. if (!this.isMapKey)
  35644. throw Error("valueFromString() called on non-map-key element");
  35645. switch (this.type) {
  35646. case e.TYPES.int32:
  35647. case e.TYPES.sint32:
  35648. case e.TYPES.sfixed32:
  35649. case e.TYPES.uint32:
  35650. case e.TYPES.fixed32:
  35651. return this.verifyValue(parseInt(i));
  35652. case e.TYPES.int64:
  35653. case e.TYPES.sint64:
  35654. case e.TYPES.sfixed64:
  35655. case e.TYPES.uint64:
  35656. case e.TYPES.fixed64:
  35657. return this.verifyValue(i);
  35658. case e.TYPES.bool:
  35659. return "true" === i;
  35660. case e.TYPES.string:
  35661. return this.verifyValue(i);
  35662. case e.TYPES.bytes:
  35663. return t.fromBinary(i)
  35664. }
  35665. }
  35666. ,
  35667. u.valueToString = function(t) {
  35668. if (!this.isMapKey)
  35669. throw Error("valueToString() called on non-map-key element");
  35670. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35671. }
  35672. ,
  35673. o.Element = h;
  35674. var d = function(e, t, i, n, r, o) {
  35675. l.call(this, e, t, i, n, o),
  35676. this.className = "Message",
  35677. this.extensions = void 0,
  35678. this.clazz = null,
  35679. this.isGroup = !!r,
  35680. this._fields = null,
  35681. this._fieldsById = null,
  35682. this._fieldsByName = null
  35683. }
  35684. , p = d.prototype = Object.create(l.prototype);
  35685. p.build = function(i) {
  35686. if (this.clazz && !i)
  35687. return this.clazz;
  35688. var n = function(e, i) {
  35689. function n(i, r, o, a) {
  35690. if (null === i || "object" != typeof i) {
  35691. if (a && a instanceof e.Reflect.Enum) {
  35692. var s = e.Reflect.Enum.getName(a.object, i);
  35693. if (null !== s)
  35694. return s
  35695. }
  35696. return i
  35697. }
  35698. if (t.isByteBuffer(i))
  35699. return r ? i.toBase64() : i.toBuffer();
  35700. if (e.Long.isLong(i))
  35701. return o ? i.toString() : e.Long.fromValue(i);
  35702. var l;
  35703. if (Array.isArray(i))
  35704. return l = [],
  35705. i.forEach(function(e, t) {
  35706. l[t] = n(e, r, o, a)
  35707. }),
  35708. l;
  35709. if (l = {},
  35710. i instanceof e.Map) {
  35711. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35712. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35713. return l
  35714. }
  35715. var u = i.$type
  35716. , d = void 0;
  35717. for (var p in i)
  35718. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35719. return l
  35720. }
  35721. var r = i.getChildren(e.Reflect.Message.Field)
  35722. , o = i.getChildren(e.Reflect.Message.OneOf)
  35723. , a = function(n, s) {
  35724. e.Builder.Message.call(this);
  35725. for (var l = 0, c = o.length; l < c; ++l)
  35726. this[o[l].name] = null;
  35727. for (l = 0,
  35728. c = r.length; l < c; ++l) {
  35729. var h = r[l];
  35730. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35731. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35732. }
  35733. if (arguments.length > 0) {
  35734. var u;
  35735. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  35736. for (l = 0,
  35737. c = arguments.length; l < c; ++l)
  35738. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35739. else
  35740. this.$set(n)
  35741. }
  35742. }
  35743. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35744. s.add = function(t, n, r) {
  35745. var o = i._fieldsByName[t];
  35746. if (!r) {
  35747. if (!o)
  35748. throw Error(this + "#" + t + " is undefined");
  35749. if (!(o instanceof e.Reflect.Message.Field))
  35750. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35751. if (!o.repeated)
  35752. throw Error(this + "#" + t + " is not a repeated field");
  35753. n = o.verifyValue(n, !0)
  35754. }
  35755. return null === this[t] && (this[t] = []),
  35756. this[t].push(n),
  35757. this
  35758. }
  35759. ,
  35760. s.$add = s.add,
  35761. s.set = function(t, n, r) {
  35762. if (t && "object" == typeof t) {
  35763. r = n;
  35764. for (var o in t)
  35765. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35766. return this
  35767. }
  35768. var a = i._fieldsByName[t];
  35769. if (r)
  35770. this[t] = n;
  35771. else {
  35772. if (!a)
  35773. throw Error(this + "#" + t + " is not a field: undefined");
  35774. if (!(a instanceof e.Reflect.Message.Field))
  35775. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35776. this[a.name] = n = a.verifyValue(n)
  35777. }
  35778. if (a && a.oneof) {
  35779. var s = this[a.oneof.name];
  35780. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35781. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35782. }
  35783. return this
  35784. }
  35785. ,
  35786. s.$set = s.set,
  35787. s.get = function(t, n) {
  35788. if (n)
  35789. return this[t];
  35790. var r = i._fieldsByName[t];
  35791. if (!(r && r instanceof e.Reflect.Message.Field))
  35792. throw Error(this + "#" + t + " is not a field: undefined");
  35793. if (!(r instanceof e.Reflect.Message.Field))
  35794. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35795. return this[r.name]
  35796. }
  35797. ,
  35798. s.$get = s.get;
  35799. for (var l = 0; l < r.length; l++) {
  35800. var c = r[l];
  35801. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35802. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35803. return e.toUpperCase().replace("_", "")
  35804. });
  35805. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35806. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35807. return "_" + e
  35808. })
  35809. , r = function(t, i) {
  35810. return this[e.name] = i ? t : e.verifyValue(t),
  35811. this
  35812. }
  35813. , o = function() {
  35814. return this[e.name]
  35815. };
  35816. null === i.getChild("set" + t) && (s["set" + t] = r),
  35817. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35818. null === i.getChild("get" + t) && (s["get" + t] = o),
  35819. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35820. }(c)
  35821. }
  35822. s.encode = function(e, n) {
  35823. "boolean" == typeof e && (n = e,
  35824. e = void 0);
  35825. var r = !1;
  35826. e || (e = new t,
  35827. r = !0);
  35828. var o = e.littleEndian;
  35829. try {
  35830. return i.encode(this, e.LE(), n),
  35831. (r ? e.flip() : e).LE(o)
  35832. } catch (t) {
  35833. throw e.LE(o),
  35834. t
  35835. }
  35836. }
  35837. ,
  35838. a.encode = function(e, t, i) {
  35839. return new a(e).encode(t, i)
  35840. }
  35841. ,
  35842. s.calculate = function() {
  35843. return i.calculate(this)
  35844. }
  35845. ,
  35846. s.encodeDelimited = function(e, n) {
  35847. var r = !1;
  35848. e || (e = new t,
  35849. r = !0);
  35850. var o = (new t).LE();
  35851. return i.encode(this, o, n).flip(),
  35852. e.writeVarint32(o.remaining()),
  35853. e.append(o),
  35854. r ? e.flip() : e
  35855. }
  35856. ,
  35857. s.encodeAB = function() {
  35858. try {
  35859. return this.encode().toArrayBuffer()
  35860. } catch (e) {
  35861. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35862. e
  35863. }
  35864. }
  35865. ,
  35866. s.toArrayBuffer = s.encodeAB,
  35867. s.encodeNB = function() {
  35868. try {
  35869. return this.encode().toBuffer()
  35870. } catch (e) {
  35871. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35872. e
  35873. }
  35874. }
  35875. ,
  35876. s.toBuffer = s.encodeNB,
  35877. s.encode64 = function() {
  35878. try {
  35879. return this.encode().toBase64()
  35880. } catch (e) {
  35881. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35882. e
  35883. }
  35884. }
  35885. ,
  35886. s.toBase64 = s.encode64,
  35887. s.encodeHex = function() {
  35888. try {
  35889. return this.encode().toHex()
  35890. } catch (e) {
  35891. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35892. e
  35893. }
  35894. }
  35895. ,
  35896. s.toHex = s.encodeHex,
  35897. s.toRaw = function(e, t) {
  35898. return n(this, !!e, !!t, this.$type)
  35899. }
  35900. ,
  35901. s.encodeJSON = function() {
  35902. return JSON.stringify(n(this, !0, !0, this.$type))
  35903. }
  35904. ,
  35905. a.decode = function(e, n, r) {
  35906. "string" == typeof n && (r = n,
  35907. n = -1),
  35908. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35909. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35910. var o = e.littleEndian;
  35911. try {
  35912. var a = i.decode(e.LE());
  35913. return e.LE(o),
  35914. a
  35915. } catch (t) {
  35916. throw e.LE(o),
  35917. t
  35918. }
  35919. }
  35920. ,
  35921. a.decodeDelimited = function(e, n) {
  35922. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35923. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35924. e.remaining() < 1)
  35925. return null;
  35926. var r = e.offset
  35927. , o = e.readVarint32();
  35928. if (e.remaining() < o)
  35929. return e.offset = r,
  35930. null;
  35931. try {
  35932. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35933. return e.offset += o,
  35934. a
  35935. } catch (t) {
  35936. throw e.offset += o,
  35937. t
  35938. }
  35939. }
  35940. ,
  35941. a.decode64 = function(e) {
  35942. return a.decode(e, "base64")
  35943. }
  35944. ,
  35945. a.decodeHex = function(e) {
  35946. return a.decode(e, "hex")
  35947. }
  35948. ,
  35949. a.decodeJSON = function(e) {
  35950. return new a(JSON.parse(e))
  35951. }
  35952. ,
  35953. s.toString = function() {
  35954. return i.toString()
  35955. }
  35956. ;
  35957. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35958. value: i.buildOpt()
  35959. }),
  35960. Object.defineProperty(s, "$options", {
  35961. value: a.$options
  35962. }),
  35963. Object.defineProperty(a, "$type", {
  35964. value: i
  35965. }),
  35966. Object.defineProperty(s, "$type", {
  35967. value: i
  35968. })),
  35969. a
  35970. }(e, this);
  35971. this._fields = [],
  35972. this._fieldsById = {},
  35973. this._fieldsByName = {};
  35974. for (var r, o = 0, a = this.children.length; o < a; o++)
  35975. if (r = this.children[o],
  35976. r instanceof A || r instanceof d || r instanceof E) {
  35977. if (n.hasOwnProperty(r.name))
  35978. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35979. n[r.name] = r.build()
  35980. } else if (r instanceof d.Field)
  35981. r.build(),
  35982. this._fields.push(r),
  35983. this._fieldsById[r.id] = r,
  35984. this._fieldsByName[r.name] = r;
  35985. else if (!(r instanceof d.OneOf || r instanceof I))
  35986. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35987. return this.clazz = n
  35988. }
  35989. ,
  35990. p.encode = function(e, t, i) {
  35991. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35992. n = this._fields[a],
  35993. r = e[n.name],
  35994. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35995. if (null !== o) {
  35996. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35997. throw l.encoded = t,
  35998. l
  35999. }
  36000. return t
  36001. }
  36002. ,
  36003. p.calculate = function(e) {
  36004. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36005. if (t = this._fields[r],
  36006. i = e[t.name],
  36007. t.required && null === i)
  36008. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36009. n += t.calculate(i, e)
  36010. }
  36011. return n
  36012. }
  36013. ,
  36014. p.decode = function(t, i, n) {
  36015. i = "number" == typeof i ? i : -1;
  36016. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36017. if (o = t.readVarint32(),
  36018. a = 7 & o,
  36019. s = o >>> 3,
  36020. a === e.WIRE_TYPES.ENDGROUP) {
  36021. if (s !== n)
  36022. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36023. break
  36024. }
  36025. if (l = this._fieldsById[s]) {
  36026. if (l.repeated && !l.options.packed)
  36027. h[l.name].push(l.decode(a, t));
  36028. else if (l.map) {
  36029. var u = l.decode(a, t);
  36030. h[l.name].set(u[0], u[1])
  36031. } else if (h[l.name] = l.decode(a, t),
  36032. l.oneof) {
  36033. var d = h[l.oneof.name];
  36034. null !== d && d !== l.name && (h[d] = null),
  36035. h[l.oneof.name] = l.name
  36036. }
  36037. } else
  36038. switch (a) {
  36039. case e.WIRE_TYPES.VARINT:
  36040. t.readVarint32();
  36041. break;
  36042. case e.WIRE_TYPES.BITS32:
  36043. t.offset += 4;
  36044. break;
  36045. case e.WIRE_TYPES.BITS64:
  36046. t.offset += 8;
  36047. break;
  36048. case e.WIRE_TYPES.LDELIM:
  36049. var p = t.readVarint32();
  36050. t.offset += p;
  36051. break;
  36052. case e.WIRE_TYPES.STARTGROUP:
  36053. for (; r(s, t); )
  36054. ;
  36055. break;
  36056. default:
  36057. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36058. }
  36059. }
  36060. for (var f = 0, g = this._fields.length; f < g; ++f)
  36061. if (l = this._fields[f],
  36062. null === h[l.name])
  36063. if ("proto3" === this.syntax)
  36064. h[l.name] = l.defaultValue;
  36065. else {
  36066. if (l.required) {
  36067. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36068. throw m.decoded = h,
  36069. m
  36070. }
  36071. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36072. }
  36073. return h
  36074. }
  36075. ,
  36076. o.Message = d;
  36077. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36078. a.call(this, t, i, s),
  36079. this.className = "Message.Field",
  36080. this.required = "required" === n,
  36081. this.repeated = "repeated" === n,
  36082. this.map = "map" === n,
  36083. this.keyType = r || null,
  36084. this.type = o,
  36085. this.resolvedType = null,
  36086. this.id = l,
  36087. this.options = c || {},
  36088. this.defaultValue = null,
  36089. this.oneof = h || null,
  36090. this.syntax = u || "proto2",
  36091. this.originalName = this.name,
  36092. this.element = null,
  36093. this.keyElement = null,
  36094. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36095. }
  36096. , g = f.prototype = Object.create(a.prototype);
  36097. g.build = function() {
  36098. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36099. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36100. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  36101. }
  36102. ,
  36103. g.verifyValue = function(t, i) {
  36104. function n(e, t) {
  36105. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36106. }
  36107. i = i || !1;
  36108. var r = this;
  36109. if (null === t)
  36110. return this.required && n(typeof t, "required"),
  36111. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36112. null;
  36113. var o;
  36114. if (this.repeated && !i) {
  36115. Array.isArray(t) || (t = [t]);
  36116. var a = [];
  36117. for (o = 0; o < t.length; o++)
  36118. a.push(this.element.verifyValue(t[o]));
  36119. return a
  36120. }
  36121. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36122. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36123. this.element.verifyValue(t))
  36124. }
  36125. ,
  36126. g.hasWirePresence = function(t, i) {
  36127. if ("proto3" !== this.syntax)
  36128. return null !== t;
  36129. if (this.oneof && i[this.oneof.name] === this.name)
  36130. return !0;
  36131. switch (this.type) {
  36132. case e.TYPES.int32:
  36133. case e.TYPES.sint32:
  36134. case e.TYPES.sfixed32:
  36135. case e.TYPES.uint32:
  36136. case e.TYPES.fixed32:
  36137. return 0 !== t;
  36138. case e.TYPES.int64:
  36139. case e.TYPES.sint64:
  36140. case e.TYPES.sfixed64:
  36141. case e.TYPES.uint64:
  36142. case e.TYPES.fixed64:
  36143. return 0 !== t.low || 0 !== t.high;
  36144. case e.TYPES.bool:
  36145. return t;
  36146. case e.TYPES.float:
  36147. case e.TYPES.double:
  36148. return 0 !== t;
  36149. case e.TYPES.string:
  36150. return t.length > 0;
  36151. case e.TYPES.bytes:
  36152. return t.remaining() > 0;
  36153. case e.TYPES.enum:
  36154. return 0 !== t;
  36155. case e.TYPES.message:
  36156. return null !== t;
  36157. default:
  36158. return !0
  36159. }
  36160. }
  36161. ,
  36162. g.encode = function(i, n, r) {
  36163. if (null === this.type || "object" != typeof this.type)
  36164. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36165. if (null === i || this.repeated && 0 == i.length)
  36166. return n;
  36167. try {
  36168. if (this.repeated) {
  36169. var o;
  36170. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36171. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36172. n.ensureCapacity(n.offset += 1);
  36173. var a = n.offset;
  36174. for (o = 0; o < i.length; o++)
  36175. this.element.encodeValue(this.id, i[o], n);
  36176. var s = n.offset - a
  36177. , l = t.calculateVarint32(s);
  36178. if (l > 1) {
  36179. var c = n.slice(a, n.offset);
  36180. a += l - 1,
  36181. n.offset = a,
  36182. n.append(c)
  36183. }
  36184. n.writeVarint32(s, a - l)
  36185. } else
  36186. for (o = 0; o < i.length; o++)
  36187. n.writeVarint32(this.id << 3 | this.type.wireType),
  36188. this.element.encodeValue(this.id, i[o], n)
  36189. } else
  36190. this.map ? i.forEach(function(i, r, o) {
  36191. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36192. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36193. n.writeVarint32(a),
  36194. n.writeVarint32(8 | this.keyType.wireType),
  36195. this.keyElement.encodeValue(1, r, n),
  36196. n.writeVarint32(16 | this.type.wireType),
  36197. this.element.encodeValue(2, i, n)
  36198. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36199. this.element.encodeValue(this.id, i, n))
  36200. } catch (e) {
  36201. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36202. }
  36203. return n
  36204. }
  36205. ,
  36206. g.calculate = function(i, n) {
  36207. if (i = this.verifyValue(i),
  36208. null === this.type || "object" != typeof this.type)
  36209. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36210. if (null === i || this.repeated && 0 == i.length)
  36211. return 0;
  36212. var r = 0;
  36213. try {
  36214. if (this.repeated) {
  36215. var o, a;
  36216. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36217. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36218. a = 0,
  36219. o = 0; o < i.length; o++)
  36220. a += this.element.calculateLength(this.id, i[o]);
  36221. r += t.calculateVarint32(a),
  36222. r += a
  36223. } else
  36224. for (o = 0; o < i.length; o++)
  36225. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36226. r += this.element.calculateLength(this.id, i[o])
  36227. } else
  36228. this.map ? i.forEach(function(i, n, o) {
  36229. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36230. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36231. r += t.calculateVarint32(a),
  36232. r += a
  36233. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36234. r += this.element.calculateLength(this.id, i))
  36235. } catch (e) {
  36236. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36237. }
  36238. return r
  36239. }
  36240. ,
  36241. g.decode = function(t, i, n) {
  36242. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  36243. if (!a)
  36244. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36245. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36246. o = i.readVarint32(),
  36247. o = i.offset + o;
  36248. for (var s = []; i.offset < o; )
  36249. s.push(this.decode(this.type.wireType, i, !0));
  36250. return s
  36251. }
  36252. if (this.map) {
  36253. var l = h.defaultFieldValue(this.keyType);
  36254. if (r = h.defaultFieldValue(this.type),
  36255. o = i.readVarint32(),
  36256. i.remaining() < o)
  36257. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36258. var c = i.clone();
  36259. for (c.limit = c.offset + o,
  36260. i.offset += o; c.remaining() > 0; ) {
  36261. var u = c.readVarint32();
  36262. t = 7 & u;
  36263. var d = u >>> 3;
  36264. if (1 === d)
  36265. l = this.keyElement.decode(c, t, d);
  36266. else {
  36267. if (2 !== d)
  36268. throw Error("Unexpected tag in map field key/value submessage");
  36269. r = this.element.decode(c, t, d)
  36270. }
  36271. }
  36272. return [l, r]
  36273. }
  36274. return this.element.decode(i, t, this.id)
  36275. }
  36276. ,
  36277. o.Message.Field = f;
  36278. var m = function(e, t, i, n, r, o, a) {
  36279. f.call(this, e, t, i, null, n, r, o, a),
  36280. this.extension
  36281. };
  36282. m.prototype = Object.create(f.prototype),
  36283. o.Message.ExtensionField = m;
  36284. var v = function(e, t, i) {
  36285. a.call(this, e, t, i),
  36286. this.fields = []
  36287. };
  36288. o.Message.OneOf = v;
  36289. var A = function(e, t, i, n, r) {
  36290. l.call(this, e, t, i, n, r),
  36291. this.className = "Enum",
  36292. this.object = null
  36293. };
  36294. A.getName = function(e, t) {
  36295. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36296. if (e[i = n[r]] === t)
  36297. return i;
  36298. return null
  36299. }
  36300. ;
  36301. var y = A.prototype = Object.create(l.prototype);
  36302. y.build = function(t) {
  36303. if (this.object && !t)
  36304. return this.object;
  36305. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36306. i[n[r].name] = n[r].id;
  36307. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36308. value: this.buildOpt(),
  36309. enumerable: !1
  36310. }),
  36311. this.object = i
  36312. }
  36313. ,
  36314. o.Enum = A;
  36315. var C = function(e, t, i, n) {
  36316. a.call(this, e, t, i),
  36317. this.className = "Enum.Value",
  36318. this.id = n
  36319. };
  36320. C.prototype = Object.create(a.prototype),
  36321. o.Enum.Value = C;
  36322. var I = function(e, t, i, n) {
  36323. a.call(this, e, t, i),
  36324. this.field = n
  36325. };
  36326. I.prototype = Object.create(a.prototype),
  36327. o.Extension = I;
  36328. var E = function(e, t, i, n) {
  36329. l.call(this, e, t, i, n),
  36330. this.className = "Service",
  36331. this.clazz = null
  36332. }
  36333. , b = E.prototype = Object.create(l.prototype);
  36334. b.build = function(i) {
  36335. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36336. for (var n = function(t) {
  36337. e.Builder.Service.call(this),
  36338. this.rpcImpl = t || function(e, t, i) {
  36339. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36340. }
  36341. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36342. !function(e) {
  36343. r[e.name] = function(n, r) {
  36344. try {
  36345. try {
  36346. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36347. } catch (e) {
  36348. if (!(e instanceof TypeError))
  36349. throw e
  36350. }
  36351. if (null === n || "object" != typeof n)
  36352. throw Error("Illegal arguments");
  36353. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36354. this.rpcImpl(e.fqn(), n, function(t, n) {
  36355. if (t)
  36356. return void r(t);
  36357. null === n && (n = "");
  36358. try {
  36359. n = e.resolvedResponseType.clazz.decode(n)
  36360. } catch (e) {}
  36361. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  36362. })
  36363. } catch (e) {
  36364. setTimeout(r.bind(this, e), 0)
  36365. }
  36366. }
  36367. ,
  36368. n[e.name] = function(t, i, r) {
  36369. new n(t)[e.name](i, r)
  36370. }
  36371. ,
  36372. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36373. value: e.buildOpt()
  36374. }),
  36375. Object.defineProperty(r[e.name], "$options", {
  36376. value: n[e.name].$options
  36377. }))
  36378. }(o[a]);
  36379. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36380. value: i.buildOpt()
  36381. }),
  36382. Object.defineProperty(r, "$options", {
  36383. value: n.$options
  36384. }),
  36385. Object.defineProperty(n, "$type", {
  36386. value: i
  36387. }),
  36388. Object.defineProperty(r, "$type", {
  36389. value: i
  36390. })),
  36391. n
  36392. }(e, this)
  36393. }
  36394. ,
  36395. o.Service = E;
  36396. var w = function(e, t, i, n) {
  36397. a.call(this, e, t, i),
  36398. this.className = "Service.Method",
  36399. this.options = n || {}
  36400. }
  36401. , _ = w.prototype = Object.create(a.prototype);
  36402. _.buildOpt = c.buildOpt,
  36403. o.Service.Method = w;
  36404. var T = function(e, t, i, n, r, o, a, s) {
  36405. w.call(this, e, t, i, s),
  36406. this.className = "Service.RPCMethod",
  36407. this.requestName = n,
  36408. this.responseName = r,
  36409. this.requestStream = o,
  36410. this.responseStream = a,
  36411. this.resolvedRequestType = null,
  36412. this.resolvedResponseType = null
  36413. };
  36414. return T.prototype = Object.create(w.prototype),
  36415. o.Service.RPCMethod = T,
  36416. o
  36417. }(r),
  36418. r.Builder = function(t, i, n) {
  36419. function r(e) {
  36420. e.messages && e.messages.forEach(function(t) {
  36421. t.syntax = e.syntax,
  36422. r(t)
  36423. }),
  36424. e.enums && e.enums.forEach(function(t) {
  36425. t.syntax = e.syntax
  36426. })
  36427. }
  36428. var o = function(e) {
  36429. this.ns = new n.Namespace(this,null,""),
  36430. this.ptr = this.ns,
  36431. this.resolved = !1,
  36432. this.result = null,
  36433. this.files = {},
  36434. this.importRoot = null,
  36435. this.options = e || {}
  36436. }
  36437. , a = o.prototype;
  36438. return o.isMessage = function(e) {
  36439. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36440. }
  36441. ,
  36442. o.isMessageField = function(e) {
  36443. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36444. }
  36445. ,
  36446. o.isEnum = function(e) {
  36447. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36448. }
  36449. ,
  36450. o.isService = function(e) {
  36451. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36452. }
  36453. ,
  36454. o.isExtend = function(e) {
  36455. return "string" == typeof e.ref
  36456. }
  36457. ,
  36458. a.reset = function() {
  36459. return this.ptr = this.ns,
  36460. this
  36461. }
  36462. ,
  36463. a.define = function(e) {
  36464. if ("string" != typeof e || !i.TYPEREF.test(e))
  36465. throw Error("illegal namespace: " + e);
  36466. return e.split(".").forEach(function(e) {
  36467. var t = this.ptr.getChild(e);
  36468. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36469. this.ptr = t
  36470. }, this),
  36471. this
  36472. }
  36473. ,
  36474. a.create = function(e) {
  36475. if (!e)
  36476. return this;
  36477. if (Array.isArray(e)) {
  36478. if (0 === e.length)
  36479. return this;
  36480. e = e.slice()
  36481. } else
  36482. e = [e];
  36483. for (var i = [e]; i.length > 0; ) {
  36484. if (e = i.pop(),
  36485. !Array.isArray(e))
  36486. throw Error("not a valid namespace: " + JSON.stringify(e));
  36487. for (; e.length > 0; ) {
  36488. var r = e.shift();
  36489. if (o.isMessage(r)) {
  36490. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36491. , s = {};
  36492. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36493. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36494. }, this),
  36495. r.fields && r.fields.forEach(function(e) {
  36496. if (null !== a.getChild(0 | e.id))
  36497. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36498. if (e.options && "object" != typeof e.options)
  36499. throw Error("illegal field options in " + a.name + "#" + e.name);
  36500. var t = null;
  36501. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36502. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36503. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36504. t && t.fields.push(e),
  36505. a.addChild(e)
  36506. }, this);
  36507. var l = [];
  36508. if (r.enums && r.enums.forEach(function(e) {
  36509. l.push(e)
  36510. }),
  36511. r.messages && r.messages.forEach(function(e) {
  36512. l.push(e)
  36513. }),
  36514. r.services && r.services.forEach(function(e) {
  36515. l.push(e)
  36516. }),
  36517. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36518. this.ptr.addChild(a),
  36519. l.length > 0) {
  36520. i.push(e),
  36521. e = l,
  36522. l = null,
  36523. this.ptr = a,
  36524. a = null;
  36525. continue
  36526. }
  36527. l = null
  36528. } else if (o.isEnum(r))
  36529. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36530. r.values.forEach(function(e) {
  36531. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36532. }, this),
  36533. this.ptr.addChild(a);
  36534. else if (o.isService(r))
  36535. a = new n.Service(this,this.ptr,r.name,r.options),
  36536. Object.keys(r.rpc).forEach(function(e) {
  36537. var t = r.rpc[e];
  36538. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36539. }, this),
  36540. this.ptr.addChild(a);
  36541. else {
  36542. if (!o.isExtend(r))
  36543. throw Error("not a valid definition: " + JSON.stringify(r));
  36544. if (a = this.ptr.resolve(r.ref, !0))
  36545. r.fields.forEach(function(e) {
  36546. if (null !== a.getChild(0 | e.id))
  36547. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36548. if (a.extensions) {
  36549. var i = !1;
  36550. if (a.extensions.forEach(function(t) {
  36551. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36552. }),
  36553. !i)
  36554. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36555. }
  36556. var r = e.name;
  36557. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36558. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36559. , s = new n.Extension(this,this.ptr,e.name,o);
  36560. o.extension = s,
  36561. this.ptr.addChild(s),
  36562. a.addChild(o)
  36563. }, this);
  36564. else if (!/\.?google\.protobuf\./.test(r.ref))
  36565. throw Error("extended message " + r.ref + " is not defined")
  36566. }
  36567. r = null,
  36568. a = null
  36569. }
  36570. e = null,
  36571. this.ptr = this.ptr.parent
  36572. }
  36573. return this.resolved = !1,
  36574. this.result = null,
  36575. this
  36576. }
  36577. ,
  36578. a.import = function(i, n) {
  36579. var o = "/";
  36580. if ("string" == typeof n) {
  36581. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36582. this.files[n] === !0)
  36583. return this.reset();
  36584. this.files[n] = !0
  36585. } else if ("object" == typeof n) {
  36586. var a = n.root;
  36587. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36588. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36589. var s = a + o + n.file;
  36590. if (this.files[s] === !0)
  36591. return this.reset();
  36592. this.files[s] = !0
  36593. }
  36594. if (i.imports && i.imports.length > 0) {
  36595. var l, c = !1;
  36596. "object" == typeof n ? (this.importRoot = n.root,
  36597. c = !0,
  36598. l = this.importRoot,
  36599. n = n.file,
  36600. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36601. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36602. o = "\\") : l = "." : l = null;
  36603. for (var h = 0; h < i.imports.length; h++)
  36604. if ("string" == typeof i.imports[h]) {
  36605. if (!l)
  36606. throw Error("cannot determine import root");
  36607. var u = i.imports[h];
  36608. if ("google/protobuf/descriptor.proto" === u)
  36609. continue;
  36610. if (u = l + o + u,
  36611. this.files[u] === !0)
  36612. continue;
  36613. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36614. var d = t.Util.fetch(u);
  36615. if (null === d)
  36616. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36617. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36618. } else
  36619. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36620. return t + "_import" + h + "." + i
  36621. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36622. c && (this.importRoot = null)
  36623. }
  36624. i.package && this.define(i.package),
  36625. i.syntax && r(i);
  36626. var p = this.ptr;
  36627. return i.options && Object.keys(i.options).forEach(function(e) {
  36628. p.options[e] = i.options[e]
  36629. }),
  36630. i.messages && (this.create(i.messages),
  36631. this.ptr = p),
  36632. i.enums && (this.create(i.enums),
  36633. this.ptr = p),
  36634. i.services && (this.create(i.services),
  36635. this.ptr = p),
  36636. i.extends && this.create(i.extends),
  36637. this.reset()
  36638. }
  36639. ,
  36640. a.resolveAll = function() {
  36641. var e;
  36642. if (null == this.ptr || "object" == typeof this.ptr.type)
  36643. return this;
  36644. if (this.ptr instanceof n.Namespace)
  36645. this.ptr.children.forEach(function(e) {
  36646. this.ptr = e,
  36647. this.resolveAll()
  36648. }, this);
  36649. else if (this.ptr instanceof n.Message.Field) {
  36650. if (i.TYPE.test(this.ptr.type))
  36651. this.ptr.type = t.TYPES[this.ptr.type];
  36652. else {
  36653. if (!i.TYPEREF.test(this.ptr.type))
  36654. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36655. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36656. !e)
  36657. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36658. if (this.ptr.resolvedType = e,
  36659. e instanceof n.Enum) {
  36660. if (this.ptr.type = t.TYPES.enum,
  36661. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36662. throw Error("proto3 message cannot reference proto2 enum")
  36663. } else {
  36664. if (!(e instanceof n.Message))
  36665. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36666. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36667. }
  36668. }
  36669. if (this.ptr.map) {
  36670. if (!i.TYPE.test(this.ptr.keyType))
  36671. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36672. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36673. }
  36674. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36675. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36676. throw Error("illegal service type in " + this.ptr.toString(!0));
  36677. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36678. !(e && e instanceof t.Reflect.Message))
  36679. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36680. if (this.ptr.resolvedRequestType = e,
  36681. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36682. !(e && e instanceof t.Reflect.Message))
  36683. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36684. this.ptr.resolvedResponseType = e
  36685. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36686. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36687. return this.reset()
  36688. }
  36689. ,
  36690. a.build = function(e) {
  36691. if (this.reset(),
  36692. this.resolved || (this.resolveAll(),
  36693. this.resolved = !0,
  36694. this.result = null),
  36695. null === this.result && (this.result = this.ns.build()),
  36696. !e)
  36697. return this.result;
  36698. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36699. if (!i[t[n]]) {
  36700. i = null;
  36701. break
  36702. }
  36703. i = i[t[n]]
  36704. }
  36705. return i
  36706. }
  36707. ,
  36708. a.lookup = function(e, t) {
  36709. return e ? this.ns.resolve(e, t) : this.ns
  36710. }
  36711. ,
  36712. a.toString = function() {
  36713. return "Builder"
  36714. }
  36715. ,
  36716. o.Message = function() {}
  36717. ,
  36718. o.Enum = function() {}
  36719. ,
  36720. o.Service = function() {}
  36721. ,
  36722. o
  36723. }(r, r.Lang, r.Reflect),
  36724. r.Map = function(e, t) {
  36725. function i(e) {
  36726. var t = 0;
  36727. return {
  36728. next: function() {
  36729. return t < e.length ? {
  36730. done: !1,
  36731. value: e[t++]
  36732. } : {
  36733. done: !0
  36734. }
  36735. }
  36736. }
  36737. }
  36738. var n = function(e, i) {
  36739. if (!e.map)
  36740. throw Error("field is not a map");
  36741. if (this.field = e,
  36742. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36743. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36744. this.map = {},
  36745. Object.defineProperty(this, "size", {
  36746. get: function() {
  36747. return Object.keys(this.map).length
  36748. }
  36749. }),
  36750. i)
  36751. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36752. var o = this.keyElem.valueFromString(n[r])
  36753. , a = this.valueElem.verifyValue(i[n[r]]);
  36754. this.map[this.keyElem.valueToString(o)] = {
  36755. key: o,
  36756. value: a
  36757. }
  36758. }
  36759. }
  36760. , r = n.prototype;
  36761. return r.clear = function() {
  36762. this.map = {}
  36763. }
  36764. ,
  36765. r.delete = function(e) {
  36766. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36767. , i = t in this.map;
  36768. return delete this.map[t],
  36769. i
  36770. }
  36771. ,
  36772. r.entries = function() {
  36773. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36774. t.push([(e = this.map[n[r]]).key, e.value]);
  36775. return i(t)
  36776. }
  36777. ,
  36778. r.keys = function() {
  36779. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36780. e.push(this.map[t[n]].key);
  36781. return i(e)
  36782. }
  36783. ,
  36784. r.values = function() {
  36785. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36786. e.push(this.map[t[n]].value);
  36787. return i(e)
  36788. }
  36789. ,
  36790. r.forEach = function(e, t) {
  36791. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36792. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36793. }
  36794. ,
  36795. r.set = function(e, t) {
  36796. var i = this.keyElem.verifyValue(e)
  36797. , n = this.valueElem.verifyValue(t);
  36798. return this.map[this.keyElem.valueToString(i)] = {
  36799. key: i,
  36800. value: n
  36801. },
  36802. this
  36803. }
  36804. ,
  36805. r.get = function(e) {
  36806. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36807. if (t in this.map)
  36808. return this.map[t].value
  36809. }
  36810. ,
  36811. r.has = function(e) {
  36812. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36813. return t in this.map
  36814. }
  36815. ,
  36816. n
  36817. }(r, r.Reflect),
  36818. r.loadProto = function(e, t, i) {
  36819. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36820. t = void 0),
  36821. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36822. }
  36823. ,
  36824. r.protoFromString = r.loadProto,
  36825. r.loadProtoFile = function(e, t, i) {
  36826. if (t && "object" == typeof t ? (i = t,
  36827. t = null) : t && "function" == typeof t || (t = null),
  36828. t)
  36829. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36830. if (null === n)
  36831. return void t(Error("Failed to fetch file"));
  36832. try {
  36833. t(null, r.loadProto(n, i, e))
  36834. } catch (e) {
  36835. t(e)
  36836. }
  36837. });
  36838. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36839. return null === n ? null : r.loadProto(n, i, e)
  36840. }
  36841. ,
  36842. r.protoFromFile = r.loadProtoFile,
  36843. r.newBuilder = function(e) {
  36844. return e = e || {},
  36845. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36846. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36847. new r.Builder(e)
  36848. }
  36849. ,
  36850. r.loadJson = function(e, t, i) {
  36851. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36852. t = null),
  36853. t && "object" == typeof t || (t = r.newBuilder()),
  36854. "string" == typeof e && (e = JSON.parse(e)),
  36855. t.import(e, i),
  36856. t.resolveAll(),
  36857. t
  36858. }
  36859. ,
  36860. r.loadJsonFile = function(e, t, i) {
  36861. if (t && "object" == typeof t ? (i = t,
  36862. t = null) : t && "function" == typeof t || (t = null),
  36863. t)
  36864. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36865. if (null === n)
  36866. return void t(Error("Failed to fetch file"));
  36867. try {
  36868. t(null, r.loadJson(JSON.parse(n), i, e))
  36869. } catch (e) {
  36870. t(e)
  36871. }
  36872. });
  36873. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36874. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36875. }
  36876. ,
  36877. r
  36878. })
  36879. }
  36880. ).call(this, e("_process"))
  36881. }
  36882. , {
  36883. _process: 203,
  36884. bytebuffer: 215,
  36885. fs: 197,
  36886. path: 197
  36887. }],
  36888. 215: [function(e, t, i) {
  36889. !function(i, n) {
  36890. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36891. var t;
  36892. try {
  36893. t = e("long")
  36894. } catch (e) {}
  36895. return n(t)
  36896. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36897. }(this, function(e) {
  36898. "use strict";
  36899. function t(e) {
  36900. var t = 0;
  36901. return function() {
  36902. return t < e.length ? e.charCodeAt(t++) : null
  36903. }
  36904. }
  36905. function i() {
  36906. var e = []
  36907. , t = [];
  36908. return function() {
  36909. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36910. e.length = 0),
  36911. void Array.prototype.push.apply(e, arguments))
  36912. }
  36913. }
  36914. function n(e, t, i, n, r) {
  36915. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  36916. for (u += d,
  36917. o = p & (1 << -h) - 1,
  36918. p >>= -h,
  36919. h += s; h > 0; o = 256 * o + e[t + u],
  36920. u += d,
  36921. h -= 8)
  36922. ;
  36923. for (a = o & (1 << -h) - 1,
  36924. o >>= -h,
  36925. h += n; h > 0; a = 256 * a + e[t + u],
  36926. u += d,
  36927. h -= 8)
  36928. ;
  36929. if (0 === o)
  36930. o = 1 - c;
  36931. else {
  36932. if (o === l)
  36933. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36934. a += Math.pow(2, n),
  36935. o -= c
  36936. }
  36937. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36938. }
  36939. function r(e, t, i, n, r, o) {
  36940. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  36941. for (t = Math.abs(t),
  36942. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36943. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36944. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36945. l *= 2),
  36946. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36947. t * l >= 2 && (a++,
  36948. l /= 2),
  36949. a + u >= h ? (s = 0,
  36950. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36951. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36952. a = 0)); r >= 8; e[i + p] = 255 & s,
  36953. p += f,
  36954. s /= 256,
  36955. r -= 8)
  36956. ;
  36957. for (a = a << r | s,
  36958. c += r; c > 0; e[i + p] = 255 & a,
  36959. p += f,
  36960. a /= 256,
  36961. c -= 8)
  36962. ;
  36963. e[i + p - f] |= 128 * g
  36964. }
  36965. var o = function(e, t, i) {
  36966. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36967. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36968. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36969. !i) {
  36970. if (e |= 0,
  36971. e < 0)
  36972. throw RangeError("Illegal capacity");
  36973. t = !!t,
  36974. i = !!i
  36975. }
  36976. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36977. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36978. this.offset = 0,
  36979. this.markedOffset = -1,
  36980. this.limit = e,
  36981. this.littleEndian = t,
  36982. this.noAssert = i
  36983. };
  36984. o.VERSION = "5.0.1",
  36985. o.LITTLE_ENDIAN = !0,
  36986. o.BIG_ENDIAN = !1,
  36987. o.DEFAULT_CAPACITY = 16,
  36988. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36989. o.DEFAULT_NOASSERT = !1,
  36990. o.Long = e || null;
  36991. var a = o.prototype;
  36992. a.__isByteBuffer__,
  36993. Object.defineProperty(a, "__isByteBuffer__", {
  36994. value: !0,
  36995. enumerable: !1,
  36996. configurable: !1
  36997. });
  36998. var s = new ArrayBuffer(0)
  36999. , l = String.fromCharCode;
  37000. o.accessor = function() {
  37001. return Uint8Array
  37002. }
  37003. ,
  37004. o.allocate = function(e, t, i) {
  37005. return new o(e,t,i)
  37006. }
  37007. ,
  37008. o.concat = function(e, t, i, n) {
  37009. "boolean" != typeof t && "string" == typeof t || (n = i,
  37010. i = t,
  37011. t = void 0);
  37012. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37013. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37014. r = e[s].limit - e[s].offset,
  37015. r > 0 && (a += r);
  37016. if (0 === a)
  37017. return new o(0,i,n);
  37018. var c, h = new o(a,i,n);
  37019. for (s = 0; s < l; )
  37020. c = e[s++],
  37021. r = c.limit - c.offset,
  37022. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37023. h.offset += r);
  37024. return h.limit = h.offset,
  37025. h.offset = 0,
  37026. h
  37027. }
  37028. ,
  37029. o.isByteBuffer = function(e) {
  37030. return (e && e.__isByteBuffer__) === !0
  37031. }
  37032. ,
  37033. o.type = function() {
  37034. return ArrayBuffer
  37035. }
  37036. ,
  37037. o.wrap = function(e, t, i, n) {
  37038. if ("string" != typeof t && (n = i,
  37039. i = t,
  37040. t = void 0),
  37041. "string" == typeof e)
  37042. switch ("undefined" == typeof t && (t = "utf8"),
  37043. t) {
  37044. case "base64":
  37045. return o.fromBase64(e, i);
  37046. case "hex":
  37047. return o.fromHex(e, i);
  37048. case "binary":
  37049. return o.fromBinary(e, i);
  37050. case "utf8":
  37051. return o.fromUTF8(e, i);
  37052. case "debug":
  37053. return o.fromDebug(e, i);
  37054. default:
  37055. throw Error("Unsupported encoding: " + t)
  37056. }
  37057. if (null === e || "object" != typeof e)
  37058. throw TypeError("Illegal buffer");
  37059. var r;
  37060. if (o.isByteBuffer(e))
  37061. return r = a.clone.call(e),
  37062. r.markedOffset = -1,
  37063. r;
  37064. if (e instanceof Uint8Array)
  37065. r = new o(0,i,n),
  37066. e.length > 0 && (r.buffer = e.buffer,
  37067. r.offset = e.byteOffset,
  37068. r.limit = e.byteOffset + e.byteLength,
  37069. r.view = new Uint8Array(e.buffer));
  37070. else if (e instanceof ArrayBuffer)
  37071. r = new o(0,i,n),
  37072. e.byteLength > 0 && (r.buffer = e,
  37073. r.offset = 0,
  37074. r.limit = e.byteLength,
  37075. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37076. else {
  37077. if ("[object Array]" !== Object.prototype.toString.call(e))
  37078. throw TypeError("Illegal buffer");
  37079. r = new o(e.length,i,n),
  37080. r.limit = e.length;
  37081. for (var s = 0; s < e.length; ++s)
  37082. r.view[s] = e[s]
  37083. }
  37084. return r
  37085. }
  37086. ,
  37087. a.writeBitSet = function(e, t) {
  37088. var i = "undefined" == typeof t;
  37089. if (i && (t = this.offset),
  37090. !this.noAssert) {
  37091. if (!(e instanceof Array))
  37092. throw TypeError("Illegal BitSet: Not an array");
  37093. if ("number" != typeof t || t % 1 !== 0)
  37094. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37095. if (t >>>= 0,
  37096. t < 0 || t + 0 > this.buffer.byteLength)
  37097. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37098. }
  37099. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37100. for (t += this.writeVarint32(o, t); a--; )
  37101. n = 1 & !!e[s++] | (1 & !!e[s++]) << 1 | (1 & !!e[s++]) << 2 | (1 & !!e[s++]) << 3 | (1 & !!e[s++]) << 4 | (1 & !!e[s++]) << 5 | (1 & !!e[s++]) << 6 | (1 & !!e[s++]) << 7,
  37102. this.writeByte(n, t++);
  37103. if (s < o) {
  37104. var l = 0;
  37105. for (n = 0; s < o; )
  37106. n |= (1 & !!e[s++]) << l++;
  37107. this.writeByte(n, t++)
  37108. }
  37109. return i ? (this.offset = t,
  37110. this) : t - r
  37111. }
  37112. ,
  37113. a.readBitSet = function(e) {
  37114. var t = "undefined" == typeof e;
  37115. t && (e = this.offset);
  37116. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37117. for (e += n.length; o--; )
  37118. i = this.readByte(e++),
  37119. s[a++] = !!(1 & i),
  37120. s[a++] = !!(2 & i),
  37121. s[a++] = !!(4 & i),
  37122. s[a++] = !!(8 & i),
  37123. s[a++] = !!(16 & i),
  37124. s[a++] = !!(32 & i),
  37125. s[a++] = !!(64 & i),
  37126. s[a++] = !!(128 & i);
  37127. if (a < r) {
  37128. var l = 0;
  37129. for (i = this.readByte(e++); a < r; )
  37130. s[a++] = !!(i >> l++ & 1)
  37131. }
  37132. return t && (this.offset = e),
  37133. s
  37134. }
  37135. ,
  37136. a.readBytes = function(e, t) {
  37137. var i = "undefined" == typeof t;
  37138. if (i && (t = this.offset),
  37139. !this.noAssert) {
  37140. if ("number" != typeof t || t % 1 !== 0)
  37141. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37142. if (t >>>= 0,
  37143. t < 0 || t + e > this.buffer.byteLength)
  37144. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37145. }
  37146. var n = this.slice(t, t + e);
  37147. return i && (this.offset += e),
  37148. n
  37149. }
  37150. ,
  37151. a.writeBytes = a.append,
  37152. a.writeInt8 = function(e, t) {
  37153. var i = "undefined" == typeof t;
  37154. if (i && (t = this.offset),
  37155. !this.noAssert) {
  37156. if ("number" != typeof e || e % 1 !== 0)
  37157. throw TypeError("Illegal value: " + e + " (not an integer)");
  37158. if (e |= 0,
  37159. "number" != typeof t || t % 1 !== 0)
  37160. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37161. if (t >>>= 0,
  37162. t < 0 || t + 0 > this.buffer.byteLength)
  37163. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37164. }
  37165. t += 1;
  37166. var n = this.buffer.byteLength;
  37167. return t > n && this.resize((n *= 2) > t ? n : t),
  37168. t -= 1,
  37169. this.view[t] = e,
  37170. i && (this.offset += 1),
  37171. this
  37172. }
  37173. ,
  37174. a.writeByte = a.writeInt8,
  37175. a.readInt8 = function(e) {
  37176. var t = "undefined" == typeof e;
  37177. if (t && (e = this.offset),
  37178. !this.noAssert) {
  37179. if ("number" != typeof e || e % 1 !== 0)
  37180. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37181. if (e >>>= 0,
  37182. e < 0 || e + 1 > this.buffer.byteLength)
  37183. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37184. }
  37185. var i = this.view[e];
  37186. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37187. t && (this.offset += 1),
  37188. i
  37189. }
  37190. ,
  37191. a.readByte = a.readInt8,
  37192. a.writeUint8 = function(e, t) {
  37193. var i = "undefined" == typeof t;
  37194. if (i && (t = this.offset),
  37195. !this.noAssert) {
  37196. if ("number" != typeof e || e % 1 !== 0)
  37197. throw TypeError("Illegal value: " + e + " (not an integer)");
  37198. if (e >>>= 0,
  37199. "number" != typeof t || t % 1 !== 0)
  37200. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37201. if (t >>>= 0,
  37202. t < 0 || t + 0 > this.buffer.byteLength)
  37203. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37204. }
  37205. t += 1;
  37206. var n = this.buffer.byteLength;
  37207. return t > n && this.resize((n *= 2) > t ? n : t),
  37208. t -= 1,
  37209. this.view[t] = e,
  37210. i && (this.offset += 1),
  37211. this
  37212. }
  37213. ,
  37214. a.writeUInt8 = a.writeUint8,
  37215. a.readUint8 = function(e) {
  37216. var t = "undefined" == typeof e;
  37217. if (t && (e = this.offset),
  37218. !this.noAssert) {
  37219. if ("number" != typeof e || e % 1 !== 0)
  37220. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37221. if (e >>>= 0,
  37222. e < 0 || e + 1 > this.buffer.byteLength)
  37223. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37224. }
  37225. var i = this.view[e];
  37226. return t && (this.offset += 1),
  37227. i
  37228. }
  37229. ,
  37230. a.readUInt8 = a.readUint8,
  37231. a.writeInt16 = function(e, t) {
  37232. var i = "undefined" == typeof t;
  37233. if (i && (t = this.offset),
  37234. !this.noAssert) {
  37235. if ("number" != typeof e || e % 1 !== 0)
  37236. throw TypeError("Illegal value: " + e + " (not an integer)");
  37237. if (e |= 0,
  37238. "number" != typeof t || t % 1 !== 0)
  37239. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37240. if (t >>>= 0,
  37241. t < 0 || t + 0 > this.buffer.byteLength)
  37242. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37243. }
  37244. t += 2;
  37245. var n = this.buffer.byteLength;
  37246. return t > n && this.resize((n *= 2) > t ? n : t),
  37247. t -= 2,
  37248. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37249. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37250. this.view[t + 1] = 255 & e),
  37251. i && (this.offset += 2),
  37252. this
  37253. }
  37254. ,
  37255. a.writeShort = a.writeInt16,
  37256. a.readInt16 = function(e) {
  37257. var t = "undefined" == typeof e;
  37258. if (t && (e = this.offset),
  37259. !this.noAssert) {
  37260. if ("number" != typeof e || e % 1 !== 0)
  37261. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37262. if (e >>>= 0,
  37263. e < 0 || e + 2 > this.buffer.byteLength)
  37264. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37265. }
  37266. var i = 0;
  37267. return this.littleEndian ? (i = this.view[e],
  37268. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37269. i |= this.view[e + 1]),
  37270. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37271. t && (this.offset += 2),
  37272. i
  37273. }
  37274. ,
  37275. a.readShort = a.readInt16,
  37276. a.writeUint16 = function(e, t) {
  37277. var i = "undefined" == typeof t;
  37278. if (i && (t = this.offset),
  37279. !this.noAssert) {
  37280. if ("number" != typeof e || e % 1 !== 0)
  37281. throw TypeError("Illegal value: " + e + " (not an integer)");
  37282. if (e >>>= 0,
  37283. "number" != typeof t || t % 1 !== 0)
  37284. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37285. if (t >>>= 0,
  37286. t < 0 || t + 0 > this.buffer.byteLength)
  37287. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37288. }
  37289. t += 2;
  37290. var n = this.buffer.byteLength;
  37291. return t > n && this.resize((n *= 2) > t ? n : t),
  37292. t -= 2,
  37293. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37294. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37295. this.view[t + 1] = 255 & e),
  37296. i && (this.offset += 2),
  37297. this
  37298. }
  37299. ,
  37300. a.writeUInt16 = a.writeUint16,
  37301. a.readUint16 = function(e) {
  37302. var t = "undefined" == typeof e;
  37303. if (t && (e = this.offset),
  37304. !this.noAssert) {
  37305. if ("number" != typeof e || e % 1 !== 0)
  37306. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37307. if (e >>>= 0,
  37308. e < 0 || e + 2 > this.buffer.byteLength)
  37309. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37310. }
  37311. var i = 0;
  37312. return this.littleEndian ? (i = this.view[e],
  37313. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37314. i |= this.view[e + 1]),
  37315. t && (this.offset += 2),
  37316. i
  37317. }
  37318. ,
  37319. a.readUInt16 = a.readUint16,
  37320. a.writeInt32 = function(e, t) {
  37321. var i = "undefined" == typeof t;
  37322. if (i && (t = this.offset),
  37323. !this.noAssert) {
  37324. if ("number" != typeof e || e % 1 !== 0)
  37325. throw TypeError("Illegal value: " + e + " (not an integer)");
  37326. if (e |= 0,
  37327. "number" != typeof t || t % 1 !== 0)
  37328. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37329. if (t >>>= 0,
  37330. t < 0 || t + 0 > this.buffer.byteLength)
  37331. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37332. }
  37333. t += 4;
  37334. var n = this.buffer.byteLength;
  37335. return t > n && this.resize((n *= 2) > t ? n : t),
  37336. t -= 4,
  37337. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37338. this.view[t + 2] = e >>> 16 & 255,
  37339. this.view[t + 1] = e >>> 8 & 255,
  37340. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37341. this.view[t + 1] = e >>> 16 & 255,
  37342. this.view[t + 2] = e >>> 8 & 255,
  37343. this.view[t + 3] = 255 & e),
  37344. i && (this.offset += 4),
  37345. this
  37346. }
  37347. ,
  37348. a.writeInt = a.writeInt32,
  37349. a.readInt32 = function(e) {
  37350. var t = "undefined" == typeof e;
  37351. if (t && (e = this.offset),
  37352. !this.noAssert) {
  37353. if ("number" != typeof e || e % 1 !== 0)
  37354. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37355. if (e >>>= 0,
  37356. e < 0 || e + 4 > this.buffer.byteLength)
  37357. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37358. }
  37359. var i = 0;
  37360. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37361. i |= this.view[e + 1] << 8,
  37362. i |= this.view[e],
  37363. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37364. i |= this.view[e + 2] << 8,
  37365. i |= this.view[e + 3],
  37366. i += this.view[e] << 24 >>> 0),
  37367. i |= 0,
  37368. t && (this.offset += 4),
  37369. i
  37370. }
  37371. ,
  37372. a.readInt = a.readInt32,
  37373. a.writeUint32 = function(e, t) {
  37374. var i = "undefined" == typeof t;
  37375. if (i && (t = this.offset),
  37376. !this.noAssert) {
  37377. if ("number" != typeof e || e % 1 !== 0)
  37378. throw TypeError("Illegal value: " + e + " (not an integer)");
  37379. if (e >>>= 0,
  37380. "number" != typeof t || t % 1 !== 0)
  37381. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37382. if (t >>>= 0,
  37383. t < 0 || t + 0 > this.buffer.byteLength)
  37384. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37385. }
  37386. t += 4;
  37387. var n = this.buffer.byteLength;
  37388. return t > n && this.resize((n *= 2) > t ? n : t),
  37389. t -= 4,
  37390. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37391. this.view[t + 2] = e >>> 16 & 255,
  37392. this.view[t + 1] = e >>> 8 & 255,
  37393. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37394. this.view[t + 1] = e >>> 16 & 255,
  37395. this.view[t + 2] = e >>> 8 & 255,
  37396. this.view[t + 3] = 255 & e),
  37397. i && (this.offset += 4),
  37398. this
  37399. }
  37400. ,
  37401. a.writeUInt32 = a.writeUint32,
  37402. a.readUint32 = function(e) {
  37403. var t = "undefined" == typeof e;
  37404. if (t && (e = this.offset),
  37405. !this.noAssert) {
  37406. if ("number" != typeof e || e % 1 !== 0)
  37407. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37408. if (e >>>= 0,
  37409. e < 0 || e + 4 > this.buffer.byteLength)
  37410. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37411. }
  37412. var i = 0;
  37413. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37414. i |= this.view[e + 1] << 8,
  37415. i |= this.view[e],
  37416. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37417. i |= this.view[e + 2] << 8,
  37418. i |= this.view[e + 3],
  37419. i += this.view[e] << 24 >>> 0),
  37420. t && (this.offset += 4),
  37421. i
  37422. }
  37423. ,
  37424. a.readUInt32 = a.readUint32,
  37425. e && (a.writeInt64 = function(t, i) {
  37426. var n = "undefined" == typeof i;
  37427. if (n && (i = this.offset),
  37428. !this.noAssert) {
  37429. if ("number" == typeof t)
  37430. t = e.fromNumber(t);
  37431. else if ("string" == typeof t)
  37432. t = e.fromString(t);
  37433. else if (!(t && t instanceof e))
  37434. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37435. if ("number" != typeof i || i % 1 !== 0)
  37436. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37437. if (i >>>= 0,
  37438. i < 0 || i + 0 > this.buffer.byteLength)
  37439. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37440. }
  37441. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37442. i += 8;
  37443. var r = this.buffer.byteLength;
  37444. i > r && this.resize((r *= 2) > i ? r : i),
  37445. i -= 8;
  37446. var o = t.low
  37447. , a = t.high;
  37448. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37449. this.view[i + 2] = o >>> 16 & 255,
  37450. this.view[i + 1] = o >>> 8 & 255,
  37451. this.view[i] = 255 & o,
  37452. i += 4,
  37453. this.view[i + 3] = a >>> 24 & 255,
  37454. this.view[i + 2] = a >>> 16 & 255,
  37455. this.view[i + 1] = a >>> 8 & 255,
  37456. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37457. this.view[i + 1] = a >>> 16 & 255,
  37458. this.view[i + 2] = a >>> 8 & 255,
  37459. this.view[i + 3] = 255 & a,
  37460. i += 4,
  37461. this.view[i] = o >>> 24 & 255,
  37462. this.view[i + 1] = o >>> 16 & 255,
  37463. this.view[i + 2] = o >>> 8 & 255,
  37464. this.view[i + 3] = 255 & o),
  37465. n && (this.offset += 8),
  37466. this
  37467. }
  37468. ,
  37469. a.writeLong = a.writeInt64,
  37470. a.readInt64 = function(t) {
  37471. var i = "undefined" == typeof t;
  37472. if (i && (t = this.offset),
  37473. !this.noAssert) {
  37474. if ("number" != typeof t || t % 1 !== 0)
  37475. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37476. if (t >>>= 0,
  37477. t < 0 || t + 8 > this.buffer.byteLength)
  37478. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37479. }
  37480. var n = 0
  37481. , r = 0;
  37482. this.littleEndian ? (n = this.view[t + 2] << 16,
  37483. n |= this.view[t + 1] << 8,
  37484. n |= this.view[t],
  37485. n += this.view[t + 3] << 24 >>> 0,
  37486. t += 4,
  37487. r = this.view[t + 2] << 16,
  37488. r |= this.view[t + 1] << 8,
  37489. r |= this.view[t],
  37490. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37491. r |= this.view[t + 2] << 8,
  37492. r |= this.view[t + 3],
  37493. r += this.view[t] << 24 >>> 0,
  37494. t += 4,
  37495. n = this.view[t + 1] << 16,
  37496. n |= this.view[t + 2] << 8,
  37497. n |= this.view[t + 3],
  37498. n += this.view[t] << 24 >>> 0);
  37499. var o = new e(n,r,!1);
  37500. return i && (this.offset += 8),
  37501. o
  37502. }
  37503. ,
  37504. a.readLong = a.readInt64,
  37505. a.writeUint64 = function(t, i) {
  37506. var n = "undefined" == typeof i;
  37507. if (n && (i = this.offset),
  37508. !this.noAssert) {
  37509. if ("number" == typeof t)
  37510. t = e.fromNumber(t);
  37511. else if ("string" == typeof t)
  37512. t = e.fromString(t);
  37513. else if (!(t && t instanceof e))
  37514. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37515. if ("number" != typeof i || i % 1 !== 0)
  37516. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37517. if (i >>>= 0,
  37518. i < 0 || i + 0 > this.buffer.byteLength)
  37519. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37520. }
  37521. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37522. i += 8;
  37523. var r = this.buffer.byteLength;
  37524. i > r && this.resize((r *= 2) > i ? r : i),
  37525. i -= 8;
  37526. var o = t.low
  37527. , a = t.high;
  37528. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37529. this.view[i + 2] = o >>> 16 & 255,
  37530. this.view[i + 1] = o >>> 8 & 255,
  37531. this.view[i] = 255 & o,
  37532. i += 4,
  37533. this.view[i + 3] = a >>> 24 & 255,
  37534. this.view[i + 2] = a >>> 16 & 255,
  37535. this.view[i + 1] = a >>> 8 & 255,
  37536. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37537. this.view[i + 1] = a >>> 16 & 255,
  37538. this.view[i + 2] = a >>> 8 & 255,
  37539. this.view[i + 3] = 255 & a,
  37540. i += 4,
  37541. this.view[i] = o >>> 24 & 255,
  37542. this.view[i + 1] = o >>> 16 & 255,
  37543. this.view[i + 2] = o >>> 8 & 255,
  37544. this.view[i + 3] = 255 & o),
  37545. n && (this.offset += 8),
  37546. this
  37547. }
  37548. ,
  37549. a.writeUInt64 = a.writeUint64,
  37550. a.readUint64 = function(t) {
  37551. var i = "undefined" == typeof t;
  37552. if (i && (t = this.offset),
  37553. !this.noAssert) {
  37554. if ("number" != typeof t || t % 1 !== 0)
  37555. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37556. if (t >>>= 0,
  37557. t < 0 || t + 8 > this.buffer.byteLength)
  37558. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37559. }
  37560. var n = 0
  37561. , r = 0;
  37562. this.littleEndian ? (n = this.view[t + 2] << 16,
  37563. n |= this.view[t + 1] << 8,
  37564. n |= this.view[t],
  37565. n += this.view[t + 3] << 24 >>> 0,
  37566. t += 4,
  37567. r = this.view[t + 2] << 16,
  37568. r |= this.view[t + 1] << 8,
  37569. r |= this.view[t],
  37570. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37571. r |= this.view[t + 2] << 8,
  37572. r |= this.view[t + 3],
  37573. r += this.view[t] << 24 >>> 0,
  37574. t += 4,
  37575. n = this.view[t + 1] << 16,
  37576. n |= this.view[t + 2] << 8,
  37577. n |= this.view[t + 3],
  37578. n += this.view[t] << 24 >>> 0);
  37579. var o = new e(n,r,!0);
  37580. return i && (this.offset += 8),
  37581. o
  37582. }
  37583. ,
  37584. a.readUInt64 = a.readUint64),
  37585. a.writeFloat32 = function(e, t) {
  37586. var i = "undefined" == typeof t;
  37587. if (i && (t = this.offset),
  37588. !this.noAssert) {
  37589. if ("number" != typeof e)
  37590. throw TypeError("Illegal value: " + e + " (not a number)");
  37591. if ("number" != typeof t || t % 1 !== 0)
  37592. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37593. if (t >>>= 0,
  37594. t < 0 || t + 0 > this.buffer.byteLength)
  37595. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37596. }
  37597. t += 4;
  37598. var n = this.buffer.byteLength;
  37599. return t > n && this.resize((n *= 2) > t ? n : t),
  37600. t -= 4,
  37601. r(this.view, e, t, this.littleEndian, 23, 4),
  37602. i && (this.offset += 4),
  37603. this
  37604. }
  37605. ,
  37606. a.writeFloat = a.writeFloat32,
  37607. a.readFloat32 = function(e) {
  37608. var t = "undefined" == typeof e;
  37609. if (t && (e = this.offset),
  37610. !this.noAssert) {
  37611. if ("number" != typeof e || e % 1 !== 0)
  37612. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37613. if (e >>>= 0,
  37614. e < 0 || e + 4 > this.buffer.byteLength)
  37615. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37616. }
  37617. var i = n(this.view, e, this.littleEndian, 23, 4);
  37618. return t && (this.offset += 4),
  37619. i
  37620. }
  37621. ,
  37622. a.readFloat = a.readFloat32,
  37623. a.writeFloat64 = function(e, t) {
  37624. var i = "undefined" == typeof t;
  37625. if (i && (t = this.offset),
  37626. !this.noAssert) {
  37627. if ("number" != typeof e)
  37628. throw TypeError("Illegal value: " + e + " (not a number)");
  37629. if ("number" != typeof t || t % 1 !== 0)
  37630. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37631. if (t >>>= 0,
  37632. t < 0 || t + 0 > this.buffer.byteLength)
  37633. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37634. }
  37635. t += 8;
  37636. var n = this.buffer.byteLength;
  37637. return t > n && this.resize((n *= 2) > t ? n : t),
  37638. t -= 8,
  37639. r(this.view, e, t, this.littleEndian, 52, 8),
  37640. i && (this.offset += 8),
  37641. this
  37642. }
  37643. ,
  37644. a.writeDouble = a.writeFloat64,
  37645. a.readFloat64 = function(e) {
  37646. var t = "undefined" == typeof e;
  37647. if (t && (e = this.offset),
  37648. !this.noAssert) {
  37649. if ("number" != typeof e || e % 1 !== 0)
  37650. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37651. if (e >>>= 0,
  37652. e < 0 || e + 8 > this.buffer.byteLength)
  37653. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37654. }
  37655. var i = n(this.view, e, this.littleEndian, 52, 8);
  37656. return t && (this.offset += 8),
  37657. i
  37658. }
  37659. ,
  37660. a.readDouble = a.readFloat64,
  37661. o.MAX_VARINT32_BYTES = 5,
  37662. o.calculateVarint32 = function(e) {
  37663. return e >>>= 0,
  37664. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37665. }
  37666. ,
  37667. o.zigZagEncode32 = function(e) {
  37668. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37669. }
  37670. ,
  37671. o.zigZagDecode32 = function(e) {
  37672. return e >>> 1 ^ -(1 & e) | 0
  37673. }
  37674. ,
  37675. a.writeVarint32 = function(e, t) {
  37676. var i = "undefined" == typeof t;
  37677. if (i && (t = this.offset),
  37678. !this.noAssert) {
  37679. if ("number" != typeof e || e % 1 !== 0)
  37680. throw TypeError("Illegal value: " + e + " (not an integer)");
  37681. if (e |= 0,
  37682. "number" != typeof t || t % 1 !== 0)
  37683. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37684. if (t >>>= 0,
  37685. t < 0 || t + 0 > this.buffer.byteLength)
  37686. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37687. }
  37688. var n, r = o.calculateVarint32(e);
  37689. t += r;
  37690. var a = this.buffer.byteLength;
  37691. for (t > a && this.resize((a *= 2) > t ? a : t),
  37692. t -= r,
  37693. e >>>= 0; e >= 128; )
  37694. n = 127 & e | 128,
  37695. this.view[t++] = n,
  37696. e >>>= 7;
  37697. return this.view[t++] = e,
  37698. i ? (this.offset = t,
  37699. this) : r
  37700. }
  37701. ,
  37702. a.writeVarint32ZigZag = function(e, t) {
  37703. return this.writeVarint32(o.zigZagEncode32(e), t)
  37704. }
  37705. ,
  37706. a.readVarint32 = function(e) {
  37707. var t = "undefined" == typeof e;
  37708. if (t && (e = this.offset),
  37709. !this.noAssert) {
  37710. if ("number" != typeof e || e % 1 !== 0)
  37711. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37712. if (e >>>= 0,
  37713. e < 0 || e + 1 > this.buffer.byteLength)
  37714. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37715. }
  37716. var i, n = 0, r = 0;
  37717. do {
  37718. if (!this.noAssert && e > this.limit) {
  37719. var o = Error("Truncated");
  37720. throw o.truncated = !0,
  37721. o
  37722. }
  37723. i = this.view[e++],
  37724. n < 5 && (r |= (127 & i) << 7 * n),
  37725. ++n
  37726. } while (0 !== (128 & i));return r |= 0,
  37727. t ? (this.offset = e,
  37728. r) : {
  37729. value: r,
  37730. length: n
  37731. }
  37732. }
  37733. ,
  37734. a.readVarint32ZigZag = function(e) {
  37735. var t = this.readVarint32(e);
  37736. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37737. t
  37738. }
  37739. ,
  37740. e && (o.MAX_VARINT64_BYTES = 10,
  37741. o.calculateVarint64 = function(t) {
  37742. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37743. var i = t.toInt() >>> 0
  37744. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37745. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37746. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  37747. }
  37748. ,
  37749. o.zigZagEncode64 = function(t) {
  37750. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37751. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37752. }
  37753. ,
  37754. o.zigZagDecode64 = function(t) {
  37755. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37756. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37757. }
  37758. ,
  37759. a.writeVarint64 = function(t, i) {
  37760. var n = "undefined" == typeof i;
  37761. if (n && (i = this.offset),
  37762. !this.noAssert) {
  37763. if ("number" == typeof t)
  37764. t = e.fromNumber(t);
  37765. else if ("string" == typeof t)
  37766. t = e.fromString(t);
  37767. else if (!(t && t instanceof e))
  37768. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37769. if ("number" != typeof i || i % 1 !== 0)
  37770. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37771. if (i >>>= 0,
  37772. i < 0 || i + 0 > this.buffer.byteLength)
  37773. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37774. }
  37775. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37776. var r = o.calculateVarint64(t)
  37777. , a = t.toInt() >>> 0
  37778. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37779. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37780. i += r;
  37781. var c = this.buffer.byteLength;
  37782. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37783. i -= r,
  37784. r) {
  37785. case 10:
  37786. this.view[i + 9] = l >>> 7 & 1;
  37787. case 9:
  37788. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37789. case 8:
  37790. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37791. case 7:
  37792. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37793. case 6:
  37794. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37795. case 5:
  37796. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37797. case 4:
  37798. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37799. case 3:
  37800. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37801. case 2:
  37802. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37803. case 1:
  37804. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37805. }
  37806. return n ? (this.offset += r,
  37807. this) : r
  37808. }
  37809. ,
  37810. a.writeVarint64ZigZag = function(e, t) {
  37811. return this.writeVarint64(o.zigZagEncode64(e), t)
  37812. }
  37813. ,
  37814. a.readVarint64 = function(t) {
  37815. var i = "undefined" == typeof t;
  37816. if (i && (t = this.offset),
  37817. !this.noAssert) {
  37818. if ("number" != typeof t || t % 1 !== 0)
  37819. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37820. if (t >>>= 0,
  37821. t < 0 || t + 1 > this.buffer.byteLength)
  37822. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37823. }
  37824. var n = t
  37825. , r = 0
  37826. , o = 0
  37827. , a = 0
  37828. , s = 0;
  37829. if (s = this.view[t++],
  37830. r = 127 & s,
  37831. 128 & s && (s = this.view[t++],
  37832. r |= (127 & s) << 7,
  37833. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37834. r |= (127 & s) << 14,
  37835. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37836. r |= (127 & s) << 21,
  37837. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37838. o = 127 & s,
  37839. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37840. o |= (127 & s) << 7,
  37841. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37842. o |= (127 & s) << 14,
  37843. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37844. o |= (127 & s) << 21,
  37845. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37846. a = 127 & s,
  37847. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37848. a |= (127 & s) << 7,
  37849. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37850. throw Error("Buffer overrun");
  37851. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37852. return i ? (this.offset = t,
  37853. l) : {
  37854. value: l,
  37855. length: t - n
  37856. }
  37857. }
  37858. ,
  37859. a.readVarint64ZigZag = function(t) {
  37860. var i = this.readVarint64(t);
  37861. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37862. i
  37863. }
  37864. ),
  37865. a.writeCString = function(e, i) {
  37866. var n = "undefined" == typeof i;
  37867. n && (i = this.offset);
  37868. var r, o = e.length;
  37869. if (!this.noAssert) {
  37870. if ("string" != typeof e)
  37871. throw TypeError("Illegal str: Not a string");
  37872. for (r = 0; r < o; ++r)
  37873. if (0 === e.charCodeAt(r))
  37874. throw RangeError("Illegal str: Contains NULL-characters");
  37875. if ("number" != typeof i || i % 1 !== 0)
  37876. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37877. if (i >>>= 0,
  37878. i < 0 || i + 0 > this.buffer.byteLength)
  37879. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37880. }
  37881. o = h.calculateUTF16asUTF8(t(e))[1],
  37882. i += o + 1;
  37883. var a = this.buffer.byteLength;
  37884. return i > a && this.resize((a *= 2) > i ? a : i),
  37885. i -= o + 1,
  37886. h.encodeUTF16toUTF8(t(e), function(e) {
  37887. this.view[i++] = e
  37888. }
  37889. .bind(this)),
  37890. this.view[i++] = 0,
  37891. n ? (this.offset = i,
  37892. this) : o
  37893. }
  37894. ,
  37895. a.readCString = function(e) {
  37896. var t = "undefined" == typeof e;
  37897. if (t && (e = this.offset),
  37898. !this.noAssert) {
  37899. if ("number" != typeof e || e % 1 !== 0)
  37900. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37901. if (e >>>= 0,
  37902. e < 0 || e + 1 > this.buffer.byteLength)
  37903. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37904. }
  37905. var n, r = e, o = -1;
  37906. return h.decodeUTF8toUTF16(function() {
  37907. if (0 === o)
  37908. return null;
  37909. if (e >= this.limit)
  37910. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37911. return o = this.view[e++],
  37912. 0 === o ? null : o
  37913. }
  37914. .bind(this), n = i(), !0),
  37915. t ? (this.offset = e,
  37916. n()) : {
  37917. string: n(),
  37918. length: e - r
  37919. }
  37920. }
  37921. ,
  37922. a.writeIString = function(e, i) {
  37923. var n = "undefined" == typeof i;
  37924. if (n && (i = this.offset),
  37925. !this.noAssert) {
  37926. if ("string" != typeof e)
  37927. throw TypeError("Illegal str: Not a string");
  37928. if ("number" != typeof i || i % 1 !== 0)
  37929. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37930. if (i >>>= 0,
  37931. i < 0 || i + 0 > this.buffer.byteLength)
  37932. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37933. }
  37934. var r, o = i;
  37935. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37936. i += 4 + r;
  37937. var a = this.buffer.byteLength;
  37938. if (i > a && this.resize((a *= 2) > i ? a : i),
  37939. i -= 4 + r,
  37940. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37941. this.view[i + 2] = r >>> 16 & 255,
  37942. this.view[i + 1] = r >>> 8 & 255,
  37943. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37944. this.view[i + 1] = r >>> 16 & 255,
  37945. this.view[i + 2] = r >>> 8 & 255,
  37946. this.view[i + 3] = 255 & r),
  37947. i += 4,
  37948. h.encodeUTF16toUTF8(t(e), function(e) {
  37949. this.view[i++] = e
  37950. }
  37951. .bind(this)),
  37952. i !== o + 4 + r)
  37953. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37954. return n ? (this.offset = i,
  37955. this) : i - o
  37956. }
  37957. ,
  37958. a.readIString = function(e) {
  37959. var t = "undefined" == typeof e;
  37960. if (t && (e = this.offset),
  37961. !this.noAssert) {
  37962. if ("number" != typeof e || e % 1 !== 0)
  37963. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37964. if (e >>>= 0,
  37965. e < 0 || e + 4 > this.buffer.byteLength)
  37966. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37967. }
  37968. var i = e
  37969. , n = this.readUint32(e)
  37970. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37971. return e += r.length,
  37972. t ? (this.offset = e,
  37973. r.string) : {
  37974. string: r.string,
  37975. length: e - i
  37976. }
  37977. }
  37978. ,
  37979. o.METRICS_CHARS = "c",
  37980. o.METRICS_BYTES = "b",
  37981. a.writeUTF8String = function(e, i) {
  37982. var n = "undefined" == typeof i;
  37983. if (n && (i = this.offset),
  37984. !this.noAssert) {
  37985. if ("number" != typeof i || i % 1 !== 0)
  37986. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37987. if (i >>>= 0,
  37988. i < 0 || i + 0 > this.buffer.byteLength)
  37989. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37990. }
  37991. var r, o = i;
  37992. r = h.calculateUTF16asUTF8(t(e))[1],
  37993. i += r;
  37994. var a = this.buffer.byteLength;
  37995. return i > a && this.resize((a *= 2) > i ? a : i),
  37996. i -= r,
  37997. h.encodeUTF16toUTF8(t(e), function(e) {
  37998. this.view[i++] = e
  37999. }
  38000. .bind(this)),
  38001. n ? (this.offset = i,
  38002. this) : i - o
  38003. }
  38004. ,
  38005. a.writeString = a.writeUTF8String,
  38006. o.calculateUTF8Chars = function(e) {
  38007. return h.calculateUTF16asUTF8(t(e))[0]
  38008. }
  38009. ,
  38010. o.calculateUTF8Bytes = function(e) {
  38011. return h.calculateUTF16asUTF8(t(e))[1]
  38012. }
  38013. ,
  38014. o.calculateString = o.calculateUTF8Bytes,
  38015. a.readUTF8String = function(e, t, n) {
  38016. "number" == typeof t && (n = t,
  38017. t = void 0);
  38018. var r = "undefined" == typeof n;
  38019. if (r && (n = this.offset),
  38020. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38021. !this.noAssert) {
  38022. if ("number" != typeof e || e % 1 !== 0)
  38023. throw TypeError("Illegal length: " + e + " (not an integer)");
  38024. if (e |= 0,
  38025. "number" != typeof n || n % 1 !== 0)
  38026. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38027. if (n >>>= 0,
  38028. n < 0 || n + 0 > this.buffer.byteLength)
  38029. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38030. }
  38031. var a, s = 0, l = n;
  38032. if (t === o.METRICS_CHARS) {
  38033. if (a = i(),
  38034. h.decodeUTF8(function() {
  38035. return s < e && n < this.limit ? this.view[n++] : null
  38036. }
  38037. .bind(this), function(e) {
  38038. ++s,
  38039. h.UTF8toUTF16(e, a)
  38040. }),
  38041. s !== e)
  38042. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38043. return r ? (this.offset = n,
  38044. a()) : {
  38045. string: a(),
  38046. length: n - l
  38047. }
  38048. }
  38049. if (t === o.METRICS_BYTES) {
  38050. if (!this.noAssert) {
  38051. if ("number" != typeof n || n % 1 !== 0)
  38052. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38053. if (n >>>= 0,
  38054. n < 0 || n + e > this.buffer.byteLength)
  38055. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38056. }
  38057. var c = n + e;
  38058. if (h.decodeUTF8toUTF16(function() {
  38059. return n < c ? this.view[n++] : null
  38060. }
  38061. .bind(this), a = i(), this.noAssert),
  38062. n !== c)
  38063. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38064. return r ? (this.offset = n,
  38065. a()) : {
  38066. string: a(),
  38067. length: n - l
  38068. }
  38069. }
  38070. throw TypeError("Unsupported metrics: " + t)
  38071. }
  38072. ,
  38073. a.readString = a.readUTF8String,
  38074. a.writeVString = function(e, i) {
  38075. var n = "undefined" == typeof i;
  38076. if (n && (i = this.offset),
  38077. !this.noAssert) {
  38078. if ("string" != typeof e)
  38079. throw TypeError("Illegal str: Not a string");
  38080. if ("number" != typeof i || i % 1 !== 0)
  38081. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38082. if (i >>>= 0,
  38083. i < 0 || i + 0 > this.buffer.byteLength)
  38084. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38085. }
  38086. var r, a, s = i;
  38087. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38088. a = o.calculateVarint32(r),
  38089. i += a + r;
  38090. var l = this.buffer.byteLength;
  38091. if (i > l && this.resize((l *= 2) > i ? l : i),
  38092. i -= a + r,
  38093. i += this.writeVarint32(r, i),
  38094. h.encodeUTF16toUTF8(t(e), function(e) {
  38095. this.view[i++] = e
  38096. }
  38097. .bind(this)),
  38098. i !== s + r + a)
  38099. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38100. return n ? (this.offset = i,
  38101. this) : i - s
  38102. }
  38103. ,
  38104. a.readVString = function(e) {
  38105. var t = "undefined" == typeof e;
  38106. if (t && (e = this.offset),
  38107. !this.noAssert) {
  38108. if ("number" != typeof e || e % 1 !== 0)
  38109. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38110. if (e >>>= 0,
  38111. e < 0 || e + 1 > this.buffer.byteLength)
  38112. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38113. }
  38114. var i = e
  38115. , n = this.readVarint32(e)
  38116. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38117. return e += r.length,
  38118. t ? (this.offset = e,
  38119. r.string) : {
  38120. string: r.string,
  38121. length: e - i
  38122. }
  38123. }
  38124. ,
  38125. a.append = function(e, t, i) {
  38126. "number" != typeof t && "string" == typeof t || (i = t,
  38127. t = void 0);
  38128. var n = "undefined" == typeof i;
  38129. if (n && (i = this.offset),
  38130. !this.noAssert) {
  38131. if ("number" != typeof i || i % 1 !== 0)
  38132. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38133. if (i >>>= 0,
  38134. i < 0 || i + 0 > this.buffer.byteLength)
  38135. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38136. }
  38137. e instanceof o || (e = o.wrap(e, t));
  38138. var r = e.limit - e.offset;
  38139. if (r <= 0)
  38140. return this;
  38141. i += r;
  38142. var a = this.buffer.byteLength;
  38143. return i > a && this.resize((a *= 2) > i ? a : i),
  38144. i -= r,
  38145. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38146. e.offset += r,
  38147. n && (this.offset += r),
  38148. this
  38149. }
  38150. ,
  38151. a.appendTo = function(e, t) {
  38152. return e.append(this, t),
  38153. this
  38154. }
  38155. ,
  38156. a.assert = function(e) {
  38157. return this.noAssert = !e,
  38158. this
  38159. }
  38160. ,
  38161. a.capacity = function() {
  38162. return this.buffer.byteLength
  38163. }
  38164. ,
  38165. a.clear = function() {
  38166. return this.offset = 0,
  38167. this.limit = this.buffer.byteLength,
  38168. this.markedOffset = -1,
  38169. this
  38170. }
  38171. ,
  38172. a.clone = function(e) {
  38173. var t = new o(0,this.littleEndian,this.noAssert);
  38174. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38175. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38176. t.view = this.view),
  38177. t.offset = this.offset,
  38178. t.markedOffset = this.markedOffset,
  38179. t.limit = this.limit,
  38180. t
  38181. }
  38182. ,
  38183. a.compact = function(e, t) {
  38184. if ("undefined" == typeof e && (e = this.offset),
  38185. "undefined" == typeof t && (t = this.limit),
  38186. !this.noAssert) {
  38187. if ("number" != typeof e || e % 1 !== 0)
  38188. throw TypeError("Illegal begin: Not an integer");
  38189. if (e >>>= 0,
  38190. "number" != typeof t || t % 1 !== 0)
  38191. throw TypeError("Illegal end: Not an integer");
  38192. if (t >>>= 0,
  38193. e < 0 || e > t || t > this.buffer.byteLength)
  38194. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38195. }
  38196. if (0 === e && t === this.buffer.byteLength)
  38197. return this;
  38198. var i = t - e;
  38199. if (0 === i)
  38200. return this.buffer = s,
  38201. this.view = null,
  38202. this.markedOffset >= 0 && (this.markedOffset -= e),
  38203. this.offset = 0,
  38204. this.limit = 0,
  38205. this;
  38206. var n = new ArrayBuffer(i)
  38207. , r = new Uint8Array(n);
  38208. return r.set(this.view.subarray(e, t)),
  38209. this.buffer = n,
  38210. this.view = r,
  38211. this.markedOffset >= 0 && (this.markedOffset -= e),
  38212. this.offset = 0,
  38213. this.limit = i,
  38214. this
  38215. }
  38216. ,
  38217. a.copy = function(e, t) {
  38218. if ("undefined" == typeof e && (e = this.offset),
  38219. "undefined" == typeof t && (t = this.limit),
  38220. !this.noAssert) {
  38221. if ("number" != typeof e || e % 1 !== 0)
  38222. throw TypeError("Illegal begin: Not an integer");
  38223. if (e >>>= 0,
  38224. "number" != typeof t || t % 1 !== 0)
  38225. throw TypeError("Illegal end: Not an integer");
  38226. if (t >>>= 0,
  38227. e < 0 || e > t || t > this.buffer.byteLength)
  38228. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38229. }
  38230. if (e === t)
  38231. return new o(0,this.littleEndian,this.noAssert);
  38232. var i = t - e
  38233. , n = new o(i,this.littleEndian,this.noAssert);
  38234. return n.offset = 0,
  38235. n.limit = i,
  38236. n.markedOffset >= 0 && (n.markedOffset -= e),
  38237. this.copyTo(n, 0, e, t),
  38238. n
  38239. }
  38240. ,
  38241. a.copyTo = function(e, t, i, n) {
  38242. var r, a;
  38243. if (!this.noAssert && !o.isByteBuffer(e))
  38244. throw TypeError("Illegal target: Not a ByteBuffer");
  38245. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38246. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38247. n = "undefined" == typeof n ? this.limit : 0 | n,
  38248. t < 0 || t > e.buffer.byteLength)
  38249. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38250. if (i < 0 || n > this.buffer.byteLength)
  38251. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38252. var s = n - i;
  38253. return 0 === s ? e : (e.ensureCapacity(t + s),
  38254. e.view.set(this.view.subarray(i, n), t),
  38255. r && (this.offset += s),
  38256. a && (e.offset += s),
  38257. this)
  38258. }
  38259. ,
  38260. a.ensureCapacity = function(e) {
  38261. var t = this.buffer.byteLength;
  38262. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38263. }
  38264. ,
  38265. a.fill = function(e, t, i) {
  38266. var n = "undefined" == typeof t;
  38267. if (n && (t = this.offset),
  38268. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38269. "undefined" == typeof t && (t = this.offset),
  38270. "undefined" == typeof i && (i = this.limit),
  38271. !this.noAssert) {
  38272. if ("number" != typeof e || e % 1 !== 0)
  38273. throw TypeError("Illegal value: " + e + " (not an integer)");
  38274. if (e |= 0,
  38275. "number" != typeof t || t % 1 !== 0)
  38276. throw TypeError("Illegal begin: Not an integer");
  38277. if (t >>>= 0,
  38278. "number" != typeof i || i % 1 !== 0)
  38279. throw TypeError("Illegal end: Not an integer");
  38280. if (i >>>= 0,
  38281. t < 0 || t > i || i > this.buffer.byteLength)
  38282. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38283. }
  38284. if (t >= i)
  38285. return this;
  38286. for (; t < i; )
  38287. this.view[t++] = e;
  38288. return n && (this.offset = t),
  38289. this
  38290. }
  38291. ,
  38292. a.flip = function() {
  38293. return this.limit = this.offset,
  38294. this.offset = 0,
  38295. this
  38296. }
  38297. ,
  38298. a.mark = function(e) {
  38299. if (e = "undefined" == typeof e ? this.offset : e,
  38300. !this.noAssert) {
  38301. if ("number" != typeof e || e % 1 !== 0)
  38302. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38303. if (e >>>= 0,
  38304. e < 0 || e + 0 > this.buffer.byteLength)
  38305. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38306. }
  38307. return this.markedOffset = e,
  38308. this
  38309. }
  38310. ,
  38311. a.order = function(e) {
  38312. if (!this.noAssert && "boolean" != typeof e)
  38313. throw TypeError("Illegal littleEndian: Not a boolean");
  38314. return this.littleEndian = !!e,
  38315. this
  38316. }
  38317. ,
  38318. a.LE = function(e) {
  38319. return this.littleEndian = "undefined" == typeof e || !!e,
  38320. this
  38321. }
  38322. ,
  38323. a.BE = function(e) {
  38324. return this.littleEndian = "undefined" != typeof e && !e,
  38325. this
  38326. }
  38327. ,
  38328. a.prepend = function(e, t, i) {
  38329. "number" != typeof t && "string" == typeof t || (i = t,
  38330. t = void 0);
  38331. var n = "undefined" == typeof i;
  38332. if (n && (i = this.offset),
  38333. !this.noAssert) {
  38334. if ("number" != typeof i || i % 1 !== 0)
  38335. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38336. if (i >>>= 0,
  38337. i < 0 || i + 0 > this.buffer.byteLength)
  38338. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38339. }
  38340. e instanceof o || (e = o.wrap(e, t));
  38341. var r = e.limit - e.offset;
  38342. if (r <= 0)
  38343. return this;
  38344. var a = r - i;
  38345. if (a > 0) {
  38346. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38347. , l = new Uint8Array(s);
  38348. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38349. this.buffer = s,
  38350. this.view = l,
  38351. this.offset += a,
  38352. this.markedOffset >= 0 && (this.markedOffset += a),
  38353. this.limit += a,
  38354. i += a
  38355. } else {
  38356. new Uint8Array(this.buffer)
  38357. }
  38358. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38359. e.offset = e.limit,
  38360. n && (this.offset -= r),
  38361. this
  38362. }
  38363. ,
  38364. a.prependTo = function(e, t) {
  38365. return e.prepend(this, t),
  38366. this
  38367. }
  38368. ,
  38369. a.printDebug = function(e) {
  38370. "function" != typeof e && (e = console.log.bind(console)),
  38371. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38372. }
  38373. ,
  38374. a.remaining = function() {
  38375. return this.limit - this.offset
  38376. }
  38377. ,
  38378. a.reset = function() {
  38379. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38380. this.markedOffset = -1) : this.offset = 0,
  38381. this
  38382. }
  38383. ,
  38384. a.resize = function(e) {
  38385. if (!this.noAssert) {
  38386. if ("number" != typeof e || e % 1 !== 0)
  38387. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38388. if (e |= 0,
  38389. e < 0)
  38390. throw RangeError("Illegal capacity: 0 <= " + e)
  38391. }
  38392. if (this.buffer.byteLength < e) {
  38393. var t = new ArrayBuffer(e)
  38394. , i = new Uint8Array(t);
  38395. i.set(this.view),
  38396. this.buffer = t,
  38397. this.view = i
  38398. }
  38399. return this
  38400. }
  38401. ,
  38402. a.reverse = function(e, t) {
  38403. if ("undefined" == typeof e && (e = this.offset),
  38404. "undefined" == typeof t && (t = this.limit),
  38405. !this.noAssert) {
  38406. if ("number" != typeof e || e % 1 !== 0)
  38407. throw TypeError("Illegal begin: Not an integer");
  38408. if (e >>>= 0,
  38409. "number" != typeof t || t % 1 !== 0)
  38410. throw TypeError("Illegal end: Not an integer");
  38411. if (t >>>= 0,
  38412. e < 0 || e > t || t > this.buffer.byteLength)
  38413. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38414. }
  38415. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38416. this)
  38417. }
  38418. ,
  38419. a.skip = function(e) {
  38420. if (!this.noAssert) {
  38421. if ("number" != typeof e || e % 1 !== 0)
  38422. throw TypeError("Illegal length: " + e + " (not an integer)");
  38423. e |= 0
  38424. }
  38425. var t = this.offset + e;
  38426. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38427. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38428. return this.offset = t,
  38429. this
  38430. }
  38431. ,
  38432. a.slice = function(e, t) {
  38433. if ("undefined" == typeof e && (e = this.offset),
  38434. "undefined" == typeof t && (t = this.limit),
  38435. !this.noAssert) {
  38436. if ("number" != typeof e || e % 1 !== 0)
  38437. throw TypeError("Illegal begin: Not an integer");
  38438. if (e >>>= 0,
  38439. "number" != typeof t || t % 1 !== 0)
  38440. throw TypeError("Illegal end: Not an integer");
  38441. if (t >>>= 0,
  38442. e < 0 || e > t || t > this.buffer.byteLength)
  38443. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38444. }
  38445. var i = this.clone();
  38446. return i.offset = e,
  38447. i.limit = t,
  38448. i
  38449. }
  38450. ,
  38451. a.toBuffer = function(e) {
  38452. var t = this.offset
  38453. , i = this.limit;
  38454. if (!this.noAssert) {
  38455. if ("number" != typeof t || t % 1 !== 0)
  38456. throw TypeError("Illegal offset: Not an integer");
  38457. if (t >>>= 0,
  38458. "number" != typeof i || i % 1 !== 0)
  38459. throw TypeError("Illegal limit: Not an integer");
  38460. if (i >>>= 0,
  38461. t < 0 || t > i || i > this.buffer.byteLength)
  38462. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38463. }
  38464. if (!e && 0 === t && i === this.buffer.byteLength)
  38465. return this.buffer;
  38466. if (t === i)
  38467. return s;
  38468. var n = new ArrayBuffer(i - t);
  38469. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38470. n
  38471. }
  38472. ,
  38473. a.toArrayBuffer = a.toBuffer,
  38474. a.toString = function(e, t, i) {
  38475. if ("undefined" == typeof e)
  38476. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38477. switch ("number" == typeof e && (e = "utf8",
  38478. t = e,
  38479. i = t),
  38480. e) {
  38481. case "utf8":
  38482. return this.toUTF8(t, i);
  38483. case "base64":
  38484. return this.toBase64(t, i);
  38485. case "hex":
  38486. return this.toHex(t, i);
  38487. case "binary":
  38488. return this.toBinary(t, i);
  38489. case "debug":
  38490. return this.toDebug();
  38491. case "columns":
  38492. return this.toColumns();
  38493. default:
  38494. throw Error("Unsupported encoding: " + e)
  38495. }
  38496. }
  38497. ;
  38498. var c = function() {
  38499. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  38500. i[t[n]] = n;
  38501. return e.encode = function(e, i) {
  38502. for (var n, r; null !== (n = e()); )
  38503. i(t[n >> 2 & 63]),
  38504. r = (3 & n) << 4,
  38505. null !== (n = e()) ? (r |= n >> 4 & 15,
  38506. i(t[63 & (r | n >> 4 & 15)]),
  38507. r = (15 & n) << 2,
  38508. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38509. i(t[63 & n])) : (i(t[63 & r]),
  38510. i(61))) : (i(t[63 & r]),
  38511. i(61),
  38512. i(61))
  38513. }
  38514. ,
  38515. e.decode = function(e, t) {
  38516. function n(e) {
  38517. throw Error("Illegal character code: " + e)
  38518. }
  38519. for (var r, o, a; null !== (r = e()); )
  38520. if (o = i[r],
  38521. "undefined" == typeof o && n(r),
  38522. null !== (r = e()) && (a = i[r],
  38523. "undefined" == typeof a && n(r),
  38524. t(o << 2 >>> 0 | (48 & a) >> 4),
  38525. null !== (r = e()))) {
  38526. if (o = i[r],
  38527. "undefined" == typeof o) {
  38528. if (61 === r)
  38529. break;
  38530. n(r)
  38531. }
  38532. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38533. null !== (r = e())) {
  38534. if (a = i[r],
  38535. "undefined" == typeof a) {
  38536. if (61 === r)
  38537. break;
  38538. n(r)
  38539. }
  38540. t((3 & o) << 6 >>> 0 | a)
  38541. }
  38542. }
  38543. }
  38544. ,
  38545. e.test = function(e) {
  38546. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38547. }
  38548. ,
  38549. e
  38550. }();
  38551. a.toBase64 = function(e, t) {
  38552. if ("undefined" == typeof e && (e = this.offset),
  38553. "undefined" == typeof t && (t = this.limit),
  38554. e |= 0,
  38555. t |= 0,
  38556. e < 0 || t > this.capacity || e > t)
  38557. throw RangeError("begin, end");
  38558. var n;
  38559. return c.encode(function() {
  38560. return e < t ? this.view[e++] : null
  38561. }
  38562. .bind(this), n = i()),
  38563. n()
  38564. }
  38565. ,
  38566. o.fromBase64 = function(e, i) {
  38567. if ("string" != typeof e)
  38568. throw TypeError("str");
  38569. var n = new o(e.length / 4 * 3,i)
  38570. , r = 0;
  38571. return c.decode(t(e), function(e) {
  38572. n.view[r++] = e
  38573. }),
  38574. n.limit = r,
  38575. n
  38576. }
  38577. ,
  38578. o.btoa = function(e) {
  38579. return o.fromBinary(e).toBase64()
  38580. }
  38581. ,
  38582. o.atob = function(e) {
  38583. return o.fromBase64(e).toBinary()
  38584. }
  38585. ,
  38586. a.toBinary = function(e, t) {
  38587. if ("undefined" == typeof e && (e = this.offset),
  38588. "undefined" == typeof t && (t = this.limit),
  38589. e |= 0,
  38590. t |= 0,
  38591. e < 0 || t > this.capacity() || e > t)
  38592. throw RangeError("begin, end");
  38593. if (e === t)
  38594. return "";
  38595. for (var i = [], n = []; e < t; )
  38596. i.push(this.view[e++]),
  38597. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38598. i = []);
  38599. return n.join("") + String.fromCharCode.apply(String, i)
  38600. }
  38601. ,
  38602. o.fromBinary = function(e, t) {
  38603. if ("string" != typeof e)
  38604. throw TypeError("str");
  38605. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38606. if (i = e.charCodeAt(n),
  38607. i > 255)
  38608. throw RangeError("illegal char code: " + i);
  38609. a.view[n++] = i
  38610. }
  38611. return a.limit = r,
  38612. a
  38613. }
  38614. ,
  38615. a.toDebug = function(e) {
  38616. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38617. if (i !== -1 && (t = this.view[i],
  38618. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38619. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38620. ++i,
  38621. e && i > 0 && i % 16 === 0 && i !== n) {
  38622. for (; r.length < 51; )
  38623. r += " ";
  38624. a += r + o + "\n",
  38625. r = o = ""
  38626. }
  38627. r += i === this.offset && i === this.limit ? i === this.markedOffset ? "!" : "|" : i === this.offset ? i === this.markedOffset ? "[" : "<" : i === this.limit ? i === this.markedOffset ? "]" : ">" : i === this.markedOffset ? "'" : e || 0 !== i && i !== n ? " " : ""
  38628. }
  38629. if (e && " " !== r) {
  38630. for (; r.length < 51; )
  38631. r += " ";
  38632. a += r + o + "\n"
  38633. }
  38634. return e ? a : r
  38635. }
  38636. ,
  38637. o.fromDebug = function(e, t, i) {
  38638. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  38639. switch (n = e.charAt(l++)) {
  38640. case "!":
  38641. if (!i) {
  38642. if (u || d || p) {
  38643. f = !0;
  38644. break
  38645. }
  38646. u = d = p = !0
  38647. }
  38648. s.offset = s.markedOffset = s.limit = c,
  38649. h = !1;
  38650. break;
  38651. case "|":
  38652. if (!i) {
  38653. if (u || p) {
  38654. f = !0;
  38655. break
  38656. }
  38657. u = p = !0
  38658. }
  38659. s.offset = s.limit = c,
  38660. h = !1;
  38661. break;
  38662. case "[":
  38663. if (!i) {
  38664. if (u || d) {
  38665. f = !0;
  38666. break
  38667. }
  38668. u = d = !0
  38669. }
  38670. s.offset = s.markedOffset = c,
  38671. h = !1;
  38672. break;
  38673. case "<":
  38674. if (!i) {
  38675. if (u) {
  38676. f = !0;
  38677. break
  38678. }
  38679. u = !0
  38680. }
  38681. s.offset = c,
  38682. h = !1;
  38683. break;
  38684. case "]":
  38685. if (!i) {
  38686. if (p || d) {
  38687. f = !0;
  38688. break
  38689. }
  38690. p = d = !0
  38691. }
  38692. s.limit = s.markedOffset = c,
  38693. h = !1;
  38694. break;
  38695. case ">":
  38696. if (!i) {
  38697. if (p) {
  38698. f = !0;
  38699. break
  38700. }
  38701. p = !0
  38702. }
  38703. s.limit = c,
  38704. h = !1;
  38705. break;
  38706. case "'":
  38707. if (!i) {
  38708. if (d) {
  38709. f = !0;
  38710. break
  38711. }
  38712. d = !0
  38713. }
  38714. s.markedOffset = c,
  38715. h = !1;
  38716. break;
  38717. case " ":
  38718. h = !1;
  38719. break;
  38720. default:
  38721. if (!i && h) {
  38722. f = !0;
  38723. break
  38724. }
  38725. if (r = parseInt(n + e.charAt(l++), 16),
  38726. !i && (isNaN(r) || r < 0 || r > 255))
  38727. throw TypeError("Illegal str: Not a debug encoded string");
  38728. s.view[c++] = r,
  38729. h = !0
  38730. }
  38731. if (f)
  38732. throw TypeError("Illegal str: Invalid symbol at " + l)
  38733. }
  38734. if (!i) {
  38735. if (!u || !p)
  38736. throw TypeError("Illegal str: Missing offset or limit");
  38737. if (c < s.buffer.byteLength)
  38738. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38739. }
  38740. return s
  38741. }
  38742. ,
  38743. a.toHex = function(e, t) {
  38744. if (e = "undefined" == typeof e ? this.offset : e,
  38745. t = "undefined" == typeof t ? this.limit : t,
  38746. !this.noAssert) {
  38747. if ("number" != typeof e || e % 1 !== 0)
  38748. throw TypeError("Illegal begin: Not an integer");
  38749. if (e >>>= 0,
  38750. "number" != typeof t || t % 1 !== 0)
  38751. throw TypeError("Illegal end: Not an integer");
  38752. if (t >>>= 0,
  38753. e < 0 || e > t || t > this.buffer.byteLength)
  38754. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38755. }
  38756. for (var i, n = new Array(t - e); e < t; )
  38757. i = this.view[e++],
  38758. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38759. return n.join("")
  38760. }
  38761. ,
  38762. o.fromHex = function(e, t, i) {
  38763. if (!i) {
  38764. if ("string" != typeof e)
  38765. throw TypeError("Illegal str: Not a string");
  38766. if (e.length % 2 !== 0)
  38767. throw TypeError("Illegal str: Length not a multiple of 2")
  38768. }
  38769. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38770. if (n = parseInt(e.substring(s, s + 2), 16),
  38771. !i && (!isFinite(n) || n < 0 || n > 255))
  38772. throw TypeError("Illegal str: Contains non-hex characters");
  38773. a.view[l++] = n
  38774. }
  38775. return a.limit = l,
  38776. a
  38777. }
  38778. ;
  38779. var h = function() {
  38780. var e = {};
  38781. return e.MAX_CODEPOINT = 1114111,
  38782. e.encodeUTF8 = function(e, t) {
  38783. var i = null;
  38784. for ("number" == typeof e && (i = e,
  38785. e = function() {
  38786. return null
  38787. }
  38788. ); null !== i || null !== (i = e()); )
  38789. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38790. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38791. t(i >> 6 & 63 | 128),
  38792. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38793. t(i >> 12 & 63 | 128),
  38794. t(i >> 6 & 63 | 128),
  38795. t(63 & i | 128)),
  38796. i = null
  38797. }
  38798. ,
  38799. e.decodeUTF8 = function(e, t) {
  38800. for (var i, n, r, o, a = function(e) {
  38801. e = e.slice(0, e.indexOf(null));
  38802. var t = Error(e.toString());
  38803. throw t.name = "TruncatedError",
  38804. t.bytes = e,
  38805. t
  38806. }; null !== (i = e()); )
  38807. if (0 === (128 & i))
  38808. t(i);
  38809. else if (192 === (224 & i))
  38810. null === (n = e()) && a([i, n]),
  38811. t((31 & i) << 6 | 63 & n);
  38812. else if (224 === (240 & i))
  38813. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38814. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38815. else {
  38816. if (240 !== (248 & i))
  38817. throw RangeError("Illegal starting byte: " + i);
  38818. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38819. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38820. }
  38821. }
  38822. ,
  38823. e.UTF16toUTF8 = function(e, t) {
  38824. for (var i, n = null; ; ) {
  38825. if (null === (i = null !== n ? n : e()))
  38826. break;
  38827. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38828. n = null) : t(i)
  38829. }
  38830. null !== n && t(n)
  38831. }
  38832. ,
  38833. e.UTF8toUTF16 = function(e, t) {
  38834. var i = null;
  38835. for ("number" == typeof e && (i = e,
  38836. e = function() {
  38837. return null
  38838. }
  38839. ); null !== i || null !== (i = e()); )
  38840. i <= 65535 ? t(i) : (i -= 65536,
  38841. t((i >> 10) + 55296),
  38842. t(i % 1024 + 56320)),
  38843. i = null
  38844. }
  38845. ,
  38846. e.encodeUTF16toUTF8 = function(t, i) {
  38847. e.UTF16toUTF8(t, function(t) {
  38848. e.encodeUTF8(t, i)
  38849. })
  38850. }
  38851. ,
  38852. e.decodeUTF8toUTF16 = function(t, i) {
  38853. e.decodeUTF8(t, function(t) {
  38854. e.UTF8toUTF16(t, i)
  38855. })
  38856. }
  38857. ,
  38858. e.calculateCodePoint = function(e) {
  38859. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38860. }
  38861. ,
  38862. e.calculateUTF8 = function(e) {
  38863. for (var t, i = 0; null !== (t = e()); )
  38864. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38865. return i
  38866. }
  38867. ,
  38868. e.calculateUTF16asUTF8 = function(t) {
  38869. var i = 0
  38870. , n = 0;
  38871. return e.UTF16toUTF8(t, function(e) {
  38872. ++i,
  38873. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38874. }),
  38875. [i, n]
  38876. }
  38877. ,
  38878. e
  38879. }();
  38880. return a.toUTF8 = function(e, t) {
  38881. if ("undefined" == typeof e && (e = this.offset),
  38882. "undefined" == typeof t && (t = this.limit),
  38883. !this.noAssert) {
  38884. if ("number" != typeof e || e % 1 !== 0)
  38885. throw TypeError("Illegal begin: Not an integer");
  38886. if (e >>>= 0,
  38887. "number" != typeof t || t % 1 !== 0)
  38888. throw TypeError("Illegal end: Not an integer");
  38889. if (t >>>= 0,
  38890. e < 0 || e > t || t > this.buffer.byteLength)
  38891. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38892. }
  38893. var n;
  38894. try {
  38895. h.decodeUTF8toUTF16(function() {
  38896. return e < t ? this.view[e++] : null
  38897. }
  38898. .bind(this), n = i())
  38899. } catch (i) {
  38900. if (e !== t)
  38901. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38902. }
  38903. return n()
  38904. }
  38905. ,
  38906. o.fromUTF8 = function(e, i, n) {
  38907. if (!n && "string" != typeof e)
  38908. throw TypeError("Illegal str: Not a string");
  38909. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38910. , a = 0;
  38911. return h.encodeUTF16toUTF8(t(e), function(e) {
  38912. r.view[a++] = e
  38913. }),
  38914. r.limit = a,
  38915. r
  38916. }
  38917. ,
  38918. o
  38919. })
  38920. }
  38921. , {
  38922. long: 216
  38923. }],
  38924. 216: [function(e, t, i) {
  38925. !function(i, n) {
  38926. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  38927. }(this, function() {
  38928. "use strict";
  38929. function e(e, t, i) {
  38930. this.low = 0 | e,
  38931. this.high = 0 | t,
  38932. this.unsigned = !!i
  38933. }
  38934. function t(e) {
  38935. return (e && e.__isLong__) === !0
  38936. }
  38937. function i(e, t) {
  38938. var i, n, o;
  38939. return t ? (e >>>= 0,
  38940. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38941. o && (l[e] = i),
  38942. i)) : (e |= 0,
  38943. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38944. o && (s[e] = i),
  38945. i))
  38946. }
  38947. function n(e, t) {
  38948. if (isNaN(e) || !isFinite(e))
  38949. return t ? m : g;
  38950. if (t) {
  38951. if (e < 0)
  38952. return m;
  38953. if (e >= d)
  38954. return I
  38955. } else {
  38956. if (e <= -p)
  38957. return E;
  38958. if (e + 1 >= p)
  38959. return C
  38960. }
  38961. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38962. }
  38963. function r(t, i, n) {
  38964. return new e(t,i,n)
  38965. }
  38966. function o(e, t, i) {
  38967. if (0 === e.length)
  38968. throw Error("empty string");
  38969. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38970. return g;
  38971. if ("number" == typeof t ? (i = t,
  38972. t = !1) : t = !!t,
  38973. i = i || 10,
  38974. i < 2 || 36 < i)
  38975. throw RangeError("radix");
  38976. var r;
  38977. if ((r = e.indexOf("-")) > 0)
  38978. throw Error("interior hyphen");
  38979. if (0 === r)
  38980. return o(e.substring(1), t, i).neg();
  38981. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38982. var h = Math.min(8, e.length - l)
  38983. , u = parseInt(e.substring(l, l + h), i);
  38984. if (h < 8) {
  38985. var d = n(c(i, h));
  38986. s = s.mul(d).add(n(u))
  38987. } else
  38988. s = s.mul(a),
  38989. s = s.add(n(u))
  38990. }
  38991. return s.unsigned = t,
  38992. s
  38993. }
  38994. function a(t) {
  38995. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38996. }
  38997. e.prototype.__isLong__,
  38998. Object.defineProperty(e.prototype, "__isLong__", {
  38999. value: !0,
  39000. enumerable: !1,
  39001. configurable: !1
  39002. }),
  39003. e.isLong = t;
  39004. var s = {}
  39005. , l = {};
  39006. e.fromInt = i,
  39007. e.fromNumber = n,
  39008. e.fromBits = r;
  39009. var c = Math.pow;
  39010. e.fromString = o,
  39011. e.fromValue = a;
  39012. var h = 1 << 24
  39013. , u = 4294967296
  39014. , d = 0x10000000000000000
  39015. , p = d / 2
  39016. , f = i(h)
  39017. , g = i(0);
  39018. e.ZERO = g;
  39019. var m = i(0, !0);
  39020. e.UZERO = m;
  39021. var v = i(1);
  39022. e.ONE = v;
  39023. var A = i(1, !0);
  39024. e.UONE = A;
  39025. var y = i(-1);
  39026. e.NEG_ONE = y;
  39027. var C = r(-1, 2147483647, !1);
  39028. e.MAX_VALUE = C;
  39029. var I = r(-1, -1, !0);
  39030. e.MAX_UNSIGNED_VALUE = I;
  39031. var E = r(0, -2147483648, !1);
  39032. e.MIN_VALUE = E;
  39033. var b = e.prototype;
  39034. return b.toInt = function() {
  39035. return this.unsigned ? this.low >>> 0 : this.low
  39036. }
  39037. ,
  39038. b.toNumber = function() {
  39039. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39040. }
  39041. ,
  39042. b.toString = function(e) {
  39043. if (e = e || 10,
  39044. e < 2 || 36 < e)
  39045. throw RangeError("radix");
  39046. if (this.isZero())
  39047. return "0";
  39048. if (this.isNegative()) {
  39049. if (this.eq(E)) {
  39050. var t = n(e)
  39051. , i = this.div(t)
  39052. , r = i.mul(t).sub(this);
  39053. return i.toString(e) + r.toInt().toString(e)
  39054. }
  39055. return "-" + this.neg().toString(e)
  39056. }
  39057. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39058. var l = a.div(o)
  39059. , h = a.sub(l.mul(o)).toInt() >>> 0
  39060. , u = h.toString(e);
  39061. if (a = l,
  39062. a.isZero())
  39063. return u + s;
  39064. for (; u.length < 6; )
  39065. u = "0" + u;
  39066. s = "" + u + s
  39067. }
  39068. }
  39069. ,
  39070. b.getHighBits = function() {
  39071. return this.high
  39072. }
  39073. ,
  39074. b.getHighBitsUnsigned = function() {
  39075. return this.high >>> 0
  39076. }
  39077. ,
  39078. b.getLowBits = function() {
  39079. return this.low
  39080. }
  39081. ,
  39082. b.getLowBitsUnsigned = function() {
  39083. return this.low >>> 0
  39084. }
  39085. ,
  39086. b.getNumBitsAbs = function() {
  39087. if (this.isNegative())
  39088. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39089. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39090. ;
  39091. return 0 != this.high ? t + 33 : t + 1
  39092. }
  39093. ,
  39094. b.isZero = function() {
  39095. return 0 === this.high && 0 === this.low
  39096. }
  39097. ,
  39098. b.isNegative = function() {
  39099. return !this.unsigned && this.high < 0
  39100. }
  39101. ,
  39102. b.isPositive = function() {
  39103. return this.unsigned || this.high >= 0
  39104. }
  39105. ,
  39106. b.isOdd = function() {
  39107. return 1 === (1 & this.low)
  39108. }
  39109. ,
  39110. b.isEven = function() {
  39111. return 0 === (1 & this.low)
  39112. }
  39113. ,
  39114. b.equals = function(e) {
  39115. return t(e) || (e = a(e)),
  39116. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39117. }
  39118. ,
  39119. b.eq = b.equals,
  39120. b.notEquals = function(e) {
  39121. return !this.eq(e)
  39122. }
  39123. ,
  39124. b.neq = b.notEquals,
  39125. b.lessThan = function(e) {
  39126. return this.comp(e) < 0
  39127. }
  39128. ,
  39129. b.lt = b.lessThan,
  39130. b.lessThanOrEqual = function(e) {
  39131. return this.comp(e) <= 0
  39132. }
  39133. ,
  39134. b.lte = b.lessThanOrEqual,
  39135. b.greaterThan = function(e) {
  39136. return this.comp(e) > 0
  39137. }
  39138. ,
  39139. b.gt = b.greaterThan,
  39140. b.greaterThanOrEqual = function(e) {
  39141. return this.comp(e) >= 0
  39142. }
  39143. ,
  39144. b.gte = b.greaterThanOrEqual,
  39145. b.compare = function(e) {
  39146. if (t(e) || (e = a(e)),
  39147. this.eq(e))
  39148. return 0;
  39149. var i = this.isNegative()
  39150. , n = e.isNegative();
  39151. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  39152. }
  39153. ,
  39154. b.comp = b.compare,
  39155. b.negate = function() {
  39156. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39157. }
  39158. ,
  39159. b.neg = b.negate,
  39160. b.add = function(e) {
  39161. t(e) || (e = a(e));
  39162. var i = this.high >>> 16
  39163. , n = 65535 & this.high
  39164. , o = this.low >>> 16
  39165. , s = 65535 & this.low
  39166. , l = e.high >>> 16
  39167. , c = 65535 & e.high
  39168. , h = e.low >>> 16
  39169. , u = 65535 & e.low
  39170. , d = 0
  39171. , p = 0
  39172. , f = 0
  39173. , g = 0;
  39174. return g += s + u,
  39175. f += g >>> 16,
  39176. g &= 65535,
  39177. f += o + h,
  39178. p += f >>> 16,
  39179. f &= 65535,
  39180. p += n + c,
  39181. d += p >>> 16,
  39182. p &= 65535,
  39183. d += i + l,
  39184. d &= 65535,
  39185. r(f << 16 | g, d << 16 | p, this.unsigned)
  39186. }
  39187. ,
  39188. b.subtract = function(e) {
  39189. return t(e) || (e = a(e)),
  39190. this.add(e.neg())
  39191. }
  39192. ,
  39193. b.sub = b.subtract,
  39194. b.multiply = function(e) {
  39195. if (this.isZero())
  39196. return g;
  39197. if (t(e) || (e = a(e)),
  39198. e.isZero())
  39199. return g;
  39200. if (this.eq(E))
  39201. return e.isOdd() ? E : g;
  39202. if (e.eq(E))
  39203. return this.isOdd() ? E : g;
  39204. if (this.isNegative())
  39205. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39206. if (e.isNegative())
  39207. return this.mul(e.neg()).neg();
  39208. if (this.lt(f) && e.lt(f))
  39209. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39210. var i = this.high >>> 16
  39211. , o = 65535 & this.high
  39212. , s = this.low >>> 16
  39213. , l = 65535 & this.low
  39214. , c = e.high >>> 16
  39215. , h = 65535 & e.high
  39216. , u = e.low >>> 16
  39217. , d = 65535 & e.low
  39218. , p = 0
  39219. , m = 0
  39220. , v = 0
  39221. , A = 0;
  39222. return A += l * d,
  39223. v += A >>> 16,
  39224. A &= 65535,
  39225. v += s * d,
  39226. m += v >>> 16,
  39227. v &= 65535,
  39228. v += l * u,
  39229. m += v >>> 16,
  39230. v &= 65535,
  39231. m += o * d,
  39232. p += m >>> 16,
  39233. m &= 65535,
  39234. m += s * u,
  39235. p += m >>> 16,
  39236. m &= 65535,
  39237. m += l * h,
  39238. p += m >>> 16,
  39239. m &= 65535,
  39240. p += i * d + o * u + s * h + l * c,
  39241. p &= 65535,
  39242. r(v << 16 | A, p << 16 | m, this.unsigned)
  39243. }
  39244. ,
  39245. b.mul = b.multiply,
  39246. b.divide = function(e) {
  39247. if (t(e) || (e = a(e)),
  39248. e.isZero())
  39249. throw Error("division by zero");
  39250. if (this.isZero())
  39251. return this.unsigned ? m : g;
  39252. var i, r, o;
  39253. if (this.unsigned) {
  39254. if (e.unsigned || (e = e.toUnsigned()),
  39255. e.gt(this))
  39256. return m;
  39257. if (e.gt(this.shru(1)))
  39258. return A;
  39259. o = m
  39260. } else {
  39261. if (this.eq(E)) {
  39262. if (e.eq(v) || e.eq(y))
  39263. return E;
  39264. if (e.eq(E))
  39265. return v;
  39266. var s = this.shr(1);
  39267. return i = s.div(e).shl(1),
  39268. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39269. o = i.add(r.div(e)))
  39270. }
  39271. if (e.eq(E))
  39272. return this.unsigned ? m : g;
  39273. if (this.isNegative())
  39274. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39275. if (e.isNegative())
  39276. return this.div(e.neg()).neg();
  39277. o = g
  39278. }
  39279. for (r = this; r.gte(e); ) {
  39280. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39281. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  39282. i -= h,
  39283. u = n(i, this.unsigned),
  39284. d = u.mul(e);
  39285. u.isZero() && (u = v),
  39286. o = o.add(u),
  39287. r = r.sub(d)
  39288. }
  39289. return o
  39290. }
  39291. ,
  39292. b.div = b.divide,
  39293. b.modulo = function(e) {
  39294. return t(e) || (e = a(e)),
  39295. this.sub(this.div(e).mul(e))
  39296. }
  39297. ,
  39298. b.mod = b.modulo,
  39299. b.not = function() {
  39300. return r(~this.low, ~this.high, this.unsigned)
  39301. }
  39302. ,
  39303. b.and = function(e) {
  39304. return t(e) || (e = a(e)),
  39305. r(this.low & e.low, this.high & e.high, this.unsigned)
  39306. }
  39307. ,
  39308. b.or = function(e) {
  39309. return t(e) || (e = a(e)),
  39310. r(this.low | e.low, this.high | e.high, this.unsigned)
  39311. }
  39312. ,
  39313. b.xor = function(e) {
  39314. return t(e) || (e = a(e)),
  39315. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39316. }
  39317. ,
  39318. b.shiftLeft = function(e) {
  39319. return t(e) && (e = e.toInt()),
  39320. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  39321. }
  39322. ,
  39323. b.shl = b.shiftLeft,
  39324. b.shiftRight = function(e) {
  39325. return t(e) && (e = e.toInt()),
  39326. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  39327. }
  39328. ,
  39329. b.shr = b.shiftRight,
  39330. b.shiftRightUnsigned = function(e) {
  39331. if (t(e) && (e = e.toInt()),
  39332. e &= 63,
  39333. 0 === e)
  39334. return this;
  39335. var i = this.high;
  39336. if (e < 32) {
  39337. var n = this.low;
  39338. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39339. }
  39340. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39341. }
  39342. ,
  39343. b.shru = b.shiftRightUnsigned,
  39344. b.toSigned = function() {
  39345. return this.unsigned ? r(this.low, this.high, !1) : this
  39346. }
  39347. ,
  39348. b.toUnsigned = function() {
  39349. return this.unsigned ? this : r(this.low, this.high, !0)
  39350. }
  39351. ,
  39352. b.toBytes = function(e) {
  39353. return e ? this.toBytesLE() : this.toBytesBE()
  39354. }
  39355. ,
  39356. b.toBytesLE = function() {
  39357. var e = this.high
  39358. , t = this.low;
  39359. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39360. }
  39361. ,
  39362. b.toBytesBE = function() {
  39363. var e = this.high
  39364. , t = this.low;
  39365. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39366. }
  39367. ,
  39368. e
  39369. })
  39370. }
  39371. , {}],
  39372. 217: [function(e, t, i) {
  39373. var n = {
  39374. REVISION: "75"
  39375. };
  39376. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39377. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39378. void 0 === Math.sign && (Math.sign = function(e) {
  39379. return e < 0 ? -1 : e > 0 ? 1 : +e
  39380. }
  39381. ),
  39382. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39383. get: function() {
  39384. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39385. }
  39386. }),
  39387. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39388. writable: !0,
  39389. configurable: !0,
  39390. value: function(e) {
  39391. "use strict";
  39392. if (void 0 === e || null === e)
  39393. throw new TypeError("Cannot convert first argument to object");
  39394. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39395. var r = arguments[i];
  39396. if (void 0 !== r && null !== r) {
  39397. r = Object(r);
  39398. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39399. var l = o[a]
  39400. , c = Object.getOwnPropertyDescriptor(r, l);
  39401. void 0 !== c && c.enumerable && (t[l] = r[l])
  39402. }
  39403. }
  39404. }
  39405. return t
  39406. }
  39407. }),
  39408. n.MOUSE = {
  39409. LEFT: 0,
  39410. MIDDLE: 1,
  39411. RIGHT: 2
  39412. },
  39413. n.CullFaceNone = 0,
  39414. n.CullFaceBack = 1,
  39415. n.CullFaceFront = 2,
  39416. n.CullFaceFrontBack = 3,
  39417. n.FrontFaceDirectionCW = 0,
  39418. n.FrontFaceDirectionCCW = 1,
  39419. n.BasicShadowMap = 0,
  39420. n.PCFShadowMap = 1,
  39421. n.PCFSoftShadowMap = 2,
  39422. n.FrontSide = 0,
  39423. n.BackSide = 1,
  39424. n.DoubleSide = 2,
  39425. n.FlatShading = 1,
  39426. n.SmoothShading = 2,
  39427. n.NoColors = 0,
  39428. n.FaceColors = 1,
  39429. n.VertexColors = 2,
  39430. n.NoBlending = 0,
  39431. n.NormalBlending = 1,
  39432. n.AdditiveBlending = 2,
  39433. n.SubtractiveBlending = 3,
  39434. n.MultiplyBlending = 4,
  39435. n.CustomBlending = 5,
  39436. n.AddEquation = 100,
  39437. n.SubtractEquation = 101,
  39438. n.ReverseSubtractEquation = 102,
  39439. n.MinEquation = 103,
  39440. n.MaxEquation = 104,
  39441. n.ZeroFactor = 200,
  39442. n.OneFactor = 201,
  39443. n.SrcColorFactor = 202,
  39444. n.OneMinusSrcColorFactor = 203,
  39445. n.SrcAlphaFactor = 204,
  39446. n.OneMinusSrcAlphaFactor = 205,
  39447. n.DstAlphaFactor = 206,
  39448. n.OneMinusDstAlphaFactor = 207,
  39449. n.DstColorFactor = 208,
  39450. n.OneMinusDstColorFactor = 209,
  39451. n.SrcAlphaSaturateFactor = 210,
  39452. n.NeverDepth = 0,
  39453. n.AlwaysDepth = 1,
  39454. n.LessDepth = 2,
  39455. n.LessEqualDepth = 3,
  39456. n.EqualDepth = 4,
  39457. n.GreaterEqualDepth = 5,
  39458. n.GreaterDepth = 6,
  39459. n.NotEqualDepth = 7,
  39460. n.MultiplyOperation = 0,
  39461. n.MixOperation = 1,
  39462. n.AddOperation = 2,
  39463. n.NoToneMapping = 0,
  39464. n.LinearToneMapping = 1,
  39465. n.ReinhardToneMapping = 2,
  39466. n.Uncharted2ToneMapping = 3,
  39467. n.CineonToneMapping = 4,
  39468. n.UVMapping = 300,
  39469. n.CubeReflectionMapping = 301,
  39470. n.CubeRefractionMapping = 302,
  39471. n.EquirectangularReflectionMapping = 303,
  39472. n.EquirectangularRefractionMapping = 304,
  39473. n.SphericalReflectionMapping = 305,
  39474. n.CubeUVReflectionMapping = 306,
  39475. n.CubeUVRefractionMapping = 307,
  39476. n.RepeatWrapping = 1e3,
  39477. n.ClampToEdgeWrapping = 1001,
  39478. n.MirroredRepeatWrapping = 1002,
  39479. n.NearestFilter = 1003,
  39480. n.NearestMipMapNearestFilter = 1004,
  39481. n.NearestMipMapLinearFilter = 1005,
  39482. n.LinearFilter = 1006,
  39483. n.LinearMipMapNearestFilter = 1007,
  39484. n.LinearMipMapLinearFilter = 1008,
  39485. n.UnsignedByteType = 1009,
  39486. n.ByteType = 1010,
  39487. n.ShortType = 1011,
  39488. n.UnsignedShortType = 1012,
  39489. n.IntType = 1013,
  39490. n.UnsignedIntType = 1014,
  39491. n.FloatType = 1015,
  39492. n.HalfFloatType = 1025,
  39493. n.UnsignedShort4444Type = 1016,
  39494. n.UnsignedShort5551Type = 1017,
  39495. n.UnsignedShort565Type = 1018,
  39496. n.AlphaFormat = 1019,
  39497. n.RGBFormat = 1020,
  39498. n.RGBAFormat = 1021,
  39499. n.LuminanceFormat = 1022,
  39500. n.LuminanceAlphaFormat = 1023,
  39501. n.RGBEFormat = n.RGBAFormat,
  39502. n.RGB_S3TC_DXT1_Format = 2001,
  39503. n.RGBA_S3TC_DXT1_Format = 2002,
  39504. n.RGBA_S3TC_DXT3_Format = 2003,
  39505. n.RGBA_S3TC_DXT5_Format = 2004,
  39506. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39507. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39508. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39509. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39510. n.RGB_ETC1_Format = 2151,
  39511. n.LoopOnce = 2200,
  39512. n.LoopRepeat = 2201,
  39513. n.LoopPingPong = 2202,
  39514. n.InterpolateDiscrete = 2300,
  39515. n.InterpolateLinear = 2301,
  39516. n.InterpolateSmooth = 2302,
  39517. n.ZeroCurvatureEnding = 2400,
  39518. n.ZeroSlopeEnding = 2401,
  39519. n.WrapAroundEnding = 2402,
  39520. n.TrianglesDrawMode = 0,
  39521. n.TriangleStripDrawMode = 1,
  39522. n.TriangleFanDrawMode = 2,
  39523. n.LinearEncoding = 3e3,
  39524. n.sRGBEncoding = 3001,
  39525. n.GammaEncoding = 3007,
  39526. n.RGBEEncoding = 3002,
  39527. n.LogLuvEncoding = 3003,
  39528. n.RGBM7Encoding = 3004,
  39529. n.RGBM16Encoding = 3005,
  39530. n.RGBDEncoding = 3006,
  39531. n.Color = function(e) {
  39532. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39533. }
  39534. ,
  39535. n.Color.prototype = {
  39536. constructor: n.Color,
  39537. r: 1,
  39538. g: 1,
  39539. b: 1,
  39540. set: function(e) {
  39541. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39542. this
  39543. },
  39544. setScalar: function(e) {
  39545. this.r = e,
  39546. this.g = e,
  39547. this.b = e
  39548. },
  39549. setHex: function(e) {
  39550. return e = Math.floor(e),
  39551. this.r = (e >> 16 & 255) / 255,
  39552. this.g = (e >> 8 & 255) / 255,
  39553. this.b = (255 & e) / 255,
  39554. this
  39555. },
  39556. setRGB: function(e, t, i) {
  39557. return this.r = e,
  39558. this.g = t,
  39559. this.b = i,
  39560. this
  39561. },
  39562. setHSL: function() {
  39563. function e(e, t, i) {
  39564. return i < 0 && (i += 1),
  39565. i > 1 && (i -= 1),
  39566. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39567. }
  39568. return function(t, i, r) {
  39569. if (t = n.Math.euclideanModulo(t, 1),
  39570. i = n.Math.clamp(i, 0, 1),
  39571. r = n.Math.clamp(r, 0, 1),
  39572. 0 === i)
  39573. this.r = this.g = this.b = r;
  39574. else {
  39575. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39576. , a = 2 * r - o;
  39577. this.r = e(a, o, t + 1 / 3),
  39578. this.g = e(a, o, t),
  39579. this.b = e(a, o, t - 1 / 3)
  39580. }
  39581. return this
  39582. }
  39583. }(),
  39584. setStyle: function(e) {
  39585. function t(t) {
  39586. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39587. }
  39588. var i;
  39589. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39590. var r, o = i[1], a = i[2];
  39591. switch (o) {
  39592. case "rgb":
  39593. case "rgba":
  39594. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39595. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39596. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39597. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39598. t(r[5]),
  39599. this;
  39600. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39601. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39602. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39603. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39604. t(r[5]),
  39605. this;
  39606. break;
  39607. case "hsl":
  39608. case "hsla":
  39609. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39610. var s = parseFloat(r[1]) / 360
  39611. , l = parseInt(r[2], 10) / 100
  39612. , c = parseInt(r[3], 10) / 100;
  39613. return t(r[5]),
  39614. this.setHSL(s, l, c)
  39615. }
  39616. }
  39617. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39618. var h = i[1]
  39619. , u = h.length;
  39620. if (3 === u)
  39621. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39622. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39623. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39624. this;
  39625. if (6 === u)
  39626. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39627. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39628. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39629. this
  39630. }
  39631. if (e && e.length > 0) {
  39632. var h = n.ColorKeywords[e];
  39633. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39634. }
  39635. return this
  39636. },
  39637. clone: function() {
  39638. return new this.constructor(this.r,this.g,this.b)
  39639. },
  39640. copy: function(e) {
  39641. return this.r = e.r,
  39642. this.g = e.g,
  39643. this.b = e.b,
  39644. this
  39645. },
  39646. copyGammaToLinear: function(e, t) {
  39647. return void 0 === t && (t = 2),
  39648. this.r = Math.pow(e.r, t),
  39649. this.g = Math.pow(e.g, t),
  39650. this.b = Math.pow(e.b, t),
  39651. this
  39652. },
  39653. copyLinearToGamma: function(e, t) {
  39654. void 0 === t && (t = 2);
  39655. var i = t > 0 ? 1 / t : 1;
  39656. return this.r = Math.pow(e.r, i),
  39657. this.g = Math.pow(e.g, i),
  39658. this.b = Math.pow(e.b, i),
  39659. this
  39660. },
  39661. convertGammaToLinear: function() {
  39662. var e = this.r
  39663. , t = this.g
  39664. , i = this.b;
  39665. return this.r = e * e,
  39666. this.g = t * t,
  39667. this.b = i * i,
  39668. this
  39669. },
  39670. convertLinearToGamma: function() {
  39671. return this.r = Math.sqrt(this.r),
  39672. this.g = Math.sqrt(this.g),
  39673. this.b = Math.sqrt(this.b),
  39674. this
  39675. },
  39676. getHex: function() {
  39677. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39678. },
  39679. getHexString: function() {
  39680. return ("000000" + this.getHex().toString(16)).slice(-6)
  39681. },
  39682. getHSL: function(e) {
  39683. var t, i, n = e || {
  39684. h: 0,
  39685. s: 0,
  39686. l: 0
  39687. }, r = this.r, o = this.g, a = this.b, s = Math.max(r, o, a), l = Math.min(r, o, a), c = (l + s) / 2;
  39688. if (l === s)
  39689. t = 0,
  39690. i = 0;
  39691. else {
  39692. var h = s - l;
  39693. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39694. s) {
  39695. case r:
  39696. t = (o - a) / h + (o < a ? 6 : 0);
  39697. break;
  39698. case o:
  39699. t = (a - r) / h + 2;
  39700. break;
  39701. case a:
  39702. t = (r - o) / h + 4
  39703. }
  39704. t /= 6
  39705. }
  39706. return n.h = t,
  39707. n.s = i,
  39708. n.l = c,
  39709. n
  39710. },
  39711. getStyle: function() {
  39712. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39713. },
  39714. offsetHSL: function(e, t, i) {
  39715. var n = this.getHSL();
  39716. return n.h += e,
  39717. n.s += t,
  39718. n.l += i,
  39719. this.setHSL(n.h, n.s, n.l),
  39720. this
  39721. },
  39722. add: function(e) {
  39723. return this.r += e.r,
  39724. this.g += e.g,
  39725. this.b += e.b,
  39726. this
  39727. },
  39728. addColors: function(e, t) {
  39729. return this.r = e.r + t.r,
  39730. this.g = e.g + t.g,
  39731. this.b = e.b + t.b,
  39732. this
  39733. },
  39734. addScalar: function(e) {
  39735. return this.r += e,
  39736. this.g += e,
  39737. this.b += e,
  39738. this
  39739. },
  39740. multiply: function(e) {
  39741. return this.r *= e.r,
  39742. this.g *= e.g,
  39743. this.b *= e.b,
  39744. this
  39745. },
  39746. multiplyScalar: function(e) {
  39747. return this.r *= e,
  39748. this.g *= e,
  39749. this.b *= e,
  39750. this
  39751. },
  39752. lerp: function(e, t) {
  39753. return this.r += (e.r - this.r) * t,
  39754. this.g += (e.g - this.g) * t,
  39755. this.b += (e.b - this.b) * t,
  39756. this
  39757. },
  39758. equals: function(e) {
  39759. return e.r === this.r && e.g === this.g && e.b === this.b
  39760. },
  39761. fromArray: function(e, t) {
  39762. return void 0 === t && (t = 0),
  39763. this.r = e[t],
  39764. this.g = e[t + 1],
  39765. this.b = e[t + 2],
  39766. this
  39767. },
  39768. toArray: function(e, t) {
  39769. return void 0 === e && (e = []),
  39770. void 0 === t && (t = 0),
  39771. e[t] = this.r,
  39772. e[t + 1] = this.g,
  39773. e[t + 2] = this.b,
  39774. e
  39775. }
  39776. },
  39777. n.ColorKeywords = {
  39778. aliceblue: 15792383,
  39779. antiquewhite: 16444375,
  39780. aqua: 65535,
  39781. aquamarine: 8388564,
  39782. azure: 15794175,
  39783. beige: 16119260,
  39784. bisque: 16770244,
  39785. black: 0,
  39786. blanchedalmond: 16772045,
  39787. blue: 255,
  39788. blueviolet: 9055202,
  39789. brown: 10824234,
  39790. burlywood: 14596231,
  39791. cadetblue: 6266528,
  39792. chartreuse: 8388352,
  39793. chocolate: 13789470,
  39794. coral: 16744272,
  39795. cornflowerblue: 6591981,
  39796. cornsilk: 16775388,
  39797. crimson: 14423100,
  39798. cyan: 65535,
  39799. darkblue: 139,
  39800. darkcyan: 35723,
  39801. darkgoldenrod: 12092939,
  39802. darkgray: 11119017,
  39803. darkgreen: 25600,
  39804. darkgrey: 11119017,
  39805. darkkhaki: 12433259,
  39806. darkmagenta: 9109643,
  39807. darkolivegreen: 5597999,
  39808. darkorange: 16747520,
  39809. darkorchid: 10040012,
  39810. darkred: 9109504,
  39811. darksalmon: 15308410,
  39812. darkseagreen: 9419919,
  39813. darkslateblue: 4734347,
  39814. darkslategray: 3100495,
  39815. darkslategrey: 3100495,
  39816. darkturquoise: 52945,
  39817. darkviolet: 9699539,
  39818. deeppink: 16716947,
  39819. deepskyblue: 49151,
  39820. dimgray: 6908265,
  39821. dimgrey: 6908265,
  39822. dodgerblue: 2003199,
  39823. firebrick: 11674146,
  39824. floralwhite: 16775920,
  39825. forestgreen: 2263842,
  39826. fuchsia: 16711935,
  39827. gainsboro: 14474460,
  39828. ghostwhite: 16316671,
  39829. gold: 16766720,
  39830. goldenrod: 14329120,
  39831. gray: 8421504,
  39832. green: 32768,
  39833. greenyellow: 11403055,
  39834. grey: 8421504,
  39835. honeydew: 15794160,
  39836. hotpink: 16738740,
  39837. indianred: 13458524,
  39838. indigo: 4915330,
  39839. ivory: 16777200,
  39840. khaki: 15787660,
  39841. lavender: 15132410,
  39842. lavenderblush: 16773365,
  39843. lawngreen: 8190976,
  39844. lemonchiffon: 16775885,
  39845. lightblue: 11393254,
  39846. lightcoral: 15761536,
  39847. lightcyan: 14745599,
  39848. lightgoldenrodyellow: 16448210,
  39849. lightgray: 13882323,
  39850. lightgreen: 9498256,
  39851. lightgrey: 13882323,
  39852. lightpink: 16758465,
  39853. lightsalmon: 16752762,
  39854. lightseagreen: 2142890,
  39855. lightskyblue: 8900346,
  39856. lightslategray: 7833753,
  39857. lightslategrey: 7833753,
  39858. lightsteelblue: 11584734,
  39859. lightyellow: 16777184,
  39860. lime: 65280,
  39861. limegreen: 3329330,
  39862. linen: 16445670,
  39863. magenta: 16711935,
  39864. maroon: 8388608,
  39865. mediumaquamarine: 6737322,
  39866. mediumblue: 205,
  39867. mediumorchid: 12211667,
  39868. mediumpurple: 9662683,
  39869. mediumseagreen: 3978097,
  39870. mediumslateblue: 8087790,
  39871. mediumspringgreen: 64154,
  39872. mediumturquoise: 4772300,
  39873. mediumvioletred: 13047173,
  39874. midnightblue: 1644912,
  39875. mintcream: 16121850,
  39876. mistyrose: 16770273,
  39877. moccasin: 16770229,
  39878. navajowhite: 16768685,
  39879. navy: 128,
  39880. oldlace: 16643558,
  39881. olive: 8421376,
  39882. olivedrab: 7048739,
  39883. orange: 16753920,
  39884. orangered: 16729344,
  39885. orchid: 14315734,
  39886. palegoldenrod: 15657130,
  39887. palegreen: 10025880,
  39888. paleturquoise: 11529966,
  39889. palevioletred: 14381203,
  39890. papayawhip: 16773077,
  39891. peachpuff: 16767673,
  39892. peru: 13468991,
  39893. pink: 16761035,
  39894. plum: 14524637,
  39895. powderblue: 11591910,
  39896. purple: 8388736,
  39897. red: 16711680,
  39898. rosybrown: 12357519,
  39899. royalblue: 4286945,
  39900. saddlebrown: 9127187,
  39901. salmon: 16416882,
  39902. sandybrown: 16032864,
  39903. seagreen: 3050327,
  39904. seashell: 16774638,
  39905. sienna: 10506797,
  39906. silver: 12632256,
  39907. skyblue: 8900331,
  39908. slateblue: 6970061,
  39909. slategray: 7372944,
  39910. slategrey: 7372944,
  39911. snow: 16775930,
  39912. springgreen: 65407,
  39913. steelblue: 4620980,
  39914. tan: 13808780,
  39915. teal: 32896,
  39916. thistle: 14204888,
  39917. tomato: 16737095,
  39918. turquoise: 4251856,
  39919. violet: 15631086,
  39920. wheat: 16113331,
  39921. white: 16777215,
  39922. whitesmoke: 16119285,
  39923. yellow: 16776960,
  39924. yellowgreen: 10145074
  39925. },
  39926. n.Quaternion = function(e, t, i, n) {
  39927. this._x = e || 0,
  39928. this._y = t || 0,
  39929. this._z = i || 0,
  39930. this._w = void 0 !== n ? n : 1
  39931. }
  39932. ,
  39933. n.Quaternion.prototype = {
  39934. constructor: n.Quaternion,
  39935. get x() {
  39936. return this._x
  39937. },
  39938. set x(e) {
  39939. this._x = e,
  39940. this.onChangeCallback()
  39941. },
  39942. get y() {
  39943. return this._y
  39944. },
  39945. set y(e) {
  39946. this._y = e,
  39947. this.onChangeCallback()
  39948. },
  39949. get z() {
  39950. return this._z
  39951. },
  39952. set z(e) {
  39953. this._z = e,
  39954. this.onChangeCallback()
  39955. },
  39956. get w() {
  39957. return this._w
  39958. },
  39959. set w(e) {
  39960. this._w = e,
  39961. this.onChangeCallback()
  39962. },
  39963. set: function(e, t, i, n) {
  39964. return this._x = e,
  39965. this._y = t,
  39966. this._z = i,
  39967. this._w = n,
  39968. this.onChangeCallback(),
  39969. this
  39970. },
  39971. clone: function() {
  39972. return new this.constructor(this._x,this._y,this._z,this._w)
  39973. },
  39974. copy: function(e) {
  39975. return this._x = e.x,
  39976. this._y = e.y,
  39977. this._z = e.z,
  39978. this._w = e.w,
  39979. this.onChangeCallback(),
  39980. this
  39981. },
  39982. setFromEuler: function(e, t) {
  39983. if (e instanceof n.Euler == !1)
  39984. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39985. var i = Math.cos(e._x / 2)
  39986. , r = Math.cos(e._y / 2)
  39987. , o = Math.cos(e._z / 2)
  39988. , a = Math.sin(e._x / 2)
  39989. , s = Math.sin(e._y / 2)
  39990. , l = Math.sin(e._z / 2)
  39991. , c = e.order;
  39992. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39993. this._y = i * s * o - a * r * l,
  39994. this._z = i * r * l + a * s * o,
  39995. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39996. this._y = i * s * o - a * r * l,
  39997. this._z = i * r * l - a * s * o,
  39998. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39999. this._y = i * s * o + a * r * l,
  40000. this._z = i * r * l + a * s * o,
  40001. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40002. this._y = i * s * o + a * r * l,
  40003. this._z = i * r * l - a * s * o,
  40004. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40005. this._y = i * s * o + a * r * l,
  40006. this._z = i * r * l - a * s * o,
  40007. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40008. this._y = i * s * o - a * r * l,
  40009. this._z = i * r * l + a * s * o,
  40010. this._w = i * r * o + a * s * l),
  40011. t !== !1 && this.onChangeCallback(),
  40012. this
  40013. },
  40014. setFromAxisAngle: function(e, t) {
  40015. var i = t / 2
  40016. , n = Math.sin(i);
  40017. return this._x = e.x * n,
  40018. this._y = e.y * n,
  40019. this._z = e.z * n,
  40020. this._w = Math.cos(i),
  40021. this.onChangeCallback(),
  40022. this
  40023. },
  40024. setFromRotationMatrix: function(e) {
  40025. var t, i = e.elements, n = i[0], r = i[4], o = i[8], a = i[1], s = i[5], l = i[9], c = i[2], h = i[6], u = i[10], d = n + s + u;
  40026. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40027. this._w = .25 / t,
  40028. this._x = (h - l) * t,
  40029. this._y = (o - c) * t,
  40030. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40031. this._w = (h - l) / t,
  40032. this._x = .25 * t,
  40033. this._y = (r + a) / t,
  40034. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40035. this._w = (o - c) / t,
  40036. this._x = (r + a) / t,
  40037. this._y = .25 * t,
  40038. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40039. this._w = (a - r) / t,
  40040. this._x = (o + c) / t,
  40041. this._y = (l + h) / t,
  40042. this._z = .25 * t),
  40043. this.onChangeCallback(),
  40044. this
  40045. },
  40046. setFromUnitVectors: function() {
  40047. var e, t, i = 1e-6;
  40048. return function(r, o) {
  40049. return void 0 === e && (e = new n.Vector3),
  40050. t = r.dot(o) + 1,
  40051. t < i ? (t = 0,
  40052. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  40053. this._x = e.x,
  40054. this._y = e.y,
  40055. this._z = e.z,
  40056. this._w = t,
  40057. this.normalize(),
  40058. this
  40059. }
  40060. }(),
  40061. inverse: function() {
  40062. return this.conjugate().normalize(),
  40063. this
  40064. },
  40065. conjugate: function() {
  40066. return this._x *= -1,
  40067. this._y *= -1,
  40068. this._z *= -1,
  40069. this.onChangeCallback(),
  40070. this
  40071. },
  40072. dot: function(e) {
  40073. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40074. },
  40075. lengthSq: function() {
  40076. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40077. },
  40078. length: function() {
  40079. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40080. },
  40081. normalize: function() {
  40082. var e = this.length();
  40083. return 0 === e ? (this._x = 0,
  40084. this._y = 0,
  40085. this._z = 0,
  40086. this._w = 1) : (e = 1 / e,
  40087. this._x = this._x * e,
  40088. this._y = this._y * e,
  40089. this._z = this._z * e,
  40090. this._w = this._w * e),
  40091. this.onChangeCallback(),
  40092. this
  40093. },
  40094. multiply: function(e, t) {
  40095. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40096. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40097. },
  40098. multiplyQuaternions: function(e, t) {
  40099. var i = e._x
  40100. , n = e._y
  40101. , r = e._z
  40102. , o = e._w
  40103. , a = t._x
  40104. , s = t._y
  40105. , l = t._z
  40106. , c = t._w;
  40107. return this._x = i * c + o * a + n * l - r * s,
  40108. this._y = n * c + o * s + r * a - i * l,
  40109. this._z = r * c + o * l + i * s - n * a,
  40110. this._w = o * c - i * a - n * s - r * l,
  40111. this.onChangeCallback(),
  40112. this
  40113. },
  40114. slerp: function(e, t) {
  40115. if (0 === t)
  40116. return this;
  40117. if (1 === t)
  40118. return this.copy(e);
  40119. var i = this._x
  40120. , n = this._y
  40121. , r = this._z
  40122. , o = this._w
  40123. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40124. if (a < 0 ? (this._w = -e._w,
  40125. this._x = -e._x,
  40126. this._y = -e._y,
  40127. this._z = -e._z,
  40128. a = -a) : this.copy(e),
  40129. a >= 1)
  40130. return this._w = o,
  40131. this._x = i,
  40132. this._y = n,
  40133. this._z = r,
  40134. this;
  40135. var s = Math.sqrt(1 - a * a);
  40136. if (Math.abs(s) < .001)
  40137. return this._w = .5 * (o + this._w),
  40138. this._x = .5 * (i + this._x),
  40139. this._y = .5 * (n + this._y),
  40140. this._z = .5 * (r + this._z),
  40141. this;
  40142. var l = Math.atan2(s, a)
  40143. , c = Math.sin((1 - t) * l) / s
  40144. , h = Math.sin(t * l) / s;
  40145. return this._w = o * c + this._w * h,
  40146. this._x = i * c + this._x * h,
  40147. this._y = n * c + this._y * h,
  40148. this._z = r * c + this._z * h,
  40149. this.onChangeCallback(),
  40150. this
  40151. },
  40152. equals: function(e) {
  40153. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40154. },
  40155. fromArray: function(e, t) {
  40156. return void 0 === t && (t = 0),
  40157. this._x = e[t],
  40158. this._y = e[t + 1],
  40159. this._z = e[t + 2],
  40160. this._w = e[t + 3],
  40161. this.onChangeCallback(),
  40162. this
  40163. },
  40164. toArray: function(e, t) {
  40165. return void 0 === e && (e = []),
  40166. void 0 === t && (t = 0),
  40167. e[t] = this._x,
  40168. e[t + 1] = this._y,
  40169. e[t + 2] = this._z,
  40170. e[t + 3] = this._w,
  40171. e
  40172. },
  40173. onChange: function(e) {
  40174. return this.onChangeCallback = e,
  40175. this
  40176. },
  40177. onChangeCallback: function() {}
  40178. },
  40179. Object.assign(n.Quaternion, {
  40180. slerp: function(e, t, i, n) {
  40181. return i.copy(e).slerp(t, n)
  40182. },
  40183. slerpFlat: function(e, t, i, n, r, o, a) {
  40184. var s = i[n + 0]
  40185. , l = i[n + 1]
  40186. , c = i[n + 2]
  40187. , h = i[n + 3]
  40188. , u = r[o + 0]
  40189. , d = r[o + 1]
  40190. , p = r[o + 2]
  40191. , f = r[o + 3];
  40192. if (h !== f || s !== u || l !== d || c !== p) {
  40193. var g = 1 - a
  40194. , m = s * u + l * d + c * p + h * f
  40195. , v = m >= 0 ? 1 : -1
  40196. , A = 1 - m * m;
  40197. if (A > Number.EPSILON) {
  40198. var y = Math.sqrt(A)
  40199. , C = Math.atan2(y, m * v);
  40200. g = Math.sin(g * C) / y,
  40201. a = Math.sin(a * C) / y
  40202. }
  40203. var I = a * v;
  40204. if (s = s * g + u * I,
  40205. l = l * g + d * I,
  40206. c = c * g + p * I,
  40207. h = h * g + f * I,
  40208. g === 1 - a) {
  40209. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40210. s *= E,
  40211. l *= E,
  40212. c *= E,
  40213. h *= E
  40214. }
  40215. }
  40216. e[t] = s,
  40217. e[t + 1] = l,
  40218. e[t + 2] = c,
  40219. e[t + 3] = h
  40220. }
  40221. }),
  40222. n.Vector2 = function(e, t) {
  40223. this.x = e || 0,
  40224. this.y = t || 0
  40225. }
  40226. ,
  40227. n.Vector2.prototype = {
  40228. constructor: n.Vector2,
  40229. get width() {
  40230. return this.x
  40231. },
  40232. set width(e) {
  40233. this.x = e
  40234. },
  40235. get height() {
  40236. return this.y
  40237. },
  40238. set height(e) {
  40239. this.y = e
  40240. },
  40241. set: function(e, t) {
  40242. return this.x = e,
  40243. this.y = t,
  40244. this
  40245. },
  40246. setScalar: function(e) {
  40247. return this.x = e,
  40248. this.y = e,
  40249. this
  40250. },
  40251. setX: function(e) {
  40252. return this.x = e,
  40253. this
  40254. },
  40255. setY: function(e) {
  40256. return this.y = e,
  40257. this
  40258. },
  40259. setComponent: function(e, t) {
  40260. switch (e) {
  40261. case 0:
  40262. this.x = t;
  40263. break;
  40264. case 1:
  40265. this.y = t;
  40266. break;
  40267. default:
  40268. throw new Error("index is out of range: " + e)
  40269. }
  40270. },
  40271. getComponent: function(e) {
  40272. switch (e) {
  40273. case 0:
  40274. return this.x;
  40275. case 1:
  40276. return this.y;
  40277. default:
  40278. throw new Error("index is out of range: " + e)
  40279. }
  40280. },
  40281. clone: function() {
  40282. return new this.constructor(this.x,this.y)
  40283. },
  40284. copy: function(e) {
  40285. return this.x = e.x,
  40286. this.y = e.y,
  40287. this
  40288. },
  40289. add: function(e, t) {
  40290. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40291. this.addVectors(e, t)) : (this.x += e.x,
  40292. this.y += e.y,
  40293. this)
  40294. },
  40295. addScalar: function(e) {
  40296. return this.x += e,
  40297. this.y += e,
  40298. this
  40299. },
  40300. addVectors: function(e, t) {
  40301. return this.x = e.x + t.x,
  40302. this.y = e.y + t.y,
  40303. this
  40304. },
  40305. addScaledVector: function(e, t) {
  40306. return this.x += e.x * t,
  40307. this.y += e.y * t,
  40308. this
  40309. },
  40310. sub: function(e, t) {
  40311. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40312. this.subVectors(e, t)) : (this.x -= e.x,
  40313. this.y -= e.y,
  40314. this)
  40315. },
  40316. subScalar: function(e) {
  40317. return this.x -= e,
  40318. this.y -= e,
  40319. this
  40320. },
  40321. subVectors: function(e, t) {
  40322. return this.x = e.x - t.x,
  40323. this.y = e.y - t.y,
  40324. this
  40325. },
  40326. multiply: function(e) {
  40327. return this.x *= e.x,
  40328. this.y *= e.y,
  40329. this
  40330. },
  40331. multiplyScalar: function(e) {
  40332. return isFinite(e) ? (this.x *= e,
  40333. this.y *= e) : (this.x = 0,
  40334. this.y = 0),
  40335. this
  40336. },
  40337. divide: function(e) {
  40338. return this.x /= e.x,
  40339. this.y /= e.y,
  40340. this
  40341. },
  40342. divideScalar: function(e) {
  40343. return this.multiplyScalar(1 / e)
  40344. },
  40345. min: function(e) {
  40346. return this.x = Math.min(this.x, e.x),
  40347. this.y = Math.min(this.y, e.y),
  40348. this
  40349. },
  40350. max: function(e) {
  40351. return this.x = Math.max(this.x, e.x),
  40352. this.y = Math.max(this.y, e.y),
  40353. this
  40354. },
  40355. clamp: function(e, t) {
  40356. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40357. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40358. this
  40359. },
  40360. clampScalar: function() {
  40361. var e, t;
  40362. return function(i, r) {
  40363. return void 0 === e && (e = new n.Vector2,
  40364. t = new n.Vector2),
  40365. e.set(i, i),
  40366. t.set(r, r),
  40367. this.clamp(e, t)
  40368. }
  40369. }(),
  40370. clampLength: function(e, t) {
  40371. var i = this.length();
  40372. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40373. this
  40374. },
  40375. floor: function() {
  40376. return this.x = Math.floor(this.x),
  40377. this.y = Math.floor(this.y),
  40378. this
  40379. },
  40380. ceil: function() {
  40381. return this.x = Math.ceil(this.x),
  40382. this.y = Math.ceil(this.y),
  40383. this
  40384. },
  40385. round: function() {
  40386. return this.x = Math.round(this.x),
  40387. this.y = Math.round(this.y),
  40388. this
  40389. },
  40390. roundToZero: function() {
  40391. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40392. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40393. this
  40394. },
  40395. negate: function() {
  40396. return this.x = -this.x,
  40397. this.y = -this.y,
  40398. this
  40399. },
  40400. dot: function(e) {
  40401. return this.x * e.x + this.y * e.y
  40402. },
  40403. lengthSq: function() {
  40404. return this.x * this.x + this.y * this.y
  40405. },
  40406. length: function() {
  40407. return Math.sqrt(this.x * this.x + this.y * this.y)
  40408. },
  40409. lengthManhattan: function() {
  40410. return Math.abs(this.x) + Math.abs(this.y)
  40411. },
  40412. normalize: function() {
  40413. return this.divideScalar(this.length())
  40414. },
  40415. angle: function() {
  40416. var e = Math.atan2(this.y, this.x);
  40417. return e < 0 && (e += 2 * Math.PI),
  40418. e
  40419. },
  40420. distanceTo: function(e) {
  40421. return Math.sqrt(this.distanceToSquared(e))
  40422. },
  40423. distanceToSquared: function(e) {
  40424. var t = this.x - e.x
  40425. , i = this.y - e.y;
  40426. return t * t + i * i
  40427. },
  40428. setLength: function(e) {
  40429. return this.multiplyScalar(e / this.length())
  40430. },
  40431. lerp: function(e, t) {
  40432. return this.x += (e.x - this.x) * t,
  40433. this.y += (e.y - this.y) * t,
  40434. this
  40435. },
  40436. lerpVectors: function(e, t, i) {
  40437. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40438. this
  40439. },
  40440. equals: function(e) {
  40441. return e.x === this.x && e.y === this.y
  40442. },
  40443. fromArray: function(e, t) {
  40444. return void 0 === t && (t = 0),
  40445. this.x = e[t],
  40446. this.y = e[t + 1],
  40447. this
  40448. },
  40449. toArray: function(e, t) {
  40450. return void 0 === e && (e = []),
  40451. void 0 === t && (t = 0),
  40452. e[t] = this.x,
  40453. e[t + 1] = this.y,
  40454. e
  40455. },
  40456. fromAttribute: function(e, t, i) {
  40457. return void 0 === i && (i = 0),
  40458. t = t * e.itemSize + i,
  40459. this.x = e.array[t],
  40460. this.y = e.array[t + 1],
  40461. this
  40462. },
  40463. rotateAround: function(e, t) {
  40464. var i = Math.cos(t)
  40465. , n = Math.sin(t)
  40466. , r = this.x - e.x
  40467. , o = this.y - e.y;
  40468. return this.x = r * i - o * n + e.x,
  40469. this.y = r * n + o * i + e.y,
  40470. this
  40471. }
  40472. },
  40473. n.Vector3 = function(e, t, i) {
  40474. this.x = e || 0,
  40475. this.y = t || 0,
  40476. this.z = i || 0
  40477. }
  40478. ,
  40479. n.Vector3.prototype = {
  40480. constructor: n.Vector3,
  40481. set: function(e, t, i) {
  40482. return this.x = e,
  40483. this.y = t,
  40484. this.z = i,
  40485. this
  40486. },
  40487. setScalar: function(e) {
  40488. return this.x = e,
  40489. this.y = e,
  40490. this.z = e,
  40491. this
  40492. },
  40493. setX: function(e) {
  40494. return this.x = e,
  40495. this
  40496. },
  40497. setY: function(e) {
  40498. return this.y = e,
  40499. this
  40500. },
  40501. setZ: function(e) {
  40502. return this.z = e,
  40503. this
  40504. },
  40505. setComponent: function(e, t) {
  40506. switch (e) {
  40507. case 0:
  40508. this.x = t;
  40509. break;
  40510. case 1:
  40511. this.y = t;
  40512. break;
  40513. case 2:
  40514. this.z = t;
  40515. break;
  40516. default:
  40517. throw new Error("index is out of range: " + e)
  40518. }
  40519. },
  40520. getComponent: function(e) {
  40521. switch (e) {
  40522. case 0:
  40523. return this.x;
  40524. case 1:
  40525. return this.y;
  40526. case 2:
  40527. return this.z;
  40528. default:
  40529. throw new Error("index is out of range: " + e)
  40530. }
  40531. },
  40532. clone: function() {
  40533. return new this.constructor(this.x,this.y,this.z)
  40534. },
  40535. copy: function(e) {
  40536. return this.x = e.x,
  40537. this.y = e.y,
  40538. this.z = e.z,
  40539. this
  40540. },
  40541. add: function(e, t) {
  40542. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40543. this.addVectors(e, t)) : (this.x += e.x,
  40544. this.y += e.y,
  40545. this.z += e.z,
  40546. this)
  40547. },
  40548. addScalar: function(e) {
  40549. return this.x += e,
  40550. this.y += e,
  40551. this.z += e,
  40552. this
  40553. },
  40554. addVectors: function(e, t) {
  40555. return this.x = e.x + t.x,
  40556. this.y = e.y + t.y,
  40557. this.z = e.z + t.z,
  40558. this
  40559. },
  40560. addScaledVector: function(e, t) {
  40561. return this.x += e.x * t,
  40562. this.y += e.y * t,
  40563. this.z += e.z * t,
  40564. this
  40565. },
  40566. sub: function(e, t) {
  40567. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40568. this.subVectors(e, t)) : (this.x -= e.x,
  40569. this.y -= e.y,
  40570. this.z -= e.z,
  40571. this)
  40572. },
  40573. subScalar: function(e) {
  40574. return this.x -= e,
  40575. this.y -= e,
  40576. this.z -= e,
  40577. this
  40578. },
  40579. subVectors: function(e, t) {
  40580. return this.x = e.x - t.x,
  40581. this.y = e.y - t.y,
  40582. this.z = e.z - t.z,
  40583. this
  40584. },
  40585. multiply: function(e, t) {
  40586. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40587. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40588. this.y *= e.y,
  40589. this.z *= e.z,
  40590. this)
  40591. },
  40592. multiplyScalar: function(e) {
  40593. return isFinite(e) ? (this.x *= e,
  40594. this.y *= e,
  40595. this.z *= e) : (this.x = 0,
  40596. this.y = 0,
  40597. this.z = 0),
  40598. this
  40599. },
  40600. multiplyVectors: function(e, t) {
  40601. return this.x = e.x * t.x,
  40602. this.y = e.y * t.y,
  40603. this.z = e.z * t.z,
  40604. this
  40605. },
  40606. applyEuler: function() {
  40607. var e;
  40608. return function(t) {
  40609. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40610. void 0 === e && (e = new n.Quaternion),
  40611. this.applyQuaternion(e.setFromEuler(t)),
  40612. this
  40613. }
  40614. }(),
  40615. applyAxisAngle: function() {
  40616. var e;
  40617. return function(t, i) {
  40618. return void 0 === e && (e = new n.Quaternion),
  40619. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40620. this
  40621. }
  40622. }(),
  40623. applyMatrix3: function(e) {
  40624. var t = this.x
  40625. , i = this.y
  40626. , n = this.z
  40627. , r = e.elements;
  40628. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40629. this.y = r[1] * t + r[4] * i + r[7] * n,
  40630. this.z = r[2] * t + r[5] * i + r[8] * n,
  40631. this
  40632. },
  40633. applyMatrix4: function(e) {
  40634. var t = this.x
  40635. , i = this.y
  40636. , n = this.z
  40637. , r = e.elements;
  40638. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40639. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40640. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40641. this
  40642. },
  40643. applyProjection: function(e) {
  40644. var t = this.x
  40645. , i = this.y
  40646. , n = this.z
  40647. , r = e.elements
  40648. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40649. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40650. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40651. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40652. this
  40653. },
  40654. applyQuaternion: function(e) {
  40655. var t = this.x
  40656. , i = this.y
  40657. , n = this.z
  40658. , r = e.x
  40659. , o = e.y
  40660. , a = e.z
  40661. , s = e.w
  40662. , l = s * t + o * n - a * i
  40663. , c = s * i + a * t - r * n
  40664. , h = s * n + r * i - o * t
  40665. , u = -r * t - o * i - a * n;
  40666. return this.x = l * s + u * -r + c * -a - h * -o,
  40667. this.y = c * s + u * -o + h * -r - l * -a,
  40668. this.z = h * s + u * -a + l * -o - c * -r,
  40669. this
  40670. },
  40671. project: function() {
  40672. var e;
  40673. return function(t) {
  40674. return void 0 === e && (e = new n.Matrix4),
  40675. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40676. this.applyProjection(e)
  40677. }
  40678. }(),
  40679. unproject: function() {
  40680. var e;
  40681. return function(t) {
  40682. return void 0 === e && (e = new n.Matrix4),
  40683. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40684. this.applyProjection(e)
  40685. }
  40686. }(),
  40687. transformDirection: function(e) {
  40688. var t = this.x
  40689. , i = this.y
  40690. , n = this.z
  40691. , r = e.elements;
  40692. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40693. this.y = r[1] * t + r[5] * i + r[9] * n,
  40694. this.z = r[2] * t + r[6] * i + r[10] * n,
  40695. this.normalize(),
  40696. this
  40697. },
  40698. divide: function(e) {
  40699. return this.x /= e.x,
  40700. this.y /= e.y,
  40701. this.z /= e.z,
  40702. this
  40703. },
  40704. divideScalar: function(e) {
  40705. return this.multiplyScalar(1 / e)
  40706. },
  40707. min: function(e) {
  40708. return this.x = Math.min(this.x, e.x),
  40709. this.y = Math.min(this.y, e.y),
  40710. this.z = Math.min(this.z, e.z),
  40711. this
  40712. },
  40713. max: function(e) {
  40714. return this.x = Math.max(this.x, e.x),
  40715. this.y = Math.max(this.y, e.y),
  40716. this.z = Math.max(this.z, e.z),
  40717. this
  40718. },
  40719. clamp: function(e, t) {
  40720. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40721. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40722. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40723. this
  40724. },
  40725. clampScalar: function() {
  40726. var e, t;
  40727. return function(i, r) {
  40728. return void 0 === e && (e = new n.Vector3,
  40729. t = new n.Vector3),
  40730. e.set(i, i, i),
  40731. t.set(r, r, r),
  40732. this.clamp(e, t)
  40733. }
  40734. }(),
  40735. clampLength: function(e, t) {
  40736. var i = this.length();
  40737. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40738. this
  40739. },
  40740. floor: function() {
  40741. return this.x = Math.floor(this.x),
  40742. this.y = Math.floor(this.y),
  40743. this.z = Math.floor(this.z),
  40744. this
  40745. },
  40746. ceil: function() {
  40747. return this.x = Math.ceil(this.x),
  40748. this.y = Math.ceil(this.y),
  40749. this.z = Math.ceil(this.z),
  40750. this
  40751. },
  40752. round: function() {
  40753. return this.x = Math.round(this.x),
  40754. this.y = Math.round(this.y),
  40755. this.z = Math.round(this.z),
  40756. this
  40757. },
  40758. roundToZero: function() {
  40759. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40760. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40761. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40762. this
  40763. },
  40764. negate: function() {
  40765. return this.x = -this.x,
  40766. this.y = -this.y,
  40767. this.z = -this.z,
  40768. this
  40769. },
  40770. dot: function(e) {
  40771. return this.x * e.x + this.y * e.y + this.z * e.z
  40772. },
  40773. lengthSq: function() {
  40774. return this.x * this.x + this.y * this.y + this.z * this.z
  40775. },
  40776. length: function() {
  40777. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40778. },
  40779. lengthManhattan: function() {
  40780. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40781. },
  40782. normalize: function() {
  40783. return this.divideScalar(this.length())
  40784. },
  40785. setLength: function(e) {
  40786. return this.multiplyScalar(e / this.length())
  40787. },
  40788. lerp: function(e, t) {
  40789. return this.x += (e.x - this.x) * t,
  40790. this.y += (e.y - this.y) * t,
  40791. this.z += (e.z - this.z) * t,
  40792. this
  40793. },
  40794. lerpVectors: function(e, t, i) {
  40795. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40796. this
  40797. },
  40798. cross: function(e, t) {
  40799. if (void 0 !== t)
  40800. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40801. this.crossVectors(e, t);
  40802. var i = this.x
  40803. , n = this.y
  40804. , r = this.z;
  40805. return this.x = n * e.z - r * e.y,
  40806. this.y = r * e.x - i * e.z,
  40807. this.z = i * e.y - n * e.x,
  40808. this
  40809. },
  40810. crossVectors: function(e, t) {
  40811. var i = e.x
  40812. , n = e.y
  40813. , r = e.z
  40814. , o = t.x
  40815. , a = t.y
  40816. , s = t.z;
  40817. return this.x = n * s - r * a,
  40818. this.y = r * o - i * s,
  40819. this.z = i * a - n * o,
  40820. this
  40821. },
  40822. projectOnVector: function() {
  40823. var e, t;
  40824. return function(i) {
  40825. return void 0 === e && (e = new n.Vector3),
  40826. e.copy(i).normalize(),
  40827. t = this.dot(e),
  40828. this.copy(e).multiplyScalar(t)
  40829. }
  40830. }(),
  40831. projectOnPlane: function() {
  40832. var e;
  40833. return function(t) {
  40834. return void 0 === e && (e = new n.Vector3),
  40835. e.copy(this).projectOnVector(t),
  40836. this.sub(e)
  40837. }
  40838. }(),
  40839. reflect: function() {
  40840. var e;
  40841. return function(t) {
  40842. return void 0 === e && (e = new n.Vector3),
  40843. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40844. }
  40845. }(),
  40846. angleTo: function(e) {
  40847. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40848. return Math.acos(n.Math.clamp(t, -1, 1))
  40849. },
  40850. distanceTo: function(e) {
  40851. return Math.sqrt(this.distanceToSquared(e))
  40852. },
  40853. distanceToSquared: function(e) {
  40854. var t = this.x - e.x
  40855. , i = this.y - e.y
  40856. , n = this.z - e.z;
  40857. return t * t + i * i + n * n
  40858. },
  40859. setFromSpherical: function(e) {
  40860. var t = Math.sin(e.phi) * e.radius;
  40861. return this.x = t * Math.sin(e.theta),
  40862. this.y = Math.cos(e.phi) * e.radius,
  40863. this.z = t * Math.cos(e.theta),
  40864. this
  40865. },
  40866. setFromMatrixPosition: function(e) {
  40867. return this.setFromMatrixColumn(e, 3)
  40868. },
  40869. setFromMatrixScale: function(e) {
  40870. var t = this.setFromMatrixColumn(e, 0).length()
  40871. , i = this.setFromMatrixColumn(e, 1).length()
  40872. , n = this.setFromMatrixColumn(e, 2).length();
  40873. return this.x = t,
  40874. this.y = i,
  40875. this.z = n,
  40876. this
  40877. },
  40878. setFromMatrixColumn: function(e, t) {
  40879. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40880. e = arguments[1],
  40881. t = arguments[0]),
  40882. this.fromArray(e.elements, 4 * t)
  40883. },
  40884. equals: function(e) {
  40885. return e.x === this.x && e.y === this.y && e.z === this.z
  40886. },
  40887. fromArray: function(e, t) {
  40888. return void 0 === t && (t = 0),
  40889. this.x = e[t],
  40890. this.y = e[t + 1],
  40891. this.z = e[t + 2],
  40892. this
  40893. },
  40894. toArray: function(e, t) {
  40895. return void 0 === e && (e = []),
  40896. void 0 === t && (t = 0),
  40897. e[t] = this.x,
  40898. e[t + 1] = this.y,
  40899. e[t + 2] = this.z,
  40900. e
  40901. },
  40902. fromAttribute: function(e, t, i) {
  40903. return void 0 === i && (i = 0),
  40904. t = t * e.itemSize + i,
  40905. this.x = e.array[t],
  40906. this.y = e.array[t + 1],
  40907. this.z = e.array[t + 2],
  40908. this
  40909. }
  40910. },
  40911. n.Vector4 = function(e, t, i, n) {
  40912. this.x = e || 0,
  40913. this.y = t || 0,
  40914. this.z = i || 0,
  40915. this.w = void 0 !== n ? n : 1
  40916. }
  40917. ,
  40918. n.Vector4.prototype = {
  40919. constructor: n.Vector4,
  40920. set: function(e, t, i, n) {
  40921. return this.x = e,
  40922. this.y = t,
  40923. this.z = i,
  40924. this.w = n,
  40925. this
  40926. },
  40927. setScalar: function(e) {
  40928. return this.x = e,
  40929. this.y = e,
  40930. this.z = e,
  40931. this.w = e,
  40932. this
  40933. },
  40934. setX: function(e) {
  40935. return this.x = e,
  40936. this
  40937. },
  40938. setY: function(e) {
  40939. return this.y = e,
  40940. this
  40941. },
  40942. setZ: function(e) {
  40943. return this.z = e,
  40944. this
  40945. },
  40946. setW: function(e) {
  40947. return this.w = e,
  40948. this
  40949. },
  40950. setComponent: function(e, t) {
  40951. switch (e) {
  40952. case 0:
  40953. this.x = t;
  40954. break;
  40955. case 1:
  40956. this.y = t;
  40957. break;
  40958. case 2:
  40959. this.z = t;
  40960. break;
  40961. case 3:
  40962. this.w = t;
  40963. break;
  40964. default:
  40965. throw new Error("index is out of range: " + e)
  40966. }
  40967. },
  40968. getComponent: function(e) {
  40969. switch (e) {
  40970. case 0:
  40971. return this.x;
  40972. case 1:
  40973. return this.y;
  40974. case 2:
  40975. return this.z;
  40976. case 3:
  40977. return this.w;
  40978. default:
  40979. throw new Error("index is out of range: " + e)
  40980. }
  40981. },
  40982. clone: function() {
  40983. return new this.constructor(this.x,this.y,this.z,this.w)
  40984. },
  40985. copy: function(e) {
  40986. return this.x = e.x,
  40987. this.y = e.y,
  40988. this.z = e.z,
  40989. this.w = void 0 !== e.w ? e.w : 1,
  40990. this
  40991. },
  40992. add: function(e, t) {
  40993. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40994. this.addVectors(e, t)) : (this.x += e.x,
  40995. this.y += e.y,
  40996. this.z += e.z,
  40997. this.w += e.w,
  40998. this)
  40999. },
  41000. addScalar: function(e) {
  41001. return this.x += e,
  41002. this.y += e,
  41003. this.z += e,
  41004. this.w += e,
  41005. this
  41006. },
  41007. addVectors: function(e, t) {
  41008. return this.x = e.x + t.x,
  41009. this.y = e.y + t.y,
  41010. this.z = e.z + t.z,
  41011. this.w = e.w + t.w,
  41012. this
  41013. },
  41014. addScaledVector: function(e, t) {
  41015. return this.x += e.x * t,
  41016. this.y += e.y * t,
  41017. this.z += e.z * t,
  41018. this.w += e.w * t,
  41019. this
  41020. },
  41021. sub: function(e, t) {
  41022. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41023. this.subVectors(e, t)) : (this.x -= e.x,
  41024. this.y -= e.y,
  41025. this.z -= e.z,
  41026. this.w -= e.w,
  41027. this)
  41028. },
  41029. subScalar: function(e) {
  41030. return this.x -= e,
  41031. this.y -= e,
  41032. this.z -= e,
  41033. this.w -= e,
  41034. this
  41035. },
  41036. subVectors: function(e, t) {
  41037. return this.x = e.x - t.x,
  41038. this.y = e.y - t.y,
  41039. this.z = e.z - t.z,
  41040. this.w = e.w - t.w,
  41041. this
  41042. },
  41043. multiplyScalar: function(e) {
  41044. return isFinite(e) ? (this.x *= e,
  41045. this.y *= e,
  41046. this.z *= e,
  41047. this.w *= e) : (this.x = 0,
  41048. this.y = 0,
  41049. this.z = 0,
  41050. this.w = 0),
  41051. this
  41052. },
  41053. applyMatrix4: function(e) {
  41054. var t = this.x
  41055. , i = this.y
  41056. , n = this.z
  41057. , r = this.w
  41058. , o = e.elements;
  41059. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41060. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41061. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41062. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41063. this
  41064. },
  41065. divideScalar: function(e) {
  41066. return this.multiplyScalar(1 / e)
  41067. },
  41068. setAxisAngleFromQuaternion: function(e) {
  41069. this.w = 2 * Math.acos(e.w);
  41070. var t = Math.sqrt(1 - e.w * e.w);
  41071. return t < 1e-4 ? (this.x = 1,
  41072. this.y = 0,
  41073. this.z = 0) : (this.x = e.x / t,
  41074. this.y = e.y / t,
  41075. this.z = e.z / t),
  41076. this
  41077. },
  41078. setAxisAngleFromRotationMatrix: function(e) {
  41079. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  41080. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41081. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41082. return this.set(1, 0, 0, 0),
  41083. this;
  41084. t = Math.PI;
  41085. var v = (l + 1) / 2
  41086. , A = (d + 1) / 2
  41087. , y = (m + 1) / 2
  41088. , C = (c + u) / 4
  41089. , I = (h + f) / 4
  41090. , E = (p + g) / 4;
  41091. return v > A && v > y ? v < o ? (i = 0,
  41092. n = .707106781,
  41093. r = .707106781) : (i = Math.sqrt(v),
  41094. n = C / i,
  41095. r = I / i) : A > y ? A < o ? (i = .707106781,
  41096. n = 0,
  41097. r = .707106781) : (n = Math.sqrt(A),
  41098. i = C / n,
  41099. r = E / n) : y < o ? (i = .707106781,
  41100. n = .707106781,
  41101. r = 0) : (r = Math.sqrt(y),
  41102. i = I / r,
  41103. n = E / r),
  41104. this.set(i, n, r, t),
  41105. this
  41106. }
  41107. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41108. return Math.abs(b) < .001 && (b = 1),
  41109. this.x = (g - p) / b,
  41110. this.y = (h - f) / b,
  41111. this.z = (u - c) / b,
  41112. this.w = Math.acos((l + d + m - 1) / 2),
  41113. this
  41114. },
  41115. min: function(e) {
  41116. return this.x = Math.min(this.x, e.x),
  41117. this.y = Math.min(this.y, e.y),
  41118. this.z = Math.min(this.z, e.z),
  41119. this.w = Math.min(this.w, e.w),
  41120. this
  41121. },
  41122. max: function(e) {
  41123. return this.x = Math.max(this.x, e.x),
  41124. this.y = Math.max(this.y, e.y),
  41125. this.z = Math.max(this.z, e.z),
  41126. this.w = Math.max(this.w, e.w),
  41127. this
  41128. },
  41129. clamp: function(e, t) {
  41130. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41131. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41132. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41133. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41134. this
  41135. },
  41136. clampScalar: function() {
  41137. var e, t;
  41138. return function(i, r) {
  41139. return void 0 === e && (e = new n.Vector4,
  41140. t = new n.Vector4),
  41141. e.set(i, i, i, i),
  41142. t.set(r, r, r, r),
  41143. this.clamp(e, t)
  41144. }
  41145. }(),
  41146. floor: function() {
  41147. return this.x = Math.floor(this.x),
  41148. this.y = Math.floor(this.y),
  41149. this.z = Math.floor(this.z),
  41150. this.w = Math.floor(this.w),
  41151. this
  41152. },
  41153. ceil: function() {
  41154. return this.x = Math.ceil(this.x),
  41155. this.y = Math.ceil(this.y),
  41156. this.z = Math.ceil(this.z),
  41157. this.w = Math.ceil(this.w),
  41158. this
  41159. },
  41160. round: function() {
  41161. return this.x = Math.round(this.x),
  41162. this.y = Math.round(this.y),
  41163. this.z = Math.round(this.z),
  41164. this.w = Math.round(this.w),
  41165. this
  41166. },
  41167. roundToZero: function() {
  41168. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41169. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41170. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41171. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41172. this
  41173. },
  41174. negate: function() {
  41175. return this.x = -this.x,
  41176. this.y = -this.y,
  41177. this.z = -this.z,
  41178. this.w = -this.w,
  41179. this
  41180. },
  41181. dot: function(e) {
  41182. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41183. },
  41184. lengthSq: function() {
  41185. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41186. },
  41187. length: function() {
  41188. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41189. },
  41190. lengthManhattan: function() {
  41191. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41192. },
  41193. normalize: function() {
  41194. return this.divideScalar(this.length())
  41195. },
  41196. setLength: function(e) {
  41197. return this.multiplyScalar(e / this.length())
  41198. },
  41199. lerp: function(e, t) {
  41200. return this.x += (e.x - this.x) * t,
  41201. this.y += (e.y - this.y) * t,
  41202. this.z += (e.z - this.z) * t,
  41203. this.w += (e.w - this.w) * t,
  41204. this
  41205. },
  41206. lerpVectors: function(e, t, i) {
  41207. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41208. this
  41209. },
  41210. equals: function(e) {
  41211. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41212. },
  41213. fromArray: function(e, t) {
  41214. return void 0 === t && (t = 0),
  41215. this.x = e[t],
  41216. this.y = e[t + 1],
  41217. this.z = e[t + 2],
  41218. this.w = e[t + 3],
  41219. this
  41220. },
  41221. toArray: function(e, t) {
  41222. return void 0 === e && (e = []),
  41223. void 0 === t && (t = 0),
  41224. e[t] = this.x,
  41225. e[t + 1] = this.y,
  41226. e[t + 2] = this.z,
  41227. e[t + 3] = this.w,
  41228. e
  41229. },
  41230. fromAttribute: function(e, t, i) {
  41231. return void 0 === i && (i = 0),
  41232. t = t * e.itemSize + i,
  41233. this.x = e.array[t],
  41234. this.y = e.array[t + 1],
  41235. this.z = e.array[t + 2],
  41236. this.w = e.array[t + 3],
  41237. this
  41238. }
  41239. },
  41240. n.Euler = function(e, t, i, r) {
  41241. this._x = e || 0,
  41242. this._y = t || 0,
  41243. this._z = i || 0,
  41244. this._order = r || n.Euler.DefaultOrder
  41245. }
  41246. ,
  41247. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41248. n.Euler.DefaultOrder = "XYZ",
  41249. n.Euler.prototype = {
  41250. constructor: n.Euler,
  41251. get x() {
  41252. return this._x
  41253. },
  41254. set x(e) {
  41255. this._x = e,
  41256. this.onChangeCallback()
  41257. },
  41258. get y() {
  41259. return this._y
  41260. },
  41261. set y(e) {
  41262. this._y = e,
  41263. this.onChangeCallback()
  41264. },
  41265. get z() {
  41266. return this._z
  41267. },
  41268. set z(e) {
  41269. this._z = e,
  41270. this.onChangeCallback()
  41271. },
  41272. get order() {
  41273. return this._order
  41274. },
  41275. set order(e) {
  41276. this._order = e,
  41277. this.onChangeCallback()
  41278. },
  41279. set: function(e, t, i, n) {
  41280. return this._x = e,
  41281. this._y = t,
  41282. this._z = i,
  41283. this._order = n || this._order,
  41284. this.onChangeCallback(),
  41285. this
  41286. },
  41287. clone: function() {
  41288. return new this.constructor(this._x,this._y,this._z,this._order)
  41289. },
  41290. copy: function(e) {
  41291. return this._x = e._x,
  41292. this._y = e._y,
  41293. this._z = e._z,
  41294. this._order = e._order,
  41295. this.onChangeCallback(),
  41296. this
  41297. },
  41298. setFromRotationMatrix: function(e, t, i) {
  41299. var r = n.Math.clamp
  41300. , o = e.elements
  41301. , a = o[0]
  41302. , s = o[4]
  41303. , l = o[8]
  41304. , c = o[1]
  41305. , h = o[5]
  41306. , u = o[9]
  41307. , d = o[2]
  41308. , p = o[6]
  41309. , f = o[10];
  41310. return t = t || this._order,
  41311. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41312. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41313. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41314. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41315. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41316. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41317. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41318. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41319. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41320. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41321. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41322. this._z = Math.atan2(c, a)) : (this._x = 0,
  41323. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41324. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41325. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41326. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41327. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41328. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41329. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41330. this._order = t,
  41331. i !== !1 && this.onChangeCallback(),
  41332. this
  41333. },
  41334. setFromQuaternion: function() {
  41335. var e;
  41336. return function(t, i, r) {
  41337. return void 0 === e && (e = new n.Matrix4),
  41338. e.makeRotationFromQuaternion(t),
  41339. this.setFromRotationMatrix(e, i, r),
  41340. this
  41341. }
  41342. }(),
  41343. setFromVector3: function(e, t) {
  41344. return this.set(e.x, e.y, e.z, t || this._order)
  41345. },
  41346. reorder: function() {
  41347. var e = new n.Quaternion;
  41348. return function(t) {
  41349. e.setFromEuler(this),
  41350. this.setFromQuaternion(e, t)
  41351. }
  41352. }(),
  41353. equals: function(e) {
  41354. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41355. },
  41356. fromArray: function(e) {
  41357. return this._x = e[0],
  41358. this._y = e[1],
  41359. this._z = e[2],
  41360. void 0 !== e[3] && (this._order = e[3]),
  41361. this.onChangeCallback(),
  41362. this
  41363. },
  41364. toArray: function(e, t) {
  41365. return void 0 === e && (e = []),
  41366. void 0 === t && (t = 0),
  41367. e[t] = this._x,
  41368. e[t + 1] = this._y,
  41369. e[t + 2] = this._z,
  41370. e[t + 3] = this._order,
  41371. e
  41372. },
  41373. toVector3: function(e) {
  41374. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41375. },
  41376. onChange: function(e) {
  41377. return this.onChangeCallback = e,
  41378. this
  41379. },
  41380. onChangeCallback: function() {}
  41381. },
  41382. n.Line3 = function(e, t) {
  41383. this.start = void 0 !== e ? e : new n.Vector3,
  41384. this.end = void 0 !== t ? t : new n.Vector3
  41385. }
  41386. ,
  41387. n.Line3.prototype = {
  41388. constructor: n.Line3,
  41389. set: function(e, t) {
  41390. return this.start.copy(e),
  41391. this.end.copy(t),
  41392. this
  41393. },
  41394. clone: function() {
  41395. return (new this.constructor).copy(this)
  41396. },
  41397. copy: function(e) {
  41398. return this.start.copy(e.start),
  41399. this.end.copy(e.end),
  41400. this
  41401. },
  41402. center: function(e) {
  41403. var t = e || new n.Vector3;
  41404. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41405. },
  41406. delta: function(e) {
  41407. var t = e || new n.Vector3;
  41408. return t.subVectors(this.end, this.start)
  41409. },
  41410. distanceSq: function() {
  41411. return this.start.distanceToSquared(this.end)
  41412. },
  41413. distance: function() {
  41414. return this.start.distanceTo(this.end)
  41415. },
  41416. at: function(e, t) {
  41417. var i = t || new n.Vector3;
  41418. return this.delta(i).multiplyScalar(e).add(this.start)
  41419. },
  41420. closestPointToPointParameter: function() {
  41421. var e = new n.Vector3
  41422. , t = new n.Vector3;
  41423. return function(i, r) {
  41424. e.subVectors(i, this.start),
  41425. t.subVectors(this.end, this.start);
  41426. var o = t.dot(t)
  41427. , a = t.dot(e)
  41428. , s = a / o;
  41429. return r && (s = n.Math.clamp(s, 0, 1)),
  41430. s
  41431. }
  41432. }(),
  41433. closestPointToPoint: function(e, t, i) {
  41434. var r = this.closestPointToPointParameter(e, t)
  41435. , o = i || new n.Vector3;
  41436. return this.delta(o).multiplyScalar(r).add(this.start)
  41437. },
  41438. applyMatrix4: function(e) {
  41439. return this.start.applyMatrix4(e),
  41440. this.end.applyMatrix4(e),
  41441. this
  41442. },
  41443. equals: function(e) {
  41444. return e.start.equals(this.start) && e.end.equals(this.end)
  41445. }
  41446. },
  41447. n.Box2 = function(e, t) {
  41448. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41449. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41450. }
  41451. ,
  41452. n.Box2.prototype = {
  41453. constructor: n.Box2,
  41454. set: function(e, t) {
  41455. return this.min.copy(e),
  41456. this.max.copy(t),
  41457. this
  41458. },
  41459. setFromPoints: function(e) {
  41460. this.makeEmpty();
  41461. for (var t = 0, i = e.length; t < i; t++)
  41462. this.expandByPoint(e[t]);
  41463. return this
  41464. },
  41465. setFromCenterAndSize: function() {
  41466. var e = new n.Vector2;
  41467. return function(t, i) {
  41468. var n = e.copy(i).multiplyScalar(.5);
  41469. return this.min.copy(t).sub(n),
  41470. this.max.copy(t).add(n),
  41471. this
  41472. }
  41473. }(),
  41474. clone: function() {
  41475. return (new this.constructor).copy(this)
  41476. },
  41477. copy: function(e) {
  41478. return this.min.copy(e.min),
  41479. this.max.copy(e.max),
  41480. this
  41481. },
  41482. makeEmpty: function() {
  41483. return this.min.x = this.min.y = +(1 / 0),
  41484. this.max.x = this.max.y = -(1 / 0),
  41485. this
  41486. },
  41487. isEmpty: function() {
  41488. return this.max.x < this.min.x || this.max.y < this.min.y
  41489. },
  41490. center: function(e) {
  41491. var t = e || new n.Vector2;
  41492. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41493. },
  41494. size: function(e) {
  41495. var t = e || new n.Vector2;
  41496. return t.subVectors(this.max, this.min)
  41497. },
  41498. expandByPoint: function(e) {
  41499. return this.min.min(e),
  41500. this.max.max(e),
  41501. this
  41502. },
  41503. expandByVector: function(e) {
  41504. return this.min.sub(e),
  41505. this.max.add(e),
  41506. this
  41507. },
  41508. expandByScalar: function(e) {
  41509. return this.min.addScalar(-e),
  41510. this.max.addScalar(e),
  41511. this
  41512. },
  41513. containsPoint: function(e) {
  41514. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41515. },
  41516. containsBox: function(e) {
  41517. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  41518. },
  41519. getParameter: function(e, t) {
  41520. var i = t || new n.Vector2;
  41521. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  41522. },
  41523. intersectsBox: function(e) {
  41524. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  41525. },
  41526. clampPoint: function(e, t) {
  41527. var i = t || new n.Vector2;
  41528. return i.copy(e).clamp(this.min, this.max)
  41529. },
  41530. distanceToPoint: function() {
  41531. var e = new n.Vector2;
  41532. return function(t) {
  41533. var i = e.copy(t).clamp(this.min, this.max);
  41534. return i.sub(t).length()
  41535. }
  41536. }(),
  41537. intersect: function(e) {
  41538. return this.min.max(e.min),
  41539. this.max.min(e.max),
  41540. this
  41541. },
  41542. union: function(e) {
  41543. return this.min.min(e.min),
  41544. this.max.max(e.max),
  41545. this
  41546. },
  41547. translate: function(e) {
  41548. return this.min.add(e),
  41549. this.max.add(e),
  41550. this
  41551. },
  41552. equals: function(e) {
  41553. return e.min.equals(this.min) && e.max.equals(this.max)
  41554. }
  41555. },
  41556. n.Box3 = function(e, t) {
  41557. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41558. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41559. }
  41560. ,
  41561. n.Box3.prototype = {
  41562. constructor: n.Box3,
  41563. set: function(e, t) {
  41564. return this.min.copy(e),
  41565. this.max.copy(t),
  41566. this
  41567. },
  41568. setFromArray: function(e) {
  41569. this.makeEmpty();
  41570. for (var t = +(1 / 0), i = +(1 / 0), n = +(1 / 0), r = -(1 / 0), o = -(1 / 0), a = -(1 / 0), s = 0, l = e.length; s < l; s += 3) {
  41571. var c = e[s]
  41572. , h = e[s + 1]
  41573. , u = e[s + 2];
  41574. c < t && (t = c),
  41575. h < i && (i = h),
  41576. u < n && (n = u),
  41577. c > r && (r = c),
  41578. h > o && (o = h),
  41579. u > a && (a = u)
  41580. }
  41581. this.min.set(t, i, n),
  41582. this.max.set(r, o, a)
  41583. },
  41584. setFromPoints: function(e) {
  41585. this.makeEmpty();
  41586. for (var t = 0, i = e.length; t < i; t++)
  41587. this.expandByPoint(e[t]);
  41588. return this
  41589. },
  41590. setFromCenterAndSize: function() {
  41591. var e = new n.Vector3;
  41592. return function(t, i) {
  41593. var n = e.copy(i).multiplyScalar(.5);
  41594. return this.min.copy(t).sub(n),
  41595. this.max.copy(t).add(n),
  41596. this
  41597. }
  41598. }(),
  41599. setFromObject: function() {
  41600. var e;
  41601. return function(t) {
  41602. void 0 === e && (e = new n.Box3);
  41603. var i = this;
  41604. return this.makeEmpty(),
  41605. t.updateMatrixWorld(!0),
  41606. t.traverse(function(t) {
  41607. var n = t.geometry;
  41608. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41609. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41610. e.applyMatrix4(t.matrixWorld),
  41611. i.union(e)))
  41612. }),
  41613. this
  41614. }
  41615. }(),
  41616. clone: function() {
  41617. return (new this.constructor).copy(this)
  41618. },
  41619. copy: function(e) {
  41620. return this.min.copy(e.min),
  41621. this.max.copy(e.max),
  41622. this
  41623. },
  41624. makeEmpty: function() {
  41625. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41626. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41627. this
  41628. },
  41629. isEmpty: function() {
  41630. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41631. },
  41632. center: function(e) {
  41633. var t = e || new n.Vector3;
  41634. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41635. },
  41636. size: function(e) {
  41637. var t = e || new n.Vector3;
  41638. return t.subVectors(this.max, this.min)
  41639. },
  41640. expandByPoint: function(e) {
  41641. return this.min.min(e),
  41642. this.max.max(e),
  41643. this
  41644. },
  41645. expandByVector: function(e) {
  41646. return this.min.sub(e),
  41647. this.max.add(e),
  41648. this
  41649. },
  41650. expandByScalar: function(e) {
  41651. return this.min.addScalar(-e),
  41652. this.max.addScalar(e),
  41653. this
  41654. },
  41655. containsPoint: function(e) {
  41656. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  41657. },
  41658. containsBox: function(e) {
  41659. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  41660. },
  41661. getParameter: function(e, t) {
  41662. var i = t || new n.Vector3;
  41663. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  41664. },
  41665. intersectsBox: function(e) {
  41666. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  41667. },
  41668. intersectsSphere: function() {
  41669. var e;
  41670. return function(t) {
  41671. return void 0 === e && (e = new n.Vector3),
  41672. this.clampPoint(t.center, e),
  41673. e.distanceToSquared(t.center) <= t.radius * t.radius
  41674. }
  41675. }(),
  41676. intersectsPlane: function(e) {
  41677. var t, i;
  41678. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41679. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41680. i = e.normal.x * this.min.x),
  41681. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41682. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41683. i += e.normal.y * this.min.y),
  41684. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41685. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41686. i += e.normal.z * this.min.z),
  41687. t <= e.constant && i >= e.constant
  41688. },
  41689. clampPoint: function(e, t) {
  41690. var i = t || new n.Vector3;
  41691. return i.copy(e).clamp(this.min, this.max)
  41692. },
  41693. distanceToPoint: function() {
  41694. var e = new n.Vector3;
  41695. return function(t) {
  41696. var i = e.copy(t).clamp(this.min, this.max);
  41697. return i.sub(t).length()
  41698. }
  41699. }(),
  41700. getBoundingSphere: function() {
  41701. var e = new n.Vector3;
  41702. return function(t) {
  41703. var i = t || new n.Sphere;
  41704. return i.center = this.center(),
  41705. i.radius = .5 * this.size(e).length(),
  41706. i
  41707. }
  41708. }(),
  41709. intersect: function(e) {
  41710. return this.min.max(e.min),
  41711. this.max.min(e.max),
  41712. this
  41713. },
  41714. union: function(e) {
  41715. return this.min.min(e.min),
  41716. this.max.max(e.max),
  41717. this
  41718. },
  41719. applyMatrix4: function() {
  41720. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  41721. return function(t) {
  41722. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41723. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41724. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41725. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41726. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41727. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41728. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41729. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41730. this.makeEmpty(),
  41731. this.setFromPoints(e),
  41732. this
  41733. }
  41734. }(),
  41735. translate: function(e) {
  41736. return this.min.add(e),
  41737. this.max.add(e),
  41738. this
  41739. },
  41740. equals: function(e) {
  41741. return e.min.equals(this.min) && e.max.equals(this.max)
  41742. }
  41743. },
  41744. n.Matrix3 = function() {
  41745. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41746. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41747. }
  41748. ,
  41749. n.Matrix3.prototype = {
  41750. constructor: n.Matrix3,
  41751. set: function(e, t, i, n, r, o, a, s, l) {
  41752. var c = this.elements;
  41753. return c[0] = e,
  41754. c[1] = n,
  41755. c[2] = a,
  41756. c[3] = t,
  41757. c[4] = r,
  41758. c[5] = s,
  41759. c[6] = i,
  41760. c[7] = o,
  41761. c[8] = l,
  41762. this
  41763. },
  41764. identity: function() {
  41765. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41766. this
  41767. },
  41768. clone: function() {
  41769. return (new this.constructor).fromArray(this.elements)
  41770. },
  41771. copy: function(e) {
  41772. var t = e.elements;
  41773. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41774. this
  41775. },
  41776. setFromMatrix4: function(e) {
  41777. var t = e.elements;
  41778. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41779. this
  41780. },
  41781. applyToVector3Array: function() {
  41782. var e;
  41783. return function(t, i, r) {
  41784. void 0 === e && (e = new n.Vector3),
  41785. void 0 === i && (i = 0),
  41786. void 0 === r && (r = t.length);
  41787. for (var o = 0, a = i; o < r; o += 3,
  41788. a += 3)
  41789. e.fromArray(t, a),
  41790. e.applyMatrix3(this),
  41791. e.toArray(t, a);
  41792. return t
  41793. }
  41794. }(),
  41795. applyToBuffer: function() {
  41796. var e;
  41797. return function(t, i, r) {
  41798. void 0 === e && (e = new n.Vector3),
  41799. void 0 === i && (i = 0),
  41800. void 0 === r && (r = t.length / t.itemSize);
  41801. for (var o = 0, a = i; o < r; o++,
  41802. a++)
  41803. e.x = t.getX(a),
  41804. e.y = t.getY(a),
  41805. e.z = t.getZ(a),
  41806. e.applyMatrix3(this),
  41807. t.setXYZ(e.x, e.y, e.z);
  41808. return t
  41809. }
  41810. }(),
  41811. multiplyScalar: function(e) {
  41812. var t = this.elements;
  41813. return t[0] *= e,
  41814. t[3] *= e,
  41815. t[6] *= e,
  41816. t[1] *= e,
  41817. t[4] *= e,
  41818. t[7] *= e,
  41819. t[2] *= e,
  41820. t[5] *= e,
  41821. t[8] *= e,
  41822. this
  41823. },
  41824. determinant: function() {
  41825. var e = this.elements
  41826. , t = e[0]
  41827. , i = e[1]
  41828. , n = e[2]
  41829. , r = e[3]
  41830. , o = e[4]
  41831. , a = e[5]
  41832. , s = e[6]
  41833. , l = e[7]
  41834. , c = e[8];
  41835. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41836. },
  41837. getInverse: function(e, t) {
  41838. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41839. var i = e.elements
  41840. , r = this.elements
  41841. , o = i[0]
  41842. , a = i[1]
  41843. , s = i[2]
  41844. , l = i[3]
  41845. , c = i[4]
  41846. , h = i[5]
  41847. , u = i[6]
  41848. , d = i[7]
  41849. , p = i[8]
  41850. , f = p * c - h * d
  41851. , g = h * u - p * l
  41852. , m = d * l - c * u
  41853. , v = o * f + a * g + s * m;
  41854. if (0 === v) {
  41855. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41856. if (t)
  41857. throw new Error(A);
  41858. return console.warn(A),
  41859. this.identity()
  41860. }
  41861. return r[0] = f,
  41862. r[1] = s * d - p * a,
  41863. r[2] = h * a - s * c,
  41864. r[3] = g,
  41865. r[4] = p * o - s * u,
  41866. r[5] = s * l - h * o,
  41867. r[6] = m,
  41868. r[7] = a * u - d * o,
  41869. r[8] = c * o - a * l,
  41870. this.multiplyScalar(1 / v)
  41871. },
  41872. transpose: function() {
  41873. var e, t = this.elements;
  41874. return e = t[1],
  41875. t[1] = t[3],
  41876. t[3] = e,
  41877. e = t[2],
  41878. t[2] = t[6],
  41879. t[6] = e,
  41880. e = t[5],
  41881. t[5] = t[7],
  41882. t[7] = e,
  41883. this
  41884. },
  41885. flattenToArrayOffset: function(e, t) {
  41886. var i = this.elements;
  41887. return e[t] = i[0],
  41888. e[t + 1] = i[1],
  41889. e[t + 2] = i[2],
  41890. e[t + 3] = i[3],
  41891. e[t + 4] = i[4],
  41892. e[t + 5] = i[5],
  41893. e[t + 6] = i[6],
  41894. e[t + 7] = i[7],
  41895. e[t + 8] = i[8],
  41896. e
  41897. },
  41898. getNormalMatrix: function(e) {
  41899. return this.setFromMatrix4(e).getInverse(this).transpose()
  41900. },
  41901. transposeIntoArray: function(e) {
  41902. var t = this.elements;
  41903. return e[0] = t[0],
  41904. e[1] = t[3],
  41905. e[2] = t[6],
  41906. e[3] = t[1],
  41907. e[4] = t[4],
  41908. e[5] = t[7],
  41909. e[6] = t[2],
  41910. e[7] = t[5],
  41911. e[8] = t[8],
  41912. this
  41913. },
  41914. fromArray: function(e) {
  41915. return this.elements.set(e),
  41916. this
  41917. },
  41918. toArray: function() {
  41919. var e = this.elements;
  41920. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41921. }
  41922. },
  41923. n.Matrix4 = function() {
  41924. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41925. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41926. }
  41927. ,
  41928. n.Matrix4.prototype = {
  41929. constructor: n.Matrix4,
  41930. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41931. var m = this.elements;
  41932. return m[0] = e,
  41933. m[4] = t,
  41934. m[8] = i,
  41935. m[12] = n,
  41936. m[1] = r,
  41937. m[5] = o,
  41938. m[9] = a,
  41939. m[13] = s,
  41940. m[2] = l,
  41941. m[6] = c,
  41942. m[10] = h,
  41943. m[14] = u,
  41944. m[3] = d,
  41945. m[7] = p,
  41946. m[11] = f,
  41947. m[15] = g,
  41948. this
  41949. },
  41950. identity: function() {
  41951. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41952. this
  41953. },
  41954. clone: function() {
  41955. return (new n.Matrix4).fromArray(this.elements)
  41956. },
  41957. copy: function(e) {
  41958. return this.elements.set(e.elements),
  41959. this
  41960. },
  41961. copyPosition: function(e) {
  41962. var t = this.elements
  41963. , i = e.elements;
  41964. return t[12] = i[12],
  41965. t[13] = i[13],
  41966. t[14] = i[14],
  41967. this
  41968. },
  41969. extractBasis: function(e, t, i) {
  41970. return e.setFromMatrixColumn(this, 0),
  41971. t.setFromMatrixColumn(this, 1),
  41972. i.setFromMatrixColumn(this, 2),
  41973. this
  41974. },
  41975. makeBasis: function(e, t, i) {
  41976. return 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),
  41977. this
  41978. },
  41979. extractRotation: function() {
  41980. var e;
  41981. return function(t) {
  41982. void 0 === e && (e = new n.Vector3);
  41983. var i = this.elements
  41984. , r = t.elements
  41985. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41986. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41987. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41988. return i[0] = r[0] * o,
  41989. i[1] = r[1] * o,
  41990. i[2] = r[2] * o,
  41991. i[4] = r[4] * a,
  41992. i[5] = r[5] * a,
  41993. i[6] = r[6] * a,
  41994. i[8] = r[8] * s,
  41995. i[9] = r[9] * s,
  41996. i[10] = r[10] * s,
  41997. this
  41998. }
  41999. }(),
  42000. makeRotationFromEuler: function(e) {
  42001. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42002. var t = this.elements
  42003. , i = e.x
  42004. , r = e.y
  42005. , o = e.z
  42006. , a = Math.cos(i)
  42007. , s = Math.sin(i)
  42008. , l = Math.cos(r)
  42009. , c = Math.sin(r)
  42010. , h = Math.cos(o)
  42011. , u = Math.sin(o);
  42012. if ("XYZ" === e.order) {
  42013. var d = a * h
  42014. , p = a * u
  42015. , f = s * h
  42016. , g = s * u;
  42017. t[0] = l * h,
  42018. t[4] = -l * u,
  42019. t[8] = c,
  42020. t[1] = p + f * c,
  42021. t[5] = d - g * c,
  42022. t[9] = -s * l,
  42023. t[2] = g - d * c,
  42024. t[6] = f + p * c,
  42025. t[10] = a * l
  42026. } else if ("YXZ" === e.order) {
  42027. var m = l * h
  42028. , v = l * u
  42029. , A = c * h
  42030. , y = c * u;
  42031. t[0] = m + y * s,
  42032. t[4] = A * s - v,
  42033. t[8] = a * c,
  42034. t[1] = a * u,
  42035. t[5] = a * h,
  42036. t[9] = -s,
  42037. t[2] = v * s - A,
  42038. t[6] = y + m * s,
  42039. t[10] = a * l
  42040. } else if ("ZXY" === e.order) {
  42041. var m = l * h
  42042. , v = l * u
  42043. , A = c * h
  42044. , y = c * u;
  42045. t[0] = m - y * s,
  42046. t[4] = -a * u,
  42047. t[8] = A + v * s,
  42048. t[1] = v + A * s,
  42049. t[5] = a * h,
  42050. t[9] = y - m * s,
  42051. t[2] = -a * c,
  42052. t[6] = s,
  42053. t[10] = a * l
  42054. } else if ("ZYX" === e.order) {
  42055. var d = a * h
  42056. , p = a * u
  42057. , f = s * h
  42058. , g = s * u;
  42059. t[0] = l * h,
  42060. t[4] = f * c - p,
  42061. t[8] = d * c + g,
  42062. t[1] = l * u,
  42063. t[5] = g * c + d,
  42064. t[9] = p * c - f,
  42065. t[2] = -c,
  42066. t[6] = s * l,
  42067. t[10] = a * l
  42068. } else if ("YZX" === e.order) {
  42069. var C = a * l
  42070. , I = a * c
  42071. , E = s * l
  42072. , b = s * c;
  42073. t[0] = l * h,
  42074. t[4] = b - C * u,
  42075. t[8] = E * u + I,
  42076. t[1] = u,
  42077. t[5] = a * h,
  42078. t[9] = -s * h,
  42079. t[2] = -c * h,
  42080. t[6] = I * u + E,
  42081. t[10] = C - b * u
  42082. } else if ("XZY" === e.order) {
  42083. var C = a * l
  42084. , I = a * c
  42085. , E = s * l
  42086. , b = s * c;
  42087. t[0] = l * h,
  42088. t[4] = -u,
  42089. t[8] = c * h,
  42090. t[1] = C * u + b,
  42091. t[5] = a * h,
  42092. t[9] = I * u - E,
  42093. t[2] = E * u - I,
  42094. t[6] = s * h,
  42095. t[10] = b * u + C
  42096. }
  42097. return t[3] = 0,
  42098. t[7] = 0,
  42099. t[11] = 0,
  42100. t[12] = 0,
  42101. t[13] = 0,
  42102. t[14] = 0,
  42103. t[15] = 1,
  42104. this
  42105. },
  42106. makeRotationFromQuaternion: function(e) {
  42107. var t = this.elements
  42108. , i = e.x
  42109. , n = e.y
  42110. , r = e.z
  42111. , o = e.w
  42112. , a = i + i
  42113. , s = n + n
  42114. , l = r + r
  42115. , c = i * a
  42116. , h = i * s
  42117. , u = i * l
  42118. , d = n * s
  42119. , p = n * l
  42120. , f = r * l
  42121. , g = o * a
  42122. , m = o * s
  42123. , v = o * l;
  42124. return t[0] = 1 - (d + f),
  42125. t[4] = h - v,
  42126. t[8] = u + m,
  42127. t[1] = h + v,
  42128. t[5] = 1 - (c + f),
  42129. t[9] = p - g,
  42130. t[2] = u - m,
  42131. t[6] = p + g,
  42132. t[10] = 1 - (c + d),
  42133. t[3] = 0,
  42134. t[7] = 0,
  42135. t[11] = 0,
  42136. t[12] = 0,
  42137. t[13] = 0,
  42138. t[14] = 0,
  42139. t[15] = 1,
  42140. this
  42141. },
  42142. lookAt: function() {
  42143. var e, t, i;
  42144. return function(r, o, a) {
  42145. void 0 === e && (e = new n.Vector3),
  42146. void 0 === t && (t = new n.Vector3),
  42147. void 0 === i && (i = new n.Vector3);
  42148. var s = this.elements;
  42149. return i.subVectors(r, o).normalize(),
  42150. 0 === i.lengthSq() && (i.z = 1),
  42151. e.crossVectors(a, i).normalize(),
  42152. 0 === e.lengthSq() && (i.x += 1e-4,
  42153. e.crossVectors(a, i).normalize()),
  42154. t.crossVectors(i, e),
  42155. s[0] = e.x,
  42156. s[4] = t.x,
  42157. s[8] = i.x,
  42158. s[1] = e.y,
  42159. s[5] = t.y,
  42160. s[9] = i.y,
  42161. s[2] = e.z,
  42162. s[6] = t.z,
  42163. s[10] = i.z,
  42164. this
  42165. }
  42166. }(),
  42167. multiply: function(e, t) {
  42168. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42169. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42170. },
  42171. multiplyMatrices: function(e, t) {
  42172. var i = e.elements
  42173. , n = t.elements
  42174. , r = this.elements
  42175. , o = i[0]
  42176. , a = i[4]
  42177. , s = i[8]
  42178. , l = i[12]
  42179. , c = i[1]
  42180. , h = i[5]
  42181. , u = i[9]
  42182. , d = i[13]
  42183. , p = i[2]
  42184. , f = i[6]
  42185. , g = i[10]
  42186. , m = i[14]
  42187. , v = i[3]
  42188. , A = i[7]
  42189. , y = i[11]
  42190. , C = i[15]
  42191. , I = n[0]
  42192. , E = n[4]
  42193. , b = n[8]
  42194. , w = n[12]
  42195. , _ = n[1]
  42196. , T = n[5]
  42197. , x = n[9]
  42198. , S = n[13]
  42199. , M = n[2]
  42200. , R = n[6]
  42201. , P = n[10]
  42202. , O = n[14]
  42203. , L = n[3]
  42204. , D = n[7]
  42205. , N = n[11]
  42206. , B = n[15];
  42207. return r[0] = o * I + a * _ + s * M + l * L,
  42208. r[4] = o * E + a * T + s * R + l * D,
  42209. r[8] = o * b + a * x + s * P + l * N,
  42210. r[12] = o * w + a * S + s * O + l * B,
  42211. r[1] = c * I + h * _ + u * M + d * L,
  42212. r[5] = c * E + h * T + u * R + d * D,
  42213. r[9] = c * b + h * x + u * P + d * N,
  42214. r[13] = c * w + h * S + u * O + d * B,
  42215. r[2] = p * I + f * _ + g * M + m * L,
  42216. r[6] = p * E + f * T + g * R + m * D,
  42217. r[10] = p * b + f * x + g * P + m * N,
  42218. r[14] = p * w + f * S + g * O + m * B,
  42219. r[3] = v * I + A * _ + y * M + C * L,
  42220. r[7] = v * E + A * T + y * R + C * D,
  42221. r[11] = v * b + A * x + y * P + C * N,
  42222. r[15] = v * w + A * S + y * O + C * B,
  42223. this
  42224. },
  42225. multiplyToArray: function(e, t, i) {
  42226. var n = this.elements;
  42227. return this.multiplyMatrices(e, t),
  42228. i[0] = n[0],
  42229. i[1] = n[1],
  42230. i[2] = n[2],
  42231. i[3] = n[3],
  42232. i[4] = n[4],
  42233. i[5] = n[5],
  42234. i[6] = n[6],
  42235. i[7] = n[7],
  42236. i[8] = n[8],
  42237. i[9] = n[9],
  42238. i[10] = n[10],
  42239. i[11] = n[11],
  42240. i[12] = n[12],
  42241. i[13] = n[13],
  42242. i[14] = n[14],
  42243. i[15] = n[15],
  42244. this
  42245. },
  42246. multiplyScalar: function(e) {
  42247. var t = this.elements;
  42248. return t[0] *= e,
  42249. t[4] *= e,
  42250. t[8] *= e,
  42251. t[12] *= e,
  42252. t[1] *= e,
  42253. t[5] *= e,
  42254. t[9] *= e,
  42255. t[13] *= e,
  42256. t[2] *= e,
  42257. t[6] *= e,
  42258. t[10] *= e,
  42259. t[14] *= e,
  42260. t[3] *= e,
  42261. t[7] *= e,
  42262. t[11] *= e,
  42263. t[15] *= e,
  42264. this
  42265. },
  42266. applyToVector3Array: function() {
  42267. var e;
  42268. return function(t, i, r) {
  42269. void 0 === e && (e = new n.Vector3),
  42270. void 0 === i && (i = 0),
  42271. void 0 === r && (r = t.length);
  42272. for (var o = 0, a = i; o < r; o += 3,
  42273. a += 3)
  42274. e.fromArray(t, a),
  42275. e.applyMatrix4(this),
  42276. e.toArray(t, a);
  42277. return t
  42278. }
  42279. }(),
  42280. applyToBuffer: function() {
  42281. var e;
  42282. return function(t, i, r) {
  42283. void 0 === e && (e = new n.Vector3),
  42284. void 0 === i && (i = 0),
  42285. void 0 === r && (r = t.length / t.itemSize);
  42286. for (var o = 0, a = i; o < r; o++,
  42287. a++)
  42288. e.x = t.getX(a),
  42289. e.y = t.getY(a),
  42290. e.z = t.getZ(a),
  42291. e.applyMatrix4(this),
  42292. t.setXYZ(e.x, e.y, e.z);
  42293. return t
  42294. }
  42295. }(),
  42296. determinant: function() {
  42297. var e = this.elements
  42298. , t = e[0]
  42299. , i = e[4]
  42300. , n = e[8]
  42301. , r = e[12]
  42302. , o = e[1]
  42303. , a = e[5]
  42304. , s = e[9]
  42305. , l = e[13]
  42306. , c = e[2]
  42307. , h = e[6]
  42308. , u = e[10]
  42309. , d = e[14]
  42310. , p = e[3]
  42311. , f = e[7]
  42312. , g = e[11]
  42313. , m = e[15];
  42314. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  42315. },
  42316. transpose: function() {
  42317. var e, t = this.elements;
  42318. return e = t[1],
  42319. t[1] = t[4],
  42320. t[4] = e,
  42321. e = t[2],
  42322. t[2] = t[8],
  42323. t[8] = e,
  42324. e = t[6],
  42325. t[6] = t[9],
  42326. t[9] = e,
  42327. e = t[3],
  42328. t[3] = t[12],
  42329. t[12] = e,
  42330. e = t[7],
  42331. t[7] = t[13],
  42332. t[13] = e,
  42333. e = t[11],
  42334. t[11] = t[14],
  42335. t[14] = e,
  42336. this
  42337. },
  42338. flattenToArrayOffset: function(e, t) {
  42339. var i = this.elements;
  42340. return e[t] = i[0],
  42341. e[t + 1] = i[1],
  42342. e[t + 2] = i[2],
  42343. e[t + 3] = i[3],
  42344. e[t + 4] = i[4],
  42345. e[t + 5] = i[5],
  42346. e[t + 6] = i[6],
  42347. e[t + 7] = i[7],
  42348. e[t + 8] = i[8],
  42349. e[t + 9] = i[9],
  42350. e[t + 10] = i[10],
  42351. e[t + 11] = i[11],
  42352. e[t + 12] = i[12],
  42353. e[t + 13] = i[13],
  42354. e[t + 14] = i[14],
  42355. e[t + 15] = i[15],
  42356. e
  42357. },
  42358. getPosition: function() {
  42359. var e;
  42360. return function() {
  42361. return void 0 === e && (e = new n.Vector3),
  42362. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42363. e.setFromMatrixColumn(this, 3)
  42364. }
  42365. }(),
  42366. setPosition: function(e) {
  42367. var t = this.elements;
  42368. return t[12] = e.x,
  42369. t[13] = e.y,
  42370. t[14] = e.z,
  42371. this
  42372. },
  42373. getInverse: function(e, t) {
  42374. var i = this.elements
  42375. , n = e.elements
  42376. , r = n[0]
  42377. , o = n[1]
  42378. , a = n[2]
  42379. , s = n[3]
  42380. , l = n[4]
  42381. , c = n[5]
  42382. , h = n[6]
  42383. , u = n[7]
  42384. , d = n[8]
  42385. , p = n[9]
  42386. , f = n[10]
  42387. , g = n[11]
  42388. , m = n[12]
  42389. , v = n[13]
  42390. , A = n[14]
  42391. , y = n[15]
  42392. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42393. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42394. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42395. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42396. , w = r * C + o * I + a * E + s * b;
  42397. if (0 === w) {
  42398. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42399. if (t)
  42400. throw new Error(_);
  42401. return console.warn(_),
  42402. this.identity()
  42403. }
  42404. return i[0] = C,
  42405. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42406. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42407. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42408. i[4] = I,
  42409. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42410. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42411. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42412. i[8] = E,
  42413. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42414. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42415. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42416. i[12] = b,
  42417. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42418. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42419. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42420. this.multiplyScalar(1 / w)
  42421. },
  42422. scale: function(e) {
  42423. var t = this.elements
  42424. , i = e.x
  42425. , n = e.y
  42426. , r = e.z;
  42427. return t[0] *= i,
  42428. t[4] *= n,
  42429. t[8] *= r,
  42430. t[1] *= i,
  42431. t[5] *= n,
  42432. t[9] *= r,
  42433. t[2] *= i,
  42434. t[6] *= n,
  42435. t[10] *= r,
  42436. t[3] *= i,
  42437. t[7] *= n,
  42438. t[11] *= r,
  42439. this
  42440. },
  42441. getMaxScaleOnAxis: function() {
  42442. var e = this.elements
  42443. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42444. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42445. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42446. return Math.sqrt(Math.max(t, i, n))
  42447. },
  42448. makeTranslation: function(e, t, i) {
  42449. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42450. this
  42451. },
  42452. makeRotationX: function(e) {
  42453. var t = Math.cos(e)
  42454. , i = Math.sin(e);
  42455. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42456. this
  42457. },
  42458. makeRotationY: function(e) {
  42459. var t = Math.cos(e)
  42460. , i = Math.sin(e);
  42461. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42462. this
  42463. },
  42464. makeRotationZ: function(e) {
  42465. var t = Math.cos(e)
  42466. , i = Math.sin(e);
  42467. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42468. this
  42469. },
  42470. makeRotationAxis: function(e, t) {
  42471. var i = Math.cos(t)
  42472. , n = Math.sin(t)
  42473. , r = 1 - i
  42474. , o = e.x
  42475. , a = e.y
  42476. , s = e.z
  42477. , l = r * o
  42478. , c = r * a;
  42479. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1),
  42480. this
  42481. },
  42482. makeScale: function(e, t, i) {
  42483. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42484. this
  42485. },
  42486. compose: function(e, t, i) {
  42487. return this.makeRotationFromQuaternion(t),
  42488. this.scale(i),
  42489. this.setPosition(e),
  42490. this
  42491. },
  42492. decompose: function() {
  42493. var e, t;
  42494. return function(i, r, o) {
  42495. void 0 === e && (e = new n.Vector3),
  42496. void 0 === t && (t = new n.Matrix4);
  42497. var a = this.elements
  42498. , s = e.set(a[0], a[1], a[2]).length()
  42499. , l = e.set(a[4], a[5], a[6]).length()
  42500. , c = e.set(a[8], a[9], a[10]).length()
  42501. , h = this.determinant();
  42502. h < 0 && (s = -s),
  42503. i.x = a[12],
  42504. i.y = a[13],
  42505. i.z = a[14],
  42506. t.elements.set(this.elements);
  42507. var u = 1 / s
  42508. , d = 1 / l
  42509. , p = 1 / c;
  42510. return t.elements[0] *= u,
  42511. t.elements[1] *= u,
  42512. t.elements[2] *= u,
  42513. t.elements[4] *= d,
  42514. t.elements[5] *= d,
  42515. t.elements[6] *= d,
  42516. t.elements[8] *= p,
  42517. t.elements[9] *= p,
  42518. t.elements[10] *= p,
  42519. r.setFromRotationMatrix(t),
  42520. o.x = s,
  42521. o.y = l,
  42522. o.z = c,
  42523. this
  42524. }
  42525. }(),
  42526. makeFrustum: function(e, t, i, n, r, o) {
  42527. var a = this.elements
  42528. , s = 2 * r / (t - e)
  42529. , l = 2 * r / (n - i)
  42530. , c = (t + e) / (t - e)
  42531. , h = (n + i) / (n - i)
  42532. , u = -(o + r) / (o - r)
  42533. , d = -2 * o * r / (o - r);
  42534. return a[0] = s,
  42535. a[4] = 0,
  42536. a[8] = c,
  42537. a[12] = 0,
  42538. a[1] = 0,
  42539. a[5] = l,
  42540. a[9] = h,
  42541. a[13] = 0,
  42542. a[2] = 0,
  42543. a[6] = 0,
  42544. a[10] = u,
  42545. a[14] = d,
  42546. a[3] = 0,
  42547. a[7] = 0,
  42548. a[11] = -1,
  42549. a[15] = 0,
  42550. this
  42551. },
  42552. makePerspective: function(e, t, i, r) {
  42553. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42554. , a = -o
  42555. , s = a * t
  42556. , l = o * t;
  42557. return this.makeFrustum(s, l, a, o, i, r)
  42558. },
  42559. makeOrthographic: function(e, t, i, n, r, o) {
  42560. var a = this.elements
  42561. , s = 1 / (t - e)
  42562. , l = 1 / (i - n)
  42563. , c = 1 / (o - r)
  42564. , h = (t + e) * s
  42565. , u = (i + n) * l
  42566. , d = (o + r) * c;
  42567. return a[0] = 2 * s,
  42568. a[4] = 0,
  42569. a[8] = 0,
  42570. a[12] = -h,
  42571. a[1] = 0,
  42572. a[5] = 2 * l,
  42573. a[9] = 0,
  42574. a[13] = -u,
  42575. a[2] = 0,
  42576. a[6] = 0,
  42577. a[10] = -2 * c,
  42578. a[14] = -d,
  42579. a[3] = 0,
  42580. a[7] = 0,
  42581. a[11] = 0,
  42582. a[15] = 1,
  42583. this
  42584. },
  42585. equals: function(e) {
  42586. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42587. if (t[n] !== i[n])
  42588. return !1;
  42589. return !0
  42590. },
  42591. fromArray: function(e) {
  42592. return this.elements.set(e),
  42593. this
  42594. },
  42595. toArray: function() {
  42596. var e = this.elements;
  42597. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
  42598. }
  42599. },
  42600. n.Ray = function(e, t) {
  42601. this.origin = void 0 !== e ? e : new n.Vector3,
  42602. this.direction = void 0 !== t ? t : new n.Vector3
  42603. }
  42604. ,
  42605. n.Ray.prototype = {
  42606. constructor: n.Ray,
  42607. set: function(e, t) {
  42608. return this.origin.copy(e),
  42609. this.direction.copy(t),
  42610. this
  42611. },
  42612. clone: function() {
  42613. return (new this.constructor).copy(this)
  42614. },
  42615. copy: function(e) {
  42616. return this.origin.copy(e.origin),
  42617. this.direction.copy(e.direction),
  42618. this
  42619. },
  42620. at: function(e, t) {
  42621. var i = t || new n.Vector3;
  42622. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42623. },
  42624. lookAt: function(e) {
  42625. this.direction.copy(e).sub(this.origin).normalize()
  42626. },
  42627. recast: function() {
  42628. var e = new n.Vector3;
  42629. return function(t) {
  42630. return this.origin.copy(this.at(t, e)),
  42631. this
  42632. }
  42633. }(),
  42634. closestPointToPoint: function(e, t) {
  42635. var i = t || new n.Vector3;
  42636. i.subVectors(e, this.origin);
  42637. var r = i.dot(this.direction);
  42638. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42639. },
  42640. distanceToPoint: function(e) {
  42641. return Math.sqrt(this.distanceSqToPoint(e))
  42642. },
  42643. distanceSqToPoint: function() {
  42644. var e = new n.Vector3;
  42645. return function(t) {
  42646. var i = e.subVectors(t, this.origin).dot(this.direction);
  42647. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42648. e.distanceToSquared(t))
  42649. }
  42650. }(),
  42651. distanceSqToSegment: function() {
  42652. var e = new n.Vector3
  42653. , t = new n.Vector3
  42654. , i = new n.Vector3;
  42655. return function(n, r, o, a) {
  42656. e.copy(n).add(r).multiplyScalar(.5),
  42657. t.copy(r).sub(n).normalize(),
  42658. i.copy(this.origin).sub(e);
  42659. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  42660. if (m > 0)
  42661. if (s = d * f - p,
  42662. l = d * p - f,
  42663. h = u * m,
  42664. s >= 0)
  42665. if (l >= -h)
  42666. if (l <= h) {
  42667. var v = 1 / m;
  42668. s *= v,
  42669. l *= v,
  42670. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42671. } else
  42672. l = u,
  42673. s = Math.max(0, -(d * l + p)),
  42674. c = -s * s + l * (l + 2 * f) + g;
  42675. else
  42676. l = -u,
  42677. s = Math.max(0, -(d * l + p)),
  42678. c = -s * s + l * (l + 2 * f) + g;
  42679. else
  42680. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42681. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42682. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42683. l = Math.min(Math.max(-u, -f), u),
  42684. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42685. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42686. c = -s * s + l * (l + 2 * f) + g);
  42687. else
  42688. l = d > 0 ? -u : u,
  42689. s = Math.max(0, -(d * l + p)),
  42690. c = -s * s + l * (l + 2 * f) + g;
  42691. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42692. a && a.copy(t).multiplyScalar(l).add(e),
  42693. c
  42694. }
  42695. }(),
  42696. intersectSphere: function() {
  42697. var e = new n.Vector3;
  42698. return function(t, i) {
  42699. e.subVectors(t.center, this.origin);
  42700. var n = e.dot(this.direction)
  42701. , r = e.dot(e) - n * n
  42702. , o = t.radius * t.radius;
  42703. if (r > o)
  42704. return null;
  42705. var a = Math.sqrt(o - r)
  42706. , s = n - a
  42707. , l = n + a;
  42708. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42709. }
  42710. }(),
  42711. intersectsSphere: function(e) {
  42712. return this.distanceToPoint(e.center) <= e.radius
  42713. },
  42714. distanceToPlane: function(e) {
  42715. var t = e.normal.dot(this.direction);
  42716. if (0 === t)
  42717. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42718. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42719. return i >= 0 ? i : null
  42720. },
  42721. intersectPlane: function(e, t) {
  42722. var i = this.distanceToPlane(e);
  42723. return null === i ? null : this.at(i, t)
  42724. },
  42725. intersectsPlane: function(e) {
  42726. var t = e.distanceToPoint(this.origin);
  42727. if (0 === t)
  42728. return !0;
  42729. var i = e.normal.dot(this.direction);
  42730. return i * t < 0
  42731. },
  42732. intersectBox: function(e, t) {
  42733. var i, n, r, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, h = 1 / this.direction.z, u = this.origin;
  42734. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42735. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42736. n = (e.min.x - u.x) * l),
  42737. c >= 0 ? (r = (e.min.y - u.y) * c,
  42738. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42739. o = (e.min.y - u.y) * c),
  42740. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42741. (o < n || n !== n) && (n = o),
  42742. h >= 0 ? (a = (e.min.z - u.z) * h,
  42743. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42744. s = (e.min.z - u.z) * h),
  42745. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42746. (s < n || n !== n) && (n = s),
  42747. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42748. },
  42749. intersectsBox: function() {
  42750. var e = new n.Vector3;
  42751. return function(t) {
  42752. return null !== this.intersectBox(t, e)
  42753. }
  42754. }(),
  42755. intersectTriangle: function() {
  42756. var e = new n.Vector3
  42757. , t = new n.Vector3
  42758. , i = new n.Vector3
  42759. , r = new n.Vector3;
  42760. return function(n, o, a, s, l) {
  42761. t.subVectors(o, n),
  42762. i.subVectors(a, n),
  42763. r.crossVectors(t, i);
  42764. var c, h = this.direction.dot(r);
  42765. if (h > 0) {
  42766. if (s)
  42767. return null;
  42768. c = 1
  42769. } else {
  42770. if (!(h < 0))
  42771. return null;
  42772. c = -1,
  42773. h = -h
  42774. }
  42775. e.subVectors(this.origin, n);
  42776. var u = c * this.direction.dot(i.crossVectors(e, i));
  42777. if (u < 0)
  42778. return null;
  42779. var d = c * this.direction.dot(t.cross(e));
  42780. if (d < 0)
  42781. return null;
  42782. if (u + d > h)
  42783. return null;
  42784. var p = -c * e.dot(r);
  42785. return p < 0 ? null : this.at(p / h, l)
  42786. }
  42787. }(),
  42788. applyMatrix4: function(e) {
  42789. return this.direction.add(this.origin).applyMatrix4(e),
  42790. this.origin.applyMatrix4(e),
  42791. this.direction.sub(this.origin),
  42792. this.direction.normalize(),
  42793. this
  42794. },
  42795. equals: function(e) {
  42796. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42797. }
  42798. },
  42799. n.Sphere = function(e, t) {
  42800. this.center = void 0 !== e ? e : new n.Vector3,
  42801. this.radius = void 0 !== t ? t : 0
  42802. }
  42803. ,
  42804. n.Sphere.prototype = {
  42805. constructor: n.Sphere,
  42806. set: function(e, t) {
  42807. return this.center.copy(e),
  42808. this.radius = t,
  42809. this
  42810. },
  42811. setFromPoints: function() {
  42812. var e = new n.Box3;
  42813. return function(t, i) {
  42814. var n = this.center;
  42815. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42816. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42817. r = Math.max(r, n.distanceToSquared(t[o]));
  42818. return this.radius = Math.sqrt(r),
  42819. this
  42820. }
  42821. }(),
  42822. clone: function() {
  42823. return (new this.constructor).copy(this)
  42824. },
  42825. copy: function(e) {
  42826. return this.center.copy(e.center),
  42827. this.radius = e.radius,
  42828. this
  42829. },
  42830. empty: function() {
  42831. return this.radius <= 0
  42832. },
  42833. containsPoint: function(e) {
  42834. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42835. },
  42836. distanceToPoint: function(e) {
  42837. return e.distanceTo(this.center) - this.radius
  42838. },
  42839. intersectsSphere: function(e) {
  42840. var t = this.radius + e.radius;
  42841. return e.center.distanceToSquared(this.center) <= t * t
  42842. },
  42843. intersectsBox: function(e) {
  42844. return e.intersectsSphere(this)
  42845. },
  42846. intersectsPlane: function(e) {
  42847. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42848. },
  42849. clampPoint: function(e, t) {
  42850. var i = this.center.distanceToSquared(e)
  42851. , r = t || new n.Vector3;
  42852. return r.copy(e),
  42853. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42854. r.multiplyScalar(this.radius).add(this.center)),
  42855. r
  42856. },
  42857. getBoundingBox: function(e) {
  42858. var t = e || new n.Box3;
  42859. return t.set(this.center, this.center),
  42860. t.expandByScalar(this.radius),
  42861. t
  42862. },
  42863. applyMatrix4: function(e) {
  42864. return this.center.applyMatrix4(e),
  42865. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42866. this
  42867. },
  42868. translate: function(e) {
  42869. return this.center.add(e),
  42870. this
  42871. },
  42872. equals: function(e) {
  42873. return e.center.equals(this.center) && e.radius === this.radius
  42874. }
  42875. },
  42876. n.Frustum = function(e, t, i, r, o, a) {
  42877. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  42878. }
  42879. ,
  42880. n.Frustum.prototype = {
  42881. constructor: n.Frustum,
  42882. set: function(e, t, i, n, r, o) {
  42883. var a = this.planes;
  42884. return a[0].copy(e),
  42885. a[1].copy(t),
  42886. a[2].copy(i),
  42887. a[3].copy(n),
  42888. a[4].copy(r),
  42889. a[5].copy(o),
  42890. this
  42891. },
  42892. clone: function() {
  42893. return (new this.constructor).copy(this)
  42894. },
  42895. copy: function(e) {
  42896. for (var t = this.planes, i = 0; i < 6; i++)
  42897. t[i].copy(e.planes[i]);
  42898. return this
  42899. },
  42900. setFromMatrix: function(e) {
  42901. var t = this.planes
  42902. , i = e.elements
  42903. , n = i[0]
  42904. , r = i[1]
  42905. , o = i[2]
  42906. , a = i[3]
  42907. , s = i[4]
  42908. , l = i[5]
  42909. , c = i[6]
  42910. , h = i[7]
  42911. , u = i[8]
  42912. , d = i[9]
  42913. , p = i[10]
  42914. , f = i[11]
  42915. , g = i[12]
  42916. , m = i[13]
  42917. , v = i[14]
  42918. , A = i[15];
  42919. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42920. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42921. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42922. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42923. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42924. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42925. this
  42926. },
  42927. intersectsObject: function() {
  42928. var e = new n.Sphere;
  42929. return function(t) {
  42930. var i = t.geometry;
  42931. return null === i.boundingSphere && i.computeBoundingSphere(),
  42932. e.copy(i.boundingSphere),
  42933. e.applyMatrix4(t.matrixWorld),
  42934. this.intersectsSphere(e)
  42935. }
  42936. }(),
  42937. intersectsSphere: function(e) {
  42938. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42939. var o = t[r].distanceToPoint(i);
  42940. if (o < n)
  42941. return !1
  42942. }
  42943. return !0
  42944. },
  42945. intersectsBox: function() {
  42946. var e = new n.Vector3
  42947. , t = new n.Vector3;
  42948. return function(i) {
  42949. for (var n = this.planes, r = 0; r < 6; r++) {
  42950. var o = n[r];
  42951. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42952. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42953. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42954. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42955. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42956. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42957. var a = o.distanceToPoint(e)
  42958. , s = o.distanceToPoint(t);
  42959. if (a < 0 && s < 0)
  42960. return !1
  42961. }
  42962. return !0
  42963. }
  42964. }(),
  42965. containsPoint: function(e) {
  42966. for (var t = this.planes, i = 0; i < 6; i++)
  42967. if (t[i].distanceToPoint(e) < 0)
  42968. return !1;
  42969. return !0
  42970. }
  42971. },
  42972. n.Plane = function(e, t) {
  42973. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42974. this.constant = void 0 !== t ? t : 0
  42975. }
  42976. ,
  42977. n.Plane.prototype = {
  42978. constructor: n.Plane,
  42979. set: function(e, t) {
  42980. return this.normal.copy(e),
  42981. this.constant = t,
  42982. this
  42983. },
  42984. setComponents: function(e, t, i, n) {
  42985. return this.normal.set(e, t, i),
  42986. this.constant = n,
  42987. this
  42988. },
  42989. setFromNormalAndCoplanarPoint: function(e, t) {
  42990. return this.normal.copy(e),
  42991. this.constant = -t.dot(this.normal),
  42992. this
  42993. },
  42994. setFromCoplanarPoints: function() {
  42995. var e = new n.Vector3
  42996. , t = new n.Vector3;
  42997. return function(i, n, r) {
  42998. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42999. return this.setFromNormalAndCoplanarPoint(o, i),
  43000. this
  43001. }
  43002. }(),
  43003. clone: function() {
  43004. return (new this.constructor).copy(this)
  43005. },
  43006. copy: function(e) {
  43007. return this.normal.copy(e.normal),
  43008. this.constant = e.constant,
  43009. this
  43010. },
  43011. normalize: function() {
  43012. var e = 1 / this.normal.length();
  43013. return this.normal.multiplyScalar(e),
  43014. this.constant *= e,
  43015. this
  43016. },
  43017. negate: function() {
  43018. return this.constant *= -1,
  43019. this.normal.negate(),
  43020. this
  43021. },
  43022. distanceToPoint: function(e) {
  43023. return this.normal.dot(e) + this.constant
  43024. },
  43025. distanceToSphere: function(e) {
  43026. return this.distanceToPoint(e.center) - e.radius
  43027. },
  43028. projectPoint: function(e, t) {
  43029. return this.orthoPoint(e, t).sub(e).negate()
  43030. },
  43031. orthoPoint: function(e, t) {
  43032. var i = this.distanceToPoint(e)
  43033. , r = t || new n.Vector3;
  43034. return r.copy(this.normal).multiplyScalar(i)
  43035. },
  43036. intersectLine: function() {
  43037. var e = new n.Vector3;
  43038. return function(t, i) {
  43039. var r = i || new n.Vector3
  43040. , o = t.delta(e)
  43041. , a = this.normal.dot(o);
  43042. if (0 !== a) {
  43043. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43044. if (!(s < 0 || s > 1))
  43045. return r.copy(o).multiplyScalar(s).add(t.start)
  43046. } else if (0 === this.distanceToPoint(t.start))
  43047. return r.copy(t.start)
  43048. }
  43049. }(),
  43050. intersectsLine: function(e) {
  43051. var t = this.distanceToPoint(e.start)
  43052. , i = this.distanceToPoint(e.end);
  43053. return t < 0 && i > 0 || i < 0 && t > 0
  43054. },
  43055. intersectsBox: function(e) {
  43056. return e.intersectsPlane(this)
  43057. },
  43058. intersectsSphere: function(e) {
  43059. return e.intersectsPlane(this)
  43060. },
  43061. coplanarPoint: function(e) {
  43062. var t = e || new n.Vector3;
  43063. return t.copy(this.normal).multiplyScalar(-this.constant)
  43064. },
  43065. applyMatrix4: function() {
  43066. var e = new n.Vector3
  43067. , t = new n.Vector3
  43068. , i = new n.Matrix3;
  43069. return function(n, r) {
  43070. var o = r || i.getNormalMatrix(n)
  43071. , a = e.copy(this.normal).applyMatrix3(o)
  43072. , s = this.coplanarPoint(t);
  43073. return s.applyMatrix4(n),
  43074. this.setFromNormalAndCoplanarPoint(a, s),
  43075. this
  43076. }
  43077. }(),
  43078. translate: function(e) {
  43079. return this.constant = this.constant - e.dot(this.normal),
  43080. this
  43081. },
  43082. equals: function(e) {
  43083. return e.normal.equals(this.normal) && e.constant === this.constant
  43084. }
  43085. },
  43086. n.Spherical = function(e, t, i) {
  43087. return this.radius = void 0 !== e ? e : 1,
  43088. this.phi = void 0 !== t ? t : 0,
  43089. this.theta = void 0 !== i ? i : 0,
  43090. this
  43091. }
  43092. ,
  43093. n.Spherical.prototype = {
  43094. constructor: n.Spherical,
  43095. set: function(e, t, i) {
  43096. this.radius = e,
  43097. this.phi = t,
  43098. this.theta = i
  43099. },
  43100. clone: function() {
  43101. return (new this.constructor).copy(this)
  43102. },
  43103. copy: function(e) {
  43104. return this.radius.copy(e.radius),
  43105. this.phi.copy(e.phi),
  43106. this.theta.copy(e.theta),
  43107. this
  43108. },
  43109. makeSafe: function() {
  43110. var e = 1e-6;
  43111. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43112. },
  43113. setFromVector3: function(e) {
  43114. return this.radius = e.length(),
  43115. 0 === this.radius ? (this.theta = 0,
  43116. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43117. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43118. this
  43119. }
  43120. },
  43121. n.Math = {
  43122. generateUUID: function() {
  43123. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43124. return function() {
  43125. for (var r = 0; r < 36; r++)
  43126. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43127. e = 15 & n,
  43128. n >>= 4,
  43129. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43130. return i.join("")
  43131. }
  43132. }(),
  43133. clamp: function(e, t, i) {
  43134. return Math.max(t, Math.min(i, e))
  43135. },
  43136. euclideanModulo: function(e, t) {
  43137. return (e % t + t) % t
  43138. },
  43139. mapLinear: function(e, t, i, n, r) {
  43140. return n + (e - t) * (r - n) / (i - t)
  43141. },
  43142. smoothstep: function(e, t, i) {
  43143. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43144. e * e * (3 - 2 * e))
  43145. },
  43146. smootherstep: function(e, t, i) {
  43147. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43148. e * e * e * (e * (6 * e - 15) + 10))
  43149. },
  43150. random16: function() {
  43151. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43152. Math.random()
  43153. },
  43154. randInt: function(e, t) {
  43155. return e + Math.floor(Math.random() * (t - e + 1))
  43156. },
  43157. randFloat: function(e, t) {
  43158. return e + Math.random() * (t - e)
  43159. },
  43160. randFloatSpread: function(e) {
  43161. return e * (.5 - Math.random())
  43162. },
  43163. degToRad: function() {
  43164. var e = Math.PI / 180;
  43165. return function(t) {
  43166. return t * e
  43167. }
  43168. }(),
  43169. radToDeg: function() {
  43170. var e = 180 / Math.PI;
  43171. return function(t) {
  43172. return t * e
  43173. }
  43174. }(),
  43175. isPowerOfTwo: function(e) {
  43176. return 0 === (e & e - 1) && 0 !== e
  43177. },
  43178. nearestPowerOfTwo: function(e) {
  43179. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43180. },
  43181. nextPowerOfTwo: function(e) {
  43182. return e--,
  43183. e |= e >> 1,
  43184. e |= e >> 2,
  43185. e |= e >> 4,
  43186. e |= e >> 8,
  43187. e |= e >> 16,
  43188. e++,
  43189. e
  43190. }
  43191. },
  43192. n.Spline = function(e) {
  43193. function t(e, t, i, n, r, o, a) {
  43194. var s = .5 * (i - e)
  43195. , l = .5 * (n - t);
  43196. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43197. }
  43198. this.points = e;
  43199. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43200. x: 0,
  43201. y: 0,
  43202. z: 0
  43203. };
  43204. this.initFromArray = function(e) {
  43205. this.points = [];
  43206. for (var t = 0; t < e.length; t++)
  43207. this.points[t] = {
  43208. x: e[t][0],
  43209. y: e[t][1],
  43210. z: e[t][2]
  43211. }
  43212. }
  43213. ,
  43214. this.getPoint = function(e) {
  43215. return i = (this.points.length - 1) * e,
  43216. r = Math.floor(i),
  43217. o = i - r,
  43218. d[0] = 0 === r ? r : r - 1,
  43219. d[1] = r,
  43220. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43221. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43222. l = this.points[d[0]],
  43223. c = this.points[d[1]],
  43224. h = this.points[d[2]],
  43225. u = this.points[d[3]],
  43226. a = o * o,
  43227. s = o * a,
  43228. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43229. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43230. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43231. p
  43232. }
  43233. ,
  43234. this.getControlPointsArray = function() {
  43235. var e, t, i = this.points.length, n = [];
  43236. for (e = 0; e < i; e++)
  43237. t = this.points[e],
  43238. n[e] = [t.x, t.y, t.z];
  43239. return n
  43240. }
  43241. ,
  43242. this.getLength = function(e) {
  43243. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43244. for (u[0] = 0,
  43245. e || (e = 100),
  43246. r = this.points.length * e,
  43247. c.copy(this.points[0]),
  43248. t = 1; t < r; t++)
  43249. i = t / r,
  43250. o = this.getPoint(i),
  43251. h.copy(o),
  43252. d += h.distanceTo(c),
  43253. c.copy(o),
  43254. a = (this.points.length - 1) * i,
  43255. s = Math.floor(a),
  43256. s !== l && (u[s] = d,
  43257. l = s);
  43258. return u[u.length] = d,
  43259. {
  43260. chunks: u,
  43261. total: d
  43262. }
  43263. }
  43264. ,
  43265. this.reparametrizeByArcLength = function(e) {
  43266. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43267. for (h.push(u.copy(this.points[0]).clone()),
  43268. t = 1; t < this.points.length; t++) {
  43269. for (s = d.chunks[t] - d.chunks[t - 1],
  43270. l = Math.ceil(e * s / d.total),
  43271. o = (t - 1) / (this.points.length - 1),
  43272. a = t / (this.points.length - 1),
  43273. i = 1; i < l - 1; i++)
  43274. r = o + i * (1 / l) * (a - o),
  43275. c = this.getPoint(r),
  43276. h.push(u.copy(c).clone());
  43277. h.push(u.copy(this.points[t]).clone())
  43278. }
  43279. this.points = h
  43280. }
  43281. }
  43282. ,
  43283. n.Triangle = function(e, t, i) {
  43284. this.a = void 0 !== e ? e : new n.Vector3,
  43285. this.b = void 0 !== t ? t : new n.Vector3,
  43286. this.c = void 0 !== i ? i : new n.Vector3
  43287. }
  43288. ,
  43289. n.Triangle.normal = function() {
  43290. var e = new n.Vector3;
  43291. return function(t, i, r, o) {
  43292. var a = o || new n.Vector3;
  43293. a.subVectors(r, i),
  43294. e.subVectors(t, i),
  43295. a.cross(e);
  43296. var s = a.lengthSq();
  43297. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43298. }
  43299. }(),
  43300. n.Triangle.barycoordFromPoint = function() {
  43301. var e = new n.Vector3
  43302. , t = new n.Vector3
  43303. , i = new n.Vector3;
  43304. return function(r, o, a, s, l) {
  43305. e.subVectors(s, o),
  43306. t.subVectors(a, o),
  43307. i.subVectors(r, o);
  43308. var c = e.dot(e)
  43309. , h = e.dot(t)
  43310. , u = e.dot(i)
  43311. , d = t.dot(t)
  43312. , p = t.dot(i)
  43313. , f = c * d - h * h
  43314. , g = l || new n.Vector3;
  43315. if (0 === f)
  43316. return g.set(-2, -1, -1);
  43317. var m = 1 / f
  43318. , v = (d * u - h * p) * m
  43319. , A = (c * p - h * u) * m;
  43320. return g.set(1 - v - A, A, v)
  43321. }
  43322. }(),
  43323. n.Triangle.containsPoint = function() {
  43324. var e = new n.Vector3;
  43325. return function(t, i, r, o) {
  43326. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43327. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43328. }
  43329. }(),
  43330. n.Triangle.prototype = {
  43331. constructor: n.Triangle,
  43332. set: function(e, t, i) {
  43333. return this.a.copy(e),
  43334. this.b.copy(t),
  43335. this.c.copy(i),
  43336. this
  43337. },
  43338. setFromPointsAndIndices: function(e, t, i, n) {
  43339. return this.a.copy(e[t]),
  43340. this.b.copy(e[i]),
  43341. this.c.copy(e[n]),
  43342. this
  43343. },
  43344. clone: function() {
  43345. return (new this.constructor).copy(this)
  43346. },
  43347. copy: function(e) {
  43348. return this.a.copy(e.a),
  43349. this.b.copy(e.b),
  43350. this.c.copy(e.c),
  43351. this
  43352. },
  43353. area: function() {
  43354. var e = new n.Vector3
  43355. , t = new n.Vector3;
  43356. return function() {
  43357. return e.subVectors(this.c, this.b),
  43358. t.subVectors(this.a, this.b),
  43359. .5 * e.cross(t).length()
  43360. }
  43361. }(),
  43362. midpoint: function(e) {
  43363. var t = e || new n.Vector3;
  43364. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43365. },
  43366. normal: function(e) {
  43367. return n.Triangle.normal(this.a, this.b, this.c, e)
  43368. },
  43369. plane: function(e) {
  43370. var t = e || new n.Plane;
  43371. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43372. },
  43373. barycoordFromPoint: function(e, t) {
  43374. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43375. },
  43376. containsPoint: function(e) {
  43377. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43378. },
  43379. equals: function(e) {
  43380. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43381. }
  43382. },
  43383. n.Interpolant = function(e, t, i, n) {
  43384. this.parameterPositions = e,
  43385. this._cachedIndex = 0,
  43386. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43387. this.sampleValues = t,
  43388. this.valueSize = i
  43389. }
  43390. ,
  43391. n.Interpolant.prototype = {
  43392. constructor: n.Interpolant,
  43393. evaluate: function(e) {
  43394. var t = this.parameterPositions
  43395. , i = this._cachedIndex
  43396. , n = t[i]
  43397. , r = t[i - 1];
  43398. e: {
  43399. t: {
  43400. var o;
  43401. i: {
  43402. n: if (!(e < n)) {
  43403. for (var a = i + 2; ; ) {
  43404. if (void 0 === n) {
  43405. if (e < r)
  43406. break n;
  43407. return i = t.length,
  43408. this._cachedIndex = i,
  43409. this.afterEnd_(i - 1, e, r)
  43410. }
  43411. if (i === a)
  43412. break;
  43413. if (r = n,
  43414. n = t[++i],
  43415. e < n)
  43416. break t
  43417. }
  43418. o = t.length;
  43419. break i
  43420. }
  43421. {
  43422. if (e >= r)
  43423. break e;
  43424. var s = t[1];
  43425. e < s && (i = 2,
  43426. r = s);
  43427. for (var a = i - 2; ; ) {
  43428. if (void 0 === r)
  43429. return this._cachedIndex = 0,
  43430. this.beforeStart_(0, e, n);
  43431. if (i === a)
  43432. break;
  43433. if (n = r,
  43434. r = t[--i - 1],
  43435. e >= r)
  43436. break t
  43437. }
  43438. o = i,
  43439. i = 0
  43440. }
  43441. }
  43442. for (; i < o; ) {
  43443. var l = i + o >>> 1;
  43444. e < t[l] ? o = l : i = l + 1
  43445. }
  43446. if (n = t[i],
  43447. r = t[i - 1],
  43448. void 0 === r)
  43449. return this._cachedIndex = 0,
  43450. this.beforeStart_(0, e, n);
  43451. if (void 0 === n)
  43452. return i = t.length,
  43453. this._cachedIndex = i,
  43454. this.afterEnd_(i - 1, r, e)
  43455. }
  43456. this._cachedIndex = i,
  43457. this.intervalChanged_(i, r, n)
  43458. }
  43459. return this.interpolate_(i, r, e, n)
  43460. },
  43461. settings: null,
  43462. DefaultSettings_: {},
  43463. getSettings_: function() {
  43464. return this.settings || this.DefaultSettings_
  43465. },
  43466. copySampleValue_: function(e) {
  43467. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43468. t[o] = i[r + o];
  43469. return t
  43470. },
  43471. interpolate_: function(e, t, i, n) {
  43472. throw new Error("call to abstract method")
  43473. },
  43474. intervalChanged_: function(e, t, i) {}
  43475. },
  43476. Object.assign(n.Interpolant.prototype, {
  43477. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43478. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43479. }),
  43480. n.CubicInterpolant = function(e, t, i, r) {
  43481. n.Interpolant.call(this, e, t, i, r),
  43482. this._weightPrev = -0,
  43483. this._offsetPrev = -0,
  43484. this._weightNext = -0,
  43485. this._offsetNext = -0
  43486. }
  43487. ,
  43488. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43489. constructor: n.CubicInterpolant,
  43490. DefaultSettings_: {
  43491. endingStart: n.ZeroCurvatureEnding,
  43492. endingEnd: n.ZeroCurvatureEnding
  43493. },
  43494. intervalChanged_: function(e, t, i) {
  43495. var r = this.parameterPositions
  43496. , o = e - 2
  43497. , a = e + 1
  43498. , s = r[o]
  43499. , l = r[a];
  43500. if (void 0 === s)
  43501. switch (this.getSettings_().endingStart) {
  43502. case n.ZeroSlopeEnding:
  43503. o = e,
  43504. s = 2 * t - i;
  43505. break;
  43506. case n.WrapAroundEnding:
  43507. o = r.length - 2,
  43508. s = t + r[o] - r[o + 1];
  43509. break;
  43510. default:
  43511. o = e,
  43512. s = i
  43513. }
  43514. if (void 0 === l)
  43515. switch (this.getSettings_().endingEnd) {
  43516. case n.ZeroSlopeEnding:
  43517. a = e,
  43518. l = 2 * i - t;
  43519. break;
  43520. case n.WrapAroundEnding:
  43521. a = 1,
  43522. l = i + r[1] - r[0];
  43523. break;
  43524. default:
  43525. a = e - 1,
  43526. l = t
  43527. }
  43528. var c = .5 * (i - t)
  43529. , h = this.valueSize;
  43530. this._weightPrev = c / (t - s),
  43531. this._weightNext = c / (l - i),
  43532. this._offsetPrev = o * h,
  43533. this._offsetNext = a * h
  43534. },
  43535. interpolate_: function(e, t, i, n) {
  43536. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  43537. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43538. return r
  43539. }
  43540. }),
  43541. n.DiscreteInterpolant = function(e, t, i, r) {
  43542. n.Interpolant.call(this, e, t, i, r)
  43543. }
  43544. ,
  43545. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43546. constructor: n.DiscreteInterpolant,
  43547. interpolate_: function(e, t, i, n) {
  43548. return this.copySampleValue_(e - 1)
  43549. }
  43550. }),
  43551. n.LinearInterpolant = function(e, t, i, r) {
  43552. n.Interpolant.call(this, e, t, i, r)
  43553. }
  43554. ,
  43555. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43556. constructor: n.LinearInterpolant,
  43557. interpolate_: function(e, t, i, n) {
  43558. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u)
  43559. r[u] = o[l + u] * h + o[s + u] * c;
  43560. return r
  43561. }
  43562. }),
  43563. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43564. n.Interpolant.call(this, e, t, i, r)
  43565. }
  43566. ,
  43567. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43568. constructor: n.QuaternionLinearInterpolant,
  43569. interpolate_: function(e, t, i, r) {
  43570. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  43571. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43572. return o
  43573. }
  43574. }),
  43575. n.Clock = function(e) {
  43576. this.autoStart = void 0 === e || e,
  43577. this.startTime = 0,
  43578. this.oldTime = 0,
  43579. this.elapsedTime = 0,
  43580. this.running = !1
  43581. }
  43582. ,
  43583. n.Clock.prototype = {
  43584. constructor: n.Clock,
  43585. start: function() {
  43586. this.startTime = performance.now(),
  43587. this.oldTime = this.startTime,
  43588. this.running = !0
  43589. },
  43590. stop: function() {
  43591. this.getElapsedTime(),
  43592. this.running = !1
  43593. },
  43594. getElapsedTime: function() {
  43595. return this.getDelta(),
  43596. this.elapsedTime
  43597. },
  43598. getDelta: function() {
  43599. var e = 0;
  43600. if (this.autoStart && !this.running && this.start(),
  43601. this.running) {
  43602. var t = performance.now();
  43603. e = .001 * (t - this.oldTime),
  43604. this.oldTime = t,
  43605. this.elapsedTime += e
  43606. }
  43607. return e
  43608. }
  43609. },
  43610. n.EventDispatcher = function() {}
  43611. ,
  43612. n.EventDispatcher.prototype = {
  43613. constructor: n.EventDispatcher,
  43614. apply: function(e) {
  43615. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43616. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43617. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43618. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43619. },
  43620. addEventListener: function(e, t) {
  43621. void 0 === this._listeners && (this._listeners = {});
  43622. var i = this._listeners;
  43623. void 0 === i[e] && (i[e] = []),
  43624. i[e].indexOf(t) === -1 && i[e].push(t)
  43625. },
  43626. hasEventListener: function(e, t) {
  43627. if (void 0 === this._listeners)
  43628. return !1;
  43629. var i = this._listeners;
  43630. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43631. },
  43632. removeEventListener: function(e, t) {
  43633. if (void 0 !== this._listeners) {
  43634. var i = this._listeners
  43635. , n = i[e];
  43636. if (void 0 !== n) {
  43637. var r = n.indexOf(t);
  43638. r !== -1 && n.splice(r, 1)
  43639. }
  43640. }
  43641. },
  43642. dispatchEvent: function(e) {
  43643. if (void 0 !== this._listeners) {
  43644. var t = this._listeners
  43645. , i = t[e.type];
  43646. if (void 0 !== i) {
  43647. e.target = this;
  43648. for (var n = [], r = i.length, o = 0; o < r; o++)
  43649. n[o] = i[o];
  43650. for (var o = 0; o < r; o++)
  43651. n[o].call(this, e)
  43652. }
  43653. }
  43654. }
  43655. },
  43656. n.Layers = function() {
  43657. this.mask = 1
  43658. }
  43659. ,
  43660. n.Layers.prototype = {
  43661. constructor: n.Layers,
  43662. set: function(e) {
  43663. this.mask = 1 << e
  43664. },
  43665. enable: function(e) {
  43666. this.mask |= 1 << e
  43667. },
  43668. toggle: function(e) {
  43669. this.mask ^= 1 << e
  43670. },
  43671. disable: function(e) {
  43672. this.mask &= ~(1 << e)
  43673. },
  43674. test: function(e) {
  43675. return 0 !== (this.mask & e.mask)
  43676. }
  43677. },
  43678. function(e) {
  43679. function t(e, t) {
  43680. return e.distance - t.distance
  43681. }
  43682. function i(e, t, n, r) {
  43683. if (e.visible !== !1 && (e.raycast(t, n),
  43684. r === !0))
  43685. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43686. i(o[a], t, n, !0)
  43687. }
  43688. e.Raycaster = function(t, i, n, r) {
  43689. this.ray = new e.Ray(t,i),
  43690. this.near = n || 0,
  43691. this.far = r || 1 / 0,
  43692. this.params = {
  43693. Mesh: {},
  43694. Line: {},
  43695. LOD: {},
  43696. Points: {
  43697. threshold: 1
  43698. },
  43699. Sprite: {}
  43700. },
  43701. Object.defineProperties(this.params, {
  43702. PointCloud: {
  43703. get: function() {
  43704. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43705. this.Points
  43706. }
  43707. }
  43708. })
  43709. }
  43710. ,
  43711. e.Raycaster.prototype = {
  43712. constructor: e.Raycaster,
  43713. linePrecision: 1,
  43714. set: function(e, t) {
  43715. this.ray.set(e, t)
  43716. },
  43717. setFromCamera: function(t, i) {
  43718. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43719. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  43720. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43721. },
  43722. intersectObject: function(e, n) {
  43723. var r = [];
  43724. return i(e, this, r, n),
  43725. r.sort(t),
  43726. r
  43727. },
  43728. intersectObjects: function(e, n) {
  43729. var r = [];
  43730. if (Array.isArray(e) === !1)
  43731. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43732. r;
  43733. for (var o = 0, a = e.length; o < a; o++)
  43734. i(e[o], this, r, n);
  43735. return r.sort(t),
  43736. r
  43737. }
  43738. }
  43739. }(n),
  43740. n.Object3D = function() {
  43741. function e() {
  43742. o.setFromEuler(r, !1)
  43743. }
  43744. function t() {
  43745. r.setFromQuaternion(o, void 0, !1)
  43746. }
  43747. Object.defineProperty(this, "id", {
  43748. value: n.Object3DIdCount++
  43749. }),
  43750. this.uuid = n.Math.generateUUID(),
  43751. this.name = "",
  43752. this.type = "Object3D",
  43753. this.parent = null,
  43754. this.children = [],
  43755. this.up = n.Object3D.DefaultUp.clone();
  43756. var i = new n.Vector3
  43757. , r = new n.Euler
  43758. , o = new n.Quaternion
  43759. , a = new n.Vector3(1,1,1);
  43760. r.onChange(e),
  43761. o.onChange(t),
  43762. Object.defineProperties(this, {
  43763. position: {
  43764. enumerable: !0,
  43765. value: i
  43766. },
  43767. rotation: {
  43768. enumerable: !0,
  43769. value: r
  43770. },
  43771. quaternion: {
  43772. enumerable: !0,
  43773. value: o
  43774. },
  43775. scale: {
  43776. enumerable: !0,
  43777. value: a
  43778. },
  43779. modelViewMatrix: {
  43780. value: new n.Matrix4
  43781. },
  43782. normalMatrix: {
  43783. value: new n.Matrix3
  43784. }
  43785. }),
  43786. this.rotationAutoUpdate = !0,
  43787. this.matrix = new n.Matrix4,
  43788. this.matrixWorld = new n.Matrix4,
  43789. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43790. this.matrixWorldNeedsUpdate = !1,
  43791. this.layers = new n.Layers,
  43792. this.visible = !0,
  43793. this.castShadow = !1,
  43794. this.receiveShadow = !1,
  43795. this.frustumCulled = !0,
  43796. this.renderOrder = 0,
  43797. this.userData = {}
  43798. }
  43799. ,
  43800. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43801. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43802. n.Object3D.prototype = {
  43803. constructor: n.Object3D,
  43804. applyMatrix: function(e) {
  43805. this.matrix.multiplyMatrices(e, this.matrix),
  43806. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43807. },
  43808. setRotationFromAxisAngle: function(e, t) {
  43809. this.quaternion.setFromAxisAngle(e, t)
  43810. },
  43811. setRotationFromEuler: function(e) {
  43812. this.quaternion.setFromEuler(e, !0)
  43813. },
  43814. setRotationFromMatrix: function(e) {
  43815. this.quaternion.setFromRotationMatrix(e)
  43816. },
  43817. setRotationFromQuaternion: function(e) {
  43818. this.quaternion.copy(e)
  43819. },
  43820. rotateOnAxis: function() {
  43821. var e = new n.Quaternion;
  43822. return function(t, i) {
  43823. return e.setFromAxisAngle(t, i),
  43824. this.quaternion.multiply(e),
  43825. this
  43826. }
  43827. }(),
  43828. rotateX: function() {
  43829. var e = new n.Vector3(1,0,0);
  43830. return function(t) {
  43831. return this.rotateOnAxis(e, t)
  43832. }
  43833. }(),
  43834. rotateY: function() {
  43835. var e = new n.Vector3(0,1,0);
  43836. return function(t) {
  43837. return this.rotateOnAxis(e, t)
  43838. }
  43839. }(),
  43840. rotateZ: function() {
  43841. var e = new n.Vector3(0,0,1);
  43842. return function(t) {
  43843. return this.rotateOnAxis(e, t)
  43844. }
  43845. }(),
  43846. translateOnAxis: function() {
  43847. var e = new n.Vector3;
  43848. return function(t, i) {
  43849. return e.copy(t).applyQuaternion(this.quaternion),
  43850. this.position.add(e.multiplyScalar(i)),
  43851. this
  43852. }
  43853. }(),
  43854. translateX: function() {
  43855. var e = new n.Vector3(1,0,0);
  43856. return function(t) {
  43857. return this.translateOnAxis(e, t)
  43858. }
  43859. }(),
  43860. translateY: function() {
  43861. var e = new n.Vector3(0,1,0);
  43862. return function(t) {
  43863. return this.translateOnAxis(e, t)
  43864. }
  43865. }(),
  43866. translateZ: function() {
  43867. var e = new n.Vector3(0,0,1);
  43868. return function(t) {
  43869. return this.translateOnAxis(e, t)
  43870. }
  43871. }(),
  43872. localToWorld: function(e) {
  43873. return e.applyMatrix4(this.matrixWorld)
  43874. },
  43875. worldToLocal: function() {
  43876. var e = new n.Matrix4;
  43877. return function(t) {
  43878. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43879. }
  43880. }(),
  43881. lookAt: function() {
  43882. var e = new n.Matrix4;
  43883. return function(t) {
  43884. e.lookAt(t, this.position, this.up),
  43885. this.quaternion.setFromRotationMatrix(e)
  43886. }
  43887. }(),
  43888. add: function(e) {
  43889. if (arguments.length > 1) {
  43890. for (var t = 0; t < arguments.length; t++)
  43891. this.add(arguments[t]);
  43892. return this
  43893. }
  43894. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43895. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43896. e.parent = this,
  43897. e.dispatchEvent({
  43898. type: "added"
  43899. }),
  43900. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43901. this)
  43902. },
  43903. remove: function(e) {
  43904. if (arguments.length > 1)
  43905. for (var t = 0; t < arguments.length; t++)
  43906. this.remove(arguments[t]);
  43907. var i = this.children.indexOf(e);
  43908. i !== -1 && (e.parent = null,
  43909. e.dispatchEvent({
  43910. type: "removed"
  43911. }),
  43912. this.children.splice(i, 1))
  43913. },
  43914. getObjectById: function(e) {
  43915. return this.getObjectByProperty("id", e)
  43916. },
  43917. getObjectByName: function(e) {
  43918. return this.getObjectByProperty("name", e)
  43919. },
  43920. getObjectByProperty: function(e, t) {
  43921. if (this[e] === t)
  43922. return this;
  43923. for (var i = 0, n = this.children.length; i < n; i++) {
  43924. var r = this.children[i]
  43925. , o = r.getObjectByProperty(e, t);
  43926. if (void 0 !== o)
  43927. return o
  43928. }
  43929. },
  43930. getWorldPosition: function(e) {
  43931. var t = e || new n.Vector3;
  43932. return this.updateMatrixWorld(!0),
  43933. t.setFromMatrixPosition(this.matrixWorld)
  43934. },
  43935. getWorldQuaternion: function() {
  43936. var e = new n.Vector3
  43937. , t = new n.Vector3;
  43938. return function(i) {
  43939. var r = i || new n.Quaternion;
  43940. return this.updateMatrixWorld(!0),
  43941. this.matrixWorld.decompose(e, r, t),
  43942. r
  43943. }
  43944. }(),
  43945. getWorldRotation: function() {
  43946. var e = new n.Quaternion;
  43947. return function(t) {
  43948. var i = t || new n.Euler;
  43949. return this.getWorldQuaternion(e),
  43950. i.setFromQuaternion(e, this.rotation.order, !1)
  43951. }
  43952. }(),
  43953. getWorldScale: function() {
  43954. var e = new n.Vector3
  43955. , t = new n.Quaternion;
  43956. return function(i) {
  43957. var r = i || new n.Vector3;
  43958. return this.updateMatrixWorld(!0),
  43959. this.matrixWorld.decompose(e, t, r),
  43960. r
  43961. }
  43962. }(),
  43963. getWorldDirection: function() {
  43964. var e = new n.Quaternion;
  43965. return function(t) {
  43966. var i = t || new n.Vector3;
  43967. return this.getWorldQuaternion(e),
  43968. i.set(0, 0, 1).applyQuaternion(e)
  43969. }
  43970. }(),
  43971. raycast: function() {},
  43972. traverse: function(e) {
  43973. e(this);
  43974. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43975. t[i].traverse(e)
  43976. },
  43977. traverseVisible: function(e) {
  43978. if (this.visible !== !1) {
  43979. e(this);
  43980. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43981. t[i].traverseVisible(e)
  43982. }
  43983. },
  43984. traverseAncestors: function(e) {
  43985. var t = this.parent;
  43986. null !== t && (e(t),
  43987. t.traverseAncestors(e))
  43988. },
  43989. updateMatrix: function() {
  43990. this.matrix.compose(this.position, this.quaternion, this.scale),
  43991. this.matrixWorldNeedsUpdate = !0
  43992. },
  43993. updateMatrixWorld: function(e) {
  43994. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43995. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43996. this.matrixWorldNeedsUpdate = !1,
  43997. e = !0);
  43998. for (var t = 0, i = this.children.length; t < i; t++)
  43999. this.children[t].updateMatrixWorld(e)
  44000. },
  44001. toJSON: function(e) {
  44002. function t(e) {
  44003. var t = [];
  44004. for (var i in e) {
  44005. var n = e[i];
  44006. delete n.metadata,
  44007. t.push(n)
  44008. }
  44009. return t
  44010. }
  44011. var i = void 0 === e
  44012. , n = {};
  44013. i && (e = {
  44014. geometries: {},
  44015. materials: {},
  44016. textures: {},
  44017. images: {}
  44018. },
  44019. n.metadata = {
  44020. version: 4.4,
  44021. type: "Object",
  44022. generator: "Object3D.toJSON"
  44023. });
  44024. var r = {};
  44025. if (r.uuid = this.uuid,
  44026. r.type = this.type,
  44027. "" !== this.name && (r.name = this.name),
  44028. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44029. this.castShadow === !0 && (r.castShadow = !0),
  44030. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44031. this.visible === !1 && (r.visible = !1),
  44032. r.matrix = this.matrix.toArray(),
  44033. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44034. r.geometry = this.geometry.uuid),
  44035. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44036. r.material = this.material.uuid),
  44037. this.children.length > 0) {
  44038. r.children = [];
  44039. for (var o = 0; o < this.children.length; o++)
  44040. r.children.push(this.children[o].toJSON(e).object)
  44041. }
  44042. if (i) {
  44043. var a = t(e.geometries)
  44044. , s = t(e.materials)
  44045. , l = t(e.textures)
  44046. , c = t(e.images);
  44047. a.length > 0 && (n.geometries = a),
  44048. s.length > 0 && (n.materials = s),
  44049. l.length > 0 && (n.textures = l),
  44050. c.length > 0 && (n.images = c)
  44051. }
  44052. return n.object = r,
  44053. n
  44054. },
  44055. clone: function(e) {
  44056. return (new this.constructor).copy(this, e)
  44057. },
  44058. copy: function(e, t) {
  44059. if (void 0 === t && (t = !0),
  44060. this.name = e.name,
  44061. this.up.copy(e.up),
  44062. this.position.copy(e.position),
  44063. this.quaternion.copy(e.quaternion),
  44064. this.scale.copy(e.scale),
  44065. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44066. this.matrix.copy(e.matrix),
  44067. this.matrixWorld.copy(e.matrixWorld),
  44068. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44069. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44070. this.visible = e.visible,
  44071. this.castShadow = e.castShadow,
  44072. this.receiveShadow = e.receiveShadow,
  44073. this.frustumCulled = e.frustumCulled,
  44074. this.renderOrder = e.renderOrder,
  44075. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44076. t === !0)
  44077. for (var i = 0; i < e.children.length; i++) {
  44078. var n = e.children[i];
  44079. this.add(n.clone())
  44080. }
  44081. return this
  44082. }
  44083. },
  44084. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44085. n.Object3DIdCount = 0,
  44086. n.Face3 = function(e, t, i, r, o, a) {
  44087. this.a = e,
  44088. this.b = t,
  44089. this.c = i,
  44090. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44091. this.vertexNormals = Array.isArray(r) ? r : [],
  44092. this.color = o instanceof n.Color ? o : new n.Color,
  44093. this.vertexColors = Array.isArray(o) ? o : [],
  44094. this.materialIndex = void 0 !== a ? a : 0
  44095. }
  44096. ,
  44097. n.Face3.prototype = {
  44098. constructor: n.Face3,
  44099. clone: function() {
  44100. return (new this.constructor).copy(this)
  44101. },
  44102. copy: function(e) {
  44103. this.a = e.a,
  44104. this.b = e.b,
  44105. this.c = e.c,
  44106. this.normal.copy(e.normal),
  44107. this.color.copy(e.color),
  44108. this.materialIndex = e.materialIndex;
  44109. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44110. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44111. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44112. this.vertexColors[t] = e.vertexColors[t].clone();
  44113. return this
  44114. }
  44115. },
  44116. n.BufferAttribute = function(e, t) {
  44117. this.uuid = n.Math.generateUUID(),
  44118. this.array = e,
  44119. this.itemSize = t,
  44120. this.dynamic = !1,
  44121. this.updateRange = {
  44122. offset: 0,
  44123. count: -1
  44124. },
  44125. this.version = 0
  44126. }
  44127. ,
  44128. n.BufferAttribute.prototype = {
  44129. constructor: n.BufferAttribute,
  44130. get count() {
  44131. return this.array.length / this.itemSize
  44132. },
  44133. set needsUpdate(e) {
  44134. e === !0 && this.version++
  44135. },
  44136. setDynamic: function(e) {
  44137. return this.dynamic = e,
  44138. this
  44139. },
  44140. copy: function(e) {
  44141. return this.array = new e.array.constructor(e.array),
  44142. this.itemSize = e.itemSize,
  44143. this.dynamic = e.dynamic,
  44144. this
  44145. },
  44146. copyAt: function(e, t, i) {
  44147. e *= this.itemSize,
  44148. i *= t.itemSize;
  44149. for (var n = 0, r = this.itemSize; n < r; n++)
  44150. this.array[e + n] = t.array[i + n];
  44151. return this
  44152. },
  44153. copyArray: function(e) {
  44154. return this.array.set(e),
  44155. this
  44156. },
  44157. copyColorsArray: function(e) {
  44158. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44159. var a = e[r];
  44160. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44161. a = new n.Color),
  44162. t[i++] = a.r,
  44163. t[i++] = a.g,
  44164. t[i++] = a.b
  44165. }
  44166. return this
  44167. },
  44168. copyIndicesArray: function(e) {
  44169. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44170. var o = e[n];
  44171. t[i++] = o.a,
  44172. t[i++] = o.b,
  44173. t[i++] = o.c
  44174. }
  44175. return this
  44176. },
  44177. copyVector2sArray: function(e) {
  44178. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44179. var a = e[r];
  44180. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44181. a = new n.Vector2),
  44182. t[i++] = a.x,
  44183. t[i++] = a.y
  44184. }
  44185. return this
  44186. },
  44187. copyVector3sArray: function(e) {
  44188. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44189. var a = e[r];
  44190. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44191. a = new n.Vector3),
  44192. t[i++] = a.x,
  44193. t[i++] = a.y,
  44194. t[i++] = a.z
  44195. }
  44196. return this
  44197. },
  44198. copyVector4sArray: function(e) {
  44199. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44200. var a = e[r];
  44201. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44202. a = new n.Vector4),
  44203. t[i++] = a.x,
  44204. t[i++] = a.y,
  44205. t[i++] = a.z,
  44206. t[i++] = a.w
  44207. }
  44208. return this
  44209. },
  44210. set: function(e, t) {
  44211. return void 0 === t && (t = 0),
  44212. this.array.set(e, t),
  44213. this
  44214. },
  44215. getX: function(e) {
  44216. return this.array[e * this.itemSize]
  44217. },
  44218. setX: function(e, t) {
  44219. return this.array[e * this.itemSize] = t,
  44220. this
  44221. },
  44222. getY: function(e) {
  44223. return this.array[e * this.itemSize + 1]
  44224. },
  44225. setY: function(e, t) {
  44226. return this.array[e * this.itemSize + 1] = t,
  44227. this
  44228. },
  44229. getZ: function(e) {
  44230. return this.array[e * this.itemSize + 2]
  44231. },
  44232. setZ: function(e, t) {
  44233. return this.array[e * this.itemSize + 2] = t,
  44234. this
  44235. },
  44236. getW: function(e) {
  44237. return this.array[e * this.itemSize + 3]
  44238. },
  44239. setW: function(e, t) {
  44240. return this.array[e * this.itemSize + 3] = t,
  44241. this
  44242. },
  44243. setXY: function(e, t, i) {
  44244. return e *= this.itemSize,
  44245. this.array[e + 0] = t,
  44246. this.array[e + 1] = i,
  44247. this
  44248. },
  44249. setXYZ: function(e, t, i, n) {
  44250. return e *= this.itemSize,
  44251. this.array[e + 0] = t,
  44252. this.array[e + 1] = i,
  44253. this.array[e + 2] = n,
  44254. this
  44255. },
  44256. setXYZW: function(e, t, i, n, r) {
  44257. return e *= this.itemSize,
  44258. this.array[e + 0] = t,
  44259. this.array[e + 1] = i,
  44260. this.array[e + 2] = n,
  44261. this.array[e + 3] = r,
  44262. this
  44263. },
  44264. clone: function() {
  44265. return (new this.constructor).copy(this)
  44266. }
  44267. },
  44268. n.Int8Attribute = function(e, t) {
  44269. return new n.BufferAttribute(new Int8Array(e),t)
  44270. }
  44271. ,
  44272. n.Uint8Attribute = function(e, t) {
  44273. return new n.BufferAttribute(new Uint8Array(e),t)
  44274. }
  44275. ,
  44276. n.Uint8ClampedAttribute = function(e, t) {
  44277. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44278. }
  44279. ,
  44280. n.Int16Attribute = function(e, t) {
  44281. return new n.BufferAttribute(new Int16Array(e),t)
  44282. }
  44283. ,
  44284. n.Uint16Attribute = function(e, t) {
  44285. return new n.BufferAttribute(new Uint16Array(e),t)
  44286. }
  44287. ;
  44288. n.Int32Attribute = function(e, t) {
  44289. return new n.BufferAttribute(new Int32Array(e),t)
  44290. }
  44291. ;
  44292. n.Uint32Attribute = function(e, t) {
  44293. return new n.BufferAttribute(new Uint32Array(e),t)
  44294. }
  44295. ,
  44296. n.Float32Attribute = function(e, t) {
  44297. return new n.BufferAttribute(new Float32Array(e),t)
  44298. }
  44299. ,
  44300. n.Float64Attribute = function(e, t) {
  44301. return new n.BufferAttribute(new Float64Array(e),t)
  44302. }
  44303. ,
  44304. n.DynamicBufferAttribute = function(e, t) {
  44305. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44306. new n.BufferAttribute(e,t).setDynamic(!0)
  44307. }
  44308. ,
  44309. n.InstancedBufferAttribute = function(e, t, i) {
  44310. n.BufferAttribute.call(this, e, t),
  44311. this.meshPerAttribute = i || 1
  44312. }
  44313. ,
  44314. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44315. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44316. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44317. return n.BufferAttribute.prototype.copy.call(this, e),
  44318. this.meshPerAttribute = e.meshPerAttribute,
  44319. this
  44320. }
  44321. ,
  44322. n.InterleavedBuffer = function(e, t) {
  44323. this.uuid = n.Math.generateUUID(),
  44324. this.array = e,
  44325. this.stride = t,
  44326. this.dynamic = !1,
  44327. this.updateRange = {
  44328. offset: 0,
  44329. count: -1
  44330. },
  44331. this.version = 0
  44332. }
  44333. ,
  44334. n.InterleavedBuffer.prototype = {
  44335. constructor: n.InterleavedBuffer,
  44336. get length() {
  44337. return this.array.length
  44338. },
  44339. get count() {
  44340. return this.array.length / this.stride
  44341. },
  44342. set needsUpdate(e) {
  44343. e === !0 && this.version++
  44344. },
  44345. setDynamic: function(e) {
  44346. return this.dynamic = e,
  44347. this
  44348. },
  44349. copy: function(e) {
  44350. return this.array = new e.array.constructor(e.array),
  44351. this.stride = e.stride,
  44352. this.dynamic = e.dynamic,
  44353. this
  44354. },
  44355. copyAt: function(e, t, i) {
  44356. e *= this.stride,
  44357. i *= t.stride;
  44358. for (var n = 0, r = this.stride; n < r; n++)
  44359. this.array[e + n] = t.array[i + n];
  44360. return this
  44361. },
  44362. set: function(e, t) {
  44363. return void 0 === t && (t = 0),
  44364. this.array.set(e, t),
  44365. this
  44366. },
  44367. clone: function() {
  44368. return (new this.constructor).copy(this)
  44369. }
  44370. },
  44371. n.InstancedInterleavedBuffer = function(e, t, i) {
  44372. n.InterleavedBuffer.call(this, e, t),
  44373. this.meshPerAttribute = i || 1
  44374. }
  44375. ,
  44376. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44377. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44378. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44379. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44380. this.meshPerAttribute = e.meshPerAttribute,
  44381. this
  44382. }
  44383. ,
  44384. n.InterleavedBufferAttribute = function(e, t, i) {
  44385. this.uuid = n.Math.generateUUID(),
  44386. this.data = e,
  44387. this.itemSize = t,
  44388. this.offset = i
  44389. }
  44390. ,
  44391. n.InterleavedBufferAttribute.prototype = {
  44392. constructor: n.InterleavedBufferAttribute,
  44393. get length() {
  44394. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44395. this.array.length
  44396. },
  44397. get count() {
  44398. return this.data.count
  44399. },
  44400. setX: function(e, t) {
  44401. return this.data.array[e * this.data.stride + this.offset] = t,
  44402. this
  44403. },
  44404. setY: function(e, t) {
  44405. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44406. this
  44407. },
  44408. setZ: function(e, t) {
  44409. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44410. this
  44411. },
  44412. setW: function(e, t) {
  44413. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44414. this
  44415. },
  44416. getX: function(e) {
  44417. return this.data.array[e * this.data.stride + this.offset]
  44418. },
  44419. getY: function(e) {
  44420. return this.data.array[e * this.data.stride + this.offset + 1]
  44421. },
  44422. getZ: function(e) {
  44423. return this.data.array[e * this.data.stride + this.offset + 2]
  44424. },
  44425. getW: function(e) {
  44426. return this.data.array[e * this.data.stride + this.offset + 3]
  44427. },
  44428. setXY: function(e, t, i) {
  44429. return e = e * this.data.stride + this.offset,
  44430. this.data.array[e + 0] = t,
  44431. this.data.array[e + 1] = i,
  44432. this
  44433. },
  44434. setXYZ: function(e, t, i, n) {
  44435. return e = e * this.data.stride + this.offset,
  44436. this.data.array[e + 0] = t,
  44437. this.data.array[e + 1] = i,
  44438. this.data.array[e + 2] = n,
  44439. this
  44440. },
  44441. setXYZW: function(e, t, i, n, r) {
  44442. return e = e * this.data.stride + this.offset,
  44443. this.data.array[e + 0] = t,
  44444. this.data.array[e + 1] = i,
  44445. this.data.array[e + 2] = n,
  44446. this.data.array[e + 3] = r,
  44447. this
  44448. }
  44449. },
  44450. n.Geometry = function() {
  44451. Object.defineProperty(this, "id", {
  44452. value: n.GeometryIdCount++
  44453. }),
  44454. this.uuid = n.Math.generateUUID(),
  44455. this.name = "",
  44456. this.type = "Geometry",
  44457. this.vertices = [],
  44458. this.colors = [],
  44459. this.faces = [],
  44460. this.faceVertexUvs = [[]],
  44461. this.morphTargets = [],
  44462. this.morphNormals = [],
  44463. this.skinWeights = [],
  44464. this.skinIndices = [],
  44465. this.lineDistances = [],
  44466. this.boundingBox = null,
  44467. this.boundingSphere = null,
  44468. this.verticesNeedUpdate = !1,
  44469. this.elementsNeedUpdate = !1,
  44470. this.uvsNeedUpdate = !1,
  44471. this.normalsNeedUpdate = !1,
  44472. this.colorsNeedUpdate = !1,
  44473. this.lineDistancesNeedUpdate = !1,
  44474. this.groupsNeedUpdate = !1
  44475. }
  44476. ,
  44477. n.Geometry.prototype = {
  44478. constructor: n.Geometry,
  44479. applyMatrix: function(e) {
  44480. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44481. var o = this.vertices[i];
  44482. o.applyMatrix4(e)
  44483. }
  44484. for (var i = 0, r = this.faces.length; i < r; i++) {
  44485. var a = this.faces[i];
  44486. a.normal.applyMatrix3(t).normalize();
  44487. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44488. a.vertexNormals[s].applyMatrix3(t).normalize()
  44489. }
  44490. return null !== this.boundingBox && this.computeBoundingBox(),
  44491. null !== this.boundingSphere && this.computeBoundingSphere(),
  44492. this.verticesNeedUpdate = !0,
  44493. this.normalsNeedUpdate = !0,
  44494. this
  44495. },
  44496. rotateX: function() {
  44497. var e;
  44498. return function(t) {
  44499. return void 0 === e && (e = new n.Matrix4),
  44500. e.makeRotationX(t),
  44501. this.applyMatrix(e),
  44502. this
  44503. }
  44504. }(),
  44505. rotateY: function() {
  44506. var e;
  44507. return function(t) {
  44508. return void 0 === e && (e = new n.Matrix4),
  44509. e.makeRotationY(t),
  44510. this.applyMatrix(e),
  44511. this
  44512. }
  44513. }(),
  44514. rotateZ: function() {
  44515. var e;
  44516. return function(t) {
  44517. return void 0 === e && (e = new n.Matrix4),
  44518. e.makeRotationZ(t),
  44519. this.applyMatrix(e),
  44520. this
  44521. }
  44522. }(),
  44523. translate: function() {
  44524. var e;
  44525. return function(t, i, r) {
  44526. return void 0 === e && (e = new n.Matrix4),
  44527. e.makeTranslation(t, i, r),
  44528. this.applyMatrix(e),
  44529. this
  44530. }
  44531. }(),
  44532. scale: function() {
  44533. var e;
  44534. return function(t, i, r) {
  44535. return void 0 === e && (e = new n.Matrix4),
  44536. e.makeScale(t, i, r),
  44537. this.applyMatrix(e),
  44538. this
  44539. }
  44540. }(),
  44541. lookAt: function() {
  44542. var e;
  44543. return function(t) {
  44544. void 0 === e && (e = new n.Object3D),
  44545. e.lookAt(t),
  44546. e.updateMatrix(),
  44547. this.applyMatrix(e.matrix)
  44548. }
  44549. }(),
  44550. fromBufferGeometry: function(e) {
  44551. function t(e, t, r, o) {
  44552. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44553. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44554. , g = new n.Face3(e,t,r,a,f,o);
  44555. i.faces.push(g),
  44556. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44557. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44558. }
  44559. var i = this
  44560. , r = null !== e.index ? e.index.array : void 0
  44561. , o = e.attributes
  44562. , a = o.position.array
  44563. , s = void 0 !== o.normal ? o.normal.array : void 0
  44564. , l = void 0 !== o.color ? o.color.array : void 0
  44565. , c = void 0 !== o.uv ? o.uv.array : void 0
  44566. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44567. void 0 !== h && (this.faceVertexUvs[1] = []);
  44568. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44569. g += 2)
  44570. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44571. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44572. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44573. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44574. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44575. if (void 0 !== r) {
  44576. var m = e.groups;
  44577. if (m.length > 0)
  44578. for (var f = 0; f < m.length; f++)
  44579. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44580. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44581. else
  44582. for (var f = 0; f < r.length; f += 3)
  44583. t(r[f], r[f + 1], r[f + 2])
  44584. } else
  44585. for (var f = 0; f < a.length / 3; f += 3)
  44586. t(f, f + 1, f + 2);
  44587. return this.computeFaceNormals(),
  44588. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44589. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44590. this
  44591. },
  44592. center: function() {
  44593. this.computeBoundingBox();
  44594. var e = this.boundingBox.center().negate();
  44595. return this.translate(e.x, e.y, e.z),
  44596. e
  44597. },
  44598. normalize: function() {
  44599. this.computeBoundingSphere();
  44600. var e = this.boundingSphere.center
  44601. , t = this.boundingSphere.radius
  44602. , i = 0 === t ? 1 : 1 / t
  44603. , r = new n.Matrix4;
  44604. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  44605. this.applyMatrix(r),
  44606. this
  44607. },
  44608. computeFaceNormals: function() {
  44609. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44610. var o = this.faces[i]
  44611. , a = this.vertices[o.a]
  44612. , s = this.vertices[o.b]
  44613. , l = this.vertices[o.c];
  44614. e.subVectors(l, s),
  44615. t.subVectors(a, s),
  44616. e.cross(t),
  44617. e.normalize(),
  44618. o.normal.copy(e)
  44619. }
  44620. },
  44621. computeVertexNormals: function(e) {
  44622. void 0 === e && (e = !0);
  44623. var t, i, r, o, a, s;
  44624. for (s = new Array(this.vertices.length),
  44625. t = 0,
  44626. i = this.vertices.length; t < i; t++)
  44627. s[t] = new n.Vector3;
  44628. if (e) {
  44629. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44630. for (r = 0,
  44631. o = this.faces.length; r < o; r++)
  44632. a = this.faces[r],
  44633. l = this.vertices[a.a],
  44634. c = this.vertices[a.b],
  44635. h = this.vertices[a.c],
  44636. u.subVectors(h, c),
  44637. d.subVectors(l, c),
  44638. u.cross(d),
  44639. s[a.a].add(u),
  44640. s[a.b].add(u),
  44641. s[a.c].add(u)
  44642. } else
  44643. for (r = 0,
  44644. o = this.faces.length; r < o; r++)
  44645. a = this.faces[r],
  44646. s[a.a].add(a.normal),
  44647. s[a.b].add(a.normal),
  44648. s[a.c].add(a.normal);
  44649. for (t = 0,
  44650. i = this.vertices.length; t < i; t++)
  44651. s[t].normalize();
  44652. for (r = 0,
  44653. o = this.faces.length; r < o; r++) {
  44654. a = this.faces[r];
  44655. var p = a.vertexNormals;
  44656. 3 === p.length ? (p[0].copy(s[a.a]),
  44657. p[1].copy(s[a.b]),
  44658. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44659. p[1] = s[a.b].clone(),
  44660. p[2] = s[a.c].clone())
  44661. }
  44662. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44663. },
  44664. computeMorphNormals: function() {
  44665. var e, t, i, r, o;
  44666. for (i = 0,
  44667. r = this.faces.length; i < r; i++)
  44668. for (o = this.faces[i],
  44669. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44670. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44671. e = 0,
  44672. t = o.vertexNormals.length; e < t; e++)
  44673. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44674. var a = new n.Geometry;
  44675. for (a.faces = this.faces,
  44676. e = 0,
  44677. t = this.morphTargets.length; e < t; e++) {
  44678. if (!this.morphNormals[e]) {
  44679. this.morphNormals[e] = {},
  44680. this.morphNormals[e].faceNormals = [],
  44681. this.morphNormals[e].vertexNormals = [];
  44682. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44683. for (i = 0,
  44684. r = this.faces.length; i < r; i++)
  44685. s = new n.Vector3,
  44686. l = {
  44687. a: new n.Vector3,
  44688. b: new n.Vector3,
  44689. c: new n.Vector3
  44690. },
  44691. c.push(s),
  44692. h.push(l)
  44693. }
  44694. var u = this.morphNormals[e];
  44695. a.vertices = this.morphTargets[e].vertices,
  44696. a.computeFaceNormals(),
  44697. a.computeVertexNormals();
  44698. var s, l;
  44699. for (i = 0,
  44700. r = this.faces.length; i < r; i++)
  44701. o = this.faces[i],
  44702. s = u.faceNormals[i],
  44703. l = u.vertexNormals[i],
  44704. s.copy(o.normal),
  44705. l.a.copy(o.vertexNormals[0]),
  44706. l.b.copy(o.vertexNormals[1]),
  44707. l.c.copy(o.vertexNormals[2])
  44708. }
  44709. for (i = 0,
  44710. r = this.faces.length; i < r; i++)
  44711. o = this.faces[i],
  44712. o.normal = o.__originalFaceNormal,
  44713. o.vertexNormals = o.__originalVertexNormals
  44714. },
  44715. computeTangents: function() {
  44716. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44717. },
  44718. computeLineDistances: function() {
  44719. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44720. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44721. this.lineDistances[i] = e
  44722. },
  44723. computeBoundingBox: function() {
  44724. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44725. this.boundingBox.setFromPoints(this.vertices)
  44726. },
  44727. computeBoundingSphere: function() {
  44728. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44729. this.boundingSphere.setFromPoints(this.vertices)
  44730. },
  44731. merge: function(e, t, i) {
  44732. if (e instanceof n.Geometry == !1)
  44733. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44734. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  44735. void 0 === i && (i = 0),
  44736. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44737. for (var d = 0, p = s.length; d < p; d++) {
  44738. var f = s[d]
  44739. , g = f.clone();
  44740. void 0 !== t && g.applyMatrix4(t),
  44741. a.push(g)
  44742. }
  44743. for (d = 0,
  44744. p = c.length; d < p; d++) {
  44745. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44746. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44747. m.normal.copy(y.normal),
  44748. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44749. for (var E = 0, b = C.length; E < b; E++)
  44750. v = C[E].clone(),
  44751. void 0 !== r && v.applyMatrix3(r).normalize(),
  44752. m.vertexNormals.push(v);
  44753. m.color.copy(y.color);
  44754. for (var E = 0, b = I.length; E < b; E++)
  44755. A = I[E],
  44756. m.vertexColors.push(A.clone());
  44757. m.materialIndex = y.materialIndex + i,
  44758. l.push(m)
  44759. }
  44760. for (d = 0,
  44761. p = u.length; d < p; d++) {
  44762. var w = u[d]
  44763. , _ = [];
  44764. if (void 0 !== w) {
  44765. for (var E = 0, b = w.length; E < b; E++)
  44766. _.push(w[E].clone());
  44767. h.push(_)
  44768. }
  44769. }
  44770. },
  44771. mergeMesh: function(e) {
  44772. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44773. void this.merge(e.geometry, e.matrix))
  44774. },
  44775. mergeVertices: function() {
  44776. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44777. for (i = 0,
  44778. n = this.vertices.length; i < n; i++)
  44779. e = this.vertices[i],
  44780. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44781. void 0 === l[t] ? (l[t] = i,
  44782. c.push(this.vertices[i]),
  44783. h[i] = c.length - 1) : h[i] = h[l[t]];
  44784. var p = [];
  44785. for (i = 0,
  44786. n = this.faces.length; i < n; i++) {
  44787. r = this.faces[i],
  44788. r.a = h[r.a],
  44789. r.b = h[r.b],
  44790. r.c = h[r.c],
  44791. o = [r.a, r.b, r.c];
  44792. for (var f = -1, g = 0; g < 3; g++)
  44793. if (o[g] === o[(g + 1) % 3]) {
  44794. f = g,
  44795. p.push(i);
  44796. break
  44797. }
  44798. }
  44799. for (i = p.length - 1; i >= 0; i--) {
  44800. var m = p[i];
  44801. for (this.faces.splice(m, 1),
  44802. a = 0,
  44803. s = this.faceVertexUvs.length; a < s; a++)
  44804. this.faceVertexUvs[a].splice(m, 1)
  44805. }
  44806. var v = this.vertices.length - c.length;
  44807. return this.vertices = c,
  44808. v
  44809. },
  44810. sortFacesByMaterialIndex: function() {
  44811. function e(e, t) {
  44812. return e.materialIndex - t.materialIndex
  44813. }
  44814. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44815. t[n]._id = n;
  44816. t.sort(e);
  44817. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44818. a && a.length === i && (r = []),
  44819. s && s.length === i && (o = []);
  44820. for (var n = 0; n < i; n++) {
  44821. var l = t[n]._id;
  44822. r && r.push(a[l]),
  44823. o && o.push(s[l])
  44824. }
  44825. r && (this.faceVertexUvs[0] = r),
  44826. o && (this.faceVertexUvs[1] = o)
  44827. },
  44828. toJSON: function() {
  44829. function e(e, t, i) {
  44830. return i ? e | 1 << t : e & ~(1 << t)
  44831. }
  44832. function t(e) {
  44833. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44834. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44835. u.push(e.x, e.y, e.z),
  44836. d[t])
  44837. }
  44838. function i(e) {
  44839. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44840. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44841. p.push(e.getHex()),
  44842. f[t])
  44843. }
  44844. function n(e) {
  44845. var t = e.x.toString() + e.y.toString();
  44846. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44847. g.push(e.x, e.y),
  44848. m[t])
  44849. }
  44850. var r = {
  44851. metadata: {
  44852. version: 4.4,
  44853. type: "Geometry",
  44854. generator: "Geometry.toJSON"
  44855. }
  44856. };
  44857. if (r.uuid = this.uuid,
  44858. r.type = this.type,
  44859. "" !== this.name && (r.name = this.name),
  44860. void 0 !== this.parameters) {
  44861. var o = this.parameters;
  44862. for (var a in o)
  44863. void 0 !== o[a] && (r[a] = o[a]);
  44864. return r
  44865. }
  44866. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44867. var c = this.vertices[l];
  44868. s.push(c.x, c.y, c.z)
  44869. }
  44870. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44871. var v = this.faces[l]
  44872. , A = !0
  44873. , y = !1
  44874. , C = void 0 !== this.faceVertexUvs[0][l]
  44875. , I = v.normal.length() > 0
  44876. , E = v.vertexNormals.length > 0
  44877. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44878. , w = v.vertexColors.length > 0
  44879. , _ = 0;
  44880. if (_ = e(_, 0, 0),
  44881. _ = e(_, 1, A),
  44882. _ = e(_, 2, y),
  44883. _ = e(_, 3, C),
  44884. _ = e(_, 4, I),
  44885. _ = e(_, 5, E),
  44886. _ = e(_, 6, b),
  44887. _ = e(_, 7, w),
  44888. h.push(_),
  44889. h.push(v.a, v.b, v.c),
  44890. h.push(v.materialIndex),
  44891. C) {
  44892. var T = this.faceVertexUvs[0][l];
  44893. h.push(n(T[0]), n(T[1]), n(T[2]))
  44894. }
  44895. if (I && h.push(t(v.normal)),
  44896. E) {
  44897. var x = v.vertexNormals;
  44898. h.push(t(x[0]), t(x[1]), t(x[2]))
  44899. }
  44900. if (b && h.push(i(v.color)),
  44901. w) {
  44902. var S = v.vertexColors;
  44903. h.push(i(S[0]), i(S[1]), i(S[2]))
  44904. }
  44905. }
  44906. return r.data = {},
  44907. r.data.vertices = s,
  44908. r.data.normals = u,
  44909. p.length > 0 && (r.data.colors = p),
  44910. g.length > 0 && (r.data.uvs = [g]),
  44911. r.data.faces = h,
  44912. r
  44913. },
  44914. clone: function() {
  44915. return (new n.Geometry).copy(this)
  44916. },
  44917. copy: function(e) {
  44918. this.vertices = [],
  44919. this.faces = [],
  44920. this.faceVertexUvs = [[]];
  44921. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44922. this.vertices.push(t[i].clone());
  44923. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44924. this.faces.push(r[i].clone());
  44925. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44926. var o = e.faceVertexUvs[i];
  44927. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44928. for (var a = 0, s = o.length; a < s; a++) {
  44929. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44930. var d = l[h];
  44931. c.push(d.clone())
  44932. }
  44933. this.faceVertexUvs[i].push(c)
  44934. }
  44935. }
  44936. return this
  44937. },
  44938. dispose: function() {
  44939. this.dispatchEvent({
  44940. type: "dispose"
  44941. })
  44942. }
  44943. },
  44944. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44945. n.GeometryIdCount = 0,
  44946. n.DirectGeometry = function() {
  44947. Object.defineProperty(this, "id", {
  44948. value: n.GeometryIdCount++
  44949. }),
  44950. this.uuid = n.Math.generateUUID(),
  44951. this.name = "",
  44952. this.type = "DirectGeometry",
  44953. this.indices = [],
  44954. this.vertices = [],
  44955. this.normals = [],
  44956. this.colors = [],
  44957. this.uvs = [],
  44958. this.uvs2 = [],
  44959. this.groups = [],
  44960. this.morphTargets = {},
  44961. this.skinWeights = [],
  44962. this.skinIndices = [],
  44963. this.boundingBox = null,
  44964. this.boundingSphere = null,
  44965. this.verticesNeedUpdate = !1,
  44966. this.normalsNeedUpdate = !1,
  44967. this.colorsNeedUpdate = !1,
  44968. this.uvsNeedUpdate = !1,
  44969. this.groupsNeedUpdate = !1
  44970. }
  44971. ,
  44972. n.DirectGeometry.prototype = {
  44973. constructor: n.DirectGeometry,
  44974. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44975. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44976. computeFaceNormals: function() {
  44977. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44978. },
  44979. computeVertexNormals: function() {
  44980. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44981. },
  44982. computeGroups: function(e) {
  44983. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44984. var a = r[o];
  44985. a.materialIndex !== i && (i = a.materialIndex,
  44986. void 0 !== t && (t.count = 3 * o - t.start,
  44987. n.push(t)),
  44988. t = {
  44989. start: 3 * o,
  44990. materialIndex: i
  44991. })
  44992. }
  44993. void 0 !== t && (t.count = 3 * o - t.start,
  44994. n.push(t)),
  44995. this.groups = n
  44996. },
  44997. fromGeometry: function(e) {
  44998. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  44999. if (c > 0) {
  45000. t = [];
  45001. for (var h = 0; h < c; h++)
  45002. t[h] = [];
  45003. this.morphTargets.position = t
  45004. }
  45005. var u, d = e.morphNormals, p = d.length;
  45006. if (p > 0) {
  45007. u = [];
  45008. for (var h = 0; h < p; h++)
  45009. u[h] = [];
  45010. this.morphTargets.normal = u
  45011. }
  45012. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45013. var A = i[h];
  45014. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45015. var y = A.vertexNormals;
  45016. if (3 === y.length)
  45017. this.normals.push(y[0], y[1], y[2]);
  45018. else {
  45019. var C = A.normal;
  45020. this.normals.push(C, C, C)
  45021. }
  45022. var I = A.vertexColors;
  45023. if (3 === I.length)
  45024. this.colors.push(I[0], I[1], I[2]);
  45025. else {
  45026. var E = A.color;
  45027. this.colors.push(E, E, E)
  45028. }
  45029. if (a === !0) {
  45030. var b = o[0][h];
  45031. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45032. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45033. }
  45034. if (s === !0) {
  45035. var b = o[1][h];
  45036. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45037. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45038. }
  45039. for (var w = 0; w < c; w++) {
  45040. var _ = l[w].vertices;
  45041. t[w].push(_[A.a], _[A.b], _[A.c])
  45042. }
  45043. for (var w = 0; w < p; w++) {
  45044. var T = d[w].vertexNormals[h];
  45045. u[w].push(T.a, T.b, T.c)
  45046. }
  45047. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45048. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45049. }
  45050. return this.computeGroups(e),
  45051. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45052. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45053. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45054. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45055. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45056. this
  45057. },
  45058. dispose: function() {
  45059. this.dispatchEvent({
  45060. type: "dispose"
  45061. })
  45062. }
  45063. },
  45064. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45065. n.BufferGeometry = function() {
  45066. Object.defineProperty(this, "id", {
  45067. value: n.GeometryIdCount++
  45068. }),
  45069. this.uuid = n.Math.generateUUID(),
  45070. this.name = "",
  45071. this.type = "BufferGeometry",
  45072. this.index = null,
  45073. this.attributes = {},
  45074. this.morphAttributes = {},
  45075. this.groups = [],
  45076. this.boundingBox = null,
  45077. this.boundingSphere = null,
  45078. this.drawRange = {
  45079. start: 0,
  45080. count: 1 / 0
  45081. }
  45082. }
  45083. ,
  45084. n.BufferGeometry.prototype = {
  45085. constructor: n.BufferGeometry,
  45086. getIndex: function() {
  45087. return this.index
  45088. },
  45089. setIndex: function(e) {
  45090. this.index = e
  45091. },
  45092. addAttribute: function(e, t) {
  45093. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45094. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45095. void this.setIndex(t)) : (this.attributes[e] = t,
  45096. this)
  45097. },
  45098. getAttribute: function(e) {
  45099. return this.attributes[e]
  45100. },
  45101. removeAttribute: function(e) {
  45102. return delete this.attributes[e],
  45103. this
  45104. },
  45105. addGroup: function(e, t, i) {
  45106. this.groups.push({
  45107. start: e,
  45108. count: t,
  45109. materialIndex: void 0 !== i ? i : 0
  45110. })
  45111. },
  45112. clearGroups: function() {
  45113. this.groups = []
  45114. },
  45115. setDrawRange: function(e, t) {
  45116. this.drawRange.start = e,
  45117. this.drawRange.count = t
  45118. },
  45119. applyMatrix: function(e) {
  45120. var t = this.attributes.position;
  45121. void 0 !== t && (e.applyToVector3Array(t.array),
  45122. t.needsUpdate = !0);
  45123. var i = this.attributes.normal;
  45124. if (void 0 !== i) {
  45125. var r = (new n.Matrix3).getNormalMatrix(e);
  45126. r.applyToVector3Array(i.array),
  45127. i.needsUpdate = !0
  45128. }
  45129. return null !== this.boundingBox && this.computeBoundingBox(),
  45130. null !== this.boundingSphere && this.computeBoundingSphere(),
  45131. this
  45132. },
  45133. rotateX: function() {
  45134. var e;
  45135. return function(t) {
  45136. return void 0 === e && (e = new n.Matrix4),
  45137. e.makeRotationX(t),
  45138. this.applyMatrix(e),
  45139. this
  45140. }
  45141. }(),
  45142. rotateY: function() {
  45143. var e;
  45144. return function(t) {
  45145. return void 0 === e && (e = new n.Matrix4),
  45146. e.makeRotationY(t),
  45147. this.applyMatrix(e),
  45148. this
  45149. }
  45150. }(),
  45151. rotateZ: function() {
  45152. var e;
  45153. return function(t) {
  45154. return void 0 === e && (e = new n.Matrix4),
  45155. e.makeRotationZ(t),
  45156. this.applyMatrix(e),
  45157. this
  45158. }
  45159. }(),
  45160. translate: function() {
  45161. var e;
  45162. return function(t, i, r) {
  45163. return void 0 === e && (e = new n.Matrix4),
  45164. e.makeTranslation(t, i, r),
  45165. this.applyMatrix(e),
  45166. this
  45167. }
  45168. }(),
  45169. scale: function() {
  45170. var e;
  45171. return function(t, i, r) {
  45172. return void 0 === e && (e = new n.Matrix4),
  45173. e.makeScale(t, i, r),
  45174. this.applyMatrix(e),
  45175. this
  45176. }
  45177. }(),
  45178. lookAt: function() {
  45179. var e;
  45180. return function(t) {
  45181. void 0 === e && (e = new n.Object3D),
  45182. e.lookAt(t),
  45183. e.updateMatrix(),
  45184. this.applyMatrix(e.matrix)
  45185. }
  45186. }(),
  45187. center: function() {
  45188. this.computeBoundingBox();
  45189. var e = this.boundingBox.center().negate();
  45190. return this.translate(e.x, e.y, e.z),
  45191. e
  45192. },
  45193. setFromObject: function(e) {
  45194. var t = e.geometry;
  45195. if (e instanceof n.Points || e instanceof n.Line) {
  45196. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45197. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45198. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45199. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45200. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45201. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45202. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45203. }
  45204. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45205. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45206. } else
  45207. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45208. return this
  45209. },
  45210. updateFromObject: function(e) {
  45211. var t = e.geometry;
  45212. if (e instanceof n.Mesh) {
  45213. var i = t.__directGeometry;
  45214. if (void 0 === i)
  45215. return this.fromGeometry(t);
  45216. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45217. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45218. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45219. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45220. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45221. t.verticesNeedUpdate = !1,
  45222. t.normalsNeedUpdate = !1,
  45223. t.colorsNeedUpdate = !1,
  45224. t.uvsNeedUpdate = !1,
  45225. t.groupsNeedUpdate = !1,
  45226. t = i
  45227. }
  45228. if (t.verticesNeedUpdate === !0) {
  45229. var r = this.attributes.position;
  45230. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45231. r.needsUpdate = !0),
  45232. t.verticesNeedUpdate = !1
  45233. }
  45234. if (t.normalsNeedUpdate === !0) {
  45235. var r = this.attributes.normal;
  45236. void 0 !== r && (r.copyVector3sArray(t.normals),
  45237. r.needsUpdate = !0),
  45238. t.normalsNeedUpdate = !1
  45239. }
  45240. if (t.colorsNeedUpdate === !0) {
  45241. var r = this.attributes.color;
  45242. void 0 !== r && (r.copyColorsArray(t.colors),
  45243. r.needsUpdate = !0),
  45244. t.colorsNeedUpdate = !1
  45245. }
  45246. if (t.uvsNeedUpdate) {
  45247. var r = this.attributes.uv;
  45248. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45249. r.needsUpdate = !0),
  45250. t.uvsNeedUpdate = !1
  45251. }
  45252. if (t.lineDistancesNeedUpdate) {
  45253. var r = this.attributes.lineDistance;
  45254. void 0 !== r && (r.copyArray(t.lineDistances),
  45255. r.needsUpdate = !0),
  45256. t.lineDistancesNeedUpdate = !1
  45257. }
  45258. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45259. this.groups = t.groups,
  45260. t.groupsNeedUpdate = !1),
  45261. this
  45262. },
  45263. fromGeometry: function(e) {
  45264. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45265. this.fromDirectGeometry(e.__directGeometry)
  45266. },
  45267. fromDirectGeometry: function(e) {
  45268. var t = new Float32Array(3 * e.vertices.length);
  45269. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45270. e.normals.length > 0) {
  45271. var i = new Float32Array(3 * e.normals.length);
  45272. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45273. }
  45274. if (e.colors.length > 0) {
  45275. var r = new Float32Array(3 * e.colors.length);
  45276. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45277. }
  45278. if (e.uvs.length > 0) {
  45279. var o = new Float32Array(2 * e.uvs.length);
  45280. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45281. }
  45282. if (e.uvs2.length > 0) {
  45283. var a = new Float32Array(2 * e.uvs2.length);
  45284. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45285. }
  45286. if (e.indices.length > 0) {
  45287. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45288. , l = new s(3 * e.indices.length);
  45289. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45290. }
  45291. this.groups = e.groups;
  45292. for (var c in e.morphTargets) {
  45293. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45294. var f = u[d]
  45295. , g = new n.Float32Attribute(3 * f.length,3);
  45296. h.push(g.copyVector3sArray(f))
  45297. }
  45298. this.morphAttributes[c] = h
  45299. }
  45300. if (e.skinIndices.length > 0) {
  45301. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45302. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45303. }
  45304. if (e.skinWeights.length > 0) {
  45305. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45306. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45307. }
  45308. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45309. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45310. this
  45311. },
  45312. computeBoundingBox: function() {
  45313. new n.Vector3;
  45314. return function() {
  45315. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45316. var e = this.attributes.position.array;
  45317. e && this.boundingBox.setFromArray(e),
  45318. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45319. this.boundingBox.max.set(0, 0, 0)),
  45320. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  45321. }
  45322. }(),
  45323. computeBoundingSphere: function() {
  45324. var e = new n.Box3
  45325. , t = new n.Vector3;
  45326. return function() {
  45327. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45328. var i = this.attributes.position.array;
  45329. if (i) {
  45330. var r = this.boundingSphere.center;
  45331. e.setFromArray(i),
  45332. e.center(r);
  45333. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45334. t.fromArray(i, a),
  45335. o = Math.max(o, r.distanceToSquared(t));
  45336. this.boundingSphere.radius = Math.sqrt(o),
  45337. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45338. }
  45339. }
  45340. }(),
  45341. computeFaceNormals: function() {},
  45342. computeVertexNormals: function() {
  45343. var e = this.index
  45344. , t = this.attributes
  45345. , i = this.groups;
  45346. if (t.position) {
  45347. var r = t.position.array;
  45348. if (void 0 === t.normal)
  45349. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45350. else
  45351. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45352. o[a] = 0;
  45353. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  45354. if (e) {
  45355. var v = e.array;
  45356. 0 === i.length && this.addGroup(0, v.length);
  45357. for (var A = 0, y = i.length; A < y; ++A)
  45358. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45359. l = 3 * v[a + 0],
  45360. c = 3 * v[a + 1],
  45361. h = 3 * v[a + 2],
  45362. d.fromArray(r, l),
  45363. p.fromArray(r, c),
  45364. f.fromArray(r, h),
  45365. g.subVectors(f, p),
  45366. m.subVectors(d, p),
  45367. g.cross(m),
  45368. u[l] += g.x,
  45369. u[l + 1] += g.y,
  45370. u[l + 2] += g.z,
  45371. u[c] += g.x,
  45372. u[c + 1] += g.y,
  45373. u[c + 2] += g.z,
  45374. u[h] += g.x,
  45375. u[h + 1] += g.y,
  45376. u[h + 2] += g.z
  45377. } else
  45378. for (var a = 0, s = r.length; a < s; a += 9)
  45379. d.fromArray(r, a),
  45380. p.fromArray(r, a + 3),
  45381. f.fromArray(r, a + 6),
  45382. g.subVectors(f, p),
  45383. m.subVectors(d, p),
  45384. g.cross(m),
  45385. u[a] = g.x,
  45386. u[a + 1] = g.y,
  45387. u[a + 2] = g.z,
  45388. u[a + 3] = g.x,
  45389. u[a + 4] = g.y,
  45390. u[a + 5] = g.z,
  45391. u[a + 6] = g.x,
  45392. u[a + 7] = g.y,
  45393. u[a + 8] = g.z;
  45394. this.normalizeNormals(),
  45395. t.normal.needsUpdate = !0
  45396. }
  45397. },
  45398. merge: function(e, t) {
  45399. if (e instanceof n.BufferGeometry == !1)
  45400. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45401. void 0 === t && (t = 0);
  45402. var i = this.attributes;
  45403. for (var r in i)
  45404. if (void 0 !== e.attributes[r])
  45405. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  45406. u++)
  45407. a[u] = l[h];
  45408. return this
  45409. },
  45410. normalizeNormals: function() {
  45411. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45412. e = r[o],
  45413. t = r[o + 1],
  45414. i = r[o + 2],
  45415. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45416. r[o] *= n,
  45417. r[o + 1] *= n,
  45418. r[o + 2] *= n
  45419. },
  45420. toNonIndexed: function() {
  45421. if (null === this.index)
  45422. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45423. this;
  45424. var e = new n.BufferGeometry
  45425. , t = this.index.array
  45426. , i = this.attributes;
  45427. for (var r in i) {
  45428. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  45429. c = t[u] * s;
  45430. for (var p = 0; p < s; p++)
  45431. l[h++] = a[c++]
  45432. }
  45433. e.addAttribute(r, new n.BufferAttribute(l,s))
  45434. }
  45435. return e
  45436. },
  45437. toJSON: function() {
  45438. var e = {
  45439. metadata: {
  45440. version: 4.4,
  45441. type: "BufferGeometry",
  45442. generator: "BufferGeometry.toJSON"
  45443. }
  45444. };
  45445. if (e.uuid = this.uuid,
  45446. e.type = this.type,
  45447. "" !== this.name && (e.name = this.name),
  45448. void 0 !== this.parameters) {
  45449. var t = this.parameters;
  45450. for (var i in t)
  45451. void 0 !== t[i] && (e[i] = t[i]);
  45452. return e
  45453. }
  45454. e.data = {
  45455. attributes: {}
  45456. };
  45457. var n = this.index;
  45458. if (null !== n) {
  45459. var r = Array.prototype.slice.call(n.array);
  45460. e.data.index = {
  45461. type: n.array.constructor.name,
  45462. array: r
  45463. }
  45464. }
  45465. var o = this.attributes;
  45466. for (var i in o) {
  45467. var a = o[i]
  45468. , r = Array.prototype.slice.call(a.array);
  45469. e.data.attributes[i] = {
  45470. itemSize: a.itemSize,
  45471. type: a.array.constructor.name,
  45472. array: r
  45473. }
  45474. }
  45475. var s = this.groups;
  45476. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45477. var l = this.boundingSphere;
  45478. return null !== l && (e.data.boundingSphere = {
  45479. center: l.center.toArray(),
  45480. radius: l.radius
  45481. }),
  45482. e
  45483. },
  45484. clone: function() {
  45485. return (new n.BufferGeometry).copy(this)
  45486. },
  45487. copy: function(e) {
  45488. var t = e.index;
  45489. null !== t && this.setIndex(t.clone());
  45490. var i = e.attributes;
  45491. for (var n in i) {
  45492. var r = i[n];
  45493. this.addAttribute(n, r.clone())
  45494. }
  45495. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45496. var l = o[a];
  45497. this.addGroup(l.start, l.count)
  45498. }
  45499. return this
  45500. },
  45501. dispose: function() {
  45502. this.dispatchEvent({
  45503. type: "dispose"
  45504. })
  45505. }
  45506. },
  45507. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45508. n.BufferGeometry.MaxIndex = 65535,
  45509. n.InstancedBufferGeometry = function() {
  45510. n.BufferGeometry.call(this),
  45511. this.type = "InstancedBufferGeometry",
  45512. this.maxInstancedCount = void 0
  45513. }
  45514. ,
  45515. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45516. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45517. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45518. this.groups.push({
  45519. start: e,
  45520. count: t,
  45521. instances: i
  45522. })
  45523. }
  45524. ,
  45525. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45526. var t = e.index;
  45527. null !== t && this.setIndex(t.clone());
  45528. var i = e.attributes;
  45529. for (var n in i) {
  45530. var r = i[n];
  45531. this.addAttribute(n, r.clone())
  45532. }
  45533. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45534. var l = o[a];
  45535. this.addGroup(l.start, l.count, l.instances)
  45536. }
  45537. return this
  45538. }
  45539. ,
  45540. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45541. n.Uniform = function(e, t) {
  45542. this.type = e,
  45543. this.value = t,
  45544. this.dynamic = !1
  45545. }
  45546. ,
  45547. n.Uniform.prototype = {
  45548. constructor: n.Uniform,
  45549. onUpdate: function(e) {
  45550. return this.dynamic = !0,
  45551. this.onUpdateCallback = e,
  45552. this
  45553. }
  45554. },
  45555. n.AnimationClip = function(e, t, i) {
  45556. this.name = e || n.Math.generateUUID(),
  45557. this.tracks = i,
  45558. this.duration = void 0 !== t ? t : -1,
  45559. this.duration < 0 && this.resetDuration(),
  45560. this.trim(),
  45561. this.optimize()
  45562. }
  45563. ,
  45564. n.AnimationClip.prototype = {
  45565. constructor: n.AnimationClip,
  45566. resetDuration: function() {
  45567. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45568. var r = this.tracks[i];
  45569. t = Math.max(t, r.times[r.times.length - 1])
  45570. }
  45571. this.duration = t
  45572. },
  45573. trim: function() {
  45574. for (var e = 0; e < this.tracks.length; e++)
  45575. this.tracks[e].trim(0, this.duration);
  45576. return this
  45577. },
  45578. optimize: function() {
  45579. for (var e = 0; e < this.tracks.length; e++)
  45580. this.tracks[e].optimize();
  45581. return this
  45582. }
  45583. },
  45584. Object.assign(n.AnimationClip, {
  45585. parse: function(e) {
  45586. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45587. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45588. return new n.AnimationClip(e.name,e.duration,t)
  45589. },
  45590. toJSON: function(e) {
  45591. for (var t = [], i = e.tracks, r = {
  45592. name: e.name,
  45593. duration: e.duration,
  45594. tracks: t
  45595. }, o = 0, a = i.length; o !== a; ++o)
  45596. t.push(n.KeyframeTrack.toJSON(i[o]));
  45597. return r
  45598. },
  45599. CreateFromMorphTargetSequence: function(e, t, i) {
  45600. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45601. var s = []
  45602. , l = [];
  45603. s.push((a + r - 1) % r, a, (a + 1) % r),
  45604. l.push(0, 1, 0);
  45605. var c = n.AnimationUtils.getKeyframeOrder(s);
  45606. s = n.AnimationUtils.sortedArray(s, 1, c),
  45607. l = n.AnimationUtils.sortedArray(l, 1, c),
  45608. 0 === s[0] && (s.push(r),
  45609. l.push(l[0])),
  45610. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45611. }
  45612. return new n.AnimationClip(e,-1,o)
  45613. },
  45614. findByName: function(e, t) {
  45615. for (var i = 0; i < e.length; i++)
  45616. if (e[i].name === t)
  45617. return e[i];
  45618. return null
  45619. },
  45620. CreateClipsFromMorphTargetSequences: function(e, t) {
  45621. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45622. var s = e[o]
  45623. , l = s.name.match(r);
  45624. if (l && l.length > 1) {
  45625. var c = l[1]
  45626. , h = i[c];
  45627. h || (i[c] = h = []),
  45628. h.push(s)
  45629. }
  45630. }
  45631. var u = [];
  45632. for (var c in i)
  45633. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45634. return u
  45635. },
  45636. parseAnimation: function(e, t, i) {
  45637. if (!e)
  45638. return console.error(" no animation in JSONLoader data"),
  45639. null;
  45640. for (var r = function(e, t, i, r, o) {
  45641. if (0 !== i.length) {
  45642. var a = []
  45643. , s = [];
  45644. n.AnimationUtils.flattenJSON(i, a, s, r),
  45645. 0 !== a.length && o.push(new e(t,a,s))
  45646. }
  45647. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45648. var u = c[h].keys;
  45649. if (u && 0 != u.length)
  45650. if (u[0].morphTargets) {
  45651. for (var d = {}, p = 0; p < u.length; p++)
  45652. if (u[p].morphTargets)
  45653. for (var f = 0; f < u[p].morphTargets.length; f++)
  45654. d[u[p].morphTargets[f]] = -1;
  45655. for (var g in d) {
  45656. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45657. var A = u[p];
  45658. m.push(A.time),
  45659. v.push(A.morphTarget === g ? 1 : 0)
  45660. }
  45661. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45662. }
  45663. s = d.length * (l || 1)
  45664. } else {
  45665. var y = ".bones[" + t[h].name + "]";
  45666. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45667. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45668. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45669. }
  45670. }
  45671. if (0 === o.length)
  45672. return null;
  45673. var C = new n.AnimationClip(a,s,o);
  45674. return C
  45675. }
  45676. }),
  45677. n.AnimationMixer = function(e) {
  45678. this._root = e,
  45679. this._initMemoryManager(),
  45680. this._accuIndex = 0,
  45681. this.time = 0,
  45682. this.timeScale = 1
  45683. }
  45684. ,
  45685. n.AnimationMixer.prototype = {
  45686. constructor: n.AnimationMixer,
  45687. clipAction: function(e, t) {
  45688. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  45689. if (void 0 !== l) {
  45690. var c = l.actionByRoot[o];
  45691. if (void 0 !== c)
  45692. return c;
  45693. if (i = l.knownActions[0],
  45694. s = i._clip,
  45695. e !== a && e !== s)
  45696. throw new Error("Different clips with the same name detected!")
  45697. }
  45698. if (null === s)
  45699. return null;
  45700. var h = new n.AnimationMixer._Action(this,s,t);
  45701. return this._bindAction(h, i),
  45702. this._addInactiveAction(h, a, o),
  45703. h
  45704. },
  45705. existingAction: function(e, t) {
  45706. var i = t || this._root
  45707. , n = i.uuid
  45708. , r = "string" == typeof e ? e : e.name
  45709. , o = this._actionsByClip[r];
  45710. return void 0 !== o ? o.actionByRoot[n] || null : null
  45711. },
  45712. stopAllAction: function() {
  45713. var e = this._actions
  45714. , t = this._nActiveActions
  45715. , i = this._bindings
  45716. , n = this._nActiveBindings;
  45717. this._nActiveActions = 0,
  45718. this._nActiveBindings = 0;
  45719. for (var r = 0; r !== t; ++r)
  45720. e[r].reset();
  45721. for (var r = 0; r !== n; ++r)
  45722. i[r].useCount = 0;
  45723. return this
  45724. },
  45725. update: function(e) {
  45726. e *= this.timeScale;
  45727. for (var t = this._actions, i = this._nActiveActions, n = this.time += e, r = Math.sign(e), o = this._accuIndex ^= 1, a = 0; a !== i; ++a) {
  45728. var s = t[a];
  45729. s.enabled && s._update(n, e, r, o)
  45730. }
  45731. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45732. l[a].apply(o);
  45733. return this
  45734. },
  45735. getRoot: function() {
  45736. return this._root
  45737. },
  45738. uncacheClip: function(e) {
  45739. var t = this._actions
  45740. , i = e.name
  45741. , n = this._actionsByClip
  45742. , r = n[i];
  45743. if (void 0 !== r) {
  45744. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45745. var l = o[a];
  45746. this._deactivateAction(l);
  45747. var c = l._cacheIndex
  45748. , h = t[t.length - 1];
  45749. l._cacheIndex = null,
  45750. l._byClipCacheIndex = null,
  45751. h._cacheIndex = c,
  45752. t[c] = h,
  45753. t.pop(),
  45754. this._removeInactiveBindingsForAction(l)
  45755. }
  45756. delete n[i]
  45757. }
  45758. },
  45759. uncacheRoot: function(e) {
  45760. var t = e.uuid
  45761. , i = this._actionsByClip;
  45762. for (var n in i) {
  45763. var r = i[n].actionByRoot
  45764. , o = r[t];
  45765. void 0 !== o && (this._deactivateAction(o),
  45766. this._removeInactiveAction(o))
  45767. }
  45768. var a = this._bindingsByRootAndName
  45769. , s = a[t];
  45770. if (void 0 !== s)
  45771. for (var l in s) {
  45772. var c = s[l];
  45773. c.restoreOriginalState(),
  45774. this._removeInactiveBinding(c)
  45775. }
  45776. },
  45777. uncacheAction: function(e, t) {
  45778. var i = this.existingAction(e, t);
  45779. null !== i && (this._deactivateAction(i),
  45780. this._removeInactiveAction(i))
  45781. }
  45782. },
  45783. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45784. n.AnimationMixer._Action = function(e, t, i) {
  45785. this._mixer = e,
  45786. this._clip = t,
  45787. this._localRoot = i || null;
  45788. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45789. endingStart: n.ZeroCurvatureEnding,
  45790. endingEnd: n.ZeroCurvatureEnding
  45791. }, l = 0; l !== o; ++l) {
  45792. var c = r[l].createInterpolant(null);
  45793. a[l] = c,
  45794. c.settings = s
  45795. }
  45796. this._interpolantSettings = s,
  45797. this._interpolants = a,
  45798. this._propertyBindings = new Array(o),
  45799. this._cacheIndex = null,
  45800. this._byClipCacheIndex = null,
  45801. this._timeScaleInterpolant = null,
  45802. this._weightInterpolant = null,
  45803. this.loop = n.LoopRepeat,
  45804. this._loopCount = -1,
  45805. this._startTime = null,
  45806. this.time = 0,
  45807. this.timeScale = 1,
  45808. this._effectiveTimeScale = 1,
  45809. this.weight = 1,
  45810. this._effectiveWeight = 1,
  45811. this.repetitions = 1 / 0,
  45812. this.paused = !1,
  45813. this.enabled = !0,
  45814. this.clampWhenFinished = !1,
  45815. this.zeroSlopeAtStart = !0,
  45816. this.zeroSlopeAtEnd = !0
  45817. }
  45818. ,
  45819. n.AnimationMixer._Action.prototype = {
  45820. constructor: n.AnimationMixer._Action,
  45821. play: function() {
  45822. return this._mixer._activateAction(this),
  45823. this
  45824. },
  45825. stop: function() {
  45826. return this._mixer._deactivateAction(this),
  45827. this.reset()
  45828. },
  45829. reset: function() {
  45830. return this.paused = !1,
  45831. this.enabled = !0,
  45832. this.time = 0,
  45833. this._loopCount = -1,
  45834. this._startTime = null,
  45835. this.stopFading().stopWarping()
  45836. },
  45837. isRunning: function() {
  45838. this._startTime;
  45839. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45840. },
  45841. isScheduled: function() {
  45842. return this._mixer._isActiveAction(this)
  45843. },
  45844. startAt: function(e) {
  45845. return this._startTime = e,
  45846. this
  45847. },
  45848. setLoop: function(e, t) {
  45849. return this.loop = e,
  45850. this.repetitions = t,
  45851. this
  45852. },
  45853. setEffectiveWeight: function(e) {
  45854. return this.weight = e,
  45855. this._effectiveWeight = this.enabled ? e : 0,
  45856. this.stopFading()
  45857. },
  45858. getEffectiveWeight: function() {
  45859. return this._effectiveWeight
  45860. },
  45861. fadeIn: function(e) {
  45862. return this._scheduleFading(e, 0, 1)
  45863. },
  45864. fadeOut: function(e) {
  45865. return this._scheduleFading(e, 1, 0)
  45866. },
  45867. crossFadeFrom: function(e, t, i) {
  45868. this._mixer;
  45869. if (e.fadeOut(t),
  45870. this.fadeIn(t),
  45871. i) {
  45872. var n = this._clip.duration
  45873. , r = e._clip.duration
  45874. , o = r / n
  45875. , a = n / r;
  45876. e.warp(1, o, t),
  45877. this.warp(a, 1, t)
  45878. }
  45879. return this
  45880. },
  45881. crossFadeTo: function(e, t, i) {
  45882. return e.crossFadeFrom(this, t, i)
  45883. },
  45884. stopFading: function() {
  45885. var e = this._weightInterpolant;
  45886. return null !== e && (this._weightInterpolant = null,
  45887. this._mixer._takeBackControlInterpolant(e)),
  45888. this
  45889. },
  45890. setEffectiveTimeScale: function(e) {
  45891. return this.timeScale = e,
  45892. this._effectiveTimeScale = this.paused ? 0 : e,
  45893. this.stopWarping()
  45894. },
  45895. getEffectiveTimeScale: function() {
  45896. return this._effectiveTimeScale
  45897. },
  45898. setDuration: function(e) {
  45899. return this.timeScale = this._clip.duration / e,
  45900. this.stopWarping()
  45901. },
  45902. syncWith: function(e) {
  45903. return this.time = e.time,
  45904. this.timeScale = e.timeScale,
  45905. this.stopWarping()
  45906. },
  45907. halt: function(e) {
  45908. return this.warp(this._currentTimeScale, 0, e)
  45909. },
  45910. warp: function(e, t, i) {
  45911. var n = this._mixer
  45912. , r = n.time
  45913. , o = this._timeScaleInterpolant
  45914. , a = this.timeScale;
  45915. null === o && (o = n._lendControlInterpolant(),
  45916. this._timeScaleInterpolant = o);
  45917. var s = o.parameterPositions
  45918. , l = o.sampleValues;
  45919. return s[0] = r,
  45920. s[1] = r + i,
  45921. l[0] = e / a,
  45922. l[1] = t / a,
  45923. this
  45924. },
  45925. stopWarping: function() {
  45926. var e = this._timeScaleInterpolant;
  45927. return null !== e && (this._timeScaleInterpolant = null,
  45928. this._mixer._takeBackControlInterpolant(e)),
  45929. this
  45930. },
  45931. getMixer: function() {
  45932. return this._mixer
  45933. },
  45934. getClip: function() {
  45935. return this._clip
  45936. },
  45937. getRoot: function() {
  45938. return this._localRoot || this._mixer._root
  45939. },
  45940. _update: function(e, t, i, n) {
  45941. var r = this._startTime;
  45942. if (null !== r) {
  45943. var o = (e - r) * i;
  45944. if (o < 0 || 0 === i)
  45945. return;
  45946. this._startTime = null,
  45947. t = i * o
  45948. }
  45949. t *= this._updateTimeScale(e);
  45950. var a = this._updateTime(t)
  45951. , s = this._updateWeight(e);
  45952. if (s > 0)
  45953. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45954. l[h].evaluate(a),
  45955. c[h].accumulate(n, s)
  45956. },
  45957. _updateWeight: function(e) {
  45958. var t = 0;
  45959. if (this.enabled) {
  45960. t = this.weight;
  45961. var i = this._weightInterpolant;
  45962. if (null !== i) {
  45963. var n = i.evaluate(e)[0];
  45964. t *= n,
  45965. e > i.parameterPositions[1] && (this.stopFading(),
  45966. 0 === n && (this.enabled = !1))
  45967. }
  45968. }
  45969. return this._effectiveWeight = t,
  45970. t
  45971. },
  45972. _updateTimeScale: function(e) {
  45973. var t = 0;
  45974. if (!this.paused) {
  45975. t = this.timeScale;
  45976. var i = this._timeScaleInterpolant;
  45977. if (null !== i) {
  45978. var n = i.evaluate(e)[0];
  45979. t *= n,
  45980. e > i.parameterPositions[1] && (this.stopWarping(),
  45981. 0 === t ? this.pause = !0 : this.timeScale = t)
  45982. }
  45983. }
  45984. return this._effectiveTimeScale = t,
  45985. t
  45986. },
  45987. _updateTime: function(e) {
  45988. var t = this.time + e;
  45989. if (0 === e)
  45990. return t;
  45991. var i = this._clip.duration
  45992. , r = this.loop
  45993. , o = this._loopCount
  45994. , a = !1;
  45995. switch (r) {
  45996. case n.LoopOnce:
  45997. if (o === -1 && (this.loopCount = 0,
  45998. this._setEndings(!0, !0, !1)),
  45999. t >= i)
  46000. t = i;
  46001. else {
  46002. if (!(t < 0))
  46003. break;
  46004. t = 0
  46005. }
  46006. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46007. this._mixer.dispatchEvent({
  46008. type: "finished",
  46009. action: this,
  46010. direction: e < 0 ? -1 : 1
  46011. });
  46012. break;
  46013. case n.LoopPingPong:
  46014. a = !0;
  46015. case n.LoopRepeat:
  46016. if (o === -1 && (e > 0 ? (o = 0,
  46017. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46018. t >= i || t < 0) {
  46019. var s = Math.floor(t / i);
  46020. t -= i * s,
  46021. o += Math.abs(s);
  46022. var l = this.repetitions - o;
  46023. if (l < 0) {
  46024. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46025. t = e > 0 ? i : 0,
  46026. this._mixer.dispatchEvent({
  46027. type: "finished",
  46028. action: this,
  46029. direction: e > 0 ? 1 : -1
  46030. });
  46031. break
  46032. }
  46033. if (0 === l) {
  46034. var c = e < 0;
  46035. this._setEndings(c, !c, a)
  46036. } else
  46037. this._setEndings(!1, !1, a);
  46038. this._loopCount = o,
  46039. this._mixer.dispatchEvent({
  46040. type: "loop",
  46041. action: this,
  46042. loopDelta: s
  46043. })
  46044. }
  46045. if (r === n.LoopPingPong && 1 === (1 & o))
  46046. return this.time = t,
  46047. i - t
  46048. }
  46049. return this.time = t,
  46050. t
  46051. },
  46052. _setEndings: function(e, t, i) {
  46053. var r = this._interpolantSettings;
  46054. i ? (r.endingStart = n.ZeroSlopeEnding,
  46055. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46056. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46057. },
  46058. _scheduleFading: function(e, t, i) {
  46059. var n = this._mixer
  46060. , r = n.time
  46061. , o = this._weightInterpolant;
  46062. null === o && (o = n._lendControlInterpolant(),
  46063. this._weightInterpolant = o);
  46064. var a = o.parameterPositions
  46065. , s = o.sampleValues;
  46066. return a[0] = r,
  46067. s[0] = t,
  46068. a[1] = r + e,
  46069. s[1] = i,
  46070. this
  46071. }
  46072. },
  46073. Object.assign(n.AnimationMixer.prototype, {
  46074. _bindAction: function(e, t) {
  46075. var i = e._localRoot || this._root
  46076. , r = e._clip.tracks
  46077. , o = r.length
  46078. , a = e._propertyBindings
  46079. , s = e._interpolants
  46080. , l = i.uuid
  46081. , c = this._bindingsByRootAndName
  46082. , h = c[l];
  46083. void 0 === h && (h = {},
  46084. c[l] = h);
  46085. for (var u = 0; u !== o; ++u) {
  46086. var d = r[u]
  46087. , p = d.name
  46088. , f = h[p];
  46089. if (void 0 !== f)
  46090. a[u] = f;
  46091. else {
  46092. if (f = a[u],
  46093. void 0 !== f) {
  46094. null === f._cacheIndex && (++f.referenceCount,
  46095. this._addInactiveBinding(f, l, p));
  46096. continue
  46097. }
  46098. var g = t && t._propertyBindings[u].binding.parsedPath;
  46099. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46100. ++f.referenceCount,
  46101. this._addInactiveBinding(f, l, p),
  46102. a[u] = f
  46103. }
  46104. s[u].resultBuffer = f.buffer
  46105. }
  46106. },
  46107. _activateAction: function(e) {
  46108. if (!this._isActiveAction(e)) {
  46109. if (null === e._cacheIndex) {
  46110. var t = (e._localRoot || this._root).uuid
  46111. , i = e._clip.name
  46112. , n = this._actionsByClip[i];
  46113. this._bindAction(e, n && n.knownActions[0]),
  46114. this._addInactiveAction(e, i, t)
  46115. }
  46116. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46117. var s = r[o];
  46118. 0 === s.useCount++ && (this._lendBinding(s),
  46119. s.saveOriginalState())
  46120. }
  46121. this._lendAction(e)
  46122. }
  46123. },
  46124. _deactivateAction: function(e) {
  46125. if (this._isActiveAction(e)) {
  46126. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46127. var r = t[i];
  46128. 0 === --r.useCount && (r.restoreOriginalState(),
  46129. this._takeBackBinding(r))
  46130. }
  46131. this._takeBackAction(e)
  46132. }
  46133. },
  46134. _initMemoryManager: function() {
  46135. this._actions = [],
  46136. this._nActiveActions = 0,
  46137. this._actionsByClip = {},
  46138. this._bindings = [],
  46139. this._nActiveBindings = 0,
  46140. this._bindingsByRootAndName = {},
  46141. this._controlInterpolants = [],
  46142. this._nActiveControlInterpolants = 0;
  46143. var e = this;
  46144. this.stats = {
  46145. actions: {
  46146. get total() {
  46147. return e._actions.length
  46148. },
  46149. get inUse() {
  46150. return e._nActiveActions
  46151. }
  46152. },
  46153. bindings: {
  46154. get total() {
  46155. return e._bindings.length
  46156. },
  46157. get inUse() {
  46158. return e._nActiveBindings
  46159. }
  46160. },
  46161. controlInterpolants: {
  46162. get total() {
  46163. return e._controlInterpolants.length
  46164. },
  46165. get inUse() {
  46166. return e._nActiveControlInterpolants
  46167. }
  46168. }
  46169. }
  46170. },
  46171. _isActiveAction: function(e) {
  46172. var t = e._cacheIndex;
  46173. return null !== t && t < this._nActiveActions
  46174. },
  46175. _addInactiveAction: function(e, t, i) {
  46176. var n = this._actions
  46177. , r = this._actionsByClip
  46178. , o = r[t];
  46179. if (void 0 === o)
  46180. o = {
  46181. knownActions: [e],
  46182. actionByRoot: {}
  46183. },
  46184. e._byClipCacheIndex = 0,
  46185. r[t] = o;
  46186. else {
  46187. var a = o.knownActions;
  46188. e._byClipCacheIndex = a.length,
  46189. a.push(e)
  46190. }
  46191. e._cacheIndex = n.length,
  46192. n.push(e),
  46193. o.actionByRoot[i] = e
  46194. },
  46195. _removeInactiveAction: function(e) {
  46196. var t = this._actions
  46197. , i = t[t.length - 1]
  46198. , n = e._cacheIndex;
  46199. i._cacheIndex = n,
  46200. t[n] = i,
  46201. t.pop(),
  46202. e._cacheIndex = null;
  46203. var r = e._clip.name
  46204. , o = this._actionsByClip
  46205. , a = o[r]
  46206. , s = a.knownActions
  46207. , l = s[s.length - 1]
  46208. , c = e._byClipCacheIndex;
  46209. l._byClipCacheIndex = c,
  46210. s[c] = l,
  46211. s.pop(),
  46212. e._byClipCacheIndex = null;
  46213. var h = a.actionByRoot
  46214. , u = (t._localRoot || this._root).uuid;
  46215. delete h[u],
  46216. 0 === s.length && delete o[r],
  46217. this._removeInactiveBindingsForAction(e)
  46218. },
  46219. _removeInactiveBindingsForAction: function(e) {
  46220. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46221. var r = t[i];
  46222. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46223. }
  46224. },
  46225. _lendAction: function(e) {
  46226. var t = this._actions
  46227. , i = e._cacheIndex
  46228. , n = this._nActiveActions++
  46229. , r = t[n];
  46230. e._cacheIndex = n,
  46231. t[n] = e,
  46232. r._cacheIndex = i,
  46233. t[i] = r
  46234. },
  46235. _takeBackAction: function(e) {
  46236. var t = this._actions
  46237. , i = e._cacheIndex
  46238. , n = --this._nActiveActions
  46239. , r = t[n];
  46240. e._cacheIndex = n,
  46241. t[n] = e,
  46242. r._cacheIndex = i,
  46243. t[i] = r
  46244. },
  46245. _addInactiveBinding: function(e, t, i) {
  46246. var n = this._bindingsByRootAndName
  46247. , r = n[t]
  46248. , o = this._bindings;
  46249. void 0 === r && (r = {},
  46250. n[t] = r),
  46251. r[i] = e,
  46252. e._cacheIndex = o.length,
  46253. o.push(e)
  46254. },
  46255. _removeInactiveBinding: function(e) {
  46256. var t = this._bindings
  46257. , i = e.binding
  46258. , n = i.rootNode.uuid
  46259. , r = i.path
  46260. , o = this._bindingsByRootAndName
  46261. , a = o[n]
  46262. , s = t[t.length - 1]
  46263. , l = e._cacheIndex;
  46264. s._cacheIndex = l,
  46265. t[l] = s,
  46266. t.pop(),
  46267. delete a[r];
  46268. e: {
  46269. for (var c in a)
  46270. break e;
  46271. delete o[n]
  46272. }
  46273. },
  46274. _lendBinding: function(e) {
  46275. var t = this._bindings
  46276. , i = e._cacheIndex
  46277. , n = this._nActiveBindings++
  46278. , r = t[n];
  46279. e._cacheIndex = n,
  46280. t[n] = e,
  46281. r._cacheIndex = i,
  46282. t[i] = r
  46283. },
  46284. _takeBackBinding: function(e) {
  46285. var t = this._bindings
  46286. , i = e._cacheIndex
  46287. , n = --this._nActiveBindings
  46288. , r = t[n];
  46289. e._cacheIndex = n,
  46290. t[n] = e,
  46291. r._cacheIndex = i,
  46292. t[i] = r
  46293. },
  46294. _lendControlInterpolant: function() {
  46295. var e = this._controlInterpolants
  46296. , t = this._nActiveControlInterpolants++
  46297. , i = e[t];
  46298. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46299. i.__cacheIndex = t,
  46300. e[t] = i),
  46301. i
  46302. },
  46303. _takeBackControlInterpolant: function(e) {
  46304. var t = this._controlInterpolants
  46305. , i = e.__cacheIndex
  46306. , n = --this._nActiveControlInterpolants
  46307. , r = t[n];
  46308. e.__cacheIndex = n,
  46309. t[n] = e,
  46310. r.__cacheIndex = i,
  46311. t[i] = r
  46312. },
  46313. _controlInterpolantsResultBuffer: new Float32Array(1)
  46314. }),
  46315. n.AnimationObjectGroup = function(e) {
  46316. this.uuid = n.Math.generateUUID(),
  46317. this._objects = Array.prototype.slice.call(arguments),
  46318. this.nCachedObjects_ = 0;
  46319. var t = {};
  46320. this._indicesByUUID = t;
  46321. for (var i = 0, r = arguments.length; i !== r; ++i)
  46322. t[arguments[i].uuid] = i;
  46323. this._paths = [],
  46324. this._parsedPaths = [],
  46325. this._bindings = [],
  46326. this._bindingsIndicesByPath = {};
  46327. var o = this;
  46328. this.stats = {
  46329. objects: {
  46330. get total() {
  46331. return o._objects.length
  46332. },
  46333. get inUse() {
  46334. return this.total - o.nCachedObjects_
  46335. }
  46336. },
  46337. get bindingsPerObject() {
  46338. return o._bindings.length
  46339. }
  46340. }
  46341. }
  46342. ,
  46343. n.AnimationObjectGroup.prototype = {
  46344. constructor: n.AnimationObjectGroup,
  46345. add: function(e) {
  46346. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  46347. var d = arguments[h]
  46348. , p = d.uuid
  46349. , f = o[p];
  46350. if (void 0 === f) {
  46351. f = i++,
  46352. o[p] = f,
  46353. t.push(d);
  46354. for (var g = 0, m = c; g !== m; ++g)
  46355. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46356. } else if (f < r) {
  46357. var v = t[f]
  46358. , A = --r
  46359. , y = t[A];
  46360. o[y.uuid] = f,
  46361. t[f] = y,
  46362. o[p] = A,
  46363. t[A] = d;
  46364. for (var g = 0, m = c; g !== m; ++g) {
  46365. var C = l[g]
  46366. , I = C[A]
  46367. , E = C[f];
  46368. C[f] = I,
  46369. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46370. C[A] = E
  46371. }
  46372. } else
  46373. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46374. }
  46375. this.nCachedObjects_ = r
  46376. },
  46377. remove: function(e) {
  46378. for (var t = this._objects, i = (t.length,
  46379. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46380. var l = arguments[a]
  46381. , c = l.uuid
  46382. , h = n[c];
  46383. if (void 0 !== h && h >= i) {
  46384. var u = i++
  46385. , d = t[u];
  46386. n[d.uuid] = h,
  46387. t[h] = d,
  46388. n[c] = u,
  46389. t[u] = l;
  46390. for (var p = 0, f = o; p !== f; ++p) {
  46391. var g = r[p]
  46392. , m = g[u]
  46393. , v = g[h];
  46394. g[h] = m,
  46395. g[u] = v
  46396. }
  46397. }
  46398. }
  46399. this.nCachedObjects_ = i
  46400. },
  46401. uncache: function(e) {
  46402. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  46403. var c = arguments[s]
  46404. , h = c.uuid
  46405. , u = r[h];
  46406. if (void 0 !== u)
  46407. if (delete r[h],
  46408. u < n) {
  46409. var d = --n
  46410. , p = t[d]
  46411. , f = --i
  46412. , g = t[f];
  46413. r[p.uuid] = u,
  46414. t[u] = p,
  46415. r[g.uuid] = d,
  46416. t[d] = g,
  46417. t.pop();
  46418. for (var m = 0, v = a; m !== v; ++m) {
  46419. var A = o[m]
  46420. , y = A[d]
  46421. , C = A[f];
  46422. A[u] = y,
  46423. A[d] = C,
  46424. A.pop()
  46425. }
  46426. } else {
  46427. var f = --i
  46428. , g = t[f];
  46429. r[g.uuid] = u,
  46430. t[u] = g,
  46431. t.pop();
  46432. for (var m = 0, v = a; m !== v; ++m) {
  46433. var A = o[m];
  46434. A[u] = A[f],
  46435. A.pop()
  46436. }
  46437. }
  46438. }
  46439. this.nCachedObjects_ = n
  46440. },
  46441. subscribe_: function(e, t) {
  46442. var i = this._bindingsIndicesByPath
  46443. , r = i[e]
  46444. , o = this._bindings;
  46445. if (void 0 !== r)
  46446. return o[r];
  46447. var a = this._paths
  46448. , s = this._parsedPaths
  46449. , l = this._objects
  46450. , c = l.length
  46451. , h = this.nCachedObjects_
  46452. , u = new Array(c);
  46453. r = o.length,
  46454. i[e] = r,
  46455. a.push(e),
  46456. s.push(t),
  46457. o.push(u);
  46458. for (var d = h, p = l.length; d !== p; ++d) {
  46459. var f = l[d];
  46460. u[d] = new n.PropertyBinding(f,e,t)
  46461. }
  46462. return u
  46463. },
  46464. unsubscribe_: function(e) {
  46465. var t = this._bindingsIndicesByPath
  46466. , i = t[e];
  46467. if (void 0 !== i) {
  46468. var n = this._paths
  46469. , r = this._parsedPaths
  46470. , o = this._bindings
  46471. , a = o.length - 1
  46472. , s = o[a]
  46473. , l = e[a];
  46474. t[l] = i,
  46475. o[i] = s,
  46476. o.pop(),
  46477. r[i] = r[a],
  46478. r.pop(),
  46479. n[i] = n[a],
  46480. n.pop()
  46481. }
  46482. }
  46483. },
  46484. n.AnimationUtils = {
  46485. arraySlice: function(e, t, i) {
  46486. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46487. },
  46488. convertArray: function(e, t, i) {
  46489. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46490. },
  46491. isTypedArray: function(e) {
  46492. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46493. },
  46494. getKeyframeOrder: function(e) {
  46495. function t(t, i) {
  46496. return e[t] - e[i]
  46497. }
  46498. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46499. n[r] = r;
  46500. return n.sort(t),
  46501. n
  46502. },
  46503. sortedArray: function(e, t, i) {
  46504. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46505. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46506. r[a++] = e[s + l];
  46507. return r
  46508. },
  46509. flattenJSON: function(e, t, i, n) {
  46510. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46511. o = e[r++];
  46512. if (void 0 !== o) {
  46513. var a = o[n];
  46514. if (void 0 !== a)
  46515. if (Array.isArray(a)) {
  46516. do
  46517. a = o[n],
  46518. void 0 !== a && (t.push(o.time),
  46519. i.push.apply(i, a)),
  46520. o = e[r++];
  46521. while (void 0 !== o)
  46522. } else if (void 0 !== a.toArray) {
  46523. do
  46524. a = o[n],
  46525. void 0 !== a && (t.push(o.time),
  46526. a.toArray(i, i.length)),
  46527. o = e[r++];
  46528. while (void 0 !== o)
  46529. } else
  46530. do
  46531. a = o[n],
  46532. void 0 !== a && (t.push(o.time),
  46533. i.push(a)),
  46534. o = e[r++];
  46535. while (void 0 !== o)
  46536. }
  46537. }
  46538. },
  46539. n.KeyframeTrack = function(e, t, i, r) {
  46540. if (void 0 === e)
  46541. throw new Error("track name is undefined");
  46542. if (void 0 === t || 0 === t.length)
  46543. throw new Error("no keyframes in track named " + e);
  46544. this.name = e,
  46545. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46546. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46547. this.setInterpolation(r || this.DefaultInterpolation),
  46548. this.validate(),
  46549. this.optimize()
  46550. }
  46551. ,
  46552. n.KeyframeTrack.prototype = {
  46553. constructor: n.KeyframeTrack,
  46554. TimeBufferType: Float32Array,
  46555. ValueBufferType: Float32Array,
  46556. DefaultInterpolation: n.InterpolateLinear,
  46557. InterpolantFactoryMethodDiscrete: function(e) {
  46558. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46559. },
  46560. InterpolantFactoryMethodLinear: function(e) {
  46561. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46562. },
  46563. InterpolantFactoryMethodSmooth: function(e) {
  46564. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46565. },
  46566. setInterpolation: function(e) {
  46567. var t = void 0;
  46568. switch (e) {
  46569. case n.InterpolateDiscrete:
  46570. t = this.InterpolantFactoryMethodDiscrete;
  46571. break;
  46572. case n.InterpolateLinear:
  46573. t = this.InterpolantFactoryMethodLinear;
  46574. break;
  46575. case n.InterpolateSmooth:
  46576. t = this.InterpolantFactoryMethodSmooth
  46577. }
  46578. if (void 0 === t) {
  46579. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46580. if (void 0 === this.createInterpolant) {
  46581. if (e === this.DefaultInterpolation)
  46582. throw new Error(i);
  46583. this.setInterpolation(this.DefaultInterpolation)
  46584. }
  46585. return void console.warn(i)
  46586. }
  46587. this.createInterpolant = t
  46588. },
  46589. getInterpolation: function() {
  46590. switch (this.createInterpolant) {
  46591. case this.InterpolantFactoryMethodDiscrete:
  46592. return n.InterpolateDiscrete;
  46593. case this.InterpolantFactoryMethodLinear:
  46594. return n.InterpolateLinear;
  46595. case this.InterpolantFactoryMethodSmooth:
  46596. return n.InterpolateSmooth
  46597. }
  46598. },
  46599. getValueSize: function() {
  46600. return this.values.length / this.times.length
  46601. },
  46602. shift: function(e) {
  46603. if (0 !== e)
  46604. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46605. t[i] += e;
  46606. return this
  46607. },
  46608. scale: function(e) {
  46609. if (1 !== e)
  46610. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46611. t[i] *= e;
  46612. return this
  46613. },
  46614. trim: function(e, t) {
  46615. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46616. ++o;
  46617. for (; a !== -1 && i[a] > t; )
  46618. --a;
  46619. if (++a,
  46620. 0 !== o || a !== r) {
  46621. o >= a && (a = Math.max(a, 1),
  46622. o = a - 1);
  46623. var s = this.getValueSize();
  46624. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46625. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46626. }
  46627. return this
  46628. },
  46629. validate: function() {
  46630. var e = !0
  46631. , t = this.getValueSize();
  46632. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46633. e = !1);
  46634. var i = this.times
  46635. , r = this.values
  46636. , o = i.length;
  46637. 0 === o && (console.error("track is empty", this),
  46638. e = !1);
  46639. for (var a = null, s = 0; s !== o; s++) {
  46640. var l = i[s];
  46641. if ("number" == typeof l && isNaN(l)) {
  46642. console.error("time is not a valid number", this, s, l),
  46643. e = !1;
  46644. break
  46645. }
  46646. if (null !== a && a > l) {
  46647. console.error("out of order keys", this, s, l, a),
  46648. e = !1;
  46649. break
  46650. }
  46651. a = l
  46652. }
  46653. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46654. for (var s = 0, c = r.length; s !== c; ++s) {
  46655. var h = r[s];
  46656. if (isNaN(h)) {
  46657. console.error("value is not a valid number", this, s, h),
  46658. e = !1;
  46659. break
  46660. }
  46661. }
  46662. return e
  46663. },
  46664. optimize: function() {
  46665. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46666. var s = !1
  46667. , l = e[o]
  46668. , c = e[o + 1];
  46669. if (l !== c && (1 !== o || l !== l[0]))
  46670. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46671. var f = t[h + p];
  46672. if (f !== t[u + p] || f !== t[d + p]) {
  46673. s = !0;
  46674. break
  46675. }
  46676. }
  46677. if (s) {
  46678. if (o !== r) {
  46679. e[r] = e[o];
  46680. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46681. t[m + p] = t[g + p]
  46682. }
  46683. ++r
  46684. }
  46685. }
  46686. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46687. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46688. this
  46689. }
  46690. },
  46691. Object.assign(n.KeyframeTrack, {
  46692. parse: function(e) {
  46693. if (void 0 === e.type)
  46694. throw new Error("track type undefined, can not parse");
  46695. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46696. if (void 0 === e.times) {
  46697. console.warn("legacy JSON format detected, converting");
  46698. var i = []
  46699. , r = [];
  46700. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46701. e.times = i,
  46702. e.values = r
  46703. }
  46704. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46705. },
  46706. toJSON: function(e) {
  46707. var t, i = e.constructor;
  46708. if (void 0 !== i.toJSON)
  46709. t = i.toJSON(e);
  46710. else {
  46711. t = {
  46712. name: e.name,
  46713. times: n.AnimationUtils.convertArray(e.times, Array),
  46714. values: n.AnimationUtils.convertArray(e.values, Array)
  46715. };
  46716. var r = e.getInterpolation();
  46717. r !== e.DefaultInterpolation && (t.interpolation = r)
  46718. }
  46719. return t.type = e.ValueTypeName,
  46720. t
  46721. },
  46722. _getTrackTypeForValueTypeName: function(e) {
  46723. switch (e.toLowerCase()) {
  46724. case "scalar":
  46725. case "double":
  46726. case "float":
  46727. case "number":
  46728. case "integer":
  46729. return n.NumberKeyframeTrack;
  46730. case "vector":
  46731. case "vector2":
  46732. case "vector3":
  46733. case "vector4":
  46734. return n.VectorKeyframeTrack;
  46735. case "color":
  46736. return n.ColorKeyframeTrack;
  46737. case "quaternion":
  46738. return n.QuaternionKeyframeTrack;
  46739. case "bool":
  46740. case "boolean":
  46741. return n.BooleanKeyframeTrack;
  46742. case "string":
  46743. return n.StringKeyframeTrack
  46744. }
  46745. throw new Error("Unsupported typeName: " + e)
  46746. }
  46747. }),
  46748. n.PropertyBinding = function(e, t, i) {
  46749. this.path = t,
  46750. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46751. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46752. this.rootNode = e
  46753. }
  46754. ,
  46755. n.PropertyBinding.prototype = {
  46756. constructor: n.PropertyBinding,
  46757. getValue: function(e, t) {
  46758. this.bind(),
  46759. this.getValue(e, t)
  46760. },
  46761. setValue: function(e, t) {
  46762. this.bind(),
  46763. this.setValue(e, t)
  46764. },
  46765. bind: function() {
  46766. var e = this.node
  46767. , t = this.parsedPath
  46768. , i = t.objectName
  46769. , r = t.propertyName
  46770. , o = t.propertyIndex;
  46771. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46772. this.node = e),
  46773. this.getValue = this._getValue_unavailable,
  46774. this.setValue = this._setValue_unavailable,
  46775. !e)
  46776. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46777. if (i) {
  46778. var a = t.objectIndex;
  46779. switch (i) {
  46780. case "materials":
  46781. if (!e.material)
  46782. return void console.error(" can not bind to material as node does not have a material", this);
  46783. if (!e.material.materials)
  46784. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46785. e = e.material.materials;
  46786. break;
  46787. case "bones":
  46788. if (!e.skeleton)
  46789. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46790. e = e.skeleton.bones;
  46791. for (var s = 0; s < e.length; s++)
  46792. if (e[s].name === a) {
  46793. a = s;
  46794. break
  46795. }
  46796. break;
  46797. default:
  46798. if (void 0 === e[i])
  46799. return void console.error(" can not bind to objectName of node, undefined", this);
  46800. e = e[i]
  46801. }
  46802. if (void 0 !== a) {
  46803. if (void 0 === e[a])
  46804. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46805. e = e[a]
  46806. }
  46807. }
  46808. var l = e[r];
  46809. if (!l) {
  46810. var c = t.nodeName;
  46811. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46812. }
  46813. var h = this.Versioning.None;
  46814. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46815. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46816. this.targetObject = e);
  46817. var u = this.BindingType.Direct;
  46818. if (void 0 !== o) {
  46819. if ("morphTargetInfluences" === r) {
  46820. if (!e.geometry)
  46821. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46822. if (!e.geometry.morphTargets)
  46823. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46824. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46825. if (e.geometry.morphTargets[s].name === o) {
  46826. o = s;
  46827. break
  46828. }
  46829. }
  46830. u = this.BindingType.ArrayElement,
  46831. this.resolvedProperty = l,
  46832. this.propertyIndex = o
  46833. } else
  46834. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46835. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46836. this.resolvedProperty = l) : this.propertyName = r;
  46837. this.getValue = this.GetterByBindingType[u],
  46838. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46839. },
  46840. unbind: function() {
  46841. this.node = null,
  46842. this.getValue = this._getValue_unbound,
  46843. this.setValue = this._setValue_unbound
  46844. }
  46845. },
  46846. Object.assign(n.PropertyBinding.prototype, {
  46847. _getValue_unavailable: function() {},
  46848. _setValue_unavailable: function() {},
  46849. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46850. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46851. BindingType: {
  46852. Direct: 0,
  46853. EntireArray: 1,
  46854. ArrayElement: 2,
  46855. HasFromToArray: 3
  46856. },
  46857. Versioning: {
  46858. None: 0,
  46859. NeedsUpdate: 1,
  46860. MatrixWorldNeedsUpdate: 2
  46861. },
  46862. GetterByBindingType: [function(e, t) {
  46863. e[t] = this.node[this.propertyName]
  46864. }
  46865. , function(e, t) {
  46866. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46867. e[t++] = i[n]
  46868. }
  46869. , function(e, t) {
  46870. e[t] = this.resolvedProperty[this.propertyIndex]
  46871. }
  46872. , function(e, t) {
  46873. this.resolvedProperty.toArray(e, t)
  46874. }
  46875. ],
  46876. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46877. this.node[this.propertyName] = e[t]
  46878. }
  46879. , function(e, t) {
  46880. this.node[this.propertyName] = e[t],
  46881. this.targetObject.needsUpdate = !0
  46882. }
  46883. , function(e, t) {
  46884. this.node[this.propertyName] = e[t],
  46885. this.targetObject.matrixWorldNeedsUpdate = !0
  46886. }
  46887. ], [function(e, t) {
  46888. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46889. i[n] = e[t++]
  46890. }
  46891. , function(e, t) {
  46892. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46893. i[n] = e[t++];
  46894. this.targetObject.needsUpdate = !0
  46895. }
  46896. , function(e, t) {
  46897. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46898. i[n] = e[t++];
  46899. this.targetObject.matrixWorldNeedsUpdate = !0
  46900. }
  46901. ], [function(e, t) {
  46902. this.resolvedProperty[this.propertyIndex] = e[t]
  46903. }
  46904. , function(e, t) {
  46905. this.resolvedProperty[this.propertyIndex] = e[t],
  46906. this.targetObject.needsUpdate = !0
  46907. }
  46908. , function(e, t) {
  46909. this.resolvedProperty[this.propertyIndex] = e[t],
  46910. this.targetObject.matrixWorldNeedsUpdate = !0
  46911. }
  46912. ], [function(e, t) {
  46913. this.resolvedProperty.fromArray(e, t)
  46914. }
  46915. , function(e, t) {
  46916. this.resolvedProperty.fromArray(e, t),
  46917. this.targetObject.needsUpdate = !0
  46918. }
  46919. , function(e, t) {
  46920. this.resolvedProperty.fromArray(e, t),
  46921. this.targetObject.matrixWorldNeedsUpdate = !0
  46922. }
  46923. ]]
  46924. }),
  46925. n.PropertyBinding.Composite = function(e, t, i) {
  46926. var r = i || n.PropertyBinding.parseTrackName(t);
  46927. this._targetGroup = e,
  46928. this._bindings = e.subscribe_(t, r)
  46929. }
  46930. ,
  46931. n.PropertyBinding.Composite.prototype = {
  46932. constructor: n.PropertyBinding.Composite,
  46933. getValue: function(e, t) {
  46934. this.bind();
  46935. var i = this._targetGroup.nCachedObjects_
  46936. , n = this._bindings[i];
  46937. void 0 !== n && n.getValue(e, t)
  46938. },
  46939. setValue: function(e, t) {
  46940. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46941. i[n].setValue(e, t)
  46942. },
  46943. bind: function() {
  46944. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46945. e[t].bind()
  46946. },
  46947. unbind: function() {
  46948. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46949. e[t].unbind()
  46950. }
  46951. },
  46952. n.PropertyBinding.create = function(e, t, i) {
  46953. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46954. }
  46955. ,
  46956. n.PropertyBinding.parseTrackName = function(e) {
  46957. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46958. , i = t.exec(e);
  46959. if (!i)
  46960. throw new Error("cannot parse trackName at all: " + e);
  46961. i.index === t.lastIndex && t.lastIndex++;
  46962. var n = {
  46963. nodeName: i[3],
  46964. objectName: i[5],
  46965. objectIndex: i[7],
  46966. propertyName: i[9],
  46967. propertyIndex: i[11]
  46968. };
  46969. if (null === n.propertyName || 0 === n.propertyName.length)
  46970. throw new Error("can not parse propertyName from trackName: " + e);
  46971. return n
  46972. }
  46973. ,
  46974. n.PropertyBinding.findNode = function(e, t) {
  46975. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46976. return e;
  46977. if (e.skeleton) {
  46978. var i = function(e) {
  46979. for (var i = 0; i < e.bones.length; i++) {
  46980. var n = e.bones[i];
  46981. if (n.name === t)
  46982. return n
  46983. }
  46984. return null
  46985. }
  46986. , n = i(e.skeleton);
  46987. if (n)
  46988. return n
  46989. }
  46990. if (e.children) {
  46991. var r = function(e) {
  46992. for (var i = 0; i < e.length; i++) {
  46993. var n = e[i];
  46994. if (n.name === t || n.uuid === t)
  46995. return n;
  46996. var o = r(n.children);
  46997. if (o)
  46998. return o
  46999. }
  47000. return null
  47001. }
  47002. , o = r(e.children);
  47003. if (o)
  47004. return o
  47005. }
  47006. return null
  47007. }
  47008. ,
  47009. n.PropertyMixer = function(e, t, i) {
  47010. this.binding = e,
  47011. this.valueSize = i;
  47012. var n, r = Float64Array;
  47013. switch (t) {
  47014. case "quaternion":
  47015. n = this._slerp;
  47016. break;
  47017. case "string":
  47018. case "bool":
  47019. r = Array,
  47020. n = this._select;
  47021. break;
  47022. default:
  47023. n = this._lerp
  47024. }
  47025. this.buffer = new r(4 * i),
  47026. this._mixBufferRegion = n,
  47027. this.cumulativeWeight = 0,
  47028. this.useCount = 0,
  47029. this.referenceCount = 0
  47030. }
  47031. ,
  47032. n.PropertyMixer.prototype = {
  47033. constructor: n.PropertyMixer,
  47034. accumulate: function(e, t) {
  47035. var i = this.buffer
  47036. , n = this.valueSize
  47037. , r = e * n + n
  47038. , o = this.cumulativeWeight;
  47039. if (0 === o) {
  47040. for (var a = 0; a !== n; ++a)
  47041. i[r + a] = i[a];
  47042. o = t
  47043. } else {
  47044. o += t;
  47045. var s = t / o;
  47046. this._mixBufferRegion(i, r, 0, s, n)
  47047. }
  47048. this.cumulativeWeight = o
  47049. },
  47050. apply: function(e) {
  47051. var t = this.valueSize
  47052. , i = this.buffer
  47053. , n = e * t + t
  47054. , r = this.cumulativeWeight
  47055. , o = this.binding;
  47056. if (this.cumulativeWeight = 0,
  47057. r < 1) {
  47058. var a = 3 * t;
  47059. this._mixBufferRegion(i, n, a, 1 - r, t)
  47060. }
  47061. for (var s = t, l = t + t; s !== l; ++s)
  47062. if (i[s] !== i[s + t]) {
  47063. o.setValue(i, n);
  47064. break
  47065. }
  47066. },
  47067. saveOriginalState: function() {
  47068. var e = this.binding
  47069. , t = this.buffer
  47070. , i = this.valueSize
  47071. , n = 3 * i;
  47072. e.getValue(t, n);
  47073. for (var r = i, o = n; r !== o; ++r)
  47074. t[r] = t[n + r % i];
  47075. this.cumulativeWeight = 0
  47076. },
  47077. restoreOriginalState: function() {
  47078. var e = 3 * this.valueSize;
  47079. this.binding.setValue(this.buffer, e)
  47080. },
  47081. _select: function(e, t, i, n, r) {
  47082. if (n >= .5)
  47083. for (var o = 0; o !== r; ++o)
  47084. e[t + o] = e[i + o]
  47085. },
  47086. _slerp: function(e, t, i, r, o) {
  47087. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47088. },
  47089. _lerp: function(e, t, i, n, r) {
  47090. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47091. var s = t + a;
  47092. e[s] = e[s] * o + e[i + a] * n
  47093. }
  47094. }
  47095. },
  47096. n.BooleanKeyframeTrack = function(e, t, i) {
  47097. n.KeyframeTrack.call(this, e, t, i)
  47098. }
  47099. ,
  47100. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47101. constructor: n.BooleanKeyframeTrack,
  47102. ValueTypeName: "bool",
  47103. ValueBufferType: Array,
  47104. DefaultInterpolation: n.IntepolateDiscrete,
  47105. InterpolantFactoryMethodLinear: void 0,
  47106. InterpolantFactoryMethodSmooth: void 0
  47107. }),
  47108. n.NumberKeyframeTrack = function(e, t, i, r) {
  47109. n.KeyframeTrack.call(this, e, t, i, r)
  47110. }
  47111. ,
  47112. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47113. constructor: n.NumberKeyframeTrack,
  47114. ValueTypeName: "number"
  47115. }),
  47116. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47117. n.KeyframeTrack.call(this, e, t, i, r)
  47118. }
  47119. ,
  47120. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47121. constructor: n.QuaternionKeyframeTrack,
  47122. ValueTypeName: "quaternion",
  47123. DefaultInterpolation: n.InterpolateLinear,
  47124. InterpolantFactoryMethodLinear: function(e) {
  47125. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47126. },
  47127. InterpolantFactoryMethodSmooth: void 0
  47128. }),
  47129. n.StringKeyframeTrack = function(e, t, i, r) {
  47130. n.KeyframeTrack.call(this, e, t, i, r)
  47131. }
  47132. ,
  47133. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47134. constructor: n.StringKeyframeTrack,
  47135. ValueTypeName: "string",
  47136. ValueBufferType: Array,
  47137. DefaultInterpolation: n.IntepolateDiscrete,
  47138. InterpolantFactoryMethodLinear: void 0,
  47139. InterpolantFactoryMethodSmooth: void 0
  47140. }),
  47141. n.VectorKeyframeTrack = function(e, t, i, r) {
  47142. n.KeyframeTrack.call(this, e, t, i, r)
  47143. }
  47144. ,
  47145. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47146. constructor: n.VectorKeyframeTrack,
  47147. ValueTypeName: "vector"
  47148. }),
  47149. n.Audio = function(e) {
  47150. n.Object3D.call(this),
  47151. this.type = "Audio",
  47152. this.context = e.context,
  47153. this.source = this.context.createBufferSource(),
  47154. this.source.onended = this.onEnded.bind(this),
  47155. this.gain = this.context.createGain(),
  47156. this.gain.connect(e.getInput()),
  47157. this.autoplay = !1,
  47158. this.startTime = 0,
  47159. this.playbackRate = 1,
  47160. this.isPlaying = !1,
  47161. this.hasPlaybackControl = !0,
  47162. this.sourceType = "empty",
  47163. this.filter = null
  47164. }
  47165. ,
  47166. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47167. n.Audio.prototype.constructor = n.Audio,
  47168. n.Audio.prototype.getOutput = function() {
  47169. return this.gain
  47170. }
  47171. ,
  47172. n.Audio.prototype.load = function(e) {
  47173. var t = new n.AudioBuffer(this.context);
  47174. return t.load(e),
  47175. this.setBuffer(t),
  47176. this
  47177. }
  47178. ,
  47179. n.Audio.prototype.setNodeSource = function(e) {
  47180. return this.hasPlaybackControl = !1,
  47181. this.sourceType = "audioNode",
  47182. this.source = e,
  47183. this.connect(),
  47184. this
  47185. }
  47186. ,
  47187. n.Audio.prototype.setBuffer = function(e) {
  47188. var t = this;
  47189. return e.onReady(function(e) {
  47190. t.source.buffer = e,
  47191. t.sourceType = "buffer",
  47192. t.autoplay && t.play()
  47193. }),
  47194. this
  47195. }
  47196. ,
  47197. n.Audio.prototype.play = function() {
  47198. if (this.isPlaying === !0)
  47199. return void console.warn("THREE.Audio: Audio is already playing.");
  47200. if (this.hasPlaybackControl === !1)
  47201. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47202. var e = this.context.createBufferSource();
  47203. e.buffer = this.source.buffer,
  47204. e.loop = this.source.loop,
  47205. e.onended = this.source.onended,
  47206. e.start(0, this.startTime),
  47207. e.playbackRate.value = this.playbackRate,
  47208. this.isPlaying = !0,
  47209. this.source = e,
  47210. this.connect()
  47211. }
  47212. ,
  47213. n.Audio.prototype.pause = function() {
  47214. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47215. void (this.startTime = this.context.currentTime))
  47216. }
  47217. ,
  47218. n.Audio.prototype.stop = function() {
  47219. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47220. void (this.startTime = 0))
  47221. }
  47222. ,
  47223. n.Audio.prototype.connect = function() {
  47224. null !== this.filter ? (this.source.connect(this.filter),
  47225. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47226. }
  47227. ,
  47228. n.Audio.prototype.disconnect = function() {
  47229. null !== this.filter ? (this.source.disconnect(this.filter),
  47230. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47231. }
  47232. ,
  47233. n.Audio.prototype.getFilter = function() {
  47234. return this.filter
  47235. }
  47236. ,
  47237. n.Audio.prototype.setFilter = function(e) {
  47238. void 0 === e && (e = null),
  47239. this.isPlaying === !0 ? (this.disconnect(),
  47240. this.filter = e,
  47241. this.connect()) : this.filter = e
  47242. }
  47243. ,
  47244. n.Audio.prototype.setPlaybackRate = function(e) {
  47245. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47246. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47247. }
  47248. ,
  47249. n.Audio.prototype.getPlaybackRate = function() {
  47250. return this.playbackRate
  47251. }
  47252. ,
  47253. n.Audio.prototype.onEnded = function() {
  47254. this.isPlaying = !1
  47255. }
  47256. ,
  47257. n.Audio.prototype.setLoop = function(e) {
  47258. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47259. }
  47260. ,
  47261. n.Audio.prototype.getLoop = function() {
  47262. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47263. !1) : this.source.loop
  47264. }
  47265. ,
  47266. n.Audio.prototype.setVolume = function(e) {
  47267. this.gain.gain.value = e
  47268. }
  47269. ,
  47270. n.Audio.prototype.getVolume = function() {
  47271. return this.gain.gain.value
  47272. }
  47273. ,
  47274. n.AudioAnalyser = function(e, t) {
  47275. this.analyser = e.context.createAnalyser(),
  47276. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47277. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47278. e.getOutput().connect(this.analyser)
  47279. }
  47280. ,
  47281. n.AudioAnalyser.prototype = {
  47282. constructor: n.AudioAnalyser,
  47283. getData: function() {
  47284. return this.analyser.getByteFrequencyData(this.data),
  47285. this.data
  47286. }
  47287. },
  47288. n.AudioBuffer = function(e) {
  47289. this.context = e,
  47290. this.ready = !1,
  47291. this.readyCallbacks = []
  47292. }
  47293. ,
  47294. n.AudioBuffer.prototype.load = function(e) {
  47295. var t = this
  47296. , i = new XMLHttpRequest;
  47297. return i.open("GET", e, !0),
  47298. i.responseType = "arraybuffer",
  47299. i.onload = function(e) {
  47300. t.context.decodeAudioData(this.response, function(e) {
  47301. t.buffer = e,
  47302. t.ready = !0;
  47303. for (var i = 0; i < t.readyCallbacks.length; i++)
  47304. t.readyCallbacks[i](t.buffer);
  47305. t.readyCallbacks = []
  47306. })
  47307. }
  47308. ,
  47309. i.send(),
  47310. this
  47311. }
  47312. ,
  47313. n.AudioBuffer.prototype.onReady = function(e) {
  47314. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47315. }
  47316. ,
  47317. n.PositionalAudio = function(e) {
  47318. n.Audio.call(this, e),
  47319. this.panner = this.context.createPanner(),
  47320. this.panner.connect(this.gain)
  47321. }
  47322. ,
  47323. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47324. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47325. n.PositionalAudio.prototype.getOutput = function() {
  47326. return this.panner
  47327. }
  47328. ,
  47329. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47330. this.panner.refDistance = e
  47331. }
  47332. ,
  47333. n.PositionalAudio.prototype.getRefDistance = function() {
  47334. return this.panner.refDistance
  47335. }
  47336. ,
  47337. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47338. this.panner.rolloffFactor = e
  47339. }
  47340. ,
  47341. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47342. return this.panner.rolloffFactor
  47343. }
  47344. ,
  47345. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47346. this.panner.distanceModel = e
  47347. }
  47348. ,
  47349. n.PositionalAudio.prototype.getDistanceModel = function() {
  47350. return this.panner.distanceModel
  47351. }
  47352. ,
  47353. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47354. this.panner.maxDistance = e
  47355. }
  47356. ,
  47357. n.PositionalAudio.prototype.getMaxDistance = function() {
  47358. return this.panner.maxDistance
  47359. }
  47360. ,
  47361. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47362. var e = new n.Vector3;
  47363. return function(t) {
  47364. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47365. e.setFromMatrixPosition(this.matrixWorld),
  47366. this.panner.setPosition(e.x, e.y, e.z)
  47367. }
  47368. }(),
  47369. n.AudioListener = function() {
  47370. n.Object3D.call(this),
  47371. this.type = "AudioListener",
  47372. this.context = new (window.AudioContext || window.webkitAudioContext),
  47373. this.gain = this.context.createGain(),
  47374. this.gain.connect(this.context.destination),
  47375. this.filter = null
  47376. }
  47377. ,
  47378. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47379. n.AudioListener.prototype.constructor = n.AudioListener,
  47380. n.AudioListener.prototype.getInput = function() {
  47381. return this.gain
  47382. }
  47383. ,
  47384. n.AudioListener.prototype.removeFilter = function() {
  47385. null !== this.filter && (this.gain.disconnect(this.filter),
  47386. this.filter.disconnect(this.context.destination),
  47387. this.gain.connect(this.context.destination),
  47388. this.filter = null)
  47389. }
  47390. ,
  47391. n.AudioListener.prototype.setFilter = function(e) {
  47392. null !== this.filter ? (this.gain.disconnect(this.filter),
  47393. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47394. this.filter = e,
  47395. this.gain.connect(this.filter),
  47396. this.filter.connect(this.context.destination)
  47397. }
  47398. ,
  47399. n.AudioListener.prototype.getFilter = function() {
  47400. return this.filter
  47401. }
  47402. ,
  47403. n.AudioListener.prototype.setMasterVolume = function(e) {
  47404. this.gain.gain.value = e
  47405. }
  47406. ,
  47407. n.AudioListener.prototype.getMasterVolume = function() {
  47408. return this.gain.gain.value
  47409. }
  47410. ,
  47411. n.AudioListener.prototype.updateMatrixWorld = function() {
  47412. var e = new n.Vector3
  47413. , t = new n.Quaternion
  47414. , i = new n.Vector3
  47415. , r = new n.Vector3;
  47416. return function(o) {
  47417. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47418. var a = this.context.listener
  47419. , s = this.up;
  47420. this.matrixWorld.decompose(e, t, i),
  47421. r.set(0, 0, -1).applyQuaternion(t),
  47422. a.setPosition(e.x, e.y, e.z),
  47423. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47424. }
  47425. }(),
  47426. n.Camera = function() {
  47427. n.Object3D.call(this),
  47428. this.type = "Camera",
  47429. this.matrixWorldInverse = new n.Matrix4,
  47430. this.projectionMatrix = new n.Matrix4
  47431. }
  47432. ,
  47433. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47434. n.Camera.prototype.constructor = n.Camera,
  47435. n.Camera.prototype.getWorldDirection = function() {
  47436. var e = new n.Quaternion;
  47437. return function(t) {
  47438. var i = t || new n.Vector3;
  47439. return this.getWorldQuaternion(e),
  47440. i.set(0, 0, -1).applyQuaternion(e)
  47441. }
  47442. }(),
  47443. n.Camera.prototype.lookAt = function() {
  47444. var e = new n.Matrix4;
  47445. return function(t) {
  47446. e.lookAt(this.position, t, this.up),
  47447. this.quaternion.setFromRotationMatrix(e)
  47448. }
  47449. }(),
  47450. n.Camera.prototype.clone = function() {
  47451. return (new this.constructor).copy(this)
  47452. }
  47453. ,
  47454. n.Camera.prototype.copy = function(e) {
  47455. return n.Object3D.prototype.copy.call(this, e),
  47456. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47457. this.projectionMatrix.copy(e.projectionMatrix),
  47458. this
  47459. }
  47460. ,
  47461. n.CubeCamera = function(e, t, i) {
  47462. n.Object3D.call(this),
  47463. this.type = "CubeCamera";
  47464. var r = 90
  47465. , o = 1
  47466. , a = new n.PerspectiveCamera(r,o,e,t);
  47467. a.up.set(0, -1, 0),
  47468. a.lookAt(new n.Vector3(1,0,0)),
  47469. this.add(a);
  47470. var s = new n.PerspectiveCamera(r,o,e,t);
  47471. s.up.set(0, -1, 0),
  47472. s.lookAt(new n.Vector3(-1,0,0)),
  47473. this.add(s);
  47474. var l = new n.PerspectiveCamera(r,o,e,t);
  47475. l.up.set(0, 0, 1),
  47476. l.lookAt(new n.Vector3(0,1,0)),
  47477. this.add(l);
  47478. var c = new n.PerspectiveCamera(r,o,e,t);
  47479. c.up.set(0, 0, -1),
  47480. c.lookAt(new n.Vector3(0,-1,0)),
  47481. this.add(c);
  47482. var h = new n.PerspectiveCamera(r,o,e,t);
  47483. h.up.set(0, -1, 0),
  47484. h.lookAt(new n.Vector3(0,0,1)),
  47485. this.add(h);
  47486. var u = new n.PerspectiveCamera(r,o,e,t);
  47487. u.up.set(0, -1, 0),
  47488. u.lookAt(new n.Vector3(0,0,-1)),
  47489. this.add(u);
  47490. var d = {
  47491. format: n.RGBFormat,
  47492. magFilter: n.LinearFilter,
  47493. minFilter: n.LinearFilter
  47494. };
  47495. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47496. this.updateCubeMap = function(e, t) {
  47497. null === this.parent && this.updateMatrixWorld();
  47498. var i = this.renderTarget
  47499. , n = i.texture.generateMipmaps;
  47500. i.texture.generateMipmaps = !1,
  47501. i.activeCubeFace = 0,
  47502. e.render(t, a, i),
  47503. i.activeCubeFace = 1,
  47504. e.render(t, s, i),
  47505. i.activeCubeFace = 2,
  47506. e.render(t, l, i),
  47507. i.activeCubeFace = 3,
  47508. e.render(t, c, i),
  47509. i.activeCubeFace = 4,
  47510. e.render(t, h, i),
  47511. i.texture.generateMipmaps = n,
  47512. i.activeCubeFace = 5,
  47513. e.render(t, u, i),
  47514. e.setRenderTarget(null)
  47515. }
  47516. }
  47517. ,
  47518. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47519. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47520. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47521. n.Camera.call(this),
  47522. this.type = "OrthographicCamera",
  47523. this.zoom = 1,
  47524. this.left = e,
  47525. this.right = t,
  47526. this.top = i,
  47527. this.bottom = r,
  47528. this.near = void 0 !== o ? o : .1,
  47529. this.far = void 0 !== a ? a : 2e3,
  47530. this.updateProjectionMatrix()
  47531. }
  47532. ,
  47533. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47534. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47535. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47536. var e = (this.right - this.left) / (2 * this.zoom)
  47537. , t = (this.top - this.bottom) / (2 * this.zoom)
  47538. , i = (this.right + this.left) / 2
  47539. , n = (this.top + this.bottom) / 2;
  47540. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47541. }
  47542. ,
  47543. n.OrthographicCamera.prototype.copy = function(e) {
  47544. return n.Camera.prototype.copy.call(this, e),
  47545. this.left = e.left,
  47546. this.right = e.right,
  47547. this.top = e.top,
  47548. this.bottom = e.bottom,
  47549. this.near = e.near,
  47550. this.far = e.far,
  47551. this.zoom = e.zoom,
  47552. this
  47553. }
  47554. ,
  47555. n.OrthographicCamera.prototype.toJSON = function(e) {
  47556. var t = n.Object3D.prototype.toJSON.call(this, e);
  47557. return t.object.zoom = this.zoom,
  47558. t.object.left = this.left,
  47559. t.object.right = this.right,
  47560. t.object.top = this.top,
  47561. t.object.bottom = this.bottom,
  47562. t.object.near = this.near,
  47563. t.object.far = this.far,
  47564. t
  47565. }
  47566. ,
  47567. n.PerspectiveCamera = function(e, t, i, r) {
  47568. n.Camera.call(this),
  47569. this.type = "PerspectiveCamera",
  47570. this.focalLength = 10,
  47571. this.zoom = 1,
  47572. this.fov = void 0 !== e ? e : 50,
  47573. this.aspect = void 0 !== t ? t : 1,
  47574. this.near = void 0 !== i ? i : .1,
  47575. this.far = void 0 !== r ? r : 2e3,
  47576. this.updateProjectionMatrix()
  47577. }
  47578. ,
  47579. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47580. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47581. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47582. void 0 === t && (t = 24),
  47583. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47584. this.updateProjectionMatrix()
  47585. }
  47586. ,
  47587. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47588. this.fullWidth = e,
  47589. this.fullHeight = t,
  47590. this.x = i,
  47591. this.y = n,
  47592. this.width = r,
  47593. this.height = o,
  47594. this.updateProjectionMatrix()
  47595. }
  47596. ,
  47597. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47598. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47599. if (this.fullWidth) {
  47600. var t = this.fullWidth / this.fullHeight
  47601. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47602. , r = -i
  47603. , o = t * r
  47604. , a = t * i
  47605. , s = Math.abs(a - o)
  47606. , l = Math.abs(i - r);
  47607. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  47608. } else
  47609. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47610. }
  47611. ,
  47612. n.PerspectiveCamera.prototype.copy = function(e) {
  47613. return n.Camera.prototype.copy.call(this, e),
  47614. this.focalLength = e.focalLength,
  47615. this.zoom = e.zoom,
  47616. this.fov = e.fov,
  47617. this.aspect = e.aspect,
  47618. this.near = e.near,
  47619. this.far = e.far,
  47620. this
  47621. }
  47622. ,
  47623. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47624. var t = n.Object3D.prototype.toJSON.call(this, e);
  47625. return t.object.focalLength = this.focalLength,
  47626. t.object.zoom = this.zoom,
  47627. t.object.fov = this.fov,
  47628. t.object.aspect = this.aspect,
  47629. t.object.near = this.near,
  47630. t.object.far = this.far,
  47631. t
  47632. }
  47633. ,
  47634. n.StereoCamera = function() {
  47635. this.type = "StereoCamera",
  47636. this.aspect = 1,
  47637. this.cameraL = new n.PerspectiveCamera,
  47638. this.cameraL.layers.enable(1),
  47639. this.cameraL.matrixAutoUpdate = !1,
  47640. this.cameraR = new n.PerspectiveCamera,
  47641. this.cameraR.layers.enable(2),
  47642. this.cameraR.matrixAutoUpdate = !1
  47643. }
  47644. ,
  47645. n.StereoCamera.prototype = {
  47646. constructor: n.StereoCamera,
  47647. update: function() {
  47648. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47649. return function(l) {
  47650. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47651. if (c) {
  47652. e = l.focalLength,
  47653. t = l.fov,
  47654. i = l.aspect * this.aspect,
  47655. r = l.near,
  47656. o = l.far;
  47657. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47658. s.elements[12] = -p,
  47659. a.elements[12] = p,
  47660. h = -g * i + f,
  47661. u = g * i + f,
  47662. d.elements[0] = 2 * r / (u - h),
  47663. d.elements[8] = (u + h) / (u - h),
  47664. this.cameraL.projectionMatrix.copy(d),
  47665. h = -g * i - f,
  47666. u = g * i - f,
  47667. d.elements[0] = 2 * r / (u - h),
  47668. d.elements[8] = (u + h) / (u - h),
  47669. this.cameraR.projectionMatrix.copy(d)
  47670. }
  47671. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47672. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47673. }
  47674. }()
  47675. },
  47676. n.Light = function(e, t) {
  47677. n.Object3D.call(this),
  47678. this.type = "Light",
  47679. this.color = new n.Color(e),
  47680. this.intensity = void 0 !== t ? t : 1,
  47681. this.receiveShadow = void 0
  47682. }
  47683. ,
  47684. n.Light.prototype = Object.create(n.Object3D.prototype),
  47685. n.Light.prototype.constructor = n.Light,
  47686. n.Light.prototype.copy = function(e) {
  47687. return n.Object3D.prototype.copy.call(this, e),
  47688. this.color.copy(e.color),
  47689. this.intensity = e.intensity,
  47690. this
  47691. }
  47692. ,
  47693. n.Light.prototype.toJSON = function(e) {
  47694. var t = n.Object3D.prototype.toJSON.call(this, e);
  47695. return t.object.color = this.color.getHex(),
  47696. t.object.intensity = this.intensity,
  47697. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47698. void 0 !== this.distance && (t.object.distance = this.distance),
  47699. void 0 !== this.angle && (t.object.angle = this.angle),
  47700. void 0 !== this.decay && (t.object.decay = this.decay),
  47701. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47702. t
  47703. }
  47704. ,
  47705. n.LightShadow = function(e) {
  47706. this.camera = e,
  47707. this.bias = 0,
  47708. this.radius = 1,
  47709. this.mapSize = new n.Vector2(512,512),
  47710. this.map = null,
  47711. this.matrix = new n.Matrix4
  47712. }
  47713. ,
  47714. n.LightShadow.prototype = {
  47715. constructor: n.LightShadow,
  47716. copy: function(e) {
  47717. return this.camera = e.camera.clone(),
  47718. this.bias = e.bias,
  47719. this.radius = e.radius,
  47720. this.mapSize.copy(e.mapSize),
  47721. this
  47722. },
  47723. clone: function() {
  47724. return (new this.constructor).copy(this)
  47725. }
  47726. },
  47727. n.AmbientLight = function(e, t) {
  47728. n.Light.call(this, e, t),
  47729. this.type = "AmbientLight",
  47730. this.castShadow = void 0
  47731. }
  47732. ,
  47733. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47734. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47735. n.DirectionalLight = function(e, t) {
  47736. n.Light.call(this, e, t),
  47737. this.type = "DirectionalLight",
  47738. this.position.set(0, 1, 0),
  47739. this.updateMatrix(),
  47740. this.target = new n.Object3D,
  47741. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47742. }
  47743. ,
  47744. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47745. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47746. n.DirectionalLight.prototype.copy = function(e) {
  47747. return n.Light.prototype.copy.call(this, e),
  47748. this.target = e.target.clone(),
  47749. this.shadow = e.shadow.clone(),
  47750. this
  47751. }
  47752. ,
  47753. n.HemisphereLight = function(e, t, i) {
  47754. n.Light.call(this, e, i),
  47755. this.type = "HemisphereLight",
  47756. this.castShadow = void 0,
  47757. this.position.set(0, 1, 0),
  47758. this.updateMatrix(),
  47759. this.groundColor = new n.Color(t)
  47760. }
  47761. ,
  47762. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47763. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47764. n.HemisphereLight.prototype.copy = function(e) {
  47765. return n.Light.prototype.copy.call(this, e),
  47766. this.groundColor.copy(e.groundColor),
  47767. this
  47768. }
  47769. ,
  47770. n.PointLight = function(e, t, i, r) {
  47771. n.Light.call(this, e, t),
  47772. this.type = "PointLight",
  47773. this.distance = void 0 !== i ? i : 0,
  47774. this.decay = void 0 !== r ? r : 1,
  47775. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47776. }
  47777. ,
  47778. n.PointLight.prototype = Object.create(n.Light.prototype),
  47779. n.PointLight.prototype.constructor = n.PointLight,
  47780. Object.defineProperty(n.PointLight.prototype, "power", {
  47781. get: function() {
  47782. return 4 * this.intensity * Math.PI
  47783. },
  47784. set: function(e) {
  47785. this.intensity = e / (4 * Math.PI)
  47786. }
  47787. }),
  47788. n.PointLight.prototype.copy = function(e) {
  47789. return n.Light.prototype.copy.call(this, e),
  47790. this.distance = e.distance,
  47791. this.decay = e.decay,
  47792. this.shadow = e.shadow.clone(),
  47793. this
  47794. }
  47795. ,
  47796. n.SpotLight = function(e, t, i, r, o, a) {
  47797. n.Light.call(this, e, t),
  47798. this.type = "SpotLight",
  47799. this.position.set(0, 1, 0),
  47800. this.updateMatrix(),
  47801. this.target = new n.Object3D,
  47802. this.distance = void 0 !== i ? i : 0,
  47803. this.angle = void 0 !== r ? r : Math.PI / 3,
  47804. this.penumbra = void 0 !== o ? o : 0,
  47805. this.decay = void 0 !== a ? a : 1,
  47806. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47807. }
  47808. ,
  47809. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47810. n.SpotLight.prototype.constructor = n.SpotLight,
  47811. Object.defineProperty(n.SpotLight.prototype, "power", {
  47812. get: function() {
  47813. return this.intensity * Math.PI
  47814. },
  47815. set: function(e) {
  47816. this.intensity = e / Math.PI
  47817. }
  47818. }),
  47819. n.SpotLight.prototype.copy = function(e) {
  47820. return n.Light.prototype.copy.call(this, e),
  47821. this.distance = e.distance,
  47822. this.angle = e.angle,
  47823. this.penumbra = e.penumbra,
  47824. this.decay = e.decay,
  47825. this.target = e.target.clone(),
  47826. this.shadow = e.shadow.clone(),
  47827. this
  47828. }
  47829. ,
  47830. n.Cache = {
  47831. enabled: !1,
  47832. files: {},
  47833. add: function(e, t) {
  47834. this.enabled !== !1 && (this.files[e] = t)
  47835. },
  47836. get: function(e) {
  47837. if (this.enabled !== !1)
  47838. return this.files[e]
  47839. },
  47840. remove: function(e) {
  47841. delete this.files[e]
  47842. },
  47843. clear: function() {
  47844. this.files = {}
  47845. }
  47846. },
  47847. n.Loader = function() {
  47848. this.onLoadStart = function() {}
  47849. ,
  47850. this.onLoadProgress = function() {}
  47851. ,
  47852. this.onLoadComplete = function() {}
  47853. }
  47854. ,
  47855. n.Loader.prototype = {
  47856. constructor: n.Loader,
  47857. crossOrigin: void 0,
  47858. extractUrlBase: function(e) {
  47859. var t = e.split("/");
  47860. return 1 === t.length ? "./" : (t.pop(),
  47861. t.join("/") + "/")
  47862. },
  47863. initMaterials: function(e, t, i) {
  47864. for (var n = [], r = 0; r < e.length; ++r)
  47865. n[r] = this.createMaterial(e[r], t, i);
  47866. return n
  47867. },
  47868. createMaterial: function() {
  47869. var e, t, i;
  47870. return function(r, o, a) {
  47871. function s(e, i, r, s, c) {
  47872. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47873. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47874. h = t.load(u)),
  47875. void 0 !== i && (h.repeat.fromArray(i),
  47876. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47877. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47878. void 0 !== r && h.offset.fromArray(r),
  47879. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47880. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47881. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47882. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47883. void 0 !== c && (h.anisotropy = c);
  47884. var p = n.Math.generateUUID();
  47885. return l[p] = h,
  47886. p
  47887. }
  47888. void 0 === e && (e = new n.Color),
  47889. void 0 === t && (t = new n.TextureLoader),
  47890. void 0 === i && (i = new n.MaterialLoader);
  47891. var l = {}
  47892. , c = {
  47893. uuid: n.Math.generateUUID(),
  47894. type: "MeshLambertMaterial"
  47895. };
  47896. for (var h in r) {
  47897. var u = r[h];
  47898. switch (h) {
  47899. case "DbgColor":
  47900. case "DbgIndex":
  47901. case "opticalDensity":
  47902. case "illumination":
  47903. break;
  47904. case "DbgName":
  47905. c.name = u;
  47906. break;
  47907. case "blending":
  47908. c.blending = n[u];
  47909. break;
  47910. case "colorAmbient":
  47911. case "mapAmbient":
  47912. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47913. break;
  47914. case "colorDiffuse":
  47915. c.color = e.fromArray(u).getHex();
  47916. break;
  47917. case "colorSpecular":
  47918. c.specular = e.fromArray(u).getHex();
  47919. break;
  47920. case "colorEmissive":
  47921. c.emissive = e.fromArray(u).getHex();
  47922. break;
  47923. case "specularCoef":
  47924. c.shininess = u;
  47925. break;
  47926. case "shading":
  47927. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47928. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47929. break;
  47930. case "mapDiffuse":
  47931. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47932. break;
  47933. case "mapDiffuseRepeat":
  47934. case "mapDiffuseOffset":
  47935. case "mapDiffuseWrap":
  47936. case "mapDiffuseAnisotropy":
  47937. break;
  47938. case "mapLight":
  47939. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47940. break;
  47941. case "mapLightRepeat":
  47942. case "mapLightOffset":
  47943. case "mapLightWrap":
  47944. case "mapLightAnisotropy":
  47945. break;
  47946. case "mapAO":
  47947. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47948. break;
  47949. case "mapAORepeat":
  47950. case "mapAOOffset":
  47951. case "mapAOWrap":
  47952. case "mapAOAnisotropy":
  47953. break;
  47954. case "mapBump":
  47955. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47956. break;
  47957. case "mapBumpScale":
  47958. c.bumpScale = u;
  47959. break;
  47960. case "mapBumpRepeat":
  47961. case "mapBumpOffset":
  47962. case "mapBumpWrap":
  47963. case "mapBumpAnisotropy":
  47964. break;
  47965. case "mapNormal":
  47966. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47967. break;
  47968. case "mapNormalFactor":
  47969. c.normalScale = [u, u];
  47970. break;
  47971. case "mapNormalRepeat":
  47972. case "mapNormalOffset":
  47973. case "mapNormalWrap":
  47974. case "mapNormalAnisotropy":
  47975. break;
  47976. case "mapSpecular":
  47977. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47978. break;
  47979. case "mapSpecularRepeat":
  47980. case "mapSpecularOffset":
  47981. case "mapSpecularWrap":
  47982. case "mapSpecularAnisotropy":
  47983. break;
  47984. case "mapAlpha":
  47985. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47986. break;
  47987. case "mapAlphaRepeat":
  47988. case "mapAlphaOffset":
  47989. case "mapAlphaWrap":
  47990. case "mapAlphaAnisotropy":
  47991. break;
  47992. case "flipSided":
  47993. c.side = n.BackSide;
  47994. break;
  47995. case "doubleSided":
  47996. c.side = n.DoubleSide;
  47997. break;
  47998. case "transparency":
  47999. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48000. c.opacity = u;
  48001. break;
  48002. case "depthTest":
  48003. case "depthWrite":
  48004. case "colorWrite":
  48005. case "opacity":
  48006. case "reflectivity":
  48007. case "transparent":
  48008. case "visible":
  48009. case "wireframe":
  48010. c[h] = u;
  48011. break;
  48012. case "vertexColors":
  48013. u === !0 && (c.vertexColors = n.VertexColors),
  48014. "face" === u && (c.vertexColors = n.FaceColors);
  48015. break;
  48016. default:
  48017. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48018. }
  48019. }
  48020. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48021. "MeshPhongMaterial" !== c.type && delete c.specular,
  48022. c.opacity < 1 && (c.transparent = !0),
  48023. i.setTextures(l),
  48024. i.parse(c)
  48025. }
  48026. }()
  48027. },
  48028. n.Loader.Handlers = {
  48029. handlers: [],
  48030. add: function(e, t) {
  48031. this.handlers.push(e, t)
  48032. },
  48033. get: function(e) {
  48034. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48035. var r = t[i]
  48036. , o = t[i + 1];
  48037. if (r.test(e))
  48038. return o
  48039. }
  48040. return null
  48041. }
  48042. },
  48043. n.XHRLoader = function(e) {
  48044. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48045. }
  48046. ,
  48047. n.XHRLoader.prototype = {
  48048. constructor: n.XHRLoader,
  48049. load: function(e, t, i, r) {
  48050. void 0 !== this.path && (e = this.path + e);
  48051. var o = this
  48052. , a = n.Cache.get(e);
  48053. if (void 0 !== a)
  48054. return t && setTimeout(function() {
  48055. t(a)
  48056. }, 0),
  48057. a;
  48058. var s = new XMLHttpRequest;
  48059. return s.overrideMimeType("text/plain"),
  48060. s.open("GET", e, !0),
  48061. s.addEventListener("load", function(i) {
  48062. var a = i.target.response;
  48063. n.Cache.add(e, a),
  48064. 200 === this.status ? (t && t(a),
  48065. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48066. t && t(a),
  48067. o.manager.itemEnd(e)) : (r && r(i),
  48068. o.manager.itemError(e))
  48069. }, !1),
  48070. void 0 !== i && s.addEventListener("progress", function(e) {
  48071. i(e)
  48072. }, !1),
  48073. s.addEventListener("error", function(t) {
  48074. r && r(t),
  48075. o.manager.itemError(e)
  48076. }, !1),
  48077. void 0 !== this.responseType && (s.responseType = this.responseType),
  48078. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48079. s.send(null),
  48080. o.manager.itemStart(e),
  48081. s
  48082. },
  48083. setPath: function(e) {
  48084. this.path = e
  48085. },
  48086. setResponseType: function(e) {
  48087. this.responseType = e
  48088. },
  48089. setWithCredentials: function(e) {
  48090. this.withCredentials = e
  48091. }
  48092. },
  48093. n.FontLoader = function(e) {
  48094. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48095. }
  48096. ,
  48097. n.FontLoader.prototype = {
  48098. constructor: n.FontLoader,
  48099. load: function(e, t, i, r) {
  48100. var o = new n.XHRLoader(this.manager);
  48101. o.load(e, function(e) {
  48102. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48103. }, i, r)
  48104. }
  48105. },
  48106. n.ImageLoader = function(e) {
  48107. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48108. }
  48109. ,
  48110. n.ImageLoader.prototype = {
  48111. constructor: n.ImageLoader,
  48112. load: function(e, t, i, r) {
  48113. void 0 !== this.path && (e = this.path + e);
  48114. var o = this
  48115. , a = n.Cache.get(e);
  48116. if (void 0 !== a)
  48117. return o.manager.itemStart(e),
  48118. t ? setTimeout(function() {
  48119. t(a),
  48120. o.manager.itemEnd(e)
  48121. }, 0) : o.manager.itemEnd(e),
  48122. a;
  48123. var s = document.createElement("img");
  48124. return s.addEventListener("load", function(i) {
  48125. n.Cache.add(e, this),
  48126. t && t(this),
  48127. o.manager.itemEnd(e)
  48128. }, !1),
  48129. void 0 !== i && s.addEventListener("progress", function(e) {
  48130. i(e)
  48131. }, !1),
  48132. s.addEventListener("error", function(t) {
  48133. r && r(t),
  48134. o.manager.itemError(e)
  48135. }, !1),
  48136. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48137. o.manager.itemStart(e),
  48138. s.src = e,
  48139. s
  48140. },
  48141. setCrossOrigin: function(e) {
  48142. this.crossOrigin = e
  48143. },
  48144. setPath: function(e) {
  48145. this.path = e
  48146. }
  48147. },
  48148. n.JSONLoader = function(e) {
  48149. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48150. e = void 0),
  48151. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48152. this.withCredentials = !1
  48153. }
  48154. ,
  48155. n.JSONLoader.prototype = {
  48156. constructor: n.JSONLoader,
  48157. get statusDomElement() {
  48158. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48159. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48160. this._statusDomElement
  48161. },
  48162. load: function(e, t, i, r) {
  48163. var o = this
  48164. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48165. , s = new n.XHRLoader(this.manager);
  48166. s.setWithCredentials(this.withCredentials),
  48167. s.load(e, function(i) {
  48168. var n = JSON.parse(i)
  48169. , r = n.metadata;
  48170. if (void 0 !== r) {
  48171. var s = r.type;
  48172. if (void 0 !== s) {
  48173. if ("object" === s.toLowerCase())
  48174. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48175. if ("scene" === s.toLowerCase())
  48176. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48177. }
  48178. }
  48179. var l = o.parse(n, a);
  48180. t(l.geometry, l.materials)
  48181. }, i, r)
  48182. },
  48183. setTexturePath: function(e) {
  48184. this.texturePath = e
  48185. },
  48186. parse: function(e, t) {
  48187. function i(t) {
  48188. function i(e, t) {
  48189. return e & 1 << t
  48190. }
  48191. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  48192. if (void 0 !== e.uvs) {
  48193. for (r = 0; r < e.uvs.length; r++)
  48194. e.uvs[r].length && B++;
  48195. for (r = 0; r < B; r++)
  48196. s.faceVertexUvs[r] = []
  48197. }
  48198. for (l = 0,
  48199. c = L.length; l < c; )
  48200. E = new n.Vector3,
  48201. E.x = L[l++] * t,
  48202. E.y = L[l++] * t,
  48203. E.z = L[l++] * t,
  48204. s.vertices.push(E);
  48205. for (l = 0,
  48206. c = O.length; l < c; )
  48207. if (f = O[l++],
  48208. g = i(f, 0),
  48209. m = i(f, 1),
  48210. v = i(f, 3),
  48211. A = i(f, 4),
  48212. y = i(f, 5),
  48213. C = i(f, 6),
  48214. I = i(f, 7),
  48215. g) {
  48216. if (w = new n.Face3,
  48217. w.a = O[l],
  48218. w.b = O[l + 1],
  48219. w.c = O[l + 3],
  48220. _ = new n.Face3,
  48221. _.a = O[l + 1],
  48222. _.b = O[l + 2],
  48223. _.c = O[l + 3],
  48224. l += 4,
  48225. m && (p = O[l++],
  48226. w.materialIndex = p,
  48227. _.materialIndex = p),
  48228. a = s.faces.length,
  48229. v)
  48230. for (r = 0; r < B; r++)
  48231. for (S = e.uvs[r],
  48232. s.faceVertexUvs[r][a] = [],
  48233. s.faceVertexUvs[r][a + 1] = [],
  48234. o = 0; o < 4; o++)
  48235. d = O[l++],
  48236. R = S[2 * d],
  48237. P = S[2 * d + 1],
  48238. M = new n.Vector2(R,P),
  48239. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48240. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48241. if (A && (u = 3 * O[l++],
  48242. w.normal.set(D[u++], D[u++], D[u]),
  48243. _.normal.copy(w.normal)),
  48244. y)
  48245. for (r = 0; r < 4; r++)
  48246. u = 3 * O[l++],
  48247. x = new n.Vector3(D[u++],D[u++],D[u]),
  48248. 2 !== r && w.vertexNormals.push(x),
  48249. 0 !== r && _.vertexNormals.push(x);
  48250. if (C && (h = O[l++],
  48251. T = N[h],
  48252. w.color.setHex(T),
  48253. _.color.setHex(T)),
  48254. I)
  48255. for (r = 0; r < 4; r++)
  48256. h = O[l++],
  48257. T = N[h],
  48258. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48259. 0 !== r && _.vertexColors.push(new n.Color(T));
  48260. s.faces.push(w),
  48261. s.faces.push(_)
  48262. } else {
  48263. if (b = new n.Face3,
  48264. b.a = O[l++],
  48265. b.b = O[l++],
  48266. b.c = O[l++],
  48267. m && (p = O[l++],
  48268. b.materialIndex = p),
  48269. a = s.faces.length,
  48270. v)
  48271. for (r = 0; r < B; r++)
  48272. for (S = e.uvs[r],
  48273. s.faceVertexUvs[r][a] = [],
  48274. o = 0; o < 3; o++)
  48275. d = O[l++],
  48276. R = S[2 * d],
  48277. P = S[2 * d + 1],
  48278. M = new n.Vector2(R,P),
  48279. s.faceVertexUvs[r][a].push(M);
  48280. if (A && (u = 3 * O[l++],
  48281. b.normal.set(D[u++], D[u++], D[u])),
  48282. y)
  48283. for (r = 0; r < 3; r++)
  48284. u = 3 * O[l++],
  48285. x = new n.Vector3(D[u++],D[u++],D[u]),
  48286. b.vertexNormals.push(x);
  48287. if (C && (h = O[l++],
  48288. b.color.setHex(N[h])),
  48289. I)
  48290. for (r = 0; r < 3; r++)
  48291. h = O[l++],
  48292. b.vertexColors.push(new n.Color(N[h]));
  48293. s.faces.push(b)
  48294. }
  48295. }
  48296. function r() {
  48297. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48298. if (e.skinWeights)
  48299. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48300. var o = e.skinWeights[i]
  48301. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48302. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48303. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48304. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48305. }
  48306. if (e.skinIndices)
  48307. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48308. var h = e.skinIndices[i]
  48309. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48310. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48311. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48312. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48313. }
  48314. s.bones = e.bones,
  48315. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  48316. }
  48317. function o(t) {
  48318. if (void 0 !== e.morphTargets)
  48319. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48320. s.morphTargets[i] = {},
  48321. s.morphTargets[i].name = e.morphTargets[i].name,
  48322. s.morphTargets[i].vertices = [];
  48323. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48324. var h = new n.Vector3;
  48325. h.x = a[l] * t,
  48326. h.y = a[l + 1] * t,
  48327. h.z = a[l + 2] * t,
  48328. o.push(h)
  48329. }
  48330. }
  48331. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48332. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48333. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48334. u[i].color.fromArray(d, 3 * i)
  48335. }
  48336. }
  48337. function a() {
  48338. var t = []
  48339. , i = [];
  48340. void 0 !== e.animation && i.push(e.animation),
  48341. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48342. for (var r = 0; r < i.length; r++) {
  48343. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48344. o && t.push(o)
  48345. }
  48346. if (s.morphTargets) {
  48347. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48348. t = t.concat(a)
  48349. }
  48350. t.length > 0 && (s.animations = t)
  48351. }
  48352. var s = new n.Geometry
  48353. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48354. if (i(l),
  48355. r(),
  48356. o(l),
  48357. a(),
  48358. s.computeFaceNormals(),
  48359. s.computeBoundingSphere(),
  48360. void 0 === e.materials || 0 === e.materials.length)
  48361. return {
  48362. geometry: s
  48363. };
  48364. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48365. return {
  48366. geometry: s,
  48367. materials: c
  48368. }
  48369. }
  48370. },
  48371. n.LoadingManager = function(e, t, i) {
  48372. var n = this
  48373. , r = !1
  48374. , o = 0
  48375. , a = 0;
  48376. this.onStart = void 0,
  48377. this.onLoad = e,
  48378. this.onProgress = t,
  48379. this.onError = i,
  48380. this.itemStart = function(e) {
  48381. a++,
  48382. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48383. r = !0
  48384. }
  48385. ,
  48386. this.itemEnd = function(e) {
  48387. o++,
  48388. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48389. o === a && (r = !1,
  48390. void 0 !== n.onLoad && n.onLoad())
  48391. }
  48392. ,
  48393. this.itemError = function(e) {
  48394. void 0 !== n.onError && n.onError(e)
  48395. }
  48396. }
  48397. ,
  48398. n.DefaultLoadingManager = new n.LoadingManager,
  48399. n.BufferGeometryLoader = function(e) {
  48400. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48401. }
  48402. ,
  48403. n.BufferGeometryLoader.prototype = {
  48404. constructor: n.BufferGeometryLoader,
  48405. load: function(e, t, i, r) {
  48406. var o = this
  48407. , a = new n.XHRLoader(o.manager);
  48408. a.load(e, function(e) {
  48409. t(o.parse(JSON.parse(e)))
  48410. }, i, r)
  48411. },
  48412. parse: function(e) {
  48413. var t = new n.BufferGeometry
  48414. , i = e.data.index
  48415. , r = {
  48416. Int8Array: Int8Array,
  48417. Uint8Array: Uint8Array,
  48418. Uint8ClampedArray: Uint8ClampedArray,
  48419. Int16Array: Int16Array,
  48420. Uint16Array: Uint16Array,
  48421. Int32Array: Int32Array,
  48422. Uint32Array: Uint32Array,
  48423. Float32Array: Float32Array,
  48424. Float64Array: Float64Array
  48425. };
  48426. if (void 0 !== i) {
  48427. var o = new r[i.type](i.array);
  48428. t.setIndex(new n.BufferAttribute(o,1))
  48429. }
  48430. var a = e.data.attributes;
  48431. for (var s in a) {
  48432. var l = a[s]
  48433. , o = new r[l.type](l.array);
  48434. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48435. }
  48436. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48437. if (void 0 !== c)
  48438. for (var h = 0, u = c.length; h !== u; ++h) {
  48439. var d = c[h];
  48440. t.addGroup(d.start, d.count, d.materialIndex)
  48441. }
  48442. var p = e.data.boundingSphere;
  48443. if (void 0 !== p) {
  48444. var f = new n.Vector3;
  48445. void 0 !== p.center && f.fromArray(p.center),
  48446. t.boundingSphere = new n.Sphere(f,p.radius)
  48447. }
  48448. return t
  48449. }
  48450. },
  48451. n.MaterialLoader = function(e) {
  48452. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48453. this.textures = {}
  48454. }
  48455. ,
  48456. n.MaterialLoader.prototype = {
  48457. constructor: n.MaterialLoader,
  48458. load: function(e, t, i, r) {
  48459. var o = this
  48460. , a = new n.XHRLoader(o.manager);
  48461. a.load(e, function(e) {
  48462. t(o.parse(JSON.parse(e)))
  48463. }, i, r)
  48464. },
  48465. setTextures: function(e) {
  48466. this.textures = e
  48467. },
  48468. getTexture: function(e) {
  48469. var t = this.textures;
  48470. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48471. t[e]
  48472. },
  48473. parse: function(e) {
  48474. var t = new n[e.type];
  48475. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48476. void 0 !== e.name && (t.name = e.name),
  48477. void 0 !== e.color && t.color.setHex(e.color),
  48478. void 0 !== e.roughness && (t.roughness = e.roughness),
  48479. void 0 !== e.metalness && (t.metalness = e.metalness),
  48480. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48481. void 0 !== e.specular && t.specular.setHex(e.specular),
  48482. void 0 !== e.shininess && (t.shininess = e.shininess),
  48483. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48484. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48485. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48486. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48487. void 0 !== e.shading && (t.shading = e.shading),
  48488. void 0 !== e.blending && (t.blending = e.blending),
  48489. void 0 !== e.side && (t.side = e.side),
  48490. void 0 !== e.opacity && (t.opacity = e.opacity),
  48491. void 0 !== e.transparent && (t.transparent = e.transparent),
  48492. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48493. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48494. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48495. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48496. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48497. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48498. void 0 !== e.size && (t.size = e.size),
  48499. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48500. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48501. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48502. t.transparent = !0),
  48503. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48504. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48505. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48506. void 0 !== e.normalScale) {
  48507. var i = e.normalScale;
  48508. Array.isArray(i) === !1 && (i = [i, i]),
  48509. t.normalScale = (new n.Vector2).fromArray(i)
  48510. }
  48511. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48512. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48513. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48514. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48515. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48516. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48517. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48518. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48519. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48520. t.combine = n.MultiplyOperation),
  48521. e.reflectivity && (t.reflectivity = e.reflectivity),
  48522. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48523. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48524. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48525. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48526. void 0 !== e.materials)
  48527. for (var r = 0, o = e.materials.length; r < o; r++)
  48528. t.materials.push(this.parse(e.materials[r]));
  48529. return t
  48530. }
  48531. },
  48532. n.ObjectLoader = function(e) {
  48533. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48534. this.texturePath = ""
  48535. }
  48536. ,
  48537. n.ObjectLoader.prototype = {
  48538. constructor: n.ObjectLoader,
  48539. load: function(e, t, i, r) {
  48540. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48541. var o = this
  48542. , a = new n.XHRLoader(o.manager);
  48543. a.load(e, function(e) {
  48544. o.parse(JSON.parse(e), t)
  48545. }, i, r)
  48546. },
  48547. setTexturePath: function(e) {
  48548. this.texturePath = e
  48549. },
  48550. setCrossOrigin: function(e) {
  48551. this.crossOrigin = e
  48552. },
  48553. parse: function(e, t) {
  48554. var i = this.parseGeometries(e.geometries)
  48555. , n = this.parseImages(e.images, function() {
  48556. void 0 !== t && t(a)
  48557. })
  48558. , r = this.parseTextures(e.textures, n)
  48559. , o = this.parseMaterials(e.materials, r)
  48560. , a = this.parseObject(e.object, i, o);
  48561. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48562. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48563. a
  48564. },
  48565. parseGeometries: function(e) {
  48566. var t = {};
  48567. if (void 0 !== e)
  48568. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48569. var s, l = e[o];
  48570. switch (l.type) {
  48571. case "PlaneGeometry":
  48572. case "PlaneBufferGeometry":
  48573. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48574. break;
  48575. case "BoxGeometry":
  48576. case "BoxBufferGeometry":
  48577. case "CubeGeometry":
  48578. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48579. break;
  48580. case "CircleGeometry":
  48581. case "CircleBufferGeometry":
  48582. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48583. break;
  48584. case "CylinderGeometry":
  48585. case "CylinderBufferGeometry":
  48586. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48587. break;
  48588. case "SphereGeometry":
  48589. case "SphereBufferGeometry":
  48590. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48591. break;
  48592. case "DodecahedronGeometry":
  48593. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48594. break;
  48595. case "IcosahedronGeometry":
  48596. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48597. break;
  48598. case "OctahedronGeometry":
  48599. s = new n.OctahedronGeometry(l.radius,l.detail);
  48600. break;
  48601. case "TetrahedronGeometry":
  48602. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48603. break;
  48604. case "RingGeometry":
  48605. case "RingBufferGeometry":
  48606. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48607. break;
  48608. case "TorusGeometry":
  48609. case "TorusBufferGeometry":
  48610. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48611. break;
  48612. case "TorusKnotGeometry":
  48613. case "TorusKnotBufferGeometry":
  48614. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48615. break;
  48616. case "LatheGeometry":
  48617. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48618. break;
  48619. case "BufferGeometry":
  48620. s = r.parse(l);
  48621. break;
  48622. case "Geometry":
  48623. s = i.parse(l.data, this.texturePath).geometry;
  48624. break;
  48625. default:
  48626. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48627. continue
  48628. }
  48629. s.uuid = l.uuid,
  48630. void 0 !== l.name && (s.name = l.name),
  48631. t[l.uuid] = s
  48632. }
  48633. return t
  48634. },
  48635. parseMaterials: function(e, t) {
  48636. var i = {};
  48637. if (void 0 !== e) {
  48638. var r = new n.MaterialLoader;
  48639. r.setTextures(t);
  48640. for (var o = 0, a = e.length; o < a; o++) {
  48641. var s = r.parse(e[o]);
  48642. i[s.uuid] = s
  48643. }
  48644. }
  48645. return i
  48646. },
  48647. parseAnimations: function(e) {
  48648. for (var t = [], i = 0; i < e.length; i++) {
  48649. var r = n.AnimationClip.parse(e[i]);
  48650. t.push(r)
  48651. }
  48652. return t
  48653. },
  48654. parseImages: function(e, t) {
  48655. function i(e) {
  48656. return r.manager.itemStart(e),
  48657. s.load(e, function() {
  48658. r.manager.itemEnd(e)
  48659. })
  48660. }
  48661. var r = this
  48662. , o = {};
  48663. if (void 0 !== e && e.length > 0) {
  48664. var a = new n.LoadingManager(t)
  48665. , s = new n.ImageLoader(a);
  48666. s.setCrossOrigin(this.crossOrigin);
  48667. for (var l = 0, c = e.length; l < c; l++) {
  48668. var h = e[l]
  48669. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48670. o[h.uuid] = i(u)
  48671. }
  48672. }
  48673. return o
  48674. },
  48675. parseTextures: function(e, t) {
  48676. function i(e) {
  48677. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48678. n[e])
  48679. }
  48680. var r = {};
  48681. if (void 0 !== e)
  48682. for (var o = 0, a = e.length; o < a; o++) {
  48683. var s = e[o];
  48684. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48685. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48686. var l = new n.Texture(t[s.image]);
  48687. l.needsUpdate = !0,
  48688. l.uuid = s.uuid,
  48689. void 0 !== s.name && (l.name = s.name),
  48690. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48691. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48692. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48693. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48694. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48695. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48696. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48697. l.wrapT = i(s.wrap[1])),
  48698. r[s.uuid] = l
  48699. }
  48700. return r
  48701. },
  48702. parseObject: function() {
  48703. var e = new n.Matrix4;
  48704. return function(t, i, r) {
  48705. function o(e) {
  48706. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48707. i[e]
  48708. }
  48709. function a(e) {
  48710. if (void 0 !== e)
  48711. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48712. r[e]
  48713. }
  48714. var s;
  48715. switch (t.type) {
  48716. case "Scene":
  48717. s = new n.Scene;
  48718. break;
  48719. case "PerspectiveCamera":
  48720. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48721. break;
  48722. case "OrthographicCamera":
  48723. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48724. break;
  48725. case "AmbientLight":
  48726. s = new n.AmbientLight(t.color,t.intensity);
  48727. break;
  48728. case "DirectionalLight":
  48729. s = new n.DirectionalLight(t.color,t.intensity);
  48730. break;
  48731. case "PointLight":
  48732. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48733. break;
  48734. case "SpotLight":
  48735. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48736. break;
  48737. case "HemisphereLight":
  48738. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48739. break;
  48740. case "Mesh":
  48741. var l = o(t.geometry)
  48742. , c = a(t.material);
  48743. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48744. break;
  48745. case "LOD":
  48746. s = new n.LOD;
  48747. break;
  48748. case "Line":
  48749. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48750. break;
  48751. case "PointCloud":
  48752. case "Points":
  48753. s = new n.Points(o(t.geometry),a(t.material));
  48754. break;
  48755. case "Sprite":
  48756. s = new n.Sprite(a(t.material));
  48757. break;
  48758. case "Group":
  48759. s = new n.Group;
  48760. break;
  48761. default:
  48762. s = new n.Object3D
  48763. }
  48764. if (s.uuid = t.uuid,
  48765. void 0 !== t.name && (s.name = t.name),
  48766. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48767. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48768. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48769. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48770. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48771. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48772. void 0 !== t.visible && (s.visible = t.visible),
  48773. void 0 !== t.userData && (s.userData = t.userData),
  48774. void 0 !== t.children)
  48775. for (var h in t.children)
  48776. s.add(this.parseObject(t.children[h], i, r));
  48777. if ("LOD" === t.type)
  48778. for (var u = t.levels, d = 0; d < u.length; d++) {
  48779. var p = u[d]
  48780. , h = s.getObjectByProperty("uuid", p.object);
  48781. void 0 !== h && s.addLevel(h, p.distance)
  48782. }
  48783. return s
  48784. }
  48785. }()
  48786. },
  48787. n.TextureLoader = function(e) {
  48788. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48789. }
  48790. ,
  48791. n.TextureLoader.prototype = {
  48792. constructor: n.TextureLoader,
  48793. load: function(e, t, i, r) {
  48794. var o = new n.Texture
  48795. , a = new n.ImageLoader(this.manager);
  48796. return a.setCrossOrigin(this.crossOrigin),
  48797. a.setPath(this.path),
  48798. a.load(e, function(e) {
  48799. o.image = e,
  48800. o.needsUpdate = !0,
  48801. void 0 !== t && t(o)
  48802. }, i, r),
  48803. o
  48804. },
  48805. setCrossOrigin: function(e) {
  48806. this.crossOrigin = e
  48807. },
  48808. setPath: function(e) {
  48809. this.path = e
  48810. }
  48811. },
  48812. n.CubeTextureLoader = function(e) {
  48813. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48814. }
  48815. ,
  48816. n.CubeTextureLoader.prototype = {
  48817. constructor: n.CubeTextureLoader,
  48818. load: function(e, t, i, r) {
  48819. function o(i) {
  48820. s.load(e[i], function(e) {
  48821. a.images[i] = e,
  48822. l++,
  48823. 6 === l && (a.needsUpdate = !0,
  48824. t && t(a))
  48825. }, void 0, r)
  48826. }
  48827. var a = new n.CubeTexture
  48828. , s = new n.ImageLoader(this.manager);
  48829. s.setCrossOrigin(this.crossOrigin),
  48830. s.setPath(this.path);
  48831. for (var l = 0, c = 0; c < e.length; ++c)
  48832. o(c);
  48833. return a
  48834. },
  48835. setCrossOrigin: function(e) {
  48836. this.crossOrigin = e
  48837. },
  48838. setPath: function(e) {
  48839. this.path = e
  48840. }
  48841. },
  48842. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48843. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48844. this._parser = null
  48845. }
  48846. ,
  48847. n.BinaryTextureLoader.prototype = {
  48848. constructor: n.BinaryTextureLoader,
  48849. load: function(e, t, i, r) {
  48850. var o = this
  48851. , a = new n.DataTexture
  48852. , s = new n.XHRLoader(this.manager);
  48853. return s.setResponseType("arraybuffer"),
  48854. s.load(e, function(e) {
  48855. var i = o._parser(e);
  48856. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48857. a.image.height = i.height,
  48858. a.image.data = i.data),
  48859. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48860. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48861. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48862. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48863. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48864. void 0 !== i.format && (a.format = i.format),
  48865. void 0 !== i.type && (a.type = i.type),
  48866. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48867. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48868. a.needsUpdate = !0,
  48869. t && t(a, i))
  48870. }, i, r),
  48871. a
  48872. }
  48873. },
  48874. n.CompressedTextureLoader = function(e) {
  48875. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48876. this._parser = null
  48877. }
  48878. ;
  48879. n.CompressedTextureLoader.prototype = {
  48880. constructor: n.CompressedTextureLoader,
  48881. load: function(e, t, i, r) {
  48882. function o(o) {
  48883. c.load(e[o], function(e) {
  48884. var i = a._parser(e, !0);
  48885. s[o] = {
  48886. width: i.width,
  48887. height: i.height,
  48888. format: i.format,
  48889. mipmaps: i.mipmaps
  48890. },
  48891. h += 1,
  48892. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48893. l.format = i.format,
  48894. l.needsUpdate = !0,
  48895. t && t(l))
  48896. }, i, r)
  48897. }
  48898. var a = this
  48899. , s = []
  48900. , l = new n.CompressedTexture;
  48901. l.image = s;
  48902. var c = new n.XHRLoader(this.manager);
  48903. if (c.setPath(this.path),
  48904. c.setResponseType("arraybuffer"),
  48905. Array.isArray(e))
  48906. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48907. o(u);
  48908. else
  48909. c.load(e, function(e) {
  48910. var i = a._parser(e, !0);
  48911. if (i.isCubemap)
  48912. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48913. s[o] = {
  48914. mipmaps: []
  48915. };
  48916. for (var c = 0; c < i.mipmapCount; c++)
  48917. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48918. s[o].format = i.format,
  48919. s[o].width = i.width,
  48920. s[o].height = i.height
  48921. }
  48922. else
  48923. l.image.width = i.width,
  48924. l.image.height = i.height,
  48925. l.mipmaps = i.mipmaps;
  48926. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48927. l.format = i.format,
  48928. l.needsUpdate = !0,
  48929. t && t(l)
  48930. }, i, r);
  48931. return l
  48932. },
  48933. setPath: function(e) {
  48934. this.path = e
  48935. }
  48936. };
  48937. n.Material = function() {
  48938. Object.defineProperty(this, "id", {
  48939. value: n.MaterialIdCount++
  48940. }),
  48941. this.uuid = n.Math.generateUUID(),
  48942. this.name = "",
  48943. this.type = "Material",
  48944. this.side = n.FrontSide,
  48945. this.opacity = 1,
  48946. this.transparent = !1,
  48947. this.blending = n.NormalBlending,
  48948. this.blendSrc = n.SrcAlphaFactor,
  48949. this.blendDst = n.OneMinusSrcAlphaFactor,
  48950. this.blendEquation = n.AddEquation,
  48951. this.blendSrcAlpha = null,
  48952. this.blendDstAlpha = null,
  48953. this.blendEquationAlpha = null,
  48954. this.depthFunc = n.LessEqualDepth,
  48955. this.depthTest = !0,
  48956. this.depthWrite = !0,
  48957. this.colorWrite = !0,
  48958. this.precision = null,
  48959. this.polygonOffset = !1,
  48960. this.polygonOffsetFactor = 0,
  48961. this.polygonOffsetUnits = 0,
  48962. this.alphaTest = 0,
  48963. this.premultipliedAlpha = !1,
  48964. this.overdraw = 0,
  48965. this.visible = !0,
  48966. this._needsUpdate = !0
  48967. }
  48968. ,
  48969. n.Material.prototype = {
  48970. constructor: n.Material,
  48971. get needsUpdate() {
  48972. return this._needsUpdate
  48973. },
  48974. set needsUpdate(e) {
  48975. e === !0 && this.update(),
  48976. this._needsUpdate = e
  48977. },
  48978. setValues: function(e) {
  48979. if (void 0 !== e)
  48980. for (var t in e) {
  48981. var i = e[t];
  48982. if (void 0 !== i) {
  48983. var r = this[t];
  48984. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  48985. } else
  48986. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48987. }
  48988. },
  48989. toJSON: function(e) {
  48990. function t(e) {
  48991. var t = [];
  48992. for (var i in e) {
  48993. var n = e[i];
  48994. delete n.metadata,
  48995. t.push(n)
  48996. }
  48997. return t
  48998. }
  48999. var i = void 0 === e;
  49000. i && (e = {
  49001. textures: {},
  49002. images: {}
  49003. });
  49004. var r = {
  49005. metadata: {
  49006. version: 4.4,
  49007. type: "Material",
  49008. generator: "Material.toJSON"
  49009. }
  49010. };
  49011. if (r.uuid = this.uuid,
  49012. r.type = this.type,
  49013. "" !== this.name && (r.name = this.name),
  49014. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49015. .5 !== this.roughness && (r.roughness = this.roughness),
  49016. .5 !== this.metalness && (r.metalness = this.metalness),
  49017. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49018. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49019. void 0 !== this.shininess && (r.shininess = this.shininess),
  49020. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49021. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49022. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49023. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49024. r.bumpScale = this.bumpScale),
  49025. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49026. r.normalScale = this.normalScale.toArray()),
  49027. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49028. r.displacementScale = this.displacementScale,
  49029. r.displacementBias = this.displacementBias),
  49030. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49031. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49032. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49033. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49034. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49035. r.reflectivity = this.reflectivity),
  49036. void 0 !== this.size && (r.size = this.size),
  49037. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49038. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49039. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49040. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49041. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49042. this.opacity < 1 && (r.opacity = this.opacity),
  49043. this.transparent === !0 && (r.transparent = this.transparent),
  49044. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49045. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49046. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49047. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49048. i) {
  49049. var o = t(e.textures)
  49050. , a = t(e.images);
  49051. o.length > 0 && (r.textures = o),
  49052. a.length > 0 && (r.images = a)
  49053. }
  49054. return r
  49055. },
  49056. clone: function() {
  49057. return (new this.constructor).copy(this)
  49058. },
  49059. copy: function(e) {
  49060. return this.name = e.name,
  49061. this.side = e.side,
  49062. this.opacity = e.opacity,
  49063. this.transparent = e.transparent,
  49064. this.blending = e.blending,
  49065. this.blendSrc = e.blendSrc,
  49066. this.blendDst = e.blendDst,
  49067. this.blendEquation = e.blendEquation,
  49068. this.blendSrcAlpha = e.blendSrcAlpha,
  49069. this.blendDstAlpha = e.blendDstAlpha,
  49070. this.blendEquationAlpha = e.blendEquationAlpha,
  49071. this.depthFunc = e.depthFunc,
  49072. this.depthTest = e.depthTest,
  49073. this.depthWrite = e.depthWrite,
  49074. this.colorWrite = e.colorWrite,
  49075. this.precision = e.precision,
  49076. this.polygonOffset = e.polygonOffset,
  49077. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49078. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49079. this.alphaTest = e.alphaTest,
  49080. this.premultipliedAlpha = e.premultipliedAlpha,
  49081. this.overdraw = e.overdraw,
  49082. this.visible = e.visible,
  49083. this
  49084. },
  49085. update: function() {
  49086. this.dispatchEvent({
  49087. type: "update"
  49088. })
  49089. },
  49090. dispose: function() {
  49091. this.dispatchEvent({
  49092. type: "dispose"
  49093. })
  49094. }
  49095. },
  49096. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49097. n.MaterialIdCount = 0,
  49098. n.LineBasicMaterial = function(e) {
  49099. n.Material.call(this),
  49100. this.type = "LineBasicMaterial",
  49101. this.color = new n.Color(16777215),
  49102. this.linewidth = 1,
  49103. this.linecap = "round",
  49104. this.linejoin = "round",
  49105. this.blending = n.NormalBlending,
  49106. this.vertexColors = n.NoColors,
  49107. this.fog = !0,
  49108. this.setValues(e)
  49109. }
  49110. ,
  49111. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49112. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49113. n.LineBasicMaterial.prototype.copy = function(e) {
  49114. return n.Material.prototype.copy.call(this, e),
  49115. this.color.copy(e.color),
  49116. this.linewidth = e.linewidth,
  49117. this.linecap = e.linecap,
  49118. this.linejoin = e.linejoin,
  49119. this.vertexColors = e.vertexColors,
  49120. this.fog = e.fog,
  49121. this
  49122. }
  49123. ,
  49124. n.LineDashedMaterial = function(e) {
  49125. n.Material.call(this),
  49126. this.type = "LineDashedMaterial",
  49127. this.color = new n.Color(16777215),
  49128. this.linewidth = 1,
  49129. this.scale = 1,
  49130. this.dashSize = 3,
  49131. this.gapSize = 1,
  49132. this.blending = n.NormalBlending,
  49133. this.vertexColors = n.NoColors,
  49134. this.fog = !0,
  49135. this.setValues(e)
  49136. }
  49137. ,
  49138. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49139. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49140. n.LineDashedMaterial.prototype.copy = function(e) {
  49141. return n.Material.prototype.copy.call(this, e),
  49142. this.color.copy(e.color),
  49143. this.linewidth = e.linewidth,
  49144. this.scale = e.scale,
  49145. this.dashSize = e.dashSize,
  49146. this.gapSize = e.gapSize,
  49147. this.vertexColors = e.vertexColors,
  49148. this.fog = e.fog,
  49149. this
  49150. }
  49151. ,
  49152. n.MeshBasicMaterial = function(e) {
  49153. n.Material.call(this),
  49154. this.type = "MeshBasicMaterial",
  49155. this.color = new n.Color(16777215),
  49156. this.map = null,
  49157. this.aoMap = null,
  49158. this.aoMapIntensity = 1,
  49159. this.specularMap = null,
  49160. this.alphaMap = null,
  49161. this.envMap = null,
  49162. this.combine = n.MultiplyOperation,
  49163. this.reflectivity = 1,
  49164. this.refractionRatio = .98,
  49165. this.fog = !0,
  49166. this.shading = n.SmoothShading,
  49167. this.blending = n.NormalBlending,
  49168. this.wireframe = !1,
  49169. this.wireframeLinewidth = 1,
  49170. this.wireframeLinecap = "round",
  49171. this.wireframeLinejoin = "round",
  49172. this.vertexColors = n.NoColors,
  49173. this.skinning = !1,
  49174. this.morphTargets = !1,
  49175. this.setValues(e)
  49176. }
  49177. ,
  49178. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49179. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49180. n.MeshBasicMaterial.prototype.copy = function(e) {
  49181. return n.Material.prototype.copy.call(this, e),
  49182. this.color.copy(e.color),
  49183. this.map = e.map,
  49184. this.aoMap = e.aoMap,
  49185. this.aoMapIntensity = e.aoMapIntensity,
  49186. this.specularMap = e.specularMap,
  49187. this.alphaMap = e.alphaMap,
  49188. this.envMap = e.envMap,
  49189. this.combine = e.combine,
  49190. this.reflectivity = e.reflectivity,
  49191. this.refractionRatio = e.refractionRatio,
  49192. this.fog = e.fog,
  49193. this.shading = e.shading,
  49194. this.wireframe = e.wireframe,
  49195. this.wireframeLinewidth = e.wireframeLinewidth,
  49196. this.wireframeLinecap = e.wireframeLinecap,
  49197. this.wireframeLinejoin = e.wireframeLinejoin,
  49198. this.vertexColors = e.vertexColors,
  49199. this.skinning = e.skinning,
  49200. this.morphTargets = e.morphTargets,
  49201. this
  49202. }
  49203. ,
  49204. n.MeshLambertMaterial = function(e) {
  49205. n.Material.call(this),
  49206. this.type = "MeshLambertMaterial",
  49207. this.color = new n.Color(16777215),
  49208. this.map = null,
  49209. this.lightMap = null,
  49210. this.lightMapIntensity = 1,
  49211. this.aoMap = null,
  49212. this.aoMapIntensity = 1,
  49213. this.emissive = new n.Color(0),
  49214. this.emissiveIntensity = 1,
  49215. this.emissiveMap = null,
  49216. this.specularMap = null,
  49217. this.alphaMap = null,
  49218. this.envMap = null,
  49219. this.combine = n.MultiplyOperation,
  49220. this.reflectivity = 1,
  49221. this.refractionRatio = .98,
  49222. this.fog = !0,
  49223. this.blending = n.NormalBlending,
  49224. this.wireframe = !1,
  49225. this.wireframeLinewidth = 1,
  49226. this.wireframeLinecap = "round",
  49227. this.wireframeLinejoin = "round",
  49228. this.vertexColors = n.NoColors,
  49229. this.skinning = !1,
  49230. this.morphTargets = !1,
  49231. this.morphNormals = !1,
  49232. this.setValues(e)
  49233. }
  49234. ,
  49235. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49236. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49237. n.MeshLambertMaterial.prototype.copy = function(e) {
  49238. return n.Material.prototype.copy.call(this, e),
  49239. this.color.copy(e.color),
  49240. this.map = e.map,
  49241. this.lightMap = e.lightMap,
  49242. this.lightMapIntensity = e.lightMapIntensity,
  49243. this.aoMap = e.aoMap,
  49244. this.aoMapIntensity = e.aoMapIntensity,
  49245. this.emissive.copy(e.emissive),
  49246. this.emissiveMap = e.emissiveMap,
  49247. this.emissiveIntensity = e.emissiveIntensity,
  49248. this.specularMap = e.specularMap,
  49249. this.alphaMap = e.alphaMap,
  49250. this.envMap = e.envMap,
  49251. this.combine = e.combine,
  49252. this.reflectivity = e.reflectivity,
  49253. this.refractionRatio = e.refractionRatio,
  49254. this.fog = e.fog,
  49255. this.wireframe = e.wireframe,
  49256. this.wireframeLinewidth = e.wireframeLinewidth,
  49257. this.wireframeLinecap = e.wireframeLinecap,
  49258. this.wireframeLinejoin = e.wireframeLinejoin,
  49259. this.vertexColors = e.vertexColors,
  49260. this.skinning = e.skinning,
  49261. this.morphTargets = e.morphTargets,
  49262. this.morphNormals = e.morphNormals,
  49263. this
  49264. }
  49265. ,
  49266. n.MeshPhongMaterial = function(e) {
  49267. n.Material.call(this),
  49268. this.type = "MeshPhongMaterial",
  49269. this.color = new n.Color(16777215),
  49270. this.specular = new n.Color(1118481),
  49271. this.shininess = 30,
  49272. this.map = null,
  49273. this.lightMap = null,
  49274. this.lightMapIntensity = 1,
  49275. this.aoMap = null,
  49276. this.aoMapIntensity = 1,
  49277. this.emissive = new n.Color(0),
  49278. this.emissiveIntensity = 1,
  49279. this.emissiveMap = null,
  49280. this.bumpMap = null,
  49281. this.bumpScale = 1,
  49282. this.normalMap = null,
  49283. this.normalScale = new n.Vector2(1,1),
  49284. this.displacementMap = null,
  49285. this.displacementScale = 1,
  49286. this.displacementBias = 0,
  49287. this.specularMap = null,
  49288. this.alphaMap = null,
  49289. this.envMap = null,
  49290. this.combine = n.MultiplyOperation,
  49291. this.reflectivity = 1,
  49292. this.refractionRatio = .98,
  49293. this.fog = !0,
  49294. this.shading = n.SmoothShading,
  49295. this.blending = n.NormalBlending,
  49296. this.wireframe = !1,
  49297. this.wireframeLinewidth = 1,
  49298. this.wireframeLinecap = "round",
  49299. this.wireframeLinejoin = "round",
  49300. this.vertexColors = n.NoColors,
  49301. this.skinning = !1,
  49302. this.morphTargets = !1,
  49303. this.morphNormals = !1,
  49304. this.setValues(e)
  49305. }
  49306. ,
  49307. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49308. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49309. n.MeshPhongMaterial.prototype.copy = function(e) {
  49310. return n.Material.prototype.copy.call(this, e),
  49311. this.color.copy(e.color),
  49312. this.specular.copy(e.specular),
  49313. this.shininess = e.shininess,
  49314. this.map = e.map,
  49315. this.lightMap = e.lightMap,
  49316. this.lightMapIntensity = e.lightMapIntensity,
  49317. this.aoMap = e.aoMap,
  49318. this.aoMapIntensity = e.aoMapIntensity,
  49319. this.emissive.copy(e.emissive),
  49320. this.emissiveMap = e.emissiveMap,
  49321. this.emissiveIntensity = e.emissiveIntensity,
  49322. this.bumpMap = e.bumpMap,
  49323. this.bumpScale = e.bumpScale,
  49324. this.normalMap = e.normalMap,
  49325. this.normalScale.copy(e.normalScale),
  49326. this.displacementMap = e.displacementMap,
  49327. this.displacementScale = e.displacementScale,
  49328. this.displacementBias = e.displacementBias,
  49329. this.specularMap = e.specularMap,
  49330. this.alphaMap = e.alphaMap,
  49331. this.envMap = e.envMap,
  49332. this.combine = e.combine,
  49333. this.reflectivity = e.reflectivity,
  49334. this.refractionRatio = e.refractionRatio,
  49335. this.fog = e.fog,
  49336. this.shading = e.shading,
  49337. this.wireframe = e.wireframe,
  49338. this.wireframeLinewidth = e.wireframeLinewidth,
  49339. this.wireframeLinecap = e.wireframeLinecap,
  49340. this.wireframeLinejoin = e.wireframeLinejoin,
  49341. this.vertexColors = e.vertexColors,
  49342. this.skinning = e.skinning,
  49343. this.morphTargets = e.morphTargets,
  49344. this.morphNormals = e.morphNormals,
  49345. this
  49346. }
  49347. ,
  49348. n.MeshStandardMaterial = function(e) {
  49349. n.Material.call(this),
  49350. this.type = "MeshStandardMaterial",
  49351. this.color = new n.Color(16777215),
  49352. this.roughness = .5,
  49353. this.metalness = .5,
  49354. this.map = null,
  49355. this.lightMap = null,
  49356. this.lightMapIntensity = 1,
  49357. this.aoMap = null,
  49358. this.aoMapIntensity = 1,
  49359. this.emissive = new n.Color(0),
  49360. this.emissiveIntensity = 1,
  49361. this.emissiveMap = null,
  49362. this.bumpMap = null,
  49363. this.bumpScale = 1,
  49364. this.normalMap = null,
  49365. this.normalScale = new n.Vector2(1,1),
  49366. this.displacementMap = null,
  49367. this.displacementScale = 1,
  49368. this.displacementBias = 0,
  49369. this.roughnessMap = null,
  49370. this.metalnessMap = null,
  49371. this.alphaMap = null,
  49372. this.envMap = null,
  49373. this.envMapIntensity = 1,
  49374. this.refractionRatio = .98,
  49375. this.fog = !0,
  49376. this.shading = n.SmoothShading,
  49377. this.blending = n.NormalBlending,
  49378. this.wireframe = !1,
  49379. this.wireframeLinewidth = 1,
  49380. this.wireframeLinecap = "round",
  49381. this.wireframeLinejoin = "round",
  49382. this.vertexColors = n.NoColors,
  49383. this.skinning = !1,
  49384. this.morphTargets = !1,
  49385. this.morphNormals = !1,
  49386. this.setValues(e)
  49387. }
  49388. ,
  49389. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49390. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49391. n.MeshStandardMaterial.prototype.copy = function(e) {
  49392. return n.Material.prototype.copy.call(this, e),
  49393. this.color.copy(e.color),
  49394. this.roughness = e.roughness,
  49395. this.metalness = e.metalness,
  49396. this.map = e.map,
  49397. this.lightMap = e.lightMap,
  49398. this.lightMapIntensity = e.lightMapIntensity,
  49399. this.aoMap = e.aoMap,
  49400. this.aoMapIntensity = e.aoMapIntensity,
  49401. this.emissive.copy(e.emissive),
  49402. this.emissiveMap = e.emissiveMap,
  49403. this.emissiveIntensity = e.emissiveIntensity,
  49404. this.bumpMap = e.bumpMap,
  49405. this.bumpScale = e.bumpScale,
  49406. this.normalMap = e.normalMap,
  49407. this.normalScale.copy(e.normalScale),
  49408. this.displacementMap = e.displacementMap,
  49409. this.displacementScale = e.displacementScale,
  49410. this.displacementBias = e.displacementBias,
  49411. this.roughnessMap = e.roughnessMap,
  49412. this.metalnessMap = e.metalnessMap,
  49413. this.alphaMap = e.alphaMap,
  49414. this.envMap = e.envMap,
  49415. this.envMapIntensity = e.envMapIntensity,
  49416. this.refractionRatio = e.refractionRatio,
  49417. this.fog = e.fog,
  49418. this.shading = e.shading,
  49419. this.wireframe = e.wireframe,
  49420. this.wireframeLinewidth = e.wireframeLinewidth,
  49421. this.wireframeLinecap = e.wireframeLinecap,
  49422. this.wireframeLinejoin = e.wireframeLinejoin,
  49423. this.vertexColors = e.vertexColors,
  49424. this.skinning = e.skinning,
  49425. this.morphTargets = e.morphTargets,
  49426. this.morphNormals = e.morphNormals,
  49427. this
  49428. }
  49429. ,
  49430. n.MeshDepthMaterial = function(e) {
  49431. n.Material.call(this),
  49432. this.type = "MeshDepthMaterial",
  49433. this.morphTargets = !1,
  49434. this.wireframe = !1,
  49435. this.wireframeLinewidth = 1,
  49436. this.setValues(e)
  49437. }
  49438. ,
  49439. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49440. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49441. n.MeshDepthMaterial.prototype.copy = function(e) {
  49442. return n.Material.prototype.copy.call(this, e),
  49443. this.wireframe = e.wireframe,
  49444. this.wireframeLinewidth = e.wireframeLinewidth,
  49445. this
  49446. }
  49447. ,
  49448. n.MeshNormalMaterial = function(e) {
  49449. n.Material.call(this, e),
  49450. this.type = "MeshNormalMaterial",
  49451. this.wireframe = !1,
  49452. this.wireframeLinewidth = 1,
  49453. this.morphTargets = !1,
  49454. this.setValues(e)
  49455. }
  49456. ,
  49457. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49458. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49459. n.MeshNormalMaterial.prototype.copy = function(e) {
  49460. return n.Material.prototype.copy.call(this, e),
  49461. this.wireframe = e.wireframe,
  49462. this.wireframeLinewidth = e.wireframeLinewidth,
  49463. this
  49464. }
  49465. ,
  49466. n.MultiMaterial = function(e) {
  49467. this.uuid = n.Math.generateUUID(),
  49468. this.type = "MultiMaterial",
  49469. this.materials = e instanceof Array ? e : [],
  49470. this.visible = !0
  49471. }
  49472. ,
  49473. n.MultiMaterial.prototype = {
  49474. constructor: n.MultiMaterial,
  49475. toJSON: function(e) {
  49476. for (var t = {
  49477. metadata: {
  49478. version: 4.2,
  49479. type: "material",
  49480. generator: "MaterialExporter"
  49481. },
  49482. uuid: this.uuid,
  49483. type: this.type,
  49484. materials: []
  49485. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49486. var o = i[n].toJSON(e);
  49487. delete o.metadata,
  49488. t.materials.push(o)
  49489. }
  49490. return t.visible = this.visible,
  49491. t
  49492. },
  49493. clone: function() {
  49494. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49495. e.materials.push(this.materials[t].clone());
  49496. return e.visible = this.visible,
  49497. e
  49498. }
  49499. },
  49500. n.PointsMaterial = function(e) {
  49501. n.Material.call(this),
  49502. this.type = "PointsMaterial",
  49503. this.color = new n.Color(16777215),
  49504. this.map = null,
  49505. this.size = 1,
  49506. this.sizeAttenuation = !0,
  49507. this.blending = n.NormalBlending,
  49508. this.vertexColors = n.NoColors,
  49509. this.fog = !0,
  49510. this.setValues(e)
  49511. }
  49512. ,
  49513. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49514. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49515. n.PointsMaterial.prototype.copy = function(e) {
  49516. return n.Material.prototype.copy.call(this, e),
  49517. this.color.copy(e.color),
  49518. this.map = e.map,
  49519. this.size = e.size,
  49520. this.sizeAttenuation = e.sizeAttenuation,
  49521. this.vertexColors = e.vertexColors,
  49522. this.fog = e.fog,
  49523. this
  49524. }
  49525. ,
  49526. n.ShaderMaterial = function(e) {
  49527. n.Material.call(this),
  49528. this.type = "ShaderMaterial",
  49529. this.defines = {},
  49530. this.uniforms = {},
  49531. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49532. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49533. this.shading = n.SmoothShading,
  49534. this.linewidth = 1,
  49535. this.wireframe = !1,
  49536. this.wireframeLinewidth = 1,
  49537. this.fog = !1,
  49538. this.lights = !1,
  49539. this.vertexColors = n.NoColors,
  49540. this.skinning = !1,
  49541. this.morphTargets = !1,
  49542. this.morphNormals = !1,
  49543. this.extensions = {
  49544. derivatives: !1,
  49545. fragDepth: !1,
  49546. drawBuffers: !1,
  49547. shaderTextureLOD: !1
  49548. },
  49549. this.defaultAttributeValues = {
  49550. color: [1, 1, 1],
  49551. uv: [0, 0],
  49552. uv2: [0, 0]
  49553. },
  49554. this.index0AttributeName = void 0,
  49555. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49556. this.setValues(e))
  49557. }
  49558. ,
  49559. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49560. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49561. n.ShaderMaterial.prototype.copy = function(e) {
  49562. return n.Material.prototype.copy.call(this, e),
  49563. this.fragmentShader = e.fragmentShader,
  49564. this.vertexShader = e.vertexShader,
  49565. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49566. this.defines = e.defines,
  49567. this.shading = e.shading,
  49568. this.wireframe = e.wireframe,
  49569. this.wireframeLinewidth = e.wireframeLinewidth,
  49570. this.fog = e.fog,
  49571. this.lights = e.lights,
  49572. this.vertexColors = e.vertexColors,
  49573. this.skinning = e.skinning,
  49574. this.morphTargets = e.morphTargets,
  49575. this.morphNormals = e.morphNormals,
  49576. this.extensions = e.extensions,
  49577. this
  49578. }
  49579. ,
  49580. n.ShaderMaterial.prototype.toJSON = function(e) {
  49581. var t = n.Material.prototype.toJSON.call(this, e);
  49582. return t.uniforms = this.uniforms,
  49583. t.vertexShader = this.vertexShader,
  49584. t.fragmentShader = this.fragmentShader,
  49585. t
  49586. }
  49587. ,
  49588. n.RawShaderMaterial = function(e) {
  49589. n.ShaderMaterial.call(this, e),
  49590. this.type = "RawShaderMaterial"
  49591. }
  49592. ,
  49593. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49594. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49595. n.SpriteMaterial = function(e) {
  49596. n.Material.call(this),
  49597. this.type = "SpriteMaterial",
  49598. this.color = new n.Color(16777215),
  49599. this.map = null,
  49600. this.rotation = 0,
  49601. this.fog = !1,
  49602. this.setValues(e)
  49603. }
  49604. ,
  49605. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49606. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49607. n.SpriteMaterial.prototype.copy = function(e) {
  49608. return n.Material.prototype.copy.call(this, e),
  49609. this.color.copy(e.color),
  49610. this.map = e.map,
  49611. this.rotation = e.rotation,
  49612. this.fog = e.fog,
  49613. this
  49614. }
  49615. ,
  49616. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49617. Object.defineProperty(this, "id", {
  49618. value: n.TextureIdCount++
  49619. }),
  49620. this.uuid = n.Math.generateUUID(),
  49621. this.name = "",
  49622. this.sourceFile = "",
  49623. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49624. this.mipmaps = [],
  49625. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49626. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49627. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49628. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49629. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49630. this.anisotropy = void 0 !== c ? c : 1,
  49631. this.format = void 0 !== s ? s : n.RGBAFormat,
  49632. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49633. this.offset = new n.Vector2(0,0),
  49634. this.repeat = new n.Vector2(1,1),
  49635. this.generateMipmaps = !0,
  49636. this.premultiplyAlpha = !1,
  49637. this.flipY = !0,
  49638. this.unpackAlignment = 4,
  49639. this.encoding = n.LinearEncoding,
  49640. this.version = 0,
  49641. this.onUpdate = null
  49642. }
  49643. ,
  49644. n.Texture.DEFAULT_IMAGE = void 0,
  49645. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49646. n.Texture.prototype = {
  49647. constructor: n.Texture,
  49648. set needsUpdate(e) {
  49649. e === !0 && this.version++
  49650. },
  49651. clone: function() {
  49652. return (new this.constructor).copy(this)
  49653. },
  49654. copy: function(e) {
  49655. return this.image = e.image,
  49656. this.mipmaps = e.mipmaps.slice(0),
  49657. this.mapping = e.mapping,
  49658. this.wrapS = e.wrapS,
  49659. this.wrapT = e.wrapT,
  49660. this.magFilter = e.magFilter,
  49661. this.minFilter = e.minFilter,
  49662. this.anisotropy = e.anisotropy,
  49663. this.format = e.format,
  49664. this.type = e.type,
  49665. this.offset.copy(e.offset),
  49666. this.repeat.copy(e.repeat),
  49667. this.generateMipmaps = e.generateMipmaps,
  49668. this.premultiplyAlpha = e.premultiplyAlpha,
  49669. this.flipY = e.flipY,
  49670. this.unpackAlignment = e.unpackAlignment,
  49671. this.encoding = e.encoding,
  49672. this
  49673. },
  49674. toJSON: function(e) {
  49675. function t(e) {
  49676. var t;
  49677. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49678. t.width = e.width,
  49679. t.height = e.height,
  49680. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49681. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49682. }
  49683. if (void 0 !== e.textures[this.uuid])
  49684. return e.textures[this.uuid];
  49685. var i = {
  49686. metadata: {
  49687. version: 4.4,
  49688. type: "Texture",
  49689. generator: "Texture.toJSON"
  49690. },
  49691. uuid: this.uuid,
  49692. name: this.name,
  49693. mapping: this.mapping,
  49694. repeat: [this.repeat.x, this.repeat.y],
  49695. offset: [this.offset.x, this.offset.y],
  49696. wrap: [this.wrapS, this.wrapT],
  49697. minFilter: this.minFilter,
  49698. magFilter: this.magFilter,
  49699. anisotropy: this.anisotropy
  49700. };
  49701. if (void 0 !== this.image) {
  49702. var r = this.image;
  49703. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49704. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49705. uuid: r.uuid,
  49706. url: t(r)
  49707. }),
  49708. i.image = r.uuid
  49709. }
  49710. return e.textures[this.uuid] = i,
  49711. i
  49712. },
  49713. dispose: function() {
  49714. this.dispatchEvent({
  49715. type: "dispose"
  49716. })
  49717. },
  49718. transformUv: function(e) {
  49719. if (this.mapping === n.UVMapping) {
  49720. if (e.multiply(this.repeat),
  49721. e.add(this.offset),
  49722. e.x < 0 || e.x > 1)
  49723. switch (this.wrapS) {
  49724. case n.RepeatWrapping:
  49725. e.x = e.x - Math.floor(e.x);
  49726. break;
  49727. case n.ClampToEdgeWrapping:
  49728. e.x = e.x < 0 ? 0 : 1;
  49729. break;
  49730. case n.MirroredRepeatWrapping:
  49731. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49732. }
  49733. if (e.y < 0 || e.y > 1)
  49734. switch (this.wrapT) {
  49735. case n.RepeatWrapping:
  49736. e.y = e.y - Math.floor(e.y);
  49737. break;
  49738. case n.ClampToEdgeWrapping:
  49739. e.y = e.y < 0 ? 0 : 1;
  49740. break;
  49741. case n.MirroredRepeatWrapping:
  49742. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49743. }
  49744. this.flipY && (e.y = 1 - e.y)
  49745. }
  49746. }
  49747. },
  49748. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49749. n.TextureIdCount = 0,
  49750. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49751. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49752. this.needsUpdate = !0
  49753. }
  49754. ,
  49755. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49756. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49757. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49758. e = void 0 !== e ? e : [],
  49759. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49760. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49761. this.flipY = !1
  49762. }
  49763. ,
  49764. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49765. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49766. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49767. get: function() {
  49768. return this.image
  49769. },
  49770. set: function(e) {
  49771. this.image = e
  49772. }
  49773. }),
  49774. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49775. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49776. this.image = {
  49777. width: t,
  49778. height: i
  49779. },
  49780. this.mipmaps = e,
  49781. this.flipY = !1,
  49782. this.generateMipmaps = !1
  49783. }
  49784. ,
  49785. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49786. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49787. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49788. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49789. this.image = {
  49790. data: e,
  49791. width: t,
  49792. height: i
  49793. },
  49794. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49795. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49796. this.flipY = !1,
  49797. this.generateMipmaps = !1
  49798. }
  49799. ,
  49800. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49801. n.DataTexture.prototype.constructor = n.DataTexture,
  49802. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49803. function h() {
  49804. requestAnimationFrame(h)
  49805. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  49806. u.needsUpdate = !0
  49807. }
  49808. }
  49809. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49810. this.generateMipmaps = !1;
  49811. var u = this;
  49812. h()
  49813. }
  49814. ,
  49815. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49816. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49817. n.Group = function() {
  49818. n.Object3D.call(this),
  49819. this.type = "Group"
  49820. }
  49821. ,
  49822. n.Group.prototype = Object.create(n.Object3D.prototype),
  49823. n.Group.prototype.constructor = n.Group,
  49824. n.Points = function(e, t) {
  49825. n.Object3D.call(this),
  49826. this.type = "Points",
  49827. this.geometry = void 0 !== e ? e : new n.Geometry,
  49828. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49829. color: 16777215 * Math.random()
  49830. })
  49831. }
  49832. ,
  49833. n.Points.prototype = Object.create(n.Object3D.prototype),
  49834. n.Points.prototype.constructor = n.Points,
  49835. n.Points.prototype.raycast = function() {
  49836. var e = new n.Matrix4
  49837. , t = new n.Ray
  49838. , i = new n.Sphere;
  49839. return function(r, o) {
  49840. function a(e, i) {
  49841. var n = t.distanceSqToPoint(e);
  49842. if (n < d) {
  49843. var a = t.closestPointToPoint(e);
  49844. a.applyMatrix4(c);
  49845. var l = r.ray.origin.distanceTo(a);
  49846. if (l < r.near || l > r.far)
  49847. return;
  49848. o.push({
  49849. distance: l,
  49850. distanceToRay: Math.sqrt(n),
  49851. point: a.clone(),
  49852. index: i,
  49853. face: null,
  49854. object: s
  49855. })
  49856. }
  49857. }
  49858. var s = this
  49859. , l = this.geometry
  49860. , c = this.matrixWorld
  49861. , h = r.params.Points.threshold;
  49862. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49863. i.copy(l.boundingSphere),
  49864. i.applyMatrix4(c),
  49865. r.ray.intersectsSphere(i) !== !1) {
  49866. e.getInverse(c),
  49867. t.copy(r.ray).applyMatrix4(e);
  49868. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49869. , d = u * u
  49870. , p = new n.Vector3;
  49871. if (l instanceof n.BufferGeometry) {
  49872. var f = l.index
  49873. , g = l.attributes
  49874. , m = g.position.array;
  49875. if (null !== f)
  49876. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49877. var C = v[A];
  49878. p.fromArray(m, 3 * C),
  49879. a(p, C)
  49880. }
  49881. else
  49882. for (var A = 0, I = m.length / 3; A < I; A++)
  49883. p.fromArray(m, 3 * A),
  49884. a(p, A)
  49885. } else
  49886. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49887. a(E[A], A)
  49888. }
  49889. }
  49890. }(),
  49891. n.Points.prototype.clone = function() {
  49892. return new this.constructor(this.geometry,this.material).copy(this)
  49893. }
  49894. ,
  49895. n.Line = function(e, t, i) {
  49896. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49897. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49898. this.type = "Line",
  49899. this.geometry = void 0 !== e ? e : new n.Geometry,
  49900. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49901. color: 16777215 * Math.random()
  49902. })))
  49903. }
  49904. ,
  49905. n.Line.prototype = Object.create(n.Object3D.prototype),
  49906. n.Line.prototype.constructor = n.Line,
  49907. n.Line.prototype.raycast = function() {
  49908. var e = new n.Matrix4
  49909. , t = new n.Ray
  49910. , i = new n.Sphere;
  49911. return function(r, o) {
  49912. var a = r.linePrecision
  49913. , s = a * a
  49914. , l = this.geometry
  49915. , c = this.matrixWorld;
  49916. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49917. i.copy(l.boundingSphere),
  49918. i.applyMatrix4(c),
  49919. r.ray.intersectsSphere(i) !== !1) {
  49920. e.getInverse(c),
  49921. t.copy(r.ray).applyMatrix4(e);
  49922. var h = new n.Vector3
  49923. , u = new n.Vector3
  49924. , d = new n.Vector3
  49925. , p = new n.Vector3
  49926. , f = this instanceof n.LineSegments ? 2 : 1;
  49927. if (l instanceof n.BufferGeometry) {
  49928. var g = l.index
  49929. , m = l.attributes
  49930. , v = m.position.array;
  49931. if (null !== g)
  49932. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49933. var I = A[y]
  49934. , E = A[y + 1];
  49935. h.fromArray(v, 3 * I),
  49936. u.fromArray(v, 3 * E);
  49937. var b = t.distanceSqToSegment(h, u, p, d);
  49938. if (!(b > s)) {
  49939. p.applyMatrix4(this.matrixWorld);
  49940. var w = r.ray.origin.distanceTo(p);
  49941. w < r.near || w > r.far || o.push({
  49942. distance: w,
  49943. point: d.clone().applyMatrix4(this.matrixWorld),
  49944. index: y,
  49945. face: null,
  49946. faceIndex: null,
  49947. object: this
  49948. })
  49949. }
  49950. }
  49951. else
  49952. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49953. h.fromArray(v, 3 * y),
  49954. u.fromArray(v, 3 * y + 3);
  49955. var b = t.distanceSqToSegment(h, u, p, d);
  49956. if (!(b > s)) {
  49957. p.applyMatrix4(this.matrixWorld);
  49958. var w = r.ray.origin.distanceTo(p);
  49959. w < r.near || w > r.far || o.push({
  49960. distance: w,
  49961. point: d.clone().applyMatrix4(this.matrixWorld),
  49962. index: y,
  49963. face: null,
  49964. faceIndex: null,
  49965. object: this
  49966. })
  49967. }
  49968. }
  49969. } else if (l instanceof n.Geometry)
  49970. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49971. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49972. if (!(b > s)) {
  49973. p.applyMatrix4(this.matrixWorld);
  49974. var w = r.ray.origin.distanceTo(p);
  49975. w < r.near || w > r.far || o.push({
  49976. distance: w,
  49977. point: d.clone().applyMatrix4(this.matrixWorld),
  49978. index: y,
  49979. face: null,
  49980. faceIndex: null,
  49981. object: this
  49982. })
  49983. }
  49984. }
  49985. }
  49986. }
  49987. }(),
  49988. n.Line.prototype.clone = function() {
  49989. return new this.constructor(this.geometry,this.material).copy(this)
  49990. }
  49991. ,
  49992. n.LineStrip = 0,
  49993. n.LinePieces = 1,
  49994. n.LineSegments = function(e, t) {
  49995. n.Line.call(this, e, t),
  49996. this.type = "LineSegments"
  49997. }
  49998. ,
  49999. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50000. n.LineSegments.prototype.constructor = n.LineSegments,
  50001. n.Mesh = function(e, t) {
  50002. n.Object3D.call(this),
  50003. this.type = "Mesh",
  50004. this.geometry = void 0 !== e ? e : new n.Geometry,
  50005. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50006. color: 16777215 * Math.random()
  50007. }),
  50008. this.drawMode = n.TrianglesDrawMode,
  50009. this.updateMorphTargets()
  50010. }
  50011. ,
  50012. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50013. n.Mesh.prototype.constructor = n.Mesh,
  50014. n.Mesh.prototype.setDrawMode = function(e) {
  50015. this.drawMode = e
  50016. }
  50017. ,
  50018. n.Mesh.prototype.updateMorphTargets = function() {
  50019. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50020. this.morphTargetBase = -1,
  50021. this.morphTargetInfluences = [],
  50022. this.morphTargetDictionary = {};
  50023. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50024. this.morphTargetInfluences.push(0),
  50025. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50026. }
  50027. }
  50028. ,
  50029. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50030. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50031. 0)
  50032. }
  50033. ,
  50034. n.Mesh.prototype.raycast = function() {
  50035. function e(e, t, i, r, o, a, s) {
  50036. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50037. o.multiplyScalar(m.x),
  50038. a.multiplyScalar(m.y),
  50039. s.multiplyScalar(m.z),
  50040. o.add(a).add(s),
  50041. o.clone()
  50042. }
  50043. function t(e, t, i, r, o, a, s) {
  50044. var l, c = e.material;
  50045. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50046. null === l)
  50047. return null;
  50048. A.copy(s),
  50049. A.applyMatrix4(e.matrixWorld);
  50050. var h = t.ray.origin.distanceTo(A);
  50051. return h < t.near || h > t.far ? null : {
  50052. distance: h,
  50053. point: A.clone(),
  50054. object: e
  50055. }
  50056. }
  50057. function i(i, r, o, a, h, u, d, m) {
  50058. s.fromArray(a, 3 * u),
  50059. l.fromArray(a, 3 * d),
  50060. c.fromArray(a, 3 * m);
  50061. var A = t(i, r, o, s, l, c, v);
  50062. return A && (h && (p.fromArray(h, 2 * u),
  50063. f.fromArray(h, 2 * d),
  50064. g.fromArray(h, 2 * m),
  50065. A.uv = e(v, s, l, c, p, f, g)),
  50066. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50067. A.faceIndex = u),
  50068. A
  50069. }
  50070. var r = new n.Matrix4
  50071. , o = new n.Ray
  50072. , a = new n.Sphere
  50073. , s = new n.Vector3
  50074. , l = new n.Vector3
  50075. , c = new n.Vector3
  50076. , h = new n.Vector3
  50077. , u = new n.Vector3
  50078. , d = new n.Vector3
  50079. , p = new n.Vector2
  50080. , f = new n.Vector2
  50081. , g = new n.Vector2
  50082. , m = new n.Vector3
  50083. , v = new n.Vector3
  50084. , A = new n.Vector3;
  50085. return function(m, A) {
  50086. var y = this.geometry
  50087. , C = this.material
  50088. , I = this.matrixWorld;
  50089. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50090. a.copy(y.boundingSphere),
  50091. a.applyMatrix4(I),
  50092. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50093. o.copy(m.ray).applyMatrix4(r),
  50094. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50095. var E, b;
  50096. if (y instanceof n.BufferGeometry) {
  50097. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50098. if (void 0 !== S.uv && (E = S.uv.array),
  50099. null !== x)
  50100. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50101. w = R[P],
  50102. _ = R[P + 1],
  50103. T = R[P + 2],
  50104. b = i(this, m, o, M, E, w, _, T),
  50105. b && (b.faceIndex = Math.floor(P / 3),
  50106. A.push(b));
  50107. else
  50108. for (var P = 0, O = M.length; P < O; P += 9)
  50109. w = P / 3,
  50110. _ = w + 1,
  50111. T = w + 2,
  50112. b = i(this, m, o, M, E, w, _, T),
  50113. b && (b.index = w,
  50114. A.push(b))
  50115. } else if (y instanceof n.Geometry) {
  50116. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  50117. k.length > 0 && (E = k);
  50118. for (var H = 0, G = U.length; H < G; H++) {
  50119. var z = U[H]
  50120. , W = B === !0 ? F[z.materialIndex] : C;
  50121. if (void 0 !== W) {
  50122. if (L = V[z.a],
  50123. D = V[z.b],
  50124. N = V[z.c],
  50125. W.morphTargets === !0) {
  50126. var j = y.morphTargets
  50127. , Y = this.morphTargetInfluences;
  50128. s.set(0, 0, 0),
  50129. l.set(0, 0, 0),
  50130. c.set(0, 0, 0);
  50131. for (var X = 0, Z = j.length; X < Z; X++) {
  50132. var q = Y[X];
  50133. if (0 !== q) {
  50134. var K = j[X].vertices;
  50135. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50136. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50137. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50138. }
  50139. }
  50140. s.add(L),
  50141. l.add(D),
  50142. c.add(N),
  50143. L = s,
  50144. D = l,
  50145. N = c
  50146. }
  50147. if (b = t(this, m, o, L, D, N, v)) {
  50148. if (E) {
  50149. var Q = E[H];
  50150. p.copy(Q[0]),
  50151. f.copy(Q[1]),
  50152. g.copy(Q[2]),
  50153. b.uv = e(v, L, D, N, p, f, g)
  50154. }
  50155. b.face = z,
  50156. b.faceIndex = H,
  50157. A.push(b)
  50158. }
  50159. }
  50160. }
  50161. }
  50162. }
  50163. }
  50164. }(),
  50165. n.Mesh.prototype.clone = function() {
  50166. return new this.constructor(this.geometry,this.material).copy(this)
  50167. }
  50168. ,
  50169. n.Bone = function(e) {
  50170. n.Object3D.call(this),
  50171. this.type = "Bone",
  50172. this.skin = e
  50173. }
  50174. ,
  50175. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50176. n.Bone.prototype.constructor = n.Bone,
  50177. n.Bone.prototype.copy = function(e) {
  50178. return n.Object3D.prototype.copy.call(this, e),
  50179. this.skin = e.skin,
  50180. this
  50181. }
  50182. ,
  50183. n.Skeleton = function(e, t, i) {
  50184. if (this.useVertexTexture = void 0 === i || i,
  50185. this.identityMatrix = new n.Matrix4,
  50186. e = e || [],
  50187. this.bones = e.slice(0),
  50188. this.useVertexTexture) {
  50189. var r = Math.sqrt(4 * this.bones.length);
  50190. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50191. r = Math.max(r, 4),
  50192. this.boneTextureWidth = r,
  50193. this.boneTextureHeight = r,
  50194. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50195. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50196. } else
  50197. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50198. if (void 0 === t)
  50199. this.calculateInverses();
  50200. else if (this.bones.length === t.length)
  50201. this.boneInverses = t.slice(0);
  50202. else {
  50203. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50204. this.boneInverses = [];
  50205. for (var o = 0, a = this.bones.length; o < a; o++)
  50206. this.boneInverses.push(new n.Matrix4)
  50207. }
  50208. }
  50209. ,
  50210. n.Skeleton.prototype.calculateInverses = function() {
  50211. this.boneInverses = [];
  50212. for (var e = 0, t = this.bones.length; e < t; e++) {
  50213. var i = new n.Matrix4;
  50214. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50215. this.boneInverses.push(i)
  50216. }
  50217. }
  50218. ,
  50219. n.Skeleton.prototype.pose = function() {
  50220. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50221. e = this.bones[t],
  50222. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50223. for (var t = 0, i = this.bones.length; t < i; t++)
  50224. e = this.bones[t],
  50225. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50226. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50227. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50228. }
  50229. ,
  50230. n.Skeleton.prototype.update = function() {
  50231. var e = new n.Matrix4;
  50232. return function() {
  50233. for (var t = 0, i = this.bones.length; t < i; t++) {
  50234. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50235. e.multiplyMatrices(n, this.boneInverses[t]),
  50236. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50237. }
  50238. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50239. }
  50240. }(),
  50241. n.Skeleton.prototype.clone = function() {
  50242. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50243. }
  50244. ,
  50245. n.SkinnedMesh = function(e, t, i) {
  50246. n.Mesh.call(this, e, t),
  50247. this.type = "SkinnedMesh",
  50248. this.bindMode = "attached",
  50249. this.bindMatrix = new n.Matrix4,
  50250. this.bindMatrixInverse = new n.Matrix4;
  50251. var r = [];
  50252. if (this.geometry && void 0 !== this.geometry.bones) {
  50253. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50254. a = this.geometry.bones[s],
  50255. o = new n.Bone(this),
  50256. r.push(o),
  50257. o.name = a.name,
  50258. o.position.fromArray(a.pos),
  50259. o.quaternion.fromArray(a.rotq),
  50260. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50261. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50262. a = this.geometry.bones[s],
  50263. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50264. }
  50265. this.normalizeSkinWeights(),
  50266. this.updateMatrixWorld(!0),
  50267. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50268. }
  50269. ,
  50270. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50271. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50272. n.SkinnedMesh.prototype.bind = function(e, t) {
  50273. this.skeleton = e,
  50274. void 0 === t && (this.updateMatrixWorld(!0),
  50275. this.skeleton.calculateInverses(),
  50276. t = this.matrixWorld),
  50277. this.bindMatrix.copy(t),
  50278. this.bindMatrixInverse.getInverse(t)
  50279. }
  50280. ,
  50281. n.SkinnedMesh.prototype.pose = function() {
  50282. this.skeleton.pose()
  50283. }
  50284. ,
  50285. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50286. if (this.geometry instanceof n.Geometry)
  50287. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50288. var t = this.geometry.skinWeights[e]
  50289. , i = 1 / t.lengthManhattan();
  50290. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50291. }
  50292. else if (this.geometry instanceof n.BufferGeometry)
  50293. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50294. r.x = o.getX(e),
  50295. r.y = o.getY(e),
  50296. r.z = o.getZ(e),
  50297. r.w = o.getW(e);
  50298. var i = 1 / r.lengthManhattan();
  50299. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50300. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50301. }
  50302. }
  50303. ,
  50304. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50305. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50306. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50307. }
  50308. ,
  50309. n.SkinnedMesh.prototype.clone = function() {
  50310. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50311. }
  50312. ,
  50313. n.LOD = function() {
  50314. n.Object3D.call(this),
  50315. this.type = "LOD",
  50316. Object.defineProperties(this, {
  50317. levels: {
  50318. enumerable: !0,
  50319. value: []
  50320. },
  50321. objects: {
  50322. get: function() {
  50323. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50324. this.levels
  50325. }
  50326. }
  50327. })
  50328. }
  50329. ,
  50330. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50331. n.LOD.prototype.constructor = n.LOD,
  50332. n.LOD.prototype.addLevel = function(e, t) {
  50333. void 0 === t && (t = 0),
  50334. t = Math.abs(t);
  50335. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50336. ;
  50337. i.splice(n, 0, {
  50338. distance: t,
  50339. object: e
  50340. }),
  50341. this.add(e)
  50342. }
  50343. ,
  50344. n.LOD.prototype.getObjectForDistance = function(e) {
  50345. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50346. ;
  50347. return t[i - 1].object
  50348. }
  50349. ,
  50350. n.LOD.prototype.raycast = function() {
  50351. var e = new n.Vector3;
  50352. return function(t, i) {
  50353. e.setFromMatrixPosition(this.matrixWorld);
  50354. var n = t.ray.origin.distanceTo(e);
  50355. this.getObjectForDistance(n).raycast(t, i)
  50356. }
  50357. }(),
  50358. n.LOD.prototype.update = function() {
  50359. var e = new n.Vector3
  50360. , t = new n.Vector3;
  50361. return function(i) {
  50362. var n = this.levels;
  50363. if (n.length > 1) {
  50364. e.setFromMatrixPosition(i.matrixWorld),
  50365. t.setFromMatrixPosition(this.matrixWorld);
  50366. var r = e.distanceTo(t);
  50367. n[0].object.visible = !0;
  50368. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50369. n[o - 1].object.visible = !1,
  50370. n[o].object.visible = !0;
  50371. for (; o < a; o++)
  50372. n[o].object.visible = !1
  50373. }
  50374. }
  50375. }(),
  50376. n.LOD.prototype.copy = function(e) {
  50377. n.Object3D.prototype.copy.call(this, e, !1);
  50378. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50379. var o = t[i];
  50380. this.addLevel(o.object.clone(), o.distance)
  50381. }
  50382. return this
  50383. }
  50384. ,
  50385. n.LOD.prototype.toJSON = function(e) {
  50386. var t = n.Object3D.prototype.toJSON.call(this, e);
  50387. t.object.levels = [];
  50388. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50389. var a = i[r];
  50390. t.object.levels.push({
  50391. object: a.object.uuid,
  50392. distance: a.distance
  50393. })
  50394. }
  50395. return t
  50396. }
  50397. ,
  50398. n.Sprite = function() {
  50399. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50400. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50401. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50402. , r = new n.BufferGeometry;
  50403. return r.setIndex(new n.BufferAttribute(e,1)),
  50404. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50405. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50406. function(e) {
  50407. n.Object3D.call(this),
  50408. this.type = "Sprite",
  50409. this.geometry = r,
  50410. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50411. }
  50412. }(),
  50413. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50414. n.Sprite.prototype.constructor = n.Sprite,
  50415. n.Sprite.prototype.raycast = function() {
  50416. var e = new n.Vector3;
  50417. return function(t, i) {
  50418. e.setFromMatrixPosition(this.matrixWorld);
  50419. var n = t.ray.distanceSqToPoint(e)
  50420. , r = this.scale.x * this.scale.y;
  50421. n > r || i.push({
  50422. distance: Math.sqrt(n),
  50423. point: this.position,
  50424. face: null,
  50425. object: this
  50426. })
  50427. }
  50428. }(),
  50429. n.Sprite.prototype.clone = function() {
  50430. return new this.constructor(this.material).copy(this)
  50431. }
  50432. ,
  50433. n.Particle = n.Sprite,
  50434. n.LensFlare = function(e, t, i, r, o) {
  50435. n.Object3D.call(this),
  50436. this.lensFlares = [],
  50437. this.positionScreen = new n.Vector3,
  50438. this.customUpdateCallback = void 0,
  50439. void 0 !== e && this.add(e, t, i, r, o)
  50440. }
  50441. ,
  50442. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50443. n.LensFlare.prototype.constructor = n.LensFlare,
  50444. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50445. void 0 === t && (t = -1),
  50446. void 0 === i && (i = 0),
  50447. void 0 === a && (a = 1),
  50448. void 0 === o && (o = new n.Color(16777215)),
  50449. void 0 === r && (r = n.NormalBlending),
  50450. i = Math.min(i, Math.max(0, i)),
  50451. this.lensFlares.push({
  50452. texture: e,
  50453. size: t,
  50454. distance: i,
  50455. x: 0,
  50456. y: 0,
  50457. z: 0,
  50458. scale: 1,
  50459. rotation: 0,
  50460. opacity: a,
  50461. color: o,
  50462. blending: r
  50463. })
  50464. }
  50465. ,
  50466. n.LensFlare.prototype.updateLensFlares = function() {
  50467. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50468. for (e = 0; e < i; e++)
  50469. t = this.lensFlares[e],
  50470. t.x = this.positionScreen.x + n * t.distance,
  50471. t.y = this.positionScreen.y + r * t.distance,
  50472. t.wantedRotation = t.x * Math.PI * .25,
  50473. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50474. }
  50475. ,
  50476. n.LensFlare.prototype.copy = function(e) {
  50477. n.Object3D.prototype.copy.call(this, e),
  50478. this.positionScreen.copy(e.positionScreen),
  50479. this.customUpdateCallback = e.customUpdateCallback;
  50480. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50481. this.lensFlares.push(e.lensFlares[t]);
  50482. return this
  50483. }
  50484. ,
  50485. n.Scene = function() {
  50486. n.Object3D.call(this),
  50487. this.type = "Scene",
  50488. this.fog = null,
  50489. this.overrideMaterial = null,
  50490. this.autoUpdate = !0
  50491. }
  50492. ,
  50493. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50494. n.Scene.prototype.constructor = n.Scene,
  50495. n.Scene.prototype.copy = function(e, t) {
  50496. return n.Object3D.prototype.copy.call(this, e, t),
  50497. null !== e.fog && (this.fog = e.fog.clone()),
  50498. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50499. this.autoUpdate = e.autoUpdate,
  50500. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50501. this
  50502. }
  50503. ,
  50504. n.Fog = function(e, t, i) {
  50505. this.name = "",
  50506. this.color = new n.Color(e),
  50507. this.near = void 0 !== t ? t : 1,
  50508. this.far = void 0 !== i ? i : 1e3
  50509. }
  50510. ,
  50511. n.Fog.prototype.clone = function() {
  50512. return new n.Fog(this.color.getHex(),this.near,this.far)
  50513. }
  50514. ,
  50515. n.FogExp2 = function(e, t) {
  50516. this.name = "",
  50517. this.color = new n.Color(e),
  50518. this.density = void 0 !== t ? t : 25e-5
  50519. }
  50520. ,
  50521. n.FogExp2.prototype.clone = function() {
  50522. return new n.FogExp2(this.color.getHex(),this.density)
  50523. }
  50524. ,
  50525. n.ShaderChunk = {},
  50526. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50527. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50528. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50529. n.ShaderChunk.aomap_fragment = "#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",
  50530. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50531. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50532. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50533. n.ShaderChunk.bsdfs = "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",
  50534. n.ShaderChunk.bumpmap_pars_fragment = "#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",
  50535. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50536. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50537. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50538. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50539. n.ShaderChunk.common = "#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",
  50540. n.ShaderChunk.cube_uv_reflection_fragment = "#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",
  50541. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50542. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50543. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50544. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  50545. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50546. n.ShaderChunk.encodings_pars_fragment = "\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",
  50547. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50548. n.ShaderChunk.envmap_fragment = "#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",
  50549. n.ShaderChunk.envmap_pars_fragment = "#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",
  50550. n.ShaderChunk.envmap_pars_vertex = "#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",
  50551. n.ShaderChunk.envmap_vertex = "#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",
  50552. n.ShaderChunk.fog_fragment = "#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",
  50553. n.ShaderChunk.fog_pars_fragment = "#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",
  50554. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50555. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50556. n.ShaderChunk.lights_lambert_vertex = "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",
  50557. n.ShaderChunk.lights_pars = "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",
  50558. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50559. n.ShaderChunk.lights_phong_pars_fragment = "#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",
  50560. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50561. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50562. n.ShaderChunk.lights_standard_fragment = "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",
  50563. n.ShaderChunk.lights_standard_pars_fragment = "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",
  50564. n.ShaderChunk.lights_template = "\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",
  50565. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50566. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  50567. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  50568. n.ShaderChunk.logdepthbuf_vertex = "#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",
  50569. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50570. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50571. n.ShaderChunk.map_particle_fragment = "#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",
  50572. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50573. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50574. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50575. n.ShaderChunk.morphnormal_vertex = "#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",
  50576. n.ShaderChunk.morphtarget_pars_vertex = "#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";
  50577. n.ShaderChunk.morphtarget_vertex = "#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";
  50578. n.ShaderChunk.normal_fragment = "#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",
  50579. n.ShaderChunk.normalmap_pars_fragment = "#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",
  50580. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50581. n.ShaderChunk.project_vertex = "#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",
  50582. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50583. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50584. n.ShaderChunk.shadowmap_pars_fragment = "#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",
  50585. n.ShaderChunk.shadowmap_pars_vertex = "#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",
  50586. n.ShaderChunk.shadowmap_vertex = "#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",
  50587. n.ShaderChunk.shadowmask_pars_fragment = "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",
  50588. n.ShaderChunk.skinbase_vertex = "#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",
  50589. n.ShaderChunk.skinning_pars_vertex = "#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",
  50590. n.ShaderChunk.skinning_vertex = "#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",
  50591. n.ShaderChunk.skinnormal_vertex = "#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",
  50592. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  50593. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50594. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50595. n.ShaderChunk.tonemapping_pars_fragment = "#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",
  50596. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50597. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50598. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50599. n.ShaderChunk.uv_pars_fragment = "#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",
  50600. n.ShaderChunk.uv_pars_vertex = "#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",
  50601. n.ShaderChunk.uv_vertex = "#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",
  50602. n.ShaderChunk.worldpos_vertex = "#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",
  50603. n.UniformsUtils = {
  50604. merge: function(e) {
  50605. for (var t = {}, i = 0; i < e.length; i++) {
  50606. var n = this.clone(e[i]);
  50607. for (var r in n)
  50608. t[r] = n[r]
  50609. }
  50610. return t
  50611. },
  50612. clone: function(e) {
  50613. var t = {};
  50614. for (var i in e) {
  50615. t[i] = {};
  50616. for (var r in e[i]) {
  50617. var o = e[i][r];
  50618. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  50619. }
  50620. }
  50621. return t
  50622. }
  50623. },
  50624. n.UniformsLib = {
  50625. common: {
  50626. diffuse: {
  50627. type: "c",
  50628. value: new n.Color(15658734)
  50629. },
  50630. opacity: {
  50631. type: "f",
  50632. value: 1
  50633. },
  50634. map: {
  50635. type: "t",
  50636. value: null
  50637. },
  50638. offsetRepeat: {
  50639. type: "v4",
  50640. value: new n.Vector4(0,0,1,1)
  50641. },
  50642. specularMap: {
  50643. type: "t",
  50644. value: null
  50645. },
  50646. alphaMap: {
  50647. type: "t",
  50648. value: null
  50649. },
  50650. envMap: {
  50651. type: "t",
  50652. value: null
  50653. },
  50654. flipEnvMap: {
  50655. type: "f",
  50656. value: -1
  50657. },
  50658. reflectivity: {
  50659. type: "f",
  50660. value: 1
  50661. },
  50662. refractionRatio: {
  50663. type: "f",
  50664. value: .98
  50665. }
  50666. },
  50667. aomap: {
  50668. aoMap: {
  50669. type: "t",
  50670. value: null
  50671. },
  50672. aoMapIntensity: {
  50673. type: "f",
  50674. value: 1
  50675. }
  50676. },
  50677. lightmap: {
  50678. lightMap: {
  50679. type: "t",
  50680. value: null
  50681. },
  50682. lightMapIntensity: {
  50683. type: "f",
  50684. value: 1
  50685. }
  50686. },
  50687. emissivemap: {
  50688. emissiveMap: {
  50689. type: "t",
  50690. value: null
  50691. }
  50692. },
  50693. bumpmap: {
  50694. bumpMap: {
  50695. type: "t",
  50696. value: null
  50697. },
  50698. bumpScale: {
  50699. type: "f",
  50700. value: 1
  50701. }
  50702. },
  50703. normalmap: {
  50704. normalMap: {
  50705. type: "t",
  50706. value: null
  50707. },
  50708. normalScale: {
  50709. type: "v2",
  50710. value: new n.Vector2(1,1)
  50711. }
  50712. },
  50713. displacementmap: {
  50714. displacementMap: {
  50715. type: "t",
  50716. value: null
  50717. },
  50718. displacementScale: {
  50719. type: "f",
  50720. value: 1
  50721. },
  50722. displacementBias: {
  50723. type: "f",
  50724. value: 0
  50725. }
  50726. },
  50727. roughnessmap: {
  50728. roughnessMap: {
  50729. type: "t",
  50730. value: null
  50731. }
  50732. },
  50733. metalnessmap: {
  50734. metalnessMap: {
  50735. type: "t",
  50736. value: null
  50737. }
  50738. },
  50739. fog: {
  50740. fogDensity: {
  50741. type: "f",
  50742. value: 25e-5
  50743. },
  50744. fogNear: {
  50745. type: "f",
  50746. value: 1
  50747. },
  50748. fogFar: {
  50749. type: "f",
  50750. value: 2e3
  50751. },
  50752. fogColor: {
  50753. type: "c",
  50754. value: new n.Color(16777215)
  50755. }
  50756. },
  50757. lights: {
  50758. ambientLightColor: {
  50759. type: "fv",
  50760. value: []
  50761. },
  50762. directionalLights: {
  50763. type: "sa",
  50764. value: [],
  50765. properties: {
  50766. direction: {
  50767. type: "v3"
  50768. },
  50769. color: {
  50770. type: "c"
  50771. },
  50772. shadow: {
  50773. type: "i"
  50774. },
  50775. shadowBias: {
  50776. type: "f"
  50777. },
  50778. shadowRadius: {
  50779. type: "f"
  50780. },
  50781. shadowMapSize: {
  50782. type: "v2"
  50783. }
  50784. }
  50785. },
  50786. directionalShadowMap: {
  50787. type: "tv",
  50788. value: []
  50789. },
  50790. directionalShadowMatrix: {
  50791. type: "m4v",
  50792. value: []
  50793. },
  50794. spotLights: {
  50795. type: "sa",
  50796. value: [],
  50797. properties: {
  50798. color: {
  50799. type: "c"
  50800. },
  50801. position: {
  50802. type: "v3"
  50803. },
  50804. direction: {
  50805. type: "v3"
  50806. },
  50807. distance: {
  50808. type: "f"
  50809. },
  50810. coneCos: {
  50811. type: "f"
  50812. },
  50813. penumbraCos: {
  50814. type: "f"
  50815. },
  50816. decay: {
  50817. type: "f"
  50818. },
  50819. shadow: {
  50820. type: "i"
  50821. },
  50822. shadowBias: {
  50823. type: "f"
  50824. },
  50825. shadowRadius: {
  50826. type: "f"
  50827. },
  50828. shadowMapSize: {
  50829. type: "v2"
  50830. }
  50831. }
  50832. },
  50833. spotShadowMap: {
  50834. type: "tv",
  50835. value: []
  50836. },
  50837. spotShadowMatrix: {
  50838. type: "m4v",
  50839. value: []
  50840. },
  50841. pointLights: {
  50842. type: "sa",
  50843. value: [],
  50844. properties: {
  50845. color: {
  50846. type: "c"
  50847. },
  50848. position: {
  50849. type: "v3"
  50850. },
  50851. decay: {
  50852. type: "f"
  50853. },
  50854. distance: {
  50855. type: "f"
  50856. },
  50857. shadow: {
  50858. type: "i"
  50859. },
  50860. shadowBias: {
  50861. type: "f"
  50862. },
  50863. shadowRadius: {
  50864. type: "f"
  50865. },
  50866. shadowMapSize: {
  50867. type: "v2"
  50868. }
  50869. }
  50870. },
  50871. pointShadowMap: {
  50872. type: "tv",
  50873. value: []
  50874. },
  50875. pointShadowMatrix: {
  50876. type: "m4v",
  50877. value: []
  50878. },
  50879. hemisphereLights: {
  50880. type: "sa",
  50881. value: [],
  50882. properties: {
  50883. direction: {
  50884. type: "v3"
  50885. },
  50886. skyColor: {
  50887. type: "c"
  50888. },
  50889. groundColor: {
  50890. type: "c"
  50891. }
  50892. }
  50893. }
  50894. },
  50895. points: {
  50896. diffuse: {
  50897. type: "c",
  50898. value: new n.Color(15658734)
  50899. },
  50900. opacity: {
  50901. type: "f",
  50902. value: 1
  50903. },
  50904. size: {
  50905. type: "f",
  50906. value: 1
  50907. },
  50908. scale: {
  50909. type: "f",
  50910. value: 1
  50911. },
  50912. map: {
  50913. type: "t",
  50914. value: null
  50915. },
  50916. offsetRepeat: {
  50917. type: "v4",
  50918. value: new n.Vector4(0,0,1,1)
  50919. }
  50920. }
  50921. },
  50922. n.ShaderChunk.cube_frag = "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",
  50923. n.ShaderChunk.cube_vert = "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",
  50924. n.ShaderChunk.depth_frag = "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",
  50925. n.ShaderChunk.depth_vert = "#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",
  50926. n.ShaderChunk.depthRGBA_frag = "#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",
  50927. n.ShaderChunk.depthRGBA_vert = "#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",
  50928. n.ShaderChunk.distanceRGBA_frag = "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",
  50929. n.ShaderChunk.distanceRGBA_vert = "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",
  50930. n.ShaderChunk.equirect_frag = "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",
  50931. n.ShaderChunk.equirect_vert = "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",
  50932. n.ShaderChunk.linedashed_frag = "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",
  50933. n.ShaderChunk.linedashed_vert = "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",
  50934. n.ShaderChunk.meshbasic_frag = "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",
  50935. n.ShaderChunk.meshbasic_vert = "#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",
  50936. n.ShaderChunk.meshlambert_frag = "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",
  50937. n.ShaderChunk.meshlambert_vert = "#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",
  50938. n.ShaderChunk.meshphong_frag = "#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",
  50939. n.ShaderChunk.meshphong_vert = "#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",
  50940. n.ShaderChunk.meshstandard_frag = "#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",
  50941. n.ShaderChunk.meshstandard_vert = "#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",
  50942. n.ShaderChunk.normal_frag = "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",
  50943. n.ShaderChunk.normal_vert = "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",
  50944. n.ShaderChunk.points_frag = "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",
  50945. n.ShaderChunk.points_vert = "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",
  50946. n.ShaderLib = {
  50947. basic: {
  50948. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50949. vertexShader: n.ShaderChunk.meshbasic_vert,
  50950. fragmentShader: n.ShaderChunk.meshbasic_frag
  50951. },
  50952. lambert: {
  50953. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50954. emissive: {
  50955. type: "c",
  50956. value: new n.Color(0)
  50957. }
  50958. }]),
  50959. vertexShader: n.ShaderChunk.meshlambert_vert,
  50960. fragmentShader: n.ShaderChunk.meshlambert_frag
  50961. },
  50962. phong: {
  50963. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50964. emissive: {
  50965. type: "c",
  50966. value: new n.Color(0)
  50967. },
  50968. specular: {
  50969. type: "c",
  50970. value: new n.Color(1118481)
  50971. },
  50972. shininess: {
  50973. type: "f",
  50974. value: 30
  50975. }
  50976. }]),
  50977. vertexShader: n.ShaderChunk.meshphong_vert,
  50978. fragmentShader: n.ShaderChunk.meshphong_frag
  50979. },
  50980. standard: {
  50981. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50982. emissive: {
  50983. type: "c",
  50984. value: new n.Color(0)
  50985. },
  50986. roughness: {
  50987. type: "f",
  50988. value: .5
  50989. },
  50990. metalness: {
  50991. type: "f",
  50992. value: 0
  50993. },
  50994. envMapIntensity: {
  50995. type: "f",
  50996. value: 1
  50997. }
  50998. }]),
  50999. vertexShader: n.ShaderChunk.meshstandard_vert,
  51000. fragmentShader: n.ShaderChunk.meshstandard_frag
  51001. },
  51002. points: {
  51003. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51004. vertexShader: n.ShaderChunk.points_vert,
  51005. fragmentShader: n.ShaderChunk.points_frag
  51006. },
  51007. dashed: {
  51008. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51009. scale: {
  51010. type: "f",
  51011. value: 1
  51012. },
  51013. dashSize: {
  51014. type: "f",
  51015. value: 1
  51016. },
  51017. totalSize: {
  51018. type: "f",
  51019. value: 2
  51020. }
  51021. }]),
  51022. vertexShader: n.ShaderChunk.linedashed_vert,
  51023. fragmentShader: n.ShaderChunk.linedashed_frag
  51024. },
  51025. depth: {
  51026. uniforms: {
  51027. mNear: {
  51028. type: "f",
  51029. value: 1
  51030. },
  51031. mFar: {
  51032. type: "f",
  51033. value: 2e3
  51034. },
  51035. opacity: {
  51036. type: "f",
  51037. value: 1
  51038. }
  51039. },
  51040. vertexShader: n.ShaderChunk.depth_vert,
  51041. fragmentShader: n.ShaderChunk.depth_frag
  51042. },
  51043. normal: {
  51044. uniforms: {
  51045. opacity: {
  51046. type: "f",
  51047. value: 1
  51048. }
  51049. },
  51050. vertexShader: n.ShaderChunk.normal_vert,
  51051. fragmentShader: n.ShaderChunk.normal_frag
  51052. },
  51053. cube: {
  51054. uniforms: {
  51055. tCube: {
  51056. type: "t",
  51057. value: null
  51058. },
  51059. tFlip: {
  51060. type: "f",
  51061. value: -1
  51062. }
  51063. },
  51064. vertexShader: n.ShaderChunk.cube_vert,
  51065. fragmentShader: n.ShaderChunk.cube_frag
  51066. },
  51067. equirect: {
  51068. uniforms: {
  51069. tEquirect: {
  51070. type: "t",
  51071. value: null
  51072. },
  51073. tFlip: {
  51074. type: "f",
  51075. value: -1
  51076. }
  51077. },
  51078. vertexShader: n.ShaderChunk.equirect_vert,
  51079. fragmentShader: n.ShaderChunk.equirect_frag
  51080. },
  51081. depthRGBA: {
  51082. uniforms: {},
  51083. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51084. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51085. },
  51086. distanceRGBA: {
  51087. uniforms: {
  51088. lightPos: {
  51089. type: "v3",
  51090. value: new n.Vector3(0,0,0)
  51091. }
  51092. },
  51093. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51094. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51095. }
  51096. },
  51097. n.WebGLRenderer = function(e) {
  51098. function t() {
  51099. return null === ye ? Oe : 1
  51100. }
  51101. function i(e, t, i, n) {
  51102. se === !0 && (e *= n,
  51103. t *= n,
  51104. i *= n),
  51105. Ye.clearColor(e, t, i, n)
  51106. }
  51107. function r() {
  51108. Ye.init(),
  51109. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51110. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51111. i(Se.r, Se.g, Se.b, Me)
  51112. }
  51113. function o() {
  51114. Ae = null,
  51115. be = null,
  51116. Ee = "",
  51117. Ie = -1,
  51118. Ye.reset()
  51119. }
  51120. function a(e) {
  51121. e.preventDefault(),
  51122. o(),
  51123. r(),
  51124. Xe.clear()
  51125. }
  51126. function s(e) {
  51127. var t = e.target;
  51128. t.removeEventListener("dispose", s),
  51129. h(t),
  51130. ke.textures--
  51131. }
  51132. function l(e) {
  51133. var t = e.target;
  51134. t.removeEventListener("dispose", l),
  51135. u(t),
  51136. ke.textures--
  51137. }
  51138. function c(e) {
  51139. var t = e.target;
  51140. t.removeEventListener("dispose", c),
  51141. d(t)
  51142. }
  51143. function h(e) {
  51144. var t = Xe.get(e);
  51145. if (e.image && t.__image__webglTextureCube)
  51146. Ge.deleteTexture(t.__image__webglTextureCube);
  51147. else {
  51148. if (void 0 === t.__webglInit)
  51149. return;
  51150. Ge.deleteTexture(t.__webglTexture)
  51151. }
  51152. Xe.delete(e)
  51153. }
  51154. function u(e) {
  51155. var t = Xe.get(e)
  51156. , i = Xe.get(e.texture);
  51157. if (e && void 0 !== i.__webglTexture) {
  51158. if (Ge.deleteTexture(i.__webglTexture),
  51159. e instanceof n.WebGLRenderTargetCube)
  51160. for (var r = 0; r < 6; r++)
  51161. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51162. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51163. else
  51164. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51165. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51166. Xe.delete(e.texture),
  51167. Xe.delete(e)
  51168. }
  51169. }
  51170. function d(e) {
  51171. p(e),
  51172. Xe.delete(e)
  51173. }
  51174. function p(e) {
  51175. var t = Xe.get(e).program;
  51176. e.program = void 0,
  51177. void 0 !== t && qe.releaseProgram(t)
  51178. }
  51179. function f(e, t, i, r) {
  51180. var o;
  51181. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51182. null === o))
  51183. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51184. void 0 === r && (r = 0),
  51185. Ye.initAttributes();
  51186. var a = i.attributes
  51187. , s = t.getAttributes()
  51188. , l = e.defaultAttributeValues;
  51189. for (var c in s) {
  51190. var h = s[c];
  51191. if (h >= 0) {
  51192. var u = a[c];
  51193. if (void 0 !== u) {
  51194. var d = u.itemSize
  51195. , p = Ze.getAttributeBuffer(u);
  51196. if (u instanceof n.InterleavedBufferAttribute) {
  51197. var f = u.data
  51198. , g = f.stride
  51199. , m = u.offset;
  51200. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51201. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51202. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51203. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51204. } else
  51205. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51206. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51207. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51208. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51209. } else if (void 0 !== l) {
  51210. var v = l[c];
  51211. if (void 0 !== v)
  51212. switch (v.length) {
  51213. case 2:
  51214. Ge.vertexAttrib2fv(h, v);
  51215. break;
  51216. case 3:
  51217. Ge.vertexAttrib3fv(h, v);
  51218. break;
  51219. case 4:
  51220. Ge.vertexAttrib4fv(h, v);
  51221. break;
  51222. default:
  51223. Ge.vertexAttrib1fv(h, v)
  51224. }
  51225. }
  51226. }
  51227. }
  51228. Ye.disableUnusedAttributes()
  51229. }
  51230. function g(e, t) {
  51231. return Math.abs(t[0]) - Math.abs(e[0])
  51232. }
  51233. function m(e, t) {
  51234. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
  51235. }
  51236. function v(e, t) {
  51237. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  51238. }
  51239. function A(e, t, i, n, r) {
  51240. var o, a;
  51241. i.transparent ? (o = de,
  51242. a = ++pe) : (o = he,
  51243. a = ++ue);
  51244. var s = o[a];
  51245. void 0 !== s ? (s.id = e.id,
  51246. s.object = e,
  51247. s.geometry = t,
  51248. s.material = i,
  51249. s.z = Ve.z,
  51250. s.group = r) : (s = {
  51251. id: e.id,
  51252. object: e,
  51253. geometry: t,
  51254. material: i,
  51255. z: Ve.z,
  51256. group: r
  51257. },
  51258. o.push(s))
  51259. }
  51260. function y(e, t) {
  51261. if (e.visible !== !1) {
  51262. if (e.layers.test(t.layers))
  51263. if (e instanceof n.Light)
  51264. ce.push(e);
  51265. else if (e instanceof n.Sprite)
  51266. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51267. else if (e instanceof n.LensFlare)
  51268. me.push(e);
  51269. else if (e instanceof n.ImmediateRenderObject)
  51270. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51271. Ve.applyProjection(Fe)),
  51272. A(e, null, e.material, Ve.z, null);
  51273. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51274. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51275. var i = e.material;
  51276. if (i.visible === !0) {
  51277. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51278. Ve.applyProjection(Fe));
  51279. var r = Ze.update(e);
  51280. if (i instanceof n.MultiMaterial)
  51281. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51282. var c = o[s]
  51283. , h = a[c.materialIndex];
  51284. h.visible === !0 && A(e, r, h, Ve.z, c)
  51285. }
  51286. else
  51287. A(e, r, i, Ve.z, null)
  51288. }
  51289. }
  51290. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51291. y(u[s], t)
  51292. }
  51293. }
  51294. function C(e, t, i, r) {
  51295. for (var o = 0, a = e.length; o < a; o++) {
  51296. var s = e[o]
  51297. , l = s.object
  51298. , c = s.geometry
  51299. , h = void 0 === r ? s.material : r
  51300. , u = s.group;
  51301. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51302. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51303. l instanceof n.ImmediateRenderObject) {
  51304. E(h);
  51305. var d = w(t, i, h, l);
  51306. Ee = "",
  51307. l.render(function(e) {
  51308. ve.renderBufferImmediate(e, d, h)
  51309. })
  51310. } else
  51311. ve.renderBufferDirect(t, i, c, h, l, u)
  51312. }
  51313. }
  51314. function I(e, t, i) {
  51315. var r = Xe.get(e)
  51316. , o = qe.getParameters(e, Ue, t, i)
  51317. , a = qe.getProgramCode(e, o)
  51318. , s = r.program
  51319. , l = !0;
  51320. if (void 0 === s)
  51321. e.addEventListener("dispose", c);
  51322. else if (s.code !== a)
  51323. p(e);
  51324. else {
  51325. if (void 0 !== o.shaderID)
  51326. return;
  51327. l = !1
  51328. }
  51329. if (l) {
  51330. if (o.shaderID) {
  51331. var h = n.ShaderLib[o.shaderID];
  51332. r.__webglShader = {
  51333. name: e.type,
  51334. uniforms: n.UniformsUtils.clone(h.uniforms),
  51335. vertexShader: h.vertexShader,
  51336. fragmentShader: h.fragmentShader
  51337. }
  51338. } else
  51339. r.__webglShader = {
  51340. name: e.type,
  51341. uniforms: e.uniforms,
  51342. vertexShader: e.vertexShader,
  51343. fragmentShader: e.fragmentShader
  51344. };
  51345. e.__webglShader = r.__webglShader,
  51346. s = qe.acquireProgram(e, o, a),
  51347. r.program = s,
  51348. e.program = s
  51349. }
  51350. var u = s.getAttributes();
  51351. if (e.morphTargets) {
  51352. e.numSupportedMorphTargets = 0;
  51353. for (var d = 0; d < ve.maxMorphTargets; d++)
  51354. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51355. }
  51356. if (e.morphNormals) {
  51357. e.numSupportedMorphNormals = 0;
  51358. for (var d = 0; d < ve.maxMorphNormals; d++)
  51359. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51360. }
  51361. r.uniformsList = [];
  51362. var f = r.__webglShader.uniforms
  51363. , g = r.program.getUniforms();
  51364. for (var m in f) {
  51365. var v = g[m];
  51366. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51367. }
  51368. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51369. f.ambientLightColor.value = Ue.ambient,
  51370. f.directionalLights.value = Ue.directional,
  51371. f.spotLights.value = Ue.spot,
  51372. f.pointLights.value = Ue.point,
  51373. f.hemisphereLights.value = Ue.hemi,
  51374. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51375. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51376. f.spotShadowMap.value = Ue.spotShadowMap,
  51377. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51378. f.pointShadowMap.value = Ue.pointShadowMap,
  51379. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51380. r.hasDynamicUniforms = !1;
  51381. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51382. var C = r.uniformsList[A][0];
  51383. if (C.dynamic === !0) {
  51384. r.hasDynamicUniforms = !0;
  51385. break
  51386. }
  51387. }
  51388. }
  51389. function E(e) {
  51390. b(e),
  51391. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  51392. Ye.setDepthFunc(e.depthFunc),
  51393. Ye.setDepthTest(e.depthTest),
  51394. Ye.setDepthWrite(e.depthWrite),
  51395. Ye.setColorWrite(e.colorWrite),
  51396. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51397. }
  51398. function b(e) {
  51399. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51400. Ye.setFlipSided(e.side === n.BackSide)
  51401. }
  51402. function w(e, t, i, r) {
  51403. xe = 0;
  51404. var o = Xe.get(i);
  51405. void 0 === o.program && (i.needsUpdate = !0),
  51406. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51407. i.needsUpdate && (I(i, t, r),
  51408. i.needsUpdate = !1);
  51409. var a = !1
  51410. , s = !1
  51411. , l = !1
  51412. , c = o.program
  51413. , h = c.getUniforms()
  51414. , u = o.__webglShader.uniforms;
  51415. if (c.id !== Ae && (Ge.useProgram(c.program),
  51416. Ae = c.id,
  51417. a = !0,
  51418. s = !0,
  51419. l = !0),
  51420. i.id !== Ie && (Ie = i.id,
  51421. s = !0),
  51422. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51423. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51424. e !== be && (be = e,
  51425. s = !0,
  51426. l = !0),
  51427. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51428. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51429. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  51430. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51431. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51432. i.skinning)
  51433. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51434. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51435. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51436. if (void 0 !== h.boneTexture) {
  51437. var d = B();
  51438. Ge.uniform1i(h.boneTexture, d),
  51439. ve.setTexture(r.skeleton.boneTexture, d)
  51440. }
  51441. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51442. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51443. } else
  51444. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51445. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51446. t && i.fog && R(u, t),
  51447. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51448. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51449. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  51450. u.mFar.value = e.far,
  51451. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51452. V(o.uniformsList)),
  51453. N(h, r),
  51454. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51455. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51456. c
  51457. }
  51458. function _(e, t, i) {
  51459. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51460. var a = e[r][0]
  51461. , s = a.onUpdateCallback;
  51462. void 0 !== s && (s.bind(a)(t, i),
  51463. n.push(e[r]))
  51464. }
  51465. V(n)
  51466. }
  51467. function T(e, t) {
  51468. e.opacity.value = t.opacity,
  51469. e.diffuse.value = t.color,
  51470. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51471. e.map.value = t.map,
  51472. e.specularMap.value = t.specularMap,
  51473. e.alphaMap.value = t.alphaMap,
  51474. t.aoMap && (e.aoMap.value = t.aoMap,
  51475. e.aoMapIntensity.value = t.aoMapIntensity);
  51476. var i;
  51477. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  51478. void 0 !== i) {
  51479. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51480. var r = i.offset
  51481. , o = i.repeat;
  51482. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51483. }
  51484. e.envMap.value = t.envMap,
  51485. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51486. e.reflectivity.value = t.reflectivity,
  51487. e.refractionRatio.value = t.refractionRatio
  51488. }
  51489. function x(e, t) {
  51490. e.diffuse.value = t.color,
  51491. e.opacity.value = t.opacity
  51492. }
  51493. function S(e, t) {
  51494. e.dashSize.value = t.dashSize,
  51495. e.totalSize.value = t.dashSize + t.gapSize,
  51496. e.scale.value = t.scale
  51497. }
  51498. function M(e, t) {
  51499. if (e.diffuse.value = t.color,
  51500. e.opacity.value = t.opacity,
  51501. e.size.value = t.size * Oe,
  51502. e.scale.value = te.clientHeight / 2,
  51503. e.map.value = t.map,
  51504. null !== t.map) {
  51505. var i = t.map.offset
  51506. , n = t.map.repeat;
  51507. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51508. }
  51509. }
  51510. function R(e, t) {
  51511. e.fogColor.value = t.color,
  51512. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51513. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51514. }
  51515. function P(e, t) {
  51516. t.lightMap && (e.lightMap.value = t.lightMap,
  51517. e.lightMapIntensity.value = t.lightMapIntensity),
  51518. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51519. }
  51520. function O(e, t) {
  51521. e.specular.value = t.specular,
  51522. e.shininess.value = Math.max(t.shininess, 1e-4),
  51523. t.lightMap && (e.lightMap.value = t.lightMap,
  51524. e.lightMapIntensity.value = t.lightMapIntensity),
  51525. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51526. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51527. e.bumpScale.value = t.bumpScale),
  51528. t.normalMap && (e.normalMap.value = t.normalMap,
  51529. e.normalScale.value.copy(t.normalScale)),
  51530. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51531. e.displacementScale.value = t.displacementScale,
  51532. e.displacementBias.value = t.displacementBias)
  51533. }
  51534. function L(e, t) {
  51535. e.roughness.value = t.roughness,
  51536. e.metalness.value = t.metalness,
  51537. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51538. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51539. t.lightMap && (e.lightMap.value = t.lightMap,
  51540. e.lightMapIntensity.value = t.lightMapIntensity),
  51541. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51542. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51543. e.bumpScale.value = t.bumpScale),
  51544. t.normalMap && (e.normalMap.value = t.normalMap,
  51545. e.normalScale.value.copy(t.normalScale)),
  51546. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51547. e.displacementScale.value = t.displacementScale,
  51548. e.displacementBias.value = t.displacementBias),
  51549. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51550. }
  51551. function D(e, t) {
  51552. e.ambientLightColor.needsUpdate = t,
  51553. e.directionalLights.needsUpdate = t,
  51554. e.pointLights.needsUpdate = t,
  51555. e.spotLights.needsUpdate = t,
  51556. e.hemisphereLights.needsUpdate = t
  51557. }
  51558. function N(e, t) {
  51559. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51560. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51561. }
  51562. function B() {
  51563. var e = xe;
  51564. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51565. xe += 1,
  51566. e
  51567. }
  51568. function F(e, t, i, r) {
  51569. var o, a;
  51570. if ("1i" === t)
  51571. Ge.uniform1i(i, r);
  51572. else if ("1f" === t)
  51573. Ge.uniform1f(i, r);
  51574. else if ("2f" === t)
  51575. Ge.uniform2f(i, r[0], r[1]);
  51576. else if ("3f" === t)
  51577. Ge.uniform3f(i, r[0], r[1], r[2]);
  51578. else if ("4f" === t)
  51579. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51580. else if ("1iv" === t)
  51581. Ge.uniform1iv(i, r);
  51582. else if ("3iv" === t)
  51583. Ge.uniform3iv(i, r);
  51584. else if ("1fv" === t)
  51585. Ge.uniform1fv(i, r);
  51586. else if ("2fv" === t)
  51587. Ge.uniform2fv(i, r);
  51588. else if ("3fv" === t)
  51589. Ge.uniform3fv(i, r);
  51590. else if ("4fv" === t)
  51591. Ge.uniform4fv(i, r);
  51592. else if ("Matrix2fv" === t)
  51593. Ge.uniformMatrix2fv(i, !1, r);
  51594. else if ("Matrix3fv" === t)
  51595. Ge.uniformMatrix3fv(i, !1, r);
  51596. else if ("Matrix4fv" === t)
  51597. Ge.uniformMatrix4fv(i, !1, r);
  51598. else if ("i" === t)
  51599. Ge.uniform1i(i, r);
  51600. else if ("f" === t)
  51601. Ge.uniform1f(i, r);
  51602. else if ("v2" === t)
  51603. Ge.uniform2f(i, r.x, r.y);
  51604. else if ("v3" === t)
  51605. Ge.uniform3f(i, r.x, r.y, r.z);
  51606. else if ("v4" === t)
  51607. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51608. else if ("c" === t)
  51609. Ge.uniform3f(i, r.r, r.g, r.b);
  51610. else if ("s" === t) {
  51611. var s = e.properties;
  51612. for (var l in s) {
  51613. var c = s[l]
  51614. , h = i[l]
  51615. , u = r[l];
  51616. F(c, c.type, h, u)
  51617. }
  51618. } else if ("sa" === t)
  51619. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51620. for (var l in s) {
  51621. var c = s[l]
  51622. , h = i[d][l]
  51623. , u = r[d][l];
  51624. F(c, c.type, h, u)
  51625. }
  51626. else if ("iv1" === t)
  51627. Ge.uniform1iv(i, r);
  51628. else if ("iv" === t)
  51629. Ge.uniform3iv(i, r);
  51630. else if ("fv1" === t)
  51631. Ge.uniform1fv(i, r);
  51632. else if ("fv" === t)
  51633. Ge.uniform3fv(i, r);
  51634. else if ("v2v" === t) {
  51635. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51636. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51637. f += 2)
  51638. e._array[f + 0] = r[d].x,
  51639. e._array[f + 1] = r[d].y;
  51640. Ge.uniform2fv(i, e._array)
  51641. } else if ("v3v" === t) {
  51642. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51643. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51644. m += 3)
  51645. e._array[m + 0] = r[d].x,
  51646. e._array[m + 1] = r[d].y,
  51647. e._array[m + 2] = r[d].z;
  51648. Ge.uniform3fv(i, e._array)
  51649. } else if ("v4v" === t) {
  51650. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51651. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51652. v += 4)
  51653. e._array[v + 0] = r[d].x,
  51654. e._array[v + 1] = r[d].y,
  51655. e._array[v + 2] = r[d].z,
  51656. e._array[v + 3] = r[d].w;
  51657. Ge.uniform4fv(i, e._array)
  51658. } else if ("m2" === t)
  51659. Ge.uniformMatrix2fv(i, !1, r.elements);
  51660. else if ("m3" === t)
  51661. Ge.uniformMatrix3fv(i, !1, r.elements);
  51662. else if ("m3v" === t) {
  51663. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51664. for (var d = 0, g = r.length; d < g; d++)
  51665. r[d].flattenToArrayOffset(e._array, 9 * d);
  51666. Ge.uniformMatrix3fv(i, !1, e._array)
  51667. } else if ("m4" === t)
  51668. Ge.uniformMatrix4fv(i, !1, r.elements);
  51669. else if ("m4v" === t) {
  51670. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51671. for (var d = 0, g = r.length; d < g; d++)
  51672. r[d].flattenToArrayOffset(e._array, 16 * d);
  51673. Ge.uniformMatrix4fv(i, !1, e._array)
  51674. } else if ("t" === t) {
  51675. if (o = r,
  51676. a = B(),
  51677. Ge.uniform1i(i, a),
  51678. !o)
  51679. return;
  51680. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  51681. } else if ("tv" === t) {
  51682. void 0 === e._array && (e._array = []);
  51683. for (var d = 0, g = e.value.length; d < g; d++)
  51684. e._array[d] = B();
  51685. Ge.uniform1iv(i, e._array);
  51686. for (var d = 0, g = e.value.length; d < g; d++)
  51687. o = e.value[d],
  51688. a = e._array[d],
  51689. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  51690. } else
  51691. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51692. }
  51693. function V(e) {
  51694. for (var t = 0, i = e.length; t < i; t++) {
  51695. var n = e[t][0];
  51696. if (n.needsUpdate !== !1) {
  51697. var r = n.type
  51698. , o = e[t][1]
  51699. , a = n.value;
  51700. F(n, r, o, a)
  51701. }
  51702. }
  51703. }
  51704. function U(e, t) {
  51705. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  51706. for (Ue.shadowsPointLight = 0,
  51707. i = 0,
  51708. r = e.length; i < r; i++)
  51709. if (o = e[i],
  51710. a = o.color,
  51711. s = o.intensity,
  51712. l = o.distance,
  51713. o instanceof n.AmbientLight)
  51714. c += a.r * s,
  51715. h += a.g * s,
  51716. u += a.b * s;
  51717. else if (o instanceof n.DirectionalLight) {
  51718. var A = Ke.get(o);
  51719. A.color.copy(o.color).multiplyScalar(o.intensity),
  51720. A.direction.setFromMatrixPosition(o.matrixWorld),
  51721. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51722. A.direction.sub(Ve),
  51723. A.direction.transformDirection(d),
  51724. A.shadow = o.castShadow,
  51725. o.castShadow && (A.shadowBias = o.shadow.bias,
  51726. A.shadowRadius = o.shadow.radius,
  51727. A.shadowMapSize = o.shadow.mapSize,
  51728. Ue.shadows[v++] = o),
  51729. Ue.directionalShadowMap[p] = o.shadow.map,
  51730. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51731. Ue.directional[p++] = A
  51732. } else if (o instanceof n.SpotLight) {
  51733. var A = Ke.get(o);
  51734. A.position.setFromMatrixPosition(o.matrixWorld),
  51735. A.position.applyMatrix4(d),
  51736. A.color.copy(a).multiplyScalar(s),
  51737. A.distance = l,
  51738. A.direction.setFromMatrixPosition(o.matrixWorld),
  51739. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51740. A.direction.sub(Ve),
  51741. A.direction.transformDirection(d),
  51742. A.coneCos = Math.cos(o.angle),
  51743. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51744. A.decay = 0 === o.distance ? 0 : o.decay,
  51745. A.shadow = o.castShadow,
  51746. o.castShadow && (A.shadowBias = o.shadow.bias,
  51747. A.shadowRadius = o.shadow.radius,
  51748. A.shadowMapSize = o.shadow.mapSize,
  51749. Ue.shadows[v++] = o),
  51750. Ue.spotShadowMap[g] = o.shadow.map,
  51751. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51752. Ue.spot[g++] = A
  51753. } else if (o instanceof n.PointLight) {
  51754. var A = Ke.get(o);
  51755. A.position.setFromMatrixPosition(o.matrixWorld),
  51756. A.position.applyMatrix4(d),
  51757. A.color.copy(o.color).multiplyScalar(o.intensity),
  51758. A.distance = o.distance,
  51759. A.decay = 0 === o.distance ? 0 : o.decay,
  51760. A.shadow = o.castShadow,
  51761. o.castShadow && (A.shadowBias = o.shadow.bias,
  51762. A.shadowRadius = o.shadow.radius,
  51763. A.shadowMapSize = o.shadow.mapSize,
  51764. Ue.shadows[v++] = o),
  51765. Ue.pointShadowMap[f] = o.shadow.map,
  51766. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51767. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51768. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51769. Ue.point[f++] = A
  51770. } else if (o instanceof n.HemisphereLight) {
  51771. var A = Ke.get(o);
  51772. A.direction.setFromMatrixPosition(o.matrixWorld),
  51773. A.direction.transformDirection(d),
  51774. A.direction.normalize(),
  51775. A.skyColor.copy(o.color).multiplyScalar(s),
  51776. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51777. Ue.hemi[m++] = A
  51778. }
  51779. Ue.ambient[0] = c,
  51780. Ue.ambient[1] = h,
  51781. Ue.ambient[2] = u,
  51782. Ue.directional.length = p,
  51783. Ue.spot.length = g,
  51784. Ue.point.length = f,
  51785. Ue.hemi.length = m,
  51786. Ue.shadows.length = v,
  51787. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51788. }
  51789. function k(e, t, i) {
  51790. var r;
  51791. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51792. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51793. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51794. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51795. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51796. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  51797. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51798. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51799. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  51800. r = We.get("EXT_texture_filter_anisotropic")) {
  51801. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51802. return;
  51803. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51804. return;
  51805. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51806. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51807. }
  51808. }
  51809. function H(e, t, i) {
  51810. void 0 === e.__webglInit && (e.__webglInit = !0,
  51811. t.addEventListener("dispose", s),
  51812. e.__webglTexture = Ge.createTexture(),
  51813. ke.textures++),
  51814. Ye.activeTexture(Ge.TEXTURE0 + i),
  51815. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51816. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51817. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51818. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51819. var r = G(t.image, je.maxTextureSize);
  51820. W(t) && z(r) === !1 && (r = j(r));
  51821. var o = z(r)
  51822. , a = ee(t.format)
  51823. , l = ee(t.type);
  51824. k(Ge.TEXTURE_2D, t, o);
  51825. var c, h = t.mipmaps;
  51826. if (t instanceof n.DataTexture)
  51827. if (h.length > 0 && o) {
  51828. for (var u = 0, d = h.length; u < d; u++)
  51829. c = h[u],
  51830. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51831. t.generateMipmaps = !1
  51832. } else
  51833. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51834. else if (t instanceof n.CompressedTexture)
  51835. for (var u = 0, d = h.length; u < d; u++)
  51836. c = h[u],
  51837. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51838. else if (h.length > 0 && o) {
  51839. for (var u = 0, d = h.length; u < d; u++)
  51840. c = h[u],
  51841. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51842. t.generateMipmaps = !1
  51843. } else
  51844. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51845. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51846. e.__version = t.version,
  51847. t.onUpdate && t.onUpdate(t)
  51848. }
  51849. function G(e, t) {
  51850. if (e.width > t || e.height > t) {
  51851. var i = t / Math.max(e.width, e.height)
  51852. , n = document.createElement("canvas");
  51853. n.width = Math.floor(e.width * i),
  51854. n.height = Math.floor(e.height * i);
  51855. var r = n.getContext("2d");
  51856. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51857. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51858. n
  51859. }
  51860. return e
  51861. }
  51862. function z(e) {
  51863. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51864. }
  51865. function W(e) {
  51866. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51867. }
  51868. function j(e) {
  51869. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51870. var t = document.createElement("canvas");
  51871. t.width = n.Math.nearestPowerOfTwo(e.width),
  51872. t.height = n.Math.nearestPowerOfTwo(e.height);
  51873. var i = t.getContext("2d");
  51874. return i.drawImage(e, 0, 0, t.width, t.height),
  51875. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51876. t
  51877. }
  51878. return e
  51879. }
  51880. function Y(e, t) {
  51881. var i = Xe.get(e);
  51882. if (6 === e.image.length)
  51883. if (e.version > 0 && i.__version !== e.version) {
  51884. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51885. i.__image__webglTextureCube = Ge.createTexture(),
  51886. ke.textures++),
  51887. Ye.activeTexture(Ge.TEXTURE0 + t),
  51888. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51889. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51890. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51891. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51892. var c = a[0]
  51893. , h = z(c)
  51894. , u = ee(e.format)
  51895. , d = ee(e.type);
  51896. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51897. for (var l = 0; l < 6; l++)
  51898. if (r)
  51899. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51900. p = f[g],
  51901. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  51902. else
  51903. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  51904. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51905. i.__version = e.version,
  51906. e.onUpdate && e.onUpdate(e)
  51907. } else
  51908. Ye.activeTexture(Ge.TEXTURE0 + t),
  51909. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51910. }
  51911. function X(e, t) {
  51912. Ye.activeTexture(Ge.TEXTURE0 + t),
  51913. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51914. }
  51915. function Z(e, t, i, n) {
  51916. var r = ee(t.texture.format)
  51917. , o = ee(t.texture.type);
  51918. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51919. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51920. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51921. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51922. }
  51923. function q(e, t) {
  51924. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51925. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51926. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  51927. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51928. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51929. }
  51930. function K(e) {
  51931. var t = Xe.get(e)
  51932. , i = e instanceof n.WebGLRenderTargetCube;
  51933. if (i) {
  51934. t.__webglDepthbuffer = [];
  51935. for (var r = 0; r < 6; r++)
  51936. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51937. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51938. q(t.__webglDepthbuffer[r], e)
  51939. } else
  51940. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51941. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51942. q(t.__webglDepthbuffer, e);
  51943. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51944. }
  51945. function Q(e) {
  51946. var t = Xe.get(e)
  51947. , i = Xe.get(e.texture);
  51948. e.addEventListener("dispose", l),
  51949. i.__webglTexture = Ge.createTexture(),
  51950. ke.textures++;
  51951. var r = e instanceof n.WebGLRenderTargetCube
  51952. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51953. if (r) {
  51954. t.__webglFramebuffer = [];
  51955. for (var a = 0; a < 6; a++)
  51956. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51957. } else
  51958. t.__webglFramebuffer = Ge.createFramebuffer();
  51959. if (r) {
  51960. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51961. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51962. for (var a = 0; a < 6; a++)
  51963. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51964. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51965. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51966. } else
  51967. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51968. k(Ge.TEXTURE_2D, e.texture, o),
  51969. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51970. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51971. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51972. e.depthBuffer && K(e)
  51973. }
  51974. function J(e) {
  51975. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51976. , i = Xe.get(e.texture).__webglTexture;
  51977. Ye.bindTexture(t, i),
  51978. Ge.generateMipmap(t),
  51979. Ye.bindTexture(t, null)
  51980. }
  51981. function $(e) {
  51982. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51983. }
  51984. function ee(e) {
  51985. var t;
  51986. if (e === n.RepeatWrapping)
  51987. return Ge.REPEAT;
  51988. if (e === n.ClampToEdgeWrapping)
  51989. return Ge.CLAMP_TO_EDGE;
  51990. if (e === n.MirroredRepeatWrapping)
  51991. return Ge.MIRRORED_REPEAT;
  51992. if (e === n.NearestFilter)
  51993. return Ge.NEAREST;
  51994. if (e === n.NearestMipMapNearestFilter)
  51995. return Ge.NEAREST_MIPMAP_NEAREST;
  51996. if (e === n.NearestMipMapLinearFilter)
  51997. return Ge.NEAREST_MIPMAP_LINEAR;
  51998. if (e === n.LinearFilter)
  51999. return Ge.LINEAR;
  52000. if (e === n.LinearMipMapNearestFilter)
  52001. return Ge.LINEAR_MIPMAP_NEAREST;
  52002. if (e === n.LinearMipMapLinearFilter)
  52003. return Ge.LINEAR_MIPMAP_LINEAR;
  52004. if (e === n.UnsignedByteType)
  52005. return Ge.UNSIGNED_BYTE;
  52006. if (e === n.UnsignedShort4444Type)
  52007. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52008. if (e === n.UnsignedShort5551Type)
  52009. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52010. if (e === n.UnsignedShort565Type)
  52011. return Ge.UNSIGNED_SHORT_5_6_5;
  52012. if (e === n.ByteType)
  52013. return Ge.BYTE;
  52014. if (e === n.ShortType)
  52015. return Ge.SHORT;
  52016. if (e === n.UnsignedShortType)
  52017. return Ge.UNSIGNED_SHORT;
  52018. if (e === n.IntType)
  52019. return Ge.INT;
  52020. if (e === n.UnsignedIntType)
  52021. return Ge.UNSIGNED_INT;
  52022. if (e === n.FloatType)
  52023. return Ge.FLOAT;
  52024. if (t = We.get("OES_texture_half_float"),
  52025. null !== t && e === n.HalfFloatType)
  52026. return t.HALF_FLOAT_OES;
  52027. if (e === n.AlphaFormat)
  52028. return Ge.ALPHA;
  52029. if (e === n.RGBFormat)
  52030. return Ge.RGB;
  52031. if (e === n.RGBAFormat)
  52032. return Ge.RGBA;
  52033. if (e === n.LuminanceFormat)
  52034. return Ge.LUMINANCE;
  52035. if (e === n.LuminanceAlphaFormat)
  52036. return Ge.LUMINANCE_ALPHA;
  52037. if (e === n.AddEquation)
  52038. return Ge.FUNC_ADD;
  52039. if (e === n.SubtractEquation)
  52040. return Ge.FUNC_SUBTRACT;
  52041. if (e === n.ReverseSubtractEquation)
  52042. return Ge.FUNC_REVERSE_SUBTRACT;
  52043. if (e === n.ZeroFactor)
  52044. return Ge.ZERO;
  52045. if (e === n.OneFactor)
  52046. return Ge.ONE;
  52047. if (e === n.SrcColorFactor)
  52048. return Ge.SRC_COLOR;
  52049. if (e === n.OneMinusSrcColorFactor)
  52050. return Ge.ONE_MINUS_SRC_COLOR;
  52051. if (e === n.SrcAlphaFactor)
  52052. return Ge.SRC_ALPHA;
  52053. if (e === n.OneMinusSrcAlphaFactor)
  52054. return Ge.ONE_MINUS_SRC_ALPHA;
  52055. if (e === n.DstAlphaFactor)
  52056. return Ge.DST_ALPHA;
  52057. if (e === n.OneMinusDstAlphaFactor)
  52058. return Ge.ONE_MINUS_DST_ALPHA;
  52059. if (e === n.DstColorFactor)
  52060. return Ge.DST_COLOR;
  52061. if (e === n.OneMinusDstColorFactor)
  52062. return Ge.ONE_MINUS_DST_COLOR;
  52063. if (e === n.SrcAlphaSaturateFactor)
  52064. return Ge.SRC_ALPHA_SATURATE;
  52065. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52066. null !== t) {
  52067. if (e === n.RGB_S3TC_DXT1_Format)
  52068. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52069. if (e === n.RGBA_S3TC_DXT1_Format)
  52070. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52071. if (e === n.RGBA_S3TC_DXT3_Format)
  52072. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52073. if (e === n.RGBA_S3TC_DXT5_Format)
  52074. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52075. }
  52076. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52077. null !== t) {
  52078. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52079. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52080. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52081. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52082. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52083. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52084. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52085. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52086. }
  52087. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52088. null !== t && e === n.RGB_ETC1_Format)
  52089. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52090. if (t = We.get("EXT_blend_minmax"),
  52091. null !== t) {
  52092. if (e === n.MinEquation)
  52093. return t.MIN_EXT;
  52094. if (e === n.MaxEquation)
  52095. return t.MAX_EXT
  52096. }
  52097. return 0
  52098. }
  52099. console.log("THREE.WebGLRenderer", n.REVISION),
  52100. e = e || {};
  52101. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52102. , ie = void 0 !== e.context ? e.context : null
  52103. , ne = void 0 !== e.alpha && e.alpha
  52104. , re = void 0 === e.depth || e.depth
  52105. , oe = void 0 === e.stencil || e.stencil
  52106. , ae = void 0 !== e.antialias && e.antialias
  52107. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52108. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52109. , ce = []
  52110. , he = []
  52111. , ue = -1
  52112. , de = []
  52113. , pe = -1
  52114. , fe = new Float32Array(8)
  52115. , ge = []
  52116. , me = [];
  52117. this.domElement = te,
  52118. this.context = null,
  52119. this.autoClear = !0,
  52120. this.autoClearColor = !0,
  52121. this.autoClearDepth = !0,
  52122. this.autoClearStencil = !0,
  52123. this.sortObjects = !0,
  52124. this.gammaFactor = 2,
  52125. this.gammaInput = !1,
  52126. this.gammaOutput = !1,
  52127. this.physicallyCorrectLights = !1,
  52128. this.toneMapping = n.LinearToneMapping,
  52129. this.toneMappingExposure = 1,
  52130. this.toneMappingWhitePoint = 1,
  52131. this.maxMorphTargets = 8,
  52132. this.maxMorphNormals = 4,
  52133. this.autoScaleCubemaps = !0;
  52134. var ve = this
  52135. , Ae = null
  52136. , ye = null
  52137. , Ce = null
  52138. , Ie = -1
  52139. , Ee = ""
  52140. , be = null
  52141. , we = new n.Vector4
  52142. , _e = null
  52143. , Te = new n.Vector4
  52144. , xe = 0
  52145. , Se = new n.Color(0)
  52146. , Me = 0
  52147. , Re = te.width
  52148. , Pe = te.height
  52149. , Oe = 1
  52150. , Le = new n.Vector4(0,0,Re,Pe)
  52151. , De = !1
  52152. , Ne = new n.Vector4(0,0,Re,Pe)
  52153. , Be = new n.Frustum
  52154. , Fe = new n.Matrix4
  52155. , Ve = new n.Vector3
  52156. , Ue = {
  52157. hash: "",
  52158. ambient: [0, 0, 0],
  52159. directional: [],
  52160. directionalShadowMap: [],
  52161. directionalShadowMatrix: [],
  52162. spot: [],
  52163. spotShadowMap: [],
  52164. spotShadowMatrix: [],
  52165. point: [],
  52166. pointShadowMap: [],
  52167. pointShadowMatrix: [],
  52168. hemi: [],
  52169. shadows: [],
  52170. shadowsPointLight: 0
  52171. }
  52172. , ke = {
  52173. geometries: 0,
  52174. textures: 0
  52175. }
  52176. , He = {
  52177. calls: 0,
  52178. vertices: 0,
  52179. faces: 0,
  52180. points: 0
  52181. };
  52182. this.info = {
  52183. render: He,
  52184. memory: ke,
  52185. programs: null
  52186. };
  52187. var Ge;
  52188. try {
  52189. var ze = {
  52190. alpha: ne,
  52191. depth: re,
  52192. stencil: oe,
  52193. antialias: ae,
  52194. premultipliedAlpha: se,
  52195. preserveDrawingBuffer: le
  52196. };
  52197. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52198. null === Ge)
  52199. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52200. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52201. return {
  52202. rangeMin: 1,
  52203. rangeMax: 1,
  52204. precision: 1
  52205. }
  52206. }
  52207. ),
  52208. te.addEventListener("webglcontextlost", a, !1)
  52209. } catch (e) {
  52210. console.error("THREE.WebGLRenderer: " + e)
  52211. }
  52212. var We = new n.WebGLExtensions(Ge);
  52213. We.get("OES_texture_float"),
  52214. We.get("OES_texture_float_linear"),
  52215. We.get("OES_texture_half_float"),
  52216. We.get("OES_texture_half_float_linear"),
  52217. We.get("OES_standard_derivatives"),
  52218. We.get("ANGLE_instanced_arrays"),
  52219. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52220. var je = new n.WebGLCapabilities(Ge,We,e)
  52221. , Ye = new n.WebGLState(Ge,We,ee)
  52222. , Xe = new n.WebGLProperties
  52223. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52224. , qe = new n.WebGLPrograms(this,je)
  52225. , Ke = new n.WebGLLights;
  52226. this.info.programs = qe.programs;
  52227. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52228. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52229. r(),
  52230. this.context = Ge,
  52231. this.capabilities = je,
  52232. this.extensions = We,
  52233. this.properties = Xe,
  52234. this.state = Ye;
  52235. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52236. this.shadowMap = $e;
  52237. var et = new n.SpritePlugin(this,ge)
  52238. , tt = new n.LensFlarePlugin(this,me);
  52239. this.getContext = function() {
  52240. return Ge
  52241. }
  52242. ,
  52243. this.getContextAttributes = function() {
  52244. return Ge.getContextAttributes()
  52245. }
  52246. ,
  52247. this.forceContextLoss = function() {
  52248. We.get("WEBGL_lose_context").loseContext()
  52249. }
  52250. ,
  52251. this.getMaxAnisotropy = function() {
  52252. var e;
  52253. return function() {
  52254. if (void 0 !== e)
  52255. return e;
  52256. var t = We.get("EXT_texture_filter_anisotropic");
  52257. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52258. }
  52259. }(),
  52260. this.getPrecision = function() {
  52261. return je.precision
  52262. }
  52263. ,
  52264. this.getPixelRatio = function() {
  52265. return Oe
  52266. }
  52267. ,
  52268. this.setPixelRatio = function(e) {
  52269. void 0 !== e && (Oe = e,
  52270. this.setSize(Ne.z, Ne.w, !1))
  52271. }
  52272. ,
  52273. this.getSize = function() {
  52274. return {
  52275. width: Re,
  52276. height: Pe
  52277. }
  52278. }
  52279. ,
  52280. this.setSize = function(e, t, i, devicePixelRatio) {
  52281. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52282. Re = e,
  52283. Pe = t,
  52284. te.width = e * Oe,
  52285. te.height = t * Oe,
  52286. i !== !1 && (te.style.width = e + "px",
  52287. te.style.height = t + "px"),
  52288. this.setViewport(0, 0, e, t)
  52289. }
  52290. ,
  52291. this.setViewport = function(e, t, i, n) {
  52292. Ye.viewport(Ne.set(e, t, i, n))
  52293. }
  52294. ,
  52295. this.setScissor = function(e, t, i, n) {
  52296. Ye.scissor(Le.set(e, t, i, n))
  52297. }
  52298. ,
  52299. this.setScissorTest = function(e) {
  52300. Ye.setScissorTest(De = e)
  52301. }
  52302. ,
  52303. this.getClearColor = function() {
  52304. return Se
  52305. }
  52306. ,
  52307. this.setClearColor = function(e, t) {
  52308. Se.set(e),
  52309. Me = void 0 !== t ? t : 1,
  52310. i(Se.r, Se.g, Se.b, Me)
  52311. }
  52312. ,
  52313. this.getClearAlpha = function() {
  52314. return Me
  52315. }
  52316. ,
  52317. this.setClearAlpha = function(e) {
  52318. Me = e,
  52319. i(Se.r, Se.g, Se.b, Me)
  52320. }
  52321. ,
  52322. this.clear = function(e, t, i) {
  52323. var n = 0;
  52324. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52325. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52326. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52327. Ge.clear(n)
  52328. }
  52329. ,
  52330. this.clearColor = function() {
  52331. this.clear(!0, !1, !1)
  52332. }
  52333. ,
  52334. this.clearDepth = function() {
  52335. this.clear(!1, !0, !1)
  52336. }
  52337. ,
  52338. this.clearStencil = function() {
  52339. this.clear(!1, !1, !0)
  52340. }
  52341. ,
  52342. this.clearTarget = function(e, t, i, n) {
  52343. this.setRenderTarget(e),
  52344. this.clear(t, i, n)
  52345. }
  52346. ,
  52347. this.resetGLState = o,
  52348. this.dispose = function() {
  52349. te.removeEventListener("webglcontextlost", a, !1)
  52350. }
  52351. ,
  52352. this.renderBufferImmediate = function(e, t, i) {
  52353. Ye.initAttributes();
  52354. var r = Xe.get(e);
  52355. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52356. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52357. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52358. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52359. var o = t.getAttributes();
  52360. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52361. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52362. Ye.enableAttribute(o.position),
  52363. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52364. e.hasNormals) {
  52365. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52366. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52367. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52368. var l = e.normalArray
  52369. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52370. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52371. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52372. l[a + 0] = c,
  52373. l[a + 1] = h,
  52374. l[a + 2] = u,
  52375. l[a + 3] = c,
  52376. l[a + 4] = h,
  52377. l[a + 5] = u,
  52378. l[a + 6] = c,
  52379. l[a + 7] = h,
  52380. l[a + 8] = u
  52381. }
  52382. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52383. Ye.enableAttribute(o.normal),
  52384. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52385. }
  52386. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52387. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52388. Ye.enableAttribute(o.uv),
  52389. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52390. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52391. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52392. Ye.enableAttribute(o.color),
  52393. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52394. Ye.disableUnusedAttributes(),
  52395. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52396. e.count = 0
  52397. }
  52398. ,
  52399. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52400. E(o);
  52401. var l = w(e, i, o, a)
  52402. , c = !1
  52403. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52404. h !== Ee && (Ee = h,
  52405. c = !0);
  52406. var u = a.morphTargetInfluences;
  52407. if (void 0 !== u) {
  52408. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52409. var v = u[p];
  52410. d.push([v, p])
  52411. }
  52412. d.sort(g),
  52413. d.length > 8 && (d.length = 8);
  52414. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52415. var v = d[p];
  52416. if (fe[p] = v[0],
  52417. 0 !== v[0]) {
  52418. var y = v[1];
  52419. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52420. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52421. } else
  52422. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52423. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52424. }
  52425. var C = l.getUniforms();
  52426. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52427. c = !0
  52428. }
  52429. var y = r.index
  52430. , I = r.attributes.position;
  52431. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52432. var b;
  52433. null !== y ? (b = Je,
  52434. b.setIndex(y)) : b = Qe,
  52435. c && (f(o, l, r),
  52436. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52437. var _ = 0
  52438. , T = 1 / 0;
  52439. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52440. var x = r.drawRange.start
  52441. , S = r.drawRange.count
  52442. , M = null !== s ? s.start : 0
  52443. , R = null !== s ? s.count : 1 / 0
  52444. , P = Math.max(_, x, M)
  52445. , O = Math.min(_ + T, x + S, M + R) - 1
  52446. , L = Math.max(0, O - P + 1);
  52447. if (a instanceof n.Mesh)
  52448. if (o.wireframe === !0)
  52449. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52450. b.setMode(Ge.LINES);
  52451. else
  52452. switch (a.drawMode) {
  52453. case n.TrianglesDrawMode:
  52454. b.setMode(Ge.TRIANGLES);
  52455. break;
  52456. case n.TriangleStripDrawMode:
  52457. b.setMode(Ge.TRIANGLE_STRIP);
  52458. break;
  52459. case n.TriangleFanDrawMode:
  52460. b.setMode(Ge.TRIANGLE_FAN)
  52461. }
  52462. else if (a instanceof n.Line) {
  52463. var D = o.linewidth;
  52464. void 0 === D && (D = 1),
  52465. Ye.setLineWidth(D * t()),
  52466. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52467. } else
  52468. a instanceof n.Points && b.setMode(Ge.POINTS);
  52469. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52470. }
  52471. ,
  52472. this.render = function(e, t, i, r) {
  52473. if (t instanceof n.Camera == !1)
  52474. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52475. var o = e.fog;
  52476. if (Ee = "",
  52477. Ie = -1,
  52478. be = null,
  52479. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52480. null === t.parent && t.updateMatrixWorld(),
  52481. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52482. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52483. Be.setFromMatrix(Fe),
  52484. ce.length = 0,
  52485. ue = -1,
  52486. pe = -1,
  52487. ge.length = 0,
  52488. me.length = 0,
  52489. y(e, t),
  52490. he.length = ue + 1,
  52491. de.length = pe + 1,
  52492. ve.sortObjects === !0 && (he.sort(m),
  52493. de.sort(v)),
  52494. U(ce, t),
  52495. $e.render(e, t),
  52496. He.calls = 0,
  52497. He.vertices = 0,
  52498. He.faces = 0,
  52499. He.points = 0,
  52500. void 0 === i && (i = null),
  52501. this.setRenderTarget(i),
  52502. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52503. e.overrideMaterial) {
  52504. var a = e.overrideMaterial;
  52505. C(he, t, o, a),
  52506. C(de, t, o, a)
  52507. } else
  52508. Ye.setBlending(n.NoBlending),
  52509. C(he, t, o),
  52510. C(de, t, o);
  52511. if (et.render(e, t),
  52512. tt.render(e, t, Te),
  52513. i) {
  52514. var s = i.texture;
  52515. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52516. }
  52517. Ye.setDepthTest(!0),
  52518. Ye.setDepthWrite(!0),
  52519. Ye.setColorWrite(!0)
  52520. }
  52521. ,
  52522. this.setFaceCulling = function(e, t) {
  52523. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52524. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52525. Ye.enable(Ge.CULL_FACE))
  52526. }
  52527. ,
  52528. this.setTexture = function(e, t) {
  52529. var i = Xe.get(e);
  52530. if (e.version > 0 && i.__version !== e.version) {
  52531. var n = e.image;
  52532. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  52533. }
  52534. Ye.activeTexture(Ge.TEXTURE0 + t),
  52535. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52536. }
  52537. ,
  52538. this.getCurrentRenderTarget = function() {
  52539. return ye
  52540. }
  52541. ,
  52542. this.setRenderTarget = function(e) {
  52543. ye = e,
  52544. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52545. var t, i = e instanceof n.WebGLRenderTargetCube;
  52546. if (e) {
  52547. var r = Xe.get(e);
  52548. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52549. we.copy(e.scissor),
  52550. _e = e.scissorTest,
  52551. Te.copy(e.viewport)
  52552. } else
  52553. t = null,
  52554. we.copy(Le).multiplyScalar(Oe),
  52555. _e = De,
  52556. Te.copy(Ne).multiplyScalar(Oe);
  52557. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52558. Ce = t),
  52559. Ye.scissor(we),
  52560. Ye.setScissorTest(_e),
  52561. Ye.viewport(Te),
  52562. i) {
  52563. var o = Xe.get(e.texture);
  52564. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52565. }
  52566. }
  52567. ,
  52568. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52569. if (e instanceof n.WebGLRenderTarget == !1)
  52570. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52571. var s = Xe.get(e).__webglFramebuffer;
  52572. if (s) {
  52573. var l = !1;
  52574. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52575. l = !0);
  52576. try {
  52577. var c = e.texture;
  52578. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52579. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52580. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  52581. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52582. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  52583. } finally {
  52584. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52585. }
  52586. }
  52587. }
  52588. }
  52589. ,
  52590. n.WebGLRenderTarget = function(e, t, i) {
  52591. this.uuid = n.Math.generateUUID(),
  52592. this.width = e,
  52593. this.height = t,
  52594. this.scissor = new n.Vector4(0,0,e,t),
  52595. this.scissorTest = !1,
  52596. this.viewport = new n.Vector4(0,0,e,t),
  52597. i = i || {},
  52598. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52599. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52600. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52601. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52602. }
  52603. ,
  52604. n.WebGLRenderTarget.prototype = {
  52605. constructor: n.WebGLRenderTarget,
  52606. setSize: function(e, t) {
  52607. this.width === e && this.height === t || (this.width = e,
  52608. this.height = t,
  52609. this.dispose()),
  52610. this.viewport.set(0, 0, e, t),
  52611. this.scissor.set(0, 0, e, t)
  52612. },
  52613. clone: function() {
  52614. return (new this.constructor).copy(this)
  52615. },
  52616. copy: function(e) {
  52617. return this.width = e.width,
  52618. this.height = e.height,
  52619. this.viewport.copy(e.viewport),
  52620. this.texture = e.texture.clone(),
  52621. this.depthBuffer = e.depthBuffer,
  52622. this.stencilBuffer = e.stencilBuffer,
  52623. this
  52624. },
  52625. dispose: function() {
  52626. this.dispatchEvent({
  52627. type: "dispose"
  52628. })
  52629. }
  52630. },
  52631. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52632. n.WebGLRenderTargetCube = function(e, t, i) {
  52633. n.WebGLRenderTarget.call(this, e, t, i),
  52634. this.activeCubeFace = 0,
  52635. this.activeMipMapLevel = 0
  52636. }
  52637. ,
  52638. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52639. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52640. n.WebGLBufferRenderer = function(e, t, i) {
  52641. function r(e) {
  52642. s = e
  52643. }
  52644. function o(t, n) {
  52645. e.drawArrays(s, t, n),
  52646. i.calls++,
  52647. i.vertices += n,
  52648. s === e.TRIANGLES && (i.faces += n / 3)
  52649. }
  52650. function a(r) {
  52651. var o = t.get("ANGLE_instanced_arrays");
  52652. if (null === o)
  52653. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52654. var a = r.attributes.position
  52655. , l = 0;
  52656. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52657. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52658. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52659. i.calls++,
  52660. i.vertices += l * r.maxInstancedCount,
  52661. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52662. }
  52663. var s;
  52664. this.setMode = r,
  52665. this.render = o,
  52666. this.renderInstances = a
  52667. }
  52668. ,
  52669. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52670. function n(e) {
  52671. s = e
  52672. }
  52673. function r(i) {
  52674. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52675. c = 4) : (l = e.UNSIGNED_SHORT,
  52676. c = 2)
  52677. }
  52678. function o(t, n) {
  52679. e.drawElements(s, n, l, t * c),
  52680. i.calls++,
  52681. i.vertices += n,
  52682. s === e.TRIANGLES && (i.faces += n / 3)
  52683. }
  52684. function a(n, r, o) {
  52685. var a = t.get("ANGLE_instanced_arrays");
  52686. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  52687. i.calls++,
  52688. i.vertices += o * n.maxInstancedCount,
  52689. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52690. }
  52691. var s, l, c;
  52692. this.setMode = n,
  52693. this.setIndex = r,
  52694. this.render = o,
  52695. this.renderInstances = a
  52696. }
  52697. ,
  52698. n.WebGLExtensions = function(e) {
  52699. var t = {};
  52700. this.get = function(i) {
  52701. if (void 0 !== t[i])
  52702. return t[i];
  52703. var n;
  52704. switch (i) {
  52705. case "EXT_texture_filter_anisotropic":
  52706. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52707. break;
  52708. case "WEBGL_compressed_texture_s3tc":
  52709. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52710. break;
  52711. case "WEBGL_compressed_texture_pvrtc":
  52712. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52713. break;
  52714. case "WEBGL_compressed_texture_etc1":
  52715. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52716. break;
  52717. default:
  52718. n = e.getExtension(i)
  52719. }
  52720. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52721. t[i] = n,
  52722. n
  52723. }
  52724. }
  52725. ,
  52726. n.WebGLCapabilities = function(e, t, i) {
  52727. function n(t) {
  52728. if ("highp" === t) {
  52729. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52730. return "highp";
  52731. t = "mediump"
  52732. }
  52733. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  52734. }
  52735. this.getMaxPrecision = n,
  52736. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52737. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52738. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52739. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52740. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52741. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52742. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52743. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52744. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52745. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52746. this.vertexTextures = this.maxVertexTextures > 0,
  52747. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52748. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52749. var r = n(this.precision);
  52750. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52751. this.precision = r),
  52752. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52753. }
  52754. ,
  52755. n.WebGLGeometries = function(e, t, i) {
  52756. function r(e) {
  52757. var t = e.geometry;
  52758. if (void 0 !== h[t.id])
  52759. return h[t.id];
  52760. t.addEventListener("dispose", o);
  52761. var r;
  52762. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52763. r = t._bufferGeometry),
  52764. h[t.id] = r,
  52765. i.memory.geometries++,
  52766. r
  52767. }
  52768. function o(e) {
  52769. var n = e.target
  52770. , r = h[n.id];
  52771. null !== r.index && s(r.index),
  52772. l(r.attributes),
  52773. n.removeEventListener("dispose", o),
  52774. delete h[n.id];
  52775. var a = t.get(n);
  52776. a.wireframe && s(a.wireframe),
  52777. t.delete(n);
  52778. var c = t.get(r);
  52779. c.wireframe && s(c.wireframe),
  52780. t.delete(r),
  52781. i.memory.geometries--
  52782. }
  52783. function a(e) {
  52784. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52785. }
  52786. function s(t) {
  52787. var i = a(t);
  52788. void 0 !== i && (e.deleteBuffer(i),
  52789. c(t))
  52790. }
  52791. function l(e) {
  52792. for (var t in e)
  52793. s(e[t])
  52794. }
  52795. function c(e) {
  52796. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52797. }
  52798. var h = {};
  52799. this.get = r
  52800. }
  52801. ,
  52802. n.WebGLLights = function() {
  52803. var e = {};
  52804. this.get = function(t) {
  52805. if (void 0 !== e[t.id])
  52806. return e[t.id];
  52807. var i;
  52808. switch (t.type) {
  52809. case "DirectionalLight":
  52810. i = {
  52811. direction: new n.Vector3,
  52812. color: new n.Color,
  52813. shadow: !1,
  52814. shadowBias: 0,
  52815. shadowRadius: 1,
  52816. shadowMapSize: new n.Vector2
  52817. };
  52818. break;
  52819. case "SpotLight":
  52820. i = {
  52821. position: new n.Vector3,
  52822. direction: new n.Vector3,
  52823. color: new n.Color,
  52824. distance: 0,
  52825. coneCos: 0,
  52826. penumbraCos: 0,
  52827. decay: 0,
  52828. shadow: !1,
  52829. shadowBias: 0,
  52830. shadowRadius: 1,
  52831. shadowMapSize: new n.Vector2
  52832. };
  52833. break;
  52834. case "PointLight":
  52835. i = {
  52836. position: new n.Vector3,
  52837. color: new n.Color,
  52838. distance: 0,
  52839. decay: 0,
  52840. shadow: !1,
  52841. shadowBias: 0,
  52842. shadowRadius: 1,
  52843. shadowMapSize: new n.Vector2
  52844. };
  52845. break;
  52846. case "HemisphereLight":
  52847. i = {
  52848. direction: new n.Vector3,
  52849. skyColor: new n.Color,
  52850. groundColor: new n.Color
  52851. }
  52852. }
  52853. return e[t.id] = i,
  52854. i
  52855. }
  52856. }
  52857. ,
  52858. n.WebGLObjects = function(e, t, i) {
  52859. function r(t) {
  52860. var i = u.get(t);
  52861. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52862. var r = i.index
  52863. , a = i.attributes;
  52864. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52865. for (var s in a)
  52866. o(a[s], e.ARRAY_BUFFER);
  52867. var l = i.morphAttributes;
  52868. for (var s in l)
  52869. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52870. o(c[h], e.ARRAY_BUFFER);
  52871. return i
  52872. }
  52873. function o(e, i) {
  52874. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52875. , o = t.get(r);
  52876. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52877. }
  52878. function a(t, i, n) {
  52879. t.__webglBuffer = e.createBuffer(),
  52880. e.bindBuffer(n, t.__webglBuffer);
  52881. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52882. e.bufferData(n, i.array, r),
  52883. t.version = i.version
  52884. }
  52885. function s(t, i, n) {
  52886. e.bindBuffer(n, t.__webglBuffer),
  52887. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  52888. i.updateRange.count = 0),
  52889. t.version = i.version
  52890. }
  52891. function l(e) {
  52892. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52893. }
  52894. function c(i) {
  52895. var r = t.get(i);
  52896. if (void 0 !== r.wireframe)
  52897. return r.wireframe;
  52898. var a = []
  52899. , s = i.index
  52900. , l = i.attributes
  52901. , c = l.position;
  52902. if (null !== s)
  52903. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52904. var g = d[p + 0]
  52905. , m = d[p + 1]
  52906. , v = d[p + 2];
  52907. h(u, g, m) && a.push(g, m),
  52908. h(u, m, v) && a.push(m, v),
  52909. h(u, v, g) && a.push(v, g)
  52910. }
  52911. else
  52912. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52913. var g = p + 0
  52914. , m = p + 1
  52915. , v = p + 2;
  52916. a.push(g, m, m, v, v, g)
  52917. }
  52918. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52919. , y = new n.BufferAttribute(new A(a),1);
  52920. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52921. r.wireframe = y,
  52922. y
  52923. }
  52924. function h(e, t, i) {
  52925. if (t > i) {
  52926. var n = t;
  52927. t = i,
  52928. i = n
  52929. }
  52930. var r = e[t];
  52931. return void 0 === r ? (e[t] = [i],
  52932. !0) : r.indexOf(i) === -1 && (r.push(i),
  52933. !0)
  52934. }
  52935. var u = new n.WebGLGeometries(e,t,i);
  52936. this.getAttributeBuffer = l,
  52937. this.getWireframeAttribute = c,
  52938. this.update = r
  52939. }
  52940. ,
  52941. n.WebGLProgram = function() {
  52942. function e(e) {
  52943. switch (e) {
  52944. case n.LinearEncoding:
  52945. return ["Linear", "( value )"];
  52946. case n.sRGBEncoding:
  52947. return ["sRGB", "( value )"];
  52948. case n.RGBEEncoding:
  52949. return ["RGBE", "( value )"];
  52950. case n.RGBM7Encoding:
  52951. return ["RGBM", "( value, 7.0 )"];
  52952. case n.RGBM16Encoding:
  52953. return ["RGBM", "( value, 16.0 )"];
  52954. case n.RGBDEncoding:
  52955. return ["RGBD", "( value, 256.0 )"];
  52956. case n.GammaEncoding:
  52957. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52958. default:
  52959. throw new Error("unsupported encoding: " + e)
  52960. }
  52961. }
  52962. function t(t, i) {
  52963. var n = e(i);
  52964. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52965. }
  52966. function i(t, i) {
  52967. var n = e(i);
  52968. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52969. }
  52970. function r(e, t) {
  52971. var i;
  52972. switch (t) {
  52973. case n.LinearToneMapping:
  52974. i = "Linear";
  52975. break;
  52976. case n.ReinhardToneMapping:
  52977. i = "Reinhard";
  52978. break;
  52979. case n.Uncharted2ToneMapping:
  52980. i = "Uncharted2";
  52981. break;
  52982. case n.CineonToneMapping:
  52983. i = "OptimizedCineon";
  52984. break;
  52985. default:
  52986. throw new Error("unsupported toneMapping: " + t)
  52987. }
  52988. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52989. }
  52990. function o(e, t, i) {
  52991. e = e || {};
  52992. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  52993. return n.filter(c).join("\n")
  52994. }
  52995. function a(e) {
  52996. var t = [];
  52997. for (var i in e) {
  52998. var n = e[i];
  52999. n !== !1 && t.push("#define " + i + " " + n)
  53000. }
  53001. return t.join("\n")
  53002. }
  53003. function s(e, t, i) {
  53004. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53005. var a = e.getActiveUniform(t, o)
  53006. , s = a.name
  53007. , l = e.getUniformLocation(t, s)
  53008. , c = f.exec(s);
  53009. if (c) {
  53010. var h = c[1]
  53011. , u = c[2]
  53012. , d = n[h];
  53013. d || (d = n[h] = {}),
  53014. d[u] = l
  53015. } else if (c = g.exec(s)) {
  53016. var p = c[1]
  53017. , v = c[2]
  53018. , A = c[3]
  53019. , y = n[p];
  53020. y || (y = n[p] = []);
  53021. var C = y[v];
  53022. C || (C = y[v] = {}),
  53023. C[A] = l
  53024. } else if (c = m.exec(s)) {
  53025. var p = c[1];
  53026. n[p] = l
  53027. } else
  53028. n[s] = l
  53029. }
  53030. return n
  53031. }
  53032. function l(e, t, i) {
  53033. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53034. var a = e.getActiveAttrib(t, o)
  53035. , s = a.name;
  53036. n[s] = e.getAttribLocation(t, s)
  53037. }
  53038. return n
  53039. }
  53040. function c(e) {
  53041. return "" !== e
  53042. }
  53043. function h(e, t) {
  53044. return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  53045. }
  53046. function u(e) {
  53047. function t(e, t) {
  53048. var i = n.ShaderChunk[t];
  53049. if (void 0 === i)
  53050. throw new Error("Can not resolve #include <" + t + ">");
  53051. return u(i)
  53052. }
  53053. var i = /#include +<([\w\d.]+)>/g;
  53054. return e.replace(i, t)
  53055. }
  53056. function d(e) {
  53057. function t(e, t, i, n) {
  53058. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53059. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53060. return r
  53061. }
  53062. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53063. return e.replace(i, t)
  53064. }
  53065. var p = 0
  53066. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53067. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53068. , m = /^([\w\d_]+)\[0\]$/;
  53069. return function(e, f, g, m) {
  53070. var v = e.context
  53071. , A = g.extensions
  53072. , y = g.defines
  53073. , C = g.__webglShader.vertexShader
  53074. , I = g.__webglShader.fragmentShader
  53075. , E = "SHADOWMAP_TYPE_BASIC";
  53076. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53077. var b = "ENVMAP_TYPE_CUBE"
  53078. , w = "ENVMAP_MODE_REFLECTION"
  53079. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53080. if (m.envMap) {
  53081. switch (g.envMap.mapping) {
  53082. case n.CubeReflectionMapping:
  53083. case n.CubeRefractionMapping:
  53084. b = "ENVMAP_TYPE_CUBE";
  53085. break;
  53086. case n.CubeUVReflectionMapping:
  53087. case n.CubeUVRefractionMapping:
  53088. b = "ENVMAP_TYPE_CUBE_UV";
  53089. break;
  53090. case n.EquirectangularReflectionMapping:
  53091. case n.EquirectangularRefractionMapping:
  53092. b = "ENVMAP_TYPE_EQUIREC";
  53093. break;
  53094. case n.SphericalReflectionMapping:
  53095. b = "ENVMAP_TYPE_SPHERE"
  53096. }
  53097. switch (g.envMap.mapping) {
  53098. case n.CubeRefractionMapping:
  53099. case n.EquirectangularRefractionMapping:
  53100. w = "ENVMAP_MODE_REFRACTION"
  53101. }
  53102. switch (g.combine) {
  53103. case n.MultiplyOperation:
  53104. _ = "ENVMAP_BLENDING_MULTIPLY";
  53105. break;
  53106. case n.MixOperation:
  53107. _ = "ENVMAP_BLENDING_MIX";
  53108. break;
  53109. case n.AddOperation:
  53110. _ = "ENVMAP_BLENDING_ADD"
  53111. }
  53112. }
  53113. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53114. g instanceof n.RawShaderMaterial ? (T = "",
  53115. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  53116. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  53117. C = u(C, m),
  53118. C = h(C, m),
  53119. I = u(I, m),
  53120. I = h(I, m),
  53121. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53122. I = d(I));
  53123. var O = T + C
  53124. , L = x + I
  53125. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53126. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53127. v.attachShader(P, D),
  53128. v.attachShader(P, N),
  53129. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53130. v.linkProgram(P);
  53131. var B = v.getProgramInfoLog(P)
  53132. , F = v.getShaderInfoLog(D)
  53133. , V = v.getShaderInfoLog(N)
  53134. , U = !0
  53135. , k = !0;
  53136. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53137. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  53138. k && (this.diagnostics = {
  53139. runnable: U,
  53140. material: g,
  53141. programLog: B,
  53142. vertexShader: {
  53143. log: F,
  53144. prefix: T
  53145. },
  53146. fragmentShader: {
  53147. log: V,
  53148. prefix: x
  53149. }
  53150. }),
  53151. v.deleteShader(D),
  53152. v.deleteShader(N);
  53153. var H;
  53154. this.getUniforms = function() {
  53155. return void 0 === H && (H = s(v, P)),
  53156. H
  53157. }
  53158. ;
  53159. var G;
  53160. return this.getAttributes = function() {
  53161. return void 0 === G && (G = l(v, P)),
  53162. G
  53163. }
  53164. ,
  53165. this.destroy = function() {
  53166. v.deleteProgram(P),
  53167. this.program = void 0
  53168. }
  53169. ,
  53170. Object.defineProperties(this, {
  53171. uniforms: {
  53172. get: function() {
  53173. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53174. this.getUniforms()
  53175. }
  53176. },
  53177. attributes: {
  53178. get: function() {
  53179. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53180. this.getAttributes()
  53181. }
  53182. }
  53183. }),
  53184. this.id = p++,
  53185. this.code = f,
  53186. this.usedTimes = 1,
  53187. this.program = P,
  53188. this.vertexShader = D,
  53189. this.fragmentShader = N,
  53190. this
  53191. }
  53192. }(),
  53193. n.WebGLPrograms = function(e, t) {
  53194. function i(e) {
  53195. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53196. return 1024;
  53197. var i = t.maxVertexUniforms
  53198. , r = Math.floor((i - 20) / 4)
  53199. , o = r;
  53200. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53201. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  53202. o
  53203. }
  53204. function r(e, t) {
  53205. var i;
  53206. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53207. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53208. i
  53209. }
  53210. var o = []
  53211. , a = {
  53212. MeshDepthMaterial: "depth",
  53213. MeshNormalMaterial: "normal",
  53214. MeshBasicMaterial: "basic",
  53215. MeshLambertMaterial: "lambert",
  53216. MeshPhongMaterial: "phong",
  53217. MeshStandardMaterial: "standard",
  53218. LineBasicMaterial: "basic",
  53219. LineDashedMaterial: "dashed",
  53220. PointsMaterial: "points"
  53221. }
  53222. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  53223. this.getParameters = function(o, s, l, c) {
  53224. var h = a[o.type]
  53225. , u = i(c)
  53226. , d = e.getPrecision();
  53227. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53228. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53229. var p = {
  53230. shaderID: h,
  53231. precision: d,
  53232. supportsVertexTextures: t.vertexTextures,
  53233. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53234. map: !!o.map,
  53235. mapEncoding: r(o.map, e.gammaInput),
  53236. envMap: !!o.envMap,
  53237. envMapMode: o.envMap && o.envMap.mapping,
  53238. envMapEncoding: r(o.envMap, e.gammaInput),
  53239. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53240. lightMap: !!o.lightMap,
  53241. aoMap: !!o.aoMap,
  53242. emissiveMap: !!o.emissiveMap,
  53243. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53244. bumpMap: !!o.bumpMap,
  53245. normalMap: !!o.normalMap,
  53246. displacementMap: !!o.displacementMap,
  53247. roughnessMap: !!o.roughnessMap,
  53248. metalnessMap: !!o.metalnessMap,
  53249. specularMap: !!o.specularMap,
  53250. alphaMap: !!o.alphaMap,
  53251. combine: o.combine,
  53252. vertexColors: o.vertexColors,
  53253. fog: l,
  53254. useFog: o.fog,
  53255. fogExp: l instanceof n.FogExp2,
  53256. flatShading: o.shading === n.FlatShading,
  53257. sizeAttenuation: o.sizeAttenuation,
  53258. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53259. skinning: o.skinning,
  53260. maxBones: u,
  53261. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53262. morphTargets: o.morphTargets,
  53263. morphNormals: o.morphNormals,
  53264. maxMorphTargets: e.maxMorphTargets,
  53265. maxMorphNormals: e.maxMorphNormals,
  53266. numDirLights: s.directional.length,
  53267. numPointLights: s.point.length,
  53268. numSpotLights: s.spot.length,
  53269. numHemiLights: s.hemi.length,
  53270. pointLightShadows: s.shadowsPointLight,
  53271. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53272. shadowMapType: e.shadowMap.type,
  53273. toneMapping: e.toneMapping,
  53274. physicallyCorrectLights: e.physicallyCorrectLights,
  53275. premultipliedAlpha: o.premultipliedAlpha,
  53276. alphaTest: o.alphaTest,
  53277. doubleSided: o.side === n.DoubleSide,
  53278. flipSided: o.side === n.BackSide
  53279. };
  53280. return p
  53281. }
  53282. ,
  53283. this.getProgramCode = function(e, t) {
  53284. var i = [];
  53285. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53286. i.push(e.vertexShader)),
  53287. void 0 !== e.defines)
  53288. for (var n in e.defines)
  53289. i.push(n),
  53290. i.push(e.defines[n]);
  53291. for (var r = 0; r < s.length; r++) {
  53292. var o = s[r];
  53293. i.push(o),
  53294. i.push(t[o])
  53295. }
  53296. return i.join()
  53297. }
  53298. ,
  53299. this.acquireProgram = function(t, i, r) {
  53300. for (var a, s = 0, l = o.length; s < l; s++) {
  53301. var c = o[s];
  53302. if (c.code === r) {
  53303. a = c,
  53304. ++a.usedTimes;
  53305. break
  53306. }
  53307. }
  53308. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53309. o.push(a)),
  53310. a
  53311. }
  53312. ,
  53313. this.releaseProgram = function(e) {
  53314. if (0 === --e.usedTimes) {
  53315. var t = o.indexOf(e);
  53316. o[t] = o[o.length - 1],
  53317. o.pop(),
  53318. e.destroy()
  53319. }
  53320. }
  53321. ,
  53322. this.programs = o
  53323. }
  53324. ,
  53325. n.WebGLProperties = function() {
  53326. var e = {};
  53327. this.get = function(t) {
  53328. var i = t.uuid
  53329. , n = e[i];
  53330. return void 0 === n && (n = {},
  53331. e[i] = n),
  53332. n
  53333. }
  53334. ,
  53335. this.delete = function(t) {
  53336. delete e[t.uuid]
  53337. }
  53338. ,
  53339. this.clear = function() {
  53340. e = {}
  53341. }
  53342. }
  53343. ,
  53344. n.WebGLShader = function() {
  53345. function e(e) {
  53346. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53347. t[i] = i + 1 + ": " + t[i];
  53348. return t.join("\n")
  53349. }
  53350. return function(t, i, n) {
  53351. var r = t.createShader(i);
  53352. return t.shaderSource(r, n),
  53353. t.compileShader(r),
  53354. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53355. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53356. r
  53357. }
  53358. }(),
  53359. n.WebGLShadowMap = function(e, t, i) {
  53360. function r(e, t, i, r) {
  53361. var o = e.geometry
  53362. , a = null
  53363. , s = v
  53364. , l = e.customDepthMaterial;
  53365. if (i && (s = A,
  53366. l = e.customDistanceMaterial),
  53367. l)
  53368. a = l;
  53369. else {
  53370. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53371. , h = e instanceof n.SkinnedMesh && t.skinning
  53372. , u = 0;
  53373. c && (u |= f),
  53374. h && (u |= g),
  53375. a = s[u]
  53376. }
  53377. return a.visible = t.visible,
  53378. a.wireframe = t.wireframe,
  53379. a.wireframeLinewidth = t.wireframeLinewidth,
  53380. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53381. a
  53382. }
  53383. function o(e, t, i) {
  53384. if (e.visible !== !1) {
  53385. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  53386. var r = e.material;
  53387. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53388. p.push(e))
  53389. }
  53390. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53391. o(a[s], t, i)
  53392. }
  53393. }
  53394. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  53395. var x = 0 !== (T & f)
  53396. , S = 0 !== (T & g)
  53397. , M = new n.ShaderMaterial({
  53398. uniforms: b,
  53399. vertexShader: E.vertexShader,
  53400. fragmentShader: E.fragmentShader,
  53401. morphTargets: x,
  53402. skinning: S
  53403. });
  53404. v[T] = M;
  53405. var R = new n.ShaderMaterial({
  53406. defines: {
  53407. USE_SHADOWMAP: ""
  53408. },
  53409. uniforms: _,
  53410. vertexShader: w.vertexShader,
  53411. fragmentShader: w.fragmentShader,
  53412. morphTargets: x,
  53413. skinning: S
  53414. });
  53415. A[T] = R
  53416. }
  53417. var P = this;
  53418. this.enabled = !1,
  53419. this.autoUpdate = !0,
  53420. this.needsUpdate = !1,
  53421. this.type = n.PCFShadowMap,
  53422. this.cullFace = n.CullFaceFront,
  53423. this.render = function(f, g) {
  53424. var m, v, A = t.shadows;
  53425. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53426. s.clearColor(1, 1, 1, 1),
  53427. s.disable(a.BLEND),
  53428. s.enable(a.CULL_FACE),
  53429. a.frontFace(a.CCW),
  53430. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53431. s.setDepthTest(!0),
  53432. s.setScissorTest(!1);
  53433. for (var E = 0, b = A.length; E < b; E++) {
  53434. var w = A[E]
  53435. , _ = w.shadow
  53436. , T = _.camera;
  53437. if (h.copy(_.mapSize),
  53438. w instanceof n.PointLight) {
  53439. m = 6,
  53440. v = !0;
  53441. var x = h.x
  53442. , S = h.y;
  53443. I[0].set(2 * x, S, x, S),
  53444. I[1].set(0, S, x, S),
  53445. I[2].set(3 * x, S, x, S),
  53446. I[3].set(x, S, x, S),
  53447. I[4].set(3 * x, 0, x, S),
  53448. I[5].set(x, 0, x, S),
  53449. h.x *= 4,
  53450. h.y *= 2
  53451. } else
  53452. m = 1,
  53453. v = !1;
  53454. if (null === _.map) {
  53455. var M = {
  53456. minFilter: n.NearestFilter,
  53457. magFilter: n.NearestFilter,
  53458. format: n.RGBAFormat
  53459. };
  53460. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53461. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53462. T.updateProjectionMatrix()
  53463. }
  53464. var R = _.map
  53465. , O = _.matrix;
  53466. d.setFromMatrixPosition(w.matrixWorld),
  53467. T.position.copy(d),
  53468. e.setRenderTarget(R),
  53469. e.clear();
  53470. for (var L = 0; L < m; L++) {
  53471. if (v) {
  53472. u.copy(T.position),
  53473. u.add(y[L]),
  53474. T.up.copy(C[L]),
  53475. T.lookAt(u);
  53476. var D = I[L];
  53477. s.viewport(D)
  53478. } else
  53479. u.setFromMatrixPosition(w.target.matrixWorld),
  53480. T.lookAt(u);
  53481. T.updateMatrixWorld(),
  53482. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53483. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53484. O.multiply(T.projectionMatrix),
  53485. O.multiply(T.matrixWorldInverse),
  53486. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53487. l.setFromMatrix(c),
  53488. p.length = 0,
  53489. o(f, g, T);
  53490. for (var N = 0, B = p.length; N < B; N++) {
  53491. var F = p[N]
  53492. , V = i.update(F)
  53493. , U = F.material;
  53494. if (U instanceof n.MultiMaterial)
  53495. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53496. var W = k[G]
  53497. , j = H[W.materialIndex];
  53498. if (j.visible === !0) {
  53499. var Y = r(F, j, v, d);
  53500. e.renderBufferDirect(T, null, V, Y, F, W)
  53501. }
  53502. }
  53503. else {
  53504. var Y = r(F, U, v, d);
  53505. e.renderBufferDirect(T, null, V, Y, F, null)
  53506. }
  53507. }
  53508. }
  53509. }
  53510. var X = e.getClearColor()
  53511. , Z = e.getClearAlpha();
  53512. e.setClearColor(X, Z),
  53513. s.enable(a.BLEND),
  53514. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53515. P.needsUpdate = !1
  53516. }
  53517. }
  53518. }
  53519. ,
  53520. n.WebGLState = function(e, t, i) {
  53521. var r = this
  53522. , o = new n.Vector4
  53523. , a = new Uint8Array(16)
  53524. , s = new Uint8Array(16)
  53525. , l = new Uint8Array(16)
  53526. , c = {}
  53527. , h = null
  53528. , u = null
  53529. , d = null
  53530. , p = null
  53531. , f = null
  53532. , g = null
  53533. , m = null
  53534. , v = null
  53535. , A = !1
  53536. , y = null
  53537. , C = null
  53538. , I = null
  53539. , E = null
  53540. , b = null
  53541. , w = null
  53542. , _ = null
  53543. , T = null
  53544. , x = null
  53545. , S = null
  53546. , M = null
  53547. , R = null
  53548. , P = null
  53549. , O = null
  53550. , L = null
  53551. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53552. , N = void 0
  53553. , B = {}
  53554. , F = new n.Vector4
  53555. , V = null
  53556. , U = null
  53557. , k = new n.Vector4
  53558. , H = new n.Vector4
  53559. , G = e.createTexture();
  53560. e.bindTexture(e.TEXTURE_2D, G),
  53561. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53562. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53563. this.init = function() {
  53564. this.clearColor(0, 0, 0, 1),
  53565. this.clearDepth(1),
  53566. this.clearStencil(0),
  53567. this.enable(e.DEPTH_TEST),
  53568. e.depthFunc(e.LEQUAL),
  53569. e.frontFace(e.CCW),
  53570. e.cullFace(e.BACK),
  53571. this.enable(e.CULL_FACE),
  53572. this.enable(e.BLEND),
  53573. e.blendEquation(e.FUNC_ADD),
  53574. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53575. }
  53576. ,
  53577. this.initAttributes = function() {
  53578. for (var e = 0, t = a.length; e < t; e++)
  53579. a[e] = 0
  53580. }
  53581. ,
  53582. this.enableAttribute = function(i) {
  53583. if (a[i] = 1,
  53584. 0 === s[i] && (e.enableVertexAttribArray(i),
  53585. s[i] = 1),
  53586. 0 !== l[i]) {
  53587. var n = t.get("ANGLE_instanced_arrays");
  53588. n.vertexAttribDivisorANGLE(i, 0),
  53589. l[i] = 0
  53590. }
  53591. }
  53592. ,
  53593. this.enableAttributeAndDivisor = function(t, i, n) {
  53594. a[t] = 1,
  53595. 0 === s[t] && (e.enableVertexAttribArray(t),
  53596. s[t] = 1),
  53597. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53598. l[t] = i)
  53599. }
  53600. ,
  53601. this.disableUnusedAttributes = function() {
  53602. for (var t = 0, i = s.length; t < i; t++)
  53603. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53604. s[t] = 0)
  53605. }
  53606. ,
  53607. this.enable = function(t) {
  53608. c[t] !== !0 && (e.enable(t),
  53609. c[t] = !0)
  53610. }
  53611. ,
  53612. this.disable = function(t) {
  53613. c[t] !== !1 && (e.disable(t),
  53614. c[t] = !1)
  53615. }
  53616. ,
  53617. this.getCompressedTextureFormats = function() {
  53618. if (null === h && (h = [],
  53619. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53620. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53621. h.push(i[n]);
  53622. return h
  53623. }
  53624. ,
  53625. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53626. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53627. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53628. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53629. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53630. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53631. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53632. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53633. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53634. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53635. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53636. u = t,
  53637. A = h),
  53638. t === n.CustomBlending ? (s = s || r,
  53639. l = l || o,
  53640. c = c || a,
  53641. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53642. d = r,
  53643. g = s),
  53644. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53645. p = o,
  53646. f = a,
  53647. m = l,
  53648. v = c)) : (d = null,
  53649. p = null,
  53650. f = null,
  53651. g = null,
  53652. m = null,
  53653. v = null)
  53654. }
  53655. ,
  53656. this.setDepthFunc = function(t) {
  53657. if (y !== t) {
  53658. if (t)
  53659. switch (t) {
  53660. case n.NeverDepth:
  53661. e.depthFunc(e.NEVER);
  53662. break;
  53663. case n.AlwaysDepth:
  53664. e.depthFunc(e.ALWAYS);
  53665. break;
  53666. case n.LessDepth:
  53667. e.depthFunc(e.LESS);
  53668. break;
  53669. case n.LessEqualDepth:
  53670. e.depthFunc(e.LEQUAL);
  53671. break;
  53672. case n.EqualDepth:
  53673. e.depthFunc(e.EQUAL);
  53674. break;
  53675. case n.GreaterEqualDepth:
  53676. e.depthFunc(e.GEQUAL);
  53677. break;
  53678. case n.GreaterDepth:
  53679. e.depthFunc(e.GREATER);
  53680. break;
  53681. case n.NotEqualDepth:
  53682. e.depthFunc(e.NOTEQUAL);
  53683. break;
  53684. default:
  53685. e.depthFunc(e.LEQUAL)
  53686. }
  53687. else
  53688. e.depthFunc(e.LEQUAL);
  53689. y = t
  53690. }
  53691. }
  53692. ,
  53693. this.setDepthTest = function(t) {
  53694. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53695. }
  53696. ,
  53697. this.setDepthWrite = function(t) {
  53698. C !== t && (e.depthMask(t),
  53699. C = t)
  53700. }
  53701. ,
  53702. this.setColorWrite = function(t) {
  53703. I !== t && (e.colorMask(t, t, t, t),
  53704. I = t)
  53705. }
  53706. ,
  53707. this.setStencilFunc = function(t, i, n) {
  53708. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53709. b = t,
  53710. w = i,
  53711. _ = n)
  53712. }
  53713. ,
  53714. this.setStencilOp = function(t, i, n) {
  53715. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53716. T = t,
  53717. x = i,
  53718. S = n)
  53719. }
  53720. ,
  53721. this.setStencilTest = function(t) {
  53722. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53723. }
  53724. ,
  53725. this.setStencilWrite = function(t) {
  53726. E !== t && (e.stencilMask(t),
  53727. E = t)
  53728. }
  53729. ,
  53730. this.setFlipSided = function(t) {
  53731. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53732. M = t)
  53733. }
  53734. ,
  53735. this.setLineWidth = function(t) {
  53736. t !== R && (e.lineWidth(t),
  53737. R = t)
  53738. }
  53739. ,
  53740. this.setPolygonOffset = function(t, i, n) {
  53741. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53742. !t || P === i && O === n || (e.polygonOffset(i, n),
  53743. P = i,
  53744. O = n)
  53745. }
  53746. ,
  53747. this.getScissorTest = function() {
  53748. return L
  53749. }
  53750. ,
  53751. this.setScissorTest = function(t) {
  53752. L = t,
  53753. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53754. }
  53755. ,
  53756. this.activeTexture = function(t) {
  53757. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53758. N !== t && (e.activeTexture(t),
  53759. N = t)
  53760. }
  53761. ,
  53762. this.bindTexture = function(t, i) {
  53763. void 0 === N && r.activeTexture();
  53764. var n = B[N];
  53765. void 0 === n && (n = {
  53766. type: void 0,
  53767. texture: void 0
  53768. },
  53769. B[N] = n),
  53770. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53771. n.type = t,
  53772. n.texture = i)
  53773. }
  53774. ,
  53775. this.compressedTexImage2D = function() {
  53776. try {
  53777. e.compressedTexImage2D.apply(e, arguments)
  53778. } catch (e) {
  53779. console.error(e)
  53780. }
  53781. }
  53782. ,
  53783. this.texImage2D = function() {
  53784. try {
  53785. e.texImage2D.apply(e, arguments)
  53786. } catch (e) {
  53787. console.error(e)
  53788. }
  53789. }
  53790. ,
  53791. this.clearColor = function(t, i, n, r) {
  53792. o.set(t, i, n, r),
  53793. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53794. F.copy(o))
  53795. }
  53796. ,
  53797. this.clearDepth = function(t) {
  53798. V !== t && (e.clearDepth(t),
  53799. V = t)
  53800. }
  53801. ,
  53802. this.clearStencil = function(t) {
  53803. U !== t && (e.clearStencil(t),
  53804. U = t)
  53805. }
  53806. ,
  53807. this.scissor = function(t) {
  53808. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53809. k.copy(t))
  53810. }
  53811. ,
  53812. this.viewport = function(t) {
  53813. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53814. H.copy(t))
  53815. }
  53816. ,
  53817. this.reset = function() {
  53818. for (var t = 0; t < s.length; t++)
  53819. 1 === s[t] && (e.disableVertexAttribArray(t),
  53820. s[t] = 0);
  53821. c = {},
  53822. h = null,
  53823. N = void 0,
  53824. B = {},
  53825. u = null,
  53826. I = null,
  53827. C = null,
  53828. E = null,
  53829. M = null
  53830. }
  53831. }
  53832. ,
  53833. n.LensFlarePlugin = function(e, t) {
  53834. function i() {
  53835. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53836. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53837. o = p.createBuffer(),
  53838. a = p.createBuffer(),
  53839. p.bindBuffer(p.ARRAY_BUFFER, o),
  53840. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53841. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53842. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53843. u = p.createTexture(),
  53844. d = p.createTexture(),
  53845. f.bindTexture(p.TEXTURE_2D, u),
  53846. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53847. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53848. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53849. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53850. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53851. f.bindTexture(p.TEXTURE_2D, d),
  53852. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53853. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53854. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53855. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53856. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53857. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53858. var i;
  53859. i = h ? {
  53860. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "uniform sampler2D occlusionMap;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", "vVisibility = visibility.r / 9.0;", "vVisibility *= 1.0 - visibility.g / 9.0;", "vVisibility *= visibility.b / 9.0;", "vVisibility *= 1.0 - visibility.a / 9.0;", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  53861. fragmentShader: ["uniform lowp int renderType;", "uniform sampler2D map;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * vVisibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  53862. } : {
  53863. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  53864. fragmentShader: ["precision mediump float;", "uniform lowp int renderType;", "uniform sampler2D map;", "uniform sampler2D occlusionMap;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", "visibility = ( 1.0 - visibility / 4.0 );", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * visibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  53865. },
  53866. s = r(i),
  53867. l = {
  53868. vertex: p.getAttribLocation(s, "position"),
  53869. uv: p.getAttribLocation(s, "uv")
  53870. },
  53871. c = {
  53872. renderType: p.getUniformLocation(s, "renderType"),
  53873. map: p.getUniformLocation(s, "map"),
  53874. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53875. opacity: p.getUniformLocation(s, "opacity"),
  53876. color: p.getUniformLocation(s, "color"),
  53877. scale: p.getUniformLocation(s, "scale"),
  53878. rotation: p.getUniformLocation(s, "rotation"),
  53879. screenPosition: p.getUniformLocation(s, "screenPosition")
  53880. }
  53881. }
  53882. function r(t) {
  53883. var i = p.createProgram()
  53884. , n = p.createShader(p.FRAGMENT_SHADER)
  53885. , r = p.createShader(p.VERTEX_SHADER)
  53886. , o = "precision " + e.getPrecision() + " float;\n";
  53887. return p.shaderSource(n, o + t.fragmentShader),
  53888. p.shaderSource(r, o + t.vertexShader),
  53889. p.compileShader(n),
  53890. p.compileShader(r),
  53891. p.attachShader(i, n),
  53892. p.attachShader(i, r),
  53893. p.linkProgram(i),
  53894. i
  53895. }
  53896. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53897. this.render = function(r, g, m) {
  53898. if (0 !== t.length) {
  53899. var v = new n.Vector3
  53900. , A = m.w / m.z
  53901. , y = .5 * m.z
  53902. , C = .5 * m.w
  53903. , I = 16 / m.w
  53904. , E = new n.Vector2(I * A,I)
  53905. , b = new n.Vector3(1,1,0)
  53906. , w = new n.Vector2(1,1);
  53907. void 0 === s && i(),
  53908. p.useProgram(s),
  53909. f.initAttributes(),
  53910. f.enableAttribute(l.vertex),
  53911. f.enableAttribute(l.uv),
  53912. f.disableUnusedAttributes(),
  53913. p.uniform1i(c.occlusionMap, 0),
  53914. p.uniform1i(c.map, 1),
  53915. p.bindBuffer(p.ARRAY_BUFFER, o),
  53916. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53917. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53918. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53919. f.disable(p.CULL_FACE),
  53920. f.setDepthWrite(!1);
  53921. for (var _ = 0, T = t.length; _ < T; _++) {
  53922. I = 16 / m.w,
  53923. E.set(I * A, I);
  53924. var x = t[_];
  53925. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53926. v.applyMatrix4(g.matrixWorldInverse),
  53927. v.applyProjection(g.projectionMatrix),
  53928. b.copy(v),
  53929. w.x = b.x * y + y,
  53930. w.y = b.y * C + C,
  53931. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53932. f.activeTexture(p.TEXTURE0),
  53933. f.bindTexture(p.TEXTURE_2D, null),
  53934. f.activeTexture(p.TEXTURE1),
  53935. f.bindTexture(p.TEXTURE_2D, u),
  53936. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53937. p.uniform1i(c.renderType, 0),
  53938. p.uniform2f(c.scale, E.x, E.y),
  53939. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53940. f.disable(p.BLEND),
  53941. f.enable(p.DEPTH_TEST),
  53942. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53943. f.activeTexture(p.TEXTURE0),
  53944. f.bindTexture(p.TEXTURE_2D, d),
  53945. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53946. p.uniform1i(c.renderType, 1),
  53947. f.disable(p.DEPTH_TEST),
  53948. f.activeTexture(p.TEXTURE1),
  53949. f.bindTexture(p.TEXTURE_2D, u),
  53950. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53951. x.positionScreen.copy(b),
  53952. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53953. p.uniform1i(c.renderType, 2),
  53954. f.enable(p.BLEND);
  53955. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53956. var R = x.lensFlares[S];
  53957. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53958. b.y = R.y,
  53959. b.z = R.z,
  53960. I = R.size * R.scale / m.w,
  53961. E.x = I * A,
  53962. E.y = I,
  53963. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53964. p.uniform2f(c.scale, E.x, E.y),
  53965. p.uniform1f(c.rotation, R.rotation),
  53966. p.uniform1f(c.opacity, R.opacity),
  53967. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53968. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53969. e.setTexture(R.texture, 1),
  53970. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53971. }
  53972. }
  53973. }
  53974. f.enable(p.CULL_FACE),
  53975. f.enable(p.DEPTH_TEST),
  53976. f.setDepthWrite(!0),
  53977. e.resetGLState()
  53978. }
  53979. }
  53980. }
  53981. ,
  53982. n.SpritePlugin = function(e, t) {
  53983. function i() {
  53984. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53985. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53986. a = d.createBuffer(),
  53987. s = d.createBuffer(),
  53988. d.bindBuffer(d.ARRAY_BUFFER, a),
  53989. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53990. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53991. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53992. l = r(),
  53993. c = {
  53994. position: d.getAttribLocation(l, "position"),
  53995. uv: d.getAttribLocation(l, "uv")
  53996. },
  53997. h = {
  53998. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53999. uvScale: d.getUniformLocation(l, "uvScale"),
  54000. rotation: d.getUniformLocation(l, "rotation"),
  54001. scale: d.getUniformLocation(l, "scale"),
  54002. color: d.getUniformLocation(l, "color"),
  54003. map: d.getUniformLocation(l, "map"),
  54004. opacity: d.getUniformLocation(l, "opacity"),
  54005. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54006. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54007. fogType: d.getUniformLocation(l, "fogType"),
  54008. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54009. fogNear: d.getUniformLocation(l, "fogNear"),
  54010. fogFar: d.getUniformLocation(l, "fogFar"),
  54011. fogColor: d.getUniformLocation(l, "fogColor"),
  54012. alphaTest: d.getUniformLocation(l, "alphaTest")
  54013. };
  54014. var i = document.createElement("canvas");
  54015. i.width = 8,
  54016. i.height = 8;
  54017. var o = i.getContext("2d");
  54018. o.fillStyle = "white",
  54019. o.fillRect(0, 0, 8, 8),
  54020. u = new n.Texture(i),
  54021. u.needsUpdate = !0
  54022. }
  54023. function r() {
  54024. var t = d.createProgram()
  54025. , i = d.createShader(d.VERTEX_SHADER)
  54026. , n = d.createShader(d.FRAGMENT_SHADER);
  54027. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  54028. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  54029. d.compileShader(i),
  54030. d.compileShader(n),
  54031. d.attachShader(t, i),
  54032. d.attachShader(t, n),
  54033. d.linkProgram(t),
  54034. t
  54035. }
  54036. function o(e, t) {
  54037. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54038. }
  54039. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  54040. this.render = function(r, v) {
  54041. if (0 !== t.length) {
  54042. void 0 === l && i(),
  54043. d.useProgram(l),
  54044. p.initAttributes(),
  54045. p.enableAttribute(c.position),
  54046. p.enableAttribute(c.uv),
  54047. p.disableUnusedAttributes(),
  54048. p.disable(d.CULL_FACE),
  54049. p.enable(d.BLEND),
  54050. d.bindBuffer(d.ARRAY_BUFFER, a),
  54051. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54052. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54053. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54054. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54055. p.activeTexture(d.TEXTURE0),
  54056. d.uniform1i(h.map, 0);
  54057. var A = 0
  54058. , y = 0
  54059. , C = r.fog;
  54060. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54061. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54062. d.uniform1f(h.fogFar, C.far),
  54063. d.uniform1i(h.fogType, 1),
  54064. A = 1,
  54065. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54066. d.uniform1i(h.fogType, 2),
  54067. A = 2,
  54068. y = 2)) : (d.uniform1i(h.fogType, 0),
  54069. A = 0,
  54070. y = 0);
  54071. for (var I = 0, E = t.length; I < E; I++) {
  54072. var b = t[I];
  54073. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54074. b.z = -b.modelViewMatrix.elements[14]
  54075. }
  54076. t.sort(o);
  54077. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54078. var b = t[I]
  54079. , _ = b.material;
  54080. d.uniform1f(h.alphaTest, _.alphaTest),
  54081. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54082. b.matrixWorld.decompose(f, g, m),
  54083. w[0] = m.x,
  54084. w[1] = m.y;
  54085. var T = 0;
  54086. r.fog && _.fog && (T = y),
  54087. A !== T && (d.uniform1i(h.fogType, T),
  54088. A = T),
  54089. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54090. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54091. d.uniform2f(h.uvScale, 1, 1)),
  54092. d.uniform1f(h.opacity, _.opacity),
  54093. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54094. d.uniform1f(h.rotation, _.rotation),
  54095. d.uniform2fv(h.scale, w),
  54096. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54097. p.setDepthTest(_.depthTest),
  54098. p.setDepthWrite(_.depthWrite),
  54099. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54100. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54101. }
  54102. p.enable(d.CULL_FACE),
  54103. e.resetGLState()
  54104. }
  54105. }
  54106. }
  54107. ,
  54108. Object.defineProperties(n.Box2.prototype, {
  54109. empty: {
  54110. value: function() {
  54111. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54112. this.isEmpty()
  54113. }
  54114. },
  54115. isIntersectionBox: {
  54116. value: function(e) {
  54117. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54118. this.intersectsBox(e)
  54119. }
  54120. }
  54121. }),
  54122. Object.defineProperties(n.Box3.prototype, {
  54123. empty: {
  54124. value: function() {
  54125. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54126. this.isEmpty()
  54127. }
  54128. },
  54129. isIntersectionBox: {
  54130. value: function(e) {
  54131. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54132. this.intersectsBox(e)
  54133. }
  54134. },
  54135. isIntersectionSphere: {
  54136. value: function(e) {
  54137. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54138. this.intersectsSphere(e)
  54139. }
  54140. }
  54141. }),
  54142. Object.defineProperties(n.Matrix3.prototype, {
  54143. multiplyVector3: {
  54144. value: function(e) {
  54145. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54146. e.applyMatrix3(this)
  54147. }
  54148. },
  54149. multiplyVector3Array: {
  54150. value: function(e) {
  54151. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54152. this.applyToVector3Array(e)
  54153. }
  54154. }
  54155. }),
  54156. Object.defineProperties(n.Matrix4.prototype, {
  54157. extractPosition: {
  54158. value: function(e) {
  54159. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54160. this.copyPosition(e)
  54161. }
  54162. },
  54163. setRotationFromQuaternion: {
  54164. value: function(e) {
  54165. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54166. this.makeRotationFromQuaternion(e)
  54167. }
  54168. },
  54169. multiplyVector3: {
  54170. value: function(e) {
  54171. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54172. e.applyProjection(this)
  54173. }
  54174. },
  54175. multiplyVector4: {
  54176. value: function(e) {
  54177. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54178. e.applyMatrix4(this)
  54179. }
  54180. },
  54181. multiplyVector3Array: {
  54182. value: function(e) {
  54183. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54184. this.applyToVector3Array(e)
  54185. }
  54186. },
  54187. rotateAxis: {
  54188. value: function(e) {
  54189. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54190. e.transformDirection(this)
  54191. }
  54192. },
  54193. crossVector: {
  54194. value: function(e) {
  54195. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54196. e.applyMatrix4(this)
  54197. }
  54198. },
  54199. translate: {
  54200. value: function(e) {
  54201. console.error("THREE.Matrix4: .translate() has been removed.")
  54202. }
  54203. },
  54204. rotateX: {
  54205. value: function(e) {
  54206. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54207. }
  54208. },
  54209. rotateY: {
  54210. value: function(e) {
  54211. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54212. }
  54213. },
  54214. rotateZ: {
  54215. value: function(e) {
  54216. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54217. }
  54218. },
  54219. rotateByAxis: {
  54220. value: function(e, t) {
  54221. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54222. }
  54223. }
  54224. }),
  54225. Object.defineProperties(n.Plane.prototype, {
  54226. isIntersectionLine: {
  54227. value: function(e) {
  54228. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54229. this.intersectsLine(e)
  54230. }
  54231. }
  54232. }),
  54233. Object.defineProperties(n.Quaternion.prototype, {
  54234. multiplyVector3: {
  54235. value: function(e) {
  54236. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54237. e.applyQuaternion(this)
  54238. }
  54239. }
  54240. }),
  54241. Object.defineProperties(n.Ray.prototype, {
  54242. isIntersectionBox: {
  54243. value: function(e) {
  54244. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54245. this.intersectsBox(e)
  54246. }
  54247. },
  54248. isIntersectionPlane: {
  54249. value: function(e) {
  54250. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54251. this.intersectsPlane(e)
  54252. }
  54253. },
  54254. isIntersectionSphere: {
  54255. value: function(e) {
  54256. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54257. this.intersectsSphere(e)
  54258. }
  54259. }
  54260. }),
  54261. Object.defineProperties(n.Vector3.prototype, {
  54262. setEulerFromRotationMatrix: {
  54263. value: function() {
  54264. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54265. }
  54266. },
  54267. setEulerFromQuaternion: {
  54268. value: function() {
  54269. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54270. }
  54271. },
  54272. getPositionFromMatrix: {
  54273. value: function(e) {
  54274. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54275. this.setFromMatrixPosition(e)
  54276. }
  54277. },
  54278. getScaleFromMatrix: {
  54279. value: function(e) {
  54280. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54281. this.setFromMatrixScale(e)
  54282. }
  54283. },
  54284. getColumnFromMatrix: {
  54285. value: function(e, t) {
  54286. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54287. this.setFromMatrixColumn(e, t)
  54288. }
  54289. }
  54290. }),
  54291. n.Face4 = function(e, t, i, r, o, a, s) {
  54292. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54293. new n.Face3(e,t,i,o,a,s)
  54294. }
  54295. ,
  54296. n.Vertex = function(e, t, i) {
  54297. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54298. new n.Vector3(e,t,i)
  54299. }
  54300. ,
  54301. Object.defineProperties(n.Object3D.prototype, {
  54302. eulerOrder: {
  54303. get: function() {
  54304. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54305. this.rotation.order
  54306. },
  54307. set: function(e) {
  54308. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54309. this.rotation.order = e
  54310. }
  54311. },
  54312. getChildByName: {
  54313. value: function(e) {
  54314. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54315. this.getObjectByName(e)
  54316. }
  54317. },
  54318. renderDepth: {
  54319. set: function(e) {
  54320. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54321. }
  54322. },
  54323. translate: {
  54324. value: function(e, t) {
  54325. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54326. this.translateOnAxis(t, e)
  54327. }
  54328. },
  54329. useQuaternion: {
  54330. get: function() {
  54331. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54332. },
  54333. set: function(e) {
  54334. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54335. }
  54336. }
  54337. }),
  54338. Object.defineProperties(n, {
  54339. PointCloud: {
  54340. value: function(e, t) {
  54341. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54342. new n.Points(e,t)
  54343. }
  54344. },
  54345. ParticleSystem: {
  54346. value: function(e, t) {
  54347. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54348. new n.Points(e,t)
  54349. }
  54350. }
  54351. }),
  54352. Object.defineProperties(n.Light.prototype, {
  54353. onlyShadow: {
  54354. set: function(e) {
  54355. console.warn("THREE.Light: .onlyShadow has been removed.")
  54356. }
  54357. },
  54358. shadowCameraFov: {
  54359. set: function(e) {
  54360. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54361. this.shadow.camera.fov = e
  54362. }
  54363. },
  54364. shadowCameraLeft: {
  54365. set: function(e) {
  54366. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54367. this.shadow.camera.left = e
  54368. }
  54369. },
  54370. shadowCameraRight: {
  54371. set: function(e) {
  54372. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54373. this.shadow.camera.right = e
  54374. }
  54375. },
  54376. shadowCameraTop: {
  54377. set: function(e) {
  54378. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54379. this.shadow.camera.top = e
  54380. }
  54381. },
  54382. shadowCameraBottom: {
  54383. set: function(e) {
  54384. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54385. this.shadow.camera.bottom = e
  54386. }
  54387. },
  54388. shadowCameraNear: {
  54389. set: function(e) {
  54390. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54391. this.shadow.camera.near = e
  54392. }
  54393. },
  54394. shadowCameraFar: {
  54395. set: function(e) {
  54396. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54397. this.shadow.camera.far = e
  54398. }
  54399. },
  54400. shadowCameraVisible: {
  54401. set: function(e) {
  54402. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54403. }
  54404. },
  54405. shadowBias: {
  54406. set: function(e) {
  54407. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54408. this.shadow.bias = e
  54409. }
  54410. },
  54411. shadowDarkness: {
  54412. set: function(e) {
  54413. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54414. }
  54415. },
  54416. shadowMapWidth: {
  54417. set: function(e) {
  54418. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54419. this.shadow.mapSize.width = e
  54420. }
  54421. },
  54422. shadowMapHeight: {
  54423. set: function(e) {
  54424. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54425. this.shadow.mapSize.height = e
  54426. }
  54427. }
  54428. }),
  54429. Object.defineProperties(n.BufferAttribute.prototype, {
  54430. length: {
  54431. get: function() {
  54432. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54433. this.array.length
  54434. }
  54435. }
  54436. }),
  54437. Object.defineProperties(n.BufferGeometry.prototype, {
  54438. drawcalls: {
  54439. get: function() {
  54440. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54441. this.groups
  54442. }
  54443. },
  54444. offsets: {
  54445. get: function() {
  54446. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54447. this.groups
  54448. }
  54449. },
  54450. addIndex: {
  54451. value: function(e) {
  54452. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54453. this.setIndex(e)
  54454. }
  54455. },
  54456. addDrawCall: {
  54457. value: function(e, t, i) {
  54458. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54459. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54460. this.addGroup(e, t)
  54461. }
  54462. },
  54463. clearDrawCalls: {
  54464. value: function() {
  54465. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54466. this.clearGroups()
  54467. }
  54468. },
  54469. computeTangents: {
  54470. value: function() {
  54471. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54472. }
  54473. },
  54474. computeOffsets: {
  54475. value: function() {
  54476. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54477. }
  54478. }
  54479. }),
  54480. Object.defineProperties(n.Material.prototype, {
  54481. wrapAround: {
  54482. get: function() {
  54483. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54484. },
  54485. set: function(e) {
  54486. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54487. }
  54488. },
  54489. wrapRGB: {
  54490. get: function() {
  54491. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54492. new n.Color
  54493. }
  54494. }
  54495. }),
  54496. Object.defineProperties(n, {
  54497. PointCloudMaterial: {
  54498. value: function(e) {
  54499. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54500. new n.PointsMaterial(e)
  54501. }
  54502. },
  54503. ParticleBasicMaterial: {
  54504. value: function(e) {
  54505. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54506. new n.PointsMaterial(e)
  54507. }
  54508. },
  54509. ParticleSystemMaterial: {
  54510. value: function(e) {
  54511. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54512. new n.PointsMaterial(e)
  54513. }
  54514. }
  54515. }),
  54516. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54517. metal: {
  54518. get: function() {
  54519. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54520. !1
  54521. },
  54522. set: function(e) {
  54523. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54524. }
  54525. }
  54526. }),
  54527. Object.defineProperties(n.ShaderMaterial.prototype, {
  54528. derivatives: {
  54529. get: function() {
  54530. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54531. this.extensions.derivatives
  54532. },
  54533. set: function(e) {
  54534. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54535. this.extensions.derivatives = e
  54536. }
  54537. }
  54538. }),
  54539. Object.defineProperties(n.WebGLRenderer.prototype, {
  54540. supportsFloatTextures: {
  54541. value: function() {
  54542. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54543. this.extensions.get("OES_texture_float")
  54544. }
  54545. },
  54546. supportsHalfFloatTextures: {
  54547. value: function() {
  54548. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54549. this.extensions.get("OES_texture_half_float")
  54550. }
  54551. },
  54552. supportsStandardDerivatives: {
  54553. value: function() {
  54554. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54555. this.extensions.get("OES_standard_derivatives")
  54556. }
  54557. },
  54558. supportsCompressedTextureS3TC: {
  54559. value: function() {
  54560. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54561. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54562. }
  54563. },
  54564. supportsCompressedTexturePVRTC: {
  54565. value: function() {
  54566. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54567. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54568. }
  54569. },
  54570. supportsBlendMinMax: {
  54571. value: function() {
  54572. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54573. this.extensions.get("EXT_blend_minmax")
  54574. }
  54575. },
  54576. supportsVertexTextures: {
  54577. value: function() {
  54578. return this.capabilities.vertexTextures
  54579. }
  54580. },
  54581. supportsInstancedArrays: {
  54582. value: function() {
  54583. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54584. this.extensions.get("ANGLE_instanced_arrays")
  54585. }
  54586. },
  54587. enableScissorTest: {
  54588. value: function(e) {
  54589. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54590. this.setScissorTest(e)
  54591. }
  54592. },
  54593. initMaterial: {
  54594. value: function() {
  54595. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54596. }
  54597. },
  54598. addPrePlugin: {
  54599. value: function() {
  54600. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54601. }
  54602. },
  54603. addPostPlugin: {
  54604. value: function() {
  54605. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54606. }
  54607. },
  54608. updateShadowMap: {
  54609. value: function() {
  54610. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54611. }
  54612. },
  54613. shadowMapEnabled: {
  54614. get: function() {
  54615. return this.shadowMap.enabled
  54616. },
  54617. set: function(e) {
  54618. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54619. this.shadowMap.enabled = e
  54620. }
  54621. },
  54622. shadowMapType: {
  54623. get: function() {
  54624. return this.shadowMap.type
  54625. },
  54626. set: function(e) {
  54627. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54628. this.shadowMap.type = e
  54629. }
  54630. },
  54631. shadowMapCullFace: {
  54632. get: function() {
  54633. return this.shadowMap.cullFace
  54634. },
  54635. set: function(e) {
  54636. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54637. this.shadowMap.cullFace = e
  54638. }
  54639. }
  54640. }),
  54641. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54642. wrapS: {
  54643. get: function() {
  54644. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54645. this.texture.wrapS
  54646. },
  54647. set: function(e) {
  54648. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54649. this.texture.wrapS = e
  54650. }
  54651. },
  54652. wrapT: {
  54653. get: function() {
  54654. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54655. this.texture.wrapT
  54656. },
  54657. set: function(e) {
  54658. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54659. this.texture.wrapT = e
  54660. }
  54661. },
  54662. magFilter: {
  54663. get: function() {
  54664. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54665. this.texture.magFilter
  54666. },
  54667. set: function(e) {
  54668. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54669. this.texture.magFilter = e
  54670. }
  54671. },
  54672. minFilter: {
  54673. get: function() {
  54674. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54675. this.texture.minFilter
  54676. },
  54677. set: function(e) {
  54678. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54679. this.texture.minFilter = e
  54680. }
  54681. },
  54682. anisotropy: {
  54683. get: function() {
  54684. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54685. this.texture.anisotropy
  54686. },
  54687. set: function(e) {
  54688. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54689. this.texture.anisotropy = e
  54690. }
  54691. },
  54692. offset: {
  54693. get: function() {
  54694. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54695. this.texture.offset
  54696. },
  54697. set: function(e) {
  54698. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54699. this.texture.offset = e
  54700. }
  54701. },
  54702. repeat: {
  54703. get: function() {
  54704. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54705. this.texture.repeat
  54706. },
  54707. set: function(e) {
  54708. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54709. this.texture.repeat = e
  54710. }
  54711. },
  54712. format: {
  54713. get: function() {
  54714. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54715. this.texture.format
  54716. },
  54717. set: function(e) {
  54718. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54719. this.texture.format = e
  54720. }
  54721. },
  54722. type: {
  54723. get: function() {
  54724. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54725. this.texture.type
  54726. },
  54727. set: function(e) {
  54728. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54729. this.texture.type = e
  54730. }
  54731. },
  54732. generateMipmaps: {
  54733. get: function() {
  54734. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54735. this.texture.generateMipmaps
  54736. },
  54737. set: function(e) {
  54738. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54739. this.texture.generateMipmaps = e
  54740. }
  54741. }
  54742. }),
  54743. n.GeometryUtils = {
  54744. merge: function(e, t, i) {
  54745. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54746. var r;
  54747. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54748. r = t.matrix,
  54749. t = t.geometry),
  54750. e.merge(t, r, i)
  54751. },
  54752. center: function(e) {
  54753. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54754. e.center()
  54755. }
  54756. },
  54757. n.ImageUtils = {
  54758. crossOrigin: void 0,
  54759. loadTexture: function(e, t, i, r) {
  54760. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54761. var o = new n.TextureLoader;
  54762. o.setCrossOrigin(this.crossOrigin);
  54763. var a = o.load(e, i, void 0, r);
  54764. return t && (a.mapping = t),
  54765. a
  54766. },
  54767. loadTextureCube: function(e, t, i, r) {
  54768. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54769. var o = new n.CubeTextureLoader;
  54770. o.setCrossOrigin(this.crossOrigin);
  54771. var a = o.load(e, i, void 0, r);
  54772. return t && (a.mapping = t),
  54773. a
  54774. },
  54775. loadCompressedTexture: function() {
  54776. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54777. },
  54778. loadCompressedTextureCube: function() {
  54779. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54780. }
  54781. },
  54782. n.Projector = function() {
  54783. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54784. this.projectVector = function(e, t) {
  54785. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54786. e.project(t)
  54787. }
  54788. ,
  54789. this.unprojectVector = function(e, t) {
  54790. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54791. e.unproject(t)
  54792. }
  54793. ,
  54794. this.pickingRay = function(e, t) {
  54795. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54796. }
  54797. }
  54798. ,
  54799. n.CanvasRenderer = function() {
  54800. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54801. this.domElement = document.createElement("canvas"),
  54802. this.clear = function() {}
  54803. ,
  54804. this.render = function() {}
  54805. ,
  54806. this.setClearColor = function() {}
  54807. ,
  54808. this.setSize = function() {}
  54809. }
  54810. ,
  54811. n.MeshFaceMaterial = n.MultiMaterial,
  54812. n.CurveUtils = {
  54813. tangentQuadraticBezier: function(e, t, i, n) {
  54814. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54815. },
  54816. tangentCubicBezier: function(e, t, i, n, r) {
  54817. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  54818. },
  54819. tangentSpline: function(e, t, i, n, r) {
  54820. var o = 6 * e * e - 6 * e
  54821. , a = 3 * e * e - 4 * e + 1
  54822. , s = -6 * e * e + 6 * e
  54823. , l = 3 * e * e - 2 * e;
  54824. return o + a + s + l
  54825. },
  54826. interpolate: function(e, t, i, n, r) {
  54827. var o = .5 * (i - e)
  54828. , a = .5 * (n - t)
  54829. , s = r * r
  54830. , l = r * s;
  54831. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54832. }
  54833. },
  54834. n.SceneUtils = {
  54835. createMultiMaterialObject: function(e, t) {
  54836. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54837. i.add(new n.Mesh(e,t[r]));
  54838. return i
  54839. },
  54840. detach: function(e, t, i) {
  54841. e.applyMatrix(t.matrixWorld),
  54842. t.remove(e),
  54843. i.add(e)
  54844. },
  54845. attach: function(e, t, i) {
  54846. var r = new n.Matrix4;
  54847. r.getInverse(i.matrixWorld),
  54848. e.applyMatrix(r),
  54849. t.remove(e),
  54850. i.add(e)
  54851. }
  54852. },
  54853. n.ShapeUtils = {
  54854. area: function(e) {
  54855. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54856. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54857. return .5 * i
  54858. },
  54859. triangulate: function() {
  54860. function e(e, t, i, n, r, o) {
  54861. var a, s, l, c, h, u, d, p, f;
  54862. if (s = e[o[t]].x,
  54863. l = e[o[t]].y,
  54864. c = e[o[i]].x,
  54865. h = e[o[i]].y,
  54866. u = e[o[n]].x,
  54867. d = e[o[n]].y,
  54868. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54869. return !1;
  54870. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54871. for (g = u - c,
  54872. m = d - h,
  54873. v = s - u,
  54874. A = l - d,
  54875. y = c - s,
  54876. C = h - l,
  54877. a = 0; a < r; a++)
  54878. if (p = e[o[a]].x,
  54879. f = e[o[a]].y,
  54880. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54881. E = f - l,
  54882. b = p - c,
  54883. w = f - h,
  54884. _ = p - u,
  54885. T = f - d,
  54886. M = g * w - m * b,
  54887. x = y * E - C * I,
  54888. S = v * T - A * _,
  54889. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54890. return !1;
  54891. return !0
  54892. }
  54893. return function(t, i) {
  54894. var r = t.length;
  54895. if (r < 3)
  54896. return null;
  54897. var o, a, s, l = [], c = [], h = [];
  54898. if (n.ShapeUtils.area(t) > 0)
  54899. for (a = 0; a < r; a++)
  54900. c[a] = a;
  54901. else
  54902. for (a = 0; a < r; a++)
  54903. c[a] = r - 1 - a;
  54904. var u = r
  54905. , d = 2 * u;
  54906. for (a = u - 1; u > 2; ) {
  54907. if (d-- <= 0)
  54908. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54909. i ? h : l;
  54910. if (o = a,
  54911. u <= o && (o = 0),
  54912. a = o + 1,
  54913. u <= a && (a = 0),
  54914. s = a + 1,
  54915. u <= s && (s = 0),
  54916. e(t, o, a, s, u, c)) {
  54917. var p, f, g, m, v;
  54918. for (p = c[o],
  54919. f = c[a],
  54920. g = c[s],
  54921. l.push([t[p], t[f], t[g]]),
  54922. h.push([c[o], c[a], c[s]]),
  54923. m = a,
  54924. v = a + 1; v < u; m++,
  54925. v++)
  54926. c[m] = c[v];
  54927. u--,
  54928. d = 2 * u
  54929. }
  54930. }
  54931. return i ? h : l
  54932. }
  54933. }(),
  54934. triangulateShape: function(e, t) {
  54935. function i(e, t, i) {
  54936. return e.x !== t.x ? e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  54937. }
  54938. function r(e, t, n, r, o) {
  54939. var a = t.x - e.x
  54940. , s = t.y - e.y
  54941. , l = r.x - n.x
  54942. , c = r.y - n.y
  54943. , h = e.x - n.x
  54944. , u = e.y - n.y
  54945. , d = s * l - a * c
  54946. , p = s * h - a * u;
  54947. if (Math.abs(d) > Number.EPSILON) {
  54948. var f;
  54949. if (d > 0) {
  54950. if (p < 0 || p > d)
  54951. return [];
  54952. if (f = c * h - l * u,
  54953. f < 0 || f > d)
  54954. return []
  54955. } else {
  54956. if (p > 0 || p < d)
  54957. return [];
  54958. if (f = c * h - l * u,
  54959. f > 0 || f < d)
  54960. return []
  54961. }
  54962. if (0 === f)
  54963. return !o || 0 !== p && p !== d ? [e] : [];
  54964. if (f === d)
  54965. return !o || 0 !== p && p !== d ? [t] : [];
  54966. if (0 === p)
  54967. return [n];
  54968. if (p === d)
  54969. return [r];
  54970. var g = f / d;
  54971. return [{
  54972. x: e.x + g * a,
  54973. y: e.y + g * s
  54974. }]
  54975. }
  54976. if (0 !== p || c * h !== l * u)
  54977. return [];
  54978. var m = 0 === a && 0 === s
  54979. , v = 0 === l && 0 === c;
  54980. if (m && v)
  54981. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54982. if (m)
  54983. return i(n, r, e) ? [e] : [];
  54984. if (v)
  54985. return i(e, t, n) ? [n] : [];
  54986. var A, y, C, I, E, b, w, _;
  54987. return 0 !== a ? (e.x < t.x ? (A = e,
  54988. C = e.x,
  54989. y = t,
  54990. I = t.x) : (A = t,
  54991. C = t.x,
  54992. y = e,
  54993. I = e.x),
  54994. n.x < r.x ? (E = n,
  54995. w = n.x,
  54996. b = r,
  54997. _ = r.x) : (E = r,
  54998. w = r.x,
  54999. b = n,
  55000. _ = n.x)) : (e.y < t.y ? (A = e,
  55001. C = e.y,
  55002. y = t,
  55003. I = t.y) : (A = t,
  55004. C = t.y,
  55005. y = e,
  55006. I = e.y),
  55007. n.y < r.y ? (E = n,
  55008. w = n.y,
  55009. b = r,
  55010. _ = r.y) : (E = r,
  55011. w = r.y,
  55012. b = n,
  55013. _ = n.y)),
  55014. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55015. }
  55016. function o(e, t, i, n) {
  55017. var r = t.x - e.x
  55018. , o = t.y - e.y
  55019. , a = i.x - e.x
  55020. , s = i.y - e.y
  55021. , l = n.x - e.x
  55022. , c = n.y - e.y
  55023. , h = r * s - o * a
  55024. , u = r * c - o * l;
  55025. if (Math.abs(h) > Number.EPSILON) {
  55026. var d = l * s - c * a;
  55027. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55028. }
  55029. return u > 0
  55030. }
  55031. function a(e, t) {
  55032. function i(e, t) {
  55033. var i = A.length - 1
  55034. , n = e - 1;
  55035. n < 0 && (n = i);
  55036. var r = e + 1;
  55037. r > i && (r = 0);
  55038. var a = o(A[e], A[n], A[r], s[t]);
  55039. if (!a)
  55040. return !1;
  55041. var l = s.length - 1
  55042. , c = t - 1;
  55043. c < 0 && (c = l);
  55044. var h = t + 1;
  55045. return h > l && (h = 0),
  55046. a = o(s[t], s[c], s[h], A[e]),
  55047. !!a
  55048. }
  55049. function n(e, t) {
  55050. var i, n, o;
  55051. for (i = 0; i < A.length; i++)
  55052. if (n = i + 1,
  55053. n %= A.length,
  55054. o = r(e, t, A[i], A[n], !0),
  55055. o.length > 0)
  55056. return !0;
  55057. return !1
  55058. }
  55059. function a(e, i) {
  55060. var n, o, a, s, l;
  55061. for (n = 0; n < y.length; n++)
  55062. for (o = t[y[n]],
  55063. a = 0; a < o.length; a++)
  55064. if (s = a + 1,
  55065. s %= o.length,
  55066. l = r(e, i, o[a], o[s], !0),
  55067. l.length > 0)
  55068. return !0;
  55069. return !1
  55070. }
  55071. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  55072. y.push(I);
  55073. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55074. if (w--,
  55075. w < 0) {
  55076. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55077. break
  55078. }
  55079. for (c = b; c < A.length; c++) {
  55080. h = A[c],
  55081. l = -1;
  55082. for (var I = 0; I < y.length; I++)
  55083. if (d = y[I],
  55084. p = h.x + ":" + h.y + ":" + d,
  55085. void 0 === C[p]) {
  55086. s = t[d];
  55087. for (var _ = 0; _ < s.length; _++)
  55088. if (u = s[_],
  55089. i(c, _) && !n(h, u) && !a(h, u)) {
  55090. l = _,
  55091. y.splice(I, 1),
  55092. f = A.slice(0, c + 1),
  55093. g = A.slice(c),
  55094. m = s.slice(l),
  55095. v = s.slice(0, l + 1),
  55096. A = f.concat(m).concat(v).concat(g),
  55097. b = c;
  55098. break
  55099. }
  55100. if (l >= 0)
  55101. break;
  55102. C[p] = !0
  55103. }
  55104. if (l >= 0)
  55105. break
  55106. }
  55107. }
  55108. return A
  55109. }
  55110. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55111. Array.prototype.push.apply(f, t[g]);
  55112. for (s = 0,
  55113. l = f.length; s < l; s++)
  55114. u = f[s].x + ":" + f[s].y,
  55115. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55116. p[u] = s;
  55117. var v = a(e, t)
  55118. , A = n.ShapeUtils.triangulate(v, !1);
  55119. for (s = 0,
  55120. l = A.length; s < l; s++)
  55121. for (h = A[s],
  55122. c = 0; c < 3; c++)
  55123. u = h[c].x + ":" + h[c].y,
  55124. d = p[u],
  55125. void 0 !== d && (h[c] = d);
  55126. return A.concat()
  55127. },
  55128. isClockWise: function(e) {
  55129. return n.ShapeUtils.area(e) < 0
  55130. },
  55131. b2: function() {
  55132. function e(e, t) {
  55133. var i = 1 - e;
  55134. return i * i * t
  55135. }
  55136. function t(e, t) {
  55137. return 2 * (1 - e) * e * t
  55138. }
  55139. function i(e, t) {
  55140. return e * e * t
  55141. }
  55142. return function(n, r, o, a) {
  55143. return e(n, r) + t(n, o) + i(n, a)
  55144. }
  55145. }(),
  55146. b3: function() {
  55147. function e(e, t) {
  55148. var i = 1 - e;
  55149. return i * i * i * t
  55150. }
  55151. function t(e, t) {
  55152. var i = 1 - e;
  55153. return 3 * i * i * e * t
  55154. }
  55155. function i(e, t) {
  55156. var i = 1 - e;
  55157. return 3 * i * e * e * t
  55158. }
  55159. function n(e, t) {
  55160. return e * e * e * t
  55161. }
  55162. return function(r, o, a, s, l) {
  55163. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55164. }
  55165. }()
  55166. },
  55167. n.Curve = function() {}
  55168. ,
  55169. n.Curve.prototype = {
  55170. constructor: n.Curve,
  55171. getPoint: function(e) {
  55172. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55173. null
  55174. },
  55175. getPointAt: function(e) {
  55176. var t = this.getUtoTmapping(e);
  55177. return this.getPoint(t)
  55178. },
  55179. getPoints: function(e) {
  55180. e || (e = 5);
  55181. var t, i = [];
  55182. for (t = 0; t <= e; t++)
  55183. i.push(this.getPoint(t / e));
  55184. return i
  55185. },
  55186. getSpacedPoints: function(e) {
  55187. e || (e = 5);
  55188. var t, i = [];
  55189. for (t = 0; t <= e; t++)
  55190. i.push(this.getPointAt(t / e));
  55191. return i
  55192. },
  55193. getLength: function() {
  55194. var e = this.getLengths();
  55195. return e[e.length - 1]
  55196. },
  55197. getLengths: function(e) {
  55198. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55199. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55200. return this.cacheArcLengths;
  55201. this.needsUpdate = !1;
  55202. var t, i, n = [], r = this.getPoint(0), o = 0;
  55203. for (n.push(0),
  55204. i = 1; i <= e; i++)
  55205. t = this.getPoint(i / e),
  55206. o += t.distanceTo(r),
  55207. n.push(o),
  55208. r = t;
  55209. return this.cacheArcLengths = n,
  55210. n
  55211. },
  55212. updateArcLengths: function() {
  55213. this.needsUpdate = !0,
  55214. this.getLengths()
  55215. },
  55216. getUtoTmapping: function(e, t) {
  55217. var i, n = this.getLengths(), r = 0, o = n.length;
  55218. i = t ? t : e * n[o - 1];
  55219. for (var a, s = 0, l = o - 1; s <= l; )
  55220. if (r = Math.floor(s + (l - s) / 2),
  55221. a = n[r] - i,
  55222. a < 0)
  55223. s = r + 1;
  55224. else {
  55225. if (!(a > 0)) {
  55226. l = r;
  55227. break
  55228. }
  55229. l = r - 1
  55230. }
  55231. if (r = l,
  55232. n[r] === i) {
  55233. var c = r / (o - 1);
  55234. return c
  55235. }
  55236. var h = n[r]
  55237. , u = n[r + 1]
  55238. , d = u - h
  55239. , p = (i - h) / d
  55240. , c = (r + p) / (o - 1);
  55241. return c
  55242. },
  55243. getTangent: function(e) {
  55244. var t = 1e-4
  55245. , i = e - t
  55246. , n = e + t;
  55247. i < 0 && (i = 0),
  55248. n > 1 && (n = 1);
  55249. var r = this.getPoint(i)
  55250. , o = this.getPoint(n)
  55251. , a = o.clone().sub(r);
  55252. return a.normalize()
  55253. },
  55254. getTangentAt: function(e) {
  55255. var t = this.getUtoTmapping(e);
  55256. return this.getTangent(t)
  55257. }
  55258. },
  55259. n.Curve.create = function(e, t) {
  55260. return e.prototype = Object.create(n.Curve.prototype),
  55261. e.prototype.constructor = e,
  55262. e.prototype.getPoint = t,
  55263. e
  55264. }
  55265. ,
  55266. n.CurvePath = function() {
  55267. this.curves = [],
  55268. this.autoClose = !1
  55269. }
  55270. ,
  55271. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55272. n.CurvePath.prototype.constructor = n.CurvePath,
  55273. n.CurvePath.prototype.add = function(e) {
  55274. this.curves.push(e)
  55275. }
  55276. ,
  55277. n.CurvePath.prototype.closePath = function() {
  55278. var e = this.curves[0].getPoint(0)
  55279. , t = this.curves[this.curves.length - 1].getPoint(1);
  55280. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55281. }
  55282. ,
  55283. n.CurvePath.prototype.getPoint = function(e) {
  55284. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55285. if (i[n] >= t) {
  55286. var r = i[n] - t
  55287. , o = this.curves[n]
  55288. , a = 1 - r / o.getLength();
  55289. return o.getPointAt(a)
  55290. }
  55291. n++
  55292. }
  55293. return null
  55294. }
  55295. ,
  55296. n.CurvePath.prototype.getLength = function() {
  55297. var e = this.getCurveLengths();
  55298. return e[e.length - 1]
  55299. }
  55300. ,
  55301. n.CurvePath.prototype.getCurveLengths = function() {
  55302. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55303. return this.cacheLengths;
  55304. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55305. t += this.curves[i].getLength(),
  55306. e.push(t);
  55307. return this.cacheLengths = e,
  55308. e
  55309. }
  55310. ,
  55311. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55312. var t = this.getPoints(e);
  55313. return this.createGeometry(t)
  55314. }
  55315. ,
  55316. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55317. var t = this.getSpacedPoints(e);
  55318. return this.createGeometry(t)
  55319. }
  55320. ,
  55321. n.CurvePath.prototype.createGeometry = function(e) {
  55322. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55323. var o = e[i];
  55324. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55325. }
  55326. return t
  55327. }
  55328. ,
  55329. n.Font = function(e) {
  55330. this.data = e
  55331. }
  55332. ,
  55333. n.Font.prototype = {
  55334. constructor: n.Font,
  55335. generateShapes: function(e, t, i) {
  55336. function r(e) {
  55337. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55338. var c = o(i[l], n, r);
  55339. r += c.offset,
  55340. s.push(c.path)
  55341. }
  55342. return s
  55343. }
  55344. function o(e, t, r) {
  55345. var o = a.glyphs[e] || a.glyphs["?"];
  55346. if (o) {
  55347. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  55348. if (o.o)
  55349. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55350. var _ = E[b++];
  55351. switch (_) {
  55352. case "m":
  55353. s = E[b++] * t + r,
  55354. l = E[b++] * t,
  55355. A.moveTo(s, l);
  55356. break;
  55357. case "l":
  55358. s = E[b++] * t + r,
  55359. l = E[b++] * t,
  55360. A.lineTo(s, l);
  55361. break;
  55362. case "q":
  55363. if (c = E[b++] * t + r,
  55364. h = E[b++] * t,
  55365. p = E[b++] * t + r,
  55366. f = E[b++] * t,
  55367. A.quadraticCurveTo(p, f, c, h),
  55368. v = y[y.length - 1]) {
  55369. u = v.x,
  55370. d = v.y;
  55371. for (var T = 1; T <= i; T++) {
  55372. var x = T / i;
  55373. C(x, u, p, c),
  55374. C(x, d, f, h)
  55375. }
  55376. }
  55377. break;
  55378. case "b":
  55379. if (c = E[b++] * t + r,
  55380. h = E[b++] * t,
  55381. p = E[b++] * t + r,
  55382. f = E[b++] * t,
  55383. g = E[b++] * t + r,
  55384. m = E[b++] * t,
  55385. A.bezierCurveTo(p, f, g, m, c, h),
  55386. v = y[y.length - 1]) {
  55387. u = v.x,
  55388. d = v.y;
  55389. for (var T = 1; T <= i; T++) {
  55390. var x = T / i;
  55391. I(x, u, p, g, c),
  55392. I(x, d, f, m, h)
  55393. }
  55394. }
  55395. }
  55396. }
  55397. return {
  55398. offset: o.ha * t,
  55399. path: A
  55400. }
  55401. }
  55402. }
  55403. void 0 === t && (t = 100),
  55404. void 0 === i && (i = 4);
  55405. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55406. Array.prototype.push.apply(l, s[c].toShapes());
  55407. return l
  55408. }
  55409. },
  55410. n.Path = function(e) {
  55411. n.CurvePath.call(this),
  55412. this.actions = [],
  55413. e && this.fromPoints(e)
  55414. }
  55415. ,
  55416. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55417. n.Path.prototype.constructor = n.Path,
  55418. n.Path.prototype.fromPoints = function(e) {
  55419. this.moveTo(e[0].x, e[0].y);
  55420. for (var t = 1, i = e.length; t < i; t++)
  55421. this.lineTo(e[t].x, e[t].y)
  55422. }
  55423. ,
  55424. n.Path.prototype.moveTo = function(e, t) {
  55425. this.actions.push({
  55426. action: "moveTo",
  55427. args: [e, t]
  55428. })
  55429. }
  55430. ,
  55431. n.Path.prototype.lineTo = function(e, t) {
  55432. var i = this.actions[this.actions.length - 1].args
  55433. , r = i[i.length - 2]
  55434. , o = i[i.length - 1]
  55435. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55436. this.curves.push(a),
  55437. this.actions.push({
  55438. action: "lineTo",
  55439. args: [e, t]
  55440. })
  55441. }
  55442. ,
  55443. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55444. var o = this.actions[this.actions.length - 1].args
  55445. , a = o[o.length - 2]
  55446. , s = o[o.length - 1]
  55447. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55448. this.curves.push(l),
  55449. this.actions.push({
  55450. action: "quadraticCurveTo",
  55451. args: [e, t, i, r]
  55452. })
  55453. }
  55454. ,
  55455. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55456. var s = this.actions[this.actions.length - 1].args
  55457. , l = s[s.length - 2]
  55458. , c = s[s.length - 1]
  55459. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55460. this.curves.push(h),
  55461. this.actions.push({
  55462. action: "bezierCurveTo",
  55463. args: [e, t, i, r, o, a]
  55464. })
  55465. }
  55466. ,
  55467. n.Path.prototype.splineThru = function(e) {
  55468. var t = Array.prototype.slice.call(arguments)
  55469. , i = this.actions[this.actions.length - 1].args
  55470. , r = i[i.length - 2]
  55471. , o = i[i.length - 1]
  55472. , a = [new n.Vector2(r,o)];
  55473. Array.prototype.push.apply(a, e);
  55474. var s = new n.SplineCurve(a);
  55475. this.curves.push(s),
  55476. this.actions.push({
  55477. action: "splineThru",
  55478. args: t
  55479. })
  55480. }
  55481. ,
  55482. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55483. var a = this.actions[this.actions.length - 1].args
  55484. , s = a[a.length - 2]
  55485. , l = a[a.length - 1];
  55486. this.absarc(e + s, t + l, i, n, r, o)
  55487. }
  55488. ,
  55489. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55490. this.absellipse(e, t, i, i, n, r, o)
  55491. }
  55492. ,
  55493. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55494. var l = this.actions[this.actions.length - 1].args
  55495. , c = l[l.length - 2]
  55496. , h = l[l.length - 1];
  55497. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55498. }
  55499. ,
  55500. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55501. var c = [e, t, i, r, o, a, s, l || 0]
  55502. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55503. this.curves.push(h);
  55504. var u = h.getPoint(1);
  55505. c.push(u.x),
  55506. c.push(u.y),
  55507. this.actions.push({
  55508. action: "ellipse",
  55509. args: c
  55510. })
  55511. }
  55512. ,
  55513. n.Path.prototype.getSpacedPoints = function(e) {
  55514. e || (e = 40);
  55515. for (var t = [], i = 0; i < e; i++)
  55516. t.push(this.getPoint(i / e));
  55517. return this.autoClose && t.push(t[0]),
  55518. t
  55519. }
  55520. ,
  55521. n.Path.prototype.getPoints = function(e) {
  55522. e = e || 12;
  55523. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  55524. var A = this.actions[m]
  55525. , y = A.action
  55526. , C = A.args;
  55527. switch (y) {
  55528. case "moveTo":
  55529. g.push(new n.Vector2(C[0],C[1]));
  55530. break;
  55531. case "lineTo":
  55532. g.push(new n.Vector2(C[0],C[1]));
  55533. break;
  55534. case "quadraticCurveTo":
  55535. t = C[2],
  55536. i = C[3],
  55537. a = C[0],
  55538. s = C[1],
  55539. g.length > 0 ? (h = g[g.length - 1],
  55540. l = h.x,
  55541. c = h.y) : (h = this.actions[m - 1].args,
  55542. l = h[h.length - 2],
  55543. c = h[h.length - 1]);
  55544. for (var I = 1; I <= e; I++) {
  55545. var E = I / e;
  55546. u = p(E, l, a, t),
  55547. d = p(E, c, s, i),
  55548. g.push(new n.Vector2(u,d))
  55549. }
  55550. break;
  55551. case "bezierCurveTo":
  55552. t = C[4],
  55553. i = C[5],
  55554. a = C[0],
  55555. s = C[1],
  55556. r = C[2],
  55557. o = C[3],
  55558. g.length > 0 ? (h = g[g.length - 1],
  55559. l = h.x,
  55560. c = h.y) : (h = this.actions[m - 1].args,
  55561. l = h[h.length - 2],
  55562. c = h[h.length - 1]);
  55563. for (var I = 1; I <= e; I++) {
  55564. var E = I / e;
  55565. u = f(E, l, a, r, t),
  55566. d = f(E, c, s, o, i),
  55567. g.push(new n.Vector2(u,d))
  55568. }
  55569. break;
  55570. case "splineThru":
  55571. h = this.actions[m - 1].args;
  55572. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55573. , w = [b]
  55574. , _ = e * C[0].length;
  55575. w = w.concat(C[0]);
  55576. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55577. g.push(T.getPointAt(I / _));
  55578. break;
  55579. case "arc":
  55580. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  55581. var E = I / N;
  55582. L || (E = 1 - E),
  55583. x = P + E * D,
  55584. u = S + R * Math.cos(x),
  55585. d = M + R * Math.sin(x),
  55586. g.push(new n.Vector2(u,d))
  55587. }
  55588. break;
  55589. case "ellipse":
  55590. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  55591. 0 !== k && (B = Math.cos(k),
  55592. F = Math.sin(k));
  55593. for (var I = 1; I <= N; I++) {
  55594. var E = I / N;
  55595. if (L || (E = 1 - E),
  55596. x = P + E * D,
  55597. u = S + V * Math.cos(x),
  55598. d = M + U * Math.sin(x),
  55599. 0 !== k) {
  55600. var H = u
  55601. , G = d;
  55602. u = (H - S) * B - (G - M) * F + S,
  55603. d = (H - S) * F + (G - M) * B + M
  55604. }
  55605. g.push(new n.Vector2(u,d))
  55606. }
  55607. }
  55608. }
  55609. var z = g[g.length - 1];
  55610. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  55611. this.autoClose && g.push(g[0]),
  55612. g
  55613. }
  55614. ,
  55615. n.Path.prototype.toShapes = function(e, t) {
  55616. function i(e) {
  55617. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55618. var a = e[r]
  55619. , s = a.args
  55620. , l = a.action;
  55621. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55622. i = new n.Path),
  55623. i[l].apply(i, s)
  55624. }
  55625. return 0 !== i.actions.length && t.push(i),
  55626. t
  55627. }
  55628. function r(e) {
  55629. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55630. var o = e[i]
  55631. , a = new n.Shape;
  55632. a.actions = o.actions,
  55633. a.curves = o.curves,
  55634. t.push(a)
  55635. }
  55636. return t
  55637. }
  55638. function o(e, t) {
  55639. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55640. var a = t[r]
  55641. , s = t[o]
  55642. , l = s.x - a.x
  55643. , c = s.y - a.y;
  55644. if (Math.abs(c) > Number.EPSILON) {
  55645. if (c < 0 && (a = t[o],
  55646. l = -l,
  55647. s = t[r],
  55648. c = -c),
  55649. e.y < a.y || e.y > s.y)
  55650. continue;
  55651. if (e.y === a.y) {
  55652. if (e.x === a.x)
  55653. return !0
  55654. } else {
  55655. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55656. if (0 === h)
  55657. return !0;
  55658. if (h < 0)
  55659. continue;
  55660. n = !n
  55661. }
  55662. } else {
  55663. if (e.y !== a.y)
  55664. continue;
  55665. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55666. return !0
  55667. }
  55668. }
  55669. return n
  55670. }
  55671. var a = n.ShapeUtils.isClockWise
  55672. , s = i(this.actions);
  55673. if (0 === s.length)
  55674. return [];
  55675. if (t === !0)
  55676. return r(s);
  55677. var l, c, h, u = [];
  55678. if (1 === s.length)
  55679. return c = s[0],
  55680. h = new n.Shape,
  55681. h.actions = c.actions,
  55682. h.curves = c.curves,
  55683. u.push(h),
  55684. u;
  55685. var d = !a(s[0].getPoints());
  55686. d = e ? !d : d;
  55687. var p, f = [], g = [], m = [], v = 0;
  55688. g[v] = void 0,
  55689. m[v] = [];
  55690. for (var A = 0, y = s.length; A < y; A++)
  55691. c = s[A],
  55692. p = c.getPoints(),
  55693. l = a(p),
  55694. l = e ? !l : l,
  55695. l ? (!d && g[v] && v++,
  55696. g[v] = {
  55697. s: new n.Shape,
  55698. p: p
  55699. },
  55700. g[v].s.actions = c.actions,
  55701. g[v].s.curves = c.curves,
  55702. d && v++,
  55703. m[v] = []) : m[v].push({
  55704. h: c,
  55705. p: p[0]
  55706. });
  55707. if (!g[0])
  55708. return r(s);
  55709. if (g.length > 1) {
  55710. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55711. f[E] = [];
  55712. for (var E = 0, b = g.length; E < b; E++)
  55713. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55714. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55715. o(T.p, g[S].p) && (E !== S && I.push({
  55716. froms: E,
  55717. tos: S,
  55718. hole: _
  55719. }),
  55720. x ? (x = !1,
  55721. f[S].push(T)) : C = !0);
  55722. x && f[E].push(T)
  55723. }
  55724. I.length > 0 && (C || (m = f))
  55725. }
  55726. for (var M, A = 0, R = g.length; A < R; A++) {
  55727. h = g[A].s,
  55728. u.push(h),
  55729. M = m[A];
  55730. for (var P = 0, O = M.length; P < O; P++)
  55731. h.holes.push(M[P].h)
  55732. }
  55733. return u
  55734. }
  55735. ,
  55736. n.Shape = function() {
  55737. n.Path.apply(this, arguments),
  55738. this.holes = []
  55739. }
  55740. ,
  55741. n.Shape.prototype = Object.create(n.Path.prototype),
  55742. n.Shape.prototype.constructor = n.Shape,
  55743. n.Shape.prototype.extrude = function(e) {
  55744. return new n.ExtrudeGeometry(this,e)
  55745. }
  55746. ,
  55747. n.Shape.prototype.makeGeometry = function(e) {
  55748. return new n.ShapeGeometry(this,e)
  55749. }
  55750. ,
  55751. n.Shape.prototype.getPointsHoles = function(e) {
  55752. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55753. t[i] = this.holes[i].getPoints(e);
  55754. return t
  55755. }
  55756. ,
  55757. n.Shape.prototype.extractAllPoints = function(e) {
  55758. return {
  55759. shape: this.getPoints(e),
  55760. holes: this.getPointsHoles(e)
  55761. }
  55762. }
  55763. ,
  55764. n.Shape.prototype.extractPoints = function(e) {
  55765. return this.extractAllPoints(e)
  55766. }
  55767. ,
  55768. n.LineCurve = function(e, t) {
  55769. this.v1 = e,
  55770. this.v2 = t
  55771. }
  55772. ,
  55773. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55774. n.LineCurve.prototype.constructor = n.LineCurve,
  55775. n.LineCurve.prototype.getPoint = function(e) {
  55776. var t = this.v2.clone().sub(this.v1);
  55777. return t.multiplyScalar(e).add(this.v1),
  55778. t
  55779. }
  55780. ,
  55781. n.LineCurve.prototype.getPointAt = function(e) {
  55782. return this.getPoint(e)
  55783. }
  55784. ,
  55785. n.LineCurve.prototype.getTangent = function(e) {
  55786. var t = this.v2.clone().sub(this.v1);
  55787. return t.normalize()
  55788. }
  55789. ,
  55790. n.QuadraticBezierCurve = function(e, t, i) {
  55791. this.v0 = e,
  55792. this.v1 = t,
  55793. this.v2 = i
  55794. }
  55795. ,
  55796. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55797. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55798. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55799. var t = n.ShapeUtils.b2;
  55800. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  55801. }
  55802. ,
  55803. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55804. var t = n.CurveUtils.tangentQuadraticBezier;
  55805. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  55806. }
  55807. ,
  55808. n.CubicBezierCurve = function(e, t, i, n) {
  55809. this.v0 = e,
  55810. this.v1 = t,
  55811. this.v2 = i,
  55812. this.v3 = n
  55813. }
  55814. ,
  55815. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55816. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55817. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55818. var t = n.ShapeUtils.b3;
  55819. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  55820. }
  55821. ,
  55822. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55823. var t = n.CurveUtils.tangentCubicBezier;
  55824. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  55825. }
  55826. ,
  55827. n.SplineCurve = function(e) {
  55828. this.points = void 0 == e ? [] : e
  55829. }
  55830. ,
  55831. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55832. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55833. n.SplineCurve.prototype.getPoint = function(e) {
  55834. var t = this.points
  55835. , i = (t.length - 1) * e
  55836. , r = Math.floor(i)
  55837. , o = i - r
  55838. , a = t[0 === r ? r : r - 1]
  55839. , s = t[r]
  55840. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55841. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55842. , h = n.CurveUtils.interpolate;
  55843. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55844. }
  55845. ,
  55846. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55847. this.aX = e,
  55848. this.aY = t,
  55849. this.xRadius = i,
  55850. this.yRadius = n,
  55851. this.aStartAngle = r,
  55852. this.aEndAngle = o,
  55853. this.aClockwise = a,
  55854. this.aRotation = s || 0
  55855. }
  55856. ,
  55857. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55858. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55859. n.EllipseCurve.prototype.getPoint = function(e) {
  55860. var t = this.aEndAngle - this.aStartAngle;
  55861. t < 0 && (t += 2 * Math.PI),
  55862. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55863. var i;
  55864. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55865. var r = this.aX + this.xRadius * Math.cos(i)
  55866. , o = this.aY + this.yRadius * Math.sin(i);
  55867. if (0 !== this.aRotation) {
  55868. var a = Math.cos(this.aRotation)
  55869. , s = Math.sin(this.aRotation)
  55870. , l = r
  55871. , c = o;
  55872. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55873. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55874. }
  55875. return new n.Vector2(r,o)
  55876. }
  55877. ,
  55878. n.ArcCurve = function(e, t, i, r, o, a) {
  55879. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55880. }
  55881. ,
  55882. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55883. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55884. n.LineCurve3 = n.Curve.create(function(e, t) {
  55885. this.v1 = e,
  55886. this.v2 = t
  55887. }, function(e) {
  55888. var t = new n.Vector3;
  55889. return t.subVectors(this.v2, this.v1),
  55890. t.multiplyScalar(e),
  55891. t.add(this.v1),
  55892. t
  55893. }),
  55894. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55895. this.v0 = e,
  55896. this.v1 = t,
  55897. this.v2 = i
  55898. }, function(e) {
  55899. var t = n.ShapeUtils.b2;
  55900. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  55901. }),
  55902. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55903. this.v0 = e,
  55904. this.v1 = t,
  55905. this.v2 = i,
  55906. this.v3 = n
  55907. }, function(e) {
  55908. var t = n.ShapeUtils.b3;
  55909. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  55910. }),
  55911. n.SplineCurve3 = n.Curve.create(function(e) {
  55912. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55913. this.points = void 0 == e ? [] : e
  55914. }, function(e) {
  55915. var t = this.points
  55916. , i = (t.length - 1) * e
  55917. , r = Math.floor(i)
  55918. , o = i - r
  55919. , a = t[0 == r ? r : r - 1]
  55920. , s = t[r]
  55921. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55922. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55923. , h = n.CurveUtils.interpolate;
  55924. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  55925. }),
  55926. n.CatmullRomCurve3 = function() {
  55927. function e() {}
  55928. var t = new n.Vector3
  55929. , i = new e
  55930. , r = new e
  55931. , o = new e;
  55932. return e.prototype.init = function(e, t, i, n) {
  55933. this.c0 = e,
  55934. this.c1 = i,
  55935. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55936. this.c3 = 2 * e - 2 * t + i + n
  55937. }
  55938. ,
  55939. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55940. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55941. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55942. s *= o,
  55943. l *= o,
  55944. this.init(t, i, s, l)
  55945. }
  55946. ,
  55947. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55948. this.init(t, i, r * (i - e), r * (n - t))
  55949. }
  55950. ,
  55951. e.prototype.calc = function(e) {
  55952. var t = e * e
  55953. , i = t * e;
  55954. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55955. }
  55956. ,
  55957. n.Curve.create(function(e) {
  55958. this.points = e || [],
  55959. this.closed = !1
  55960. }, function(e) {
  55961. var a, s, l, c, h = this.points;
  55962. c = h.length,
  55963. c < 2 && console.log("duh, you need at least 2 points"),
  55964. a = (c - (this.closed ? 0 : 1)) * e,
  55965. s = Math.floor(a),
  55966. l = a - s,
  55967. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55968. l = 1);
  55969. var u, d, p, f;
  55970. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55971. u = t),
  55972. d = h[s % c],
  55973. p = h[(s + 1) % c],
  55974. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55975. f = t),
  55976. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55977. var g = "chordal" === this.type ? .5 : .25
  55978. , m = Math.pow(u.distanceToSquared(d), g)
  55979. , v = Math.pow(d.distanceToSquared(p), g)
  55980. , A = Math.pow(p.distanceToSquared(f), g);
  55981. v < 1e-4 && (v = 1),
  55982. m < 1e-4 && (m = v),
  55983. A < 1e-4 && (A = v),
  55984. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55985. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55986. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55987. } else if ("catmullrom" === this.type) {
  55988. var y = void 0 !== this.tension ? this.tension : .5;
  55989. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55990. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55991. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55992. }
  55993. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55994. return C
  55995. })
  55996. }(),
  55997. n.ClosedSplineCurve3 = function(e) {
  55998. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55999. n.CatmullRomCurve3.call(this, e),
  56000. this.type = "catmullrom",
  56001. this.closed = !0
  56002. }
  56003. ,
  56004. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56005. n.BoxGeometry = function(e, t, i, r, o, a) {
  56006. n.Geometry.call(this),
  56007. this.type = "BoxGeometry",
  56008. this.parameters = {
  56009. width: e,
  56010. height: t,
  56011. depth: i,
  56012. widthSegments: r,
  56013. heightSegments: o,
  56014. depthSegments: a
  56015. },
  56016. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56017. this.mergeVertices()
  56018. }
  56019. ,
  56020. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56021. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56022. n.CubeGeometry = n.BoxGeometry,
  56023. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56024. function s(e, t, i) {
  56025. var n = 0;
  56026. return n += e * t * 2,
  56027. n += e * i * 2,
  56028. n += i * t * 2,
  56029. 4 * n
  56030. }
  56031. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56032. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  56033. for (var L = O * b - _, D = 0; D < x; D++) {
  56034. var N = D * E - w;
  56035. P[e] = N * r,
  56036. P[t] = L * o,
  56037. P[i] = T,
  56038. p[m] = P.x,
  56039. p[m + 1] = P.y,
  56040. p[m + 2] = P.z,
  56041. P[e] = 0,
  56042. P[t] = 0,
  56043. P[i] = l > 0 ? 1 : -1,
  56044. f[m] = P.x,
  56045. f[m + 1] = P.y,
  56046. f[m + 2] = P.z,
  56047. g[v] = D / h,
  56048. g[v + 1] = 1 - O / u,
  56049. m += 3,
  56050. v += 2,
  56051. M += 1
  56052. }
  56053. for (O = 0; O < u; O++)
  56054. for (D = 0; D < h; D++) {
  56055. var B = y + D + x * O
  56056. , F = y + D + x * (O + 1)
  56057. , V = y + (D + 1) + x * (O + 1)
  56058. , U = y + (D + 1) + x * O;
  56059. d[A] = B,
  56060. d[A + 1] = F,
  56061. d[A + 2] = U,
  56062. d[A + 3] = F,
  56063. d[A + 4] = V,
  56064. d[A + 5] = U,
  56065. A += 6,
  56066. R += 6
  56067. }
  56068. c.addGroup(C, R, I),
  56069. C += R,
  56070. y += M
  56071. }
  56072. n.BufferGeometry.call(this),
  56073. this.type = "BoxBufferGeometry",
  56074. this.parameters = {
  56075. width: e,
  56076. height: t,
  56077. depth: i,
  56078. widthSegments: r,
  56079. heightSegments: o,
  56080. depthSegments: a
  56081. };
  56082. var c = this;
  56083. r = Math.floor(r) || 1,
  56084. o = Math.floor(o) || 1,
  56085. a = Math.floor(a) || 1;
  56086. var h = s(r, o, a)
  56087. , u = h / 4 * 6
  56088. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56089. , p = new Float32Array(3 * h)
  56090. , f = new Float32Array(3 * h)
  56091. , g = new Float32Array(2 * h)
  56092. , m = 0
  56093. , v = 0
  56094. , A = 0
  56095. , y = 0
  56096. , C = 0;
  56097. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56098. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56099. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56100. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56101. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56102. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56103. this.setIndex(new n.BufferAttribute(d,1)),
  56104. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56105. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56106. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56107. }
  56108. ,
  56109. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56110. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56111. n.CircleGeometry = function(e, t, i, r) {
  56112. n.Geometry.call(this),
  56113. this.type = "CircleGeometry",
  56114. this.parameters = {
  56115. radius: e,
  56116. segments: t,
  56117. thetaStart: i,
  56118. thetaLength: r
  56119. },
  56120. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56121. }
  56122. ,
  56123. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56124. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56125. n.CircleBufferGeometry = function(e, t, i, r) {
  56126. n.BufferGeometry.call(this),
  56127. this.type = "CircleBufferGeometry",
  56128. this.parameters = {
  56129. radius: e,
  56130. segments: t,
  56131. thetaStart: i,
  56132. thetaLength: r
  56133. },
  56134. e = e || 50,
  56135. t = void 0 !== t ? Math.max(3, t) : 8,
  56136. i = void 0 !== i ? i : 0,
  56137. r = void 0 !== r ? r : 2 * Math.PI;
  56138. var o = t + 2
  56139. , a = new Float32Array(3 * o)
  56140. , s = new Float32Array(3 * o)
  56141. , l = new Float32Array(2 * o);
  56142. s[2] = 1,
  56143. l[0] = .5,
  56144. l[1] = .5;
  56145. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56146. h += 3,
  56147. u += 2) {
  56148. var d = i + c / t * r;
  56149. a[h] = e * Math.cos(d),
  56150. a[h + 1] = e * Math.sin(d),
  56151. s[h + 2] = 1,
  56152. l[u] = (a[h] / e + 1) / 2,
  56153. l[u + 1] = (a[h + 1] / e + 1) / 2
  56154. }
  56155. for (var p = [], h = 1; h <= t; h++)
  56156. p.push(h, h + 1, 0);
  56157. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56158. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56159. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56160. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56161. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56162. }
  56163. ,
  56164. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56165. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56166. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56167. function c() {
  56168. var e = (r + 1) * (o + 1);
  56169. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56170. e
  56171. }
  56172. function h() {
  56173. var e = r * o * 2 * 3;
  56174. return a === !1 && (e += 2 * r * 3),
  56175. e
  56176. }
  56177. function u() {
  56178. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56179. for (c = 0; c <= o; c++) {
  56180. var p = []
  56181. , f = c / o
  56182. , b = f * (t - e) + e;
  56183. for (a = 0; a <= r; a++) {
  56184. var w = a / r;
  56185. u.x = b * Math.sin(w * l + s),
  56186. u.y = -f * i + E,
  56187. u.z = b * Math.cos(w * l + s),
  56188. m.setXYZ(y, u.x, u.y, u.z),
  56189. h.copy(u),
  56190. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56191. h.z = Math.cos(w * l + s)),
  56192. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56193. v.setXYZ(y, h.x, h.y, h.z),
  56194. A.setXY(y, w, 1 - f),
  56195. p.push(y),
  56196. y++
  56197. }
  56198. I.push(p)
  56199. }
  56200. for (a = 0; a < r; a++)
  56201. for (c = 0; c < o; c++) {
  56202. var _ = I[c][a]
  56203. , T = I[c + 1][a]
  56204. , x = I[c + 1][a + 1]
  56205. , S = I[c][a + 1];
  56206. g.setX(C, _),
  56207. C++,
  56208. g.setX(C, T),
  56209. C++,
  56210. g.setX(C, S),
  56211. C++,
  56212. g.setX(C, T),
  56213. C++,
  56214. g.setX(C, x),
  56215. C++,
  56216. g.setX(C, S),
  56217. C++
  56218. }
  56219. }
  56220. function d(i) {
  56221. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56222. for (a = y,
  56223. o = 1; o <= r; o++)
  56224. m.setXYZ(y, 0, E * p, 0),
  56225. v.setXYZ(y, 0, p, 0),
  56226. i === !0 ? (h.x = o / r,
  56227. h.y = 0) : (h.x = (o - 1) / r,
  56228. h.y = 1),
  56229. A.setXY(y, h.x, h.y),
  56230. y++;
  56231. for (c = y,
  56232. o = 0; o <= r; o++) {
  56233. var f = o / r;
  56234. u.x = d * Math.sin(f * l + s),
  56235. u.y = E * p,
  56236. u.z = d * Math.cos(f * l + s),
  56237. m.setXYZ(y, u.x, u.y, u.z),
  56238. v.setXYZ(y, 0, p, 0),
  56239. A.setXY(y, f, i === !0 ? 1 : 0),
  56240. y++
  56241. }
  56242. for (o = 0; o < r; o++) {
  56243. var I = a + o
  56244. , b = c + o;
  56245. i === !0 ? (g.setX(C, b),
  56246. C++,
  56247. g.setX(C, b + 1),
  56248. C++,
  56249. g.setX(C, I),
  56250. C++) : (g.setX(C, b + 1),
  56251. C++,
  56252. g.setX(C, b),
  56253. C++,
  56254. g.setX(C, I),
  56255. C++)
  56256. }
  56257. }
  56258. n.BufferGeometry.call(this),
  56259. this.type = "CylinderBufferGeometry",
  56260. this.parameters = {
  56261. radiusTop: e,
  56262. radiusBottom: t,
  56263. height: i,
  56264. radialSegments: r,
  56265. heightSegments: o,
  56266. openEnded: a,
  56267. thetaStart: s,
  56268. thetaLength: l
  56269. },
  56270. e = void 0 !== e ? e : 20,
  56271. t = void 0 !== t ? t : 20,
  56272. i = void 0 !== i ? i : 100,
  56273. r = Math.floor(r) || 8,
  56274. o = Math.floor(o) || 1,
  56275. a = void 0 !== a && a,
  56276. s = void 0 !== s ? s : 0,
  56277. l = void 0 !== l ? l : 2 * Math.PI;
  56278. var p = c()
  56279. , f = h()
  56280. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56281. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56282. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56283. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56284. , y = 0
  56285. , C = 0
  56286. , I = []
  56287. , E = i / 2;
  56288. u(),
  56289. a === !1 && (e > 0 && d(!0),
  56290. t > 0 && d(!1)),
  56291. this.setIndex(g),
  56292. this.addAttribute("position", m),
  56293. this.addAttribute("normal", v),
  56294. this.addAttribute("uv", A)
  56295. }
  56296. ,
  56297. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56298. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56299. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56300. n.Geometry.call(this),
  56301. this.type = "CylinderGeometry",
  56302. this.parameters = {
  56303. radiusTop: e,
  56304. radiusBottom: t,
  56305. height: i,
  56306. radialSegments: r,
  56307. heightSegments: o,
  56308. openEnded: a,
  56309. thetaStart: s,
  56310. thetaLength: l
  56311. },
  56312. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56313. this.mergeVertices()
  56314. }
  56315. ,
  56316. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56317. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56318. n.EdgesGeometry = function(e, t) {
  56319. function i(e, t) {
  56320. return e - t
  56321. }
  56322. n.BufferGeometry.call(this),
  56323. t = void 0 !== t ? t : 1;
  56324. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56325. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56326. r.fromBufferGeometry(e)) : r = e.clone(),
  56327. r.mergeVertices(),
  56328. r.computeFaceNormals();
  56329. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56330. for (var p = h[u], f = 0; f < 3; f++) {
  56331. a[0] = p[l[f]],
  56332. a[1] = p[l[(f + 1) % 3]],
  56333. a.sort(i);
  56334. var g = a.toString();
  56335. void 0 === s[g] ? s[g] = {
  56336. vert1: a[0],
  56337. vert2: a[1],
  56338. face1: u,
  56339. face2: void 0
  56340. } : s[g].face2 = u
  56341. }
  56342. var m = [];
  56343. for (var g in s) {
  56344. var v = s[g];
  56345. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56346. var A = c[v.vert1];
  56347. m.push(A.x),
  56348. m.push(A.y),
  56349. m.push(A.z),
  56350. A = c[v.vert2],
  56351. m.push(A.x),
  56352. m.push(A.y),
  56353. m.push(A.z)
  56354. }
  56355. }
  56356. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56357. }
  56358. ,
  56359. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56360. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56361. n.ExtrudeGeometry = function(e, t) {
  56362. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56363. this.type = "ExtrudeGeometry",
  56364. e = Array.isArray(e) ? e : [e],
  56365. this.addShapeList(e, t),
  56366. void this.computeFaceNormals())
  56367. }
  56368. ;
  56369. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56370. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56371. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56372. for (var i = e.length, n = 0; n < i; n++) {
  56373. var r = e[n];
  56374. this.addShape(r, t)
  56375. }
  56376. }
  56377. ,
  56378. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56379. function i(e, t, i) {
  56380. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56381. t.clone().multiplyScalar(i).add(e)
  56382. }
  56383. function r(e, t, i) {
  56384. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  56385. if (Math.abs(d) > Number.EPSILON) {
  56386. var p = Math.sqrt(u)
  56387. , f = Math.sqrt(c * c + h * h)
  56388. , g = t.x - l / p
  56389. , m = t.y + s / p
  56390. , v = i.x - h / f
  56391. , A = i.y + c / f
  56392. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56393. r = g + s * y - e.x,
  56394. o = m + l * y - e.y;
  56395. var C = r * r + o * o;
  56396. if (C <= 2)
  56397. return new n.Vector2(r,o);
  56398. a = Math.sqrt(C / 2)
  56399. } else {
  56400. var I = !1;
  56401. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56402. I ? (r = -l,
  56403. o = s,
  56404. a = Math.sqrt(u)) : (r = s,
  56405. o = l,
  56406. a = Math.sqrt(u / 2))
  56407. }
  56408. return new n.Vector2(r / a,o / a)
  56409. }
  56410. function o() {
  56411. if (C) {
  56412. var e = 0
  56413. , t = z * e;
  56414. for (Y = 0; Y < W; Y++)
  56415. G = N[Y],
  56416. c(G[2] + t, G[1] + t, G[0] + t);
  56417. for (e = E + 2 * y,
  56418. t = z * e,
  56419. Y = 0; Y < W; Y++)
  56420. G = N[Y],
  56421. c(G[0] + t, G[1] + t, G[2] + t)
  56422. } else {
  56423. for (Y = 0; Y < W; Y++)
  56424. G = N[Y],
  56425. c(G[2], G[1], G[0]);
  56426. for (Y = 0; Y < W; Y++)
  56427. G = N[Y],
  56428. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56429. }
  56430. }
  56431. function a() {
  56432. var e = 0;
  56433. for (s(B, e),
  56434. e += B.length,
  56435. x = 0,
  56436. S = L.length; x < S; x++)
  56437. T = L[x],
  56438. s(T, e),
  56439. e += T.length
  56440. }
  56441. function s(e, t) {
  56442. var i, n;
  56443. for (Y = e.length; --Y >= 0; ) {
  56444. i = Y,
  56445. n = Y - 1,
  56446. n < 0 && (n = e.length - 1);
  56447. var r = 0
  56448. , o = E + 2 * y;
  56449. for (r = 0; r < o; r++) {
  56450. var a = z * r
  56451. , s = z * (r + 1)
  56452. , l = t + i + a
  56453. , c = t + n + a
  56454. , u = t + n + s
  56455. , d = t + i + s;
  56456. h(l, c, u, d, e, r, o, i, n)
  56457. }
  56458. }
  56459. }
  56460. function l(e, t, i) {
  56461. M.vertices.push(new n.Vector3(e,t,i))
  56462. }
  56463. function c(e, t, i) {
  56464. e += R,
  56465. t += R,
  56466. i += R,
  56467. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56468. var r = _.generateTopUV(M, e, t, i);
  56469. M.faceVertexUvs[0].push(r)
  56470. }
  56471. function h(e, t, i, r, o, a, s, l, c) {
  56472. e += R,
  56473. t += R,
  56474. i += R,
  56475. r += R,
  56476. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56477. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56478. var h = _.generateSideWallUV(M, e, t, i, r);
  56479. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56480. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56481. }
  56482. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  56483. b && (u = b.getSpacedPoints(E),
  56484. w = !0,
  56485. C = !1,
  56486. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56487. p = new n.Vector3,
  56488. f = new n.Vector3,
  56489. g = new n.Vector3),
  56490. C || (y = 0,
  56491. v = 0,
  56492. A = 0);
  56493. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  56494. if (D) {
  56495. for (O = O.reverse(),
  56496. x = 0,
  56497. S = L.length; x < S; x++)
  56498. T = L[x],
  56499. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56500. D = !1
  56501. }
  56502. var N = n.ShapeUtils.triangulateShape(O, L)
  56503. , B = O;
  56504. for (x = 0,
  56505. S = L.length; x < S; x++)
  56506. T = L[x],
  56507. O = O.concat(T);
  56508. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  56509. Z++,
  56510. q++)
  56511. Z === X && (Z = 0),
  56512. q === X && (q = 0),
  56513. j[Y] = r(B[Y], B[Z], B[q]);
  56514. var K, Q = [], J = j.concat();
  56515. for (x = 0,
  56516. S = L.length; x < S; x++) {
  56517. for (T = L[x],
  56518. K = [],
  56519. Y = 0,
  56520. X = T.length,
  56521. Z = X - 1,
  56522. q = Y + 1; Y < X; Y++,
  56523. Z++,
  56524. q++)
  56525. Z === X && (Z = 0),
  56526. q === X && (q = 0),
  56527. K[Y] = r(T[Y], T[Z], T[q]);
  56528. Q.push(K),
  56529. J = J.concat(K)
  56530. }
  56531. for (F = 0; F < y; F++) {
  56532. for (U = F / y,
  56533. k = v * (1 - U),
  56534. V = A * Math.sin(U * Math.PI / 2),
  56535. Y = 0,
  56536. X = B.length; Y < X; Y++)
  56537. H = i(B[Y], j[Y], V),
  56538. l(H.x, H.y, -k);
  56539. for (x = 0,
  56540. S = L.length; x < S; x++)
  56541. for (T = L[x],
  56542. K = Q[x],
  56543. Y = 0,
  56544. X = T.length; Y < X; Y++)
  56545. H = i(T[Y], K[Y], V),
  56546. l(H.x, H.y, -k)
  56547. }
  56548. for (V = A,
  56549. Y = 0; Y < z; Y++)
  56550. H = C ? i(O[Y], J[Y], V) : O[Y],
  56551. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56552. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56553. g.copy(u[0]).add(f).add(p),
  56554. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56555. var $;
  56556. for ($ = 1; $ <= E; $++)
  56557. for (Y = 0; Y < z; Y++)
  56558. H = C ? i(O[Y], J[Y], V) : O[Y],
  56559. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56560. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56561. g.copy(u[$]).add(f).add(p),
  56562. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56563. for (F = y - 1; F >= 0; F--) {
  56564. for (U = F / y,
  56565. k = v * (1 - U),
  56566. V = A * Math.sin(U * Math.PI / 2),
  56567. Y = 0,
  56568. X = B.length; Y < X; Y++)
  56569. H = i(B[Y], j[Y], V),
  56570. l(H.x, H.y, m + k);
  56571. for (x = 0,
  56572. S = L.length; x < S; x++)
  56573. for (T = L[x],
  56574. K = Q[x],
  56575. Y = 0,
  56576. X = T.length; Y < X; Y++)
  56577. H = i(T[Y], K[Y], V),
  56578. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56579. }
  56580. o(),
  56581. a()
  56582. }
  56583. ,
  56584. n.ExtrudeGeometry.WorldUVGenerator = {
  56585. generateTopUV: function(e, t, i, r) {
  56586. var o = e.vertices
  56587. , a = o[t]
  56588. , s = o[i]
  56589. , l = o[r];
  56590. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56591. },
  56592. generateSideWallUV: function(e, t, i, r, o) {
  56593. var a = e.vertices
  56594. , s = a[t]
  56595. , l = a[i]
  56596. , c = a[r]
  56597. , h = a[o];
  56598. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  56599. }
  56600. },
  56601. n.ShapeGeometry = function(e, t) {
  56602. n.Geometry.call(this),
  56603. this.type = "ShapeGeometry",
  56604. Array.isArray(e) === !1 && (e = [e]),
  56605. this.addShapeList(e, t),
  56606. this.computeFaceNormals()
  56607. }
  56608. ,
  56609. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56610. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56611. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56612. for (var i = 0, n = e.length; i < n; i++)
  56613. this.addShape(e[i], t);
  56614. return this
  56615. }
  56616. ,
  56617. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56618. void 0 === t && (t = {});
  56619. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  56620. if (p) {
  56621. for (u = u.reverse(),
  56622. i = 0,
  56623. r = d.length; i < r; i++)
  56624. o = d[i],
  56625. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56626. p = !1
  56627. }
  56628. var f = n.ShapeUtils.triangulateShape(u, d);
  56629. for (i = 0,
  56630. r = d.length; i < r; i++)
  56631. o = d[i],
  56632. u = u.concat(o);
  56633. var g, m, v = u.length, A = f.length;
  56634. for (i = 0; i < v; i++)
  56635. g = u[i],
  56636. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56637. for (i = 0; i < A; i++) {
  56638. m = f[i];
  56639. var y = m[0] + c
  56640. , C = m[1] + c
  56641. , I = m[2] + c;
  56642. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56643. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56644. }
  56645. }
  56646. ,
  56647. n.LatheBufferGeometry = function(e, t, i, r) {
  56648. n.BufferGeometry.call(this),
  56649. this.type = "LatheBufferGeometry",
  56650. this.parameters = {
  56651. points: e,
  56652. segments: t,
  56653. phiStart: i,
  56654. phiLength: r
  56655. },
  56656. t = Math.floor(t) || 12,
  56657. i = i || 0,
  56658. r = r || 2 * Math.PI,
  56659. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56660. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  56661. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56662. for (a = 0; a <= t; a++) {
  56663. var A = i + a * g * r
  56664. , y = Math.sin(A)
  56665. , C = Math.cos(A);
  56666. for (s = 0; s <= e.length - 1; s++)
  56667. m.x = e[s].x * y,
  56668. m.y = e[s].y,
  56669. m.z = e[s].x * C,
  56670. u.setXYZ(p, m.x, m.y, m.z),
  56671. v.x = a / t,
  56672. v.y = s / (e.length - 1),
  56673. d.setXY(p, v.x, v.y),
  56674. p++
  56675. }
  56676. for (a = 0; a < t; a++)
  56677. for (s = 0; s < e.length - 1; s++) {
  56678. o = s + a * e.length;
  56679. var I = o
  56680. , E = o + e.length
  56681. , b = o + e.length + 1
  56682. , w = o + 1;
  56683. h.setX(f, I),
  56684. f++,
  56685. h.setX(f, E),
  56686. f++,
  56687. h.setX(f, w),
  56688. f++,
  56689. h.setX(f, E),
  56690. f++,
  56691. h.setX(f, b),
  56692. f++,
  56693. h.setX(f, w),
  56694. f++
  56695. }
  56696. if (this.setIndex(h),
  56697. this.addAttribute("position", u),
  56698. this.addAttribute("uv", d),
  56699. this.computeVertexNormals(),
  56700. r === 2 * Math.PI) {
  56701. var _ = this.attributes.normal.array
  56702. , T = new n.Vector3
  56703. , x = new n.Vector3
  56704. , S = new n.Vector3;
  56705. for (o = t * e.length * 3,
  56706. a = 0,
  56707. s = 0; a < e.length; a++,
  56708. s += 3)
  56709. T.x = _[s + 0],
  56710. T.y = _[s + 1],
  56711. T.z = _[s + 2],
  56712. x.x = _[o + s + 0],
  56713. x.y = _[o + s + 1],
  56714. x.z = _[o + s + 2],
  56715. S.addVectors(T, x).normalize(),
  56716. _[s + 0] = _[o + s + 0] = S.x,
  56717. _[s + 1] = _[o + s + 1] = S.y,
  56718. _[s + 2] = _[o + s + 2] = S.z
  56719. }
  56720. }
  56721. ,
  56722. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56723. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56724. n.LatheGeometry = function(e, t, i, r) {
  56725. n.Geometry.call(this),
  56726. this.type = "LatheGeometry",
  56727. this.parameters = {
  56728. points: e,
  56729. segments: t,
  56730. phiStart: i,
  56731. phiLength: r
  56732. },
  56733. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56734. this.mergeVertices()
  56735. }
  56736. ,
  56737. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56738. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56739. n.PlaneGeometry = function(e, t, i, r) {
  56740. n.Geometry.call(this),
  56741. this.type = "PlaneGeometry",
  56742. this.parameters = {
  56743. width: e,
  56744. height: t,
  56745. widthSegments: i,
  56746. heightSegments: r
  56747. },
  56748. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56749. }
  56750. ,
  56751. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56752. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56753. n.PlaneBufferGeometry = function(e, t, i, r) {
  56754. n.BufferGeometry.call(this),
  56755. this.type = "PlaneBufferGeometry",
  56756. this.parameters = {
  56757. width: e,
  56758. height: t,
  56759. widthSegments: i,
  56760. heightSegments: r
  56761. };
  56762. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  56763. for (var y = A * d - a, C = 0; C < c; C++) {
  56764. var I = C * u - o;
  56765. p[m] = I,
  56766. p[m + 1] = -y,
  56767. f[m + 2] = 1,
  56768. g[v] = C / s,
  56769. g[v + 1] = 1 - A / l,
  56770. m += 3,
  56771. v += 2
  56772. }
  56773. m = 0;
  56774. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56775. for (var C = 0; C < s; C++) {
  56776. var b = C + c * A
  56777. , w = C + c * (A + 1)
  56778. , _ = C + 1 + c * (A + 1)
  56779. , T = C + 1 + c * A;
  56780. E[m] = b,
  56781. E[m + 1] = w,
  56782. E[m + 2] = T,
  56783. E[m + 3] = w,
  56784. E[m + 4] = _,
  56785. E[m + 5] = T,
  56786. m += 6
  56787. }
  56788. this.setIndex(new n.BufferAttribute(E,1)),
  56789. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56790. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56791. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56792. }
  56793. ,
  56794. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56795. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56796. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56797. n.BufferGeometry.call(this),
  56798. this.type = "RingBufferGeometry",
  56799. this.parameters = {
  56800. innerRadius: e,
  56801. outerRadius: t,
  56802. thetaSegments: i,
  56803. phiSegments: r,
  56804. thetaStart: o,
  56805. thetaLength: a
  56806. },
  56807. e = e || 20,
  56808. t = t || 50,
  56809. o = void 0 !== o ? o : 0,
  56810. a = void 0 !== a ? a : 2 * Math.PI,
  56811. i = void 0 !== i ? Math.max(3, i) : 8,
  56812. r = void 0 !== r ? Math.max(1, r) : 1;
  56813. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  56814. for (l = 0; l <= r; l++) {
  56815. for (c = 0; c <= i; c++)
  56816. s = o + c / i * a,
  56817. C.x = A * Math.cos(s),
  56818. C.y = A * Math.sin(s),
  56819. p.setXYZ(m, C.x, C.y, C.z),
  56820. f.setXYZ(m, 0, 0, 1),
  56821. I.x = (C.x / t + 1) / 2,
  56822. I.y = (C.y / t + 1) / 2,
  56823. g.setXY(m, I.x, I.y),
  56824. m++;
  56825. A += y
  56826. }
  56827. for (l = 0; l < r; l++) {
  56828. var E = l * (i + 1);
  56829. for (c = 0; c < i; c++) {
  56830. s = c + E;
  56831. var b = s
  56832. , w = s + i + 1
  56833. , _ = s + i + 2
  56834. , T = s + 1;
  56835. d.setX(v, b),
  56836. v++,
  56837. d.setX(v, w),
  56838. v++,
  56839. d.setX(v, _),
  56840. v++,
  56841. d.setX(v, b),
  56842. v++,
  56843. d.setX(v, _),
  56844. v++,
  56845. d.setX(v, T),
  56846. v++
  56847. }
  56848. }
  56849. this.setIndex(d),
  56850. this.addAttribute("position", p),
  56851. this.addAttribute("normal", f),
  56852. this.addAttribute("uv", g)
  56853. }
  56854. ,
  56855. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56856. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56857. n.RingGeometry = function(e, t, i, r, o, a) {
  56858. n.Geometry.call(this),
  56859. this.type = "RingGeometry",
  56860. this.parameters = {
  56861. innerRadius: e,
  56862. outerRadius: t,
  56863. thetaSegments: i,
  56864. phiSegments: r,
  56865. thetaStart: o,
  56866. thetaLength: a
  56867. },
  56868. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56869. }
  56870. ,
  56871. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56872. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56873. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56874. n.Geometry.call(this),
  56875. this.type = "SphereGeometry",
  56876. this.parameters = {
  56877. radius: e,
  56878. widthSegments: t,
  56879. heightSegments: i,
  56880. phiStart: r,
  56881. phiLength: o,
  56882. thetaStart: a,
  56883. thetaLength: s
  56884. },
  56885. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56886. }
  56887. ,
  56888. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56889. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56890. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56891. n.BufferGeometry.call(this),
  56892. this.type = "SphereBufferGeometry",
  56893. this.parameters = {
  56894. radius: e,
  56895. widthSegments: t,
  56896. heightSegments: i,
  56897. phiStart: r,
  56898. phiLength: o,
  56899. thetaStart: a,
  56900. thetaLength: s
  56901. },
  56902. e = e || 50,
  56903. t = Math.max(3, Math.floor(t) || 8),
  56904. i = Math.max(2, Math.floor(i) || 6),
  56905. r = void 0 !== r ? r : 0,
  56906. o = void 0 !== o ? o : 2 * Math.PI,
  56907. a = void 0 !== a ? a : 0,
  56908. s = void 0 !== s ? s : Math.PI;
  56909. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  56910. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56911. var C = y / t
  56912. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56913. , E = e * Math.cos(a + A * s)
  56914. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56915. g.set(I, E, b).normalize(),
  56916. h.setXYZ(p, I, E, b),
  56917. u.setXYZ(p, g.x, g.y, g.z),
  56918. d.setXY(p, C, 1 - A),
  56919. v.push(p),
  56920. p++
  56921. }
  56922. f.push(v)
  56923. }
  56924. for (var w = [], m = 0; m < i; m++)
  56925. for (var y = 0; y < t; y++) {
  56926. var _ = f[m][y + 1]
  56927. , T = f[m][y]
  56928. , x = f[m + 1][y]
  56929. , S = f[m + 1][y + 1];
  56930. (0 !== m || a > 0) && w.push(_, T, S),
  56931. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56932. }
  56933. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56934. this.addAttribute("position", h),
  56935. this.addAttribute("normal", u),
  56936. this.addAttribute("uv", d),
  56937. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56938. }
  56939. ,
  56940. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56941. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56942. n.TextGeometry = function(e, t) {
  56943. t = t || {};
  56944. var i = t.font;
  56945. if (i instanceof n.Font == !1)
  56946. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56947. new n.Geometry;
  56948. var r = i.generateShapes(e, t.size, t.curveSegments);
  56949. t.amount = void 0 !== t.height ? t.height : 50,
  56950. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56951. void 0 === t.bevelSize && (t.bevelSize = 8),
  56952. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56953. n.ExtrudeGeometry.call(this, r, t),
  56954. this.type = "TextGeometry"
  56955. }
  56956. ,
  56957. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56958. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56959. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56960. n.BufferGeometry.call(this),
  56961. this.type = "TorusBufferGeometry",
  56962. this.parameters = {
  56963. radius: e,
  56964. tube: t,
  56965. radialSegments: i,
  56966. tubularSegments: r,
  56967. arc: o
  56968. },
  56969. e = e || 100,
  56970. t = t || 40,
  56971. i = Math.floor(i) || 8,
  56972. r = Math.floor(r) || 6,
  56973. o = o || 2 * Math.PI;
  56974. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  56975. for (a = 0; a <= i; a++)
  56976. for (s = 0; s <= r; s++) {
  56977. var C = s / r * o
  56978. , I = a / i * Math.PI * 2;
  56979. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56980. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56981. A.z = t * Math.sin(I),
  56982. u[f] = A.x,
  56983. u[f + 1] = A.y,
  56984. u[f + 2] = A.z,
  56985. v.x = e * Math.cos(C),
  56986. v.y = e * Math.sin(C),
  56987. y.subVectors(A, v).normalize(),
  56988. d[f] = y.x,
  56989. d[f + 1] = y.y,
  56990. d[f + 2] = y.z,
  56991. p[g] = s / r,
  56992. p[g + 1] = a / i,
  56993. f += 3,
  56994. g += 2
  56995. }
  56996. for (a = 1; a <= i; a++)
  56997. for (s = 1; s <= r; s++) {
  56998. var E = (r + 1) * a + s - 1
  56999. , b = (r + 1) * (a - 1) + s - 1
  57000. , w = (r + 1) * (a - 1) + s
  57001. , _ = (r + 1) * a + s;
  57002. h[m] = E,
  57003. h[m + 1] = b,
  57004. h[m + 2] = _,
  57005. h[m + 3] = b,
  57006. h[m + 4] = w,
  57007. h[m + 5] = _,
  57008. m += 6
  57009. }
  57010. this.setIndex(new n.BufferAttribute(h,1)),
  57011. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57012. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57013. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57014. }
  57015. ,
  57016. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57017. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57018. n.TorusGeometry = function(e, t, i, r, o) {
  57019. n.Geometry.call(this),
  57020. this.type = "TorusGeometry",
  57021. this.parameters = {
  57022. radius: e,
  57023. tube: t,
  57024. radialSegments: i,
  57025. tubularSegments: r,
  57026. arc: o
  57027. },
  57028. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57029. }
  57030. ,
  57031. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57032. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57033. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57034. function s(e, t, i, n, r) {
  57035. var o = Math.cos(e)
  57036. , a = Math.sin(e)
  57037. , s = i / t * e
  57038. , l = Math.cos(s);
  57039. r.x = n * (2 + l) * .5 * o,
  57040. r.y = n * (2 + l) * a * .5,
  57041. r.z = n * Math.sin(s) * .5
  57042. }
  57043. n.BufferGeometry.call(this),
  57044. this.type = "TorusKnotBufferGeometry",
  57045. this.parameters = {
  57046. radius: e,
  57047. tube: t,
  57048. tubularSegments: i,
  57049. radialSegments: r,
  57050. p: o,
  57051. q: a
  57052. },
  57053. e = e || 100,
  57054. t = t || 40,
  57055. i = Math.floor(i) || 64,
  57056. r = Math.floor(r) || 8,
  57057. o = o || 2,
  57058. a = a || 3;
  57059. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  57060. for (l = 0; l <= i; ++l) {
  57061. var T = l / i * o * Math.PI * 2;
  57062. for (s(T, o, a, e, I),
  57063. s(T + .01, o, a, e, E),
  57064. w.subVectors(E, I),
  57065. _.addVectors(E, I),
  57066. b.crossVectors(w, _),
  57067. _.crossVectors(b, w),
  57068. b.normalize(),
  57069. _.normalize(),
  57070. c = 0; c <= r; ++c) {
  57071. var x = c / r * Math.PI * 2
  57072. , S = -t * Math.cos(x)
  57073. , M = t * Math.sin(x);
  57074. A.x = I.x + (S * _.x + M * b.x),
  57075. A.y = I.y + (S * _.y + M * b.y),
  57076. A.z = I.z + (S * _.z + M * b.z),
  57077. p.setXYZ(m, A.x, A.y, A.z),
  57078. y.subVectors(A, I).normalize(),
  57079. f.setXYZ(m, y.x, y.y, y.z),
  57080. C.x = l / i,
  57081. C.y = c / r,
  57082. g.setXY(m, C.x, C.y),
  57083. m++
  57084. }
  57085. }
  57086. for (c = 1; c <= i; c++)
  57087. for (l = 1; l <= r; l++) {
  57088. var R = (r + 1) * (c - 1) + (l - 1)
  57089. , P = (r + 1) * c + (l - 1)
  57090. , O = (r + 1) * c + l
  57091. , L = (r + 1) * (c - 1) + l;
  57092. d.setX(v, R),
  57093. v++,
  57094. d.setX(v, P),
  57095. v++,
  57096. d.setX(v, L),
  57097. v++,
  57098. d.setX(v, P),
  57099. v++,
  57100. d.setX(v, O),
  57101. v++,
  57102. d.setX(v, L),
  57103. v++
  57104. }
  57105. this.setIndex(d),
  57106. this.addAttribute("position", p),
  57107. this.addAttribute("normal", f),
  57108. this.addAttribute("uv", g)
  57109. }
  57110. ,
  57111. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57112. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57113. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57114. n.Geometry.call(this),
  57115. this.type = "TorusKnotGeometry",
  57116. this.parameters = {
  57117. radius: e,
  57118. tube: t,
  57119. tubularSegments: i,
  57120. radialSegments: r,
  57121. p: o,
  57122. q: a
  57123. },
  57124. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57125. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57126. this.mergeVertices()
  57127. }
  57128. ,
  57129. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57130. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57131. n.TubeGeometry = function(e, t, i, r, o, a) {
  57132. function s(e, t, i) {
  57133. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57134. }
  57135. n.Geometry.call(this),
  57136. this.type = "TubeGeometry",
  57137. this.parameters = {
  57138. path: e,
  57139. segments: t,
  57140. radius: i,
  57141. radialSegments: r,
  57142. closed: o,
  57143. taper: a
  57144. },
  57145. t = t || 64,
  57146. i = i || 1,
  57147. r = r || 8,
  57148. o = o || !1,
  57149. a = a || n.TubeGeometry.NoTaper;
  57150. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  57151. for (this.tangents = D,
  57152. this.normals = N,
  57153. this.binormals = B,
  57154. v = 0; v < P; v++)
  57155. for (M[v] = [],
  57156. u = v / (P - 1),
  57157. m = e.getPointAt(u),
  57158. l = D[v],
  57159. c = N[v],
  57160. h = B[v],
  57161. p = i * a(u),
  57162. A = 0; A < r; A++)
  57163. d = A / r * 2 * Math.PI,
  57164. f = -p * Math.cos(d),
  57165. g = p * Math.sin(d),
  57166. O.copy(m),
  57167. O.x += f * c.x + g * h.x,
  57168. O.y += f * c.y + g * h.y,
  57169. O.z += f * c.z + g * h.z,
  57170. M[v][A] = s(O.x, O.y, O.z);
  57171. for (v = 0; v < t; v++)
  57172. for (A = 0; A < r; A++)
  57173. y = o ? (v + 1) % t : v + 1,
  57174. C = (A + 1) % r,
  57175. I = M[v][A],
  57176. E = M[y][A],
  57177. b = M[y][C],
  57178. w = M[v][C],
  57179. _ = new n.Vector2(v / t,A / r),
  57180. T = new n.Vector2((v + 1) / t,A / r),
  57181. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57182. S = new n.Vector2(v / t,(A + 1) / r),
  57183. this.faces.push(new n.Face3(I,E,w)),
  57184. this.faceVertexUvs[0].push([_, T, S]),
  57185. this.faces.push(new n.Face3(E,b,w)),
  57186. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57187. this.computeFaceNormals(),
  57188. this.computeVertexNormals()
  57189. }
  57190. ,
  57191. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57192. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57193. n.TubeGeometry.NoTaper = function(e) {
  57194. return 1
  57195. }
  57196. ,
  57197. n.TubeGeometry.SinusoidalTaper = function(e) {
  57198. return Math.sin(Math.PI * e)
  57199. }
  57200. ,
  57201. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57202. function r() {
  57203. f[0] = new n.Vector3,
  57204. g[0] = new n.Vector3,
  57205. a = Number.MAX_VALUE,
  57206. s = Math.abs(p[0].x),
  57207. l = Math.abs(p[0].y),
  57208. c = Math.abs(p[0].z),
  57209. s <= a && (a = s,
  57210. d.set(1, 0, 0)),
  57211. l <= a && (a = l,
  57212. d.set(0, 1, 0)),
  57213. c <= a && d.set(0, 0, 1),
  57214. m.crossVectors(p[0], d).normalize(),
  57215. f[0].crossVectors(p[0], m),
  57216. g[0].crossVectors(p[0], f[0])
  57217. }
  57218. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  57219. for (this.tangents = p,
  57220. this.normals = f,
  57221. this.binormals = g,
  57222. h = 0; h < A; h++)
  57223. u = h / (A - 1),
  57224. p[h] = e.getTangentAt(u),
  57225. p[h].normalize();
  57226. for (r(),
  57227. h = 1; h < A; h++)
  57228. f[h] = f[h - 1].clone(),
  57229. g[h] = g[h - 1].clone(),
  57230. m.crossVectors(p[h - 1], p[h]),
  57231. m.length() > Number.EPSILON && (m.normalize(),
  57232. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57233. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57234. g[h].crossVectors(p[h], f[h]);
  57235. if (i)
  57236. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57237. o /= A - 1,
  57238. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57239. h = 1; h < A; h++)
  57240. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57241. g[h].crossVectors(p[h], f[h])
  57242. }
  57243. ,
  57244. n.PolyhedronGeometry = function(e, t, i, r) {
  57245. function o(e) {
  57246. var t = e.normalize().clone();
  57247. t.index = u.vertices.push(t) - 1;
  57248. var i = l(e) / 2 / Math.PI + .5
  57249. , r = c(e) / Math.PI + .5;
  57250. return t.uv = new n.Vector2(i,1 - r),
  57251. t
  57252. }
  57253. function a(e, t, i, r) {
  57254. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57255. u.faces.push(o),
  57256. C.copy(e).add(t).add(i).divideScalar(3);
  57257. var a = l(C);
  57258. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57259. }
  57260. function s(e, t) {
  57261. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  57262. l[h] = [];
  57263. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  57264. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57265. }
  57266. for (var h = 0; h < i; h++)
  57267. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57268. var m = Math.floor(g / 2);
  57269. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  57270. }
  57271. }
  57272. function l(e) {
  57273. return Math.atan2(e.z, -e.x)
  57274. }
  57275. function c(e) {
  57276. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57277. }
  57278. function h(e, t, i) {
  57279. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57280. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57281. e.clone()
  57282. }
  57283. n.Geometry.call(this),
  57284. this.type = "PolyhedronGeometry",
  57285. this.parameters = {
  57286. vertices: e,
  57287. indices: t,
  57288. radius: i,
  57289. detail: r
  57290. },
  57291. i = i || 1,
  57292. r = r || 0;
  57293. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57294. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57295. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57296. m++) {
  57297. var v = f[t[d]]
  57298. , A = f[t[d + 1]]
  57299. , y = f[t[d + 2]];
  57300. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57301. }
  57302. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57303. s(g[d], r);
  57304. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57305. var I = this.faceVertexUvs[0][d]
  57306. , E = I[0].x
  57307. , b = I[1].x
  57308. , w = I[2].x
  57309. , _ = Math.max(E, b, w)
  57310. , T = Math.min(E, b, w);
  57311. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57312. b < .2 && (I[1].x += 1),
  57313. w < .2 && (I[2].x += 1))
  57314. }
  57315. for (var d = 0, p = this.vertices.length; d < p; d++)
  57316. this.vertices[d].multiplyScalar(i);
  57317. this.mergeVertices(),
  57318. this.computeFaceNormals(),
  57319. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57320. }
  57321. ,
  57322. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57323. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57324. n.DodecahedronGeometry = function(e, t) {
  57325. var i = (1 + Math.sqrt(5)) / 2
  57326. , r = 1 / i
  57327. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  57328. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 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, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  57329. n.PolyhedronGeometry.call(this, o, a, e, t),
  57330. this.type = "DodecahedronGeometry",
  57331. this.parameters = {
  57332. radius: e,
  57333. detail: t
  57334. }
  57335. }
  57336. ,
  57337. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57338. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57339. n.IcosahedronGeometry = function(e, t) {
  57340. var i = (1 + Math.sqrt(5)) / 2
  57341. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  57342. , o = [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, 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, 10, 8, 6, 7, 9, 8, 1];
  57343. n.PolyhedronGeometry.call(this, r, o, e, t),
  57344. this.type = "IcosahedronGeometry",
  57345. this.parameters = {
  57346. radius: e,
  57347. detail: t
  57348. }
  57349. }
  57350. ,
  57351. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57352. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57353. n.OctahedronGeometry = function(e, t) {
  57354. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57355. , 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];
  57356. n.PolyhedronGeometry.call(this, i, r, e, t),
  57357. this.type = "OctahedronGeometry",
  57358. this.parameters = {
  57359. radius: e,
  57360. detail: t
  57361. }
  57362. }
  57363. ,
  57364. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57365. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57366. n.TetrahedronGeometry = function(e, t) {
  57367. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57368. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57369. n.PolyhedronGeometry.call(this, i, r, e, t),
  57370. this.type = "TetrahedronGeometry",
  57371. this.parameters = {
  57372. radius: e,
  57373. detail: t
  57374. }
  57375. }
  57376. ,
  57377. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57378. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57379. n.ParametricGeometry = function(e, t, i) {
  57380. n.Geometry.call(this),
  57381. this.type = "ParametricGeometry",
  57382. this.parameters = {
  57383. func: e,
  57384. slices: t,
  57385. stacks: i
  57386. };
  57387. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57388. for (r = 0; r <= i; r++)
  57389. for (l = r / i,
  57390. o = 0; o <= t; o++)
  57391. s = o / t,
  57392. a = e(s, l),
  57393. c.push(a);
  57394. var p, f, g, m, v, A, y, C;
  57395. for (r = 0; r < i; r++)
  57396. for (o = 0; o < t; o++)
  57397. p = r * d + o,
  57398. f = r * d + o + 1,
  57399. g = (r + 1) * d + o + 1,
  57400. m = (r + 1) * d + o,
  57401. v = new n.Vector2(o / t,r / i),
  57402. A = new n.Vector2((o + 1) / t,r / i),
  57403. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57404. C = new n.Vector2(o / t,(r + 1) / i),
  57405. h.push(new n.Face3(p,f,m)),
  57406. u.push([v, A, C]),
  57407. h.push(new n.Face3(f,g,m)),
  57408. u.push([A.clone(), y, C.clone()]);
  57409. this.computeFaceNormals(),
  57410. this.computeVertexNormals()
  57411. }
  57412. ,
  57413. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57414. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57415. n.WireframeGeometry = function(e) {
  57416. function t(e, t) {
  57417. return e - t
  57418. }
  57419. n.BufferGeometry.call(this);
  57420. var i = [0, 0]
  57421. , r = {}
  57422. , o = ["a", "b", "c"];
  57423. if (e instanceof n.Geometry) {
  57424. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57425. for (var d = s[h], p = 0; p < 3; p++) {
  57426. i[0] = d[o[p]],
  57427. i[1] = d[o[(p + 1) % 3]],
  57428. i.sort(t);
  57429. var f = i.toString();
  57430. void 0 === r[f] && (c[2 * l] = i[0],
  57431. c[2 * l + 1] = i[1],
  57432. r[f] = !0,
  57433. l++)
  57434. }
  57435. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57436. for (var p = 0; p < 2; p++) {
  57437. var m = a[c[2 * h + p]]
  57438. , v = 6 * h + 3 * p;
  57439. g[v + 0] = m.x,
  57440. g[v + 1] = m.y,
  57441. g[v + 2] = m.z
  57442. }
  57443. this.addAttribute("position", new n.BufferAttribute(g,3))
  57444. } else if (e instanceof n.BufferGeometry)
  57445. if (null !== e.index) {
  57446. var A = e.index.array
  57447. , a = e.attributes.position
  57448. , y = e.groups
  57449. , l = 0;
  57450. 0 === y.length && e.addGroup(0, A.length);
  57451. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57452. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57453. for (var p = 0; p < 3; p++) {
  57454. i[0] = A[h + p],
  57455. i[1] = A[h + (p + 1) % 3],
  57456. i.sort(t);
  57457. var f = i.toString();
  57458. void 0 === r[f] && (c[2 * l] = i[0],
  57459. c[2 * l + 1] = i[1],
  57460. r[f] = !0,
  57461. l++)
  57462. }
  57463. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57464. for (var p = 0; p < 2; p++) {
  57465. var v = 6 * h + 3 * p
  57466. , T = c[2 * h + p];
  57467. g[v + 0] = a.getX(T),
  57468. g[v + 1] = a.getY(T),
  57469. g[v + 2] = a.getZ(T)
  57470. }
  57471. this.addAttribute("position", new n.BufferAttribute(g,3))
  57472. } else {
  57473. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  57474. for (var p = 0; p < 3; p++) {
  57475. var v = 18 * h + 6 * p
  57476. , S = 9 * h + 3 * p;
  57477. g[v + 0] = a[S],
  57478. g[v + 1] = a[S + 1],
  57479. g[v + 2] = a[S + 2];
  57480. var T = 9 * h + 3 * ((p + 1) % 3);
  57481. g[v + 3] = a[T],
  57482. g[v + 4] = a[T + 1],
  57483. g[v + 5] = a[T + 2]
  57484. }
  57485. this.addAttribute("position", new n.BufferAttribute(g,3))
  57486. }
  57487. }
  57488. ,
  57489. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57490. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57491. n.AxisHelper = function(e) {
  57492. e = e || 1;
  57493. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57494. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57495. , r = new n.BufferGeometry;
  57496. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57497. r.addAttribute("color", new n.BufferAttribute(i,3));
  57498. var o = new n.LineBasicMaterial({
  57499. vertexColors: n.VertexColors
  57500. });
  57501. n.LineSegments.call(this, r, o)
  57502. }
  57503. ,
  57504. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57505. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57506. n.ArrowHelper = function() {
  57507. var e = new n.Geometry;
  57508. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57509. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57510. return t.translate(0, -.5, 0),
  57511. function(i, r, o, a, s, l) {
  57512. n.Object3D.call(this),
  57513. void 0 === a && (a = 16776960),
  57514. void 0 === o && (o = 1),
  57515. void 0 === s && (s = .2 * o),
  57516. void 0 === l && (l = .2 * s),
  57517. this.position.copy(r),
  57518. this.line = new n.Line(e,new n.LineBasicMaterial({
  57519. color: a
  57520. })),
  57521. this.line.matrixAutoUpdate = !1,
  57522. this.add(this.line),
  57523. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57524. color: a
  57525. })),
  57526. this.cone.matrixAutoUpdate = !1,
  57527. this.add(this.cone),
  57528. this.setDirection(i),
  57529. this.setLength(o, s, l)
  57530. }
  57531. }(),
  57532. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57533. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57534. n.ArrowHelper.prototype.setDirection = function() {
  57535. var e, t = new n.Vector3;
  57536. return function(i) {
  57537. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  57538. e = Math.acos(i.y),
  57539. this.quaternion.setFromAxisAngle(t, e))
  57540. }
  57541. }(),
  57542. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57543. void 0 === t && (t = .2 * e),
  57544. void 0 === i && (i = .2 * t),
  57545. this.line.scale.set(1, Math.max(0, e - t), 1),
  57546. this.line.updateMatrix(),
  57547. this.cone.scale.set(i, t, i),
  57548. this.cone.position.y = e,
  57549. this.cone.updateMatrix()
  57550. }
  57551. ,
  57552. n.ArrowHelper.prototype.setColor = function(e) {
  57553. this.line.material.color.set(e),
  57554. this.cone.material.color.set(e)
  57555. }
  57556. ,
  57557. n.BoxHelper = function(e) {
  57558. var t = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7])
  57559. , i = new Float32Array(24)
  57560. , r = new n.BufferGeometry;
  57561. r.setIndex(new n.BufferAttribute(t,1)),
  57562. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57563. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57564. color: 16776960
  57565. })),
  57566. void 0 !== e && this.update(e)
  57567. }
  57568. ,
  57569. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57570. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57571. n.BoxHelper.prototype.update = function() {
  57572. var e = new n.Box3;
  57573. return function(t) {
  57574. if (e.setFromObject(t),
  57575. !e.isEmpty()) {
  57576. var i = e.min
  57577. , n = e.max
  57578. , r = this.geometry.attributes.position
  57579. , o = r.array;
  57580. o[0] = n.x,
  57581. o[1] = n.y,
  57582. o[2] = n.z,
  57583. o[3] = i.x,
  57584. o[4] = n.y,
  57585. o[5] = n.z,
  57586. o[6] = i.x,
  57587. o[7] = i.y,
  57588. o[8] = n.z,
  57589. o[9] = n.x,
  57590. o[10] = i.y,
  57591. o[11] = n.z,
  57592. o[12] = n.x,
  57593. o[13] = n.y,
  57594. o[14] = i.z,
  57595. o[15] = i.x,
  57596. o[16] = n.y,
  57597. o[17] = i.z,
  57598. o[18] = i.x,
  57599. o[19] = i.y,
  57600. o[20] = i.z,
  57601. o[21] = n.x,
  57602. o[22] = i.y,
  57603. o[23] = i.z,
  57604. r.needsUpdate = !0,
  57605. this.geometry.computeBoundingSphere()
  57606. }
  57607. }
  57608. }(),
  57609. n.BoundingBoxHelper = function(e, t) {
  57610. var i = void 0 !== t ? t : 8947848;
  57611. this.object = e,
  57612. this.box = new n.Box3,
  57613. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57614. color: i,
  57615. wireframe: !0
  57616. }))
  57617. }
  57618. ,
  57619. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57620. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57621. n.BoundingBoxHelper.prototype.update = function() {
  57622. this.box.setFromObject(this.object),
  57623. this.box.size(this.scale),
  57624. this.box.center(this.position)
  57625. }
  57626. ,
  57627. n.CameraHelper = function(e) {
  57628. function t(e, t, n) {
  57629. i(e, n),
  57630. i(t, n)
  57631. }
  57632. function i(e, t) {
  57633. r.vertices.push(new n.Vector3),
  57634. r.colors.push(new n.Color(t)),
  57635. void 0 === a[e] && (a[e] = []),
  57636. a[e].push(r.vertices.length - 1)
  57637. }
  57638. var r = new n.Geometry
  57639. , o = new n.LineBasicMaterial({
  57640. color: 16777215,
  57641. vertexColors: n.FaceColors
  57642. })
  57643. , a = {}
  57644. , s = 16755200
  57645. , l = 16711680
  57646. , c = 43775
  57647. , h = 16777215
  57648. , u = 3355443;
  57649. t("n1", "n2", s),
  57650. t("n2", "n4", s),
  57651. t("n4", "n3", s),
  57652. t("n3", "n1", s),
  57653. t("f1", "f2", s),
  57654. t("f2", "f4", s),
  57655. t("f4", "f3", s),
  57656. t("f3", "f1", s),
  57657. t("n1", "f1", s),
  57658. t("n2", "f2", s),
  57659. t("n3", "f3", s),
  57660. t("n4", "f4", s),
  57661. t("p", "n1", l),
  57662. t("p", "n2", l),
  57663. t("p", "n3", l),
  57664. t("p", "n4", l),
  57665. t("u1", "u2", c),
  57666. t("u2", "u3", c),
  57667. t("u3", "u1", c),
  57668. t("c", "t", h),
  57669. t("p", "c", u),
  57670. t("cn1", "cn2", u),
  57671. t("cn3", "cn4", u),
  57672. t("cf1", "cf2", u),
  57673. t("cf3", "cf4", u),
  57674. n.LineSegments.call(this, r, o),
  57675. this.camera = e,
  57676. this.camera.updateProjectionMatrix(),
  57677. this.matrix = e.matrixWorld,
  57678. this.matrixAutoUpdate = !1,
  57679. this.pointMap = a,
  57680. this.update()
  57681. }
  57682. ,
  57683. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57684. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57685. n.CameraHelper.prototype.update = function() {
  57686. function e(e, n, a, s) {
  57687. r.set(n, a, s).unproject(o);
  57688. var l = i[e];
  57689. if (void 0 !== l)
  57690. for (var c = 0, h = l.length; c < h; c++)
  57691. t.vertices[l[c]].copy(r)
  57692. }
  57693. var t, i, r = new n.Vector3, o = new n.Camera;
  57694. return function() {
  57695. t = this.geometry,
  57696. i = this.pointMap;
  57697. var n = 1
  57698. , r = 1;
  57699. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57700. e("c", 0, 0, -1),
  57701. e("t", 0, 0, 1),
  57702. e("n1", -n, -r, -1),
  57703. e("n2", n, -r, -1),
  57704. e("n3", -n, r, -1),
  57705. e("n4", n, r, -1),
  57706. e("f1", -n, -r, 1),
  57707. e("f2", n, -r, 1),
  57708. e("f3", -n, r, 1),
  57709. e("f4", n, r, 1),
  57710. e("u1", .7 * n, 1.1 * r, -1),
  57711. e("u2", .7 * -n, 1.1 * r, -1),
  57712. e("u3", 0, 2 * r, -1),
  57713. e("cf1", -n, 0, 1),
  57714. e("cf2", n, 0, 1),
  57715. e("cf3", 0, -r, 1),
  57716. e("cf4", 0, r, 1),
  57717. e("cn1", -n, 0, -1),
  57718. e("cn2", n, 0, -1),
  57719. e("cn3", 0, -r, -1),
  57720. e("cn4", 0, r, -1),
  57721. t.verticesNeedUpdate = !0
  57722. }
  57723. }(),
  57724. n.DirectionalLightHelper = function(e, t) {
  57725. n.Object3D.call(this),
  57726. this.light = e,
  57727. this.light.updateMatrixWorld(),
  57728. this.matrix = e.matrixWorld,
  57729. this.matrixAutoUpdate = !1,
  57730. t = t || 1;
  57731. var i = new n.Geometry;
  57732. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  57733. var r = new n.LineBasicMaterial({
  57734. fog: !1
  57735. });
  57736. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57737. this.lightPlane = new n.Line(i,r),
  57738. this.add(this.lightPlane),
  57739. i = new n.Geometry,
  57740. i.vertices.push(new n.Vector3, new n.Vector3),
  57741. r = new n.LineBasicMaterial({
  57742. fog: !1
  57743. }),
  57744. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57745. this.targetLine = new n.Line(i,r),
  57746. this.add(this.targetLine),
  57747. this.update()
  57748. }
  57749. ,
  57750. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57751. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57752. n.DirectionalLightHelper.prototype.dispose = function() {
  57753. this.lightPlane.geometry.dispose(),
  57754. this.lightPlane.material.dispose(),
  57755. this.targetLine.geometry.dispose(),
  57756. this.targetLine.material.dispose()
  57757. }
  57758. ,
  57759. n.DirectionalLightHelper.prototype.update = function() {
  57760. var e = new n.Vector3
  57761. , t = new n.Vector3
  57762. , i = new n.Vector3;
  57763. return function() {
  57764. e.setFromMatrixPosition(this.light.matrixWorld),
  57765. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57766. i.subVectors(t, e),
  57767. this.lightPlane.lookAt(i),
  57768. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57769. this.targetLine.geometry.vertices[1].copy(i),
  57770. this.targetLine.geometry.verticesNeedUpdate = !0,
  57771. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57772. }
  57773. }(),
  57774. n.EdgesHelper = function(e, t, i) {
  57775. var r = void 0 !== t ? t : 16777215;
  57776. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57777. color: r
  57778. })),
  57779. this.matrix = e.matrixWorld,
  57780. this.matrixAutoUpdate = !1
  57781. }
  57782. ,
  57783. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57784. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57785. n.FaceNormalsHelper = function(e, t, i, r) {
  57786. this.object = e,
  57787. this.size = void 0 !== t ? t : 1;
  57788. var o = void 0 !== i ? i : 16776960
  57789. , a = void 0 !== r ? r : 1
  57790. , s = 0
  57791. , l = this.object.geometry;
  57792. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57793. var c = new n.BufferGeometry
  57794. , h = new n.Float32Attribute(2 * s * 3,3);
  57795. c.addAttribute("position", h),
  57796. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57797. color: o,
  57798. linewidth: a
  57799. })),
  57800. this.matrixAutoUpdate = !1,
  57801. this.update()
  57802. }
  57803. ,
  57804. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57805. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57806. n.FaceNormalsHelper.prototype.update = function() {
  57807. var e = new n.Vector3
  57808. , t = new n.Vector3
  57809. , i = new n.Matrix3;
  57810. return function() {
  57811. this.object.updateMatrixWorld(!0),
  57812. i.getNormalMatrix(this.object.matrixWorld);
  57813. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  57814. var u = s[c]
  57815. , d = u.normal;
  57816. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57817. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57818. r.setXYZ(l, e.x, e.y, e.z),
  57819. l += 1,
  57820. r.setXYZ(l, t.x, t.y, t.z),
  57821. l += 1
  57822. }
  57823. return r.needsUpdate = !0,
  57824. this
  57825. }
  57826. }(),
  57827. n.GridHelper = function(e, t) {
  57828. var i = new n.Geometry
  57829. , r = new n.LineBasicMaterial({
  57830. vertexColors: n.VertexColors
  57831. });
  57832. this.color1 = new n.Color(4473924),
  57833. this.color2 = new n.Color(8947848);
  57834. for (var o = -e; o <= e; o += t) {
  57835. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  57836. var a = 0 === o ? this.color1 : this.color2;
  57837. i.colors.push(a, a, a, a)
  57838. }
  57839. n.LineSegments.call(this, i, r)
  57840. }
  57841. ,
  57842. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57843. n.GridHelper.prototype.constructor = n.GridHelper,
  57844. n.GridHelper.prototype.setColors = function(e, t) {
  57845. this.color1.set(e),
  57846. this.color2.set(t),
  57847. this.geometry.colorsNeedUpdate = !0
  57848. }
  57849. ,
  57850. n.HemisphereLightHelper = function(e, t) {
  57851. n.Object3D.call(this),
  57852. this.light = e,
  57853. this.light.updateMatrixWorld(),
  57854. this.matrix = e.matrixWorld,
  57855. this.matrixAutoUpdate = !1,
  57856. this.colors = [new n.Color, new n.Color];
  57857. var i = new n.SphereGeometry(t,4,2);
  57858. i.rotateX(-Math.PI / 2);
  57859. for (var r = 0, o = 8; r < o; r++)
  57860. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57861. var a = new n.MeshBasicMaterial({
  57862. vertexColors: n.FaceColors,
  57863. wireframe: !0
  57864. });
  57865. this.lightSphere = new n.Mesh(i,a),
  57866. this.add(this.lightSphere),
  57867. this.update()
  57868. }
  57869. ,
  57870. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57871. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57872. n.HemisphereLightHelper.prototype.dispose = function() {
  57873. this.lightSphere.geometry.dispose(),
  57874. this.lightSphere.material.dispose()
  57875. }
  57876. ,
  57877. n.HemisphereLightHelper.prototype.update = function() {
  57878. var e = new n.Vector3;
  57879. return function() {
  57880. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57881. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57882. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57883. this.lightSphere.geometry.colorsNeedUpdate = !0
  57884. }
  57885. }(),
  57886. n.PointLightHelper = function(e, t) {
  57887. this.light = e,
  57888. this.light.updateMatrixWorld();
  57889. var i = new n.SphereGeometry(t,4,2)
  57890. , r = new n.MeshBasicMaterial({
  57891. wireframe: !0,
  57892. fog: !1
  57893. });
  57894. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57895. n.Mesh.call(this, i, r),
  57896. this.matrix = this.light.matrixWorld,
  57897. this.matrixAutoUpdate = !1
  57898. }
  57899. ,
  57900. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57901. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57902. n.PointLightHelper.prototype.dispose = function() {
  57903. this.geometry.dispose(),
  57904. this.material.dispose()
  57905. }
  57906. ,
  57907. n.PointLightHelper.prototype.update = function() {
  57908. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57909. }
  57910. ,
  57911. n.SkeletonHelper = function(e) {
  57912. this.bones = this.getBoneList(e);
  57913. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57914. var r = this.bones[i];
  57915. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57916. t.vertices.push(new n.Vector3),
  57917. t.colors.push(new n.Color(0,0,1)),
  57918. t.colors.push(new n.Color(0,1,0)))
  57919. }
  57920. t.dynamic = !0;
  57921. var o = new n.LineBasicMaterial({
  57922. vertexColors: n.VertexColors,
  57923. depthTest: !1,
  57924. depthWrite: !1,
  57925. transparent: !0
  57926. });
  57927. n.LineSegments.call(this, t, o),
  57928. this.root = e,
  57929. this.matrix = e.matrixWorld,
  57930. this.matrixAutoUpdate = !1,
  57931. this.update()
  57932. }
  57933. ,
  57934. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57935. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57936. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57937. var t = [];
  57938. e instanceof n.Bone && t.push(e);
  57939. for (var i = 0; i < e.children.length; i++)
  57940. t.push.apply(t, this.getBoneList(e.children[i]));
  57941. return t
  57942. }
  57943. ,
  57944. n.SkeletonHelper.prototype.update = function() {
  57945. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  57946. var a = this.bones[o];
  57947. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57948. e.vertices[r].setFromMatrixPosition(i),
  57949. i.multiplyMatrices(t, a.parent.matrixWorld),
  57950. e.vertices[r + 1].setFromMatrixPosition(i),
  57951. r += 2)
  57952. }
  57953. e.verticesNeedUpdate = !0,
  57954. e.computeBoundingSphere()
  57955. }
  57956. ,
  57957. n.SpotLightHelper = function(e) {
  57958. n.Object3D.call(this),
  57959. this.light = e,
  57960. this.light.updateMatrixWorld(),
  57961. this.matrix = e.matrixWorld,
  57962. this.matrixAutoUpdate = !1;
  57963. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57964. t.translate(0, -.5, 0),
  57965. t.rotateX(-Math.PI / 2);
  57966. var i = new n.MeshBasicMaterial({
  57967. wireframe: !0,
  57968. fog: !1
  57969. });
  57970. this.cone = new n.Mesh(t,i),
  57971. this.add(this.cone),
  57972. this.update()
  57973. }
  57974. ,
  57975. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57976. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57977. n.SpotLightHelper.prototype.dispose = function() {
  57978. this.cone.geometry.dispose(),
  57979. this.cone.material.dispose()
  57980. }
  57981. ,
  57982. n.SpotLightHelper.prototype.update = function() {
  57983. var e = new n.Vector3
  57984. , t = new n.Vector3;
  57985. return function() {
  57986. var i = this.light.distance ? this.light.distance : 1e4
  57987. , n = i * Math.tan(this.light.angle);
  57988. this.cone.scale.set(n, n, i),
  57989. e.setFromMatrixPosition(this.light.matrixWorld),
  57990. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57991. this.cone.lookAt(t.sub(e)),
  57992. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57993. }
  57994. }(),
  57995. n.VertexNormalsHelper = function(e, t, i, r) {
  57996. this.object = e,
  57997. this.size = void 0 !== t ? t : 1;
  57998. var o = void 0 !== i ? i : 16711680
  57999. , a = void 0 !== r ? r : 1
  58000. , s = 0
  58001. , l = this.object.geometry;
  58002. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58003. var c = new n.BufferGeometry
  58004. , h = new n.Float32Attribute(2 * s * 3,3);
  58005. c.addAttribute("position", h),
  58006. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58007. color: o,
  58008. linewidth: a
  58009. })),
  58010. this.matrixAutoUpdate = !1,
  58011. this.update()
  58012. }
  58013. ,
  58014. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58015. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58016. n.VertexNormalsHelper.prototype.update = function() {
  58017. var e = new n.Vector3
  58018. , t = new n.Vector3
  58019. , i = new n.Matrix3;
  58020. return function() {
  58021. var r = ["a", "b", "c"];
  58022. this.object.updateMatrixWorld(!0),
  58023. i.getNormalMatrix(this.object.matrixWorld);
  58024. var o = this.object.matrixWorld
  58025. , a = this.geometry.attributes.position
  58026. , s = this.object.geometry;
  58027. if (s instanceof n.Geometry)
  58028. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58029. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58030. var m = l[p[r[f]]]
  58031. , v = p.vertexNormals[f];
  58032. e.copy(m).applyMatrix4(o),
  58033. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58034. a.setXYZ(h, e.x, e.y, e.z),
  58035. h += 1,
  58036. a.setXYZ(h, t.x, t.y, t.z),
  58037. h += 1
  58038. }
  58039. else if (s instanceof n.BufferGeometry)
  58040. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58041. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58042. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58043. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58044. a.setXYZ(h, e.x, e.y, e.z),
  58045. h += 1,
  58046. a.setXYZ(h, t.x, t.y, t.z),
  58047. h += 1;
  58048. return a.needsUpdate = !0,
  58049. this
  58050. }
  58051. }(),
  58052. n.WireframeHelper = function(e, t) {
  58053. var i = void 0 !== t ? t : 16777215;
  58054. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58055. color: i
  58056. })),
  58057. this.matrix = e.matrixWorld,
  58058. this.matrixAutoUpdate = !1
  58059. }
  58060. ,
  58061. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58062. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58063. n.ImmediateRenderObject = function(e) {
  58064. n.Object3D.call(this),
  58065. this.material = e,
  58066. this.render = function(e) {}
  58067. }
  58068. ,
  58069. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58070. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58071. n.MorphBlendMesh = function(e, t) {
  58072. n.Mesh.call(this, e, t),
  58073. this.animationsMap = {},
  58074. this.animationsList = [];
  58075. var i = this.geometry.morphTargets.length
  58076. , r = "__default"
  58077. , o = 0
  58078. , a = i - 1
  58079. , s = i / 1;
  58080. this.createAnimation(r, o, a, s),
  58081. this.setAnimationWeight(r, 1)
  58082. }
  58083. ,
  58084. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58085. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58086. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58087. var r = {
  58088. start: t,
  58089. end: i,
  58090. length: i - t + 1,
  58091. fps: n,
  58092. duration: (i - t) / n,
  58093. lastFrame: 0,
  58094. currentFrame: 0,
  58095. active: !1,
  58096. time: 0,
  58097. direction: 1,
  58098. weight: 1,
  58099. directionBackwards: !1,
  58100. mirroredLoop: !1
  58101. };
  58102. this.animationsMap[e] = r,
  58103. this.animationsList.push(r)
  58104. }
  58105. ,
  58106. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58107. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58108. var s = r.morphTargets[o]
  58109. , l = s.name.match(i);
  58110. if (l && l.length > 1) {
  58111. var c = l[1];
  58112. n[c] || (n[c] = {
  58113. start: 1 / 0,
  58114. end: -(1 / 0)
  58115. });
  58116. var h = n[c];
  58117. o < h.start && (h.start = o),
  58118. o > h.end && (h.end = o),
  58119. t || (t = c)
  58120. }
  58121. }
  58122. for (var c in n) {
  58123. var h = n[c];
  58124. this.createAnimation(c, h.start, h.end, e)
  58125. }
  58126. this.firstAnimation = t
  58127. }
  58128. ,
  58129. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58130. var t = this.animationsMap[e];
  58131. t && (t.direction = 1,
  58132. t.directionBackwards = !1)
  58133. }
  58134. ,
  58135. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58136. var t = this.animationsMap[e];
  58137. t && (t.direction = -1,
  58138. t.directionBackwards = !0)
  58139. }
  58140. ,
  58141. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58142. var i = this.animationsMap[e];
  58143. i && (i.fps = t,
  58144. i.duration = (i.end - i.start) / i.fps)
  58145. }
  58146. ,
  58147. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58148. var i = this.animationsMap[e];
  58149. i && (i.duration = t,
  58150. i.fps = (i.end - i.start) / i.duration)
  58151. }
  58152. ,
  58153. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58154. var i = this.animationsMap[e];
  58155. i && (i.weight = t)
  58156. }
  58157. ,
  58158. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58159. var i = this.animationsMap[e];
  58160. i && (i.time = t)
  58161. }
  58162. ,
  58163. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58164. var t = 0
  58165. , i = this.animationsMap[e];
  58166. return i && (t = i.time),
  58167. t
  58168. }
  58169. ,
  58170. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58171. var t = -1
  58172. , i = this.animationsMap[e];
  58173. return i && (t = i.duration),
  58174. t
  58175. }
  58176. ,
  58177. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58178. var t = this.animationsMap[e];
  58179. t ? (t.time = 0,
  58180. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58181. }
  58182. ,
  58183. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58184. var t = this.animationsMap[e];
  58185. t && (t.active = !1)
  58186. }
  58187. ,
  58188. n.MorphBlendMesh.prototype.update = function(e) {
  58189. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58190. var r = this.animationsList[t];
  58191. if (r.active) {
  58192. var o = r.duration / r.length;
  58193. r.time += r.direction * e,
  58194. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58195. r.time > r.duration && (r.time = r.duration,
  58196. r.directionBackwards = !0),
  58197. r.time < 0 && (r.time = 0,
  58198. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58199. r.time < 0 && (r.time += r.duration));
  58200. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58201. , s = r.weight;
  58202. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58203. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58204. this.morphTargetInfluences[a] = 0,
  58205. r.lastFrame = r.currentFrame,
  58206. r.currentFrame = a);
  58207. var l = r.time % o / o;
  58208. r.directionBackwards && (l = 1 - l),
  58209. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58210. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58211. }
  58212. }
  58213. }
  58214. ,
  58215. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58216. i.THREE = n) : this.THREE = n
  58217. window.THREE = n
  58218. }
  58219. , {}]
  58220. }, {}, [116]);
  58221. function initTransitionPass(THREE){
  58222. THREE.TransitionPass = function ( scene, camera ) {
  58223. this.renderScene = scene;
  58224. this.renderCamera = camera;
  58225. this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, {
  58226. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  58227. format: THREE.RGBAFormat
  58228. });
  58229. this.coverTex = this.coverRenderTarget.texture;
  58230. this.enabled = false;
  58231. this.oldClearColor = new THREE.Color();
  58232. this.oldClearAlpha = 1;
  58233. this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
  58234. this.scene = new THREE.Scene();
  58235. this.material = this.getMaskMaterial()
  58236. var copyShader = THREE.CopyShader;
  58237. this.materialCopy = new THREE.ShaderMaterial( {
  58238. uniforms: this.copyUniforms,
  58239. vertexShader: copyShader.vertexShader,
  58240. fragmentShader: copyShader.fragmentShader,
  58241. blending: THREE.NoBlending,
  58242. depthTest: false,
  58243. depthWrite: false,
  58244. transparent: true
  58245. } );
  58246. this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
  58247. this.quad.frustumCulled = false; // Avoid getting clipped
  58248. this.scene.add( this.quad );
  58249. }
  58250. THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
  58251. constructor: THREE.TransitionPass,
  58252. setSize: function ( width, height ) {
  58253. this.coverRenderTarget.setSize( width, height );
  58254. },
  58255. render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
  58256. var oldAutoClear = renderer.autoClear;
  58257. renderer.autoClear = false;
  58258. var uniforms = this.quad.material.uniforms
  58259. uniforms.bgTex.value = readBuffer.texture;
  58260. uniforms.coverTex.value = this.coverTex;
  58261. uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
  58262. uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
  58263. uniforms.screenRatio.value *= uniforms.screenRatio.value
  58264. renderer.render( this.scene, this.camera);
  58265. renderer.autoClear = oldAutoClear;
  58266. },
  58267. start:function(sceneRenderer){
  58268. this.enabled = true
  58269. //draw coverTex
  58270. this.quad.material.uniforms.progress.value = 1;
  58271. sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
  58272. },
  58273. stop:function(){
  58274. this.enabled = false
  58275. }
  58276. ,
  58277. getMaskMaterial :function(){
  58278. return new THREE.ShaderMaterial( {
  58279. uniforms: {
  58280. coverTex: {
  58281. type: "t",
  58282. value: null
  58283. },
  58284. bgTex: {
  58285. type: "t",
  58286. value: null
  58287. },
  58288. progress:{
  58289. type: "f",
  58290. value: 0
  58291. },
  58292. screenRatio:{
  58293. type: "f",
  58294. value: 1
  58295. }
  58296. },
  58297. vertexShader: `
  58298. varying vec2 vUv;
  58299. void main()
  58300. {
  58301. vUv = uv;
  58302. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  58303. }
  58304. `,
  58305. fragmentShader: `
  58306. uniform sampler2D coverTex;
  58307. uniform sampler2D bgTex;
  58308. uniform float progress;
  58309. uniform float screenRatio;
  58310. varying vec2 vUv;
  58311. void main() {
  58312. const float maxRadius = 0.708; // sqrt(0.5^2+0.5^2)
  58313. const float minRadius = 0.0 ;
  58314. float radius = sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio);
  58315. float diff = 0.15;
  58316. float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
  58317. float radiusOut = radiusIn + diff;
  58318. if(radius < radiusIn) {
  58319. gl_FragColor = texture2D(bgTex, vUv);
  58320. //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
  58321. }else if(radius>radiusOut){
  58322. gl_FragColor = texture2D(coverTex, vUv) ;
  58323. //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
  58324. }else{
  58325. vec4 color1 = texture2D(bgTex, vUv);
  58326. vec4 color2 = texture2D(coverTex, vUv);
  58327. float rotio = smoothstep(radiusIn ,radiusOut,radius);
  58328. gl_FragColor = mix(color1, color2, rotio);
  58329. }
  58330. }
  58331. `
  58332. } );
  58333. },
  58334. }
  58335. }
  58336. /*
  58337. 笔记:
  58338. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  58339. */