main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553
  1. window.common = null;
  2. window.MathLight = null;
  3. window.math = null
  4. var dealMap = (map)=>{//使不resize when image is not power of two
  5. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  6. map.minFilter = THREE.LinearFilter;
  7. map.magFilter = THREE.LinearFilter;
  8. map.generateMipmaps = true;
  9. }
  10. /* var sortByScore = function(list,g_tourAudio request, rank) {
  11. var i = common.filterAll(list, request);
  12. return 0 === i.length ? null : i = i.map(function(e) {
  13. return {
  14. item: e,
  15. score: rank.reduce(function(t, i) {
  16. return t + i(e);
  17. }, 0)
  18. };
  19. }).sort(function(e, t) {
  20. return t.score - e.score;
  21. });
  22. };
  23. */
  24. var getTransformSid = function(){
  25. var name
  26. if(player.mode == 'panorama'){
  27. name = player.currentPano ? player.currentPano.id : 'outside'
  28. }else{
  29. name = 'outside'
  30. }
  31. return name
  32. }
  33. var convertTool = {
  34. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  35. var camera = camera || player.camera;
  36. var dom = dom || player.domElement;
  37. 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);
  38. var x,y;
  39. x = (pos.x + 1) / 2 * dom.clientWidth;
  40. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  41. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  42. && y <= dom.clientHeight && y >= 0
  43. return {
  44. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  45. vector: pos, //(范围 -1 ~ 1)
  46. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  47. inSight : inSight //在屏幕范围内可见
  48. };
  49. },
  50. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  51. var ori = player.position
  52. var dir = pos3d.clone().sub(ori).normalize()
  53. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  54. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  55. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  56. }else{ */
  57. var o = ray.intersectObjects(player.model.colliders);
  58. //}
  59. var len = pos3d.distanceTo(ori);
  60. if (o && o.length) {
  61. for(var i=0;i<o.length;i++){
  62. if(o[i].distance < len){ return true; }//有遮挡
  63. }
  64. }
  65. },
  66. /*
  67. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  68. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  69. */
  70. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  71. var A = pos;
  72. var player = player;
  73. var mouse = player.mouse;
  74. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  75. if(info.y != void 0){//地面线的
  76. var y = info.y;
  77. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  78. //intersectPlane和地面平行,无交点
  79. var x = pos.x, z = pos.z;
  80. }else{
  81. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  82. if(O.y == A.y){console.log('一样??');return;}
  83. if(A.y == y){console.log('一样2??');return;}
  84. var r = (O.y-y)/(A.y-y);
  85. var x = (r*A.x-O.x)/(r-1);
  86. var z = (r*A.z-O.z)/(r-1);
  87. }
  88. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  89. var N = info.normalVec;
  90. var P = info.pullPos;
  91. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  92. if(O.z==A.z){console.log('O.z==A.z?');return;}
  93. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  94. //console.log('N.z==0 && N.x == 0?');
  95. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  96. if(c == 0){console.log("分母为0?? return;");return;}
  97. 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
  98. var x = t * (A.x - O.x) + O.x;
  99. var y = t * (A.y - O.y) + O.y;
  100. var z = t * (A.z - O.z) + O.z;
  101. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  102. 求直线L与平面π的交点的坐标。
  103. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  104. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  105. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  106. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  107. 再代入参数方程即得交点的坐标(x,y,z). */
  108. }else if(N.x ==0 ){ //z与pullPos相等
  109. var z = P.z;
  110. if(O.y == A.y){console.log('一样??');return;}
  111. if(A.y == y){console.log('一样2??');return;}
  112. if(A.z == z){console.log('一样3??');return;}
  113. var r = (O.z-z)/(A.z-z);
  114. var x = (r*A.x-O.x)/(r-1);
  115. var y = (r*A.y-O.y)/(r-1);
  116. }else if(N.z == 0){//x与pullPos相等
  117. var x = P.x;
  118. if(O.y == A.y){console.log('一样??');return;}
  119. if(A.y == y){console.log('一样2??');return;}
  120. if(A.x == x){console.log('一样3??');return;}
  121. var r = (O.x-x)/(A.x-x);
  122. var y = (r*A.y-O.y)/(r-1);
  123. var z = (r*A.z-O.z)/(r-1);
  124. }
  125. }
  126. return new THREE.Vector3(x,y,z);
  127. },
  128. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  129. var raycaster = new THREE.Raycaster;
  130. camera.updateMatrixWorld();
  131. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  132. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  133. var dir = end.sub(origin).normalize()
  134. raycaster.set(origin, dir);
  135. var n = raycaster.intersectObjects(meshes);
  136. if (0 === n.length)
  137. return null;
  138. return n[0];
  139. },
  140. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  141. var dir = B.clone().sub(A).normalize();
  142. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  143. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  144. var o = ray.intersectObjects(options.model || player.model.colliders);
  145. if (o && o.length)return o;
  146. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  147. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  148. normal.multiplyScalar(options.throughWidth)
  149. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  150. var A2 = A.clone().add(normalVec3)
  151. ray.set(A2, dir);
  152. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  153. ray.set(A.clone().add(normalVec3.negate()), dir);
  154. if (o2 && o2.length)return o2;
  155. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  156. if (o3 && o3.length)return o3;
  157. }
  158. return null;
  159. },
  160. getPosAtSphere : function(pos3d, toPanoPos){
  161. var dir = pos3d.clone().sub(toPanoPos);
  162. dir.normalize();//然后计算在球中
  163. dir.multiplyScalar(Constants.skyRadius);
  164. dir.add(toPanoPos);
  165. return dir;
  166. }
  167. }
  168. var dom = {
  169. getOffset: function(e, t, i) {
  170. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  171. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  172. left += "left" == e ? t.offsetLeft : t.offsetTop;
  173. return left
  174. }
  175. };
  176. if (function() {
  177. "use strict";
  178. function o(e, t) {
  179. return typeof e === t
  180. }
  181. function a(e, t) {
  182. return e instanceof t
  183. }
  184. function s(e) {
  185. return e && e.nodeType
  186. }
  187. function l(e) {
  188. return s(e) ? e : a(e, y) ? e[0] : void 0
  189. }
  190. function e(e, i, n) {
  191. return y.each(e, function(e, t) {
  192. n = i.call(t, n, e, t)
  193. }),
  194. n
  195. }
  196. function t(e, t, i) {
  197. var n, r, o;
  198. if (e === t)
  199. return !0;
  200. if (!e || !t || e.constructor !== t.constructor)
  201. return !1;
  202. for (n = 0,
  203. r = i.length; n < r; n += 1) {
  204. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  205. return !1;
  206. if (e[o] !== t[o])
  207. return !1
  208. }
  209. return !0
  210. }
  211. function c(e, t, i, n) {
  212. this.left = w(e),
  213. this.top = w(t),
  214. this.width = w(i),
  215. this.height = w(n),
  216. this.right = this.left + this.width,
  217. this.bottom = this.top + this.height
  218. }
  219. function h(e, t, i, n) {
  220. this.visible = e || 0,
  221. this.viewport = t || 0,
  222. this.possible = i || 0,
  223. this.rects = n && I({}, n) || null
  224. }
  225. function r(e, t) {
  226. this.els = e,
  227. this.viewport = t
  228. }
  229. function n(e, t) {
  230. return e.val - t.val
  231. }
  232. function u(e, t) {
  233. return t.val - e.val
  234. }
  235. function d(e) {
  236. var t = c.ofContent(e, !0)
  237. , i = c.ofViewport(e, !0)
  238. , n = t.width - i.width
  239. , r = t.height - i.height;
  240. this.content = t,
  241. this.viewport = i,
  242. this.width = n <= 0 ? null : i.left / n,
  243. this.height = r <= 0 ? null : i.top / r,
  244. this.left = i.left,
  245. this.top = i.top,
  246. this.right = t.right - i.right,
  247. this.bottom = t.bottom - i.bottom
  248. }
  249. function p(e) {
  250. this.el = e || window
  251. }
  252. function f(e, t) {
  253. this.context = e,
  254. this.viewport = t,
  255. this.init()
  256. }
  257. function g(e, t, i, n) {
  258. this.context = new r(e,t),
  259. this.property = i,
  260. this.descending = n,
  261. this.init()
  262. }
  263. function m(e) {
  264. e && e !== window && e !== document ? (this.context = e,
  265. this.$autoTarget = y(e)) : this.context = window,
  266. this.init()
  267. }
  268. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  269. v = 1,
  270. function(e) {
  271. return e ? (i[e] || (i[e] = v,
  272. v += 1),
  273. i[e]) : 0
  274. }
  275. );
  276. I(c.prototype, {
  277. equals: function(e) {
  278. return t(this, e, ["left", "top", "width", "height"])
  279. },
  280. area: function() {
  281. return this.width * this.height
  282. },
  283. relativeTo: function(e) {
  284. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  285. },
  286. intersection: function(e) {
  287. if (!a(e, c))
  288. return null;
  289. var t = _(this.left, e.left)
  290. , i = b(this.right, e.right)
  291. , n = _(this.top, e.top)
  292. , r = i - t
  293. , o = b(this.bottom, e.bottom) - n;
  294. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  295. },
  296. envelope: function(e) {
  297. if (!a(e, c))
  298. return this;
  299. var t = b(this.left, e.left)
  300. , i = _(this.right, e.right)
  301. , n = b(this.top, e.top);
  302. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  303. }
  304. }),
  305. I(c, {
  306. ofContent: function(e, t) {
  307. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  308. },
  309. ofViewport: function(e, t) {
  310. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  311. },
  312. ofElement: function(e) {
  313. var t = y(e);
  314. if (!t.is(":visible"))
  315. return null;
  316. var i = t.offset();
  317. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  318. }
  319. }),
  320. I(h.prototype, {
  321. equals: function(e) {
  322. return this.fracsEqual(e) && this.rectsEqual(e)
  323. },
  324. fracsEqual: function(e) {
  325. return t(this, e, ["visible", "viewport", "possible"])
  326. },
  327. rectsEqual: function(e) {
  328. return t(this.rects, e.rects, ["document", "element", "viewport"])
  329. }
  330. }),
  331. I(h, {
  332. of: function(e, t) {
  333. var i, n, r;
  334. return e = s(e) && c.ofElement(e) || e,
  335. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  336. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  337. r = b(e.width, t.width) * b(e.height, t.height),
  338. new h(n / e.area(),n / t.area(),n / r,{
  339. document: i,
  340. element: i.relativeTo(e),
  341. viewport: i.relativeTo(t)
  342. })) : new h
  343. }
  344. });
  345. var x = ["width", "height", "left", "right", "top", "bottom"]
  346. , S = ["possible", "visible", "viewport"];
  347. I(r.prototype, {
  348. sorted: function(t, e) {
  349. var i = this.viewport;
  350. return y.map(this.els, function(e) {
  351. return {
  352. el: e,
  353. val: function(e, t, i) {
  354. var n;
  355. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  356. n ? n[i] : 0
  357. }(e, i, t)
  358. }
  359. }).sort(e ? u : n)
  360. },
  361. best: function(e, t) {
  362. return this.els.length ? this.sorted(e, t)[0] : null
  363. }
  364. }),
  365. I(d.prototype, {
  366. equals: function(e) {
  367. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  368. }
  369. }),
  370. I(p.prototype, {
  371. equals: function(e) {
  372. return t(this, e, ["el"])
  373. },
  374. scrollState: function() {
  375. return new d(this.el)
  376. },
  377. scrollTo: function(e, t, i) {
  378. var n = y(this.el === window ? "html,body" : this.el);
  379. e = e || 0,
  380. t = t || 0,
  381. i = isNaN(i) ? 1e3 : i,
  382. n.stop(!0).animate({
  383. scrollLeft: e,
  384. scrollTop: t
  385. }, i)
  386. },
  387. scroll: function(e, t, i) {
  388. var n = this.el === window ? A : y(this.el);
  389. e = e || 0,
  390. t = t || 0,
  391. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  392. },
  393. scrollToRect: function(e, t, i, n) {
  394. t = t || 0,
  395. i = i || 0,
  396. this.scrollTo(e.left - t, e.top - i, n)
  397. },
  398. scrollToElement: function(e, t, i, n) {
  399. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  400. this.scrollToRect(r, t, i, n)
  401. }
  402. });
  403. var M = {
  404. init: function() {
  405. this.callbacks = y.Callbacks("memory unique"),
  406. this.currVal = null,
  407. this.prevVal = null,
  408. this.checkProxy = y.proxy(this.check, this),
  409. this.autoCheck()
  410. },
  411. bind: function(e) {
  412. this.callbacks.add(e)
  413. },
  414. unbind: function(e) {
  415. e ? this.callbacks.remove(e) : this.callbacks.empty()
  416. },
  417. trigger: function() {
  418. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  419. },
  420. check: function(e) {
  421. var t = this.updatedValue(e);
  422. return void 0 !== t && (this.prevVal = this.currVal,
  423. this.currVal = t,
  424. this.trigger(),
  425. !0)
  426. },
  427. $autoTarget: A,
  428. autoEvents: "load resize scroll",
  429. autoCheck: function(e) {
  430. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  431. }
  432. };
  433. I(f.prototype, M, {
  434. updatedValue: function() {
  435. var e = h.of(this.context, this.viewport);
  436. return this.currVal && this.currVal.equals(e) ? void 0 : e
  437. }
  438. }),
  439. I(g.prototype, M, {
  440. updatedValue: function() {
  441. var e = this.context.best(this.property, this.descending);
  442. return e && (e = 0 < e.val ? e.el : null,
  443. this.currVal !== e) ? e : void 0
  444. }
  445. }),
  446. I(m.prototype, M, {
  447. updatedValue: function() {
  448. var e = new d(this.context);
  449. return this.currVal && this.currVal.equals(e) ? void 0 : e
  450. }
  451. });
  452. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  453. function H(e, t, i, n) {
  454. return i = N(i) ? i.apply(e, t) : i,
  455. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  456. }
  457. R = U,
  458. P = {
  459. statics: {
  460. version: "0.15.0",
  461. Rect: c,
  462. Fractions: h,
  463. Group: r,
  464. ScrollState: d,
  465. Viewport: p,
  466. FracsCallbacks: f,
  467. GroupCallbacks: g,
  468. ScrollStateCallbacks: m,
  469. fracs: function(e, t) {
  470. return h.of(e, t)
  471. }
  472. },
  473. methods: {
  474. content: function(e) {
  475. return this.length ? c.ofContent(this[0], e) : null
  476. },
  477. envelope: function() {
  478. return e(this, function(e) {
  479. var t = c.ofElement(this);
  480. return e ? e.envelope(t) : t
  481. })
  482. },
  483. fracs: function(e, i, n) {
  484. o(e, "string") || (n = i,
  485. i = e,
  486. e = null),
  487. E(i) || (n = i,
  488. i = null),
  489. n = l(n);
  490. var r = U + ".fracs." + T(n);
  491. return "unbind" === e ? this.each(function() {
  492. var e = y(this).data(r);
  493. e && e.unbind(i)
  494. }) : "check" === e ? this.each(function() {
  495. var e = y(this).data(r);
  496. e && e.check()
  497. }) : E(i) ? this.each(function() {
  498. var e = y(this)
  499. , t = e.data(r);
  500. t || (t = new f(this,n),
  501. e.data(r, t)),
  502. t.bind(i)
  503. }) : this.length ? h.of(this[0], n) : null
  504. },
  505. intersection: function() {
  506. return e(this, function(e) {
  507. var t = c.ofElement(this);
  508. return e ? e.intersection(t) : t
  509. })
  510. },
  511. max: function(e, t, i) {
  512. return E(t) || (i = t,
  513. t = null),
  514. i = l(i),
  515. t ? (new g(this,i,e,!0).bind(t),
  516. this) : this.pushStack(new r(this,i).best(e, !0).el)
  517. },
  518. min: function(e, t, i) {
  519. return E(t) || (i = t,
  520. t = null),
  521. i = l(i),
  522. t ? (new g(this,i,e).bind(t),
  523. this) : this.pushStack(new r(this,i).best(e).el)
  524. },
  525. rect: function() {
  526. return this.length ? c.ofElement(this[0]) : null
  527. },
  528. scrollState: function(e, i) {
  529. var n = U + ".scrollState";
  530. return o(e, "string") || (i = e,
  531. e = null),
  532. "unbind" === e ? this.each(function() {
  533. var e = y(this).data(n);
  534. e && e.unbind(i)
  535. }) : "check" === e ? this.each(function() {
  536. var e = y(this).data(n);
  537. e && e.check()
  538. }) : E(i) ? this.each(function() {
  539. var e = y(this)
  540. , t = e.data(n);
  541. t || (t = new m(this),
  542. e.data(n, t)),
  543. t.bind(i)
  544. }) : this.length ? new d(this[0]) : null
  545. },
  546. scroll: function(e, t, i) {
  547. return this.each(function() {
  548. new p(this).scroll(e, t, i)
  549. })
  550. },
  551. scrollTo: function(e, t, i, n) {
  552. return y.isNumeric(e) && (n = i,
  553. i = t,
  554. t = e,
  555. e = null),
  556. e = l(e),
  557. this.each(function() {
  558. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  559. })
  560. },
  561. scrollToThis: function(e, t, i, n) {
  562. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  563. this
  564. },
  565. softLink: function(t, i, n, r) {
  566. return r = new p(l(r)),
  567. this.filter("a[href^=#]").each(function() {
  568. var e = y(this);
  569. e.on("click", function() {
  570. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  571. })
  572. })
  573. },
  574. sort: function(e, t, i) {
  575. return o(t, "boolean") || (i = t,
  576. t = null),
  577. i = l(i),
  578. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  579. return e.el
  580. }))
  581. },
  582. viewport: function(e) {
  583. return this.length ? c.ofViewport(this[0], e) : null
  584. }
  585. },
  586. defaultStatic: "fracs",
  587. defaultMethod: "fracs"
  588. },
  589. O = [].slice,
  590. L = jQuery,
  591. D = L.extend,
  592. N = L.isFunction,
  593. F = D({}, P),
  594. B = function() {
  595. return H(this, O.call(arguments), F.defaultStatic, B)
  596. }
  597. ,
  598. V = function(e) {
  599. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  600. }
  601. ,
  602. (k = function(e) {
  603. e && (D(B, e.statics),
  604. D(V, e.methods)),
  605. B.modplug = k
  606. }
  607. ).prev = {
  608. statics: L[R],
  609. methods: L.fn[R]
  610. },
  611. k(P),
  612. L[R] = B,
  613. L.fn[R] = V
  614. }(),
  615. "undefined" == typeof jQuery)
  616. throw new Error("Bootstrap's JavaScript requires jQuery");
  617. !function(m) {
  618. "use strict";
  619. function r(e, t) {
  620. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  621. this.init("tooltip", e, t)
  622. }
  623. r.VERSION = "3.2.0",
  624. r.DEFAULTS = {
  625. animation: !0,
  626. placement: "top",
  627. selector: !1,
  628. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  629. trigger: "hover focus",
  630. title: "",
  631. delay: 0,
  632. html: !1,
  633. container: !1,
  634. viewport: {
  635. selector: "body",
  636. padding: 0
  637. }
  638. },
  639. r.prototype.init = function(e, t, i) {
  640. this.enabled = !0,
  641. this.type = e,
  642. this.$element = m(t),
  643. this.options = this.getOptions(i),
  644. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  645. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  646. var o = n[r];
  647. if ("click" == o)
  648. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  649. else if ("manual" != o) {
  650. var a = "hover" == o ? "mouseenter" : "focusin"
  651. , s = "hover" == o ? "mouseleave" : "focusout";
  652. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  653. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  654. }
  655. }
  656. this.options.selector ? this._options = m.extend({}, this.options, {
  657. trigger: "manual",
  658. selector: ""
  659. }) : this.fixTitle()
  660. }
  661. ,
  662. r.prototype.getDefaults = function() {
  663. return r.DEFAULTS
  664. }
  665. ,
  666. r.prototype.getOptions = function(e) {
  667. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  668. show: e.delay,
  669. hide: e.delay
  670. }),
  671. e
  672. }
  673. ,
  674. r.prototype.getDelegateOptions = function() {
  675. var i = {}
  676. , n = this.getDefaults();
  677. return this._options && m.each(this._options, function(e, t) {
  678. n[e] != t && (i[e] = t)
  679. }),
  680. i
  681. }
  682. ,
  683. r.prototype.enter = function(e) {
  684. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  685. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  686. m(e.currentTarget).data("bs." + this.type, t)),
  687. clearTimeout(t.timeout),
  688. t.hoverState = "in",
  689. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  690. }
  691. ,
  692. r.prototype.leave = function(e) {
  693. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  694. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  695. m(e.currentTarget).data("bs." + this.type, t)),
  696. clearTimeout(t.timeout),
  697. t.hoverState = "out",
  698. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  699. "out" == t.hoverState && t.hide()
  700. }, t.options.delay.hide)) : t.hide()
  701. }
  702. ,
  703. r.prototype.show = function() {
  704. var e = m.Event("show.bs." + this.type);
  705. if (this.hasContent() && this.enabled) {
  706. this.$element.trigger(e);
  707. var t = m.contains(document.documentElement, this.$element[0]);
  708. if (e.isDefaultPrevented() || !t)
  709. return;
  710. var i = this
  711. , n = this.tip()
  712. , r = this.getUID(this.type);
  713. this.setContent(),
  714. n.attr("id", r),
  715. this.$element.attr("aria-describedby", r),
  716. this.options.animation && n.addClass("fade");
  717. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  718. , a = /\s?auto?\s?/i
  719. , s = a.test(o);
  720. s && (o = o.replace(a, "") || "top"),
  721. n.detach().css({
  722. top: 0,
  723. left: 0,
  724. display: "block"
  725. }).addClass(o).data("bs." + this.type, this),
  726. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  727. var l = this.getPosition()
  728. , c = n[0].offsetWidth
  729. , h = n[0].offsetHeight;
  730. if (s) {
  731. var u = o
  732. , d = this.$element.parent()
  733. , p = this.getPosition(d);
  734. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  735. n.removeClass(u).addClass(o)
  736. }
  737. var f = this.getCalculatedOffset(o, l, c, h);
  738. this.applyPlacement(f, o);
  739. var g = function() {
  740. i.$element.trigger("shown.bs." + i.type),
  741. i.hoverState = null
  742. };
  743. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  744. }
  745. }
  746. ,
  747. r.prototype.applyPlacement = function(e, t) {
  748. var i = this.tip()
  749. , n = i[0].offsetWidth
  750. , r = i[0].offsetHeight
  751. , o = parseInt(i.css("margin-top"), 10)
  752. , a = parseInt(i.css("margin-left"), 10);
  753. isNaN(o) && (o = 0),
  754. isNaN(a) && (a = 0),
  755. e.top = e.top + o,
  756. e.left = e.left + a,
  757. m.offset.setOffset(i[0], m.extend({
  758. using: function(e) {
  759. i.css({
  760. top: Math.round(e.top),
  761. left: Math.round(e.left)
  762. })
  763. }
  764. }, e), 0),
  765. i.addClass("in");
  766. var s = i[0].offsetWidth
  767. , l = i[0].offsetHeight;
  768. "top" == t && l != r && (e.top = e.top + r - l);
  769. var c = this.getViewportAdjustedDelta(t, e, s, l);
  770. c.left ? e.left += c.left : e.top += c.top;
  771. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  772. , u = c.left ? "left" : "top"
  773. , d = c.left ? "offsetWidth" : "offsetHeight";
  774. i.offset(e),
  775. this.replaceArrow(h, i[0][d], u)
  776. }
  777. ,
  778. r.prototype.replaceArrow = function(e, t, i) {
  779. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  780. }
  781. ,
  782. r.prototype.setContent = function() {
  783. var e = this.tip()
  784. , t = this.getTitle();
  785. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  786. e.removeClass("fade in top bottom left right")
  787. }
  788. ,
  789. r.prototype.hide = function() {
  790. function e() {
  791. "in" != t.hoverState && i.detach(),
  792. t.$element.trigger("hidden.bs." + t.type)
  793. }
  794. var t = this
  795. , i = this.tip()
  796. , n = m.Event("hide.bs." + this.type);
  797. if (this.$element.removeAttr("aria-describedby"),
  798. this.$element.trigger(n),
  799. !n.isDefaultPrevented())
  800. return i.removeClass("in"),
  801. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  802. this.hoverState = null,
  803. this
  804. }
  805. ,
  806. r.prototype.fixTitle = function() {
  807. var e = this.$element;
  808. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  809. }
  810. ,
  811. r.prototype.hasContent = function() {
  812. return this.getTitle()
  813. }
  814. ,
  815. r.prototype.getPosition = function(e) {
  816. var t = (e = e || this.$element)[0]
  817. , i = "BODY" == t.tagName;
  818. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  819. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  820. width: i ? m(window).width() : e.outerWidth(),
  821. height: i ? m(window).height() : e.outerHeight()
  822. }, i ? {
  823. top: 0,
  824. left: 0
  825. } : e.offset())
  826. }
  827. ,
  828. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  829. return "bottom" == e ? {
  830. top: t.top + t.height,
  831. left: t.left + t.width / 2 - i / 2
  832. } : "top" == e ? {
  833. top: t.top - n,
  834. left: t.left + t.width / 2 - i / 2
  835. } : "left" == e ? {
  836. top: t.top + t.height / 2 - n / 2,
  837. left: t.left - i
  838. } : {
  839. top: t.top + t.height / 2 - n / 2,
  840. left: t.left + t.width
  841. }
  842. }
  843. ,
  844. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  845. var r = {
  846. top: 0,
  847. left: 0
  848. };
  849. if (!this.$viewport)
  850. return r;
  851. var o = this.options.viewport && this.options.viewport.padding || 0
  852. , a = this.getPosition(this.$viewport);
  853. if (/right|left/.test(e)) {
  854. var s = t.top - o - a.scroll
  855. , l = t.top + o - a.scroll + n;
  856. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  857. } else {
  858. var c = t.left - o
  859. , h = t.left + o + i;
  860. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  861. }
  862. return r
  863. }
  864. ,
  865. r.prototype.getTitle = function() {
  866. var e = this.$element
  867. , t = this.options;
  868. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  869. }
  870. ,
  871. r.prototype.getUID = function(e) {
  872. for (; e += ~~(1e6 * Math.random()),
  873. document.getElementById(e); )
  874. ;
  875. return e
  876. }
  877. ,
  878. r.prototype.tip = function() {
  879. return this.$tip = this.$tip || m(this.options.template)
  880. }
  881. ,
  882. r.prototype.arrow = function() {
  883. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  884. }
  885. ,
  886. r.prototype.validate = function() {
  887. this.$element[0].parentNode || (this.hide(),
  888. this.$element = null,
  889. this.options = null)
  890. }
  891. ,
  892. r.prototype.enable = function() {
  893. this.enabled = !0
  894. }
  895. ,
  896. r.prototype.disable = function() {
  897. this.enabled = !1
  898. }
  899. ,
  900. r.prototype.toggleEnabled = function() {
  901. this.enabled = !this.enabled
  902. }
  903. ,
  904. r.prototype.toggle = function(e) {
  905. var t = this;
  906. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  907. m(e.currentTarget).data("bs." + this.type, t))),
  908. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  909. }
  910. ,
  911. r.prototype.destroy = function() {
  912. clearTimeout(this.timeout),
  913. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  914. }
  915. ;
  916. var e = m.fn.tooltip;
  917. m.fn.tooltip = function(n) {
  918. return this.each(function() {
  919. var e = m(this)
  920. , t = e.data("bs.tooltip")
  921. , i = "object" == typeof n && n;
  922. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  923. "string" == typeof n && t[n]())
  924. })
  925. }
  926. ,
  927. m.fn.tooltip.Constructor = r,
  928. m.fn.tooltip.noConflict = function() {
  929. return m.fn.tooltip = e,
  930. this
  931. }
  932. }(jQuery),
  933. function(e, t, i) {
  934. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  935. }(0, this, function() {
  936. "use strict";
  937. function Keen() {
  938. return _init.apply(this, arguments)
  939. }
  940. function _init(e) {
  941. if (_isUndefined(e))
  942. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  943. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  944. throw new Error("Please provide a projectId");
  945. this.configure(e)
  946. }
  947. function _extend(e) {
  948. for (var t = 1; t < arguments.length; t++)
  949. for (var i in arguments[t])
  950. e[i] = arguments[t][i];
  951. return e
  952. }
  953. function _isUndefined(e) {
  954. return void 0 === e
  955. }
  956. function _type(e) {
  957. var t = e && e.constructor ? e.constructor.toString() : void 0;
  958. return t ? t.match(/function (.*)\(/)[1] : "Null"
  959. }
  960. function _each(e, t, i) {
  961. var n;
  962. if (!e)
  963. return 0;
  964. if (i = i || e,
  965. "array" === _type(e)) {
  966. for (n = 0; n < e.length; n++)
  967. if (!1 === t.call(i, e[n], n, e))
  968. return 0
  969. } else
  970. for (n in e)
  971. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  972. return 0;
  973. return 1
  974. }
  975. function _parse_params(e) {
  976. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  977. return decodeURIComponent(e.replace(n, " "))
  978. }, a = e.split("?")[1]; t = r.exec(a); )
  979. i[o(t[1])] = o(t[2]);
  980. return i
  981. }
  982. function _set_protocol(e) {
  983. switch (e) {
  984. case "http":
  985. return "http";
  986. case "auto":
  987. return location.protocol.replace(/:/g, "");
  988. case "https":
  989. case void 0:
  990. default:
  991. return "https"
  992. }
  993. }
  994. function _set_request_type(e) {
  995. var t = e || "jsonp"
  996. , i = !1;
  997. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  998. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  999. }
  1000. function _build_url(e) {
  1001. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1002. }
  1003. function _uploadEvent(e, t, i, n, r) {
  1004. var o = _build_url.apply(this, ["/events/" + e])
  1005. , a = {};
  1006. for (var s in i = !1 !== i,
  1007. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1008. t)
  1009. t.hasOwnProperty(s) && (a[s] = t[s]);
  1010. switch (this.client.requestType) {
  1011. case "xhr":
  1012. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1013. break;
  1014. case "jsonp":
  1015. var l = JSON.stringify(a)
  1016. , c = Keen.Base64.encode(l);
  1017. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1018. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1019. break;
  1020. case "beacon":
  1021. l = JSON.stringify(a),
  1022. c = Keen.Base64.encode(l);
  1023. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1024. o += "&c=clv1",
  1025. _request.beacon.apply(this, [o, null, n, r])
  1026. }
  1027. }
  1028. Keen.prototype.configure = function(e) {
  1029. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1030. e.protocol = _set_protocol(e.protocol),
  1031. e.requestType = _set_request_type(e.requestType),
  1032. this.client = {
  1033. projectId: e.projectId,
  1034. writeKey: e.writeKey,
  1035. readKey: e.readKey,
  1036. globalProperties: null,
  1037. endpoint: e.protocol + "://" + e.host,
  1038. requestType: e.requestType
  1039. },
  1040. Keen.trigger("client", this, e),
  1041. this.trigger("ready"),
  1042. this
  1043. }
  1044. ;
  1045. var _request = {
  1046. xhr: function(e, t, i, n, r, o, a, s) {
  1047. if (!r)
  1048. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1049. var l = new XMLHttpRequest;
  1050. if (l.onreadystatechange = function() {
  1051. if (4 == l.readyState)
  1052. if (200 <= l.status && l.status < 300) {
  1053. var e;
  1054. try {
  1055. e = JSON.parse(l.responseText)
  1056. } catch (e) {
  1057. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1058. s && s(l, e)
  1059. }
  1060. a && e && a(e)
  1061. } else
  1062. Keen.log("HTTP request failed."),
  1063. s && s(l, null)
  1064. }
  1065. ,
  1066. l.open(e, t, o),
  1067. r && l.setRequestHeader("Authorization", r),
  1068. n && l.setRequestHeader("Content-Type", "application/json"),
  1069. i)
  1070. for (var c in i)
  1071. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1072. var h = n ? JSON.stringify(n) : null;
  1073. l.send(h)
  1074. },
  1075. jsonp: function(e, t, i, n) {
  1076. if (!t)
  1077. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1078. if (t && e.indexOf("api_key") < 0) {
  1079. var r = 0 < e.indexOf("?") ? "&" : "?";
  1080. e = e + r + "api_key=" + t
  1081. }
  1082. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1083. o += "a";
  1084. var a = !1;
  1085. window[o] = function(e) {
  1086. a = !0,
  1087. i && e && i(e),
  1088. window[o] = void 0
  1089. }
  1090. ,
  1091. e = e + "&jsonp=" + o;
  1092. var s = document.createElement("script");
  1093. s.id = "keen-jsonp",
  1094. s.src = e,
  1095. document.getElementsByTagName("head")[0].appendChild(s),
  1096. s.onreadystatechange = function() {
  1097. !1 === a && "loaded" === this.readyState && (a = !0,
  1098. n && n())
  1099. }
  1100. ,
  1101. s.onerror = function() {
  1102. !1 === a && (a = !0,
  1103. n && n())
  1104. }
  1105. },
  1106. beacon: function(e, t, i, n) {
  1107. if (t && e.indexOf("api_key") < 0) {
  1108. var r = 0 < e.indexOf("?") ? "&" : "?";
  1109. e = e + r + "api_key=" + t
  1110. }
  1111. var o = document.createElement("img");
  1112. o.onload = function() {
  1113. if (!0,
  1114. "naturalHeight"in this) {
  1115. if (this.naturalHeight + this.naturalWidth === 0)
  1116. return void this.onerror()
  1117. } else if (this.width + this.height === 0)
  1118. return void this.onerror();
  1119. i && i({
  1120. created: !0
  1121. })
  1122. }
  1123. ,
  1124. o.onerror = function() {
  1125. !0,
  1126. n && n()
  1127. }
  1128. ,
  1129. o.src = e
  1130. }
  1131. }
  1132. , Events = Keen.Events = {
  1133. on: function(e, t) {
  1134. return this.listeners || (this.listeners = {}),
  1135. (this.listeners[e] || (this.listeners[e] = [])).push({
  1136. callback: t
  1137. }),
  1138. this
  1139. },
  1140. off: function(e, t) {
  1141. if (!e && !t)
  1142. return this.listeners = void 0,
  1143. delete this.listeners,
  1144. this;
  1145. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1146. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1147. t && 0 != i.length || (this.listeners[e] = void 0,
  1148. delete this.listeners[e]);
  1149. return this
  1150. },
  1151. trigger: function(e) {
  1152. if (!this.listeners)
  1153. return this;
  1154. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1155. i[n].callback.apply(this, t);
  1156. return this
  1157. }
  1158. };
  1159. _extend(Keen.prototype, Events),
  1160. _extend(Keen, Events),
  1161. Keen.loaded = !0,
  1162. Keen.utils = {
  1163. each: _each,
  1164. extend: _extend,
  1165. parseParams: _parse_params
  1166. },
  1167. Keen.ready = function(e) {
  1168. Keen.loaded ? e() : Keen.on("ready", e)
  1169. }
  1170. ,
  1171. Keen.log = function(e) {
  1172. "object" == typeof console && console.log("[Keen IO]", e)
  1173. }
  1174. ;
  1175. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1176. Keen.prototype.addEvent = function() {
  1177. _uploadEvent.apply(this, arguments)
  1178. }
  1179. ,
  1180. Keen.prototype.addEventSync = function(e, t, i, n) {
  1181. _uploadEvent.apply(this, [e, t, !1, i, n])
  1182. }
  1183. ,
  1184. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1185. var o = e
  1186. , a = o.metaKey
  1187. , s = o.target
  1188. , l = !1
  1189. , c = function() {};
  1190. return void 0 === n && (n = 500),
  1191. "A" === s.nodeName ? c = function() {
  1192. a || l || (l = !0,
  1193. window.location = s.href)
  1194. }
  1195. : "FORM" === s.nodeName && (c = function() {
  1196. l || (l = !0,
  1197. s.submit())
  1198. }
  1199. ),
  1200. r && (c = function() {
  1201. l || (l = !0,
  1202. r())
  1203. }
  1204. ),
  1205. _uploadEvent.call(this, t, i, c, c),
  1206. setTimeout(function() {
  1207. c()
  1208. }, n),
  1209. !!a && void 0
  1210. }
  1211. ,
  1212. Keen.prototype.setGlobalProperties = function(e) {
  1213. if (!this.client)
  1214. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1215. if (!e || "function" != typeof e)
  1216. throw new Error("Invalid value for global properties: " + e);
  1217. this.client.globalProperties = e
  1218. }
  1219. ,
  1220. Keen.Base64 = {
  1221. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1222. encode: function(e) {
  1223. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1224. for (e = this.utf8.encode(e); c < e.length; )
  1225. t = e.charCodeAt(c++),
  1226. i = e.charCodeAt(c++),
  1227. n = e.charCodeAt(c++),
  1228. r = t >> 2,
  1229. o = (3 & t) << 4 | i >> 4,
  1230. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1231. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1232. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1233. return l
  1234. },
  1235. decode: function(e) {
  1236. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1237. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1238. t = c.indexOf(e.charAt(l++)),
  1239. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1240. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1241. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1242. return this.utf8.decode(s)
  1243. },
  1244. utf8: {
  1245. encode: function(e) {
  1246. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1247. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1248. return i
  1249. },
  1250. decode: function(e) {
  1251. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1252. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1253. return i
  1254. }
  1255. }
  1256. },
  1257. "object" != typeof JSON && (JSON = {}),
  1258. function() {
  1259. function f(e) {
  1260. return e < 10 ? "0" + e : e
  1261. }
  1262. function quote(e) {
  1263. return escapable.lastIndex = 0,
  1264. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1265. var t = meta[e];
  1266. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1267. }) + '"' : '"' + e + '"'
  1268. }
  1269. function str(e, t) {
  1270. var i, n, r, o, a, s = gap, l = t[e];
  1271. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1272. "function" == typeof rep && (l = rep.call(t, e, l)),
  1273. typeof l) {
  1274. case "string":
  1275. return quote(l);
  1276. case "number":
  1277. return isFinite(l) ? String(l) : "null";
  1278. case "boolean":
  1279. case "null":
  1280. return String(l);
  1281. case "object":
  1282. if (!l)
  1283. return "null";
  1284. if (gap += indent,
  1285. a = [],
  1286. "[object Array]" === Object.prototype.toString.apply(l)) {
  1287. for (o = l.length,
  1288. i = 0; i < o; i += 1)
  1289. a[i] = str(i, l) || "null";
  1290. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1291. gap = s,
  1292. r
  1293. }
  1294. if (rep && "object" == typeof rep)
  1295. for (o = rep.length,
  1296. i = 0; i < o; i += 1)
  1297. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1298. else
  1299. for (n in l)
  1300. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1301. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1302. gap = s,
  1303. r
  1304. }
  1305. }
  1306. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1307. 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
  1308. }
  1309. ,
  1310. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1311. return this.valueOf()
  1312. }
  1313. );
  1314. 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 = {
  1315. "\b": "\\b",
  1316. "\t": "\\t",
  1317. "\n": "\\n",
  1318. "\f": "\\f",
  1319. "\r": "\\r",
  1320. '"': '\\"',
  1321. "\\": "\\\\"
  1322. }, rep;
  1323. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1324. var n;
  1325. if (indent = gap = "",
  1326. "number" == typeof i)
  1327. for (n = 0; n < i; n += 1)
  1328. indent += " ";
  1329. else
  1330. "string" == typeof i && (indent = i);
  1331. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1332. throw new Error("JSON.stringify");
  1333. return str("", {
  1334. "": e
  1335. })
  1336. }
  1337. ),
  1338. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1339. function walk(e, t) {
  1340. var i, n, r = e[t];
  1341. if (r && "object" == typeof r)
  1342. for (i in r)
  1343. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1344. return reviver.call(e, t, r)
  1345. }
  1346. var j;
  1347. if (text = String(text),
  1348. cx.lastIndex = 0,
  1349. cx.test(text) && (text = text.replace(cx, function(e) {
  1350. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1351. })),
  1352. /^[\],:{}\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, "")))
  1353. return j = eval("(" + text + ")"),
  1354. "function" == typeof reviver ? walk({
  1355. "": j
  1356. }, "") : j;
  1357. throw new SyntaxError("JSON.parse")
  1358. }
  1359. )
  1360. }(),
  1361. Hh = Keen.utils,
  1362. Ih = function(i) {
  1363. function e(e) {
  1364. for (u = 1; e = n.shift(); )
  1365. e()
  1366. }
  1367. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1368. return r[l] && r[l](s, t = function() {
  1369. r.removeEventListener(s, t, !1),
  1370. e()
  1371. }
  1372. , !1),
  1373. a && r.attachEvent(c, t = function() {
  1374. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1375. e())
  1376. }
  1377. ),
  1378. i = a ? function(t) {
  1379. self != top ? u ? t() : n.push(t) : function() {
  1380. try {
  1381. o.doScroll("left")
  1382. } catch (e) {
  1383. return setTimeout(function() {
  1384. i(t)
  1385. }, 50)
  1386. }
  1387. t()
  1388. }()
  1389. }
  1390. : function(e) {
  1391. u ? e() : n.push(e)
  1392. }
  1393. }
  1394. ,
  1395. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1396. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1397. if (loaded && cached) {
  1398. for (var instance in clients = cached.clients || {},
  1399. ready = cached.ready || [],
  1400. clients)
  1401. if (clients.hasOwnProperty(instance)) {
  1402. var client = clients[instance];
  1403. for (var method in Keen.prototype)
  1404. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1405. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1406. ,
  1407. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1408. ,
  1409. client._config && (client.configure.call(client, client._config),
  1410. delete client._config),
  1411. client._setGlobalProperties) {
  1412. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1413. client.setGlobalProperties.apply(client, globals[i]);
  1414. delete client._setGlobalProperties
  1415. }
  1416. if (client._addEvent) {
  1417. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1418. client.addEvent.apply(client, queue[i]);
  1419. delete client._addEvent
  1420. }
  1421. var callback = client._on || [];
  1422. if (client._on) {
  1423. for (var i = 0; i < callback.length; i++)
  1424. client.on.apply(client, callback[i]);
  1425. client.trigger("ready"),
  1426. delete client._on
  1427. }
  1428. }
  1429. for (var i = 0; i < ready.length; i++) {
  1430. var callback = ready[i];
  1431. Keen.on("ready", function() {
  1432. callback()
  1433. })
  1434. }
  1435. }
  1436. return Keen.loaded && setTimeout(function() {
  1437. Keen.utils.domready(function() {
  1438. Keen.trigger("ready")
  1439. })
  1440. }, 0),
  1441. Keen
  1442. }),
  1443. function() {
  1444. var i = window.analytics = window.analytics || [];
  1445. if (!i.initialize) {
  1446. if (i.invoked)
  1447. return window.console && console.error && console.error("Segment snippet included twice.");
  1448. i.invoked = !0,
  1449. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1450. i.factory = function(t) {
  1451. return function() {
  1452. var e = Array.prototype.slice.call(arguments);
  1453. return e.unshift(t),
  1454. i.push(e),
  1455. i
  1456. }
  1457. }
  1458. ;
  1459. for (var e = 0; e < i.methods.length; e++) {
  1460. var t = i.methods[e];
  1461. i[t] = i.factory(t)
  1462. }
  1463. i.load = function(e) {
  1464. var t = document.createElement("script");
  1465. t.type = "text/javascript",
  1466. t.async = !0,
  1467. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1468. var i = document.getElementsByTagName("script")[0];
  1469. i.parentNode.insertBefore(t, i)
  1470. }
  1471. ,
  1472. i.SNIPPET_VERSION = "4.0.0"
  1473. }
  1474. }(),
  1475. function(i, u) {
  1476. "use strict";
  1477. var d = "function"
  1478. , p = "undefined"
  1479. , f = "object"
  1480. , e = "major"
  1481. , t = "model"
  1482. , n = "name"
  1483. , r = "type"
  1484. , o = "vendor"
  1485. , a = "version"
  1486. , s = "architecture"
  1487. , l = "console"
  1488. , c = "mobile"
  1489. , h = "tablet"
  1490. , g = {
  1491. has: function(e, t) {
  1492. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1493. },
  1494. lowerize: function(e) {
  1495. return e.toLowerCase()
  1496. }
  1497. }
  1498. , m = {
  1499. rgx: function() {
  1500. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1501. var c = l[s]
  1502. , h = l[s + 1];
  1503. if (typeof e == p)
  1504. for (n in e = {},
  1505. h)
  1506. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1507. for (t = i = 0; t < c.length; t++)
  1508. if (o = c[t].exec(this.getUA())) {
  1509. for (n = 0; n < h.length; n++)
  1510. a = o[++i],
  1511. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1512. break
  1513. }
  1514. if (o)
  1515. break
  1516. }
  1517. return e
  1518. },
  1519. str: function(e, t) {
  1520. for (var i in t)
  1521. if (typeof t[i] == f && 0 < t[i].length) {
  1522. for (var n = 0; n < t[i].length; n++)
  1523. if (g.has(t[i][n], e))
  1524. return "?" === i ? u : i
  1525. } else if (g.has(t[i], e))
  1526. return "?" === i ? u : i;
  1527. return e
  1528. }
  1529. }
  1530. , v = {
  1531. browser: {
  1532. oldsafari: {
  1533. major: {
  1534. 1: ["/8", "/1", "/3"],
  1535. 2: "/4",
  1536. "?": "/"
  1537. },
  1538. version: {
  1539. "1.0": "/8",
  1540. 1.2: "/1",
  1541. 1.3: "/3",
  1542. "2.0": "/412",
  1543. "2.0.2": "/416",
  1544. "2.0.3": "/417",
  1545. "2.0.4": "/419",
  1546. "?": "/"
  1547. }
  1548. }
  1549. },
  1550. device: {
  1551. sprint: {
  1552. model: {
  1553. "Evo Shift 4G": "7373KT"
  1554. },
  1555. vendor: {
  1556. HTC: "APA",
  1557. Sprint: "Sprint"
  1558. }
  1559. }
  1560. },
  1561. os: {
  1562. windows: {
  1563. version: {
  1564. ME: "4.90",
  1565. "NT 3.11": "NT3.51",
  1566. "NT 4.0": "NT4.0",
  1567. 2e3: "NT 5.0",
  1568. XP: ["NT 5.1", "NT 5.2"],
  1569. Vista: "NT 6.0",
  1570. 7: "NT 6.1",
  1571. 8: "NT 6.2",
  1572. 8.1: "NT 6.3",
  1573. RT: "ARM"
  1574. }
  1575. }
  1576. }
  1577. }
  1578. , y = {
  1579. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(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], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(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], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(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], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(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], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1580. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1581. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(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], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1582. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1583. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(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], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/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], [n, a]]
  1584. }
  1585. , A = function(e) {
  1586. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1587. return this instanceof A ? (this.getBrowser = function() {
  1588. return m.rgx.apply(this, y.browser)
  1589. }
  1590. ,
  1591. this.getCPU = function() {
  1592. return m.rgx.apply(this, y.cpu)
  1593. }
  1594. ,
  1595. this.getDevice = function() {
  1596. return m.rgx.apply(this, y.device)
  1597. }
  1598. ,
  1599. this.getEngine = function() {
  1600. return m.rgx.apply(this, y.engine)
  1601. }
  1602. ,
  1603. this.getOS = function() {
  1604. return m.rgx.apply(this, y.os)
  1605. }
  1606. ,
  1607. this.getResult = function() {
  1608. return {
  1609. ua: this.getUA(),
  1610. browser: this.getBrowser(),
  1611. engine: this.getEngine(),
  1612. os: this.getOS(),
  1613. device: this.getDevice(),
  1614. cpu: this.getCPU()
  1615. }
  1616. }
  1617. ,
  1618. this.getUA = function() {
  1619. return t
  1620. }
  1621. ,
  1622. this.setUA = function(e) {
  1623. return t = e,
  1624. this
  1625. }
  1626. ,
  1627. void this.setUA(t)) : new A(e).getResult()
  1628. };
  1629. if (typeof exports != p)
  1630. typeof module != p && module.exports && (exports = module.exports = A),
  1631. exports.UAParser = A;
  1632. else if (i.UAParser = A,
  1633. typeof define == d && define.amd && define(function() {
  1634. return A
  1635. }),
  1636. typeof i.jQuery != p) {
  1637. var C = i.jQuery
  1638. , I = new A;
  1639. C.ua = I.getResult(),
  1640. C.ua.get = function() {
  1641. return I.getUA()
  1642. }
  1643. ,
  1644. C.ua.set = function(e) {
  1645. I.setUA(e);
  1646. var t = I.getResult();
  1647. for (var i in t)
  1648. C.ua[i] = t[i]
  1649. }
  1650. }
  1651. }(this),
  1652. window.Modernizr = function(e, t) {
  1653. function i(e, t) {
  1654. return typeof e === t
  1655. }
  1656. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1657. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1658. return t in e && i(e.constructor.prototype[t], "undefined")
  1659. }
  1660. : function(e, t) {
  1661. return p.call(e, t)
  1662. }
  1663. ,
  1664. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1665. var r = this;
  1666. if ("function" != typeof r)
  1667. throw new TypeError;
  1668. var o = d.call(arguments, 1)
  1669. , a = function() {
  1670. if (this instanceof a) {
  1671. function e() {}
  1672. e.prototype = r.prototype;
  1673. var t = new e
  1674. , i = r.apply(t, o.concat(d.call(arguments)));
  1675. return Object(i) === i ? i : t
  1676. }
  1677. return r.apply(n, o.concat(d.call(arguments)))
  1678. };
  1679. return a
  1680. }
  1681. ),
  1682. h.webgl = function() {
  1683. return !!e.WebGLRenderingContext
  1684. }
  1685. ,
  1686. h)
  1687. r(h, f) && (n = f.toLowerCase(),
  1688. a[n] = h[f](),
  1689. u.push((a[n] ? "" : "no-") + n));
  1690. return a.addTest = function(e, t) {
  1691. if ("object" == typeof e)
  1692. for (var i in e)
  1693. r(e, i) && a.addTest(i, e[i]);
  1694. else {
  1695. if (e = e.toLowerCase(),
  1696. void 0 !== a[e])
  1697. return a;
  1698. t = "function" == typeof t ? t() : t,
  1699. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1700. a[e] = t
  1701. }
  1702. return a
  1703. }
  1704. ,
  1705. o = "",
  1706. c.cssText = o,
  1707. l = null,
  1708. a._version = "2.8.2",
  1709. a
  1710. }(this, this.document),
  1711. function(xe, e, Se) {
  1712. "use strict";
  1713. function Me(s, e, n) {
  1714. function a(e) {
  1715. var t = Q.length;
  1716. if (G.old = xe.extend({}, G),
  1717. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1718. Y = W[F.horizontal ? "width" : "height"](),
  1719. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1720. Q.length = 0,
  1721. G.start = 0,
  1722. G.end = nt(z - H, 0),
  1723. le) {
  1724. $.length,
  1725. J = U.children(F.itemSelector),
  1726. $.length = 0;
  1727. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1728. z = 0,
  1729. J.each(function(e, t) {
  1730. var i = xe(t)
  1731. , n = t.getBoundingClientRect()
  1732. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1733. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1734. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1735. , s = r + o + a
  1736. , l = !o || !a
  1737. , c = {};
  1738. c.el = t,
  1739. c.size = l ? r : s,
  1740. c.half = c.size / 2,
  1741. c.start = z + (l ? o : 0),
  1742. c.center = c.start - it(H / 2 - c.size / 2),
  1743. c.end = c.start - H + c.size,
  1744. e || (z += u),
  1745. z += s,
  1746. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1747. e === g && (c.end += d,
  1748. z += d,
  1749. f = l ? a : 0),
  1750. $.push(c),
  1751. h = c
  1752. }),
  1753. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1754. z -= f,
  1755. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1756. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1757. }
  1758. if (G.center = it(G.end / 2 + G.start / 2),
  1759. v(),
  1760. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1761. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1762. X.end = Y - q,
  1763. _e || c()),
  1764. !V && 0 < H) {
  1765. var n = G.start
  1766. , r = "";
  1767. if (le)
  1768. xe.each($, function(e, t) {
  1769. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1770. Q.push(n),
  1771. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1772. });
  1773. else
  1774. for (; n - H < G.end; )
  1775. Q.push(n),
  1776. n += H;
  1777. if (Z[0] && t !== Q.length) {
  1778. for (var o = 0; o < Q.length; o++)
  1779. r += F.pageBuilder.call(B, o);
  1780. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1781. }
  1782. }
  1783. if (ee.slideeSize = z,
  1784. ee.frameSize = H,
  1785. ee.sbSize = Y,
  1786. ee.handleSize = q,
  1787. le) {
  1788. e && null != F.startAt && (m(F.startAt),
  1789. B[se ? "toCenter" : "toStart"](F.startAt));
  1790. var a = $[ee.activeItem];
  1791. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1792. } else
  1793. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1794. L("load")
  1795. }
  1796. function l(e, t, i) {
  1797. if (le && Ie.released && !i) {
  1798. var n = d(e)
  1799. , r = e > G.start && e < G.end;
  1800. se ? (r && (e = $[n.centerItem].center),
  1801. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1802. }
  1803. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1804. Ae.start = +new Date,
  1805. Ae.time = 0,
  1806. Ae.from = G.cur,
  1807. Ae.to = e,
  1808. Ae.delta = e - G.cur,
  1809. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1810. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1811. Ie.tweese = 0,
  1812. e !== G.dest && (G.dest = e,
  1813. L("change"),
  1814. _e || o()),
  1815. g(),
  1816. v(),
  1817. p(),
  1818. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1819. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1820. L("activePage", ye.page))
  1821. }
  1822. function o() {
  1823. if (B.initialized) {
  1824. if (!_e)
  1825. return _e = Ge(o),
  1826. void (Ie.released && L("moveStart"));
  1827. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1828. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1829. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1830. Ae.to === G.cur ? (G.cur = Ae.to,
  1831. Ie.tweese = _e = 0) : _e = Ge(o),
  1832. L("move"),
  1833. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1834. !_e && Ie.released && L("moveEnd"),
  1835. c()
  1836. }
  1837. }
  1838. function c() {
  1839. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1840. X.cur = Fe(it(X.cur), X.start, X.end),
  1841. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1842. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1843. }
  1844. function t() {
  1845. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1846. Te = Ie.init ? Ge(t) : 0,
  1847. Ce.now = +new Date,
  1848. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1849. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1850. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1851. Ce.lastTime = Ce.now
  1852. }
  1853. function i(e, t, i) {
  1854. if ("boolean" === Re(t) && (i = t,
  1855. t = Se),
  1856. t === Se)
  1857. l(G[e], i);
  1858. else {
  1859. if (se && "center" !== e)
  1860. return;
  1861. var n = B.getPos(t);
  1862. n && l(n[e], i, !se)
  1863. }
  1864. }
  1865. function h(e) {
  1866. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1867. }
  1868. function u(e) {
  1869. return h(De(e) && e < 0 ? e + $.length : e)
  1870. }
  1871. function m(e, t) {
  1872. var i = h(e);
  1873. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1874. J.eq(i).addClass(F.activeClass),
  1875. ye.active = ee.activeItem = i,
  1876. p(),
  1877. L("active", i)),
  1878. i)
  1879. }
  1880. function d(e) {
  1881. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1882. var t = {}
  1883. , i = ae ? 0 : H / 2;
  1884. if (!V)
  1885. for (var n = 0, r = Q.length; n < r; n++) {
  1886. if (e >= G.end || n === Q.length - 1) {
  1887. t.activePage = Q.length - 1;
  1888. break
  1889. }
  1890. if (e <= Q[n] + i) {
  1891. t.activePage = n;
  1892. break
  1893. }
  1894. }
  1895. if (le) {
  1896. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1897. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1898. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1899. l === c - 1 || e <= $[l].end + $[l].half) {
  1900. a = l;
  1901. break
  1902. }
  1903. t.firstItem = De(o) ? o : 0,
  1904. t.centerItem = De(s) ? s : t.firstItem,
  1905. t.lastItem = De(a) ? a : t.centerItem
  1906. }
  1907. return t
  1908. }
  1909. function v(e) {
  1910. xe.extend(ee, d(e))
  1911. }
  1912. function p() {
  1913. var e = G.dest <= G.start
  1914. , t = G.dest >= G.end
  1915. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1916. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1917. ge.is("button,input") && ge.prop("disabled", e),
  1918. me.is("button,input") && me.prop("disabled", t),
  1919. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1920. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1921. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1922. de.is("button,input") && de.prop("disabled", e),
  1923. ue.is("button,input") && ue.prop("disabled", t)),
  1924. le && null != ee.activeItem) {
  1925. var n = 0 === ee.activeItem
  1926. , r = ee.activeItem >= $.length - 1
  1927. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1928. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1929. pe.is("button,input") && pe.prop("disabled", n),
  1930. fe.is("button,input") && fe.prop("disabled", r),
  1931. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1932. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1933. }
  1934. }
  1935. function r(e, t, i) {
  1936. if (e = u(e),
  1937. t = u(t),
  1938. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1939. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1940. var n = e < t ? e : i ? t : t - 1
  1941. , r = t < e ? e : i ? t + 1 : t
  1942. , o = t < e;
  1943. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1944. a()
  1945. }
  1946. }
  1947. function f(e, t) {
  1948. for (var i = 0, n = ve[e].length; i < n; i++)
  1949. if (ve[e][i] === t)
  1950. return i;
  1951. return -1
  1952. }
  1953. function g() {
  1954. Ie.released && !B.isPaused && B.resume()
  1955. }
  1956. function y(e) {
  1957. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1958. }
  1959. function A() {
  1960. Ie.history[0] = Ie.history[1],
  1961. Ie.history[1] = Ie.history[2],
  1962. Ie.history[2] = Ie.history[3],
  1963. Ie.history[3] = Ie.delta
  1964. }
  1965. function C(e) {
  1966. Ie.released = 0,
  1967. Ie.source = e,
  1968. Ie.slidee = "slidee" === e
  1969. }
  1970. function I(e) {
  1971. var t = "touchstart" === e.type
  1972. , i = e.data.source
  1973. , n = "slidee" === i;
  1974. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1975. C(i),
  1976. Ie.init = 0,
  1977. Ie.$source = xe(e.target),
  1978. Ie.touch = t,
  1979. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1980. Ie.initX = Ie.pointer.pageX,
  1981. Ie.initY = Ie.pointer.pageY,
  1982. Ie.initPos = n ? G.cur : X.cur,
  1983. Ie.start = +new Date,
  1984. Ie.time = 0,
  1985. Ie.path = 0,
  1986. Ie.delta = 0,
  1987. Ie.locked = 0,
  1988. Ie.history = [0, 0, 0, 0],
  1989. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1990. We.on(t ? qe : Ye, E),
  1991. B.pause(1),
  1992. (n ? U : j).addClass(F.draggedClass),
  1993. L("moveStart"),
  1994. n && (be = setInterval(A, 10)))
  1995. }
  1996. function E(e) {
  1997. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1998. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1999. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2000. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2001. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2002. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2003. Ie.released || !(Ie.path < 1)) {
  2004. if (!Ie.init) {
  2005. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2006. return _();
  2007. Ie.init = 1
  2008. }
  2009. Pe(e),
  2010. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2011. Ie.$source.on(Ze, Oe)),
  2012. Ie.released && (_(),
  2013. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2014. Ie.delta += Ie.swing,
  2015. Ie.tweese = 10 < $e(Ie.swing))),
  2016. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2017. }
  2018. }
  2019. function _() {
  2020. clearInterval(be),
  2021. Ie.released = !0,
  2022. We.off(Ie.touch ? qe : Ye, E),
  2023. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2024. setTimeout(function() {
  2025. Ie.$source.off(Ze, Oe)
  2026. }),
  2027. G.cur === G.dest && Ie.init && L("moveEnd"),
  2028. B.resume(1),
  2029. Ie.init = 0
  2030. }
  2031. function b(e) {
  2032. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2033. }
  2034. function w() {
  2035. B.stop(),
  2036. We.off("mouseup", w)
  2037. }
  2038. function T(e) {
  2039. switch (Pe(e),
  2040. this) {
  2041. case ue[0]:
  2042. case de[0]:
  2043. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2044. We.on("mouseup", w);
  2045. break;
  2046. case pe[0]:
  2047. B.prev();
  2048. break;
  2049. case fe[0]:
  2050. B.next();
  2051. break;
  2052. case ge[0]:
  2053. B.prevPage();
  2054. break;
  2055. case me[0]:
  2056. B.nextPage()
  2057. }
  2058. }
  2059. function x(e) {
  2060. e.originalEvent[He] = B;
  2061. var t = +new Date;
  2062. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2063. ot = t;
  2064. else if (F.scrollBy && G.start !== G.end) {
  2065. var i = function(e) {
  2066. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2067. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2068. le ? (Ue = +new Date,
  2069. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2070. Ee.last = Ue,
  2071. Ee.delta += Ee.curDelta,
  2072. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2073. Ee.delta %= 1),
  2074. Ee.finalDelta) : Ee.curDelta
  2075. }(e.originalEvent);
  2076. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2077. B.slideBy(F.scrollBy * i)
  2078. }
  2079. }
  2080. function S(e) {
  2081. F.clickBar && e.target === W[0] && (Pe(e),
  2082. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2083. }
  2084. function M(e) {
  2085. if (F.keyboardNavBy)
  2086. switch (e.which) {
  2087. case F.horizontal ? 37 : 38:
  2088. Pe(e),
  2089. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2090. break;
  2091. case F.horizontal ? 39 : 40:
  2092. Pe(e),
  2093. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2094. }
  2095. }
  2096. function R(e) {
  2097. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2098. }
  2099. function P() {
  2100. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2101. }
  2102. function O(e) {
  2103. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2104. }
  2105. function L(e, t) {
  2106. if (ve[e]) {
  2107. for (N = ve[e].length,
  2108. Je.length = 0,
  2109. D = 0; D < N; D++)
  2110. Je.push(ve[e][D]);
  2111. for (D = 0; D < N; D++)
  2112. Je[D].call(B, e, t)
  2113. }
  2114. }
  2115. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  2116. start: 0,
  2117. center: 0,
  2118. end: 0,
  2119. cur: 0,
  2120. dest: 0
  2121. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2122. start: 0,
  2123. end: 0,
  2124. cur: 0
  2125. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2126. firstItem: 0,
  2127. lastItem: 0,
  2128. centerItem: 0,
  2129. activeItem: null,
  2130. activePage: 0
  2131. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  2132. released: 1
  2133. }, Ee = {
  2134. last: 0,
  2135. delta: 0,
  2136. resetTime: 200
  2137. }, _e = 0, be = 0, we = 0, Te = 0;
  2138. V || (s = k[0]),
  2139. B.initialized = 0,
  2140. B.frame = s,
  2141. B.slidee = U[0],
  2142. B.pos = G,
  2143. B.rel = ee,
  2144. B.items = $,
  2145. B.pages = Q,
  2146. B.isPaused = 0,
  2147. B.options = F,
  2148. B.dragging = Ie,
  2149. B.reload = function() {
  2150. a()
  2151. }
  2152. ,
  2153. B.getPos = function(e) {
  2154. if (le) {
  2155. var t = h(e);
  2156. return -1 !== t && $[t]
  2157. }
  2158. var i = U.find(e).eq(0);
  2159. if (i[0]) {
  2160. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2161. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2162. return {
  2163. start: n,
  2164. center: n - H / 2 + r / 2,
  2165. end: n - H + r,
  2166. size: r
  2167. }
  2168. }
  2169. return !1
  2170. }
  2171. ,
  2172. B.moveBy = function(e) {
  2173. Ce.speed = e,
  2174. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2175. Ce.startPos = G.cur,
  2176. C("button"),
  2177. Ie.init = 1,
  2178. L("moveStart"),
  2179. ze(Te),
  2180. t())
  2181. }
  2182. ,
  2183. B.stop = function() {
  2184. "button" === Ie.source && (Ie.init = 0,
  2185. Ie.released = 1)
  2186. }
  2187. ,
  2188. B.prev = function() {
  2189. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2190. }
  2191. ,
  2192. B.next = function() {
  2193. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2194. }
  2195. ,
  2196. B.prevPage = function() {
  2197. B.activatePage(ee.activePage - 1)
  2198. }
  2199. ,
  2200. B.nextPage = function() {
  2201. B.activatePage(ee.activePage + 1)
  2202. }
  2203. ,
  2204. B.slideBy = function(e, t) {
  2205. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2206. }
  2207. ,
  2208. B.slideTo = function(e, t) {
  2209. l(e, t)
  2210. }
  2211. ,
  2212. B.toStart = function(e, t) {
  2213. i("start", e, t)
  2214. }
  2215. ,
  2216. B.toEnd = function(e, t) {
  2217. i("end", e, t)
  2218. }
  2219. ,
  2220. B.toCenter = function(e, t) {
  2221. i("center", e, t)
  2222. }
  2223. ,
  2224. B.getIndex = h,
  2225. B.activate = function(e, t) {
  2226. var i = m(e);
  2227. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2228. }
  2229. ,
  2230. B.activatePage = function(e, t) {
  2231. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2232. }
  2233. ,
  2234. B.resume = function(e) {
  2235. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2236. we ? we = clearTimeout(we) : L("resume"),
  2237. we = setTimeout(function() {
  2238. switch (L("cycle"),
  2239. F.cycleBy) {
  2240. case "items":
  2241. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2242. break;
  2243. case "pages":
  2244. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2245. }
  2246. }, F.cycleInterval))
  2247. }
  2248. ,
  2249. B.pause = function(e) {
  2250. e < B.isPaused || (B.isPaused = e || 100,
  2251. we && (we = clearTimeout(we),
  2252. L("pause")))
  2253. }
  2254. ,
  2255. B.toggle = function() {
  2256. B[we ? "pause" : "resume"]()
  2257. }
  2258. ,
  2259. B.set = function(e, t) {
  2260. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2261. }
  2262. ,
  2263. B.add = function(e, t) {
  2264. var i = xe(e);
  2265. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2266. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2267. a()
  2268. }
  2269. ,
  2270. B.remove = function(e) {
  2271. if (le) {
  2272. var t = u(e);
  2273. if (-1 < t) {
  2274. J.eq(t).remove();
  2275. var i = t === ee.activeItem;
  2276. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2277. a(),
  2278. i && (ye.active = null,
  2279. B.activate(ee.activeItem))
  2280. }
  2281. } else
  2282. xe(e).remove(),
  2283. a()
  2284. }
  2285. ,
  2286. B.moveAfter = function(e, t) {
  2287. r(e, t, 1)
  2288. }
  2289. ,
  2290. B.moveBefore = function(e, t) {
  2291. r(e, t)
  2292. }
  2293. ,
  2294. B.on = function(e, t) {
  2295. if ("object" === Re(e))
  2296. for (var i in e)
  2297. e.hasOwnProperty(i) && B.on(i, e[i]);
  2298. else if ("function" === Re(t))
  2299. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2300. ve[n[r]] = ve[n[r]] || [],
  2301. -1 === f(n[r], t) && ve[n[r]].push(t);
  2302. else if ("array" === Re(t))
  2303. for (var a = 0, s = t.length; a < s; a++)
  2304. B.on(e, t[a])
  2305. }
  2306. ,
  2307. B.one = function(t, i) {
  2308. B.on(t, function e() {
  2309. i.apply(B, arguments),
  2310. B.off(t, e)
  2311. })
  2312. }
  2313. ,
  2314. B.off = function(e, t) {
  2315. if (t instanceof Array)
  2316. for (var i = 0, n = t.length; i < n; i++)
  2317. B.off(e, t[i]);
  2318. else
  2319. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2320. if (ve[r[o]] = ve[r[o]] || [],
  2321. null == t)
  2322. ve[r[o]].length = 0;
  2323. else {
  2324. var s = f(r[o], t);
  2325. -1 !== s && ve[r[o]].splice(s, 1)
  2326. }
  2327. }
  2328. ,
  2329. B.destroy = function() {
  2330. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2331. We.off("keydown", M),
  2332. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2333. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2334. Z.empty(),
  2335. V || (k.off("." + He),
  2336. te.restore(),
  2337. ie.restore(),
  2338. ne.restore(),
  2339. re.restore(),
  2340. xe.removeData(s, He)),
  2341. $.length = Q.length = 0,
  2342. ye = {},
  2343. B.initialized = 0,
  2344. B
  2345. }
  2346. ,
  2347. B.init = function() {
  2348. if (!B.initialized) {
  2349. B.on(n);
  2350. var e = ["overflow", "position"]
  2351. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2352. te.save.apply(te, e),
  2353. ne.save.apply(ne, e),
  2354. ie.save.apply(ie, t),
  2355. re.save.apply(re, t);
  2356. var i = j;
  2357. return V || (i = i.add(U),
  2358. k.css("overflow", "hidden"),
  2359. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2360. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2361. i.css({
  2362. position: "absolute"
  2363. })),
  2364. F.forward && ue.on(Ke, T),
  2365. F.backward && de.on(Ke, T),
  2366. F.prev && pe.on(Ze, T),
  2367. F.next && fe.on(Ze, T),
  2368. F.prevPage && ge.on(Ze, T),
  2369. F.nextPage && me.on(Ze, T),
  2370. ce.on(Xe, x),
  2371. W[0] && W.on(Ze, S),
  2372. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2373. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2374. he.on(je, {
  2375. source: "slidee"
  2376. }, I),
  2377. j && j.on(je, {
  2378. source: "handle"
  2379. }, I),
  2380. We.on("keydown", M),
  2381. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2382. k.on("scroll." + He, Le)),
  2383. B.initialized = 1,
  2384. a(!0),
  2385. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2386. B
  2387. }
  2388. }
  2389. }
  2390. function Re(e) {
  2391. 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
  2392. }
  2393. function Pe(e, t) {
  2394. e.preventDefault(),
  2395. t && e.stopPropagation()
  2396. }
  2397. function Oe(e) {
  2398. Pe(e, 1),
  2399. xe(this).off(e.type, Oe)
  2400. }
  2401. function Le() {
  2402. this.scrollLeft = 0,
  2403. this.scrollTop = 0
  2404. }
  2405. function De(e) {
  2406. return !isNaN(parseFloat(e)) && isFinite(e)
  2407. }
  2408. function Ne(e, t) {
  2409. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2410. }
  2411. function Fe(e, t, i) {
  2412. return e < t ? t : i < e ? i : e
  2413. }
  2414. function Be(t) {
  2415. var i = {
  2416. style: {},
  2417. save: function() {
  2418. if (t && t.nodeType) {
  2419. for (var e = 0; e < arguments.length; e++)
  2420. i.style[arguments[e]] = t.style[arguments[e]];
  2421. return i
  2422. }
  2423. },
  2424. restore: function() {
  2425. if (t && t.nodeType) {
  2426. for (var e in i.style)
  2427. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2428. return i
  2429. }
  2430. }
  2431. };
  2432. return i
  2433. }
  2434. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2435. function t(e) {
  2436. for (var t = 0, i = r.length; t < i; t++) {
  2437. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2438. if (null != o.style[n])
  2439. return n
  2440. }
  2441. }
  2442. We.on(Xe, function(e) {
  2443. var t = e.originalEvent[He]
  2444. , i = +new Date;
  2445. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2446. }),
  2447. function(t) {
  2448. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2449. var t = (new Date).getTime()
  2450. , i = Math.max(0, 16 - (t - r))
  2451. , n = setTimeout(e, i);
  2452. return r = t,
  2453. n
  2454. }
  2455. ;
  2456. var r = (new Date).getTime()
  2457. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2458. ze = function(e) {
  2459. i.call(t, e)
  2460. }
  2461. }(window),
  2462. r = ["", "webkit", "moz", "ms", "o"],
  2463. o = document.createElement("div"),
  2464. Ve = t("transform"),
  2465. ke = t("perspective") ? "translateZ(0) " : "",
  2466. e.Sly = Me,
  2467. xe.fn.sly = function(n, r) {
  2468. var o, a;
  2469. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2470. a = Array.prototype.slice.call(arguments, 1)),
  2471. n = {}),
  2472. this.each(function(e, t) {
  2473. var i = xe.data(t, He);
  2474. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2475. })
  2476. }
  2477. ,
  2478. Me.defaults = {
  2479. slidee: null,
  2480. horizontal: !1,
  2481. itemNav: null,
  2482. itemSelector: null,
  2483. smart: !1,
  2484. activateOn: null,
  2485. activateMiddle: !1,
  2486. scrollSource: null,
  2487. scrollBy: 0,
  2488. scrollHijack: 300,
  2489. scrollTrap: !1,
  2490. dragSource: null,
  2491. mouseDragging: !1,
  2492. touchDragging: !1,
  2493. releaseSwing: !1,
  2494. swingSpeed: .2,
  2495. elasticBounds: !1,
  2496. interactive: null,
  2497. scrollBar: null,
  2498. dragHandle: !1,
  2499. dynamicHandle: !1,
  2500. minHandleSize: 50,
  2501. clickBar: !1,
  2502. syncSpeed: .5,
  2503. pagesBar: null,
  2504. activatePageOn: null,
  2505. pageBuilder: function(e) {
  2506. return "<li>" + (e + 1) + "</li>"
  2507. },
  2508. forward: null,
  2509. backward: null,
  2510. prev: null,
  2511. next: null,
  2512. prevPage: null,
  2513. nextPage: null,
  2514. cycleBy: null,
  2515. cycleInterval: 5e3,
  2516. pauseOnHover: !1,
  2517. startPaused: !1,
  2518. moveBy: 300,
  2519. speed: 0,
  2520. easing: "swing",
  2521. startAt: null,
  2522. keyboardNavBy: null,
  2523. draggedClass: "dragged",
  2524. activeClass: "active",
  2525. disabledClass: "disabled"
  2526. }
  2527. }(jQuery, window),
  2528. function o(a, s, l) {
  2529. function c(i, e) {
  2530. if (!s[i]) {
  2531. if (!a[i]) {
  2532. var t = "function" == typeof require && require;
  2533. if (!e && t)
  2534. return t(i, !0);
  2535. if (h)
  2536. return h(i, !0);
  2537. var n = new Error("Cannot find module '" + i + "'");
  2538. throw n.code = "MODULE_NOT_FOUND",
  2539. n
  2540. }
  2541. var r = s[i] = {
  2542. exports: {}
  2543. };
  2544. a[i][0].call(r.exports, function(e) {
  2545. var t = a[i][1][e];
  2546. return c(t || e)
  2547. }, r, r.exports, o, a, s, l)
  2548. }
  2549. return s[i].exports
  2550. }
  2551. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2552. c(l[e]);
  2553. return c
  2554. }({
  2555. 1: [function(p, f, e) {
  2556. (function(e) {
  2557. "use strict";
  2558. function t(e) {
  2559. this.player = null,
  2560. this.director = null,
  2561. this.modelManager = null,
  2562. this.container = null,
  2563. this.tagManager = null,
  2564. this.fadeInSpeed = e,
  2565. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2566. }
  2567. var r = p("three")
  2568. , i = p("./util/logger")
  2569. , n = (p("./util/common"),
  2570. p("./enum/PlayerEvents"))
  2571. , o = p("./enum/DirectorEvents")
  2572. , a = p("./settings")
  2573. , s = p("./enum/Viewmode")
  2574. , l = (p("./enum/WarpStyle"),
  2575. p("./enum/BlackoutStyle"),
  2576. p("./enum/ModelManagerEvents"))
  2577. , c = p("./enum/tagEvents")
  2578. , h = p("./util/transitions")
  2579. , u = p("./util/lerp")
  2580. , d = new i(e);
  2581. t.prototype.init = function(e, t, i, n, r) {
  2582. (window.app = this).player = t,
  2583. this.director = e,
  2584. this.modelManager = i,
  2585. this.tagManager = n,
  2586. this.container = r,
  2587. this.updateModel(),
  2588. this.bindEvents()
  2589. }
  2590. ,
  2591. t.prototype.bindEvents = function() {
  2592. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2593. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2594. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2595. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2596. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2597. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2598. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2599. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2600. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2601. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2602. }
  2603. ,
  2604. t.prototype.updateModel = function() {
  2605. this.model = this.modelManager.getActiveModel()
  2606. }
  2607. ,
  2608. t.prototype.handleWarpStarted = function() {
  2609. this.hidePlayerReticule()
  2610. }
  2611. ,
  2612. t.prototype.ontagActivated = function() {
  2613. this.hidePlayerReticule()
  2614. }
  2615. ,
  2616. t.prototype.onNavigationTotag = function() {
  2617. this.hidePlayerReticule()
  2618. }
  2619. ,
  2620. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2621. var n = this.modelManager.getActiveModel()
  2622. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2623. n.fadePanoMarkers(r),
  2624. n.setMode(t)
  2625. }
  2626. ,
  2627. t.prototype.handlePlayerModeChanged = function(e, t) {
  2628. var i = this.modelManager.getActiveModel()
  2629. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2630. i.setSide(n),
  2631. i.setMode(t)
  2632. }
  2633. ,
  2634. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2635. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2636. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2637. }
  2638. ,
  2639. t.prototype.handleActionInterruption = function() {}
  2640. ,
  2641. t.prototype.handleStartInside = function(e) {
  2642. var t = a[this.player.mode]
  2643. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2644. this.fadeIn(this.fadeInSpeed),
  2645. this.model.alpha = 0,
  2646. this.model.skybox.material.uniforms.opacity.value = 1,
  2647. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2648. var n = this.player.reticule;
  2649. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2650. }
  2651. ,
  2652. t.prototype.handleStartOutside = function(e) {
  2653. this.fadeIn(e)
  2654. }
  2655. ,
  2656. t.prototype.fadeIn = function(e) {
  2657. null != e || (e = 2e3,
  2658. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2659. $(this.container).fadeIn(e)
  2660. }
  2661. ,
  2662. t.prototype.hidePlayerReticule = function() {
  2663. this.player.reticule.hide()
  2664. }
  2665. ,
  2666. f.exports = t
  2667. }
  2668. ).call(this, "/js/DisplayController.js")
  2669. }
  2670. , {
  2671. "./enum/BlackoutStyle": 18,
  2672. "./enum/DirectorEvents": 23,
  2673. "./enum/tagEvents": 32,
  2674. "./enum/ModelManagerEvents": 33,
  2675. "./enum/PlayerEvents": 40,
  2676. "./enum/Viewmode": 51,
  2677. "./enum/WarpStyle": 52,
  2678. "./settings": 166,
  2679. "./util/common": 185,
  2680. "./util/lerp": 188,
  2681. "./util/logger": 189,
  2682. "./util/transitions": 195,
  2683. three: 217
  2684. }],
  2685. 2: [function(e, t, i) {
  2686. "use strict";
  2687. function n() {
  2688. this.baseStartTime = performance.timing.navigationStart,
  2689. this.loadingStartTime = null,
  2690. this.waitingStartTime = null,
  2691. this.appReadyTime = null
  2692. }
  2693. n.prototype.setBaseStartTime = function(e) {
  2694. this.baseStartTime = e || Date.now()
  2695. }
  2696. ,
  2697. n.prototype.setWaitingStartTime = function(e) {
  2698. this.waitingStartTime = e || Date.now()
  2699. }
  2700. ,
  2701. n.prototype.setLoadingStartTime = function(e) {
  2702. this.loadingStartTime = e || Date.now()
  2703. }
  2704. ,
  2705. n.prototype.setAppReadyTime = function(e) {
  2706. this.appReadyTime = e || Date.now()
  2707. }
  2708. ,
  2709. n.prototype.calcFullLoadingTime = function() {
  2710. var e = this.appReadyTime - this.baseStartTime;
  2711. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2712. e
  2713. }
  2714. ,
  2715. t.exports = n
  2716. }
  2717. , {}],
  2718. 3: [function(i, n, e) {
  2719. (function(e) {
  2720. "use strict";
  2721. function a() {
  2722. return 100 * Math.random()
  2723. }
  2724. var t = i("./util/logger")
  2725. , s = i("./util/browser")
  2726. , l = new t(e)
  2727. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2728. initialized: !1,
  2729. init: function(e, t) {
  2730. if (t = t || {},
  2731. !this.initialized) {
  2732. for (var i in this.initialized = !0,
  2733. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2734. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2735. e) {
  2736. var n = i.match("^sc_tilegen_([0-9]+)$");
  2737. n && (c.tilegen = a() < parseInt(n[1]));
  2738. var r = i.match("^sc_imgopt_([0-9]+)$");
  2739. r && (c.imgopt = a() < parseInt(r[1]))
  2740. }
  2741. for (var o in t)
  2742. c[o] = t[o],
  2743. l.debug("A/B override:", o, c[o])
  2744. }
  2745. },
  2746. changeIfTileGenerating: function(e) {
  2747. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2748. e += ""),
  2749. e
  2750. },
  2751. changeIfImageOptimzing: function(e) {
  2752. if(e.includes("blob:http"))return e;//add
  2753. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2754. e += ""),
  2755. e
  2756. },
  2757. tilegen: !1,
  2758. imgopt: !1
  2759. };
  2760. n.exports = c
  2761. }
  2762. ).call(this, "/js/ab.js")
  2763. }
  2764. , {
  2765. "./util/browser": 182,
  2766. "./util/logger": 189
  2767. }],
  2768. 4: [function(u, d, e) {
  2769. (function(e) {
  2770. "use strict";
  2771. function r(n, e, t, i) {
  2772. function r(e) {
  2773. a[e.sid] = !0;
  2774. var t = e.billboard.media && e.billboard.media.type
  2775. , i = {
  2776. tag_id: e.sid,
  2777. tags_visited: Object.keys(a).length,
  2778. tag_count: Object.keys(n.tags).length,
  2779. tag_view_count: ++d,
  2780. has_media: !!t
  2781. };
  2782. t && (i.media_type = t),
  2783. g("tag_opened", i)
  2784. }
  2785. var o, a = {}, s = Date.now() - P, l = null;
  2786. i && (l = Date.now() - window.navigationStart);
  2787. try {
  2788. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2789. } catch (n) {
  2790. o = !1
  2791. }
  2792. var c, h = n.supportsVR;
  2793. h || (c = "VR disabled at the model/account level",
  2794. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2795. g("model_loaded", {
  2796. duration: s,
  2797. duration_from_navigation_start: l,
  2798. has_hlr: o,
  2799. has_vr: h,
  2800. vr_reason: c
  2801. });
  2802. var u = 0;
  2803. n.panos.forEach(function(e) {
  2804. e.on("enter", function() {
  2805. f("pano_viewed", {
  2806. pano_id: e.id,
  2807. pano_view_count: ++u,
  2808. alignment_type: e.alignmentType,
  2809. interaction_source: R,
  2810. navigation_source: v
  2811. })
  2812. })
  2813. });
  2814. var d = 0;
  2815. for (var p in n.tags)
  2816. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2817. e.on("tour_auto", function(e) {
  2818. v = "tour_" + e
  2819. }),
  2820. e.on("tour_manual", function(e) {
  2821. R = "gui-" + e,
  2822. v = "tour_manual"
  2823. }),
  2824. t.on(C.InteractionKey, function() {
  2825. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2826. }),
  2827. t.on(C.InteractionDirect, function() {
  2828. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2829. }),
  2830. function(t) {
  2831. I.on(T.OPENED, function() {
  2832. f("showcase_share_intent", {
  2833. pano_id: t.currentPano && t.currentPano.id
  2834. })
  2835. }),
  2836. I.on(T.LINK_CLICKED, function(e) {
  2837. f("showcase_share_action", {
  2838. channel: e.channel,
  2839. pano_id: t.currentPano && t.currentPano.id
  2840. })
  2841. }),
  2842. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2843. f("showcase_share_origin_link_clicked")
  2844. })
  2845. }(e),
  2846. function() {
  2847. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2848. gui_action: "click_vr_button"
  2849. })),
  2850. _.on(S.LAUNCH, function(e) {
  2851. f("showcase_gui", {
  2852. gui_action: "launch_vr",
  2853. vr_platform: e.vr_platform,
  2854. vr_app: e.vr_app
  2855. })
  2856. }),
  2857. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2858. gui_action: "vr_modal_prev"
  2859. })),
  2860. _.on(S.NEXT, function(e) {
  2861. f("showcase_gui", {
  2862. gui_action: e.nextAction
  2863. })
  2864. }),
  2865. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2866. gui_action: "vr_modal_close"
  2867. })),
  2868. _.on(S.falseICECHOSEN, function(e) {
  2869. f("showcase_gui", {
  2870. gui_action: e.name + " "
  2871. })
  2872. }),
  2873. _.on(S.STORE, function(e) {
  2874. f("showcase_gui", {
  2875. gui_action: "launch_store",
  2876. store: e
  2877. })
  2878. })
  2879. }()
  2880. }
  2881. function f(e, t) {
  2882. if (t = t || {},
  2883. i)
  2884. try {
  2885. window.analytics.track(e, s.extendObject(t, c), {
  2886. context: {
  2887. app: {
  2888. name: "showcase",
  2889. version: "2.25.6-0-gd87e5b1"
  2890. },
  2891. screen: {
  2892. width: window.screen.width,
  2893. height: window.screen.height,
  2894. density: window.devicePixelRatio
  2895. }
  2896. }
  2897. })
  2898. } catch (t) {
  2899. console.warn("Failed to send data to segment for " + e)
  2900. }
  2901. }
  2902. function g(e, t) {
  2903. f(e, t = t || {})
  2904. }
  2905. function m(e, t) {
  2906. R = e === C.InteractionGui ? "gui-" + t : e,
  2907. v = "self_guided"
  2908. }
  2909. var v, o, a = (u("three"),
  2910. u("./util/ajax"),
  2911. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2912. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2913. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2914. d.exports = {
  2915. report: function(e, t, i, n) {
  2916. !function(e, t) {
  2917. if (o)
  2918. try {
  2919. o.addEvent(e, s.extendObject({
  2920. host: window.location.host,
  2921. keen: {
  2922. addons: [{
  2923. name: "keen:ua_parser",
  2924. input: {
  2925. ua_string: "user_agent"
  2926. },
  2927. output: "parsed_user_agent"
  2928. }]
  2929. },
  2930. user_agent: "${keen.user_agent}",
  2931. referrer: {
  2932. url: s.normalizeUrl(document.referrer),
  2933. domain: s.domainFromUrl(document.referrer),
  2934. url_original: document.referrer
  2935. },
  2936. embedded: y.inIframe(),
  2937. is_mobile: y.isMobile(),
  2938. version: "2.25.6-0-gd87e5b1"
  2939. }, t))
  2940. } catch (e) {
  2941. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2942. }
  2943. }("Session starts", {
  2944. model: e,
  2945. status: t,
  2946. loadtime: Date.now() - (P || Date.now()),
  2947. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2948. autoplay: i,
  2949. quickstart: n,
  2950. ab_tilegen: a.tilegen,
  2951. ab_imgopt: a.imgopt
  2952. })
  2953. },
  2954. impression: function(e) {
  2955. g("impression", {
  2956. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2957. url_params: (void 0 !== e.immediate && e.immediate,
  2958. window.location.search.substr(1).split("&"))
  2959. })
  2960. },
  2961. initKeen: function(e) {
  2962. return e.token && e.appId ? void (o = new Keen({
  2963. projectId: e.appId,
  2964. writeKey: e.token,
  2965. readKey: "",
  2966. requestType: "xhr"
  2967. })) : void l.warn("no keen token/appId")
  2968. },
  2969. initSegment: function(e) {
  2970. return e.token ? (i = e.token,
  2971. window.analytics.load(e.token),
  2972. c = {
  2973. model_id: e.model,
  2974. start_source: e.startSource,
  2975. autoplay: e.autoplay,
  2976. quickstart: e.quickstart,
  2977. language_tag: t.languageTag,
  2978. is_mobile: y.isMobile(),
  2979. iframe: y.inIframe(),
  2980. aspect_ratio: y.aspectRatio(),
  2981. session_id: h,
  2982. window: {
  2983. width: $("#player").width(),
  2984. height: $("#player").height()
  2985. },
  2986. platform: {
  2987. browser: {
  2988. name: $.ua.browser.name,
  2989. major: $.ua.browser.major,
  2990. version: $.ua.browser.version
  2991. },
  2992. os: {
  2993. name: $.ua.os.name,
  2994. version: $.ua.os.version
  2995. },
  2996. device: {
  2997. vendor: $.ua.device.vendor,
  2998. model: $.ua.device.model,
  2999. type: $.ua.device.type
  3000. }
  3001. }
  3002. },
  3003. n = Math.random() < t.analytics.sessionTrackingRate,
  3004. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3005. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3006. },
  3007. sessionStart: function(e) {
  3008. l.debug("analytics user_session_start"),
  3009. f("session_started"),
  3010. P = Date.now(),
  3011. window.addEventListener("unload", function() {
  3012. !function(e, t) {
  3013. if (t = t || {},
  3014. navigator.sendBeacon && i)
  3015. try {
  3016. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3017. event: e,
  3018. anonymousId: window.analytics.user().anonymousId(),
  3019. properties: s.extendObject(t, c),
  3020. writeKey: i,
  3021. sentAt: Date.now(),
  3022. type: "track",
  3023. context: {
  3024. userAgent: y.userAgent(),
  3025. library: {
  3026. name: "showcase-beacon",
  3027. version: "2.25.6-0-gd87e5b1"
  3028. },
  3029. app: {
  3030. name: "showcase",
  3031. version: "2.25.6-0-gd87e5b1"
  3032. }
  3033. }
  3034. }))
  3035. } catch (e) {
  3036. console.warn("Failed to send async segment request")
  3037. }
  3038. }("session_ended", {
  3039. duration: Date.now() - P
  3040. })
  3041. })
  3042. },
  3043. modelLoaded: function(e, t, i, n) {
  3044. r(e, t, i, n)
  3045. },
  3046. loadComplete: function(e) {
  3047. f("load_times", {
  3048. time_to_app_start: e
  3049. })
  3050. },
  3051. track: function(e, t) {
  3052. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3053. f(e, t))
  3054. },
  3055. trackAlways: function(e, t) {
  3056. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3057. f(e, t)
  3058. },
  3059. getSessionId: function() {
  3060. return h
  3061. },
  3062. updateInteraction: m
  3063. }
  3064. }
  3065. ).call(this, "/js/analytics.js")
  3066. }
  3067. , {
  3068. "./ab": 3,
  3069. "./enum/ControlEvents": 21,
  3070. "./enum/PlayerEvents": 40,
  3071. "./enum/VROption": 47,
  3072. "./enum/VRPlatforms": 49,
  3073. "./enum/Viewmode": 51,
  3074. "./gui/sharing/ShareEvents": 76,
  3075. "./gui/sharing/modal": 77,
  3076. "./gui/title/TitleEvents": 80,
  3077. "./gui/title/titleBar": 82,
  3078. "./gui/vr/vrEvent": 85,
  3079. "./gui/vr/vrModal": 87,
  3080. "./localization/localize": 108,
  3081. "./tag/Billboard/BillboardEvent": 120,
  3082. "./settings": 166,
  3083. "./util/ajax": 181,
  3084. "./util/browser": 182,
  3085. "./util/common": 185,
  3086. "./util/logger": 189,
  3087. three: 217
  3088. }],
  3089. 5: [function(e, t, i) {
  3090. "use strict";
  3091. function n() {
  3092. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3093. this.controls = null
  3094. }
  3095. var r = e("three")
  3096. , o = e("../constants")
  3097. , a = e("../util/cameraLight");
  3098. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3099. this.aspect = e,
  3100. this.updateProjectionMatrix()
  3101. }
  3102. ,
  3103. t.exports = n
  3104. }
  3105. , {
  3106. "../constants": 8,
  3107. "../util/cameraLight": 184,
  3108. three: 217
  3109. }],
  3110. 6: [function(e, t, i) {
  3111. "use strict";
  3112. function n() {
  3113. var e = $("#player").width() / $("#player").height();
  3114. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3115. this.controls = null,
  3116. this.updateAspect(e)
  3117. }
  3118. var r = e("three")
  3119. , o = e("../constants");
  3120. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3121. this.aspect = e,
  3122. this.top = o.orthoBase / e,
  3123. this.bottom = -o.orthoBase / e,
  3124. this.updateProjectionMatrix()
  3125. }
  3126. ,
  3127. t.exports = n
  3128. }
  3129. , {
  3130. "../constants": 8,
  3131. three: 217
  3132. }],
  3133. 7: [function(e, t, i) {
  3134. "use strict";
  3135. function n() {
  3136. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3137. this.controls = null
  3138. }
  3139. var r = e("three")
  3140. , o = e("../settings")
  3141. , a = e("../util/cameraLight");
  3142. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3143. this.aspect = e,
  3144. this.updateProjectionMatrix()
  3145. }
  3146. ,
  3147. t.exports = n
  3148. }
  3149. , {
  3150. "../settings": 166,
  3151. "../util/cameraLight": 184,
  3152. three: 217
  3153. }],
  3154. 8: [function(e, t, i) {
  3155. "use strict";
  3156. t.exports = {
  3157. signedUrlDefaultExpireTime: 24e4,
  3158. signedUrlCheckInterval: 1e4,
  3159. signedUrlRefreshBuffer: 15e3,
  3160. dollhouseFOV: 70,
  3161. dollhouseNear: .1,//1,
  3162. dollhouseFar: 5e3,
  3163. insideFOV: 70,
  3164. insideFOVMax: 120,
  3165. insideNear: .1,
  3166. insideFar: 5e3,
  3167. insideLookSpeed: .12,
  3168. insideLookLimitUp: 40,
  3169. insideLookLimitDown: -40,
  3170. orthoNear: 1,
  3171. orthoFar: 5e3,
  3172. orthoBase: 10,
  3173. narrowLandscapeHeight: 290,
  3174. reallyNarrowLandscapeHeight: 250,
  3175. visionTilingStartDate: new Date("8/26/2016"),
  3176. visionTilingStartVersion: "1.1.407.13667",
  3177. windowHeightHighQualityThreshold: 900,
  3178. tourStepDelayDefault: 3500,
  3179. tourStepDelaySlideShow: 5e3,
  3180. workshopApsect: 9 / 16,
  3181. highQualityMaxZoom: 2,
  3182. ultraHighQualityMaxZoom: 3
  3183. }
  3184. }
  3185. , {}],
  3186. 9: [function(e, t, i) {
  3187. "use strict";
  3188. function n() {
  3189. this.activeControl = null,
  3190. this.controls = {},
  3191. this.cameras = {}
  3192. }
  3193. var a = e("./PanoramaControls")
  3194. , s = e("./DollhouseControls")
  3195. , l = e("./FloorplanControls")
  3196. , c = e("../cameras/PanoramaCamera")
  3197. , h = e("../cameras/DollhouseCamera")
  3198. , u = e("../cameras/FloorplanCamera")
  3199. , r = e("events").EventEmitter
  3200. , d = e("../enum/ControlEvents")
  3201. , o = e("../enum/ModelManagerEvents")
  3202. , p = e("../enum/Viewmode")
  3203. , f = e("../settings");
  3204. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3205. this.setUpControls(),
  3206. this.bindEvents(e, t)
  3207. }
  3208. ,
  3209. n.prototype.activateControls = function(e) {
  3210. this.activeControl && (this.activeControl.reset(),
  3211. this.activeControl.enabled = !1),
  3212. this.controls[e] && (this.controls[e].enabled = !0),
  3213. this.activeControl = this.controls[e]
  3214. }
  3215. ,
  3216. n.prototype.setUpControls = function() {
  3217. var i = {}
  3218. , n = {}
  3219. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3220. , r = [c, h, u]
  3221. , o = [a, s, l];
  3222. e.forEach(function(e, t) {
  3223. i[e] = new r[t],
  3224. n[e] = new o[t](i[e]),
  3225. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3226. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3227. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3228. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3229. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3230. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3231. }
  3232. .bind(this)),
  3233. this.controls = n,
  3234. this.cameras = i
  3235. }
  3236. ,
  3237. n.prototype.bindEvents = function(e, t) {
  3238. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3239. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3240. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3241. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3242. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3243. passive: !1
  3244. }),
  3245. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3246. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3247. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3248. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3249. e.addEventListener("contextmenu", function(e) {
  3250. e.preventDefault()
  3251. }),
  3252. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3253. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3254. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3255. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3256. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3257. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3258. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3259. t.on(o.ActiveModelChanged, function(e) {
  3260. this.setModelForControls(e.model)
  3261. }
  3262. .bind(this))
  3263. }
  3264. ,
  3265. n.prototype.setModelForControls = function(e) {
  3266. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3267. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3268. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3269. this.controls[e].setBounds(t)
  3270. }
  3271. .bind(this))
  3272. }
  3273. ,
  3274. n.prototype.onMouseDown = function(e) {
  3275. e.preventDefault(),
  3276. this.activeControl && this.activeControl.onMouseDown(e)
  3277. }
  3278. ,
  3279. n.prototype.onMouseMove = function(e) {
  3280. e.preventDefault(),
  3281. this.activeControl && this.activeControl.onMouseMove(e)
  3282. }
  3283. ,
  3284. n.prototype.onMouseUp = function(e) {
  3285. e.preventDefault(),
  3286. this.activeControl && this.activeControl.onMouseUp(e)
  3287. }
  3288. ,
  3289. n.prototype.onMouseOver = function(e) {
  3290. e.preventDefault(),
  3291. this.activeControl && this.activeControl.onMouseOver(e)
  3292. }
  3293. ,
  3294. n.prototype.onMouseWheel = function(e) {
  3295. e.preventDefault(),
  3296. this.activeControl && this.activeControl.onMouseWheel(e)
  3297. }
  3298. ,
  3299. n.prototype.onTouchStart = function(e) {
  3300. e.preventDefault(),
  3301. this.activeControl && this.activeControl.onTouchStart(e),
  3302. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3303. $("#hotListContent ul .active").removeClass("active"),
  3304. $("#hotList")[0].classList.remove("active")
  3305. }
  3306. ,
  3307. n.prototype.onTouchMove = function(e) {
  3308. e.preventDefault(),
  3309. this.activeControl && this.activeControl.onTouchMove(e)
  3310. }
  3311. ,
  3312. n.prototype.onTouchEnd = function(e) {
  3313. e.preventDefault(),
  3314. this.activeControl && this.activeControl.onTouchEnd(e)
  3315. }
  3316. ,
  3317. n.prototype.onPointerDown = function(e) {
  3318. if (e.preventDefault(),
  3319. this.activeControl)
  3320. switch (e.pointerType) {
  3321. case "mouse":
  3322. this.activeControl.onMouseDown(e);
  3323. break;
  3324. default:
  3325. this.activeControl.onPointerDown(e)
  3326. }
  3327. }
  3328. ,
  3329. n.prototype.onPointerMove = function(e) {
  3330. if (e.preventDefault(),
  3331. this.activeControl)
  3332. switch (e.pointerType) {
  3333. case "mouse":
  3334. this.activeControl.onMouseMove(e);
  3335. break;
  3336. default:
  3337. this.activeControl.onPointerMove(e)
  3338. }
  3339. }
  3340. ,
  3341. n.prototype.onPointerUp = function(e) {
  3342. if (e.preventDefault(),
  3343. this.activeControl)
  3344. switch (e.pointerType) {
  3345. case "mouse":
  3346. this.activeControl.onMouseUp(e);
  3347. break;
  3348. default:
  3349. this.activeControl.onPointerUp(e)
  3350. }
  3351. }
  3352. ,
  3353. n.prototype.onPointerCancel = function(e) {
  3354. e.preventDefault(),
  3355. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3356. }
  3357. ,
  3358. n.prototype.onKeyDown = function(e) {
  3359. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3360. this.activeControl && this.activeControl.onKeyDown(e))
  3361. }
  3362. ,
  3363. n.prototype.onKeyUp = function(e) {
  3364. e.preventDefault(),
  3365. this.activeControl && this.activeControl.onKeyUp(e)
  3366. }
  3367. ,
  3368. t.exports = n
  3369. }
  3370. , {
  3371. "../cameras/DollhouseCamera": 5,
  3372. "../cameras/FloorplanCamera": 6,
  3373. "../cameras/PanoramaCamera": 7,
  3374. "../enum/ControlEvents": 21,
  3375. "../enum/ModelManagerEvents": 33,
  3376. "../enum/Viewmode": 51,
  3377. "../settings": 166,
  3378. "./DollhouseControls": 10,
  3379. "./FloorplanControls": 11,
  3380. "./PanoramaControls": 13,
  3381. events: 202
  3382. }],
  3383. 10: [function(e, t, i) {
  3384. "use strict";
  3385. function n(e) {
  3386. a.call(this, e),
  3387. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3388. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3389. this.minDistance = o.dollhouseDefault.minDistance,
  3390. this.maxDistance = o.dollhouseDefault.maxDistance,
  3391. this.adjustedMinDistance = this.minDistance,
  3392. this.adjustedMaxDistance = this.maxDistance
  3393. }
  3394. var r = e("three")
  3395. , o = e("../settings")
  3396. , a = e("./OutsideControls");
  3397. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3398. this.camera.updateMatrix();
  3399. var i = this.camera.position.clone().sub(this.target).length();
  3400. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3401. this.panLeft(2 * e * i / $("#player").height()),
  3402. this.panUp(-2 * t * i / $("#player").height())
  3403. }
  3404. ,
  3405. n.prototype.updateZoom = function() {
  3406. return this.offset.length() * this.scale
  3407. }
  3408. ,
  3409. n.prototype.setZoomBounds = function(e) {
  3410. var t = e.min.distanceTo(e.max);
  3411. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3412. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3413. this.minDistance = this.adjustedMinDistance,
  3414. this.maxDistance = this.adjustedMaxDistance
  3415. }
  3416. ,
  3417. n.prototype.resetRanges = function(e, t) {
  3418. e ? (this.minDistance = Math.min(e, this.minDistance),
  3419. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3420. this.maxDistance = this.adjustedMaxDistance),
  3421. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3422. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3423. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3424. }
  3425. ,
  3426. n.prototype.toJSON = function() {
  3427. return a.prototype.toJSON.call(this)
  3428. }
  3429. ,
  3430. t.exports = n
  3431. }
  3432. , {
  3433. "../settings": 166,
  3434. "./OutsideControls": 12,
  3435. three: 217
  3436. }],
  3437. 11: [function(e, t, i) {
  3438. "use strict";
  3439. function n(e) {
  3440. c.call(this, e),
  3441. this.minDistance = 15,
  3442. this.maxDistance = 50,
  3443. this.noRotateUpDown = !0,
  3444. this.minPolarAngle = 0,
  3445. this.maxPolarAngle = 0,
  3446. this.mouseActions[u.LEFT] = h.PAN,
  3447. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3448. this.mouseActions[u.RIGHT] = h.ROTATE,
  3449. this.touchActions[1] = h.PAN,
  3450. this.touchActions[2] = h.ROTATE_DOLLY,
  3451. this.absoluteScale = 1,
  3452. this.currentScale = 1
  3453. }
  3454. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3455. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3456. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3457. this.currentScale = this.absoluteScale
  3458. }
  3459. ,
  3460. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3461. var t = Math.max(modelSize.x, modelSize.z)
  3462. , i = Math.min(modelSize.x, modelSize.z)
  3463. , n = Math.max(t, i * this.camera.aspect)
  3464. , r = Math.max(i, t * this.camera.aspect);
  3465. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3466. return absoluteScale
  3467. },
  3468. n.prototype.rotateToView = function(e, t) {
  3469. var i = 0;
  3470. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3471. this.rotateLeft(i),
  3472. this.update(0)
  3473. }
  3474. ,
  3475. n.prototype.pan = function(e, t) {
  3476. this.camera.updateMatrix(),
  3477. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3478. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3479. }
  3480. ,
  3481. n.prototype.updateZoom = function() {
  3482. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3483. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3484. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3485. this.camera.left = -l.orthoBase * this.currentScale,
  3486. this.camera.right = l.orthoBase * this.currentScale,
  3487. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3488. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3489. this.camera.updateProjectionMatrix(),
  3490. this.offset.length()
  3491. }
  3492. ,
  3493. n.prototype.toJSON = (r = new s.Quaternion,
  3494. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3495. a = new s.Quaternion,
  3496. function() {
  3497. var e = c.prototype.toJSON.call(this);
  3498. return r.copy(e.camera_quaternion),
  3499. a.copy(o),
  3500. a.multiply(r),
  3501. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3502. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3503. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3504. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3505. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3506. e
  3507. }
  3508. ),
  3509. t.exports = n
  3510. }
  3511. , {
  3512. "../enum/ControlActions": 20,
  3513. "../enum/MouseButton": 34,
  3514. "../settings": 166,
  3515. "../util/browser": 182,
  3516. "../util/math": 190,
  3517. "./OutsideControls": 12,
  3518. three: 217
  3519. }],
  3520. 12: [function(e, t, i) {
  3521. "use strict";
  3522. function n(e) {
  3523. this.camera = e,
  3524. (this.camera.controls = this).enabled = !1,
  3525. this.target = new a.Vector3,
  3526. this.targetBounds = new a.Box3,
  3527. this.zoomSpeed = 2,//编辑时缩放快一些
  3528. this.minDistance = 0,
  3529. this.maxDistance = 1 / 0,
  3530. this.noRotateUpDown = !1,
  3531. this.rotateSpeed = 1,
  3532. this.keyboardZoomSpeed = 0,
  3533. this.keyPanSpeed = 7,
  3534. this.autoRotate = !1,
  3535. this.autoRotateSpeed = 2,
  3536. this.autoPan = !1,
  3537. this.autoPanPosition = new a.Vector3,
  3538. this.minPolarAngle = a.Math.degToRad(25),
  3539. this.maxPolarAngle = a.Math.degToRad(65),
  3540. this.rotationAcceleration = new a.Vector2,
  3541. this.rotationSpeed = new a.Vector2,
  3542. this.panAcceleration = new a.Vector2,
  3543. this.panSpeed = new a.Vector2,
  3544. this.rotateStart = new a.Vector2,
  3545. this.rotateEnd = new a.Vector2,
  3546. this.rotateDelta = new a.Vector2,
  3547. this.panStart = new a.Vector2,
  3548. this.panEnd = new a.Vector2,
  3549. this.panDelta = new a.Vector2,
  3550. this.panOffset = new a.Vector3,
  3551. this.offset = new a.Vector3,
  3552. this.dollyStart = new a.Vector2,
  3553. this.dollyEnd = new a.Vector2,
  3554. this.dollyDelta = new a.Vector2,
  3555. this.phiDelta = 0,
  3556. this.thetaDelta = 0,
  3557. this.scale = 1,
  3558. this.panVector = new a.Vector3,
  3559. this.lastPosition = new a.Vector3,
  3560. this.state = u.NONE,
  3561. this.mouseActions = {},
  3562. this.mouseActions[d.LEFT] = u.ROTATE,
  3563. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3564. this.mouseActions[d.RIGHT] = u.PAN,
  3565. this.touchActions = {},
  3566. this.touchActions[1] = u.ROTATE,
  3567. this.touchActions[2] = u.PAN_DOLLY,
  3568. this.lastMoveTime = 0,
  3569. this.pointersLimit = 2,
  3570. this.pointers = []
  3571. }
  3572. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3573. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3574. this.targetBounds = e
  3575. }
  3576. ,
  3577. n.prototype.isEngaged = function() {
  3578. return this.state !== u.NONE
  3579. }
  3580. ,
  3581. n.prototype.rotateLeft = function(e) {
  3582. void 0 === e && (e = this.getAutoRotationAngle()),
  3583. this.thetaDelta -= e
  3584. }
  3585. ,
  3586. n.prototype.rotateUp = function(e) {
  3587. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3588. this.phiDelta -= e)
  3589. }
  3590. ,
  3591. n.prototype.panLeft = function(e) {
  3592. var t = this.camera.matrix.elements;
  3593. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3594. this.panOffset.multiplyScalar(-e),
  3595. this.panVector.add(this.panOffset)
  3596. }
  3597. ,
  3598. n.prototype.panUp = function(e) {
  3599. var t = this.camera.matrix.elements;
  3600. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3601. this.panOffset.multiplyScalar(-e),
  3602. this.panVector.add(this.panOffset)
  3603. }
  3604. ,
  3605. n.prototype.startRotating = function(e, t) {
  3606. e && this.navRotationAcc("x", e),
  3607. t && this.navRotationAcc("y", t)
  3608. }
  3609. ,
  3610. n.prototype.stopRotating = function(e) {
  3611. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3612. this.navRotationAcc("x", 0),
  3613. this.navRotationAcc("y", 0)
  3614. }
  3615. ,
  3616. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3617. o = new a.Vector3,
  3618. function(e, t) {
  3619. r.copy(this.camera.position),
  3620. void 0 === e && null === e || r.setX(e),
  3621. void 0 === t && null === t || r.setZ(t);
  3622. var i = this.camera.position.distanceTo(this.target)
  3623. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3624. this.targetClamped = !1,
  3625. o.copy(r).addScaledVector(n, i),
  3626. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3627. r.copy(o).addScaledVector(n, -i),
  3628. this.targetClamped = !0),
  3629. this.autoPanPosition.x = r.x,
  3630. this.autoPanPosition.z = r.z,
  3631. this.autoPan && this.stopAutoPanning()
  3632. }
  3633. ),
  3634. n.prototype.stopAutoPanning = function() {
  3635. var e = this.autoPan;
  3636. this.autoPan = !1,
  3637. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3638. }
  3639. ,
  3640. n.prototype.dollyIn = function(e) {
  3641. void 0 === e && (e = this.getZoomScale()),
  3642. this.scale /= e
  3643. }
  3644. ,
  3645. n.prototype.dollyOut = function(e) {
  3646. void 0 === e && (e = this.getZoomScale()),
  3647. this.scale *= e
  3648. }
  3649. ,
  3650. n.prototype.updatePan = function(e) {
  3651. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3652. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3653. this.autoPan) {
  3654. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3655. t.setY(0).clampLength(0, 50 * e),
  3656. this.target.add(t),
  3657. this.camera.position.add(t),
  3658. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3659. this.stopAutoPanning())
  3660. }
  3661. }
  3662. ,
  3663. n.prototype.update = function(e) {
  3664. e = e || 1 / 60,
  3665. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3666. this.rotateLeft(-this.rotationSpeed.x),
  3667. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3668. this.updatePan(e);
  3669. var t = this.camera.position;
  3670. this.offset.copy(t).sub(this.target);
  3671. var i = Math.atan2(this.offset.x, this.offset.z)
  3672. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3673. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3674. i += this.thetaDelta,
  3675. n += this.phiDelta,
  3676. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3677. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3678. var r = this.updateZoom();
  3679. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3680. this.target.add(this.panVector),
  3681. this.targetBounds.clampPoint(this.target, this.target),
  3682. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3683. this.offset.y = r * Math.cos(n),
  3684. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3685. t.copy(this.target).add(this.offset),
  3686. this.camera.lookAt(this.target),
  3687. this.thetaDelta = 0,
  3688. this.phiDelta = 0,
  3689. this.scale = 1,
  3690. this.panVector.set(0, 0, 0),
  3691. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3692. }
  3693. ,
  3694. n.prototype.getAutoRotationAngle = function() {
  3695. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3696. }
  3697. ,
  3698. n.prototype.getZoomScale = function() {
  3699. return Math.pow(.95, this.zoomSpeed)
  3700. }
  3701. ,
  3702. n.prototype.onMouseDown = function(e) {
  3703. if (this.enabled) {
  3704. switch (e.preventDefault(),
  3705. this.stopAutoPanning(),
  3706. this.mouseDown = !0,
  3707. this.state = this.mouseActions[e.button],
  3708. this.state) {
  3709. case u.ROTATE:
  3710. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3711. this.rotationSpeed.set(0, 0);
  3712. break;
  3713. case u.DOLLY:
  3714. this.dollyStart.set(e.clientX, e.clientY);
  3715. break;
  3716. case u.PAN:
  3717. this.panStart.set(e.clientX, e.clientY)
  3718. }
  3719. this.emit(f.InputStart, "mouse")
  3720. }
  3721. }
  3722. ,
  3723. n.prototype.onMouseMove = function(e) {
  3724. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3725. switch (e.preventDefault(),
  3726. this.state) {
  3727. case u.ROTATE:
  3728. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3729. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3730. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3731. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3732. this.rotateStart.copy(this.rotateEnd);
  3733. break;
  3734. case u.DOLLY:
  3735. this.dollyEnd.set(e.clientX, e.clientY),
  3736. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3737. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3738. this.dollyStart.copy(this.dollyEnd);
  3739. break;
  3740. case u.PAN:
  3741. this.panEnd.set(e.clientX, e.clientY),
  3742. this.panDelta.subVectors(this.panEnd, this.panStart),
  3743. this.pan(this.panDelta.x, this.panDelta.y),
  3744. this.panStart.copy(this.panEnd)
  3745. }
  3746. this.emit(f.Move, "mouse"),
  3747. this.lastMoveTime = e.timeStamp,
  3748. this.update()
  3749. }
  3750. }
  3751. ,
  3752. n.prototype.onMouseUp = function(e) {
  3753. this.enabled && (this.mouseDown = !1,
  3754. this.state = u.NONE,
  3755. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3756. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3757. this.update(),
  3758. this.rotationAcceleration.set(0, 0),
  3759. this.rotateDelta.set(0, 0)))
  3760. }
  3761. ,
  3762. n.prototype.onMouseOver = function(e) {
  3763. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3764. }
  3765. ,
  3766. n.prototype.onMouseWheel = function(e) {
  3767. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3768. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3769. this.update())
  3770. }
  3771. ,
  3772. n.prototype.onKeyDown = function(e) {
  3773. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3774. this.handleKeyDown(e.which)))
  3775. }
  3776. ,
  3777. n.prototype.navRotationAcc = function(e, t) {
  3778. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3779. }
  3780. ,
  3781. n.prototype.navPanAcc = function(e, t) {
  3782. this.stopAutoPanning(),
  3783. this.panAcceleration[e] = t
  3784. }
  3785. ,
  3786. n.prototype.handleKeyDown = function(e) {
  3787. var t = !0;
  3788. switch (e) {
  3789. case p.UPARROW:
  3790. case p.I:
  3791. this.navRotationAcc("y", 1);
  3792. break;
  3793. case p.DOWNARROW:
  3794. case p.K:
  3795. this.navRotationAcc("y", -1);
  3796. break;
  3797. case p.LEFTARROW:
  3798. case p.J:
  3799. this.navRotationAcc("x", -1);
  3800. break;
  3801. case p.RIGHTARROW:
  3802. case p.L:
  3803. this.navRotationAcc("x", 1);
  3804. break;
  3805. case p.W:
  3806. this.navPanAcc("y", 1);
  3807. break;
  3808. case p.S:
  3809. this.navPanAcc("y", -1);
  3810. break;
  3811. case p.A:
  3812. this.navPanAcc("x", -1);
  3813. break;
  3814. case p.D:
  3815. this.navPanAcc("x", 1);
  3816. break;
  3817. default:
  3818. t = !1
  3819. }
  3820. t && this.emit(f.Move, "key")
  3821. }
  3822. ,
  3823. n.prototype.onKeyUp = function(e) {
  3824. this.enabled && (e.preventDefault(),
  3825. e.stopPropagation(),
  3826. this.handleKeyUp(e.which))
  3827. }
  3828. ,
  3829. n.prototype.handleKeyUp = function(e) {
  3830. switch (e) {
  3831. case p.I:
  3832. case p.K:
  3833. case p.UPARROW:
  3834. case p.DOWNARROW:
  3835. this.keyboardZoomSpeed = 0,
  3836. this.rotationAcceleration.y = 0;
  3837. break;
  3838. case p.J:
  3839. case p.L:
  3840. case p.LEFTARROW:
  3841. case p.RIGHTARROW:
  3842. this.rotationAcceleration.x = 0;
  3843. break;
  3844. case p.S:
  3845. case p.W:
  3846. this.panAcceleration.y = 0;
  3847. break;
  3848. case p.A:
  3849. case p.D:
  3850. this.panAcceleration.x = 0
  3851. }
  3852. }
  3853. ,
  3854. n.prototype.onTouchStart = function(i) {
  3855. if (this.enabled || this.state === u.NONE) {
  3856. i.preventDefault(),
  3857. i.stopPropagation(),
  3858. this.stopAutoPanning();
  3859. var e = function() {
  3860. if (2 === i.touches.length) {
  3861. var e = i.touches[0].pageX - i.touches[1].pageX
  3862. , t = i.touches[0].pageY - i.touches[1].pageY;
  3863. this.dollyStart.set(e, t)
  3864. }
  3865. }
  3866. .bind(this)
  3867. , t = function() {
  3868. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3869. }
  3870. .bind(this)
  3871. , n = function() {
  3872. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3873. }
  3874. .bind(this);
  3875. switch (this.state = this.touchActions[i.touches.length],
  3876. this.state) {
  3877. case u.PAN_DOLLY:
  3878. e();
  3879. case u.PAN:
  3880. t();
  3881. break;
  3882. case u.ROTATE_DOLLY:
  3883. e();
  3884. case u.ROTATE:
  3885. n()
  3886. }
  3887. this.rotationSpeed.set(0, 0),
  3888. this.emit(f.InputStart, "touch")
  3889. }
  3890. }
  3891. ,
  3892. n.prototype.onTouchMove = function(a) {
  3893. if (this.enabled && this.state !== u.NONE) {
  3894. a.preventDefault(),
  3895. a.stopPropagation();
  3896. var s = function() {
  3897. var e = a.touches[0].pageX - a.touches[1].pageX
  3898. , t = a.touches[0].pageY - a.touches[1].pageY;
  3899. this.dollyEnd.set(e, t);
  3900. var i = this.dollyStart.length() - this.dollyEnd.length();
  3901. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3902. this.dollyStart.copy(this.dollyEnd)
  3903. }
  3904. .bind(this)
  3905. , e = function() {
  3906. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3907. this.panDelta.subVectors(this.panEnd, this.panStart),
  3908. this.pan(this.panDelta.x, this.panDelta.y),
  3909. this.panStart.copy(this.panEnd),
  3910. this.rotateDelta.set(0, 0)
  3911. }
  3912. .bind(this)
  3913. , l = function() {
  3914. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3915. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3916. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3917. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3918. this.rotateStart.copy(this.rotateEnd)
  3919. }
  3920. .bind(this)
  3921. , t = function() {
  3922. if (2 === a.touches.length) {
  3923. var e = window.devicePixelRatio || 1
  3924. , t = a.touches[1].pageX - a.touches[0].pageX
  3925. , i = a.touches[1].pageY - a.touches[0].pageY
  3926. , n = Math.sqrt(t * t + i * i);
  3927. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3928. this.state = u.DOLLY,
  3929. s();
  3930. else {
  3931. var r = h.average(a.touches, "pageX")
  3932. , o = h.average(a.touches, "pageY");
  3933. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3934. this.rotateStart.set(r, o),
  3935. l())
  3936. }
  3937. }
  3938. }
  3939. .bind(this);
  3940. switch (this.state) {
  3941. case u.PAN_DOLLY:
  3942. s();
  3943. case u.PAN:
  3944. e();
  3945. break;
  3946. case u.ROTATE_DOLLY:
  3947. t();
  3948. break;
  3949. case u.DOLLY:
  3950. s();
  3951. break;
  3952. case u.ROTATE:
  3953. l();
  3954. break;
  3955. default:
  3956. this.state = u.NONE
  3957. }
  3958. this.lastMoveTime = a.timeStamp,
  3959. this.emit(f.Move, "touch")
  3960. }
  3961. }
  3962. ,
  3963. n.prototype.onTouchEnd = function(e) {
  3964. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3965. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3966. this.state = u.NONE,
  3967. this.update(),
  3968. this.rotationAcceleration.set(0, 0),
  3969. this.rotateDelta.set(0, 0))
  3970. }
  3971. ,
  3972. n.prototype.onPointerDown = function(e) {
  3973. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3974. id: e.pointerId,
  3975. pageX: e.pageX,
  3976. pageY: e.pageY
  3977. }),
  3978. e.touches = this.pointers,
  3979. this.onTouchStart(e)),
  3980. this.emit(f.InputStart, "pointer"))
  3981. }
  3982. ,
  3983. n.prototype.onPointerMove = function(t) {
  3984. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3985. t.pointerId === e.id && (e.pageX = t.pageX,
  3986. e.pageY = t.pageY)
  3987. }),
  3988. t.touches = this.pointers,
  3989. this.onTouchMove(t))
  3990. }
  3991. ,
  3992. n.prototype.onPointerUp = function(i) {
  3993. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3994. i.pointerId === e.id && this.pointers.splice(t, 1)
  3995. }
  3996. .bind(this)),
  3997. i.touches = this.pointers,
  3998. this.onTouchEnd(i))
  3999. }
  4000. ,
  4001. n.prototype.reset = function() {
  4002. this.state = u.NONE,
  4003. this.stopAutoPanning(),
  4004. this.rotationSpeed.set(0, 0),
  4005. this.rotationAcceleration.set(0, 0),
  4006. this.panSpeed.set(0, 0),
  4007. this.panAcceleration.set(0, 0)
  4008. }
  4009. ,
  4010. n.prototype.toJSON = function() {
  4011. return {
  4012. camera_position: {
  4013. x: s.toPrecision(this.camera.position.x, 4),
  4014. y: s.toPrecision(this.camera.position.y, 4),
  4015. z: s.toPrecision(this.camera.position.z, 4)
  4016. },
  4017. camera_quaternion: {
  4018. x: s.toPrecision(this.camera.quaternion.x, 4),
  4019. y: s.toPrecision(this.camera.quaternion.y, 4),
  4020. z: s.toPrecision(this.camera.quaternion.z, 4),
  4021. w: s.toPrecision(this.camera.quaternion.w, 4)
  4022. }
  4023. }
  4024. }
  4025. ,
  4026. t.exports = n
  4027. }
  4028. , {
  4029. "../enum/ControlActions": 20,
  4030. "../enum/ControlEvents": 21,
  4031. "../enum/Keys": 30,
  4032. "../enum/MouseButton": 34,
  4033. "../enum/Vectors": 50,
  4034. "../settings": 166,
  4035. "../util/common": 185,
  4036. "../util/math": 190,
  4037. events: 202,
  4038. three: 217
  4039. }],
  4040. 13: [function(u, d, e) {
  4041. (function(e) {
  4042. "use strict";
  4043. function t(e) {
  4044. this.camera = e,
  4045. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4046. this.lookVector = new s.Vector3,
  4047. this.lookSpeed = .05,
  4048. this.rotationAcc = new s.Vector2,
  4049. this.rotationSpeed = new s.Vector2,
  4050. this.lat = 0,
  4051. this.lon = 0,
  4052. this.phi = 0,
  4053. this.theta = 0,
  4054. this.enabled = !1,
  4055. this.locked = !1,
  4056. this.pointer = new s.Vector2(0,0),
  4057. this.rotationHistory = [],
  4058. this.rotationDifference = new s.Vector2,
  4059. this.pointerDragOn = !1,
  4060. this.pointerDragStart = new s.Vector2(0,0),
  4061. this.pinchDistance = 0,
  4062. this.moveStart = new s.Vector2,
  4063. this.moveTolerance = .01,
  4064. this.pointersLimit = 2,
  4065. this.pointers = []
  4066. }
  4067. var s = u("three")
  4068. , i = u("../util/logger")
  4069. , n = u("../settings")
  4070. , r = u("../util/common")
  4071. , o = u("../util/math")
  4072. , a = (u("../enum/Vectors"),
  4073. u("../enum/MouseButton"))
  4074. , l = u("../enum/Keys")
  4075. , c = u("../enum/ControlEvents")
  4076. , h = u("events").EventEmitter;
  4077. new i(e),
  4078. (t.prototype = Object.create(h.prototype)).usable = function() {
  4079. return this.enabled && !this.locked
  4080. }
  4081. ,
  4082. /* t.prototype.lookAt = function(e) {
  4083. var t = this.camera.position.clone().sub(e)
  4084. , i = Math.atan(t.z / t.x);
  4085. i += t.x < 0 ? Math.PI : 0,
  4086. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4087. this.lon = s.Math.radToDeg(i) + 180;
  4088. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4089. , r = Math.atan(t.y / n);
  4090. this.lat = -s.Math.radToDeg(r)
  4091. } */
  4092. t.prototype.lookAt = function(aim, dir) {
  4093. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4094. var i = Math.atan(t.z / t.x);
  4095. i += t.x < 0 ? Math.PI : 0;
  4096. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4097. this.lon = s.Math.radToDeg(i) + 180;
  4098. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4099. o = Math.atan(t.y / n);
  4100. this.lat = -s.Math.radToDeg(o);
  4101. }
  4102. ,
  4103. t.prototype.startRotationFrom = function(e, t) {
  4104. o.convertScreenPositionToNDC(e, t, this.pointer),
  4105. this.pointerDragOn = !0,
  4106. this.pointerDragStart.copy(this.pointer),
  4107. this.moveStart.copy(this.pointer),
  4108. this.rotationHistory = [],
  4109. this.rotationSpeed.set(0, 0)
  4110. }
  4111. ,
  4112. t.prototype.onMouseOver = function(e) {
  4113. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4114. }
  4115. ,
  4116. t.prototype.onTouchStart = function(e) {
  4117. if (this.usable()) {
  4118. switch (e.preventDefault(),
  4119. e.stopPropagation(),
  4120. e.touches.length) {
  4121. case 1:
  4122. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4123. break;
  4124. case 2:
  4125. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4126. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4127. this.pinchDistance = Math.sqrt(t * t + i * i)
  4128. }
  4129. this.emit(c.InputStart, "touch")
  4130. }
  4131. }
  4132. ,
  4133. t.prototype.onPointerDown = function(e) {
  4134. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4135. id: e.pointerId,
  4136. clientX: e.clientX,
  4137. clientY: e.clientY
  4138. }),
  4139. e.touches = this.pointers,
  4140. this.onTouchStart(e),
  4141. this.emit(c.InputStart, "pointer"))
  4142. }
  4143. ,
  4144. t.prototype.onMouseDown = function(e) {
  4145. if (this.usable()) {
  4146. switch (e.preventDefault(),
  4147. e.stopPropagation(),
  4148. e.button) {
  4149. case a.LEFT:
  4150. this.startRotationFrom(e.clientX, e.clientY)
  4151. }
  4152. this.emit(c.InputStart, "mouse")
  4153. }
  4154. }
  4155. ,
  4156. t.prototype.updateRotation = function() {
  4157. if (this.usable() && this.pointerDragOn) {
  4158. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4159. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4160. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4161. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4162. , r = Math.atan2(e.y, i)
  4163. , o = Math.atan2(t.y, n);
  4164. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4165. e.y = 0,
  4166. t.y = 0;
  4167. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4168. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4169. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4170. this.pointerDragStart.copy(this.pointer)
  4171. }
  4172. }
  4173. ,
  4174. t.prototype.onMouseMove = function(e) {
  4175. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4176. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  4177. }
  4178. ,
  4179. t.prototype.onTouchMove = function(e) {
  4180. if (this.usable())
  4181. switch (this.emit(c.Move, "touch"),
  4182. e.touches.length) {
  4183. case 1:
  4184. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4185. break;
  4186. case 2:
  4187. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4188. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4189. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4190. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4191. this.emit(c.Pinch, n),
  4192. this.pinchDistance -= n)
  4193. }
  4194. }
  4195. ,
  4196. t.prototype.onPointerMove = function(t) {
  4197. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4198. t.pointerId === e.id && (e.clientX = t.clientX,
  4199. e.clientY = t.clientY)
  4200. }),
  4201. t.touches = this.pointers,
  4202. this.onTouchMove(t))
  4203. }
  4204. ,
  4205. t.prototype.endRotation = function() {
  4206. this.pointerDragOn = !1;
  4207. var e = r.averageVectors(this.rotationHistory);
  4208. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4209. }
  4210. ,
  4211. t.prototype.onTouchEnd = function(e) {
  4212. this.usable() && (e.preventDefault(),
  4213. e.stopPropagation(),
  4214. this.endRotation())
  4215. }
  4216. ,
  4217. t.prototype.onMouseUp = function(e) {
  4218. this.usable() && (e.preventDefault(),
  4219. e.stopPropagation(),
  4220. this.endRotation())
  4221. }
  4222. ,
  4223. t.prototype.onPointerUp = function(i) {
  4224. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4225. i.pointerId === e.id && this.pointers.splice(t, 1)
  4226. }
  4227. .bind(this)),
  4228. i.touches = this.pointers,
  4229. this.onTouchEnd(i))
  4230. }
  4231. ,
  4232. t.prototype.update = function(e) {
  4233. for (this.lon,
  4234. this.lat,
  4235. this.updateRotation(),
  4236. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4237. this.rotationHistory.shift();
  4238. this.lon += this.rotationDifference.x,
  4239. this.lat += this.rotationDifference.y,
  4240. this.rotationDifference.set(0, 0),
  4241. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4242. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4243. this.lon += this.rotationSpeed.x * e,
  4244. this.lat += this.rotationSpeed.y * e
  4245. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4246. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4247. 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 );
  4248. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4249. this.phi = s.Math.degToRad(90 - this.lat),
  4250. this.theta = s.Math.degToRad(this.lon),
  4251. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4252. this.lookVector.y = Math.cos(this.phi),
  4253. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4254. this.target.copy(this.lookVector).add(this.camera.position),
  4255. this.camera.lookAt(this.target)
  4256. }
  4257. ,
  4258. t.prototype.onMouseWheel = function(e) {
  4259. if (this.usable()) {
  4260. var t = e.wheelDelta || -e.detail;
  4261. this.emit(c.InteractionDirect),
  4262. this.emit(c.Scroll, t)
  4263. }
  4264. }
  4265. ,
  4266. t.prototype.onKeyDown = function(e) {
  4267. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4268. this.handleKeyDown(e.which)))
  4269. }
  4270. ,
  4271. t.prototype.handleKeyDown = function(e) {
  4272. var t = function(e, t) {
  4273. this.rotationAcc[e] = t
  4274. }
  4275. .bind(this);
  4276. this.emit(c.InteractionKey);
  4277. var i = !0;
  4278. switch (e) {
  4279. case l.LEFTARROW:
  4280. case l.J:
  4281. t("x", -1);
  4282. break;
  4283. case l.RIGHTARROW:
  4284. case l.L:
  4285. t("x", 1);
  4286. break;
  4287. case l.I:
  4288. t("y", 1);
  4289. break;
  4290. case l.K:
  4291. t("y", -1);
  4292. break;
  4293. default:
  4294. i = !1
  4295. }
  4296. i && this.emit(c.Move, "key")
  4297. }
  4298. ,
  4299. t.prototype.onKeyUp = function(e) {
  4300. this.usable() && (e.preventDefault(),
  4301. e.stopPropagation(),
  4302. this.handleKeyUp(e.which))
  4303. }
  4304. ,
  4305. t.prototype.handleKeyUp = function(e) {
  4306. switch (e) {
  4307. case l.LEFTARROW:
  4308. case l.J:
  4309. case l.RIGHTARROW:
  4310. case l.L:
  4311. this.rotationAcc.x = 0;
  4312. break;
  4313. case l.I:
  4314. case l.K:
  4315. this.rotationAcc.y = 0
  4316. }
  4317. }
  4318. ,
  4319. t.prototype.startRotating = function(e, t) {
  4320. e && (this.rotationAcc.x = e),
  4321. t && (this.rotationAcc.y = t)
  4322. }
  4323. ,
  4324. t.prototype.stopRotating = function(e) {
  4325. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4326. this.rotationAcc.set(0, 0)
  4327. }
  4328. ,
  4329. t.prototype.reset = function() {
  4330. this.pointerDragOn = !1,
  4331. this.rotationAcc.set(0, 0),
  4332. this.rotationSpeed.set(0, 0),
  4333. this.pointers = []
  4334. }
  4335. ,
  4336. t.prototype.toJSON = function() {
  4337. return {
  4338. camera_position: {
  4339. x: o.toPrecision(this.camera.position.x, 4),
  4340. y: o.toPrecision(this.camera.position.y, 4),
  4341. z: o.toPrecision(this.camera.position.z, 4)
  4342. },
  4343. camera_quaternion: {
  4344. x: o.toPrecision(this.camera.quaternion.x, 4),
  4345. y: o.toPrecision(this.camera.quaternion.y, 4),
  4346. z: o.toPrecision(this.camera.quaternion.z, 4),
  4347. w: o.toPrecision(this.camera.quaternion.w, 4)
  4348. }
  4349. }
  4350. }
  4351. ,
  4352. t.prototype.setStateFromJSON = function(e) {
  4353. this.camera.position.copy(e.camera_position),
  4354. this.camera.quaternion.copy(e.camera_quaternion)
  4355. }
  4356. ,
  4357. d.exports = t
  4358. }
  4359. ).call(this, "/js/controls/PanoramaControls.js")
  4360. }
  4361. , {
  4362. "../enum/ControlEvents": 21,
  4363. "../enum/Keys": 30,
  4364. "../enum/MouseButton": 34,
  4365. "../enum/Vectors": 50,
  4366. "../settings": 166,
  4367. "../util/common": 185,
  4368. "../util/logger": 189,
  4369. "../util/math": 190,
  4370. events: 202,
  4371. three: 217
  4372. }],
  4373. 14: [function(t, i, e) {
  4374. (function(e) {
  4375. "use strict";
  4376. var c = t("three")
  4377. , h = t("../enum/Viewmode")
  4378. , u = new (t("../util/logger"))(e);
  4379. i.exports = {
  4380. serialize: function(e) {
  4381. return encodeURI(JSON.stringify(e))
  4382. },
  4383. deserialize: function(e) {
  4384. function t(e) {
  4385. return e.reduce(function(e, t) {
  4386. return e && "number" == typeof t && !isNaN(t)
  4387. }, !0)
  4388. }
  4389. try {
  4390. var i = JSON.parse(decodeURI(e))
  4391. , n = {
  4392. mode: h.fromInt(i.camera_mode),
  4393. panoId: i.scan_id,
  4394. position: (new c.Vector3).copy(i.camera_position),
  4395. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4396. zoom: i.ortho_zoom,
  4397. floorVisibility: i.floor_visibility
  4398. }
  4399. , r = n.position;
  4400. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4401. var o = n.quaternion;
  4402. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4403. n
  4404. } catch (i) {
  4405. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4406. try {
  4407. var a = e.split(",")
  4408. , s = {
  4409. x: parseFloat(a[2]),
  4410. y: parseFloat(a[3]),
  4411. z: parseFloat(a[4])
  4412. }
  4413. , l = {
  4414. x: parseFloat(a[5]),
  4415. y: parseFloat(a[6]),
  4416. z: parseFloat(a[7]),
  4417. w: parseFloat(a[8])
  4418. };
  4419. return t([s.x, s.y, s.z]) || (s.x = 0,
  4420. s.y = 0,
  4421. s.z = 0),
  4422. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4423. l.y = 0,
  4424. l.z = 0,
  4425. l.w = 1),
  4426. {
  4427. mode: h.fromInt(a[0]),
  4428. panoId: a[1],
  4429. position: (new c.Vector3).copy(s),
  4430. quaternion: (new c.Quaternion).copy(l)
  4431. }
  4432. } catch (t) {
  4433. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4434. }
  4435. }
  4436. return null
  4437. }
  4438. }
  4439. }
  4440. ).call(this, "/js/controls/serializer.js")
  4441. }
  4442. , {
  4443. "../enum/Viewmode": 51,
  4444. "../util/logger": 189,
  4445. three: 217
  4446. }],
  4447. 15: [function(C, I, e) {
  4448. (function(e) {
  4449. "use strict";
  4450. function t() {
  4451. this.endlessLoop = r.warp.loop,
  4452. this.clock = new i.Clock(!0),
  4453. this.model = null,
  4454. this.player = null,
  4455. this.currentItem = null,
  4456. this.destinationItem = null,
  4457. this.tourIsPlaying = !1,
  4458. this.transitionStage = v.None,
  4459. this.nextFunc = null,
  4460. this.onTheBus = !1,
  4461. this.tourInProgress = !1,
  4462. this.reachSource = null,
  4463. this.interrupted = !1,
  4464. this.nItems = 0,
  4465. this.walkingSectionPaused = !1
  4466. }
  4467. var i = C("three")
  4468. , n = C("./util/logger")
  4469. , r = C("./settings")
  4470. , o = C("./util/transitions")
  4471. , a = C("events").EventEmitter
  4472. , s = C("./enum/Viewmode")
  4473. , l = C("./analytics")
  4474. , c = C("./enum/WarpStyle")
  4475. , h = (o = C("./util/transitions"),
  4476. C("./model/ModelManager"),
  4477. C("./enum/ModelManagerEvents"))
  4478. , u = C("./enum/DirectorEvents")
  4479. , d = C("./enum/PlayerEvents")
  4480. , p = (C("./enum/ControlEvents"),
  4481. C("./enum/BlackoutStyle"))
  4482. , f = C("./enum/PathDiscardMode")
  4483. , g = C("./enum/PathDisplayMode")
  4484. , m = (C("./player"),
  4485. new n(e))
  4486. , v = Object.freeze({
  4487. None: 0,
  4488. Moving: 1,
  4489. Aiming: 2,
  4490. Interlude: 3
  4491. })
  4492. , y = Object.freeze({
  4493. Forward: 1,
  4494. NoChange: 0,
  4495. Backwards: -1
  4496. })
  4497. , A = o.getUniqueId();
  4498. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4499. this.player = e,
  4500. this.modelManager = t,
  4501. this.updateModel(),
  4502. this.resetAll(),
  4503. this.bindEvents()
  4504. }
  4505. ,
  4506. t.prototype.resetAll = function() {
  4507. if (this.currentItem = null,
  4508. this.destinationItem = null,
  4509. this.tourIsPlaying = !1,
  4510. //this.bgmReplay(),
  4511. this.transitionStage = v.None,
  4512. this.nextFunc = null,
  4513. this.onTheBus = !1,
  4514. this.reachSource = null,
  4515. this.interrupted = !1,
  4516. this.model) {
  4517. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4518. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4519. } else
  4520. this.defaultWarpStyle = c.BLACK,
  4521. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4522. this.resetSpecialTransition()
  4523. }
  4524. ,
  4525. t.prototype.updateModel = function() {
  4526. this.model = this.modelManager.getActiveModel(),
  4527. this.nItems = this.model.heroLocations.length
  4528. }
  4529. ,
  4530. t.prototype.bindEvents = function() {
  4531. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4532. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4533. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4534. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4535. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4536. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4537. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4538. this.player.once(d.Move, function() {
  4539. o.cancelById(A)
  4540. })
  4541. }
  4542. ,
  4543. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4544. return e === c.WALK && (this.interrupt(p.NONE),
  4545. this.pauseWalkingSection(),
  4546. this.player.fastForwardActivePanoFlight(),
  4547. !0)
  4548. }
  4549. ,
  4550. t.prototype.handlePlayerMove = function(e) {
  4551. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4552. this.emit("update.controls")
  4553. }
  4554. ,
  4555. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4556. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4557. this.emit("update.controls"))
  4558. }
  4559. ,
  4560. t.prototype.handlePlayerModeChanged = function(e, t) {
  4561. this.intermediateState() || e === t || (this.onTheBus = !1,
  4562. this.emit("update.controls"))
  4563. }
  4564. ,
  4565. t.prototype.handlePlayerInputStart = function(e) {
  4566. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4567. }
  4568. ,
  4569. t.prototype.handlePlayerFlyingStarted = function() {
  4570. this.clearWalkingSectionPaused()
  4571. }
  4572. ,
  4573. t.prototype.describe = function() {
  4574. return {
  4575. nItems: this.nItems,
  4576. currentItem: this.currentItem,
  4577. destinationItem: this.destinationItem,
  4578. tourIsPlaying: this.tourIsPlaying,
  4579. onTheBus: this.onTheBus,
  4580. endlessLoop: this.endlessLoop,
  4581. viewMode: this.player.mode,
  4582. inTransition: this._inTransition(),
  4583. transitionStage: this.transitionStage,
  4584. tourInProgress: this.tourInProgress
  4585. }
  4586. }
  4587. ,
  4588. t.prototype._inTransition = function() {
  4589. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4590. }
  4591. ,
  4592. t.prototype.bounceable = function() {
  4593. var e = this.clock.getDelta();
  4594. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4595. }
  4596. ,
  4597. t.prototype.itemCompare = function(item1, item2, type){//add
  4598. if(type == 'equal'){//==
  4599. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4600. }else if(type == 'less'){//<
  4601. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4602. }
  4603. }
  4604. t.prototype.currentMoveDirection = function() {
  4605. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4606. 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
  4607. }
  4608. ,
  4609. t.prototype.clearPath = function() {
  4610. this._inTransition() || this.player.path.discardPathObject()
  4611. }
  4612. ,
  4613. t.prototype.allFloors = function() {
  4614. this.model.toggleAllFloors()
  4615. }
  4616. ,
  4617. t.prototype.actionComplete = function(e) {
  4618. if (this.interrupted = !1,
  4619. this.transitionStage = v.None,
  4620. this.resetSpecialTransition(),
  4621. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4622. this.tourIsPlaying || (this.player.disablePreRendering(),
  4623. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4624. this.emit("update.controls"),
  4625. this.nextFunc) {
  4626. var t = this.nextFunc;
  4627. this.nextFunc = null,
  4628. t()
  4629. }
  4630. }
  4631. ,
  4632. t.prototype.awaitCompletion = function(e, t) {
  4633. this.nextFunc = t,
  4634. e()
  4635. }
  4636. ,
  4637. t.prototype.updateSuccessFunction = function(e) {
  4638. this.nextFunc = e
  4639. }
  4640. ,
  4641. t.prototype.interrupt = function(e, t) {
  4642. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4643. this.tourIsPlaying = !1,
  4644. //this.bgmReplay(),
  4645. this.interrupted = !0,
  4646. this.nextFunc = null,
  4647. this.emit(u.ActionInterrupted),
  4648. null != e || (e = p.BEGINNING),
  4649. this.player.interruptAndFastForward(e, t),
  4650. !0)
  4651. }
  4652. ,
  4653. t.prototype.wouldInterrupt = function() {
  4654. return this.transitionStage !== v.None
  4655. }
  4656. ,
  4657. t.prototype.intermediateState = function() {
  4658. return this.transitionStage !== v.None
  4659. }
  4660. ,
  4661. t.prototype.isInterrupted = function() {
  4662. return this.interrupted
  4663. }
  4664. ,
  4665. t.prototype.pauseWalkingSection = function() {
  4666. this.walkingSectionPaused = !0
  4667. }
  4668. ,
  4669. t.prototype.clearWalkingSectionPaused = function() {
  4670. this.walkingSectionPaused = !1
  4671. }
  4672. ,
  4673. t.prototype.autoTour = function() {
  4674. var i = Date.now();
  4675. this.model.auxDataPromise.then(function() {
  4676. i = Date.now() - i;
  4677. var e = r.warp.auto
  4678. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4679. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4680. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4681. done: function() {
  4682. this.playTour()
  4683. }
  4684. .bind(this),
  4685. name: "_atr",
  4686. id: A
  4687. })
  4688. }
  4689. .bind(this))
  4690. }
  4691. ,
  4692. t.prototype.atDestinationPano = function() {
  4693. if (!this.player.currentPano || null === this.destinationItem)
  4694. return !1;
  4695. var e = this.player.currentPano.id;
  4696. if (void 0 === e)
  4697. return !1;
  4698. var t = this.model.heroLocations;
  4699. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4700. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4701. return destination && destination.panoId == e
  4702. }
  4703. ,
  4704. t.prototype.redirectToItem = function(e, t) {
  4705. if (null != e)
  4706. if (this.wouldInterrupt())
  4707. if (this.player.mode !== s.TRANSITIONING) {
  4708. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4709. var i = function() {
  4710. o.setTimeout(function() {
  4711. this.setDestinationItem(e),
  4712. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4713. }
  4714. .bind(this), 0)
  4715. }
  4716. .bind(this);
  4717. this.interrupt(p.END, 0),
  4718. this.updateSuccessFunction(i)
  4719. } else
  4720. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4721. else
  4722. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4723. else
  4724. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4725. }
  4726. ,
  4727. t.prototype.useSpecialTransition = function(e) {
  4728. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4729. this.nextWarpStyle = c.BLACK
  4730. }
  4731. ,
  4732. t.prototype.resetSpecialTransition = function() {
  4733. this.nextWarpStyle = this.defaultWarpStyle
  4734. }
  4735. ,
  4736. t.prototype.arrivedAtDestination = function(e) {
  4737. if (this.player.flying || this.player.isWarping())
  4738. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4739. else {
  4740. this.transitionStage = v.Aiming;
  4741. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4742. this.player.model.fadePanoMarkers(0),
  4743. this.awaitCompletion(function() {
  4744. this.resetSpecialTransition(),
  4745. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4746. }
  4747. .bind(this), t)
  4748. }
  4749. }
  4750. ,
  4751. t.prototype.goToDestination = function(e, t, i, n) {
  4752. //音频
  4753. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4754. if(musicInfo && musicInfo.music){
  4755. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4756. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4757. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4758. let audioSrc2 = common.getFileNameFromUrl(src)
  4759. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4760. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4761. SoundManager.play('tour',null,0) // currentTime = 0;
  4762. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4763. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4764. }
  4765. }else{//很可能是该folder的起始
  4766. SoundManager.play('tour', manage.dealURL(src))
  4767. }
  4768. }
  4769. if (this.onTheBus = !0,
  4770. this.emit("update.controls"),
  4771. this.player.updateLastView(),
  4772. n || !this.atDestinationPano()){
  4773. if (this.player.flying || this.player.isWarping())
  4774. m.warn("Cannot go to new destination while player is flying or warping.");
  4775. else {
  4776. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4777. , s = null
  4778. , l = null;
  4779. if (a.isPano()) {
  4780. var o1 = this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4781. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4782. s = this.arrivedAtDestination.bind(this, !0)
  4783. //add
  4784. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4785. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4786. }
  4787. } else{
  4788. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4789. s = this.arrivedAtDestination.bind(this, !1);
  4790. }
  4791. this.transitionStage = v.Moving,
  4792. this.model.fadePanoMarkers(0),
  4793. this.awaitCompletion(function() {
  4794. l()
  4795. }
  4796. .bind(this), s),
  4797. this.emit("update.controls")
  4798. }
  4799. }else{
  4800. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4801. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4802. if(a.zoom && a.zoom != this.player.zoomLevel){
  4803. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4804. } */
  4805. this.arrivedAtDestination(!0)
  4806. }
  4807. }
  4808. ,
  4809. t.prototype.tourInterlude = function() {
  4810. if (l.trackAlways("reach_highlight", {
  4811. reach_source: this.reachSource
  4812. }),
  4813. this.model.fadePanoMarkers(0),
  4814. this.emit("update.controls"),
  4815. this.tourIsPlaying)
  4816. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4817. this.stopTour(),
  4818. this.emit(u.TourEnd),
  4819. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4820. this.transitionStage = v.Interlude,
  4821. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4822. }
  4823. .bind(this), this.goNext.bind(this))
  4824. }
  4825. ,
  4826. t.prototype.playTour = function() {
  4827. if (!this.bounceable())
  4828. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4829. this.tourInProgress = !0,
  4830. this.reachSource = "play",
  4831. this.tourIsPlaying = !0,
  4832. this.wasZoomEnabled = this.player.zoomEnabled,
  4833. this.player.zoomEnabled = !1,
  4834. this.resetSpecialTransition(),
  4835. this.emit("update.controls"),
  4836. this.emit(u.TourStart),
  4837. this.player.enablePreRendering(),
  4838. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4839. this.goToDestination()) : this.goNext()))
  4840. }
  4841. ,
  4842. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4843. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4844. this.tourIsPlaying = !1,
  4845. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4846. this.interrupt(),
  4847. this.clearWalkingSectionPaused(),
  4848. this.resetSpecialTransition(),
  4849. this.emit("update.controls"))
  4850. }
  4851. ,
  4852. t.prototype.endTourProgress = function() {
  4853. this.tourInProgress = !1,
  4854. this.emit("update.controls"),
  4855. this.emit(u.TourEnd)
  4856. }
  4857. ,
  4858. t.prototype.goToHighlight = function(e) {
  4859. if (this.wouldInterrupt())
  4860. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4861. else {
  4862. if (m.debug("<tour.goto " + e + ">"),
  4863. this.isInterrupted())
  4864. return;
  4865. this.clearWalkingSectionPaused(),
  4866. this.setDestinationItem(e),
  4867. this.useSpecialTransition("Hilight"),
  4868. this.goToDestination(),
  4869. l.trackAlways("reach_highlight", {
  4870. reach_source: "thumb"
  4871. })
  4872. }
  4873. }
  4874. ,
  4875. t.prototype.prevHighlight = function() {
  4876. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4877. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4878. this.reachSource = "prev",
  4879. this.goPrev()))
  4880. }
  4881. ,
  4882. t.prototype.nextHighlight = function() {
  4883. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4884. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4885. this.reachSource = "next",
  4886. this.goNext()))
  4887. }
  4888. ,
  4889. t.prototype.changeMode = function(e) {
  4890. var t = $.Deferred()
  4891. , i = t.resolve.bind(t)
  4892. , n = t.reject.bind(t);
  4893. if (this.emit(u.StartModeChange),
  4894. !function() {
  4895. return this.clearWalkingSectionPaused(),
  4896. !!this.wouldInterrupt() && (this.interrupt(),
  4897. !0)
  4898. }
  4899. .bind(this)()) {
  4900. switch (e) {
  4901. case s.PANORAMA:
  4902. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4903. break;
  4904. case s.DOLLHOUSE:
  4905. case s.FLOORPLAN:
  4906. this.player.flyToNewMode({
  4907. mode: e
  4908. }).done(i).fail(n);
  4909. break;
  4910. case s.OUTDOOR:
  4911. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4912. }
  4913. return t.promise()
  4914. }
  4915. }
  4916. ,
  4917. t.prototype.atEndOfTour = function(item) {
  4918. //return this.currentItem >= this.nItems - 1
  4919. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4920. if(end){
  4921. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4922. if(heroLocations){
  4923. end = this.currentItem[1] >= heroLocations.length - 1
  4924. }
  4925. }
  4926. return end;
  4927. }
  4928. ,
  4929. t.prototype.firstDestination = function() {
  4930. //return 0 < this.nItems ? 0 : null
  4931. return 0 < this.nItems ? [0,0]: null
  4932. }
  4933. ,
  4934. t.prototype.finalDestination = function() {
  4935. //return 0 < this.nItems ? this.nItems - 1 : null
  4936. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4937. }
  4938. ,
  4939. t.prototype.goPrev = function() {
  4940. this.tourAdvance(-1)
  4941. }
  4942. ,
  4943. t.prototype.goNext = function() {
  4944. this.tourAdvance(1)
  4945. }
  4946. ,
  4947. t.prototype.setDestinationItem = function(e) {
  4948. this.destinationItem = e,
  4949. this.emit("update.controls")
  4950. }
  4951. ,
  4952. t.prototype.setCurrentItem = function(e) {
  4953. this.currentItem = e,
  4954. this.emit("update.controls")
  4955. }
  4956. ,
  4957. t.prototype.nextItem = function(currentItem) {
  4958. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4959. if(currentItem == void 0)return this.firstDestination()
  4960. var currentLocation = this.model.heroLocations[currentItem[0]];
  4961. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4962. var item;
  4963. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4964. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4965. }else{
  4966. item = [currentItem[0] , currentItem[1]+1]
  4967. }
  4968. if(item[0] >= this.nItems ){
  4969. item = this.firstDestination()
  4970. }
  4971. return item;
  4972. //暂时不理会endlessLoop,默认为false
  4973. }
  4974. ,
  4975. t.prototype.prevItem = function(currentItem) {
  4976. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4977. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4978. var item;
  4979. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4980. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4981. else{
  4982. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4983. if(this.currentItem[1] == 0){//子目录中第一个
  4984. return [currentItem[0] - 1, lastChildNum-1]
  4985. }else{
  4986. return [currentItem[0], currentItem[1]-1]
  4987. }
  4988. }
  4989. }
  4990. ,
  4991. t.prototype.tourAdvance = function(e) {//e是1或-1
  4992. m.debug("tourAdvance(" + e + ")")
  4993. if(null === this.currentItem || void 0 === this.currentItem){
  4994. this.setDestinationItem(this.firstDestination())
  4995. }else{
  4996. var item
  4997. if(e == 1){
  4998. item = this.nextItem(this.currentItem)
  4999. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5000. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5001. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5002. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5003. }else{
  5004. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5005. } */
  5006. }else if(e == -1){
  5007. item = this.prevItem(this.currentItem)
  5008. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5009. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5010. else{
  5011. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5012. if(this.currentItem[1] == 0){//子目录中第一个
  5013. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5014. }else{
  5015. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5016. }
  5017. } */
  5018. }
  5019. //this.setDestinationItem(this.currentItem + e)
  5020. this.setDestinationItem(item)
  5021. }
  5022. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5023. this.useSpecialTransition("reverse-looping to end")
  5024. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5025. this.useSpecialTransition("looping back to start")
  5026. }
  5027. /* if(this.destinationItem[0] < 0 ){
  5028. this.setDestinationItem(this.finalDestination())
  5029. this.useSpecialTransition("reverse-looping to end")
  5030. }else{
  5031. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5032. this.useSpecialTransition("looping back to start"))
  5033. } */
  5034. /* var momentTour = this.getMomentTour(this.destinationItem);
  5035. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5036. var i = this.player.zoomLevel;
  5037. this.player.zoomEnabled = !0;
  5038. var t = function(e, t) {
  5039. this.player.zoomTo((1 - e) * i, !0)
  5040. }
  5041. .bind(this);
  5042. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5043. } */
  5044. this.goToDestination()
  5045. }
  5046. ,
  5047. t.prototype.getMomentTour = function(destinationItem) {//add
  5048. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5049. if(!destinationItem) return wholeMomentTour
  5050. else{
  5051. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5052. if(currentLocation.momentTour)return currentLocation.momentTour;
  5053. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5054. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5055. }
  5056. }
  5057. ,
  5058. I.exports = t
  5059. }
  5060. ).call(this, "/js/director.js")
  5061. }
  5062. , {
  5063. "./analytics": 4,
  5064. "./enum/BlackoutStyle": 18,
  5065. "./enum/ControlEvents": 21,
  5066. "./enum/DirectorEvents": 23,
  5067. "./enum/ModelManagerEvents": 33,
  5068. "./enum/PathDiscardMode": 38,
  5069. "./enum/PathDisplayMode": 39,
  5070. "./enum/PlayerEvents": 40,
  5071. "./enum/Viewmode": 51,
  5072. "./enum/WarpStyle": 52,
  5073. "./model/ModelManager": 140,
  5074. "./player": 155,
  5075. "./settings": 166,
  5076. "./util/logger": 189,
  5077. "./util/transitions": 195,
  5078. events: 202,
  5079. three: 217
  5080. }],
  5081. 16: [function(e, t, i) {
  5082. "use strict";
  5083. var n = e("three")
  5084. , r = e("./enum/Viewmode")
  5085. , o = (e("./settings"),
  5086. e("./util/transitions"))
  5087. , a = e("./enum/PlayerEvents")
  5088. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5089. , l = new n.ShaderPass(n.VerticalBlurShader);
  5090. l.renderToScreen = !0;
  5091. var c = $("#player").width() / $("#player").height();
  5092. isNaN(c) && (c = 1);
  5093. var h = {
  5094. currentBlur: 0,
  5095. aspect: c,
  5096. blurStrength: 1,
  5097. hblurPass: s,
  5098. vblurPass: l,
  5099. bindEvents: function(e) {
  5100. e.on(a.ModeChanged, function(e, t) {
  5101. e === r.PANORAMA && (o.cancel(h.blur),
  5102. o.cancel(h.addBlur),
  5103. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5104. })
  5105. },
  5106. blur: function(e) {
  5107. var t = (h.currentBlur = e) * h.blurStrength;
  5108. l.uniforms.v.value = t / 512 * h.aspect,
  5109. s.uniforms.h.value = t / 512
  5110. },
  5111. addBlur: function(e) {
  5112. e = Math.max(e, h.currentBlur),
  5113. h.blur(e)
  5114. },
  5115. removeBlur: function(e) {
  5116. e = Math.min(1 - e, h.currentBlur),
  5117. h.blur(e)
  5118. }
  5119. };
  5120. h.blur(0),
  5121. t.exports = h
  5122. }
  5123. , {
  5124. "./enum/PlayerEvents": 40,
  5125. "./enum/Viewmode": 51,
  5126. "./settings": 166,
  5127. "./util/transitions": 195,
  5128. three: 217
  5129. }],
  5130. 17: [function(e, t, i) {
  5131. "use strict";
  5132. t.exports = {
  5133. UNKNOWN: 0,
  5134. ALIGNED: 1,
  5135. UNALIGNED: 2,
  5136. PLACED: 3
  5137. }
  5138. }
  5139. , {}],
  5140. 18: [function(e, t, i) {
  5141. "use strict";
  5142. t.exports = {
  5143. NONE: 0,
  5144. MIDDLE: 1,
  5145. END: 2,
  5146. BEGINNING: 3,
  5147. FADEIN: 4
  5148. }
  5149. }
  5150. , {}],
  5151. 19: [function(e, t, i) {
  5152. "use strict";
  5153. var r = e("three");
  5154. t.exports = {
  5155. newBlue: new r.Color(4967932),
  5156. altBlue: new r.Color(47355),
  5157. tagDefault: new r.Color(223357),
  5158. classicBlue: new r.Color(53759),
  5159. mpYellow: new r.Color(16502016),
  5160. mpOrange: new r.Color(16428055),
  5161. mpBlue: new r.Color(12096),
  5162. mpLtGrey: new r.Color(13751252),
  5163. mpDkGrey: new r.Color(10000019),
  5164. mpRed: new r.Color(12525854),
  5165. mpOrangeDesat: new r.Color(16764529),
  5166. mpBlueDesat: new r.Color(4034734),
  5167. mpRedDesat: new r.Color(14705505),
  5168. white: new r.Color(16777215),
  5169. black: new r.Color(0),
  5170. _desat: function(e, t) {
  5171. var i = t || .3
  5172. , n = (new r.Color).copy(e).getHSL();
  5173. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5174. },
  5175. _darken: function(e, t) {
  5176. var i = t || .2
  5177. , n = e.getHSL();
  5178. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5179. }
  5180. }
  5181. }
  5182. , {
  5183. three: 217
  5184. }],
  5185. 20: [function(e, t, i) {
  5186. "use strict";
  5187. t.exports = {
  5188. NONE: -1,
  5189. ROTATE: 0,
  5190. DOLLY: 1,
  5191. PAN: 2,
  5192. ROTATE_DOLLY: 3,
  5193. PAN_DOLLY: 4
  5194. }
  5195. }
  5196. , {}],
  5197. 21: [function(e, t, i) {
  5198. "use strict";
  5199. t.exports = {
  5200. Move: "move",
  5201. InteractionDirect: "interaction.direct",
  5202. InteractionKey: "interaction.key",
  5203. InteractionGui: "interaction.gui",
  5204. FlyInDirection: "fly.direction",
  5205. InputStart: "input.start",
  5206. Pinch: "input.pinch",
  5207. Scroll: "input.scroll",
  5208. AutoPanInterrupt: "autopan.interrupt",
  5209. AutoPanComplete: "autopan.complete",
  5210. AutoPanClamped: "autopan.clamped",
  5211. LongTap: "longtap"
  5212. }
  5213. }
  5214. , {}],
  5215. 22: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = Object.freeze({
  5218. FORWARD: "FORWARD",
  5219. LEFT: "LEFT",
  5220. RIGHT: "RIGHT",
  5221. BACK: "BACK",
  5222. UP: "UP",
  5223. DOWN: "DOWN"
  5224. })
  5225. }
  5226. , {}],
  5227. 23: [function(e, t, i) {
  5228. "use strict";
  5229. t.exports = {
  5230. ActionInterrupted: "action.interrupted",
  5231. TourStart: "tour.start",
  5232. TourEnd: "tour.end",
  5233. StartModeChange: "mode.startChange"
  5234. }
  5235. }
  5236. , {}],
  5237. 24: [function(e, t, i) {
  5238. "use strict";
  5239. t.exports = Object.freeze({
  5240. None: 0,
  5241. Queued: 1,
  5242. ForceQueued: 2,
  5243. Downloading: 3,
  5244. Downloaded: 4,
  5245. DownloadFailed: 5
  5246. })
  5247. }
  5248. , {}],
  5249. 25: [function(e, t, i) {
  5250. "use strict";
  5251. t.exports = {
  5252. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5253. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5254. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5255. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5256. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5257. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5258. }
  5259. }
  5260. , {}],
  5261. 26: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. Texture2D: 0,
  5265. TextureCube: 1
  5266. }
  5267. }
  5268. , {}],
  5269. 27: [function(e, t, i) {
  5270. "use strict";
  5271. t.exports = {
  5272. SMALL: "small",
  5273. LARGE: "large"
  5274. }
  5275. }
  5276. , {}],
  5277. 28: [function(e, t, i) {
  5278. "use strict";
  5279. var n = e("./Viewmode")
  5280. , r = {
  5281. LANDING: {},
  5282. NAVIGATION: "navigation",
  5283. MORE_HELP: "moreHelp",
  5284. TOUR_INTERACTION: {}
  5285. };
  5286. r.LANDING[n.PANORAMA] = "panorama.landing",
  5287. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5288. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5289. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5290. r.TOUR_INTERACTION.standard = "standard.tour",
  5291. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5292. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5293. t.exports = r
  5294. }
  5295. , {
  5296. "./Viewmode": 51
  5297. }],
  5298. 29: [function(e, t, i) {
  5299. "use strict";
  5300. var n = {
  5301. UP: 1,
  5302. DOWN: -1,
  5303. LEFT: "L",
  5304. RIGHT: "R",
  5305. FORWARD: "F",
  5306. BACK: "B",
  5307. reverse: {},
  5308. opposite: function(e) {
  5309. return this.reverse[e.toString()]
  5310. }
  5311. };
  5312. n.reverse[n.UP] = n.DOWN,
  5313. n.reverse[n.DOWN] = n.UP,
  5314. n.reverse[n.LEFT] = n.RIGHT,
  5315. n.reverse[n.RIGHT] = n.LEFT,
  5316. n.reverse[n.FORWARD] = n.BACK,
  5317. n.reverse[n.BACK] = n.FORWARD,
  5318. t.exports = n
  5319. }
  5320. , {}],
  5321. 30: [function(e, t, i) {
  5322. "use strict";
  5323. var n = {
  5324. ZERO: 48,
  5325. ONE: 49,
  5326. TWO: 50,
  5327. THREE: 51,
  5328. FOUR: 52,
  5329. FIVE: 53,
  5330. SIX: 54,
  5331. SEVEN: 55,
  5332. EIGHT: 56,
  5333. NINE: 57,
  5334. LEFTARROW: 37,
  5335. UPARROW: 38,
  5336. RIGHTARROW: 39,
  5337. DOWNARROW: 40,
  5338. A: 65,
  5339. B: 66,
  5340. C: 67,
  5341. D: 68,
  5342. E: 69,
  5343. F: 70,
  5344. G: 71,
  5345. H: 72,
  5346. I: 73,
  5347. J: 74,
  5348. K: 75,
  5349. L: 76,
  5350. M: 77,
  5351. N: 78,
  5352. O: 79,
  5353. P: 80,
  5354. Q: 81,
  5355. R: 82,
  5356. S: 83,
  5357. T: 84,
  5358. U: 85,
  5359. V: 86,
  5360. W: 87,
  5361. X: 88,
  5362. Y: 89,
  5363. Z: 90,
  5364. SPACE: 32,
  5365. RETURN: 13,
  5366. SEMICOLON: 186,
  5367. PLUSEQUALS: 187,
  5368. DASHUNDERSCORE: 189,
  5369. OPENBRACKET: 219
  5370. };
  5371. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5372. n.PLUSEQUALS = 61,
  5373. n.DASHUNDERSCORE = 173),
  5374. t.exports = n
  5375. }
  5376. , {
  5377. "../util/browser": 182
  5378. }],
  5379. 31: [function(e, t, i) {
  5380. "use strict";
  5381. t.exports = {
  5382. EN_US: "en-US",
  5383. ES_MX: "es-MX",
  5384. FR_FR: "fr-FR",
  5385. DE_DE: "de-DE",
  5386. RU_RU: "ru-RU",
  5387. CN_CN: "cn-CN",
  5388. JP_JP: "jp-JP"
  5389. }
  5390. }
  5391. , {}],
  5392. 32: [function(e, t, i) {
  5393. "use strict";
  5394. t.exports = {
  5395. TagActivated: "tag.activated",
  5396. TagDismissed: "tag.dismissed",
  5397. TagNavigation: "tag.navigation"
  5398. }
  5399. }
  5400. , {}],
  5401. 33: [function(e, t, i) {
  5402. "use strict";
  5403. t.exports = {
  5404. ModelAdded: "model-added",
  5405. ActiveModelChanged: "active-model-changed"
  5406. }
  5407. }
  5408. , {}],
  5409. 34: [function(e, t, i) {
  5410. "use strict";
  5411. t.exports = {
  5412. LEFT: 0,
  5413. MIDDLE: 1,
  5414. RIGHT: 2
  5415. }
  5416. }
  5417. , {}],
  5418. 35: [function(e, t, i) {
  5419. "use strict";
  5420. t.exports = {
  5421. PanoRenderComplete: "panorama.render.complete",
  5422. TileRenderFailure: "panorama.tile.render.failed",
  5423. TileRenderSuccess: "panorama.tile.render.success",
  5424. TileUploadAttempted: "panorama.tile.upload.attempted",
  5425. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5426. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5427. }
  5428. }
  5429. , {}],
  5430. 36: [function(e, t, i) {
  5431. "use strict";
  5432. t.exports = {
  5433. BASE: 1,
  5434. STANDARD: 2,
  5435. HIGH: 3,
  5436. ULTRAHIGH: 4
  5437. }
  5438. }
  5439. , {}],
  5440. 37: [function(e, t, i) {
  5441. "use strict";
  5442. t.exports = {
  5443. LoadComplete: "panorama.load.complete",
  5444. LoadFailed: "panorama.load.failed",
  5445. TileLoaded: "panorama.tile.loaded"
  5446. }
  5447. }
  5448. , {}],
  5449. 38: [function(e, t, i) {
  5450. "use strict";
  5451. t.exports = Object.freeze({
  5452. Standard: 0,
  5453. Slow: 1,
  5454. Retain: 2
  5455. })
  5456. }
  5457. , {}],
  5458. 39: [function(e, t, i) {
  5459. "use strict";
  5460. t.exports = Object.freeze({
  5461. Show: 0,
  5462. Hide: 1,
  5463. Retain: 2
  5464. })
  5465. }
  5466. , {}],
  5467. 40: [function(e, t, i) {
  5468. "use strict";
  5469. t.exports = {
  5470. Move: "move",
  5471. MoveComplete: "move.complete",
  5472. ModeChanged: "mode.changed",
  5473. ModeChanging: "mode.changing",
  5474. PanoChosen: "pano.chosen",
  5475. ClosestPanoChanging: "closest.pano.changing",
  5476. WarpStarted: "warp.started",
  5477. WarpInterrupted: "warp.interrupted",
  5478. WarpEnded: "warp.ended",
  5479. FlyinFinished: "flyin.finished",
  5480. FlyingStarted: "flying.started",
  5481. FlyingInterrupted: "flying.interrupted",
  5482. FlyingEnded: "flying.ended",
  5483. Ready: "ready",
  5484. StartInside: "start.inside",
  5485. StartOutside: "start.outside",
  5486. ViewChanged: "view.changed",
  5487. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5488. InputStart: "input.start"
  5489. }
  5490. }
  5491. , {}],
  5492. 41: [function(e, t, i) {
  5493. "use strict";
  5494. t.exports = Object.freeze({
  5495. DEFAULT: 0,
  5496. PANOMARKERS: 1,
  5497. RETICULE: 2,
  5498. TAG: 3
  5499. })
  5500. }
  5501. , {}],
  5502. 42: [function(e, t, i) {
  5503. "use strict";
  5504. t.exports = {
  5505. visibleFloor: 1,
  5506. ghostFloor: 3,
  5507. boundingSkybox: 1,
  5508. panoMarker: 2,
  5509. reticule: 3,
  5510. tagStem: 4,
  5511. tagDisc: 5,
  5512. ribbon: 100
  5513. }
  5514. }
  5515. , {}],
  5516. 43: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. ContextCreated: "scene-renderer-context-created",
  5520. AfterRender: "after-render",
  5521. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5522. }
  5523. }
  5524. , {}],
  5525. 44: [function(e, t, i) {
  5526. "use strict";
  5527. t.exports = {
  5528. IDLE: "idle",
  5529. BROWSE: "browse",
  5530. EXAMINE: "examine"
  5531. }
  5532. }
  5533. , {}],
  5534. 45: [function(e, t, i) {
  5535. "use strict";
  5536. t.exports = {
  5537. TileDownloadSuccess: "tiledownloader.download.success",
  5538. TileDownloadFailure: "tiledownloader.download.failure",
  5539. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5540. }
  5541. }
  5542. , {}],
  5543. 46: [function(e, t, i) {
  5544. "use strict";
  5545. t.exports = {
  5546. CardboardAndroid: "googlevr",
  5547. GearVR: "gearvr",
  5548. CardboardIOS: "googlevrios",
  5549. Cardboard: "googlevr"
  5550. }
  5551. }
  5552. , {}],
  5553. 47: [function(e, t, i) {
  5554. "use strict";
  5555. t.exports = {
  5556. NONE: 0,
  5557. CONTEXTUAL: 1,
  5558. ANDROID: 2
  5559. }
  5560. }
  5561. , {}],
  5562. 48: [function(e, t, i) {
  5563. "use strict";
  5564. var n = {
  5565. Title: 0,
  5566. Cardboard: 1
  5567. }
  5568. , r = {
  5569. Title: 0,
  5570. Cardboard: 1,
  5571. Gear: 2
  5572. };
  5573. [n, r].forEach(function(e) {
  5574. e.pageCount = Object.keys(e).length
  5575. }),
  5576. t.exports.ios = n,
  5577. t.exports.standard = r
  5578. }
  5579. , {}],
  5580. 49: [function(e, t, i) {
  5581. "use strict";
  5582. t.exports = {
  5583. Android: "android",
  5584. IOS: "ios",
  5585. Desktop: "desktop",
  5586. UnsupportedAndroid: "android-unsupported"
  5587. }
  5588. }
  5589. , {}],
  5590. 50: [function(e, t, i) {
  5591. "use strict";
  5592. var n = e("three");
  5593. t.exports = {
  5594. UP: new n.Vector3(0,1,0),
  5595. DOWN: new n.Vector3(0,-1,0),
  5596. LEFT: new n.Vector3(-1,0,0),
  5597. RIGHT: new n.Vector3(1,0,0),
  5598. FORWARD: new n.Vector3(0,0,-1),
  5599. BACK: new n.Vector3(0,0,1)
  5600. }
  5601. }
  5602. , {
  5603. three: 217
  5604. }],
  5605. 51: [function(e, t, i) {
  5606. "use strict";
  5607. var n = e("../exception/ViewmodeConvertException")
  5608. , r = e("./coreViewmodes")
  5609. , o = {
  5610. MESH: "mesh",
  5611. OUTDOOR: "outdoor",
  5612. TRANSITIONING: "transitioning",
  5613. toInt: function(e) {
  5614. switch (e) {
  5615. case this.PANORAMA:
  5616. return 1;
  5617. case this.DOLLHOUSE:
  5618. return 2;
  5619. case this.FLOORPLAN:
  5620. return 3;
  5621. case this.OUTDOOR:
  5622. return 4;
  5623. case this.TRANSITIONING:
  5624. return -1
  5625. }
  5626. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5627. },
  5628. fromInt: function(e) {
  5629. switch (e) {
  5630. case "1":
  5631. case 1:
  5632. return this.PANORAMA;
  5633. case "2":
  5634. case 2:
  5635. return this.DOLLHOUSE;
  5636. case "3":
  5637. case 3:
  5638. return this.FLOORPLAN;
  5639. case "4":
  5640. case 4:
  5641. return this.OUTDOOR
  5642. }
  5643. throw new n("No known conversion for int to viewmode for int: " + e)
  5644. },
  5645. convertWorkshopModeInt: function(e) {
  5646. switch (e) {
  5647. case "0":
  5648. case 0:
  5649. case void 0:
  5650. return this.PANORAMA;
  5651. case "1":
  5652. case 1:
  5653. return this.FLOORPLAN;
  5654. case "2":
  5655. case 2:
  5656. return this.DOLLHOUSE;
  5657. case "3":
  5658. case 3:
  5659. return this.MESH
  5660. }
  5661. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5662. }
  5663. };
  5664. e("../util/common").extendObject(o, r),
  5665. t.exports = o
  5666. }
  5667. , {
  5668. "../exception/ViewmodeConvertException": 58,
  5669. "../util/common": 185,
  5670. "./coreViewmodes": 54
  5671. }],
  5672. 52: [function(e, t, i) {
  5673. "use strict";
  5674. t.exports = {
  5675. BLACK: "black",
  5676. STD: "std",
  5677. WALK: "walk"
  5678. }
  5679. }
  5680. , {}],
  5681. 53: [function(e, t, i) {
  5682. "use strict";
  5683. t.exports = {
  5684. ZoomIn: "zoom.in",
  5685. ZoomOut: "zoom.out",
  5686. ZoomMax: "zoom.max",
  5687. ZoomMin: "zoom.min"
  5688. }
  5689. }
  5690. , {}],
  5691. 54: [function(e, t, i) {
  5692. "use strict";
  5693. t.exports = {
  5694. PANORAMA: "panorama",
  5695. DOLLHOUSE: "dollhouse",
  5696. FLOORPLAN: "floorplan"
  5697. }
  5698. }
  5699. , {}],
  5700. 55: [function(e, t, i) {
  5701. "use strict";
  5702. t.exports = function(e) {
  5703. this.message = e
  5704. }
  5705. }
  5706. , {}],
  5707. 56: [function(e, t, i) {
  5708. "use strict";
  5709. function n(e) {
  5710. r.call(this, e)
  5711. }
  5712. var r = e("./BasicException");
  5713. n.prototype = Object.create(r.prototype),
  5714. t.exports = n
  5715. }
  5716. , {
  5717. "./BasicException": 55
  5718. }],
  5719. 57: [function(e, t, i) {
  5720. "use strict";
  5721. function n(e) {
  5722. r.call(this, e)
  5723. }
  5724. var r = e("./BasicException");
  5725. n.prototype = Object.create(r.prototype),
  5726. t.exports = n
  5727. }
  5728. , {
  5729. "./BasicException": 55
  5730. }],
  5731. 58: [function(e, t, i) {
  5732. "use strict";
  5733. function n(e) {
  5734. r.call(this, e)
  5735. }
  5736. var r = e("./BasicException");
  5737. n.prototype = Object.create(r.prototype),
  5738. t.exports = n
  5739. }
  5740. , {
  5741. "./BasicException": 55
  5742. }],
  5743. 59: [function(a, s, e) {
  5744. (function(e) {
  5745. "use strict";
  5746. var i = a("./util/ajax")
  5747. , n = a("./util/showcase")
  5748. , t = a("./util/logger")
  5749. , r = new t(e)
  5750. , o = {};
  5751. s.exports = {
  5752. loadFeatureFlags: function(e) {
  5753. var t = $.Deferred();
  5754. return i.get(e.urlBase + "", {
  5755. responseType: "json",
  5756. prefetchFrom: "user",
  5757. auth: n.getAuthorizationHeader()
  5758. }).done(function(e) {
  5759. (o = function(e) {
  5760. var t = {};
  5761. if (e) {
  5762. var i = e.flags;
  5763. if (i)
  5764. for (var n in i)
  5765. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5766. return t
  5767. }
  5768. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5769. null
  5770. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5771. }).fail(function() {
  5772. r.debug("Retrieval of feature flags failed."),
  5773. t.reject("loading-failed")
  5774. }),
  5775. t.promise()
  5776. },
  5777. getFlags: function() {
  5778. return o
  5779. },
  5780. updateDependentSettings: function(e, t) {
  5781. (e = e || o).labels && (t.labels.enabled = !0),
  5782. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5783. e.showcase_sdk && (t.sdkInit = !0),
  5784. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5785. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5786. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5787. e.hide_sc_sharing && (t.share.enabled = !1)
  5788. }
  5789. }
  5790. }
  5791. ).call(this, "/js/featureflags.js")
  5792. }
  5793. , {
  5794. "./util/ajax": 181,
  5795. "./util/logger": 189,
  5796. "./util/showcase": 193
  5797. }],
  5798. 60: [function(e, t, i) {
  5799. "use strict";
  5800. var n = (e("../util/common"),
  5801. {
  5802. status: 0,
  5803. set: function(e) {
  5804. if (isNaN(e))
  5805. return !1;
  5806. var t = $(".progressbar");
  5807. e < 0 && (e = 0),
  5808. 100 < e && (e = 100);
  5809. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5810. , n = Math.round(e)
  5811. , r = parseInt(i) - 15;
  5812. t.find(".bar").css("width", i),
  5813. t.find(".label").css("left", r),
  5814. t.find(".perc").text(n + "%"),
  5815. this.status = e
  5816. },
  5817. done: function(e) {
  5818. return e || this.status ? (this.status = null,
  5819. this.set(100)) : this
  5820. }
  5821. });
  5822. t.exports.circleLoader = n
  5823. }
  5824. , {
  5825. "../util/common": 185
  5826. }],
  5827. 61: [function(e, t, i) {
  5828. "use strict";
  5829. t.exports = Object.freeze({
  5830. CLOSE: "modal.closer.close"
  5831. })
  5832. }
  5833. , {}],
  5834. 62: [function(e, t, i) {
  5835. "use strict";
  5836. function n(t, e) {
  5837. function i() {
  5838. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5839. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5840. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5841. c.classList.remove("closeByFooter")))
  5842. }
  5843. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5844. }
  5845. var r = e("../../settings")
  5846. , o = (e("../../tag/Media/MediaEvent"),
  5847. e("../../util/browser"))
  5848. , a = e("../../util/common")
  5849. , s = e("./ModalCloserEvent")
  5850. , l = e("events").EventEmitter
  5851. , c = document.getElementsByClassName("footer")[0]
  5852. , h = c.querySelectorAll(".close")[0]
  5853. , u = null
  5854. , d = null
  5855. , p = null
  5856. , f = (o.isMobile(),
  5857. {
  5858. open: function(e) {
  5859. e && (n(e),
  5860. u && h.removeEventListener("click", u, !0),
  5861. u = function(e, t) {
  5862. t && (t.stopPropagation(),
  5863. t.preventDefault()),
  5864. e && this.emit(s.CLOSE, e),
  5865. f.reset()
  5866. }
  5867. .bind(this, e.id),
  5868. h.addEventListener("click", u, !0),
  5869. d && window.removeEventListener("resize", d, !0),
  5870. d = n.bind(this, e),
  5871. window.addEventListener("resize", d, !0))
  5872. },
  5873. reset: function() {
  5874. c.classList.remove("closeByFooter"),
  5875. h.removeEventListener("click", u, !0),
  5876. window.removeEventListener("resize", d, !0),
  5877. u = d = p = null
  5878. }
  5879. });
  5880. a.extendObject(f, l.prototype),
  5881. t.exports = f
  5882. }
  5883. , {
  5884. "../../tag/Media/MediaEvent": 131,
  5885. "../../settings": 166,
  5886. "../../util/browser": 182,
  5887. "../../util/common": 185,
  5888. "./ModalCloserEvent": 61,
  5889. events: 202
  5890. }],
  5891. 63: [function(e, t, i) {
  5892. "use strict";
  5893. var A = e("../lib/dat.gui")
  5894. , C = e("three")
  5895. , I = e("../util/easing")
  5896. , E = e("../enum/Viewmode")
  5897. , _ = e("../enum/Colors")
  5898. , b = e("../enum/WarpStyle")
  5899. , w = e("../settings");
  5900. e("../tag/tag"),
  5901. A.GUI.prototype.removeFolder = function(e) {
  5902. var t = this.__folders[e];
  5903. t && (t.close(),
  5904. this.__ul.removeChild(t.domElement.parentNode),
  5905. delete this.__folders[e],
  5906. this.onResize())
  5907. }
  5908. ,
  5909. t.exports.toggle = function(t, e, i) {
  5910. var n = new A.GUI({
  5911. width: 400
  5912. })
  5913. , r = n.addFolder("Flydown from Dollhouse");
  5914. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5915. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5916. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5917. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5918. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5919. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5920. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5921. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5922. var o = n.addFolder("Transition between panos");
  5923. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5924. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5925. w.transition.flyTime = 0,
  5926. o.__controllers.forEach(function(e) {
  5927. e.updateDisplay()
  5928. })
  5929. }),
  5930. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5931. w.transition.flySpeed = 0,
  5932. o.__controllers.forEach(function(e) {
  5933. e.updateDisplay()
  5934. })
  5935. }),
  5936. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5937. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5938. o.add(w.transition, "movementEasing", Object.keys(I));
  5939. var a = n.addFolder("Path Display");
  5940. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5941. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5942. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5943. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5944. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5945. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5946. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5947. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5948. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5949. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5950. w.path.color = _[w.path.color],
  5951. w.path.colorUp = _._desat(w.path.color),
  5952. w.path.colorDown = _.darken(w.path.color)
  5953. }),
  5954. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5955. w.reticuleColor = _[w.reticuleColor]
  5956. });
  5957. var s = n.addFolder("Warping")
  5958. , l = s.addFolder("Warp/Teleport");
  5959. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5960. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5961. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5962. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5963. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5964. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5965. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5966. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5967. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5968. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5969. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5970. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5971. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5972. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5973. w.path.typ = b[w.path.typ]
  5974. }),
  5975. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5976. e.endlessLoop = w.warp.loop
  5977. }),
  5978. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5979. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5980. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5981. var c = s.addFolder("Long Warp Only");
  5982. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5983. w.warp.flySpeed = 0,
  5984. c.__controllers.forEach(function(e) {
  5985. e.updateDisplay()
  5986. })
  5987. }),
  5988. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5989. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5990. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5991. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5992. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5993. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5994. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5995. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5996. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5997. var h = n.addFolder("Warp Esoterica");
  5998. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5999. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6000. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6001. w.warp.minWarpTime = 0,
  6002. h.__controllers.forEach(function(e) {
  6003. e.updateDisplay()
  6004. })
  6005. }),
  6006. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6007. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6008. h.add(w.warp, "movementEasing", Object.keys(I));
  6009. var u = n.addFolder("Misc");
  6010. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6011. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6012. }),
  6013. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6014. i.cameras[E.PANORAMA].fov = w.insideFOV
  6015. }),
  6016. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6017. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6018. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6019. var d = n.addFolder("Navigation");
  6020. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6021. w.navigation.panoScores || t.panos.forEach(function(e) {
  6022. e.floor.remove(e.text3d),
  6023. e.text3d = null
  6024. })
  6025. }),
  6026. d.add(w.navigation, "mouseDirection"),
  6027. d.add(w.navigation, "filterStrictness", 0, 1),
  6028. d.add(w.navigation, "angleFactor", -60, 0),
  6029. d.add(w.navigation, "directionFactor", 1, 20),
  6030. d.add(w.navigation, "distanceFactor", -5, 5),
  6031. d.add(w.navigation, "optionalityFactor", .1, 10);
  6032. var p = n.addFolder("tags")
  6033. , f = p.addFolder("Tag Creation");
  6034. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6035. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6036. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6037. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6038. var g = p.addFolder("Visibility");
  6039. g.add(w.tags.visibility, "anyDistance"),
  6040. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6041. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6042. g.add(w.tags.visibility, "hideViaFloor"),
  6043. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6044. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6045. var m = p.addFolder("Disc Parameters");
  6046. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6047. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6048. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6049. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6050. }),
  6051. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6052. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6053. }),
  6054. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6055. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6056. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6057. var v = p.addFolder("Navigate");
  6058. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6059. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6060. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6061. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6062. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6063. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6064. var y = n.addFolder("Debug");
  6065. y.add(w, "wireframe").onFinishChange(function() {
  6066. t.chunks.forEach(function(e) {
  6067. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6068. e.wireframeTwin.material.depthWrite = !1,
  6069. e.wireframeTwin.material.depthTest = !1,
  6070. e.wireframeTwin.material.opacity = .5,
  6071. e.wireframeTwin.material.transparent = !0),
  6072. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6073. })
  6074. }),
  6075. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6076. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6077. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6078. t.skybox.wireframe = null)
  6079. }),
  6080. y.add(w, "showSweeps").onFinishChange(function() {
  6081. t.setSweepVisibility(w.showSweeps)
  6082. }),
  6083. y.add(w, "showMesh").onFinishChange(function() {
  6084. t.chunks.forEach(function(e) {
  6085. e.visible = w.showMesh
  6086. })
  6087. }),
  6088. y.add(w, "showFloors").onFinishChange(function() {
  6089. t.floors.forEach(function(e) {
  6090. e.collider.children.forEach(function(e) {
  6091. e.material.visible = w.showFloors
  6092. })
  6093. })
  6094. }),
  6095. y.add(w, "showSkyboxes").onFinishChange(function() {
  6096. t.panos.forEach(function(e) {
  6097. e.skyboxMesh.visible = w.showSkyboxes
  6098. })
  6099. }),
  6100. y.add(w, "showNeighbors").onChange(function() {}),
  6101. y.add(t, "alpha", 0, 1)
  6102. }
  6103. }
  6104. , {
  6105. "../enum/Colors": 19,
  6106. "../enum/Viewmode": 51,
  6107. "../enum/WarpStyle": 52,
  6108. "../lib/dat.gui": 93,
  6109. "../tag/tag": 123,
  6110. "../settings": 166,
  6111. "../util/easing": 186,
  6112. three: 217
  6113. }],
  6114. 64: [function(c, h, e) {
  6115. (function(e) {
  6116. "use strict";
  6117. function i(e, t, i, n) {
  6118. $(".gui-error .error-problem-text").text(e),
  6119. $(".gui-error .error-solution-text").text(t),
  6120. $(".gui-error .error-explanation").text(i),
  6121. $(".gui-error .error-actions").html(n),
  6122. $(window).resize(),
  6123. $(".gui-error").fadeIn(),
  6124. $("#bottom-logo").fadeIn()
  6125. }
  6126. function n(e) {
  6127. 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("");
  6128. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6129. r.isMobile() || $("[rel=tiletip]").tooltip({
  6130. placement: "bottom",
  6131. delay: {
  6132. show: 50,
  6133. hide: 0
  6134. },
  6135. trigger: "hover",
  6136. viewport: {
  6137. selector: "body",
  6138. padding: 10
  6139. }
  6140. })
  6141. }
  6142. function t() {
  6143. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6144. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6145. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6146. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6147. e.preventDefault(),
  6148. e.stopPropagation(),
  6149. n(" ")
  6150. })
  6151. }
  6152. var r = c("./../util/browser")
  6153. , o = c("./../analytics")
  6154. , a = c("./../settings")
  6155. , s = c("../localization/localize")
  6156. , l = new (c("./../util/logger"))(e);
  6157. h.exports.error = function(e) {
  6158. if ($("head title").text(a.pageTitle),
  6159. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6160. $("#gui-loading").fadeOut(250),
  6161. $("#quick-blackout").hide(),
  6162. o.track("showcase_error", {
  6163. error_key: e
  6164. }),
  6165. s.locale || s.init(),
  6166. "webgl-unsupported" === e)
  6167. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6168. else if ("webgl-ios" === e)
  6169. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6170. else if ("webgl-safari" === e)
  6171. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6172. else if ("webgl-generic" === e)
  6173. t();
  6174. else if ("missing-urls" === e)
  6175. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6176. else if ("loading-failed" === e)
  6177. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6178. else {
  6179. if ("loading-failed-maintenance" !== e)
  6180. return void l.error("Unhandled error: " + e);
  6181. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6182. }
  6183. }
  6184. }
  6185. ).call(this, "/js/gui/error.js")
  6186. }
  6187. , {
  6188. "../localization/localize": 108,
  6189. "./../analytics": 4,
  6190. "./../settings": 166,
  6191. "./../util/browser": 182,
  6192. "./../util/logger": 189
  6193. }],
  6194. 65: [function(Oe, Le, e) {
  6195. (function(e) {
  6196. "use strict";
  6197. function c() {
  6198. for (var e in Ce)
  6199. if (Ce.hasOwnProperty(e)) {
  6200. var t = Ce[e];
  6201. if (!t.visible)
  6202. for (var i = 0; i < t.elements.length; i++)
  6203. $(t.elements[i]).hide()
  6204. }
  6205. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6206. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6207. ge = [],
  6208. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6209. ge.push(".hideTarget", ".pinTop.right")
  6210. }
  6211. function v(e, t) {
  6212. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6213. $("#gui-zoomin").toggle(i),
  6214. $("#gui-zoomout").toggle(i)
  6215. }
  6216. function l() {
  6217. n(),
  6218. $(".pinBottom").toggleClass("open"),
  6219. $("#drawer").toggleClass("open"),
  6220. $(".footer").toggleClass("open"),
  6221. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6222. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6223. O.resetDrawer()),
  6224. setTimeout(function() {
  6225. $("#pullTab").toggleClass("opened")
  6226. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6227. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6228. }
  6229. function t(e) {
  6230. var t;
  6231. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6232. t = e.position().top + e.outerHeight(),
  6233. e.attr("style", "display: none")),
  6234. $("#player").outerHeight() - 130 < t + 25
  6235. }
  6236. function y(e) {
  6237. "touchstart" === e.type && e.preventDefault(),
  6238. e.stopPropagation()
  6239. }
  6240. function n() {
  6241. w && (w.reload(),
  6242. w.init())
  6243. }
  6244. function r() {
  6245. $("#gui-spinner").stop(!0, !0),
  6246. $("#gui-spinner").fadeOut(1e3),
  6247. !(Ae = !0)
  6248. }
  6249. function A(e, t) {
  6250. var i = e.mode
  6251. , n = t || e.currentPano;
  6252. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6253. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6254. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6255. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6256. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6257. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6258. $("#gui-modes-outside").removeClass("desktop-only")),
  6259. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6260. pe = i,
  6261. $("#gui-modes-outside").addClass("hidden"),
  6262. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6263. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6264. }
  6265. function C(t, i) {
  6266. function e() {
  6267. document.getElementById("vr").classList.remove("hidden"),
  6268. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6269. S.supportsFullscreen() ? function(e) {
  6270. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6271. Q.init(t.data, i, e, x),
  6272. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6273. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6274. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6275. $(".improper-embed").toggleClass("hidden", !1),
  6276. n())
  6277. }, function(e) {
  6278. n()
  6279. }) : n()
  6280. }
  6281. function n() {
  6282. var e;
  6283. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6284. X.init(t.data, x),
  6285. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6286. function() {
  6287. _e("vr"),
  6288. V.open(e)
  6289. }
  6290. )),
  6291. X.on(Z.CLOSED, V.reset)
  6292. }
  6293. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6294. switch (M.vr.option) {
  6295. case le.CONTEXTUAL:
  6296. e();
  6297. break;
  6298. case le.ANDROID:
  6299. S.detectAndroid() && e();
  6300. break;
  6301. case le.NONE:
  6302. }
  6303. }
  6304. function h(e, i) {
  6305. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6306. if ("372" !== getQueryVariable("m")) {
  6307. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6308. $(".gui-floor").find(".container").prepend(r)
  6309. }
  6310. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6311. n.on("click", function(e) {
  6312. y(e),
  6313. _e("floor"),
  6314. n.toggleClass("open")
  6315. }),
  6316. $(".floorChoice").on("click", function(e) {
  6317. y(e);
  6318. var t = $(this).data("index");
  6319. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6320. i.player.gotoFloor(t),
  6321. R.track("showcase_gui", {
  6322. gui_action: "click_floor_select_button",
  6323. interaction_source: "gui"
  6324. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6325. _e("move"),
  6326. i.allFloors(),
  6327. R.track("showcase_gui", {
  6328. gui_action: "click_toggle_all_floors_button",
  6329. interaction_source: "gui"
  6330. })),
  6331. n.removeClass("open")
  6332. })
  6333. }
  6334. function I(e, t) {
  6335. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6336. $(".gui-floor-icon").hide(),
  6337. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6338. $(".gui-floor-icon").show(),
  6339. $(".gui-floor-title").hide()),
  6340. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6341. $(".gui-floor-number").text(se.FLOOR_ALL),
  6342. $(".floorChoice").removeClass("active"),
  6343. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6344. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6345. $(".floorChoice").removeClass("active"),
  6346. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6347. }
  6348. function E() {
  6349. var e = $("#player").width() - 20
  6350. , t = $("#scroller")
  6351. , i = $("#drawer")
  6352. , n = $(".pinBottom");
  6353. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6354. i.addClass("noScroll"),
  6355. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6356. i.toggleClass("noScroll"),
  6357. n.toggleClass("noScroll"))
  6358. }
  6359. function _(e) {
  6360. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6361. e = e || 0,
  6362. Ae = !1,
  6363. window.setTimeout(function() {
  6364. Ae || (!0,
  6365. $("#gui-spinner").stop(!0, !0).show())
  6366. }
  6367. .bind(this), e)
  6368. }(M.modelComponentLoadSpinnerDelay)
  6369. }
  6370. function b(e, t) {
  6371. for (var i = []; e; )
  6372. i.push(e),
  6373. e = e.parentNode;
  6374. for (; t && -1 === i.indexOf(t); )
  6375. t = t.parentNode;
  6376. return t
  6377. }
  6378. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6379. Oe("../util/ajax"),
  6380. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6381. Oe("../util/camera"),
  6382. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6383. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6384. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6385. Oe("../enum/PathDisplayMode"),
  6386. Oe("../enum/DirectorEvents"),
  6387. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6388. Oe("../enum/WarpStyle"),
  6389. Oe("../enum/AlignmentType"),
  6390. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6391. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6392. coBrand: {
  6393. visible: !0,
  6394. elements: [".co-brand", "#loaderCoBrand"]
  6395. },
  6396. help: {
  6397. visible: !0,
  6398. elements: [".nav-help", "#nav-help"]
  6399. },
  6400. tourControls: {
  6401. visible: !0,
  6402. elements: [".next", ".previous", "#play"]
  6403. },
  6404. highlight: {
  6405. visible: !0,
  6406. elements: ["#drawer", "#pullTab"]
  6407. },
  6408. share: {
  6409. visible: !0,
  6410. elements: [".socialButton", "#share"]
  6411. },
  6412. fullScreen: {
  6413. visible: !0,
  6414. elements: ["#gui-fullscreen"]
  6415. },
  6416. floors: {
  6417. visible: !0,
  6418. elements: [".gui-floor"]
  6419. }
  6420. }, Ie = (g = document.getElementById("drawer"),
  6421. function() {
  6422. $("#player").height() < 400 && g.classList.contains("open") && l()
  6423. }
  6424. ), Ee = (f = document.getElementById("meta-info"),
  6425. function() {
  6426. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6427. }
  6428. ), _e = (i = document.getElementById("meta-info"),
  6429. s = document.getElementById("interaction-modal"),
  6430. u = $("#drawer").eq(0),
  6431. d = $(".gui-floor").eq(0),
  6432. p = $(".vr-popup").eq(0),
  6433. function(e) {
  6434. switch (e) {
  6435. case "info":
  6436. we(),
  6437. Te(),
  6438. Ie(),
  6439. Me(),
  6440. Re(),
  6441. xe(),
  6442. Pe();
  6443. break;
  6444. case "terms":
  6445. be(),
  6446. Te(),
  6447. Se(),
  6448. Me(),
  6449. Re(),
  6450. xe(),
  6451. Pe();
  6452. break;
  6453. case "help":
  6454. be(),
  6455. we(),
  6456. Me(),
  6457. Re(),
  6458. xe(),
  6459. Pe();
  6460. break;
  6461. case "vr":
  6462. be(),
  6463. we(),
  6464. Me(),
  6465. Re(),
  6466. Te(),
  6467. Pe(),
  6468. t(p) && Se();
  6469. break;
  6470. case "highlights":
  6471. Ee(),
  6472. we(),
  6473. Me(),
  6474. Re();
  6475. break;
  6476. case "share":
  6477. be(),
  6478. we(),
  6479. Te(),
  6480. Re(),
  6481. xe(),
  6482. Pe();
  6483. break;
  6484. case "floor":
  6485. we(),
  6486. Me(),
  6487. xe();
  6488. break;
  6489. case "view":
  6490. Re(),
  6491. Me(),
  6492. we(),
  6493. xe();
  6494. break;
  6495. case "tour":
  6496. case "move":
  6497. we(),
  6498. Me(),
  6499. Re(),
  6500. xe();
  6501. break;
  6502. case "resize":
  6503. be(),
  6504. Ie(),
  6505. Re();
  6506. break;
  6507. case "tag":
  6508. we(),
  6509. Te(),
  6510. Me(),
  6511. Re(),
  6512. xe()
  6513. }
  6514. }
  6515. );
  6516. function be() {
  6517. i.classList.contains("expand") && z.toggleMeta(!0)
  6518. }
  6519. function we() {
  6520. W.hide()
  6521. }
  6522. function Te() {
  6523. U.close()
  6524. }
  6525. function xe() {
  6526. X.dismiss()
  6527. }
  6528. function Se() {
  6529. u.hasClass("open") && l()
  6530. }
  6531. function Me() {
  6532. K.hide()
  6533. }
  6534. function Re() {
  6535. d.hasClass("open") && d.removeClass("open")
  6536. }
  6537. function Pe() {
  6538. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6539. }
  6540. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6541. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6542. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6543. setTimeout(function() {
  6544. $(".icon:visible").hide().show(0)
  6545. }, 100)
  6546. }),
  6547. $("#gui-fullscreen").find("a").on("click", function(e) {
  6548. y(e),
  6549. S.requestFullscreen($("body")[0]),
  6550. R.track("showcase_gui", {
  6551. gui_action: "click_enter_fullscreen",
  6552. interaction_source: "gui"
  6553. })
  6554. }),
  6555. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6556. y(e),
  6557. S.exitFullscreen(),
  6558. R.track("showcase_gui", {
  6559. gui_action: "click_exit_fullscreen",
  6560. interaction_source: "gui"
  6561. })
  6562. }),
  6563. $(window).on("resize", function(e) {
  6564. var t = e.target.innerHeight
  6565. , i = e.target.innerWidth;
  6566. t === o && i === a || (Ce.highlight.visible && E(),
  6567. _e("resize"),
  6568. $(".pinTop.right").removeClass("hideUnderMeta"),
  6569. n(),
  6570. o = t,
  6571. a = i)
  6572. }).resize(),
  6573. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6574. $("#pullTab").on("click", function(e) {
  6575. y(e),
  6576. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6577. gui_action: "hide_highlight_reel"
  6578. }),
  6579. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6580. gui_action: "show_highlight_reel"
  6581. }),
  6582. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6583. l()
  6584. }),
  6585. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6586. $("#hotList").on("click", function(e) {
  6587. y(e);
  6588. var t = $("#hotListWrap")[0];
  6589. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6590. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6591. this.classList.add("active"))
  6592. }),
  6593. $("#hotListContent ul").on("mouseover", function(e) {
  6594. y(e);
  6595. var t = e.target
  6596. , i = document.getElementById("hotListWrap");
  6597. if ("SPAN" === t.tagName) {
  6598. var n = t.parentElement.parentElement;
  6599. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6600. } else if ("LI" === t.tagName) {
  6601. n = t.parentElement;
  6602. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6603. } else
  6604. i.style.width = ""
  6605. }),
  6606. $("#hotListContent ul").on("click", function(e) {
  6607. y(e),
  6608. this.preElem && this.preElem.classList.remove("active"),
  6609. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6610. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6611. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6612. e.target.hot && e.target.hot.examine(!0),
  6613. this.preElem = e.target)
  6614. }),
  6615. $("#hotListClose").on("click", function(e) {
  6616. y(e),
  6617. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6618. $("#hotListContent ul .active").removeClass("active"),
  6619. $("#hotList")[0].classList.remove("active")
  6620. })),
  6621. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6622. $("#more-menu-button").on("click", function(e) {
  6623. y(e),
  6624. $("#more-menu").toggleClass("open")
  6625. }),
  6626. Le.exports.init = function(s, l, c, e, t, i, n) {
  6627. var r;
  6628. x = n,
  6629. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6630. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6631. F.init(),
  6632. D.init(s, i),
  6633. ce.init(s, l, e),
  6634. $(".icon").on("mouseover", function() {
  6635. l.player && l.player.reticule.hide()
  6636. }),
  6637. function(e, t) {
  6638. var i = t.player;
  6639. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6640. y(e),
  6641. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6642. R.track("USER", {
  6643. event_type: "showcase_gui",
  6644. gui_action: "click_inside_mode_button"
  6645. }),
  6646. t.changeMode(ie.PANORAMA)
  6647. }),
  6648. $("#gui-modes-outside").find("a").on("click", function(e) {
  6649. y(e),
  6650. R.track("showcase_gui", {
  6651. gui_action: "click_outside_mode_button"
  6652. }),
  6653. t.changeMode(pe)
  6654. }),
  6655. $("#gui-modes-floorplan").on("click", function(e) {
  6656. y(e),
  6657. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6658. gui_action: "click_floorplan_mode_button"
  6659. }),
  6660. t.changeMode(ie.FLOORPLAN))
  6661. }),
  6662. $("#gui-modes-dollhouse").on("click", function(e) {
  6663. y(e),
  6664. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6665. gui_action: "click_dollhouse_mode_button"
  6666. }),
  6667. t.changeMode(ie.DOLLHOUSE))
  6668. })
  6669. }(0, l),
  6670. function(e, t) {
  6671. $("#play").on("mousedown touchstart", function(e) {
  6672. y(e),
  6673. _e("tour"),
  6674. q.play(),
  6675. R.trackAlways("showcase_gui", {
  6676. gui_action: "play_highlights"
  6677. })
  6678. }),
  6679. window.startAndPlay = function(e) {
  6680. _e("tour"),
  6681. q.play(),
  6682. R.trackAlways("showcase_gui", {
  6683. gui_action: "play_highlights"
  6684. })
  6685. }
  6686. ,
  6687. $("#pause").on("mousedown touchstart", function(e) {
  6688. y(e),
  6689. q.pause(),
  6690. R.trackAlways("showcase_gui", {
  6691. gui_action: "pause_highlights"
  6692. })
  6693. }),
  6694. $("#gui-zoomin").find("a").on("click", function(e) {
  6695. y(e),
  6696. t.player.zoomInIncrementally()
  6697. }),
  6698. $("#gui-zoomout").find("a").on("click", function(e) {
  6699. y(e),
  6700. t.player.zoomOutIncrementally()
  6701. })
  6702. }(0, l),
  6703. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6704. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6705. function() {
  6706. _e("share"),
  6707. V.open(r)
  6708. }
  6709. )),
  6710. K.on(ae.CLOSED, V.reset)),
  6711. 0 < s.heroLocations.length ? function(e, i, t) {
  6712. var n = 100 / (fe = e.heroLocations.length) + "%"
  6713. , r = $("#thumb-container")
  6714. , o = $("#progressBar");
  6715. $("#status").find(".totalSteps").text(fe);
  6716. for (var a = 0; a < fe; a++) {
  6717. var s = e.heroLocations[a]
  6718. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6719. if(s.heroLocations){//有子项,选第一张截图
  6720. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6721. }else{
  6722. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6723. }
  6724. if (l.attr("data-index", a),
  6725. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6726. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6727. s.name) {
  6728. var c = $('<div class="overlay"></div>').text(s.name);
  6729. l.prepend(c)
  6730. }
  6731. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6732. var h = e.panos.get(s.panoId)
  6733. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6734. l.prepend(u)
  6735. }
  6736. r.append(l),
  6737. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6738. }
  6739. T = 144 * fe,
  6740. 111 * fe,
  6741. $(".thumbImg").on("mouseover", function() {
  6742. !function(e) {
  6743. return e.describe().inTransition
  6744. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6745. }),
  6746. $(".thumbImg").on("mouseout", function() {
  6747. i.clearPath()
  6748. }),
  6749. $(".thumbImg").on("click", function(e) {
  6750. y(e);
  6751. var t = $(this);
  6752. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6753. R.trackAlways("showcase_gui", {
  6754. gui_action: "click_highlight"
  6755. }),
  6756. i.goToHighlight([t.data("index"),0])//改
  6757. }),
  6758. $(".previous").find("a").on("click", function(e) {
  6759. y(e),
  6760. R.trackAlways("showcase_gui", {
  6761. gui_action: "prev_highlight"
  6762. }),
  6763. i.prevHighlight()
  6764. }),
  6765. $(".next").find("a").on("click", function(e) {
  6766. y(e),
  6767. R.trackAlways("showcase_gui", {
  6768. gui_action: "next_highlight"
  6769. }),
  6770. i.nextHighlight()
  6771. }),
  6772. $("#drawer").on("mouseleave", function(t) {
  6773. var i;
  6774. y(t);
  6775. try {
  6776. i = new MouseEvent("mouseup",{
  6777. clientX: t.clientX,
  6778. clientY: t.clientY,
  6779. screenX: t.screenX,
  6780. screenY: t.screenY
  6781. })
  6782. } catch (e) {
  6783. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", 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)
  6784. }
  6785. document.dispatchEvent(i)
  6786. }),
  6787. (w = new Sly($("#scrollFrame"),{
  6788. horizontal: !0,
  6789. itemNav: "centered",
  6790. smart: !0,
  6791. scrollTrap: !0,
  6792. scrollBy: 1,
  6793. mouseDragging: !0,
  6794. touchDragging: !0,
  6795. speed: 300,
  6796. dragHandle: !0,
  6797. dynamicHandle: !0,
  6798. clickBar: !0,
  6799. scrollBar: $("#scroller"),
  6800. activateOn: null
  6801. }).init()).on("active", function(e, t) {
  6802. t,
  6803. _e("tour"),
  6804. $(".step").removeClass("active"),
  6805. $("#status").find(".curIdx").text(t + 1);
  6806. for (var i = 0; i <= t; i++)
  6807. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6808. }),
  6809. E()
  6810. }(s, l, c) : (Ce.highlight.visible = !1,
  6811. Ce.tourControls.visible = !1),
  6812. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6813. function() {
  6814. var n;
  6815. document.body.addEventListener("mousedown", function(e) {
  6816. n = 0 === e.button || 1 === e.which ? e.target : null
  6817. }, !0),
  6818. document.body.addEventListener("mouseup", function(t) {
  6819. n !== t.target && (n = b(n, t.target));
  6820. var e = document.getElementById("gui-parent");
  6821. if (b(e, n) !== e && (n = null),
  6822. n) {
  6823. var i;
  6824. try {
  6825. i = new MouseEvent("click",t)
  6826. } catch (e) {
  6827. (i = document.createEvent("MouseEvents")).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)
  6828. }
  6829. i.syntheticClick = !0,
  6830. n.dispatchEvent(i),
  6831. n = null
  6832. }
  6833. }, !0),
  6834. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6835. e.syntheticClick || (e.stopPropagation(),
  6836. "A" === e.target.nodeName && e.preventDefault())
  6837. }, !0)
  6838. }(),
  6839. A(c),
  6840. C(s, t),
  6841. s.on("floor.changed", I),
  6842. s.on("waiting", function(e) {
  6843. _(e)
  6844. }
  6845. .bind(this, s)),
  6846. s.on("waiting-done", function(e) {
  6847. _(e)
  6848. }
  6849. .bind(this, s)),
  6850. c.on(re.ModeChanged, function(e, t) {
  6851. A(c),
  6852. v(l, c),
  6853. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6854. U.updateMode(t)
  6855. }),
  6856. e.on(oe.Move, _e.bind(this, "move")),
  6857. c.on(re.Ready, function() {
  6858. O.init(e, c, c.tagManager, l),
  6859. c.on(re.ModeChanged, function(e, t) {
  6860. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6861. })
  6862. }),
  6863. c.on(re.PanoChosen, function(e, t) {
  6864. A(c, t),
  6865. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6866. }),
  6867. V.on(k.CLOSE, function(e) {
  6868. switch (e) {
  6869. case "vr-modal":
  6870. X.dismiss();
  6871. break;
  6872. case "share-modal":
  6873. K.hide();
  6874. break;
  6875. case "terms-modal":
  6876. W.hide()
  6877. }
  6878. });
  6879. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6880. l.on("update.controls", function() {
  6881. var e, t, i, n = l.describe();
  6882. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6883. u.show()),
  6884. n.tourInProgress && (d.forEach(function(e) {
  6885. e.classList.add("playing")
  6886. }),
  6887. p.addClass("playing"),
  6888. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6889. u.hide()),
  6890. n.tourInProgress || (q.stopTour(),
  6891. d.forEach(function(e) {
  6892. e.classList.remove("playing")
  6893. }),
  6894. p.removeClass("playing"),
  6895. f.removeClass("playing"))),
  6896. null !== n.currentItem) {
  6897. var r, o;
  6898. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6899. n.onTheBus ? (r = "active",
  6900. o = "recent") : (o = "active",
  6901. r = "recent");
  6902. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6903. for (e = 0; e < s.heroLocations.length; e += 1)
  6904. i = g.eq(e),
  6905. t = m.eq(e),
  6906. i.removeClass(o),
  6907. t.removeClass(o),
  6908. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6909. t.addClass(r),
  6910. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6911. t.addClass(r)) : (i.removeClass(r),
  6912. t.removeClass(r))
  6913. } else
  6914. for (e = 0; e < s.heroLocations.length; e += 1)
  6915. i = g.eq(e),
  6916. t = m.eq(e),
  6917. i.removeClass("active recent"),
  6918. t.removeClass("active recent");
  6919. v(l, c)
  6920. }),
  6921. document.addEventListener("keydown", function(e) {
  6922. switch (R.updateInteraction(oe.InteractionKey),
  6923. e.which) {
  6924. case te.ZERO:
  6925. M.debug && s.toggleAlpha();
  6926. break;
  6927. case te.NINE:
  6928. M.debug && B.toggle();
  6929. break;
  6930. case te.ONE:
  6931. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6932. break;
  6933. case te.TWO:
  6934. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6935. break;
  6936. case te.THREE:
  6937. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6938. break;
  6939. case te.FOUR:
  6940. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6941. break;
  6942. case te.SPACE:
  6943. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6944. break;
  6945. case te.RETURN:
  6946. M.debug && s.toggleExplodeUp();
  6947. break;
  6948. case te.P:
  6949. !function(e) {
  6950. me.gui || (me.gui = function(e) {
  6951. var t = new he.GUI;
  6952. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6953. e.setSweepVisibility(M.showSweeps)
  6954. }),
  6955. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6956. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6957. M.transition.flySpeed = 0,
  6958. t.__controllers.forEach(function(e) {
  6959. e.updateDisplay()
  6960. })
  6961. }),
  6962. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6963. $(t.__closeButton).hide(),
  6964. t
  6965. }(me.model)),
  6966. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6967. }(!me.visible);
  6968. break;
  6969. case te.U:
  6970. !function(e) {
  6971. ve.gui || (ve.gui = function(t, i) {
  6972. function e() {
  6973. var e = i.toJSON();
  6974. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6975. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6976. }
  6977. var n = {}
  6978. , r = new he.GUI({
  6979. autoPlace: !0,
  6980. width: "60%"
  6981. });
  6982. return e(),
  6983. i.on(re.ViewChanged, e),
  6984. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6985. r.domElement.id = "datLinks",
  6986. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6987. if (!S.detectSafari()) {
  6988. var t = document.createElement("button");
  6989. t.classList.add("btn-deep-link"),
  6990. t.innerText = se.MENU_COPY,
  6991. e.nextSibling.appendChild(t);
  6992. var n = function() {
  6993. alert(se.LINK_ALERT_COPY),
  6994. t.hide()
  6995. };
  6996. t.addEventListener("click", function(e) {
  6997. try {
  6998. var t = e.target.parentNode.childNodes[0];
  6999. t.select();
  7000. var i = document.execCommand("copy");
  7001. t.blur(),
  7002. i || n()
  7003. } catch (e) {
  7004. n()
  7005. }
  7006. })
  7007. }
  7008. }),
  7009. $(r.__closeButton).hide(),
  7010. r
  7011. }(ve.model, ve.player)),
  7012. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7013. }(!ve.visible);
  7014. break;
  7015. case te.X:
  7016. M.debug && s.toggleExplode();
  7017. break;
  7018. case te.PLUSEQUALS:
  7019. l.player.activatePersistentZooming(!0),
  7020. O.hideUi();
  7021. break;
  7022. case te.DASHUNDERSCORE:
  7023. l.player.activatePersistentZooming(!1),
  7024. O.hideUi();
  7025. break;
  7026. case te.SEVEN:
  7027. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7028. break;
  7029. case te.EIGHT:
  7030. l.player.decreaseZoomSpeed();
  7031. break;
  7032. case te.NINE:
  7033. l.player.increaseZoomSpeed()
  7034. }
  7035. return c && c.reticule.hide(),
  7036. !0
  7037. }
  7038. .bind(this)),
  7039. document.addEventListener("keyup", function(e) {
  7040. switch (e.which) {
  7041. case te.PLUSEQUALS:
  7042. l.player.deactivatePersistentZooming();
  7043. break;
  7044. case te.DASHUNDERSCORE:
  7045. l.player.deactivatePersistentZooming()
  7046. }
  7047. }
  7048. .bind(this)),
  7049. function(e) {
  7050. me = {
  7051. gui: null,
  7052. visible: !1,
  7053. model: e
  7054. }
  7055. }(s),
  7056. function(e, t) {
  7057. ve = {
  7058. gui: null,
  7059. visible: !1,
  7060. model: e,
  7061. player: t
  7062. }
  7063. }(s, l.player),
  7064. function(e) {
  7065. function t(e, i) {
  7066. $(e).find("a").each(function(e, t) {
  7067. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7068. t.style.pointerEvents = i ? "auto" : "none"
  7069. })
  7070. }
  7071. e.on(de.ZoomMax, function() {
  7072. t("#gui-zoomin", !1),
  7073. t("#gui-zoomout", !0)
  7074. }),
  7075. e.on(de.ZoomMin, function() {
  7076. t("#gui-zoomin", !0),
  7077. t("#gui-zoomout", !1)
  7078. }),
  7079. e.on(de.ZoomIn, function() {
  7080. t("#gui-zoomout", !0)
  7081. }),
  7082. e.on(de.ZoomOut, function() {
  7083. t("#gui-zoomin", !0)
  7084. }),
  7085. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7086. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7087. }(c),
  7088. P.setAutoPlay(s.heroCount()),
  7089. U.init(c, i.mode),
  7090. U.on(H.OPENED, _e.bind(this, "help")),
  7091. W.init(),
  7092. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7093. function() {
  7094. _e("terms"),
  7095. V.open(o)
  7096. }
  7097. )),
  7098. W.on(j.CLOSED, V.reset),
  7099. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7100. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7101. M.profiling.enabled && B.show(),
  7102. q.init(l)
  7103. }
  7104. ,
  7105. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7106. function a() {
  7107. o.setLoadingStartTime(),
  7108. function() {
  7109. function e(e) {
  7110. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7111. }
  7112. $("body").css("touch-action", "none"),
  7113. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7114. var t = document.getElementById("terms-text")
  7115. , i = document.getElementById("more-help-wrapper")
  7116. , n = (document.getElementById("navigation-help-wrapper"),
  7117. document.getElementById("help-dialog"),
  7118. document.getElementById("tag-billboards"));
  7119. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7120. passive: !1
  7121. }),
  7122. document.body.addEventListener("DOMMouseScroll", e)),
  7123. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7124. e.stopPropagation()
  7125. })
  7126. }(),
  7127. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7128. l()) : function(e) {
  7129. L.show(e),
  7130. c()
  7131. }(l)
  7132. }
  7133. var s = $.Deferred()
  7134. , l = s.resolve.bind(s);
  7135. ye = !0,
  7136. _(e);
  7137. e.data.player_options && function(e) {
  7138. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7139. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7140. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7141. }(e.data.player_options),
  7142. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7143. se.localizeGUI();
  7144. !function(i) {
  7145. function e(e, t) {
  7146. return !!i.player_options[e] && i[t || e]
  7147. }
  7148. $(".model-title").text(i.name);
  7149. var t = M.pageTitle;
  7150. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7151. document.title = t,
  7152. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7153. delay: {
  7154. show: 50,
  7155. hide: 0
  7156. },
  7157. trigger: "hover",
  7158. html: !1,
  7159. viewport: {
  7160. selector: "body",
  7161. padding: 10
  7162. }
  7163. }),
  7164. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7165. z.populate({
  7166. name: e("model_name", "name"),
  7167. coBrand: e("presented_by"),
  7168. description: e("model_summary", "summary") || "暂无内容",
  7169. contactName: e("contact_name"),
  7170. address: e("address"),
  7171. phone: e("contact_phone"),
  7172. formattedPhone: i.formatted_contact_phone,
  7173. email: e("contact_email"),
  7174. url: e("external_url"),
  7175. socialSharing: i.enable_social_sharing && i.is_public
  7176. })
  7177. }(e.data);
  7178. r || $(".quick").addClass("hidden");
  7179. n ? (R.impression(),
  7180. a()) : (o.setWaitingStartTime(),
  7181. N.show(r, a))
  7182. return s
  7183. }
  7184. ,
  7185. Le.exports.endLoading = function(e, t, i) {
  7186. var n = t.player;
  7187. function r() {
  7188. i.dismissExaminedTag(),
  7189. i.disableHovering()
  7190. }
  7191. $("#gui-thumb").fadeOut(2500),
  7192. L.hide(function() {
  7193. ye = !1
  7194. }),
  7195. Y.init(e, i),
  7196. z.finishSetup(Object.keys(e.tags).length),
  7197. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7198. X.on(Z.OPENED, r),
  7199. K.on(ae.OPENED, r),
  7200. U.on(H.OPENED, r),
  7201. W.on(j.OPENED, r);
  7202. var o = i.enableHovering.bind(i);
  7203. if (X.on(Z.CLOSED, o),
  7204. K.on(ae.CLOSED, o),
  7205. U.on(H.CLOSED, o),
  7206. W.on(j.CLOSED, o),
  7207. M.labels.enabled && Object.keys(e.labels).length,
  7208. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7209. I(e.currentFloor, n.mode)),
  7210. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7211. h(e, t)),
  7212. c(),
  7213. v(t, t.player),
  7214. $("#gui").fadeIn(1500),
  7215. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7216. l(),
  7217. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7218. }, 2e3),
  7219. !S.isMobile())
  7220. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7221. $(a[s]).addClass("hasHover");
  7222. _(e),
  7223. z.setupToggling(),
  7224. window.editHotPanel && editHotPanel(),
  7225. function() {
  7226. var i = $("#pullTab")
  7227. , e = {
  7228. bottom: {
  7229. "border-bottom-left-radius": "10px",
  7230. "border-bottom-right-radius": "10px"
  7231. },
  7232. top: {
  7233. "border-top-left-radius": "10px",
  7234. "border-top-right-radius": "10px"
  7235. }
  7236. }
  7237. , t = {
  7238. bottom: {
  7239. "border-top-right-radius": "10px",
  7240. "border-bottom-right-radius": "10px"
  7241. },
  7242. top: {
  7243. "border-bottom-left-radius": "10px",
  7244. "border-top-left-radius": "10px"
  7245. }
  7246. };
  7247. function n(e, t) {
  7248. $("#gui-modes-map > div:visible:last").css(e),
  7249. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7250. }
  7251. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7252. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7253. }()
  7254. $(".toolRight a").removeClass('hasHover')
  7255. }
  7256. ,
  7257. Le.exports.onProgress = function(e) {
  7258. L.progress(e)
  7259. }
  7260. }
  7261. ).call(this, "/js/gui/gui.js")
  7262. }
  7263. , {
  7264. "../analytics": 4,
  7265. "../controls/serializer": 14,
  7266. "../enum/AlignmentType": 17,
  7267. "../enum/BlackoutStyle": 18,
  7268. "../enum/ControlEvents": 21,
  7269. "../enum/DirectorEvents": 23,
  7270. "../enum/Keys": 30,
  7271. "../enum/PathDiscardMode": 38,
  7272. "../enum/PathDisplayMode": 39,
  7273. "../enum/PlayerEvents": 40,
  7274. "../enum/VROption": 47,
  7275. "../enum/Vectors": 50,
  7276. "../enum/Viewmode": 51,
  7277. "../enum/WarpStyle": 52,
  7278. "../enum/ZoomEvents": 53,
  7279. "../lib/dat.gui": 93,
  7280. "../localization/localize": 108,
  7281. "../tag/Media/MediaEvent": 131,
  7282. "../objects/Snapshot": 153,
  7283. "../settings": 166,
  7284. "../util/ajax": 181,
  7285. "../util/browser": 182,
  7286. "../util/camera": 183,
  7287. "../util/logger": 189,
  7288. "../util/showcase": 193,
  7289. "../util/transitions": 195,
  7290. "./closer/ModalCloserEvent": 61,
  7291. "./closer/modalCloser": 62,
  7292. "./help/HelpEvent": 66,
  7293. "./help/help": 67,
  7294. "./helpManager": 68,
  7295. "./immersiveMode": 69,
  7296. "./konami": 70,
  7297. "./landingScreen": 71,
  7298. "./loadingScreen": 72,
  7299. "./memoryUsage": 73,
  7300. "./playButton": 74,
  7301. "./populateModal": 75,
  7302. "./sharing/ShareEvents": 76,
  7303. "./sharing/modal": 77,
  7304. "./terms/TermsEvent": 78,
  7305. "./terms/terms": 79,
  7306. "./title/TitleEvents": 80,
  7307. "./title/tagToggle": 81,
  7308. "./title/titleBar": 82,
  7309. "./tourInteraction": 84,
  7310. "./vr/vrEvent": 85,
  7311. "./vr/vrModal": 87,
  7312. "./webvr/WebVrEvent": 88,
  7313. "./webvr/webVRgui": 89,
  7314. three: 217
  7315. }],
  7316. 66: [function(e, t, i) {
  7317. "use strict";
  7318. t.exports = Object.freeze({
  7319. OPENED: "help.opened",
  7320. CLOSED: "help.closed"
  7321. })
  7322. }
  7323. , {}],
  7324. 67: [function(e, t, i) {
  7325. "use strict";
  7326. function n() {
  7327. p.on("click", function(e) {
  7328. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7329. setTimeout(function() {
  7330. x = !1
  7331. }, h.help.modalStayDuration),
  7332. S.emit(l.OPENED),
  7333. f.addClass("open " + T),
  7334. p.addClass("open"),
  7335. o(),
  7336. r(),
  7337. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7338. v.classList.add("fadeIn")))
  7339. }),
  7340. E.on("click", function(e) {
  7341. S.close()
  7342. }),
  7343. C.on("click", function(e) {
  7344. T && T !== a.TRANSITIONING && (o(),
  7345. r())
  7346. }),
  7347. I.on("click", function(e) {
  7348. o(),
  7349. I.addClass("underline-tab"),
  7350. c.fill(b, s.MORE_HELP),
  7351. f.addClass("more-help")
  7352. })
  7353. }
  7354. function r() {
  7355. C.addClass("underline-tab"),
  7356. c.fill(_, s.NAVIGATION, T),
  7357. f.addClass(T)
  7358. }
  7359. function o() {
  7360. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7361. A.forEach(function(e) {
  7362. e.classList.remove("underline-tab")
  7363. })
  7364. }
  7365. var a = e("../../enum/Viewmode")
  7366. , s = e("../../enum/HelpModalType")
  7367. , l = e("./HelpEvent")
  7368. , c = (e("../helpManager"),
  7369. e("./../populateModal"))
  7370. , h = e("../../settings")
  7371. , u = e("../../util/common")
  7372. , d = e("events").EventEmitter
  7373. , p = $(".footer-help").eq(0)
  7374. , f = $("#help-dialog").eq(0)
  7375. , g = document.querySelector("#quick-logo")
  7376. , m = document.querySelector("#loaderCoBrand")
  7377. , v = document.querySelector("#help-dialog")
  7378. , y = document.querySelector(".footer")
  7379. , A = $(".help-tabs").children().toArray()
  7380. , C = $(".navigation-tab").eq(0)
  7381. , I = $(".more-help-tab").eq(0)
  7382. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7383. f.find(".close").eq(0))
  7384. , _ = f.find(".interactions").toArray()
  7385. , b = f.find(".ui-instructions").toArray()
  7386. , w = a.PANORAMA
  7387. , T = a.PANORAMA
  7388. , x = !1
  7389. , S = {
  7390. init: function(e, t) {
  7391. w = T = t,
  7392. [v, m, g, y].forEach(function(e) {
  7393. e.classList.add(c.deviceType)
  7394. }),
  7395. n()
  7396. },
  7397. close: function() {
  7398. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7399. p.removeClass("open"),
  7400. f.removeClass("open"),
  7401. v.classList.contains("fadeIn"))) {
  7402. v.classList.remove("fadeIn");
  7403. var e = T === a.TRANSITIONING ? w : T;
  7404. c.clear(_, s.NAVIGATION, e)
  7405. }
  7406. },
  7407. updateMode: function(e) {
  7408. w = T,
  7409. T = e
  7410. }
  7411. };
  7412. u.extendObject(S, d.prototype),
  7413. t.exports = S
  7414. }
  7415. , {
  7416. "../../enum/HelpModalType": 28,
  7417. "../../enum/Viewmode": 51,
  7418. "../../settings": 166,
  7419. "../../util/common": 185,
  7420. "../helpManager": 68,
  7421. "./../populateModal": 75,
  7422. "./HelpEvent": 66,
  7423. events: 202
  7424. }],
  7425. 68: [function(s, l, e) {
  7426. (function(e) {
  7427. "use strict";
  7428. var t = s("../util/browser")
  7429. , i = s("./../util/logger")
  7430. , n = s("./../settings")
  7431. , r = new i(e)
  7432. , o = function() {
  7433. var t;
  7434. try {
  7435. return t = window.localStorage.getItem("visitCount") || "0",
  7436. t = (parseFloat(t) + 1).toString(),
  7437. window.localStorage.setItem("visitCount", t),
  7438. r.debug("visitCount = " + t),
  7439. t
  7440. } catch (e) {
  7441. t = "1",
  7442. r.debug("couldn't set local storage")
  7443. }
  7444. }()
  7445. , a = !1;
  7446. l.exports = {
  7447. isHelpDisabled: function() {
  7448. return "0" === t.valueFromHash("help", null) || a
  7449. },
  7450. isLargeHelpEnabled: function() {
  7451. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7452. },
  7453. isSmallHelpEnabled: function() {
  7454. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7455. },
  7456. isHelpEnabled: function() {
  7457. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7458. },
  7459. setAutoPlay: function(e) {
  7460. a = 0 <= n.warp.auto && 1 < e
  7461. }
  7462. }
  7463. }
  7464. ).call(this, "/js/gui/helpManager.js")
  7465. }
  7466. , {
  7467. "../util/browser": 182,
  7468. "./../settings": 166,
  7469. "./../util/logger": 189
  7470. }],
  7471. 69: [function(e, t, i) {
  7472. "use strict";
  7473. function r(e) {
  7474. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7475. T = !0,
  7476. h.close(),
  7477. function(e) {
  7478. !n(e) && S ? v.forEach(function(e) {
  7479. e.classList.remove("drawerOpen"),
  7480. e.classList.add("duringTour")
  7481. }) : C.hasClass("open") ? v.forEach(function(e) {
  7482. e.classList.remove("duringTour"),
  7483. e.classList.add("drawerOpen")
  7484. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7485. e.classList.add("fadeOut")
  7486. })
  7487. }(e),
  7488. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7489. C.hasClass("playing") || (y.forEach(function(e) {
  7490. e.classList.add("detectHover")
  7491. }),
  7492. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7493. }
  7494. function o() {
  7495. C.hasClass("playing") || (clearTimeout(x),
  7496. x = setTimeout(a, c.immersive.timeToShowAgain))
  7497. }
  7498. function a() {
  7499. clearTimeout(x),
  7500. T = !1,
  7501. m.forEach(function(e) {
  7502. e.classList.remove("drawerOpen")
  7503. }),
  7504. S || v.forEach(function(e) {
  7505. e.classList.remove("duringTour")
  7506. }),
  7507. y.forEach(function(e) {
  7508. e.classList.remove("detectHover")
  7509. })
  7510. }
  7511. function s() {
  7512. T ? a() : r(),
  7513. M = !0,
  7514. setTimeout(function() {
  7515. M = !1
  7516. }, c.immersive.uiStayDuration)
  7517. }
  7518. function n(e) {
  7519. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7520. }
  7521. var l = e("../util/browser")
  7522. , c = e("../settings")
  7523. , h = e("./help/help")
  7524. , u = e("../enum/tagEvents")
  7525. , d = e("../enum/ControlEvents")
  7526. , p = e("../enum/PlayerEvents")
  7527. , f = e("../enum/DirectorEvents")
  7528. , g = (p = e("../enum/PlayerEvents"),
  7529. e("../enum/Viewmode"))
  7530. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7531. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7532. , y = $("#hover-bottom, #hover-top").toArray()
  7533. , A = ($("#pullTab").eq(0),
  7534. $("#playHead").eq(0),
  7535. $(".pinBottom-container").eq(0))
  7536. , C = $("#drawer").eq(0)
  7537. , I = $("#drawer-container").eq(0)
  7538. , E = $("#meta-info").eq(0)
  7539. , _ = $(".pinTop.left").eq(0)
  7540. , b = $("#player").eq(0)
  7541. , w = document.getElementById("pullTab")
  7542. , T = !1
  7543. , x = null
  7544. , S = !1
  7545. , M = !1
  7546. , R = null
  7547. , P = !1;
  7548. t.exports.init = function(e, t, i, n) {
  7549. (function(t, i, e, n) {
  7550. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7551. t.controls[e].on(d.Move, r),
  7552. t.controls[e].on(d.LongTap, s)
  7553. }),
  7554. b.on("mousewheel DOMMouseScroll", r),
  7555. e.on(u.TagActivated, r),
  7556. e.on(u.TagNavigation, r),
  7557. i.on(p.FlyingEnded, o),
  7558. i.on(p.ModeChanging, function(e, t) {
  7559. P = t !== g.PANORAMA && e !== g.PANORAMA
  7560. }),
  7561. i.on(p.ModeChanged, function(e, t) {
  7562. R = i.mode,
  7563. t !== g.TRANSITIONING ? a() : r("modeChange")
  7564. }),
  7565. n.on(f.TourStart, function() {
  7566. S = !0,
  7567. r()
  7568. }),
  7569. n.on(f.TourEnd, function() {
  7570. S = !1,
  7571. a()
  7572. }),
  7573. n.on(f.ActionInterrupted, function() {
  7574. S = !1
  7575. }),
  7576. w.addEventListener("touchend", function() {
  7577. $("#pullTab").hasClass("opened") && !S && a()
  7578. }, !0)
  7579. }
  7580. )(e, t, i, n),
  7581. l.isMobile() ? (y.forEach(function(e) {
  7582. e.classList.add("mobile")
  7583. }),
  7584. A.click(a)) : (y.forEach(function(e) {
  7585. e.addEventListener("mouseleave", function() {
  7586. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7587. }, !0)
  7588. }),
  7589. b.mouseleave(function() {
  7590. y[0].classList.contains("detectHover") && a()
  7591. })),
  7592. R = t.mode
  7593. }
  7594. ,
  7595. t.exports.hideUi = r,
  7596. t.exports.resetDrawer = function() {
  7597. I.hasClass("duringTour") || (S = !1,
  7598. r("gui"),
  7599. a())
  7600. }
  7601. }
  7602. , {
  7603. "../enum/ControlEvents": 21,
  7604. "../enum/DirectorEvents": 23,
  7605. "../enum/tagEvents": 32,
  7606. "../enum/PlayerEvents": 40,
  7607. "../enum/Viewmode": 51,
  7608. "../settings": 166,
  7609. "../util/browser": 182,
  7610. "./help/help": 67
  7611. }],
  7612. 70: [function(i, n, e) {
  7613. (function(e) {
  7614. "use strict";
  7615. var t = i("./../util/logger")
  7616. , o = i("./../settings")
  7617. , a = i("./debug")
  7618. , s = i("./../util/common")
  7619. , l = (i("./gui"),
  7620. new t(e));
  7621. o.console && $("body").append('<div id="debug-console"></div>'),
  7622. n.exports.init = function(i, n, r) {
  7623. l.debug("konami has the modelInstance");
  7624. var t = [];
  7625. $(window).on("keydown", function(e) {
  7626. t.push(e.which),
  7627. t.length > o.secretPanelWord.length && t.shift(),
  7628. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7629. o.debug = !0)
  7630. }),
  7631. $(window).on("keydown", function e(t) {
  7632. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7633. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7634. })
  7635. }
  7636. }
  7637. ).call(this, "/js/gui/konami.js")
  7638. }
  7639. , {
  7640. "./../settings": 166,
  7641. "./../util/common": 185,
  7642. "./../util/logger": 189,
  7643. "./debug": 63,
  7644. "./gui": 65
  7645. }],
  7646. 71: [function(e, t, i) {
  7647. "use strict";
  7648. function r() {
  7649. s.clear(m, l.LANDING[v]),
  7650. g.removeClass("fadeIn")
  7651. }
  7652. var o = e("../settings")
  7653. , a = (e("./help/help"),
  7654. e("./helpManager"))
  7655. , s = e("./populateModal")
  7656. , l = e("../enum/HelpModalType")
  7657. , n = e("../enum/Viewmode")
  7658. , c = e("../enum/DirectorEvents")
  7659. , h = e("../enum/PlayerEvents")
  7660. , u = $("#quick-blackout").eq(0)
  7661. , d = $("#quick-logo").eq(0)
  7662. , p = $(".quick-brand").toArray()
  7663. , f = $("#loaderCoBrand").eq(0)
  7664. , g = $("#interaction-modal").eq(0)
  7665. , m = g.find(".interaction").toArray()
  7666. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7667. "");
  7668. t.exports.delayLanding = function(e) {
  7669. var t = $.Deferred();
  7670. e || t.resolve();
  7671. var i = o.startupFlyinDelay;
  7672. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7673. setTimeout(t.resolve.bind(t), i),
  7674. t
  7675. }
  7676. ,
  7677. t.exports.showMessage = function(e, t, i) {
  7678. var n = 0;
  7679. o.quickstart.enabled && (function(e) {
  7680. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7681. d.before(f),
  7682. p = $(".quick-brand").toArray()), */
  7683. u.addClass("fadeOut")
  7684. /* setTimeout(function() {
  7685. p.forEach(function(e) {
  7686. e.classList.add("fadeIn")
  7687. })
  7688. }, o.quickstart.showTextDelay),
  7689. setTimeout(function() {
  7690. p.forEach(function(e) {
  7691. e.classList.add("fadeOut")
  7692. })
  7693. }, o.quickstart.fadeOutDelay) */
  7694. }(i),
  7695. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7696. function(e, t) {
  7697. setTimeout(function() {
  7698. if (a.isHelpEnabled()) {
  7699. if (t(),
  7700. s.init(),
  7701. g.addClass("fadeIn landing " + s.deviceType),
  7702. a.isSmallHelpEnabled())
  7703. return void g.addClass("small");
  7704. s.fill(m, l.LANDING[v]),
  7705. g.addClass(v)
  7706. }
  7707. }, e);
  7708. var i = {
  7709. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7710. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7711. }
  7712. , n = $(".nav-icon .icon");
  7713. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7714. function r(e) {
  7715. e.on("click", function() {
  7716. var e = null;
  7717. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7718. i.length < e || e < 1)
  7719. return !1;
  7720. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7721. "data-page": e,
  7722. src: i.mobile[e - 1]
  7723. }) : n.attr({
  7724. "data-page": e,
  7725. src: i.pc[e - 1]
  7726. })
  7727. })
  7728. }
  7729. r($(".next-button")),
  7730. r($(".prev-button"))
  7731. }(n, function() {
  7732. e.once(h.Move, r),
  7733. t.once(c.TourStart, r)
  7734. })
  7735. }
  7736. ,
  7737. t.exports.init = function(e, t) {
  7738. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7739. }
  7740. ,
  7741. t.exports.dismissModal = r
  7742. }
  7743. , {
  7744. "../enum/DirectorEvents": 23,
  7745. "../enum/HelpModalType": 28,
  7746. "../enum/PlayerEvents": 40,
  7747. "../enum/Viewmode": 51,
  7748. "../settings": 166,
  7749. "./help/help": 67,
  7750. "./helpManager": 68,
  7751. "./populateModal": 75
  7752. }],
  7753. 72: [function(e, t, i) {
  7754. "use strict";
  7755. var n = e("./circleLoader").circleLoader;
  7756. t.exports = {
  7757. element: $("#gui-loading"),
  7758. hide: function(e) {
  7759. n.done(),
  7760. this.element.fadeOut(1500, e)
  7761. },
  7762. show: function(e) {
  7763. this.element.fadeIn(500, function() {
  7764. this.element.css("display", "table"),
  7765. e && e()
  7766. }
  7767. .bind(this))
  7768. },
  7769. progress: function(e) {
  7770. n.set(e)
  7771. }
  7772. }
  7773. }
  7774. , {
  7775. "./circleLoader": 60
  7776. }],
  7777. 73: [function(e, t, i) {
  7778. "use strict";
  7779. var n = e("../settings")
  7780. , r = $("#memory-info")
  7781. , o = r.find("#memory-gpu")
  7782. , a = !1;
  7783. t.exports = {
  7784. show: function() {
  7785. n.profiling.enabled && (r.show(),
  7786. a = !0)
  7787. },
  7788. hide: function() {
  7789. r.hide(),
  7790. a = !1
  7791. },
  7792. toggle: function() {
  7793. a ? this.hide() : this.show()
  7794. },
  7795. update: function(e) {
  7796. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7797. }
  7798. }
  7799. }
  7800. , {
  7801. "../settings": 166
  7802. }],
  7803. 74: [function(e, t, i) {
  7804. "use strict";
  7805. e("../util/browser"),
  7806. e("../analytics");
  7807. e("../settings"),
  7808. t.exports = {
  7809. show: function(e, t) {
  7810. $("#gui-message").fadeOut(500, function() {
  7811. t()
  7812. })
  7813. }
  7814. }
  7815. }
  7816. , {
  7817. "../analytics": 4,
  7818. "../settings": 166,
  7819. "../util/browser": 182
  7820. }],
  7821. 75: [function(e, t, i) {
  7822. "use strict";
  7823. function n(e, t, i, n) {
  7824. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7825. }
  7826. var r = e("../util/browser")
  7827. , o = e("../localization/localize")
  7828. , a = e("../enum/HelpModalType")
  7829. , s = (e("../enum/HelpModalSize"),
  7830. e("../enum/Viewmode"));
  7831. t.exports = {
  7832. init: function() {
  7833. if (!this.hasInitialized) {
  7834. this.hasInitialized = !0,
  7835. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7836. this.assets = {},
  7837. this.assets[a.LANDING[s.PANORAMA]] = {
  7838. desktop: {
  7839. left: {
  7840. "top-info": o.ROTATE,
  7841. "big-image": "images/nav_help_mouse_drag_left.png",
  7842. keyboard: "images/nav_help_keyboard_left_right.png"
  7843. },
  7844. middle: {
  7845. "top-info": o.MOVE,
  7846. "big-image": "images/nav_help_mouse_click.png",
  7847. keyboard: "images/nav_help_keyboard_up_down.png"
  7848. },
  7849. right: {
  7850. "top-info": o.ZOOM,
  7851. "big-image": "images/nav_help_mouse_zoom.png",
  7852. keyboard: "images/nav_help_zoom_keys.png"
  7853. }
  7854. },
  7855. mobile: {
  7856. left: {
  7857. "top-info": o.ROTATE,
  7858. "big-image": "images/nav_help_gesture_drag.png"
  7859. },
  7860. middle: {
  7861. "top-info": o.MOVE,
  7862. "big-image": "images/nav_help_gesture_tap.png"
  7863. },
  7864. right: {
  7865. "top-info": o.ZOOM,
  7866. "big-image": "images/nav_help_gesture_pinch.png"
  7867. }
  7868. }
  7869. },
  7870. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7871. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7872. desktop: {
  7873. left: {
  7874. "top-info": o.ROTATE,
  7875. "big-image": "images/nav_help_mouse_drag_left.png",
  7876. keyboard: "images/nav_help_keyboard_left_right.png"
  7877. },
  7878. middle: {
  7879. "top-info": o.MOVE,
  7880. "big-image": "images/nav_help_mouse_position_right.png"
  7881. }
  7882. },
  7883. mobile: {
  7884. left: {
  7885. "top-info": o.ROTATE,
  7886. "big-image": "images/nav_help_gesture_drag.png"
  7887. },
  7888. middle: {
  7889. "top-info": o.MOVE,
  7890. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7891. }
  7892. }
  7893. },
  7894. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7895. desktop: {
  7896. left: {
  7897. "top-info": o.MOVE,
  7898. "big-image": "images/nav_help_mouse_position_left.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.ROTATE,
  7902. "big-image": "images/nav_help_mouse_drag_right.png",
  7903. keyboard: "images/nav_help_keyboard_left_right.png"
  7904. }
  7905. },
  7906. mobile: {
  7907. left: {
  7908. "top-info": o.MOVE,
  7909. "big-image": "images/nav_help_gesture_position.png"
  7910. },
  7911. middle: {
  7912. "top-info": o.ROTATE,
  7913. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7914. }
  7915. }
  7916. };
  7917. var e = {
  7918. "top-info": o.INSIDE,
  7919. "big-image": "images/nav_help_click_inside.png",
  7920. keyboard: "images/nav_help_inside_key.png"
  7921. };
  7922. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7923. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7924. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7925. var t = {
  7926. "top-info": o.INSIDE,
  7927. "big-image": "images/nav_help_tap_inside.png"
  7928. };
  7929. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7930. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7931. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7932. this.assets[a.NAVIGATION] = {},
  7933. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7934. desktop: {
  7935. left: {
  7936. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7937. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7938. "big-image": "images/nav_help_mouse_drag_left.png",
  7939. keyboard: "images/nav_help_keyboard_left_right.png"
  7940. },
  7941. middle: {
  7942. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7943. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7944. "big-image": "images/nav_help_mouse_click.png",
  7945. keyboard: "images/nav_help_keyboard_up_down.png"
  7946. },
  7947. right: {
  7948. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7949. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7950. "big-image": "images/nav_help_mouse_zoom.png",
  7951. keyboard: "images/nav_help_zoom_keys.png"
  7952. }
  7953. },
  7954. mobile: {
  7955. left: {
  7956. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7957. "big-image": "images/nav_help_gesture_drag.png"
  7958. },
  7959. middle: {
  7960. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7961. "big-image": "images/nav_help_gesture_tap.png"
  7962. },
  7963. right: {
  7964. "top-info": o.HELP_MOBILE_3,
  7965. "big-image": "images/nav_help_gesture_pinch.png"
  7966. }
  7967. }
  7968. },
  7969. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7970. desktop: {
  7971. left: {
  7972. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7973. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7974. "big-image": "images/nav_help_mouse_drag_left.png",
  7975. keyboard: "images/nav_help_keyboard_all.png"
  7976. },
  7977. middle: {
  7978. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7979. "big-image": "images/nav_help_mouse_position_right.png"
  7980. },
  7981. right: {
  7982. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7983. "big-image": "images/nav_help_mouse_zoom.png"
  7984. }
  7985. },
  7986. mobile: {
  7987. left: {
  7988. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7989. "big-image": "images/nav_help_gesture_drag.png"
  7990. },
  7991. middle: {
  7992. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7993. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7994. },
  7995. right: {
  7996. "top-info": o.HELP_MOBILE_3,
  7997. "big-image": "images/nav_help_gesture_pinch.png"
  7998. }
  7999. }
  8000. },
  8001. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8002. desktop: {
  8003. left: {
  8004. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8005. "big-image": "images/nav_help_mouse_position_left.png"
  8006. },
  8007. middle: {
  8008. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8009. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8010. "big-image": "images/nav_help_mouse_drag_right.png",
  8011. keyboard: "images/nav_help_keyboard_left_right.png"
  8012. },
  8013. right: {
  8014. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8015. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8016. "big-image": "images/nav_help_mouse_zoom.png",
  8017. keyboard: "images/nav_help_keyboard_up_down.png"
  8018. }
  8019. },
  8020. mobile: {
  8021. left: {
  8022. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8023. "big-image": "images/nav_help_gesture_position.png"
  8024. },
  8025. middle: {
  8026. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8027. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8028. },
  8029. right: {
  8030. "top-info": o.HELP_MOBILE_3,
  8031. "big-image": "images/nav_help_gesture_pinch.png"
  8032. }
  8033. }
  8034. },
  8035. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8036. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8037. "top-info": o.HELP_DESKTOP_360_2A,
  8038. "bottom-info": o.HELP_DESKTOP_360_2B,
  8039. "big-image": "images/nav_help_click_inside.png",
  8040. keyboard: "images/nav_help_inside_key.png"
  8041. },
  8042. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8043. "top-info": o.HELP_MOBILE_360_2,
  8044. "big-image": "images/nav_help_tap_inside.png"
  8045. },
  8046. this.assets[a.MORE_HELP] = {
  8047. desktop: {
  8048. "more-help-hlr": {
  8049. "top-info": o.HELP_MORE_HLR_A,
  8050. "big-image": "images/nav_help_expand.svg",
  8051. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8052. },
  8053. "more-help-dollhouse": {
  8054. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8055. "big-image": "images/nav_help_dollhouse.svg",
  8056. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8057. },
  8058. "more-help-floors": {
  8059. "top-info": o.HELP_MORE_FLOORS_A,
  8060. "big-image": "images/nav_help_floor picker.svg",
  8061. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8062. },
  8063. "more-help-tag": {
  8064. "top-info": o.HELP_MORE_TAG_A,
  8065. "big-image": "images/nav_help_tag.svg",
  8066. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8067. },
  8068. "more-help-zoom": {
  8069. "top-info": o.HELP_MORE_ZOOM_A,
  8070. "big-image": "images/nav_help_zoom.svg",
  8071. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8072. },
  8073. "more-help-tour": {
  8074. "top-info": o.HELP_MORE_TOUR_A,
  8075. "big-image": "images/nav_help_play.png",
  8076. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8077. },
  8078. "more-help-inside": {
  8079. "top-info": o.HELP_MORE_INSIDE_A,
  8080. "big-image": "images/nav_help_inside.svg",
  8081. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8082. },
  8083. "more-help-vr": {
  8084. "top-info": o.HELP_MORE_VR_A,
  8085. "big-image": "images/nav_help_vr.svg",
  8086. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8087. },
  8088. "more-help-360": {
  8089. "top-info": o.HELP_MORE_360_A,
  8090. "big-image": "images/nav_help_360.svg",
  8091. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8092. },
  8093. "more-help-fullscreen": {
  8094. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8095. "big-image": "images/nav_help_fullscreen.svg",
  8096. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8097. }
  8098. },
  8099. mobile: {
  8100. "more-help-hlr": {
  8101. "top-info": o.HELP_MORE_HLR_A,
  8102. "big-image": "images/nav_help_expand.svg",
  8103. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8104. },
  8105. "more-help-dollhouse": {
  8106. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8107. "big-image": "images/nav_help_dollhouse.svg",
  8108. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8109. },
  8110. "more-help-floors": {
  8111. "top-info": o.HELP_MORE_FLOORS_A,
  8112. "big-image": "images/nav_help_floor picker.svg",
  8113. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8114. },
  8115. "more-help-tag": {
  8116. "top-info": o.HELP_MORE_TAG_A,
  8117. "big-image": "images/nav_help_tag.svg",
  8118. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8119. },
  8120. "more-help-tour": {
  8121. "top-info": o.HELP_MORE_TOUR_A,
  8122. "big-image": "images/nav_help_play.png",
  8123. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8124. },
  8125. "more-help-inside": {
  8126. "top-info": o.HELP_MORE_INSIDE_A,
  8127. "big-image": "images/nav_help_inside.svg",
  8128. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8129. },
  8130. "more-help-vr": {
  8131. "top-info": o.HELP_MORE_VR_A,
  8132. "big-image": "images/webvr.svg",
  8133. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8134. },
  8135. "more-help-360": {
  8136. "top-info": o.HELP_MORE_360_A,
  8137. "big-image": "images/nav_help_360.svg",
  8138. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8139. }
  8140. }
  8141. },
  8142. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8143. desktop: {
  8144. left: {
  8145. "top-info": o.ROTATE,
  8146. "big-image": "images/nav_help_mouse_drag_left.png",
  8147. keyboard: "images/nav_help_keyboard_left_right.png"
  8148. },
  8149. middle: {
  8150. "top-info": o.MOVE,
  8151. "big-image": "images/nav_help_mouse_click.png",
  8152. keyboard: "images/nav_help_keyboard_up_down.png"
  8153. },
  8154. right: {
  8155. "top-info": o.PLAY,
  8156. "big-image": "images/Desktop-help-play-button.svg",
  8157. keyboard: "images/Desktop-help-spacebar-2.svg"
  8158. }
  8159. },
  8160. mobile: {
  8161. left: {
  8162. "top-info": o.ROTATE,
  8163. "big-image": "images/nav_help_gesture_drag.png"
  8164. },
  8165. middle: {
  8166. "top-info": o.MOVE,
  8167. "big-image": "images/nav_help_gesture_tap.png"
  8168. },
  8169. right: {
  8170. "top-info": o.PLAY,
  8171. "big-image": "images/mobile-help-play-button.svg"
  8172. }
  8173. }
  8174. },
  8175. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8176. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8177. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8178. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8179. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8180. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8181. }
  8182. },
  8183. fill: function(e, t, i) {
  8184. n.call(this, e, t, i, !0)
  8185. },
  8186. clear: function(e, t, i) {
  8187. n.call(this, e, t, i, !1)
  8188. }
  8189. }
  8190. }
  8191. , {
  8192. "../enum/HelpModalSize": 27,
  8193. "../enum/HelpModalType": 28,
  8194. "../enum/Viewmode": 51,
  8195. "../localization/localize": 108,
  8196. "../util/browser": 182
  8197. }],
  8198. 76: [function(e, t, i) {
  8199. "use strict";
  8200. t.exports = Object.freeze({
  8201. OPENED: "share.open",
  8202. CLOSED: "share.closed",
  8203. LINK_CLICKED: "share.linked"
  8204. })
  8205. }
  8206. , {}],
  8207. 77: [function(e, t, i) {
  8208. "use strict";
  8209. function n(n) {
  8210. function e(e, t) {
  8211. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8212. I.emit(l.LINK_CLICKED, {
  8213. channel: n
  8214. }),
  8215. window.open(C[n], "shareWindow", i)
  8216. }
  8217. switch (n) {
  8218. case A.FACEBOOK:
  8219. e(580, 420);
  8220. break;
  8221. case A.TWITTER:
  8222. e(550, 440);
  8223. break;
  8224. case A.MAIL:
  8225. I.emit(l.LINK_CLICKED, {
  8226. channel: "email"
  8227. }),
  8228. window.open(C[n], "_blank");
  8229. break;
  8230. case A.LINKEDIN:
  8231. }
  8232. }
  8233. function r(e) {
  8234. I.emit(l.LINK_CLICKED, {
  8235. channel: "copylink"
  8236. });
  8237. var t = document.createRange();
  8238. t.selectNodeContents(v);
  8239. var i = window.getSelection();
  8240. i.removeAllRanges(),
  8241. i.addRange(t),
  8242. document.execCommand("copy"),
  8243. y.classList.remove("hidden"),
  8244. v.classList.add("highlighted")
  8245. }
  8246. function o(e) {
  8247. e && (e.stopPropagation(),
  8248. e.target === v) || (window.getSelection().removeAllRanges(),
  8249. v.classList.remove("highlighted"),
  8250. y.classList.add("hidden"))
  8251. }
  8252. var a = e("../../util/browser")
  8253. , s = e("../../localization/localize")
  8254. , l = e("./ShareEvents")
  8255. , c = e("../../util/common")
  8256. , h = e("events").EventEmitter
  8257. , u = document.getElementById("sharing")
  8258. , d = document.getElementById("share-modal")
  8259. , p = document.getElementById("share-close")
  8260. , f = document.getElementById("facebook-share")
  8261. , g = document.getElementById("twitter-share")
  8262. , m = document.getElementById("mail-share")
  8263. , v = document.getElementById("share-url-text")
  8264. , y = document.getElementById("copy-success")
  8265. , A = Object.freeze({
  8266. FACEBOOK: "facebook",
  8267. TWITTER: "twitter",
  8268. MAIL: "mail",
  8269. LINKEDIN: "linkedin"
  8270. })
  8271. , C = {};
  8272. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8273. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8274. C[A.MAIL] = "mailto:?subject=";
  8275. var I = {
  8276. init: function(e) {
  8277. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8278. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8279. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8280. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8281. u.addEventListener("click", this.toggle.bind(this)),
  8282. p.addEventListener("click", this.hide.bind(this)),
  8283. v.addEventListener("click", r),
  8284. d.addEventListener("click", o),
  8285. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8286. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8287. m.addEventListener("click", n.bind(this, A.MAIL)),
  8288. v.textContent = window.location.href + "&utm_source=4",
  8289. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8290. u.classList.remove("hidden")
  8291. },
  8292. show: function() {
  8293. this.emit(l.OPENED),
  8294. d.classList.add("fadeIn")
  8295. },
  8296. hide: function() {
  8297. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8298. document.selection && document.selection.empty(),
  8299. window.getSelection().removeAllRanges(),
  8300. o(),
  8301. d.classList.remove("fadeIn"))
  8302. },
  8303. toggle: function() {
  8304. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8305. }
  8306. };
  8307. c.extendObject(I, h.prototype),
  8308. t.exports = I
  8309. }
  8310. , {
  8311. "../../localization/localize": 108,
  8312. "../../util/browser": 182,
  8313. "../../util/common": 185,
  8314. "./ShareEvents": 76,
  8315. events: 202
  8316. }],
  8317. 78: [function(e, t, i) {
  8318. "use strict";
  8319. t.exports = Object.freeze({
  8320. OPENED: "terms.opened",
  8321. CLOSED: "terms.closed"
  8322. })
  8323. }
  8324. , {}],
  8325. 79: [function(e, t, i) {
  8326. "use strict";
  8327. var n = e("./TermsEvent")
  8328. , r = e("../../localization/localize")
  8329. , o = e("../../analytics")
  8330. , a = e("../../util/ajax")
  8331. , s = e("../../util/common")
  8332. , l = e("events").EventEmitter
  8333. , c = document.getElementById("terms-modal")
  8334. , h = {
  8335. init: function() {
  8336. $(".footer-terms").on("click", function(e) {
  8337. e.preventDefault(),
  8338. this.show()
  8339. }
  8340. .bind(this)),
  8341. $("#terms-modal .close").on("click", this.hide.bind(this))
  8342. },
  8343. show: function() {
  8344. this.emit(n.OPENED),
  8345. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8346. var t = $("#terms-text").html(e);
  8347. o.track("showcase_gui", {
  8348. gui_action: "click_terms_button",
  8349. interaction_source: "gui"
  8350. }),
  8351. t.find("a").attr("target", "_blank")
  8352. }).fail(function() {
  8353. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8354. }),
  8355. c.classList.add("fadeIn")
  8356. },
  8357. hide: function(e) {
  8358. e && e.preventDefault(),
  8359. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8360. c.classList.remove("fadeIn")
  8361. }
  8362. };
  8363. s.extendObject(h, l.prototype),
  8364. t.exports = h
  8365. }
  8366. , {
  8367. "../../analytics": 4,
  8368. "../../localization/localize": 108,
  8369. "../../util/ajax": 181,
  8370. "../../util/common": 185,
  8371. "./TermsEvent": 78,
  8372. events: 202
  8373. }],
  8374. 80: [function(e, t, i) {
  8375. "use strict";
  8376. t.exports = Object.freeze({
  8377. OPEN_INFO: "title.open.info",
  8378. CLOSE_INFO: "title.close.info",
  8379. SHOW_INFO: "title.show.info",
  8380. HIDE_INFO: "title.hide.info",
  8381. LINK_CLICKED: "title.link.click",
  8382. CONTACT_LINK_CLICKED: "title.contact.click",
  8383. ORIGIN_LINK_CLICKED: "title.origin.click"
  8384. })
  8385. }
  8386. , {}],
  8387. 81: [function(e, t, i) {
  8388. "use strict";
  8389. var o = e("../../settings");
  8390. t.exports.init = function(e, t) {
  8391. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8392. function e(e) {
  8393. t.shouldShowtags = "show" === this.value,
  8394. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8395. }
  8396. document.getElementById("tag-toggles").classList.remove("hidden"),
  8397. document.getElementById("radio-tag-show").checked = !0;
  8398. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8399. n[r].addEventListener("change", e)
  8400. }(e, t)
  8401. }
  8402. }
  8403. , {
  8404. "../../settings": 166
  8405. }],
  8406. 82: [function(S, M, e) {
  8407. (function(e) {
  8408. "use strict";
  8409. function i(e) {
  8410. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8411. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8412. _.appendChild(function(e) {
  8413. var t = document.createElement("a");
  8414. return t.id = "url",
  8415. t.target = "_blank",
  8416. t.href = e,
  8417. t.innerText = e,
  8418. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8419. t
  8420. }(e)),
  8421. b.forEach(function(e) {
  8422. e.classList.add("share-link")
  8423. }),
  8424. 0))
  8425. }
  8426. function s(e, t) {
  8427. var i = e
  8428. , n = t;
  8429. return function(e, t) {
  8430. i.push(t || n, e)
  8431. }
  8432. }
  8433. var l = S("../../util/browser")
  8434. , t = S("../../util/common")
  8435. , n = S("../../util/logger")
  8436. , r = S("../../localization/localize")
  8437. , o = S("./titleBarSettings")
  8438. , c = S("../../settings")
  8439. , a = S("./TitleEvents")
  8440. , h = S("events").EventEmitter
  8441. , u = new n(e)
  8442. , d = document.querySelector(".pinTop.left")
  8443. , p = document.getElementsByClassName("title-container")[0]
  8444. , f = document.getElementById("title-toggle").querySelector("i")
  8445. , g = document.getElementById("meta-info-wrapper")
  8446. , m = document.getElementById("meta-info")
  8447. , v = document.getElementById("meta-description")
  8448. , y = document.getElementsByClassName("contact-info")[0]
  8449. , A = document.getElementById("contact-data")
  8450. , C = document.getElementById("addressTxt")
  8451. , I = document.getElementById("tag-toggles")
  8452. , E = document.getElementById("share-origin")
  8453. , _ = document.getElementById("share-link-wrapper")
  8454. , b = [m, g, p]
  8455. , w = !1
  8456. , T = !1
  8457. , x = {
  8458. populate: function(e) {
  8459. if (function(e, t) {
  8460. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8461. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8462. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8463. document.getElementById("gui-name").classList.add("noCoBrand"),
  8464. document.getElementById("cobrandTitle").classList.add("hidden")),
  8465. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8466. !1)
  8467. }(DATA.name, e.coBrand)) {
  8468. if (function(e) {
  8469. e ? (w = !0,
  8470. v.innerHTML = e) : v.classList.add("hidden")
  8471. }(e.description),
  8472. function(e, t, i, n) {
  8473. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8474. w = !0;
  8475. var r = []
  8476. , o = s(r, "<br>");
  8477. if (e && o('<span id="contactName">' + e + "</span>"),
  8478. t) {
  8479. var a = n || t;
  8480. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8481. }
  8482. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8483. r[0] = "",
  8484. A.innerHTML = r.join("")
  8485. } else
  8486. y.classList.add("hidden")
  8487. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8488. function(e) {
  8489. if ("string" == typeof e)
  8490. try {
  8491. e = JSON.parse(e)
  8492. } catch (e) {
  8493. return u.warn("Unable to parse address data"),
  8494. C.parentElement.classList.add("hidden")
  8495. }
  8496. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8497. w = !0;
  8498. var t = []
  8499. , i = s(t, " ");
  8500. e.address_1 && i(e.address_1),
  8501. e.address_2 && i(e.address_2),
  8502. e.city && i(e.city, ", "),
  8503. e.state && i(e.state, ", "),
  8504. e.zip && i(e.zip, e.state ? " " : ", "),
  8505. t[0] = "",
  8506. C.innerText = t.join("")
  8507. } else
  8508. C.parentElement.classList.add("hidden")
  8509. }(e.address),
  8510. w) {
  8511. var t = document.createElement("br");
  8512. I.insertBefore(t, I.firstElementChild)
  8513. }
  8514. e.socialSharing && c.share.enabled && (T = i(e.url))
  8515. }
  8516. },
  8517. finishSetup: function(e) {
  8518. w = w || !!e,
  8519. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8520. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8521. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8522. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8523. }),
  8524. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8525. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8526. contact_type: e.getAttribute("id")
  8527. }))
  8528. }),
  8529. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8530. },
  8531. toggleMeta: function(e, t) {
  8532. var i = document.getElementById("model-title");
  8533. t && t.preventDefault();
  8534. var n = m.classList.contains("expand");
  8535. e && !n || (n ? (b.forEach(function(e) {
  8536. e.classList.remove("expand")
  8537. }),
  8538. this.emit(a.CLOSE_INFO),
  8539. i.classList.remove("expand")) : (b.forEach(function(e) {
  8540. e.classList.add("expand")
  8541. }),
  8542. i.classList.add("expand"),
  8543. this.emit(a.OPEN_INFO)))
  8544. },
  8545. setupToggling: function() {
  8546. g.style.height = m.offsetHeight + "px",
  8547. m.addEventListener("transitionend", function() {
  8548. g.style.height = m.offsetHeight + "px"
  8549. })
  8550. },
  8551. toggleTitle: function(e) {
  8552. e && e.preventDefault(),
  8553. d.classList.contains("closed") ? (d.classList.add("open"),
  8554. f.classList.remove("icon-dpad-right"),
  8555. f.classList.add("icon-dpad-left"),
  8556. this.emit(a.SHOW_INFO),
  8557. setTimeout(function() {
  8558. d.classList.remove("closed"),
  8559. d.classList.remove("open")
  8560. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8561. f.classList.remove("icon-dpad-left"),
  8562. f.classList.add("icon-dpad-right"),
  8563. this.emit(a.HIDE_INFO))
  8564. }
  8565. };
  8566. t.extendObject(x, h.prototype),
  8567. M.exports = x
  8568. }
  8569. ).call(this, "/js/gui/title/titleBar.js")
  8570. }
  8571. , {
  8572. "../../localization/localize": 108,
  8573. "../../settings": 166,
  8574. "../../util/browser": 182,
  8575. "../../util/common": 185,
  8576. "../../util/logger": 189,
  8577. "./TitleEvents": 80,
  8578. "./titleBarSettings": 83,
  8579. events: 202
  8580. }],
  8581. 83: [function(e, t, i) {
  8582. "use strict";
  8583. t.exports = Object.freeze({
  8584. minTooltipCharacters: 19,
  8585. removeAnimationClasses: 500
  8586. })
  8587. }
  8588. , {}],
  8589. 84: [function(e, t, i) {
  8590. "use strict";
  8591. function n() {
  8592. v.playTour(),
  8593. y && clearTimeout(y),
  8594. c(),
  8595. E.removeClass("fadeIn")
  8596. }
  8597. function r() {
  8598. A.classList.contains("playing") && (v.stopTour(),
  8599. E.addClass("fadeIn"),
  8600. setTimeout(function() {
  8601. E.removeClass("fadeIn")
  8602. }, h.tourInteraction.showPauseButton),
  8603. M || (clearTimeout(y),
  8604. y = setTimeout(s, h.tourInteraction.showModal)),
  8605. setTimeout(function() {
  8606. A.classList.remove("playing")
  8607. }, h.tourInteraction.allowNextClick))
  8608. }
  8609. function o() {
  8610. v.tourInProgress && (v.stopTour(),
  8611. v.endTourProgress(),
  8612. A.classList.remove("playing"))
  8613. }
  8614. function a() {
  8615. _.is(":visible") ? n() : r()
  8616. }
  8617. function s() {//去掉导览结束时的提示
  8618. /* if (!h.tourInteraction.disabled) {
  8619. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8620. T.addClass("fadeIn tour " + p.deviceType);
  8621. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8622. if (!h.tourInteraction.smallModal)
  8623. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8624. p.fill(x, g.TOUR_INTERACTION[e]),
  8625. T.addClass(e);
  8626. T.addClass(t)
  8627. } */
  8628. }
  8629. function l(e, t) {
  8630. if (t) {
  8631. var i = "keydown" === t.type
  8632. , n = t.which === u.SPACE || v.tourIsPlaying;
  8633. i && n || e || (M = !0),
  8634. v.atEndOfTour() && c(),
  8635. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8636. c(),
  8637. t.which !== u.SPACE && o()),
  8638. i && n && a()
  8639. }
  8640. }
  8641. function c() {
  8642. T.removeClass("fadeIn")
  8643. }
  8644. var h = (e("../util/browser"),
  8645. e("../settings"))
  8646. , u = e("../enum/Keys")
  8647. , d = e("../enum/Viewmode")
  8648. , p = (e("./helpManager"),
  8649. e("./populateModal"))
  8650. , f = e("../enum/DirectorEvents")
  8651. , g = e("../enum/HelpModalType")
  8652. , m = e("../enum/HelpModalSize")
  8653. , v = null
  8654. , y = null
  8655. , A = document.getElementById("pause-overlay")
  8656. , C = document.getElementById("player")
  8657. , I = document.getElementById("gui")
  8658. , E = $("#pause-icon").eq(0)
  8659. , _ = $("#play").eq(0)
  8660. , b = $("#playHead").eq(0)
  8661. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8662. , T = $("#interaction-modal").eq(0)
  8663. , x = $("#interaction-modal .interaction").toArray()
  8664. , S = ["touchstart", "mousedown", "pointerdown"]
  8665. , M = !1;
  8666. t.exports.init = function(e) {
  8667. v = e,
  8668. S.forEach(function(t) {
  8669. C.addEventListener(t, l.bind(this, !1), !0),
  8670. I.addEventListener(t, l.bind(this, !0), !0),
  8671. A.addEventListener(t, r, !0),
  8672. w.forEach(function(e) {
  8673. e.addEventListener(t, o, !0)
  8674. }),
  8675. $("#drawer img").on(t, o)
  8676. }),
  8677. document.addEventListener("keydown", l.bind(this, !1), !0),
  8678. v.on(f.TourStart, function() {
  8679. A.classList.add("playing")
  8680. })
  8681. }
  8682. ,
  8683. t.exports.play = n,
  8684. t.exports.pause = r,
  8685. t.exports.pauseWithoutCTA = o,
  8686. t.exports.togglePlay = a,
  8687. t.exports.stopTour = function() {
  8688. b.hasClass("playing") && (clearTimeout(y),
  8689. v.atEndOfTour() ? (A.classList.remove("playing"),
  8690. s()) : E.removeClass("fadeIn"))
  8691. }
  8692. ,
  8693. t.exports.dismissModal = c
  8694. }
  8695. , {
  8696. "../enum/DirectorEvents": 23,
  8697. "../enum/HelpModalSize": 27,
  8698. "../enum/HelpModalType": 28,
  8699. "../enum/Keys": 30,
  8700. "../enum/Viewmode": 51,
  8701. "../settings": 166,
  8702. "../util/browser": 182,
  8703. "./helpManager": 68,
  8704. "./populateModal": 75
  8705. }],
  8706. 85: [function(e, t, i) {
  8707. "use strict";
  8708. t.exports = Object.freeze({
  8709. OPENED: "vr.modal.opened",
  8710. LAUNCH: "vr.modal.launch",
  8711. CLOSED: "vr.modal.closed",
  8712. NEXT: "vr.modal.next",
  8713. PREV: "vr.modal.prev",
  8714. STORE: "vr.modal.store",
  8715. falseICECHOSEN: "vr.modal.device"
  8716. })
  8717. }
  8718. , {}],
  8719. 86: [function(e, t, i) {
  8720. "use strict";
  8721. var h = e("../../util/browser")
  8722. , u = e("../../enum/VRApps")
  8723. , n = e("../../enum/VRPlatforms")
  8724. , d = e("../../util/ajax")
  8725. , p = e("../../settings")
  8726. , r = {};
  8727. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8728. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8729. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8730. u) {
  8731. var a = u[o];
  8732. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8733. }
  8734. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8735. "https://" + s);
  8736. t.exports.init = function(e, t, o) {
  8737. function a(e, t, i, n) {
  8738. function r() {
  8739. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8740. }
  8741. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8742. }
  8743. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8744. , l = g + "/vr/dlist/?ret=" + s
  8745. , c = g + "/vr/show/?ret=" + s;
  8746. switch (e) {
  8747. case n.IOS:
  8748. !function(t, e, i, n) {
  8749. var r = a(t, e, i, n)
  8750. , o = {
  8751. responseType: "json",
  8752. data: {
  8753. branch_key: p.appConfig.branch_key,
  8754. data: {
  8755. m: e,
  8756. full_url: r,
  8757. $desktop_url: "",
  8758. $og_app_id: "331853976762864119",
  8759. $og_title: i,
  8760. $og_description: n,
  8761. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8762. $canonical_url: window.location.href
  8763. }
  8764. }
  8765. };
  8766. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8767. f[t] = e.url
  8768. }).fail(function(e) {
  8769. f[t] = e
  8770. }
  8771. .bind(this, r))
  8772. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8773. break;
  8774. default:
  8775. !function(e, t, i) {
  8776. for (var n in u) {
  8777. var r = u[n]
  8778. , o = a(r, e, t, i);
  8779. f[r] = o
  8780. }
  8781. }(t.sid, t.name, t.summary)
  8782. }
  8783. }
  8784. ,
  8785. t.exports.launch = function(e) {
  8786. var t = f[e];
  8787. window.open(t, "_blank")
  8788. }
  8789. ,
  8790. t.exports.launchStore = function(e) {
  8791. var t = r[e];
  8792. window.open(t, "_blank")
  8793. }
  8794. }
  8795. , {
  8796. "../../enum/VRApps": 46,
  8797. "../../enum/VRPlatforms": 49,
  8798. "../../settings": 166,
  8799. "../../util/ajax": 181,
  8800. "../../util/browser": 182
  8801. }],
  8802. 87: [function(e, t, i) {
  8803. "use strict";
  8804. function c(e) {
  8805. var t;
  8806. switch (e) {
  8807. case y.IOS:
  8808. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8809. case y.Android:
  8810. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8811. }
  8812. return !1
  8813. }
  8814. function h(e) {
  8815. switch (e) {
  8816. case y.Android:
  8817. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8818. x.filter(".gearvr").off().on("click", q.gear),
  8819. n(k, U, "logo-button", "same-line");
  8820. break;
  8821. case y.UnsupportedAndroid:
  8822. n("", H, "", "");
  8823. break;
  8824. case y.IOS:
  8825. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8826. n(k, "", "logo-button", "");
  8827. break;
  8828. case y.Desktop:
  8829. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8830. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8831. n(k, U, "logo-button", "same-line"),
  8832. Q.cardboard()
  8833. }
  8834. }
  8835. function u(e) {
  8836. $(".p1, .p2, .p3").hide(),
  8837. l.insertAfter(T),
  8838. w.removeClass("front-page"),
  8839. w.removeClass("details-page"),
  8840. w.removeClass("lastPage"),
  8841. x.removeClass("logo-button"),
  8842. x.removeClass("same-line"),
  8843. T.removeClass("headsetOptions"),
  8844. S.attr("src", ""),
  8845. S.filter(".second").removeClass("gear"),
  8846. S.css("display", "inline-block"),
  8847. S.off(),
  8848. M.filter(".second").css("display", ""),
  8849. O.css("display", "none"),
  8850. $(".p" + (e + 1) + _).show(),
  8851. S.filter(".third").insertBefore(M.filter(".third"))
  8852. }
  8853. function n(e, t, i, n) {
  8854. w.addClass("front-page"),
  8855. S.filter(".first").attr("src", e),
  8856. S.filter(".second").attr("src", t),
  8857. x.filter(".first").addClass(i),
  8858. x.filter(".second").addClass(i),
  8859. x.addClass(n),
  8860. ".show-desktop" === _ && T.insertAfter(l)
  8861. }
  8862. function r(e, t, i) {
  8863. T.addClass("headsetOptions"),
  8864. x.off(),
  8865. S.filter(".second").attr("src", t),
  8866. O.css("display", "block"),
  8867. M.filter(".second").css("display", "none"),
  8868. O.on("click", function() {
  8869. u(b.Title),
  8870. h(y.Desktop)
  8871. }),
  8872. e && (X.emit(C.falseICECHOSEN, {
  8873. name: v.GearVR
  8874. }),
  8875. S.filter(".first").attr("src", e),
  8876. S.filter(".second").addClass("gear"),
  8877. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8878. Q.gearvr()),
  8879. i && (X.emit(C.falseICECHOSEN, {
  8880. name: v.Cardboard
  8881. }),
  8882. S.filter(".third").attr("src", i),
  8883. S.filter(".third").show(),
  8884. S.filter(".third").insertAfter(S.filter(".second")),
  8885. S.filter(".third").addClass("link"),
  8886. S.filter(".second").addClass("link"),
  8887. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8888. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8889. Q.cardboard())
  8890. }
  8891. function d(e, t) {
  8892. switch (t) {
  8893. case y.IOS:
  8894. j = W,
  8895. Y = G;
  8896. break;
  8897. case y.Desktop:
  8898. e === b.Cardboard ? (j = N,
  8899. Y = B,
  8900. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8901. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8902. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8903. Y = "");
  8904. break;
  8905. default:
  8906. Y = e === b.Cardboard ? (j = H,
  8907. G) : (j = V,
  8908. z)
  8909. }
  8910. }
  8911. function p(e, t, i) {
  8912. w.find(".inner").addClass("details-page"),
  8913. w.addClass("details-page"),
  8914. S.filter(".first").attr("src", e),
  8915. S.filter(".second").attr("src", t),
  8916. S.filter(".third").attr("src", i)
  8917. }
  8918. function f() {
  8919. var e = 1 < g.aspectRatio() && g.isMobile();
  8920. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8921. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8922. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8923. }
  8924. var g = e("../../util/browser")
  8925. , m = e("./vrLink")
  8926. , v = e("../../enum/VRApps")
  8927. , y = e("../../enum/VRPlatforms")
  8928. , A = e("../../enum/VRPages")
  8929. , C = e("./vrEvent")
  8930. , o = (e("../../settings"),
  8931. e("../../constants"))
  8932. , I = e("../../localization/localize")
  8933. , a = e("../../util/common")
  8934. , s = e("events").EventEmitter
  8935. , E = 0
  8936. , _ = null
  8937. , b = A.standard
  8938. , w = $(".vr-popup")
  8939. , l = w.find(".vr-popup-body")
  8940. , T = w.find(".vr-images")
  8941. , x = w.find(".img-container")
  8942. , S = w.find(".vr-sm-image")
  8943. , M = x.find(".vr-img-caption")
  8944. , R = $(".vr-buttons").find(".prev-button")
  8945. , P = $(".vr-buttons").find(".next-button")
  8946. , O = T.find(".front-close")
  8947. , L = $(".vr-page")
  8948. , D = w.find("img")
  8949. , N = "images/apple-store.png"
  8950. , F = "images/badge-oculus.png"
  8951. , B = "images/badge-cardboard.png"
  8952. , V = "images/logo-samsung.png"
  8953. , k = "images/headset-cardboard.png"
  8954. , U = "images/headset-gearvr.png"
  8955. , H = "images/ico-android-robot.png"
  8956. , z = "images/ico-gearvr.png"
  8957. , G = "images/ico-vr.png"
  8958. , W = "images/apple-logo-white.svg"
  8959. , j = null
  8960. , Y = null
  8961. , q = {}
  8962. , X = {
  8963. init: function(e, t) {
  8964. function i(e) {
  8965. X.emit(C.STORE, {
  8966. type: e
  8967. }),
  8968. m.launchStore(e)
  8969. }
  8970. function n(e) {
  8971. switch (e !== b.pageCount && (u(e),
  8972. L.text(e + 1 + " / " + b.pageCount)),
  8973. e) {
  8974. case b.Title:
  8975. R.css("display", "none"),
  8976. P.text(a[e]),
  8977. h(r);
  8978. break;
  8979. case b.Cardboard:
  8980. R.css("display", "block"),
  8981. P.text(a[e]),
  8982. x.filter(".cardboard").off(),
  8983. x.filter(".gearvr").off(),
  8984. d(e, r),
  8985. p(k, j, Y);
  8986. break;
  8987. case b.Gear:
  8988. P.text(a[e]),
  8989. d(e, r),
  8990. w.addClass("lastPage"),
  8991. p(U, j, Y);
  8992. break;
  8993. case b.pageCount:
  8994. w.removeClass("fadeIn"),
  8995. X.emit(C.CLOSED)
  8996. }
  8997. D.filter("[src='']").hide()
  8998. }
  8999. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9000. _ = ".show-supported",
  9001. y.Android) : (w.addClass("unsupported"),
  9002. _ = ".show-unsupported",
  9003. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9004. _ = ".show-ios",
  9005. b = A.ios,
  9006. y.IOS) : (w.addClass("desktop"),
  9007. _ = ".show-desktop",
  9008. y.Desktop);
  9009. function o(e) {
  9010. X.emit(C.LAUNCH, {
  9011. vr_platform: r,
  9012. vr_app: e
  9013. }),
  9014. m.launch(e)
  9015. }
  9016. m.init(r, e, t),
  9017. r !== y.Desktop && w.addClass("mobile"),
  9018. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9019. q.gear = o.bind(this, v.GearVR),
  9020. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9021. f(),
  9022. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9023. $(_).show();
  9024. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9025. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9026. r === y.IOS && (a.splice(1, 1),
  9027. s.splice(1, 1)),
  9028. $("#vr").on("click", function(e) {
  9029. e.preventDefault(),
  9030. window.vrEnabled || (window.vrEnabled = !0,
  9031. this.classList.add("active"),
  9032. $("#gui div").not("#vrOff").addClass("vrHide"),
  9033. $("#vrOffImg").css({
  9034. display: "inline-block"
  9035. }))
  9036. }),
  9037. $("#vrOff").on("click", function() {
  9038. window.vrEnabled = !1,
  9039. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9040. $("#vrOffImg").css({
  9041. display: "none"
  9042. }),
  9043. $("#player canvas").css({
  9044. width: "",
  9045. height: ""
  9046. }),
  9047. $("#vr").removeClass("active")
  9048. });
  9049. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9050. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9051. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9052. $("span.modelLink").text(l),
  9053. R.on("click", function(e) {
  9054. X.emit(C.PREV),
  9055. n(--E)
  9056. }),
  9057. P.on("click", function(e) {
  9058. P.text(),
  9059. X.emit(C.NEXT, {
  9060. nextAction: s[E]
  9061. }),
  9062. n(++E)
  9063. }),
  9064. w.find(".close").on("click", X.dismiss)
  9065. },
  9066. dismiss: function() {
  9067. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9068. X.emit(C.CLOSED))
  9069. },
  9070. isDeviceSupported: c
  9071. };
  9072. a.extendObject(X, s.prototype),
  9073. $(window).resize(f);
  9074. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9075. K = M.filter(".first").find(".gearvr"),
  9076. {
  9077. cardboard: function() {
  9078. K.addClass("hidden"),
  9079. Z.removeClass("hidden")
  9080. },
  9081. gearvr: function() {
  9082. Z.addClass("hidden"),
  9083. K.removeClass("hidden")
  9084. }
  9085. });
  9086. t.exports = X
  9087. }
  9088. , {
  9089. "../../constants": 8,
  9090. "../../enum/VRApps": 46,
  9091. "../../enum/VRPages": 48,
  9092. "../../enum/VRPlatforms": 49,
  9093. "../../localization/localize": 108,
  9094. "../../settings": 166,
  9095. "../../util/browser": 182,
  9096. "../../util/common": 185,
  9097. "./vrEvent": 85,
  9098. "./vrLink": 86,
  9099. events: 202
  9100. }],
  9101. 88: [function(e, t, i) {
  9102. "use strict";
  9103. t.exports = Object.freeze({
  9104. OPENED: "webvr.modal.opened",
  9105. SHOW_TERMS: "webvr.footer.show.terms"
  9106. })
  9107. }
  9108. , {}],
  9109. 89: [function(B, V, e) {
  9110. (function(e) {
  9111. "use strict";
  9112. function a() {
  9113. function t() {
  9114. p.isPresenting || (r.info("exiting webVR"),
  9115. c("webvr_exit_app"),
  9116. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9117. window.removeEventListener("vrdisplaypresentchange", t))
  9118. }
  9119. r.info("Headset mounted"),
  9120. u.suspend();
  9121. var e = document.createElement("canvas");
  9122. for (e.getContext("webgl"),
  9123. e.className = "webvr-canvas",
  9124. document.bgColor = "#000",
  9125. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9126. document.body.removeChild(document.body.firstChild);
  9127. document.body.appendChild(e),
  9128. c("webvr_enter_app"),
  9129. p.requestPresent([{
  9130. source: e,
  9131. predistorted: !0
  9132. }]).catch(function(e) {
  9133. r.error("Failed to present: " + e),
  9134. c("webvr_exit_calibrate"),
  9135. t()
  9136. }),
  9137. d.then(function() {
  9138. window.dispatchEvent(new Event("vrapp-start"))
  9139. }),
  9140. window.addEventListener("vrdisplaypresentchange", t)
  9141. }
  9142. function s() {
  9143. c("webvr_modal_close"),
  9144. _.find(".enter-button").off("click", a),
  9145. E.fadeOut(g.guiAnimationSpeed, function() {
  9146. _.toggleClass("hidden", !1),
  9147. b.toggleClass("hidden", !0),
  9148. f.exitFullscreen()
  9149. }),
  9150. I.fadeIn(g.guiAnimationSpeed)
  9151. }
  9152. function t() {
  9153. M.toggleClass("hidden", !0),
  9154. S.toggleClass("hidden", !1)
  9155. }
  9156. function l() {
  9157. _.toggleClass("hidden"),
  9158. b.toggleClass("hidden")
  9159. }
  9160. function c(e) {
  9161. var t = f.isLandscape() ? "landscape" : "portrait";
  9162. i.trackAlways("showcase_gui", {
  9163. gui_action: e,
  9164. orientation: t
  9165. })
  9166. }
  9167. function h() {
  9168. var e = f.isLandscape();
  9169. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9170. }
  9171. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9172. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9173. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  9174. init: function(e, t, i, n) {
  9175. function r(e) {
  9176. e.preventDefault(),
  9177. o(e.currentTarget.id)
  9178. }
  9179. function o(i) {
  9180. F[i](),
  9181. Object.keys(F).map(function(e, t) {
  9182. $("#" + e).toggleClass("tabs-underlined", e === i)
  9183. })
  9184. }
  9185. p = i,
  9186. u = t,
  9187. y.init(m.Android, e, n),
  9188. h(),
  9189. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9190. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9191. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9192. w.filter(".device-headset-side").attr("src", R),
  9193. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9194. $("#vr").on("click", function(e) {
  9195. e.preventDefault(),
  9196. c("click_webvr_button"),
  9197. E.is(":hidden") && (N.emit(A.OPENED),
  9198. I.fadeOut(g.guiAnimationSpeed),
  9199. E.fadeIn(g.guiAnimationSpeed),
  9200. function() {
  9201. if (!d) {
  9202. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9203. d = new Promise(function(e, t) {
  9204. var i = document.createElement("script");
  9205. i.type = "text/javascript",
  9206. i.src = n,
  9207. i.onload = e,
  9208. document.head.appendChild(i)
  9209. }
  9210. )
  9211. }
  9212. _.find(".enter-button").on("click", a)
  9213. }())
  9214. }),
  9215. $(".webvr-popup .close").on("click", function(e) {
  9216. e.preventDefault(),
  9217. _.hasClass("hidden") ? (c("webvr_help_close"),
  9218. l()) : s()
  9219. }),
  9220. $("#tabcardboard").on("click", r),
  9221. $("#tabdaydream").on("click", r),
  9222. $("#tabnative").on("click", r),
  9223. $(".webvr-popup .open-with-app").on("click", function(e) {
  9224. e.preventDefault(),
  9225. c("webvr_learn_more"),
  9226. o("tabnative"),
  9227. l()
  9228. }),
  9229. $(".webvr-popup .help").on("click", function(e) {
  9230. e.preventDefault(),
  9231. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9232. l()
  9233. }),
  9234. $(".webvr-popup .terms").on("click", function(e) {
  9235. e.preventDefault(),
  9236. c("webvr_click_terms"),
  9237. s(),
  9238. N.emit(A.SHOW_TERMS)
  9239. }),
  9240. T.on("click", function(e) {
  9241. e.preventDefault(),
  9242. c(D),
  9243. window.open(L, "_blank")
  9244. }),
  9245. x.on("click", function(e) {
  9246. e.preventDefault(),
  9247. c("webvr_phone_link"),
  9248. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9249. }),
  9250. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9251. e.preventDefault(),
  9252. c("webvr_cardboard_link"),
  9253. y.launch(v.CardboardAndroid)
  9254. }),
  9255. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9256. e.preventDefault(),
  9257. c("webvr_oculus_link"),
  9258. y.launch(v.GearVR)
  9259. })
  9260. }
  9261. }, F = {
  9262. tabcardboard: function() {
  9263. w.filter(".device-headset").attr("src", R),
  9264. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9265. L = "https://vr.google.com/cardboard/get-cardboard/",
  9266. D = "webvr_cardboard_link",
  9267. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9268. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9269. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9270. t()
  9271. },
  9272. tabdaydream: function() {
  9273. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9274. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9275. L = P,
  9276. D = O,
  9277. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9278. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9279. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9280. t()
  9281. },
  9282. tabnative: function() {
  9283. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9284. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9285. M.toggleClass("hidden", !1),
  9286. S.toggleClass("hidden", !0)
  9287. }
  9288. };
  9289. n.extendObject(N, o.prototype),
  9290. $(window).resize(h),
  9291. V.exports = N
  9292. }
  9293. ).call(this, "/js/gui/webvr/webVRgui.js")
  9294. }
  9295. , {
  9296. "../../analytics": 4,
  9297. "../../constants": 8,
  9298. "../../enum/VRApps": 46,
  9299. "../../enum/VRPlatforms": 49,
  9300. "../../localization/localize": 108,
  9301. "../../settings": 166,
  9302. "../../util/browser": 182,
  9303. "../../util/common": 185,
  9304. "../../util/logger": 189,
  9305. "./../gui": 65,
  9306. "./../vr/vrLink": 86,
  9307. "./WebVrEvent": 88,
  9308. events: 202
  9309. }],
  9310. 90: [function(e, t, i) {
  9311. "use strict";
  9312. function n(e, t, i, n, r) {
  9313. this.floorId = n || 0 === n ? n : -1,
  9314. this.roomId = r || "",
  9315. this.labelId = e,
  9316. this.position = (new o.Vector3).copy(t),
  9317. this.text = i
  9318. }
  9319. var o = e("three")
  9320. , r = e("../util/browser");
  9321. n.prototype.build = function() {
  9322. var e = window.document.createElement("div");
  9323. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9324. var t = window.document.createElement("div");
  9325. t.setAttribute("class", "gui-floorplan-label-text");
  9326. var i = window.document.createTextNode(this.text);
  9327. t.appendChild(i),
  9328. e.appendChild(t),
  9329. window.document.body.appendChild(e),
  9330. this.labelGui = e,
  9331. this.textBlock = t,
  9332. $(this.labelGui).hide();
  9333. var n = window.getComputedStyle(this.labelGui);
  9334. this.initialTransform = n.transform || n.webkitTransform
  9335. }
  9336. ,
  9337. t.exports = n
  9338. }
  9339. , {
  9340. "../util/browser": 182,
  9341. three: 217
  9342. }],
  9343. 91: [function(e, t, i) {
  9344. "use strict";
  9345. function n() {
  9346. this.player = null,
  9347. this.modelManager = null,
  9348. this.container = null
  9349. }
  9350. var c, o, r = e("three"), a = (e("../util/common"),
  9351. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9352. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9353. e("../util/transitions"),
  9354. e("../util/lerp"),
  9355. e("../util/browser"));
  9356. n.prototype.init = function(e, t, i) {
  9357. this.player = e,
  9358. this.modelManager = t,
  9359. this.container = i,
  9360. this.updateModel(),
  9361. this.bindEvents()
  9362. }
  9363. ,
  9364. n.prototype.bindEvents = function() {
  9365. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9366. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9367. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9368. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9369. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9370. }
  9371. ,
  9372. n.prototype.updateModel = function() {
  9373. this.model = this.modelManager.getActiveModel()
  9374. }
  9375. ,
  9376. n.prototype.handlePlayerViewChanged = function() {
  9377. this.updateLabelVisibility(),
  9378. this.updateLabelDisplay()
  9379. }
  9380. ,
  9381. n.prototype.getLabelsForFloor = function(t, i) {
  9382. return (i = i || []).length = 0,
  9383. this.model.labels.forEach(function(e) {
  9384. this.labelVisibleForFloor(e, t) && i.push(e)
  9385. }
  9386. .bind(this)),
  9387. i
  9388. }
  9389. ,
  9390. n.prototype.getLabelsForCurrentFloor = function(e) {
  9391. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9392. }
  9393. ,
  9394. n.prototype.labelVisibleForFloor = function(e, t) {
  9395. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9396. if (!this.model.showingLabels || !e.labelGui || !i)
  9397. return !1;
  9398. var n = e.floorId === this.model.floors.size() - 1;
  9399. return this.model.allFloorsVisible ? n : e.floorId === t
  9400. }
  9401. ,
  9402. n.prototype.updateLabelVisibility = function(e) {
  9403. this.model.labels.forEach(function(e) {
  9404. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9405. }
  9406. .bind(this))
  9407. }
  9408. ,
  9409. n.prototype.showAllLabels = function(t, i) {
  9410. this.model.labels.forEach(function(e) {
  9411. this.showLabel(e, t, i)
  9412. }
  9413. .bind(this))
  9414. }
  9415. ,
  9416. n.prototype.hideAllLabels = function(t, i) {
  9417. this.model.labels.forEach(function(e) {
  9418. this.hideLabel(e, t, i)
  9419. }
  9420. .bind(this))
  9421. }
  9422. ,
  9423. n.prototype.showLabel = function(e, t, i) {
  9424. this.model.showingLabels && (e.visible || (e.visible = !0,
  9425. e.labelGui.style.display = "block",
  9426. e.labelGui.style.opacity = 0,
  9427. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9428. }
  9429. ,
  9430. n.prototype.hideLabel = function(e, t, i) {
  9431. e.visible && (e.visible = !1,
  9432. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9433. }
  9434. ,
  9435. n.prototype.supportedMode = function() {
  9436. return this.player.mode === h.FLOORPLAN
  9437. }
  9438. ,
  9439. n.prototype.updateLabelDisplay = (new r.Vector3,
  9440. new r.Vector3,
  9441. o = [],
  9442. function() {
  9443. var e = this.player.getLabelScaleFactor()
  9444. , t = 1.2 * (1 - e) + .6
  9445. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9446. this.getLabelsForCurrentFloor(o);
  9447. for (var n = 0; n < o.length; n++) {
  9448. var r = o[n];
  9449. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9450. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9451. }
  9452. }
  9453. ),
  9454. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9455. new r.Vector3,
  9456. function(e, t, i, n, r) {
  9457. t.style.fontSize = 100 * r + "%";
  9458. var o = .5 * $("#player").width()
  9459. , a = .5 * $("#player").height();
  9460. c.copy(i),
  9461. c.project(this.player.camera);
  9462. var s = c.x * o + o
  9463. , l = -c.y * a + a;
  9464. s -= e.offsetWidth / 2,
  9465. l -= e.offsetHeight / 2,
  9466. e.style.left = s + "px",
  9467. e.style.top = l + "px"
  9468. }
  9469. ),
  9470. n.prototype.handleStartInside = function(e) {
  9471. this.updateLabelVisibility()
  9472. }
  9473. ,
  9474. n.prototype.handleStartOutside = function() {
  9475. this.updateLabelVisibility()
  9476. }
  9477. ,
  9478. t.exports = n
  9479. }
  9480. , {
  9481. "../enum/DirectorEvents": 23,
  9482. "../enum/ModelManagerEvents": 33,
  9483. "../enum/PlayerEvents": 40,
  9484. "../enum/Viewmode": 51,
  9485. "../enum/WarpStyle": 52,
  9486. "../settings": 166,
  9487. "../util/browser": 182,
  9488. "../util/common": 185,
  9489. "../util/lerp": 188,
  9490. "../util/transitions": 195,
  9491. three: 217
  9492. }],
  9493. 92: [function(e, t, i) {
  9494. "use strict";
  9495. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9496. if (null == this)
  9497. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9498. if ("function" != typeof e)
  9499. throw new TypeError("predicate must be a function");
  9500. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9501. if (t = i[o],
  9502. e.call(r, t, o, i))
  9503. return o;
  9504. return -1
  9505. }
  9506. ),
  9507. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9508. value: function(e) {
  9509. if (null == this)
  9510. throw new TypeError('"this" is null or not defined');
  9511. var t = Object(this)
  9512. , i = t.length >>> 0;
  9513. if ("function" != typeof e)
  9514. throw new TypeError("predicate must be a function");
  9515. for (var n = arguments[1], r = 0; r < i; ) {
  9516. var o = t[r];
  9517. if (e.call(n, o, r, t))
  9518. return o;
  9519. r++
  9520. }
  9521. }
  9522. })
  9523. }
  9524. , {}],
  9525. 93: [function(e, t, i) {
  9526. "use strict";
  9527. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9528. function te() {
  9529. this.backgroundElement = document.createElement("div"),
  9530. r.extend(this.backgroundElement.style, {
  9531. backgroundColor: "rgba(0,0,0,0.8)",
  9532. top: 0,
  9533. left: 0,
  9534. display: "none",
  9535. zIndex: "1000",
  9536. opacity: 0,
  9537. WebkitTransition: "opacity 0.2s linear"
  9538. }),
  9539. n.makeFullscreen(this.backgroundElement),
  9540. this.backgroundElement.style.position = "fixed",
  9541. this.domElement = document.createElement("div"),
  9542. r.extend(this.domElement.style, {
  9543. position: "fixed",
  9544. display: "none",
  9545. zIndex: "1001",
  9546. opacity: 0,
  9547. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9548. }),
  9549. document.body.appendChild(this.backgroundElement),
  9550. document.body.appendChild(this.domElement);
  9551. var e = this;
  9552. n.bind(this.backgroundElement, "click", function() {
  9553. e.hide()
  9554. })
  9555. }
  9556. function ie(e, t, i) {
  9557. Object.defineProperty(e, t, {
  9558. get: function() {
  9559. return "RGB" === this.__state.space || re(this, t, i),
  9560. this.__state[t]
  9561. },
  9562. set: function(e) {
  9563. "RGB" !== this.__state.space && (re(this, t, i),
  9564. this.__state.space = "RGB"),
  9565. this.__state[t] = e
  9566. }
  9567. })
  9568. }
  9569. function ne(e, t) {
  9570. Object.defineProperty(e, t, {
  9571. get: function() {
  9572. return "HSV" === this.__state.space || oe(this),
  9573. this.__state[t]
  9574. },
  9575. set: function(e) {
  9576. "HSV" !== this.__state.space && (oe(this),
  9577. this.__state.space = "HSV"),
  9578. this.__state[t] = e
  9579. }
  9580. })
  9581. }
  9582. function re(e, t, i) {
  9583. if ("HEX" === e.__state.space)
  9584. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9585. else {
  9586. if ("HSV" !== e.__state.space)
  9587. throw "Corrupted color state";
  9588. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9589. }
  9590. }
  9591. function oe(e) {
  9592. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9593. l.extend(e.__state, {
  9594. s: t.s,
  9595. v: t.v
  9596. }),
  9597. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9598. }
  9599. function ae() {
  9600. if (this.__state = o.apply(this, arguments),
  9601. !1 === this.__state)
  9602. throw "Failed to interpret color arguments";
  9603. this.__state.a = this.__state.a || 1
  9604. }
  9605. function se(e) {
  9606. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9607. }
  9608. function le(e, t) {
  9609. this.initialValue = e[t],
  9610. this.domElement = document.createElement("div"),
  9611. this.object = e,
  9612. this.property = t,
  9613. this.__onChange = void 0,
  9614. this.__onFinishChange = void 0
  9615. }
  9616. (t.exports = ee).gui = ee.gui || {},
  9617. ee.utils = ee.utils || {},
  9618. ee.controllers = ee.controllers || {},
  9619. ee.dom = ee.dom || {},
  9620. ee.color = ee.color || {},
  9621. ee.utils.css = {
  9622. load: function(e, t) {
  9623. var i = (t = t || document).createElement("link");
  9624. i.type = "text/css",
  9625. i.rel = "stylesheet",
  9626. i.href = e,
  9627. t.getElementsByTagName("head")[0].appendChild(i)
  9628. },
  9629. inject: function(e, t) {
  9630. t = t || document;
  9631. var i = document.createElement("style");
  9632. i.type = "text/css",
  9633. i.innerHTML = e,
  9634. t.getElementsByTagName("head")[0].appendChild(i)
  9635. }
  9636. },
  9637. ee.utils.common = (Q = Array.prototype.forEach,
  9638. J = Array.prototype.slice,
  9639. {
  9640. BREAK: {},
  9641. extend: function(i) {
  9642. return this.each(J.call(arguments, 1), function(e) {
  9643. for (var t in e)
  9644. this.isUndefined(e[t]) || (i[t] = e[t])
  9645. }, this),
  9646. i
  9647. },
  9648. defaults: function(i) {
  9649. return this.each(J.call(arguments, 1), function(e) {
  9650. for (var t in e)
  9651. this.isUndefined(i[t]) && (i[t] = e[t])
  9652. }, this),
  9653. i
  9654. },
  9655. compose: function() {
  9656. var i = J.call(arguments);
  9657. return function() {
  9658. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9659. e = [i[t].apply(this, e)];
  9660. return e[0]
  9661. }
  9662. },
  9663. each: function(e, t, i) {
  9664. if (e)
  9665. if (Q && e.forEach && e.forEach === Q)
  9666. e.forEach(t, i);
  9667. else if (e.length === e.length + 0) {
  9668. for (var n = 0, r = e.length; n < r; n++)
  9669. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9670. return
  9671. } else
  9672. for (var n in e)
  9673. if (t.call(i, e[n], n) === this.BREAK)
  9674. return
  9675. },
  9676. defer: function(e) {
  9677. setTimeout(e, 0)
  9678. },
  9679. toArray: function(e) {
  9680. return e.toArray ? e.toArray() : J.call(e)
  9681. },
  9682. isUndefined: function(e) {
  9683. return void 0 === e
  9684. },
  9685. isNull: function(e) {
  9686. return null === e
  9687. },
  9688. isNaN: function(e) {
  9689. return e != e
  9690. },
  9691. isArray: Array.isArray || function(e) {
  9692. return e.constructor === Array
  9693. }
  9694. ,
  9695. isObject: function(e) {
  9696. return e === Object(e)
  9697. },
  9698. isNumber: function(e) {
  9699. return e === e + 0
  9700. },
  9701. isString: function(e) {
  9702. return e === e + ""
  9703. },
  9704. isBoolean: function(e) {
  9705. return !1 === e || !0 === e
  9706. },
  9707. isFunction: function(e) {
  9708. return "[object Function]" === Object.prototype.toString.call(e)
  9709. }
  9710. }),
  9711. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9712. onChange: function(e) {
  9713. return this.__onChange = e,
  9714. this
  9715. },
  9716. onFinishChange: function(e) {
  9717. return this.__onFinishChange = e,
  9718. this
  9719. },
  9720. setValue: function(e) {
  9721. return this.object[this.property] = e,
  9722. this.__onChange && this.__onChange.call(this, e),
  9723. this.updateDisplay(),
  9724. this
  9725. },
  9726. getValue: function() {
  9727. return this.object[this.property]
  9728. },
  9729. updateDisplay: function() {
  9730. return this
  9731. },
  9732. isModified: function() {
  9733. return this.initialValue !== this.getValue()
  9734. }
  9735. }),
  9736. le),
  9737. ee.dom.dom = function(c) {
  9738. function i(e) {
  9739. if ("0" === e || c.isUndefined(e))
  9740. return 0;
  9741. var t = e.match(n);
  9742. return c.isNull(t) ? 0 : parseFloat(t[1])
  9743. }
  9744. var h = {};
  9745. c.each({
  9746. HTMLEvents: ["change"],
  9747. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9748. KeyboardEvents: ["keydown"]
  9749. }, function(e, t) {
  9750. c.each(e, function(e) {
  9751. h[e] = t
  9752. })
  9753. });
  9754. var n = /(\d+(\.\d+)?)px/
  9755. , r = {
  9756. makeSelectable: function(e, t) {
  9757. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9758. return !1
  9759. }
  9760. : function() {}
  9761. ,
  9762. e.style.MozUserSelect = t ? "auto" : "none",
  9763. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9764. e.unselectable = t ? "on" : "off")
  9765. },
  9766. makeFullscreen: function(e, t, i) {
  9767. c.isUndefined(t) && (t = !0),
  9768. c.isUndefined(i) && (i = !0),
  9769. e.style.position = "absolute",
  9770. t && (e.style.left = 0,
  9771. e.style.right = 0),
  9772. i && (e.style.top = 0,
  9773. e.style.bottom = 0)
  9774. },
  9775. fakeEvent: function(e, t, i, n) {
  9776. i = i || {};
  9777. var r = h[t];
  9778. if (!r)
  9779. throw new Error("Event type " + t + " not supported.");
  9780. var o = document.createEvent(r);
  9781. switch (r) {
  9782. case "MouseEvents":
  9783. var a = i.x || i.clientX || 0
  9784. , s = i.y || i.clientY || 0;
  9785. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9786. break;
  9787. case "KeyboardEvents":
  9788. var l = o.initKeyboardEvent || o.initKeyEvent;
  9789. c.defaults(i, {
  9790. cancelable: !0,
  9791. ctrlKey: !1,
  9792. altKey: !1,
  9793. shiftKey: !1,
  9794. metaKey: !1,
  9795. keyCode: void 0,
  9796. charCode: void 0
  9797. }),
  9798. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9799. break;
  9800. default:
  9801. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9802. }
  9803. c.defaults(o, n),
  9804. e.dispatchEvent(o)
  9805. },
  9806. bind: function(e, t, i, n) {
  9807. return n = n || !1,
  9808. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9809. r
  9810. },
  9811. unbind: function(e, t, i, n) {
  9812. return n = n || !1,
  9813. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9814. r
  9815. },
  9816. addClass: function(e, t) {
  9817. if (void 0 === e.className)
  9818. e.className = t;
  9819. else if (e.className !== t) {
  9820. var i = e.className.split(/ +/);
  9821. -1 == i.indexOf(t) && (i.push(t),
  9822. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9823. }
  9824. return r
  9825. },
  9826. removeClass: function(e, t) {
  9827. if (t)
  9828. if (void 0 === e.className)
  9829. ;
  9830. else if (e.className === t)
  9831. e.removeAttribute("class");
  9832. else {
  9833. var i = e.className.split(/ +/)
  9834. , n = i.indexOf(t);
  9835. -1 != n && (i.splice(n, 1),
  9836. e.className = i.join(" "))
  9837. }
  9838. else
  9839. e.className = void 0;
  9840. return r
  9841. },
  9842. hasClass: function(e, t) {
  9843. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9844. },
  9845. getWidth: function(e) {
  9846. var t = getComputedStyle(e);
  9847. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9848. },
  9849. getHeight: function(e) {
  9850. var t = getComputedStyle(e);
  9851. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9852. },
  9853. getOffset: function(e) {
  9854. var t = {
  9855. left: 0,
  9856. top: 0
  9857. };
  9858. if (e.offsetParent)
  9859. for (; t.left += e.offsetLeft,
  9860. t.top += e.offsetTop,
  9861. e = e.offsetParent; )
  9862. ;
  9863. return t
  9864. },
  9865. isActive: function(e) {
  9866. return e === document.activeElement && (e.type || e.href)
  9867. }
  9868. };
  9869. return r
  9870. }(ee.utils.common),
  9871. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9872. X = ee.dom.dom,
  9873. Z = ee.utils.common,
  9874. (K = function(e, t, i) {
  9875. K.superclass.call(this, e, t);
  9876. var n = this;
  9877. if (this.__select = document.createElement("select"),
  9878. Z.isArray(i)) {
  9879. var r = {};
  9880. Z.each(i, function(e) {
  9881. r[e] = e
  9882. }),
  9883. i = r
  9884. }
  9885. Z.each(i, function(e, t) {
  9886. var i = document.createElement("option");
  9887. i.innerHTML = t,
  9888. i.setAttribute("value", e),
  9889. n.__select.appendChild(i)
  9890. }),
  9891. this.updateDisplay(),
  9892. X.bind(this.__select, "change", function() {
  9893. var e = this.options[this.selectedIndex].value;
  9894. n.setValue(e)
  9895. }),
  9896. this.domElement.appendChild(this.__select)
  9897. }
  9898. ).superclass = q,
  9899. Z.extend(K.prototype, q.prototype, {
  9900. setValue: function(e) {
  9901. var t = K.superclass.prototype.setValue.call(this, e);
  9902. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9903. t
  9904. },
  9905. updateDisplay: function() {
  9906. return this.__select.value = this.getValue(),
  9907. K.superclass.prototype.updateDisplay.call(this)
  9908. }
  9909. }),
  9910. K),
  9911. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9912. j = ee.utils.common,
  9913. (Y = function(e, t, i) {
  9914. Y.superclass.call(this, e, t),
  9915. i = i || {},
  9916. this.__min = i.min,
  9917. this.__max = i.max,
  9918. this.__step = i.step,
  9919. j.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,
  9920. this.__precision = se(this.__impliedStep)
  9921. }
  9922. ).superclass = W,
  9923. j.extend(Y.prototype, W.prototype, {
  9924. setValue: function(e) {
  9925. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9926. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9927. Y.superclass.prototype.setValue.call(this, e)
  9928. },
  9929. min: function(e) {
  9930. return this.__min = e,
  9931. this
  9932. },
  9933. max: function(e) {
  9934. return this.__max = e,
  9935. this
  9936. },
  9937. step: function(e) {
  9938. return this.__step = e,
  9939. this.__impliedStep = e,
  9940. this.__precision = se(e),
  9941. this
  9942. }
  9943. }),
  9944. Y),
  9945. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9946. H = ee.dom.dom,
  9947. z = ee.utils.common,
  9948. (G = function(e, t, i) {
  9949. function n() {
  9950. var e = parseFloat(s.__input.value);
  9951. z.isNaN(e) || s.setValue(e)
  9952. }
  9953. function r(e) {
  9954. var t = a - e.clientY;
  9955. s.setValue(s.getValue() + t * s.__impliedStep),
  9956. a = e.clientY
  9957. }
  9958. function o() {
  9959. H.unbind(window, "mousemove", r),
  9960. H.unbind(window, "mouseup", o)
  9961. }
  9962. this.__truncationSuspended = !1,
  9963. G.superclass.call(this, e, t, i);
  9964. var a, s = this;
  9965. this.__input = document.createElement("input"),
  9966. this.__input.setAttribute("type", "text"),
  9967. H.bind(this.__input, "change", n),
  9968. H.bind(this.__input, "blur", function() {
  9969. n(),
  9970. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9971. }),
  9972. H.bind(this.__input, "mousedown", function(e) {
  9973. H.bind(window, "mousemove", r),
  9974. H.bind(window, "mouseup", o),
  9975. a = e.clientY
  9976. }),
  9977. H.bind(this.__input, "keydown", function(e) {
  9978. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9979. this.blur(),
  9980. s.__truncationSuspended = !1)
  9981. }),
  9982. this.updateDisplay(),
  9983. this.domElement.appendChild(this.__input)
  9984. }
  9985. ).superclass = U,
  9986. z.extend(G.prototype, U.prototype, {
  9987. updateDisplay: function() {
  9988. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9989. var i = Math.pow(10, t);
  9990. return Math.round(e * i) / i
  9991. }(this.getValue(), this.__precision),
  9992. G.superclass.prototype.updateDisplay.call(this)
  9993. }
  9994. }),
  9995. G),
  9996. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9997. F = ee.dom.dom,
  9998. B = ee.utils.css,
  9999. V = ee.utils.common,
  10000. (k = function(e, t, i, n, r) {
  10001. function o(e) {
  10002. e.preventDefault();
  10003. var t = F.getOffset(s.__background)
  10004. , i = F.getWidth(s.__background);
  10005. return s.setValue(function(e, t, i, n, r) {
  10006. return n + (e - t) / (i - t) * (r - n)
  10007. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10008. !1
  10009. }
  10010. function a() {
  10011. F.unbind(window, "mousemove", o),
  10012. F.unbind(window, "mouseup", a),
  10013. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10014. }
  10015. k.superclass.call(this, e, t, {
  10016. min: i,
  10017. max: n,
  10018. step: r
  10019. });
  10020. var s = this;
  10021. this.__background = document.createElement("div"),
  10022. this.__foreground = document.createElement("div"),
  10023. F.bind(this.__background, "mousedown", function(e) {
  10024. F.bind(window, "mousemove", o),
  10025. F.bind(window, "mouseup", a),
  10026. o(e)
  10027. }),
  10028. F.addClass(this.__background, "slider"),
  10029. F.addClass(this.__foreground, "slider-fg"),
  10030. this.updateDisplay(),
  10031. this.__background.appendChild(this.__foreground),
  10032. this.domElement.appendChild(this.__background)
  10033. }
  10034. ).superclass = N,
  10035. k.useDefaultStyles = function() {
  10036. B.inject("/**\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}")
  10037. }
  10038. ,
  10039. V.extend(k.prototype, N.prototype, {
  10040. updateDisplay: function() {
  10041. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10042. return this.__foreground.style.width = 100 * e + "%",
  10043. k.superclass.prototype.updateDisplay.call(this)
  10044. }
  10045. }),
  10046. k),
  10047. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10048. O = ee.dom.dom,
  10049. L = ee.utils.common,
  10050. (D = function(e, t, i) {
  10051. D.superclass.call(this, e, t);
  10052. var n = this;
  10053. this.__button = document.createElement("div"),
  10054. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10055. O.bind(this.__button, "click", function(e) {
  10056. return e.preventDefault(),
  10057. n.fire(),
  10058. !1
  10059. }),
  10060. O.addClass(this.__button, "button"),
  10061. this.domElement.appendChild(this.__button)
  10062. }
  10063. ).superclass = P,
  10064. L.extend(D.prototype, P.prototype, {
  10065. fire: function() {
  10066. this.__onChange && this.__onChange.call(this),
  10067. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10068. this.getValue().call(this.object)
  10069. }
  10070. }),
  10071. D),
  10072. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10073. S = ee.dom.dom,
  10074. M = ee.utils.common,
  10075. (R = function(e, t) {
  10076. R.superclass.call(this, e, t);
  10077. var i = this;
  10078. this.__prev = this.getValue(),
  10079. this.__checkbox = document.createElement("input"),
  10080. this.__checkbox.setAttribute("type", "checkbox"),
  10081. S.bind(this.__checkbox, "change", function() {
  10082. i.setValue(!i.__prev)
  10083. }, !1),
  10084. this.domElement.appendChild(this.__checkbox),
  10085. this.updateDisplay()
  10086. }
  10087. ).superclass = x,
  10088. M.extend(R.prototype, x.prototype, {
  10089. setValue: function(e) {
  10090. var t = R.superclass.prototype.setValue.call(this, e);
  10091. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10092. this.__prev = this.getValue(),
  10093. t
  10094. },
  10095. updateDisplay: function() {
  10096. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10097. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10098. R.superclass.prototype.updateDisplay.call(this)
  10099. }
  10100. }),
  10101. R),
  10102. ee.color.toString = (T = ee.utils.common,
  10103. function(e) {
  10104. if (1 == e.a || T.isUndefined(e.a)) {
  10105. for (var t = e.hex.toString(16); t.length < 6; )
  10106. t = "0" + t;
  10107. return "#" + t
  10108. }
  10109. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10110. }
  10111. ),
  10112. ee.color.interpret = (I = ee.color.toString,
  10113. E = ee.utils.common,
  10114. w = [{
  10115. litmus: E.isString,
  10116. conversions: {
  10117. THREE_CHAR_HEX: {
  10118. read: function(e) {
  10119. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10120. return null !== t && {
  10121. space: "HEX",
  10122. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10123. }
  10124. },
  10125. write: I
  10126. },
  10127. SIX_CHAR_HEX: {
  10128. read: function(e) {
  10129. var t = e.match(/^#([A-F0-9]{6})$/i);
  10130. return null !== t && {
  10131. space: "HEX",
  10132. hex: parseInt("0x" + t[1].toString())
  10133. }
  10134. },
  10135. write: I
  10136. },
  10137. CSS_RGB: {
  10138. read: function(e) {
  10139. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10140. return null !== t && {
  10141. space: "RGB",
  10142. r: parseFloat(t[1]),
  10143. g: parseFloat(t[2]),
  10144. b: parseFloat(t[3])
  10145. }
  10146. },
  10147. write: I
  10148. },
  10149. CSS_RGBA: {
  10150. read: function(e) {
  10151. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10152. return null !== t && {
  10153. space: "RGB",
  10154. r: parseFloat(t[1]),
  10155. g: parseFloat(t[2]),
  10156. b: parseFloat(t[3]),
  10157. a: parseFloat(t[4])
  10158. }
  10159. },
  10160. write: I
  10161. }
  10162. }
  10163. }, {
  10164. litmus: E.isNumber,
  10165. conversions: {
  10166. HEX: {
  10167. read: function(e) {
  10168. return {
  10169. space: "HEX",
  10170. hex: e,
  10171. conversionName: "HEX"
  10172. }
  10173. },
  10174. write: function(e) {
  10175. return e.hex
  10176. }
  10177. }
  10178. }
  10179. }, {
  10180. litmus: E.isArray,
  10181. conversions: {
  10182. RGB_ARRAY: {
  10183. read: function(e) {
  10184. return 3 == e.length && {
  10185. space: "RGB",
  10186. r: e[0],
  10187. g: e[1],
  10188. b: e[2]
  10189. }
  10190. },
  10191. write: function(e) {
  10192. return [e.r, e.g, e.b]
  10193. }
  10194. },
  10195. RGBA_ARRAY: {
  10196. read: function(e) {
  10197. return 4 == e.length && {
  10198. space: "RGB",
  10199. r: e[0],
  10200. g: e[1],
  10201. b: e[2],
  10202. a: e[3]
  10203. }
  10204. },
  10205. write: function(e) {
  10206. return [e.r, e.g, e.b, e.a]
  10207. }
  10208. }
  10209. }
  10210. }, {
  10211. litmus: E.isObject,
  10212. conversions: {
  10213. RGBA_OBJ: {
  10214. read: function(e) {
  10215. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10216. space: "RGB",
  10217. r: e.r,
  10218. g: e.g,
  10219. b: e.b,
  10220. a: e.a
  10221. }
  10222. },
  10223. write: function(e) {
  10224. return {
  10225. r: e.r,
  10226. g: e.g,
  10227. b: e.b,
  10228. a: e.a
  10229. }
  10230. }
  10231. },
  10232. RGB_OBJ: {
  10233. read: function(e) {
  10234. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10235. space: "RGB",
  10236. r: e.r,
  10237. g: e.g,
  10238. b: e.b
  10239. }
  10240. },
  10241. write: function(e) {
  10242. return {
  10243. r: e.r,
  10244. g: e.g,
  10245. b: e.b
  10246. }
  10247. }
  10248. },
  10249. HSVA_OBJ: {
  10250. read: function(e) {
  10251. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10252. space: "HSV",
  10253. h: e.h,
  10254. s: e.s,
  10255. v: e.v,
  10256. a: e.a
  10257. }
  10258. },
  10259. write: function(e) {
  10260. return {
  10261. h: e.h,
  10262. s: e.s,
  10263. v: e.v,
  10264. a: e.a
  10265. }
  10266. }
  10267. },
  10268. HSV_OBJ: {
  10269. read: function(e) {
  10270. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10271. space: "HSV",
  10272. h: e.h,
  10273. s: e.s,
  10274. v: e.v
  10275. }
  10276. },
  10277. write: function(e) {
  10278. return {
  10279. h: e.h,
  10280. s: e.s,
  10281. v: e.v
  10282. }
  10283. }
  10284. }
  10285. }
  10286. }],
  10287. function() {
  10288. b = !1;
  10289. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10290. return E.each(w, function(e) {
  10291. if (e.litmus(i))
  10292. return E.each(e.conversions, function(e, t) {
  10293. if (_ = e.read(i),
  10294. !1 === b && !1 !== _)
  10295. return (b = _).conversionName = t,
  10296. _.conversion = e,
  10297. E.BREAK
  10298. }),
  10299. E.BREAK
  10300. }),
  10301. b
  10302. }
  10303. ),
  10304. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10305. function y(e, t, i, n) {
  10306. if (void 0 === t[i])
  10307. throw new Error("Object " + t + ' has no property "' + i + '"');
  10308. var r;
  10309. if (n.color)
  10310. r = new g(t,i);
  10311. else {
  10312. var o = [t, i].concat(n.factoryArgs);
  10313. r = c.apply(e, o)
  10314. }
  10315. n.before instanceof h && (n.before = n.before.__li),
  10316. C(e, r),
  10317. m.addClass(r.domElement, "c");
  10318. var a = document.createElement("span");
  10319. m.addClass(a, "property-name"),
  10320. a.innerHTML = r.property;
  10321. var s = document.createElement("div");
  10322. s.appendChild(a),
  10323. s.appendChild(r.domElement);
  10324. var l = A(e, s, n.before);
  10325. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10326. m.addClass(l, typeof r.getValue()),
  10327. function(t, i, n) {
  10328. if (n.__li = i,
  10329. n.__gui = t,
  10330. v.extend(n, {
  10331. options: function(e) {
  10332. return 1 < arguments.length ? (n.remove(),
  10333. y(t, n.object, n.property, {
  10334. before: n.__li.nextElementSibling,
  10335. factoryArgs: [v.toArray(arguments)]
  10336. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10337. y(t, n.object, n.property, {
  10338. before: n.__li.nextElementSibling,
  10339. factoryArgs: [e]
  10340. })) : void 0
  10341. },
  10342. name: function(e) {
  10343. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10344. n
  10345. },
  10346. listen: function() {
  10347. return n.__gui.listen(n),
  10348. n
  10349. },
  10350. remove: function() {
  10351. return n.__gui.remove(n),
  10352. n
  10353. }
  10354. }),
  10355. n instanceof f) {
  10356. var r = new p(n.object,n.property,{
  10357. min: n.__min,
  10358. max: n.__max,
  10359. step: n.__step
  10360. });
  10361. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10362. var t = n[e]
  10363. , i = r[e];
  10364. n[e] = r[e] = function() {
  10365. var e = Array.prototype.slice.call(arguments);
  10366. return t.apply(n, e),
  10367. i.apply(r, e)
  10368. }
  10369. }),
  10370. m.addClass(i, "has-slider"),
  10371. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10372. } else if (n instanceof p) {
  10373. var e = function(e) {
  10374. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10375. y(t, n.object, n.property, {
  10376. before: n.__li.nextElementSibling,
  10377. factoryArgs: [n.__min, n.__max, n.__step]
  10378. })) : e
  10379. };
  10380. n.min = v.compose(e, n.min),
  10381. n.max = v.compose(e, n.max)
  10382. } else
  10383. n instanceof u ? (m.bind(i, "click", function() {
  10384. m.fakeEvent(n.__checkbox, "click")
  10385. }),
  10386. m.bind(n.__checkbox, "click", function(e) {
  10387. e.stopPropagation()
  10388. })) : n instanceof d ? (m.bind(i, "click", function() {
  10389. m.fakeEvent(n.__button, "click")
  10390. }),
  10391. m.bind(i, "mouseover", function() {
  10392. m.addClass(n.__button, "hover")
  10393. }),
  10394. m.bind(i, "mouseout", function() {
  10395. m.removeClass(n.__button, "hover")
  10396. })) : n instanceof g && (m.addClass(i, "color"),
  10397. n.updateDisplay = v.compose(function(e) {
  10398. return i.style.borderLeftColor = n.__color.toString(),
  10399. e
  10400. }, n.updateDisplay),
  10401. n.updateDisplay());
  10402. n.setValue = v.compose(function(e) {
  10403. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10404. e
  10405. }, n.setValue)
  10406. }(e, l, r),
  10407. e.__controllers.push(r),
  10408. r
  10409. }
  10410. function A(e, t, i) {
  10411. var n = document.createElement("li");
  10412. return t && n.appendChild(t),
  10413. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10414. e.onResize(),
  10415. n
  10416. }
  10417. function C(e, t) {
  10418. var i = e.getRoot()
  10419. , n = i.__rememberedObjects.indexOf(t.object);
  10420. if (-1 != n) {
  10421. var r = i.__rememberedObjectIndecesToControllers[n];
  10422. if (void 0 === r && (r = {},
  10423. i.__rememberedObjectIndecesToControllers[n] = r),
  10424. r[t.property] = t,
  10425. i.load && i.load.remembered) {
  10426. var o, a = i.load.remembered;
  10427. if (a[e.preset])
  10428. o = a[e.preset];
  10429. else {
  10430. if (!a[T])
  10431. return;
  10432. o = a[T]
  10433. }
  10434. if (o[n] && void 0 !== o[n][t.property]) {
  10435. var s = o[n][t.property];
  10436. t.initialValue = s,
  10437. t.setValue(s)
  10438. }
  10439. }
  10440. }
  10441. }
  10442. function I(e, t) {
  10443. return document.location.href + "." + t
  10444. }
  10445. function l(e, t) {
  10446. e.domElement.style.width = t + "px",
  10447. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10448. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10449. }
  10450. function a(r, o) {
  10451. var a = {};
  10452. return v.each(r.__rememberedObjects, function(e, t) {
  10453. var i = {}
  10454. , n = r.__rememberedObjectIndecesToControllers[t];
  10455. v.each(n, function(e, t) {
  10456. i[t] = o ? e.initialValue : e.getValue()
  10457. }),
  10458. a[t] = i
  10459. }),
  10460. a
  10461. }
  10462. function E(e, t, i) {
  10463. var n = document.createElement("option");
  10464. n.innerHTML = t,
  10465. n.value = t,
  10466. e.__preset_select.appendChild(n),
  10467. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10468. }
  10469. function _(e, t) {
  10470. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10471. i.innerHTML = t ? i.value + "*" : i.value
  10472. }
  10473. e.inject(".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");
  10474. var b, w, T = "Default", x = function() {
  10475. try {
  10476. return "localStorage"in window && null !== window.localStorage
  10477. } catch (e) {
  10478. return !1
  10479. }
  10480. }(), S = !0, s = !1, M = [], R = function(t) {
  10481. var i = this;
  10482. this.domElement = document.createElement("div"),
  10483. this.__ul = document.createElement("ul"),
  10484. this.domElement.appendChild(this.__ul),
  10485. m.addClass(this.domElement, "dg"),
  10486. this.__folders = {},
  10487. this.__controllers = [],
  10488. this.__rememberedObjects = [],
  10489. this.__rememberedObjectIndecesToControllers = [],
  10490. this.__listening = [],
  10491. t = t || {},
  10492. t = v.defaults(t, {
  10493. autoPlace: !0,
  10494. width: R.DEFAULT_WIDTH
  10495. }),
  10496. t = v.defaults(t, {
  10497. resizable: t.autoPlace,
  10498. hideable: t.autoPlace
  10499. }),
  10500. v.isUndefined(t.load) ? t.load = {
  10501. preset: T
  10502. } : t.preset && (t.load.preset = t.preset),
  10503. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10504. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10505. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10506. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10507. if (Object.defineProperties(this, {
  10508. parent: {
  10509. get: function() {
  10510. return t.parent
  10511. }
  10512. },
  10513. scrollable: {
  10514. get: function() {
  10515. return t.scrollable
  10516. }
  10517. },
  10518. autoPlace: {
  10519. get: function() {
  10520. return t.autoPlace
  10521. }
  10522. },
  10523. preset: {
  10524. get: function() {
  10525. return i.parent ? i.getRoot().preset : t.load.preset
  10526. },
  10527. set: function(e) {
  10528. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10529. function(e) {
  10530. for (var t = 0; t < e.__preset_select.length; t++)
  10531. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10532. }(this),
  10533. i.revert()
  10534. }
  10535. },
  10536. width: {
  10537. get: function() {
  10538. return t.width
  10539. },
  10540. set: function(e) {
  10541. t.width = e,
  10542. l(i, e)
  10543. }
  10544. },
  10545. name: {
  10546. get: function() {
  10547. return t.name
  10548. },
  10549. set: function(e) {
  10550. t.name = e,
  10551. a && (a.innerHTML = t.name)
  10552. }
  10553. },
  10554. closed: {
  10555. get: function() {
  10556. return t.closed
  10557. },
  10558. set: function(e) {
  10559. t.closed = e,
  10560. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10561. this.onResize(),
  10562. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10563. }
  10564. },
  10565. load: {
  10566. get: function() {
  10567. return t.load
  10568. }
  10569. },
  10570. useLocalStorage: {
  10571. get: function() {
  10572. return r
  10573. },
  10574. set: function(e) {
  10575. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10576. localStorage.setItem(I(0, "isLocal"), e))
  10577. }
  10578. }
  10579. }),
  10580. v.isUndefined(t.parent)) {
  10581. if (t.closed = !1,
  10582. m.addClass(this.domElement, R.CLASS_MAIN),
  10583. m.makeSelectable(this.domElement, !1),
  10584. x && r) {
  10585. i.useLocalStorage = !0;
  10586. var o = localStorage.getItem(I(0, "gui"));
  10587. o && (t.load = JSON.parse(o))
  10588. }
  10589. this.__closeButton = document.createElement("div"),
  10590. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10591. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10592. this.domElement.appendChild(this.__closeButton),
  10593. m.bind(this.__closeButton, "click", function() {
  10594. i.closed = !i.closed
  10595. })
  10596. } else {
  10597. void 0 === t.closed && (t.closed = !0);
  10598. var a = document.createTextNode(t.name);
  10599. m.addClass(a, "controller-name");
  10600. var s = A(i, a);
  10601. m.addClass(this.__ul, R.CLASS_CLOSED),
  10602. m.addClass(s, "title"),
  10603. m.bind(s, "click", function(e) {
  10604. return e.preventDefault(),
  10605. i.closed = !i.closed,
  10606. !1
  10607. }),
  10608. t.closed || (this.closed = !1)
  10609. }
  10610. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10611. m.addClass(w, "dg"),
  10612. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10613. document.body.appendChild(w),
  10614. S = !1),
  10615. w.appendChild(this.domElement),
  10616. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10617. this.parent || l(i, t.width)),
  10618. m.bind(window, "resize", function() {
  10619. i.onResize()
  10620. }),
  10621. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10622. i.onResize()
  10623. }),
  10624. m.bind(this.__ul, "transitionend", function() {
  10625. i.onResize()
  10626. }),
  10627. m.bind(this.__ul, "oTransitionEnd", function() {
  10628. i.onResize()
  10629. }),
  10630. this.onResize(),
  10631. t.resizable && function(t) {
  10632. function e(e) {
  10633. return e.preventDefault(),
  10634. r = e.clientX,
  10635. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10636. m.bind(window, "mousemove", i),
  10637. m.bind(window, "mouseup", n),
  10638. !1
  10639. }
  10640. function i(e) {
  10641. return e.preventDefault(),
  10642. t.width += r - e.clientX,
  10643. t.onResize(),
  10644. r = e.clientX,
  10645. !1
  10646. }
  10647. function n() {
  10648. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10649. m.unbind(window, "mousemove", i),
  10650. m.unbind(window, "mouseup", n)
  10651. }
  10652. var r;
  10653. t.__resize_handle = document.createElement("div"),
  10654. v.extend(t.__resize_handle.style, {
  10655. width: "6px",
  10656. marginLeft: "-3px",
  10657. height: "200px",
  10658. cursor: "ew-resize",
  10659. position: "absolute"
  10660. }),
  10661. m.bind(t.__resize_handle, "mousedown", e),
  10662. m.bind(t.__closeButton, "mousedown", e),
  10663. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10664. }(this),
  10665. n = function() {
  10666. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10667. }
  10668. ,
  10669. this.saveToLocalStorageIfPossible = n,
  10670. i.getRoot(),
  10671. t.parent || ((e = i.getRoot()).width += 1,
  10672. v.defer(function() {
  10673. e.width -= 1
  10674. }))
  10675. };
  10676. return R.toggleHide = function() {
  10677. s = !s,
  10678. v.each(M, function(e) {
  10679. e.domElement.style.zIndex = s ? -999 : 999,
  10680. e.domElement.style.opacity = s ? 0 : 1
  10681. })
  10682. }
  10683. ,
  10684. R.CLASS_AUTO_PLACE = "a",
  10685. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10686. R.CLASS_MAIN = "main",
  10687. R.CLASS_CONTROLLER_ROW = "cr",
  10688. R.CLASS_TOO_TALL = "taller-than-window",
  10689. R.CLASS_CLOSED = "closed",
  10690. R.CLASS_CLOSE_BUTTON = "close-button",
  10691. R.CLASS_DRAG = "drag",
  10692. R.DEFAULT_WIDTH = 245,
  10693. R.TEXT_CLOSED = "Close Controls",
  10694. R.TEXT_OPEN = "Open Controls",
  10695. m.bind(window, "keydown", function(e) {
  10696. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10697. }, !1),
  10698. v.extend(R.prototype, {
  10699. add: function(e, t) {
  10700. return y(this, e, t, {
  10701. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10702. })
  10703. },
  10704. addColor: function(e, t) {
  10705. return y(this, e, t, {
  10706. color: !0
  10707. })
  10708. },
  10709. remove: function(e) {
  10710. this.__ul.removeChild(e.__li),
  10711. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10712. var t = this;
  10713. v.defer(function() {
  10714. t.onResize()
  10715. })
  10716. },
  10717. destroy: function() {
  10718. this.autoPlace && w.removeChild(this.domElement)
  10719. },
  10720. addFolder: function(e) {
  10721. if (void 0 !== this.__folders[e])
  10722. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10723. var t = {
  10724. name: e,
  10725. parent: this
  10726. };
  10727. t.autoPlace = this.autoPlace,
  10728. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10729. t.load = this.load.folders[e]);
  10730. var i = new R(t);
  10731. this.__folders[e] = i;
  10732. var n = A(this, i.domElement);
  10733. return m.addClass(n, "folder"),
  10734. i
  10735. },
  10736. open: function() {
  10737. this.closed = !1
  10738. },
  10739. close: function() {
  10740. this.closed = !0
  10741. },
  10742. onResize: function() {
  10743. var t = this.getRoot();
  10744. if (t.scrollable) {
  10745. var e = m.getOffset(t.__ul).top
  10746. , i = 0;
  10747. v.each(t.__ul.childNodes, function(e) {
  10748. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10749. }),
  10750. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10751. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10752. t.__ul.style.height = "auto")
  10753. }
  10754. t.__resize_handle && v.defer(function() {
  10755. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10756. }),
  10757. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10758. },
  10759. remember: function() {
  10760. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<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>'),
  10761. this.parent)
  10762. throw new Error("You can only call remember on a top level GUI.");
  10763. var t = this;
  10764. v.each(Array.prototype.slice.call(arguments), function(e) {
  10765. 0 == t.__rememberedObjects.length && function(i) {
  10766. var e = i.__save_row = document.createElement("li");
  10767. m.addClass(i.domElement, "has-save"),
  10768. i.__ul.insertBefore(e, i.__ul.firstChild),
  10769. m.addClass(e, "save-row");
  10770. var t = document.createElement("span");
  10771. t.innerHTML = "&nbsp;",
  10772. m.addClass(t, "button gears");
  10773. var n = document.createElement("span");
  10774. n.innerHTML = "Save",
  10775. m.addClass(n, "button"),
  10776. m.addClass(n, "save");
  10777. var r = document.createElement("span");
  10778. r.innerHTML = "New",
  10779. m.addClass(r, "button"),
  10780. m.addClass(r, "save-as");
  10781. var o = document.createElement("span");
  10782. o.innerHTML = "Revert",
  10783. m.addClass(o, "button"),
  10784. m.addClass(o, "revert");
  10785. var a = i.__preset_select = document.createElement("select");
  10786. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10787. E(i, t, t == i.preset)
  10788. }) : E(i, T, !1),
  10789. m.bind(a, "change", function() {
  10790. for (var e = 0; e < i.__preset_select.length; e++)
  10791. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10792. i.preset = this.value
  10793. }),
  10794. e.appendChild(a),
  10795. e.appendChild(t),
  10796. e.appendChild(n),
  10797. e.appendChild(r),
  10798. e.appendChild(o),
  10799. x) {
  10800. var s = document.getElementById("dg-save-locally")
  10801. , l = document.getElementById("dg-local-explain");
  10802. s.style.display = "block";
  10803. var c = document.getElementById("dg-local-storage");
  10804. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10805. var h = function() {
  10806. l.style.display = i.useLocalStorage ? "block" : "none"
  10807. };
  10808. h(),
  10809. m.bind(c, "change", function() {
  10810. i.useLocalStorage = !i.useLocalStorage,
  10811. h()
  10812. })
  10813. }
  10814. var u = document.getElementById("dg-new-constructor");
  10815. m.bind(u, "keydown", function(e) {
  10816. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10817. }),
  10818. m.bind(t, "click", function() {
  10819. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10820. b.show(),
  10821. u.focus(),
  10822. u.select()
  10823. }),
  10824. m.bind(n, "click", function() {
  10825. i.save()
  10826. }),
  10827. m.bind(r, "click", function() {
  10828. var e = prompt("Enter a new preset name.");
  10829. e && i.saveAs(e)
  10830. }),
  10831. m.bind(o, "click", function() {
  10832. i.revert()
  10833. })
  10834. }(t),
  10835. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10836. }),
  10837. this.autoPlace && l(this, this.width)
  10838. },
  10839. getRoot: function() {
  10840. for (var e = this; e.parent; )
  10841. e = e.parent;
  10842. return e
  10843. },
  10844. getSaveObject: function() {
  10845. var i = this.load;
  10846. return i.closed = this.closed,
  10847. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10848. i.remembered || (i.remembered = {}),
  10849. i.remembered[this.preset] = a(this)),
  10850. i.folders = {},
  10851. v.each(this.__folders, function(e, t) {
  10852. i.folders[t] = e.getSaveObject()
  10853. }),
  10854. i
  10855. },
  10856. save: function() {
  10857. this.load.remembered || (this.load.remembered = {}),
  10858. this.load.remembered[this.preset] = a(this),
  10859. _(this, !1),
  10860. this.saveToLocalStorageIfPossible()
  10861. },
  10862. saveAs: function(e) {
  10863. this.load.remembered || (this.load.remembered = {},
  10864. this.load.remembered[T] = a(this, !0)),
  10865. this.load.remembered[e] = a(this),
  10866. this.preset = e,
  10867. E(this, e, !0),
  10868. this.saveToLocalStorageIfPossible()
  10869. },
  10870. revert: function(t) {
  10871. v.each(this.__controllers, function(e) {
  10872. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10873. }, this),
  10874. v.each(this.__folders, function(e) {
  10875. e.revert(e)
  10876. }),
  10877. t || _(this.getRoot(), !1)
  10878. },
  10879. listen: function(e) {
  10880. var t = 0 == this.__listening.length;
  10881. this.__listening.push(e),
  10882. t && function e(t) {
  10883. 0 != t.length && r(function() {
  10884. e(t)
  10885. }),
  10886. v.each(t, function(e) {
  10887. e.updateDisplay()
  10888. })
  10889. }(this.__listening)
  10890. }
  10891. }),
  10892. R
  10893. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10894. u = ee.controllers.NumberControllerBox,
  10895. d = ee.controllers.NumberControllerSlider,
  10896. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10897. y = ee.dom.dom,
  10898. A = ee.utils.common,
  10899. (C = function(e, t) {
  10900. function i() {
  10901. n.setValue(n.__input.value)
  10902. }
  10903. C.superclass.call(this, e, t);
  10904. var n = this;
  10905. this.__input = document.createElement("input"),
  10906. this.__input.setAttribute("type", "text"),
  10907. y.bind(this.__input, "keyup", i),
  10908. y.bind(this.__input, "change", i),
  10909. y.bind(this.__input, "blur", function() {
  10910. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10911. }),
  10912. y.bind(this.__input, "keydown", function(e) {
  10913. 13 === e.keyCode && this.blur()
  10914. }),
  10915. this.updateDisplay(),
  10916. this.domElement.appendChild(this.__input)
  10917. }
  10918. ).superclass = v,
  10919. A.extend(C.prototype, v.prototype, {
  10920. updateDisplay: function() {
  10921. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10922. C.superclass.prototype.updateDisplay.call(this)
  10923. }
  10924. }),
  10925. C),
  10926. f = ee.controllers.FunctionController,
  10927. g = ee.controllers.BooleanController,
  10928. m = ee.utils.common,
  10929. function(e, t) {
  10930. var i = e[t];
  10931. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10932. min: arguments[2],
  10933. max: arguments[3]
  10934. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10935. }
  10936. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10937. function f(t, i, n, r) {
  10938. t.style.background = "",
  10939. p.each(o, function(e) {
  10940. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10941. })
  10942. }
  10943. var g = function(e, t) {
  10944. function i(e) {
  10945. a(e),
  10946. h.bind(window, "mousemove", a),
  10947. h.bind(window, "mouseup", n)
  10948. }
  10949. function n() {
  10950. h.unbind(window, "mousemove", a),
  10951. h.unbind(window, "mouseup", n)
  10952. }
  10953. function r() {
  10954. var e = d(this.value);
  10955. !1 !== e ? (l.__color.__state = e,
  10956. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10957. }
  10958. function o() {
  10959. h.unbind(window, "mousemove", s),
  10960. h.unbind(window, "mouseup", o)
  10961. }
  10962. function a(e) {
  10963. e.preventDefault();
  10964. var t = h.getWidth(l.__saturation_field)
  10965. , i = h.getOffset(l.__saturation_field)
  10966. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10967. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10968. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10969. 1 < n ? n = 1 : n < 0 && (n = 0),
  10970. l.__color.v = r,
  10971. l.__color.s = n,
  10972. l.setValue(l.__color.toOriginal()),
  10973. !1
  10974. }
  10975. function s(e) {
  10976. e.preventDefault();
  10977. var t = h.getHeight(l.__hue_field)
  10978. , i = h.getOffset(l.__hue_field)
  10979. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10980. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10981. l.__color.h = 360 * n,
  10982. l.setValue(l.__color.toOriginal()),
  10983. !1
  10984. }
  10985. g.superclass.call(this, e, t),
  10986. this.__color = new u(this.getValue()),
  10987. this.__temp = new u(0);
  10988. var l = this;
  10989. this.domElement = document.createElement("div"),
  10990. h.makeSelectable(this.domElement, !1),
  10991. this.__selector = document.createElement("div"),
  10992. this.__selector.className = "selector",
  10993. this.__saturation_field = document.createElement("div"),
  10994. this.__saturation_field.className = "saturation-field",
  10995. this.__field_knob = document.createElement("div"),
  10996. this.__field_knob.className = "field-knob",
  10997. this.__field_knob_border = "2px solid ",
  10998. this.__hue_knob = document.createElement("div"),
  10999. this.__hue_knob.className = "hue-knob",
  11000. this.__hue_field = document.createElement("div"),
  11001. this.__hue_field.className = "hue-field",
  11002. this.__input = document.createElement("input"),
  11003. this.__input.type = "text",
  11004. this.__input_textShadow = "0 1px 1px ",
  11005. h.bind(this.__input, "keydown", function(e) {
  11006. 13 === e.keyCode && r.call(this)
  11007. }),
  11008. h.bind(this.__input, "blur", r),
  11009. h.bind(this.__selector, "mousedown", function(e) {
  11010. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11011. h.removeClass(l.__selector, "drag")
  11012. })
  11013. });
  11014. var c = document.createElement("div");
  11015. p.extend(this.__selector.style, {
  11016. width: "122px",
  11017. height: "102px",
  11018. padding: "3px",
  11019. backgroundColor: "#222",
  11020. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11021. }),
  11022. p.extend(this.__field_knob.style, {
  11023. position: "absolute",
  11024. width: "12px",
  11025. height: "12px",
  11026. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11027. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11028. borderRadius: "12px",
  11029. zIndex: 1
  11030. }),
  11031. p.extend(this.__hue_knob.style, {
  11032. position: "absolute",
  11033. width: "15px",
  11034. height: "2px",
  11035. borderRight: "4px solid #fff",
  11036. zIndex: 1
  11037. }),
  11038. p.extend(this.__saturation_field.style, {
  11039. width: "100px",
  11040. height: "100px",
  11041. border: "1px solid #555",
  11042. marginRight: "3px",
  11043. display: "inline-block",
  11044. cursor: "pointer"
  11045. }),
  11046. p.extend(c.style, {
  11047. width: "100%",
  11048. height: "100%",
  11049. background: "none"
  11050. }),
  11051. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11052. p.extend(this.__hue_field.style, {
  11053. width: "15px",
  11054. height: "100px",
  11055. display: "inline-block",
  11056. border: "1px solid #555",
  11057. cursor: "ns-resize"
  11058. }),
  11059. function(e) {
  11060. e.style.background = "",
  11061. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11062. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11063. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11064. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11065. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11066. }(this.__hue_field),
  11067. p.extend(this.__input.style, {
  11068. outline: "none",
  11069. textAlign: "center",
  11070. color: "#fff",
  11071. border: 0,
  11072. fontWeight: "bold",
  11073. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11074. }),
  11075. h.bind(this.__saturation_field, "mousedown", i),
  11076. h.bind(this.__field_knob, "mousedown", i),
  11077. h.bind(this.__hue_field, "mousedown", function(e) {
  11078. s(e),
  11079. h.bind(window, "mousemove", s),
  11080. h.bind(window, "mouseup", o)
  11081. }),
  11082. this.__saturation_field.appendChild(c),
  11083. this.__selector.appendChild(this.__field_knob),
  11084. this.__selector.appendChild(this.__saturation_field),
  11085. this.__selector.appendChild(this.__hue_field),
  11086. this.__hue_field.appendChild(this.__hue_knob),
  11087. this.domElement.appendChild(this.__input),
  11088. this.domElement.appendChild(this.__selector),
  11089. this.updateDisplay()
  11090. };
  11091. g.superclass = e,
  11092. p.extend(g.prototype, e.prototype, {
  11093. updateDisplay: function() {
  11094. var t = d(this.getValue());
  11095. if (!1 !== t) {
  11096. var i = !1;
  11097. p.each(u.COMPONENTS, function(e) {
  11098. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11099. return i = !0,
  11100. {}
  11101. }, this),
  11102. i && p.extend(this.__color.__state, t)
  11103. }
  11104. p.extend(this.__temp.__state, this.__color.__state),
  11105. this.__temp.a = 1;
  11106. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11107. , n = 255 - e;
  11108. p.extend(this.__field_knob.style, {
  11109. marginLeft: 100 * this.__color.s - 7 + "px",
  11110. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11111. backgroundColor: this.__temp.toString(),
  11112. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11113. }),
  11114. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11115. this.__temp.s = 1,
  11116. this.__temp.v = 1,
  11117. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11118. p.extend(this.__input.style, {
  11119. backgroundColor: this.__input.value = this.__color.toString(),
  11120. color: "rgb(" + e + "," + e + "," + e + ")",
  11121. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11122. })
  11123. }
  11124. });
  11125. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11126. return g
  11127. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11128. a = ee.color.math = {
  11129. hsv_to_rgb: function(e, t, i) {
  11130. var n = Math.floor(e / 60) % 6
  11131. , r = e / 60 - Math.floor(e / 60)
  11132. , o = i * (1 - t)
  11133. , a = i * (1 - r * t)
  11134. , s = i * (1 - (1 - r) * t)
  11135. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11136. return {
  11137. r: 255 * l[0],
  11138. g: 255 * l[1],
  11139. b: 255 * l[2]
  11140. }
  11141. },
  11142. rgb_to_hsv: function(e, t, i) {
  11143. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11144. return 0 == o ? {
  11145. h: NaN,
  11146. s: 0,
  11147. v: 0
  11148. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11149. (n /= 6) < 0 && (n += 1),
  11150. {
  11151. h: 360 * n,
  11152. s: a / o,
  11153. v: o / 255
  11154. })
  11155. },
  11156. rgb_to_hex: function(e, t, i) {
  11157. var n = this.hex_with_component(0, 2, e);
  11158. return n = this.hex_with_component(n, 1, t),
  11159. this.hex_with_component(n, 0, i)
  11160. },
  11161. component_from_hex: function(e, t) {
  11162. return e >> 8 * t & 255
  11163. },
  11164. hex_with_component: function(e, t, i) {
  11165. return i << (c = 8 * t) | e & ~(255 << c)
  11166. }
  11167. },
  11168. s = ee.color.toString,
  11169. l = ee.utils.common,
  11170. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11171. l.extend(ae.prototype, {
  11172. toString: function() {
  11173. return s(this)
  11174. },
  11175. toOriginal: function() {
  11176. return this.__state.conversion.write(this)
  11177. }
  11178. }),
  11179. ie(ae.prototype, "r", 2),
  11180. ie(ae.prototype, "g", 1),
  11181. ie(ae.prototype, "b", 0),
  11182. ne(ae.prototype, "h"),
  11183. ne(ae.prototype, "s"),
  11184. ne(ae.prototype, "v"),
  11185. Object.defineProperty(ae.prototype, "a", {
  11186. get: function() {
  11187. return this.__state.a
  11188. },
  11189. set: function(e) {
  11190. this.__state.a = e
  11191. }
  11192. }),
  11193. Object.defineProperty(ae.prototype, "hex", {
  11194. get: function() {
  11195. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11196. this.__state.hex
  11197. },
  11198. set: function(e) {
  11199. this.__state.space = "HEX",
  11200. this.__state.hex = e
  11201. }
  11202. }),
  11203. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11204. window.setTimeout(e, 1e3 / 60)
  11205. }
  11206. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11207. r = ee.utils.common,
  11208. te.prototype.show = function() {
  11209. var e = this;
  11210. this.backgroundElement.style.display = "block",
  11211. this.domElement.style.display = "block",
  11212. this.domElement.style.opacity = 0,
  11213. this.domElement.style.webkitTransform = "scale(1.1)",
  11214. this.layout(),
  11215. r.defer(function() {
  11216. e.backgroundElement.style.opacity = 1,
  11217. e.domElement.style.opacity = 1,
  11218. e.domElement.style.webkitTransform = "scale(1)"
  11219. })
  11220. }
  11221. ,
  11222. te.prototype.hide = function() {
  11223. var e = this
  11224. , t = function() {
  11225. e.domElement.style.display = "none",
  11226. e.backgroundElement.style.display = "none",
  11227. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11228. n.unbind(e.domElement, "transitionend", t),
  11229. n.unbind(e.domElement, "oTransitionEnd", t)
  11230. };
  11231. n.bind(this.domElement, "webkitTransitionEnd", t),
  11232. n.bind(this.domElement, "transitionend", t),
  11233. n.bind(this.domElement, "oTransitionEnd", t),
  11234. this.backgroundElement.style.opacity = 0,
  11235. this.domElement.style.opacity = 0,
  11236. this.domElement.style.webkitTransform = "scale(1.1)"
  11237. }
  11238. ,
  11239. te.prototype.layout = function() {
  11240. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11241. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11242. }
  11243. ,
  11244. te), ee.dom.dom, ee.utils.common)
  11245. }
  11246. , {}],
  11247. 94: [function(e, t, i) {
  11248. (function(J) {
  11249. "use strict";
  11250. function i(e) {
  11251. function t(e, t) {
  11252. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11253. for (var a = 1; a <= e[o]; a++)
  11254. r[t[n]] = [],
  11255. r[t[n]][0] = i,
  11256. r[t[n]][1] = o,
  11257. n++,
  11258. i++;
  11259. i *= 2
  11260. }
  11261. return r
  11262. }
  11263. function _(e) {
  11264. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11265. t & 1 << i && (B |= 1 << V),
  11266. i--,
  11267. --V < 0 && (255 == B ? (b(255),
  11268. b(0)) : b(B),
  11269. V = 7,
  11270. B = 0)
  11271. }
  11272. function b(e) {
  11273. F.push(e)
  11274. }
  11275. function w(e) {
  11276. b(e >> 8 & 255),
  11277. b(255 & e)
  11278. }
  11279. function T(e, t, i, n, r) {
  11280. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11281. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11282. for (h = 0; h < 8; ++h) {
  11283. i = e[d],
  11284. n = e[d + 1],
  11285. r = e[d + 2],
  11286. o = e[d + 3],
  11287. a = e[d + 4],
  11288. s = e[d + 5],
  11289. l = e[d + 6];
  11290. var p = i + (c = e[d + 7])
  11291. , f = i - c
  11292. , g = n + l
  11293. , m = n - l
  11294. , v = r + s
  11295. , y = r - s
  11296. , A = o + a
  11297. , C = o - a
  11298. , I = p + A
  11299. , E = p - A
  11300. , _ = g + v
  11301. , b = g - v;
  11302. e[d] = I + _,
  11303. e[d + 4] = I - _;
  11304. var w = .707106781 * (b + E);
  11305. e[d + 2] = E + w,
  11306. e[d + 6] = E - w;
  11307. var T = .382683433 * ((I = C + y) - (b = m + f))
  11308. , x = .5411961 * I + T
  11309. , S = 1.306562965 * b + T
  11310. , M = .707106781 * (_ = y + m)
  11311. , R = f + M
  11312. , P = f - M;
  11313. e[d + 5] = P + x,
  11314. e[d + 3] = P - x,
  11315. e[d + 1] = R + S,
  11316. e[d + 7] = R - S,
  11317. d += 8
  11318. }
  11319. for (h = d = 0; h < 8; ++h) {
  11320. i = e[d],
  11321. n = e[d + 8],
  11322. r = e[d + 16],
  11323. o = e[d + 24],
  11324. a = e[d + 32],
  11325. s = e[d + 40],
  11326. l = e[d + 48];
  11327. var O = i + (c = e[d + 56])
  11328. , L = i - c
  11329. , D = n + l
  11330. , N = n - l
  11331. , F = r + s
  11332. , B = r - s
  11333. , V = o + a
  11334. , k = o - a
  11335. , U = O + V
  11336. , H = O - V
  11337. , z = D + F
  11338. , G = D - F;
  11339. e[d] = U + z,
  11340. e[d + 32] = U - z;
  11341. var W = .707106781 * (G + H);
  11342. e[d + 16] = H + W,
  11343. e[d + 48] = H - W;
  11344. var j = .382683433 * ((U = k + B) - (G = N + L))
  11345. , Y = .5411961 * U + j
  11346. , q = 1.306562965 * G + j
  11347. , X = .707106781 * (z = B + N)
  11348. , Z = L + X
  11349. , K = L - X;
  11350. e[d + 40] = K + Y,
  11351. e[d + 24] = K - Y,
  11352. e[d + 8] = Z + q,
  11353. e[d + 56] = Z - q,
  11354. d++
  11355. }
  11356. for (h = 0; h < 64; ++h)
  11357. u = e[h] * t[h],
  11358. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11359. return Q
  11360. }(e, t), c = 0; c < 64; ++c)
  11361. A[C[c]] = l[c];
  11362. var h = A[0] - i;
  11363. i = A[0],
  11364. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11365. _(v[o]));
  11366. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11367. ;
  11368. if (0 == u)
  11369. return _(a),
  11370. i;
  11371. for (var d, p = 1; p <= u; ) {
  11372. for (var f = p; 0 == A[p] && p <= u; ++p)
  11373. ;
  11374. var g = p - f;
  11375. if (16 <= g) {
  11376. d = g >> 4;
  11377. for (var m = 1; m <= d; ++m)
  11378. _(s);
  11379. g &= 15
  11380. }
  11381. o = 32767 + A[p],
  11382. _(r[(g << 4) + y[o]]),
  11383. _(v[o]),
  11384. p++
  11385. }
  11386. return 63 != u && _(a),
  11387. i
  11388. }
  11389. function x(e) {
  11390. if (e <= 0 && (e = 1),
  11391. 100 < e && (e = 100),
  11392. i != e) {
  11393. (function(e) {
  11394. 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++) {
  11395. var n = u((t[i] * e + 50) / 100);
  11396. n < 1 ? n = 1 : 255 < n && (n = 255),
  11397. O[C[i]] = n
  11398. }
  11399. 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++) {
  11400. var a = u((r[o] * e + 50) / 100);
  11401. a < 1 ? a = 1 : 255 < a && (a = 255),
  11402. L[C[o]] = a
  11403. }
  11404. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11405. for (var h = 0; h < 8; h++)
  11406. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11407. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11408. l++
  11409. }
  11410. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11411. i = e
  11412. }
  11413. }
  11414. var S, M, R, P, i, u = (Math.round,
  11415. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [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], G = [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], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [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];
  11416. this.encode = function(e, t) {
  11417. var i = ((new Date).getTime(),
  11418. t.quality);
  11419. i && x(i),
  11420. F = new Array,
  11421. B = 0,
  11422. V = 7,
  11423. w(65496),
  11424. w(65504),
  11425. w(16),
  11426. b(74),
  11427. b(70),
  11428. b(73),
  11429. b(70),
  11430. b(0),
  11431. b(1),
  11432. b(1),
  11433. b(0),
  11434. w(1),
  11435. w(1),
  11436. b(0),
  11437. b(0),
  11438. function() {
  11439. w(65499),
  11440. w(132),
  11441. b(0);
  11442. for (var e = 0; e < 64; e++)
  11443. b(O[e]);
  11444. b(1);
  11445. for (var t = 0; t < 64; t++)
  11446. b(L[t])
  11447. }(),
  11448. function(e, t) {
  11449. w(65472),
  11450. w(17),
  11451. b(8),
  11452. w(t),
  11453. w(e),
  11454. b(3),
  11455. b(1),
  11456. b(17),
  11457. b(0),
  11458. b(2),
  11459. b(17),
  11460. b(1),
  11461. b(3),
  11462. b(17),
  11463. b(1)
  11464. }(e.width, e.height),
  11465. function() {
  11466. w(65476),
  11467. w(418),
  11468. b(0);
  11469. for (var e = 0; e < 16; e++)
  11470. b(G[e + 1]);
  11471. for (var t = 0; t <= 11; t++)
  11472. b(W[t]);
  11473. b(16);
  11474. for (var i = 0; i < 16; i++)
  11475. b(j[i + 1]);
  11476. for (var n = 0; n <= 161; n++)
  11477. b(Y[n]);
  11478. b(1);
  11479. for (var r = 0; r < 16; r++)
  11480. b(q[r + 1]);
  11481. for (var o = 0; o <= 11; o++)
  11482. b(X[o]);
  11483. b(17);
  11484. for (var a = 0; a < 16; a++)
  11485. b(Z[a + 1]);
  11486. for (var s = 0; s <= 161; s++)
  11487. b(K[s])
  11488. }(),
  11489. w(65498),
  11490. w(12),
  11491. b(3),
  11492. b(1),
  11493. b(0),
  11494. b(2),
  11495. b(17),
  11496. b(3),
  11497. b(17),
  11498. b(0),
  11499. b(63),
  11500. b(0);
  11501. var n = 0
  11502. , r = 0
  11503. , o = 0;
  11504. B = 0,
  11505. V = 7,
  11506. this.encode.displayName = "_encode_";
  11507. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11508. for (a = 0; a < A; ) {
  11509. for (u = h = A * C + a,
  11510. d = -1,
  11511. f = p = 0; f < 64; f++)
  11512. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11513. v <= C + p && (u -= A * (C + 1 + p - v)),
  11514. A <= a + d && (u -= a + d - A + 4),
  11515. s = g[u++],
  11516. l = g[u++],
  11517. c = g[u++],
  11518. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11519. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11520. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11521. n = T(k, D, n, S, R),
  11522. r = T(U, N, r, M, P),
  11523. o = T(H, N, o, M, P),
  11524. a += 32
  11525. }
  11526. C += I
  11527. }
  11528. if (0 <= V) {
  11529. var E = [];
  11530. E[1] = V + 1,
  11531. E[0] = (1 << V + 1) - 1,
  11532. _(E)
  11533. }
  11534. return w(65497),
  11535. new J(F)
  11536. }
  11537. ,
  11538. (new Date).getTime(),
  11539. e = e || 50,
  11540. function() {
  11541. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11542. n[t] = e(t)
  11543. }(),
  11544. S = t(G, W),
  11545. M = t(q, X),
  11546. R = t(j, Y),
  11547. P = t(Z, K),
  11548. function() {
  11549. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11550. for (var n = e; n < t; n++)
  11551. y[32767 + n] = i,
  11552. v[32767 + n] = [],
  11553. v[32767 + n][1] = i,
  11554. v[32767 + n][0] = n;
  11555. for (var r = -(t - 1); r <= -e; r++)
  11556. y[32767 + r] = i,
  11557. v[32767 + r] = [],
  11558. v[32767 + r][1] = i,
  11559. v[32767 + r][0] = t - 1 + r;
  11560. e <<= 1,
  11561. t <<= 1
  11562. }
  11563. }(),
  11564. function() {
  11565. for (var e = 0; e < 256; e++)
  11566. z[e] = 19595 * e,
  11567. z[e + 256 >> 0] = 38470 * e,
  11568. z[e + 512 >> 0] = 7471 * e + 32768,
  11569. z[e + 768 >> 0] = -11059 * e,
  11570. z[e + 1024 >> 0] = -21709 * e,
  11571. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11572. z[e + 1536 >> 0] = -27439 * e,
  11573. z[e + 1792 >> 0] = -5329 * e
  11574. }(),
  11575. x(e),
  11576. (new Date).getTime()
  11577. }
  11578. t.exports.encode = function(e, t) {
  11579. return (t = t || {}).quality = t.quality || 50,
  11580. {
  11581. data: new i(t.quality).encode(e, t),
  11582. width: e.width,
  11583. height: e.height
  11584. }
  11585. }
  11586. }
  11587. ).call(this, e("buffer").Buffer)
  11588. }
  11589. , {
  11590. buffer: 198
  11591. }],
  11592. 95: [function(e, t, i) {
  11593. "use strict";
  11594. !function() {
  11595. if ("performance"in window == 0 && (window.performance = {}),
  11596. Date.now = Date.now || function() {
  11597. return (new Date).getTime()
  11598. }
  11599. ,
  11600. "now"in window.performance == 0) {
  11601. var e = Date.now();
  11602. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11603. window.performance.now = function() {
  11604. return Date.now() - e
  11605. }
  11606. }
  11607. }()
  11608. }
  11609. , {}],
  11610. 96: [function(e, t, i) {
  11611. "use strict";
  11612. var a = e("three");
  11613. a.EffectComposer = function(e, t) {
  11614. if (this.renderer = e,
  11615. void 0 === t) {
  11616. var i = {
  11617. minFilter: a.LinearFilter,
  11618. magFilter: a.LinearFilter,
  11619. format: a.RGBAFormat,
  11620. stencilBuffer: !1
  11621. }
  11622. , n = e.getSize();
  11623. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11624. }
  11625. this.renderTarget1 = t,
  11626. this.renderTarget2 = t.clone(),
  11627. this.writeBuffer = this.renderTarget1,
  11628. this.readBuffer = this.renderTarget2,
  11629. this.passes = [],
  11630. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11631. this.copyPass = new a.ShaderPass(a.CopyShader)
  11632. }
  11633. ,
  11634. a.EffectComposer.prototype = {
  11635. swapBuffers: function() {
  11636. var e = this.readBuffer;
  11637. this.readBuffer = this.writeBuffer,
  11638. this.writeBuffer = e
  11639. },
  11640. addPass: function(e) {
  11641. this.passes.push(e)
  11642. },
  11643. insertPass: function(e, t) {
  11644. this.passes.splice(t, 0, e)
  11645. },
  11646. render: function(e) {
  11647. this.writeBuffer = this.renderTarget1,
  11648. this.readBuffer = this.renderTarget2;
  11649. var t, i, n = !1, r = this.passes.length;
  11650. for (i = 0; i < r; i++)
  11651. if ((t = this.passes[i]).enabled) {
  11652. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11653. t.needsSwap) {
  11654. if (n) {
  11655. var o = this.renderer.context;
  11656. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11657. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11658. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11659. }
  11660. this.swapBuffers()
  11661. }
  11662. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11663. }
  11664. },
  11665. reset: function(e) {
  11666. if (void 0 === e) {
  11667. var t = this.renderer.getSize();
  11668. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11669. }
  11670. this.renderTarget1.dispose(),
  11671. this.renderTarget2.dispose(),
  11672. this.renderTarget1 = e,
  11673. this.renderTarget2 = e.clone(),
  11674. this.writeBuffer = this.renderTarget1,
  11675. this.readBuffer = this.renderTarget2
  11676. },
  11677. setSize: function(e, t) {
  11678. this.renderTarget1.setSize(e, t),
  11679. this.renderTarget2.setSize(e, t)
  11680. }
  11681. }
  11682. }
  11683. , {
  11684. three: 217
  11685. }],
  11686. 97: [function(e, t, i) {
  11687. "use strict";
  11688. var n = e("three");
  11689. n.MaskPass = function(e, t) {
  11690. this.scene = e,
  11691. this.camera = t,
  11692. this.enabled = !0,
  11693. this.clear = !0,
  11694. this.needsSwap = !1,
  11695. this.inverse = !1
  11696. }
  11697. ,
  11698. n.MaskPass.prototype = {
  11699. render: function(e, t, i, n) {
  11700. var r, o, a = e.context;
  11701. a.colorMask(!1, !1, !1, !1),
  11702. a.depthMask(!1),
  11703. o = this.inverse ? (r = 0,
  11704. 1) : (r = 1,
  11705. 0),
  11706. a.enable(a.STENCIL_TEST),
  11707. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11708. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11709. a.clearStencil(o),
  11710. e.render(this.scene, this.camera, i, this.clear),
  11711. e.render(this.scene, this.camera, t, this.clear),
  11712. a.colorMask(!0, !0, !0, !0),
  11713. a.depthMask(!0),
  11714. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11715. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11716. }
  11717. },
  11718. n.ClearMaskPass = function() {
  11719. this.enabled = !0
  11720. }
  11721. ,
  11722. n.ClearMaskPass.prototype = {
  11723. render: function(e, t, i, n) {
  11724. var r = e.context;
  11725. r.disable(r.STENCIL_TEST)
  11726. }
  11727. }
  11728. }
  11729. , {
  11730. three: 217
  11731. }],
  11732. 98: [function(e, t, i) {
  11733. "use strict";
  11734. var o = e("three");
  11735. o.RenderPass = function(e, t, i, n, r) {
  11736. this.scene = e,
  11737. this.camera = t,
  11738. this.overrideMaterial = i,
  11739. this.clearColor = n,
  11740. this.clearAlpha = void 0 !== r ? r : 1,
  11741. this.oldClearColor = new o.Color,
  11742. this.oldClearAlpha = 1,
  11743. this.enabled = !0,
  11744. this.clear = !0,
  11745. this.needsSwap = !1
  11746. }
  11747. ,
  11748. o.RenderPass.prototype = {
  11749. render: function(e, t, i, n) {
  11750. this.scene.overrideMaterial = this.overrideMaterial,
  11751. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11752. this.oldClearAlpha = e.getClearAlpha(),
  11753. e.setClearColor(this.clearColor, this.clearAlpha)),
  11754. e.render(this.scene, this.camera, i, this.clear),
  11755. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11756. this.scene.overrideMaterial = null
  11757. }
  11758. }
  11759. }
  11760. , {
  11761. three: 217
  11762. }],
  11763. 99: [function(e, t, i) {
  11764. "use strict";
  11765. var n = e("three");
  11766. n.ShaderPass = function(e, t) {
  11767. this.textureID = void 0 !== t ? t : "tDiffuse",
  11768. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11769. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11770. this.material = new n.ShaderMaterial({
  11771. defines: e.defines || {},
  11772. uniforms: this.uniforms,
  11773. vertexShader: e.vertexShader,
  11774. fragmentShader: e.fragmentShader
  11775. })),
  11776. this.renderToScreen = !1,
  11777. this.enabled = !0,
  11778. this.needsSwap = !0,
  11779. this.clear = !1,
  11780. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11781. this.scene = new n.Scene,
  11782. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11783. this.scene.add(this.quad)
  11784. }
  11785. ,
  11786. n.ShaderPass.prototype = {
  11787. render: function(e, t, i, n) {
  11788. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11789. this.quad.material = this.material,
  11790. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11791. }
  11792. }
  11793. }
  11794. , {
  11795. three: 217
  11796. }],
  11797. 100: [function(e, t, i) {
  11798. "use strict";
  11799. e("three").CopyShader = {
  11800. uniforms: {
  11801. tDiffuse: {
  11802. type: "t",
  11803. value: null
  11804. },
  11805. opacity: {
  11806. type: "f",
  11807. value: 1
  11808. }
  11809. },
  11810. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11811. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11812. }
  11813. }
  11814. , {
  11815. three: 217
  11816. }],
  11817. 101: [function(e, t, i) {
  11818. "use strict";
  11819. e("three").HorizontalBlurShader = {
  11820. uniforms: {
  11821. tDiffuse: {
  11822. type: "t",
  11823. value: null
  11824. },
  11825. h: {
  11826. type: "f",
  11827. value: 1 / 512
  11828. }
  11829. },
  11830. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11831. 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")
  11832. }
  11833. }
  11834. , {
  11835. three: 217
  11836. }],
  11837. 102: [function(e, t, i) {
  11838. "use strict";
  11839. e("three").VerticalBlurShader = {
  11840. uniforms: {
  11841. tDiffuse: {
  11842. type: "t",
  11843. value: null
  11844. },
  11845. v: {
  11846. type: "f",
  11847. value: 1 / 512
  11848. }
  11849. },
  11850. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11851. 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")
  11852. }
  11853. }
  11854. , {
  11855. three: 217
  11856. }],
  11857. 103: [function(e, t, i) {
  11858. "use strict";
  11859. var z = e("three");
  11860. !function() {
  11861. if ("performance"in window == 0 && (window.performance = {}),
  11862. "now"in window.performance == 0) {
  11863. var e = Date.now();
  11864. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11865. window.performance.now = function() {
  11866. return Date.now() - e
  11867. }
  11868. }
  11869. }(),
  11870. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11871. var t, i = this.extensions, n = this.context;
  11872. if (e === z.RepeatWrapping)
  11873. return n.REPEAT;
  11874. if (e === z.ClampToEdgeWrapping)
  11875. return n.CLAMP_TO_EDGE;
  11876. if (e === z.MirroredRepeatWrapping)
  11877. return n.MIRRORED_REPEAT;
  11878. if (e === z.NearestFilter)
  11879. return n.NEAREST;
  11880. if (e === z.NearestMipMapNearestFilter)
  11881. return n.NEAREST_MIPMAP_NEAREST;
  11882. if (e === z.NearestMipMapLinearFilter)
  11883. return n.NEAREST_MIPMAP_LINEAR;
  11884. if (e === z.LinearFilter)
  11885. return n.LINEAR;
  11886. if (e === z.LinearMipMapNearestFilter)
  11887. return n.LINEAR_MIPMAP_NEAREST;
  11888. if (e === z.LinearMipMapLinearFilter)
  11889. return n.LINEAR_MIPMAP_LINEAR;
  11890. if (e === z.UnsignedByteType)
  11891. return n.UNSIGNED_BYTE;
  11892. if (e === z.UnsignedShort4444Type)
  11893. return n.UNSIGNED_SHORT_4_4_4_4;
  11894. if (e === z.UnsignedShort5551Type)
  11895. return n.UNSIGNED_SHORT_5_5_5_1;
  11896. if (e === z.UnsignedShort565Type)
  11897. return n.UNSIGNED_SHORT_5_6_5;
  11898. if (e === z.ByteType)
  11899. return n.BYTE;
  11900. if (e === z.ShortType)
  11901. return n.SHORT;
  11902. if (e === z.UnsignedShortType)
  11903. return n.UNSIGNED_SHORT;
  11904. if (e === z.IntType)
  11905. return n.INT;
  11906. if (e === z.UnsignedIntType)
  11907. return n.UNSIGNED_INT;
  11908. if (e === z.FloatType)
  11909. return n.FLOAT;
  11910. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11911. return t.HALF_FLOAT_OES;
  11912. if (e === z.AlphaFormat)
  11913. return n.ALPHA;
  11914. if (e === z.RGBFormat)
  11915. return n.RGB;
  11916. if (e === z.RGBAFormat)
  11917. return n.RGBA;
  11918. if (e === z.LuminanceFormat)
  11919. return n.LUMINANCE;
  11920. if (e === z.LuminanceAlphaFormat)
  11921. return n.LUMINANCE_ALPHA;
  11922. if (e === z.AddEquation)
  11923. return n.FUNC_ADD;
  11924. if (e === z.SubtractEquation)
  11925. return n.FUNC_SUBTRACT;
  11926. if (e === z.ReverseSubtractEquation)
  11927. return n.FUNC_REVERSE_SUBTRACT;
  11928. if (e === z.ZeroFactor)
  11929. return n.ZERO;
  11930. if (e === z.OneFactor)
  11931. return n.ONE;
  11932. if (e === z.SrcColorFactor)
  11933. return n.SRC_COLOR;
  11934. if (e === z.OneMinusSrcColorFactor)
  11935. return n.ONE_MINUS_SRC_COLOR;
  11936. if (e === z.SrcAlphaFactor)
  11937. return n.SRC_ALPHA;
  11938. if (e === z.OneMinusSrcAlphaFactor)
  11939. return n.ONE_MINUS_SRC_ALPHA;
  11940. if (e === z.DstAlphaFactor)
  11941. return n.DST_ALPHA;
  11942. if (e === z.OneMinusDstAlphaFactor)
  11943. return n.ONE_MINUS_DST_ALPHA;
  11944. if (e === z.DstColorFactor)
  11945. return n.DST_COLOR;
  11946. if (e === z.OneMinusDstColorFactor)
  11947. return n.ONE_MINUS_DST_COLOR;
  11948. if (e === z.SrcAlphaSaturateFactor)
  11949. return n.SRC_ALPHA_SATURATE;
  11950. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11951. if (e === z.RGB_S3TC_DXT1_Format)
  11952. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11953. if (e === z.RGBA_S3TC_DXT1_Format)
  11954. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11955. if (e === z.RGBA_S3TC_DXT3_Format)
  11956. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11957. if (e === z.RGBA_S3TC_DXT5_Format)
  11958. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11959. }
  11960. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11961. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11962. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11963. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11964. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11965. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11966. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11967. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11968. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11969. }
  11970. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11971. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11972. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11973. if (e === z.MinEquation)
  11974. return t.MIN_EXT;
  11975. if (e === z.MaxEquation)
  11976. return t.MAX_EXT
  11977. }
  11978. return 0
  11979. }
  11980. ,
  11981. z.WebGLState = function(l, i, c) {
  11982. var n = this
  11983. , r = new z.Vector4
  11984. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11985. , o = new Uint8Array(e)
  11986. , a = new Uint8Array(e)
  11987. , s = new Uint8Array(e)
  11988. , t = {}
  11989. , h = null
  11990. , u = null
  11991. , d = null
  11992. , p = null
  11993. , f = null
  11994. , g = null
  11995. , m = null
  11996. , v = null
  11997. , y = !1
  11998. , A = null
  11999. , C = null
  12000. , I = null
  12001. , E = null
  12002. , _ = null
  12003. , b = null
  12004. , w = null
  12005. , T = null
  12006. , x = null
  12007. , S = null
  12008. , M = null
  12009. , R = null
  12010. , P = null
  12011. , O = null
  12012. , L = null
  12013. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12014. , N = void 0
  12015. , F = {}
  12016. , B = new z.Vector4
  12017. , V = null
  12018. , k = null
  12019. , U = new z.Vector4
  12020. , H = new z.Vector4;
  12021. this.init = function() {
  12022. this.clearColor(0, 0, 0, 1),
  12023. this.clearDepth(1),
  12024. this.clearStencil(0),
  12025. this.enable(l.DEPTH_TEST),
  12026. l.depthFunc(l.LEQUAL),
  12027. l.frontFace(l.CCW),
  12028. l.cullFace(l.BACK),
  12029. this.enable(l.CULL_FACE),
  12030. this.enable(l.BLEND),
  12031. l.blendEquation(l.FUNC_ADD),
  12032. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12033. }
  12034. ,
  12035. this.initAttributes = function() {
  12036. for (var e = 0, t = o.length; e < t; e++)
  12037. o[e] = 0
  12038. }
  12039. ,
  12040. this.enableAttribute = function(e) {
  12041. o[e] = 1,
  12042. 0 === a[e] && (l.enableVertexAttribArray(e),
  12043. a[e] = 1),
  12044. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12045. s[e] = 0)
  12046. }
  12047. ,
  12048. this.enableAttributeAndDivisor = function(e, t, i) {
  12049. o[e] = 1,
  12050. 0 === a[e] && (l.enableVertexAttribArray(e),
  12051. a[e] = 1),
  12052. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12053. s[e] = t)
  12054. }
  12055. ,
  12056. this.disableUnusedAttributes = function() {
  12057. for (var e = 0, t = a.length; e < t; e++)
  12058. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12059. a[e] = 0)
  12060. }
  12061. ,
  12062. this.enable = function(e) {
  12063. !0 !== t[e] && (l.enable(e),
  12064. t[e] = !0)
  12065. }
  12066. ,
  12067. this.disable = function(e) {
  12068. !1 !== t[e] && (l.disable(e),
  12069. t[e] = !1)
  12070. }
  12071. ,
  12072. this.getCompressedTextureFormats = function() {
  12073. if (null === h && (h = [],
  12074. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12075. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12076. h.push(e[t]);
  12077. return h
  12078. }
  12079. ,
  12080. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12081. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12082. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12083. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12084. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12085. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12086. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12087. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12088. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12089. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12090. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12091. u = e,
  12092. y = s),
  12093. e === z.CustomBlending ? (r = r || t,
  12094. o = o || i,
  12095. a = a || n,
  12096. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12097. d = t,
  12098. g = r),
  12099. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12100. p = i,
  12101. f = n,
  12102. m = o,
  12103. v = a)) : v = m = g = f = p = d = null
  12104. }
  12105. ,
  12106. this.setDepthFunc = function(e) {
  12107. if (A !== e) {
  12108. if (e)
  12109. switch (e) {
  12110. case z.NeverDepth:
  12111. l.depthFunc(l.NEVER);
  12112. break;
  12113. case z.AlwaysDepth:
  12114. l.depthFunc(l.ALWAYS);
  12115. break;
  12116. case z.LessDepth:
  12117. l.depthFunc(l.LESS);
  12118. break;
  12119. case z.LessEqualDepth:
  12120. l.depthFunc(l.LEQUAL);
  12121. break;
  12122. case z.EqualDepth:
  12123. l.depthFunc(l.EQUAL);
  12124. break;
  12125. case z.GreaterEqualDepth:
  12126. l.depthFunc(l.GEQUAL);
  12127. break;
  12128. case z.GreaterDepth:
  12129. l.depthFunc(l.GREATER);
  12130. break;
  12131. case z.NotEqualDepth:
  12132. l.depthFunc(l.NOTEQUAL);
  12133. break;
  12134. default:
  12135. l.depthFunc(l.LEQUAL)
  12136. }
  12137. else
  12138. l.depthFunc(l.LEQUAL);
  12139. A = e
  12140. }
  12141. }
  12142. ,
  12143. this.setDepthTest = function(e) {
  12144. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12145. }
  12146. ,
  12147. this.setDepthWrite = function(e) {
  12148. C !== e && (l.depthMask(e),
  12149. C = e)
  12150. }
  12151. ,
  12152. this.setColorWrite = function(e) {
  12153. I !== e && (l.colorMask(e, e, e, e),
  12154. I = e)
  12155. }
  12156. ,
  12157. this.setStencilFunc = function(e, t, i) {
  12158. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12159. _ = e,
  12160. b = t,
  12161. w = i)
  12162. }
  12163. ,
  12164. this.setStencilOp = function(e, t, i) {
  12165. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12166. T = e,
  12167. x = t,
  12168. S = i)
  12169. }
  12170. ,
  12171. this.setStencilTest = function(e) {
  12172. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12173. }
  12174. ,
  12175. this.setStencilWrite = function(e) {
  12176. E !== e && (l.stencilMask(e),
  12177. E = e)
  12178. }
  12179. ,
  12180. this.setFlipSided = function(e) {
  12181. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12182. M = e)
  12183. }
  12184. ,
  12185. this.setLineWidth = function(e) {
  12186. e !== R && (l.lineWidth(e),
  12187. R = e)
  12188. }
  12189. ,
  12190. this.setPolygonOffset = function(e, t, i) {
  12191. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12192. !e || P === t && O === i || (l.polygonOffset(t, i),
  12193. P = t,
  12194. O = i)
  12195. }
  12196. ,
  12197. this.getScissorTest = function() {
  12198. return L
  12199. }
  12200. ,
  12201. this.setScissorTest = function(e) {
  12202. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12203. }
  12204. ,
  12205. this.activeTexture = function(e) {
  12206. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12207. N !== e && (l.activeTexture(e),
  12208. N = e)
  12209. }
  12210. ,
  12211. this.bindTexture = function(e, t) {
  12212. void 0 === N && n.activeTexture();
  12213. var i = F[N];
  12214. void 0 === i && (i = {
  12215. type: void 0,
  12216. texture: void 0
  12217. },
  12218. F[N] = i),
  12219. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12220. i.type = e,
  12221. i.texture = t)
  12222. }
  12223. ,
  12224. this.compressedTexImage2D = function() {
  12225. try {
  12226. l.compressedTexImage2D.apply(l, arguments)
  12227. } catch (e) {
  12228. console.error(e)
  12229. }
  12230. }
  12231. ,
  12232. this.texImage2D = function() {
  12233. try {
  12234. l.texImage2D.apply(l, arguments)
  12235. } catch (e) {
  12236. console.error(e)
  12237. }
  12238. }
  12239. ,
  12240. this.clearColor = function(e, t, i, n) {
  12241. r.set(e, t, i, n),
  12242. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12243. B.copy(r))
  12244. }
  12245. ,
  12246. this.clearDepth = function(e) {
  12247. V !== e && (l.clearDepth(e),
  12248. V = e)
  12249. }
  12250. ,
  12251. this.clearStencil = function(e) {
  12252. k !== e && (l.clearStencil(e),
  12253. k = e)
  12254. }
  12255. ,
  12256. this.scissor = function(e) {
  12257. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12258. U.copy(e))
  12259. }
  12260. ,
  12261. this.viewport = function(e) {
  12262. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12263. H.copy(e))
  12264. }
  12265. ,
  12266. this.reset = function() {
  12267. for (var e = 0; e < a.length; e++)
  12268. 1 === a[e] && (l.disableVertexAttribArray(e),
  12269. a[e] = 0);
  12270. t = {},
  12271. N = void 0,
  12272. F = {},
  12273. M = E = C = I = u = h = null
  12274. }
  12275. }
  12276. }
  12277. , {
  12278. three: 217
  12279. }],
  12280. 104: [function(a, h, e) {
  12281. (function(i, e) {
  12282. "use strict";
  12283. function t(e) {
  12284. this.urls = e;
  12285. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12286. this.builder = n.loadProto(t),
  12287. this.decoder = this.builder.build("binary_mesh")
  12288. }
  12289. var s = a("three")
  12290. , n = a("protobufjs")
  12291. , r = a("../util/logger")
  12292. , o = (a("../util/common"),
  12293. a("../util/ajax"))
  12294. , l = a("../objects/Chunk")
  12295. , c = new r(e);
  12296. t.prototype = {
  12297. constructor: t,
  12298. load: function(t, i, n, r) {
  12299. return c.time("download"),
  12300. o.get(t, {
  12301. responseType: "arraybuffer"
  12302. }).done(function(e) {
  12303. c.timeEnd("download"),
  12304. this.parse(e, t, i, n, r)
  12305. }
  12306. .bind(this)).fail(r)
  12307. },
  12308. parse: function(e, t, i, n, r) {
  12309. var o = this.readProtobuf(e);
  12310. if (!o)
  12311. return r();
  12312. try {
  12313. c.time("convert to webgl"),
  12314. this.convertProtobufToSceneObject(o, t, i, n, r),
  12315. c.timeEnd("convert to webgl")
  12316. } catch (e) {
  12317. return c.error("failed parsing .dam"),
  12318. c.error(e.message),
  12319. r()
  12320. }
  12321. },
  12322. readProtobuf: function(e) {
  12323. var t;
  12324. try {
  12325. c.time("parse proto"),
  12326. t = this.decoder.decode(e),
  12327. c.timeEnd("parse proto")
  12328. } catch (e) {
  12329. return c.error("failed parsing proto for .dam"),
  12330. c.error(e.message),
  12331. null
  12332. }
  12333. return t
  12334. },
  12335. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12336. if (0 === e.chunk.length)
  12337. return c.warn("No chunks in damfile..."),
  12338. t([]);
  12339. var o = new s.Matrix4;
  12340. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12341. var a = e.chunk.map(function(e) {
  12342. var t = new s.BufferGeometry;
  12343. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12344. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12345. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12346. t.applyMatrix(o),
  12347. t.computeBoundingBox(),
  12348. new l({
  12349. geometry: t,
  12350. textureName: e.material_name,
  12351. name: e.chunk_name,
  12352. meshUrl: i
  12353. })
  12354. });
  12355. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12356. r())
  12357. }
  12358. },
  12359. h.exports = t
  12360. }
  12361. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12362. }
  12363. , {
  12364. "../objects/Chunk": 144,
  12365. "../util/ajax": 181,
  12366. "../util/common": 185,
  12367. "../util/logger": 189,
  12368. buffer: 198,
  12369. protobufjs: 214,
  12370. three: 217
  12371. }],
  12372. 105: [function(n, r, e) {
  12373. (function(e) {
  12374. "use strict";
  12375. var t = (n("three"),
  12376. n("../settings"),
  12377. n("../util/browser"),
  12378. n("./DamLoader"))
  12379. , i = n("../util/logger")
  12380. , u = (n("../ab"),
  12381. new i(e));
  12382. r.exports = {
  12383. getLoaders: function() {
  12384. return [["_50k", ".dam", t], ["", ".dam", t]]
  12385. },
  12386. load: function(e, t, i, n, r, o) {
  12387. var a = this.getLoaders()[o = o || 0];
  12388. if (a) {
  12389. var s = a[0]
  12390. , l = a[1]
  12391. , c = new a[2](t)
  12392. , h = t.get(e + s + l);
  12393. h ? (u.debug("Trying " + s + l),
  12394. c.load(h, i, n, function() {
  12395. this.load(e, t, i, n, r, ++o)
  12396. }
  12397. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12398. this.load(e, t, i, n, r, ++o))
  12399. } else
  12400. r && r("No suitable model file found...")
  12401. }
  12402. }
  12403. }
  12404. ).call(this, "/js/loaders/ModelLoader.js")
  12405. }
  12406. , {
  12407. "../ab": 3,
  12408. "../settings": 166,
  12409. "../util/browser": 182,
  12410. "../util/logger": 189,
  12411. "./DamLoader": 104,
  12412. three: 217
  12413. }],
  12414. 106: [function(i, n, e) {
  12415. (function(e) {
  12416. "use strict";
  12417. var l = i("../util/common")
  12418. , c = i("../util/texture")
  12419. , h = i("../util/browser")
  12420. , t = i("../util/logger")
  12421. , u = i("../settings")
  12422. , d = new t(e);
  12423. n.exports = {
  12424. load: function(i, n) {
  12425. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12426. return $.when();
  12427. var r = l.countUnique(i.chunks.map(function(e) {
  12428. return e.textureName
  12429. }))
  12430. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12431. , t = "_50k" == e ? "high" : "low";
  12432. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12433. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12434. t = "low"));
  12435. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12436. , a = $.Deferred()
  12437. , s = 0;
  12438. return i.chunks.forEach(function(e) {
  12439. if (!e.material.map && e.textureName) {
  12440. var t = i.urls.get(o + e.textureName);
  12441. e.setTextureMap(c.load(t, function(e, t) {
  12442. e || (n.push(t),
  12443. s++,
  12444. a.notify(s, r),
  12445. s === r && a.resolve())
  12446. }
  12447. .bind(this, c.isLoaded(t))))
  12448. }
  12449. }),
  12450. a.promise()
  12451. }
  12452. }
  12453. }
  12454. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12455. }
  12456. , {
  12457. "../settings": 166,
  12458. "../util/browser": 182,
  12459. "../util/common": 185,
  12460. "../util/logger": 189,
  12461. "../util/texture": 194
  12462. }],
  12463. 107: [function(s, l, e) {
  12464. (function(n, e) {
  12465. "use strict";
  12466. function t(e) {
  12467. this.model = e,
  12468. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12469. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12470. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12471. , i = r.loadProto(t);
  12472. this.decoder = i.build("VisionModeldata")
  12473. }
  12474. var r = s("protobufjs")
  12475. , i = s("../util/ajax")
  12476. , o = (s("../util/common"),
  12477. s("../util/math"))
  12478. , a = new (s("../util/logger"))(e);
  12479. t.prototype.load = function() {
  12480. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12481. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12482. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12483. $.when([]))
  12484. }
  12485. ,
  12486. t.prototype.loadVisionModelData = function() {
  12487. return i.get(this.modelDataPath, {
  12488. responseType: "arraybuffer"
  12489. }).then(function(e) {
  12490. var t;
  12491. try {
  12492. t = this.decoder.decode(e)
  12493. } catch (e) {
  12494. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12495. this.loadSweepLocationsCSV()
  12496. }
  12497. var i = t.sweepLocations.map(function(e) {
  12498. return {
  12499. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12500. position: {
  12501. x: e.pose.translation.x,
  12502. y: e.pose.translation.y,
  12503. z: e.pose.translation.z
  12504. },
  12505. quaternion: {
  12506. x: e.pose.rotation.x,
  12507. y: e.pose.rotation.y,
  12508. z: e.pose.rotation.z,
  12509. w: e.pose.rotation.w
  12510. },
  12511. puck: {
  12512. x: e.puck.x,
  12513. y: e.puck.y,
  12514. z: e.puck.z
  12515. },
  12516. floor: e.group,
  12517. neighbours: e.visibles,
  12518. alignmentType: e.alignment_type
  12519. }
  12520. }).map(function(e) {
  12521. return e.position = o.convertVisionVector(e.position),
  12522. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12523. e.puck = o.convertVisionVector(e.puck),
  12524. e
  12525. });
  12526. return i.forEach(function(e) {
  12527. if(e.neighbours.find(a=>a==-1)){
  12528. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12529. }
  12530. e.neighbours = e.neighbours.filter(e=>i[e])
  12531. e.neighbours = e.neighbours.map(function(e) {
  12532. return i[e].uuid
  12533. })
  12534. }),
  12535. i
  12536. }
  12537. .bind(this), function() {
  12538. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12539. this.loadSweepLocationsCSV()
  12540. }
  12541. .bind(this))
  12542. }
  12543. ,
  12544. t.prototype.loadSweepLocationsCSV = function() {
  12545. return i.get(this.sweepLocationsPath).then(function(e) {
  12546. return e.split("\n").map(function(e) {
  12547. return e.split(", ")
  12548. }).filter(function(e) {
  12549. return 1 < e.length
  12550. }).map(function(e) {
  12551. return {
  12552. uuid: e[0],
  12553. position: {
  12554. x: parseFloat(e[1]),
  12555. y: parseFloat(e[2]),
  12556. z: parseFloat(e[3])
  12557. },
  12558. quaternion: {
  12559. x: parseFloat(e[4]),
  12560. y: parseFloat(e[5]),
  12561. z: parseFloat(e[6]),
  12562. w: parseFloat(e[7])
  12563. }
  12564. }
  12565. }).map(function(e) {
  12566. return e.position = o.convertVisionVector(e.position),
  12567. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12568. e
  12569. })
  12570. }).fail(function() {
  12571. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12572. })
  12573. }
  12574. ,
  12575. l.exports = t
  12576. }
  12577. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12578. }
  12579. , {
  12580. "../util/ajax": 181,
  12581. "../util/common": 185,
  12582. "../util/logger": 189,
  12583. "../util/math": 190,
  12584. buffer: 198,
  12585. protobufjs: 214
  12586. }],
  12587. 108: [function(s, l, e) {
  12588. (function(e) {
  12589. "use strict";
  12590. function t() {
  12591. this.locale = null
  12592. }
  12593. var i = s("../settings")
  12594. , n = s("../util/common")
  12595. , r = s("../util/logger")
  12596. , o = s("../enum/Locale")
  12597. , a = new r(e);
  12598. t.prototype.init = function() {
  12599. var e;
  12600. switch (i.languageTag) {
  12601. case null:
  12602. case "en":
  12603. case o.EN_US:
  12604. this.locale = o.EN_US,
  12605. e = s("./strings-en-US");
  12606. break;
  12607. case "es":
  12608. case o.ES_MX:
  12609. this.locale = o.ES_MX,
  12610. e = s("./strings-es-MX");
  12611. break;
  12612. case "fr":
  12613. case o.FR_FR:
  12614. this.locale = o.FR_FR,
  12615. e = s("./strings-fr-FR");
  12616. break;
  12617. case "de":
  12618. case o.DE_DE:
  12619. this.locale = o.DE_DE,
  12620. e = s("./strings-de-DE");
  12621. break;
  12622. case "ru":
  12623. case o.RU_RU:
  12624. this.locale = o.RU_RU,
  12625. e = s("./strings-ru-RU");
  12626. break;
  12627. case "cn":
  12628. case o.CN_CN:
  12629. this.locale = o.CN_CN,
  12630. e = s("./strings-cn-CN");
  12631. break;
  12632. case "jp":
  12633. case o.JP_JP:
  12634. this.locale = o.JP_JP,
  12635. e = s("./strings-jp-JP");
  12636. break;
  12637. default:
  12638. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12639. this.locale = o.EN_US,
  12640. e = s("./strings-en-US")
  12641. }
  12642. a.info("Using locale '" + this.locale + "'"),
  12643. n.extendObject(this, e)
  12644. }
  12645. ,
  12646. t.prototype.localizeGUI = function() {
  12647. var e = document.querySelector("#gui-parent");
  12648. this.localizeTree(e),
  12649. this.localizeLoadingText()
  12650. }
  12651. ,
  12652. t.prototype.localizeLoadingText = function() {
  12653. document.querySelector("#help-dialog").classList.add(this.locale),
  12654. document.querySelector("#interaction-modal").classList.add(this.locale),
  12655. document.querySelector("#gui").classList.add(this.locale)
  12656. }
  12657. ,
  12658. t.prototype.localizeTree = function(e) {
  12659. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12660. if (e.nodeType === Node.TEXT_NODE)
  12661. (t = e.data.match(n)) && (i = t[1],
  12662. e.data = this.localizeText(i) || i);
  12663. else if (e.nodeType === Node.ELEMENT_NODE) {
  12664. var r = e.getAttribute("title");
  12665. r && ((t = r.match(n)) && (i = t[1],
  12666. e.setAttribute("title", this.localizeText(i) || i)))
  12667. }
  12668. for (e = e.firstChild; e; )
  12669. this.localizeTree(e),
  12670. e = e.nextSibling
  12671. }
  12672. ,
  12673. t.prototype.localizeText = function(e) {
  12674. var t = this[e];
  12675. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12676. t = s("./strings-en-US")[e]),
  12677. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12678. t
  12679. }
  12680. ,
  12681. l.exports = new t
  12682. }
  12683. ).call(this, "/js/localization/localize.js")
  12684. }
  12685. , {
  12686. "../enum/Locale": 31,
  12687. "../settings": 166,
  12688. "../util/common": 185,
  12689. "../util/logger": 189,
  12690. "./strings-cn-CN": 109,
  12691. "./strings-de-DE": 110,
  12692. "./strings-en-US": 111,
  12693. "./strings-es-MX": 112,
  12694. "./strings-fr-FR": 113,
  12695. "./strings-jp-JP": 114,
  12696. "./strings-ru-RU": 115
  12697. }],
  12698. 109: [function(e, t, i) {
  12699. "use strict";
  12700. t.exports = {
  12701. PAGE_TITLE: "",
  12702. LOADING: "正在加载",
  12703. PRESENTED_BY_CAPS: "呈现者:",
  12704. POWERED_BY: "技术支持:",
  12705. POWERED_BY_CAPS: "技术支持:",
  12706. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12707. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12708. PRESENTED_BY: "呈现者:",
  12709. MORE: "更多 ",
  12710. LESS: "更少 ",
  12711. TAG_CONTENT: "tag™ 内容",
  12712. SHOW: "显示",
  12713. HIDE: "隐藏",
  12714. DOLLHOUSE: "场景屋",
  12715. FLOOR_PLAN: "楼层平面图",
  12716. OPEN_HIGHLIGHTS: "打开精彩片段",
  12717. CLOSE_HIGHLIGHTS: "关闭",
  12718. PREVIOUS: "上一个",
  12719. PLAY: "播放",
  12720. PAUSE: "暂停",
  12721. NEXT: "下一个",
  12722. EXPLORE_3D_SPACE: "探索 3D 空间",
  12723. VIEW_DOLLHOUSE: "观看场景屋",
  12724. SOCIAL_SHARING: "分享这个空间",
  12725. VIEW_IN_VR: "以 VR 观看",
  12726. VIEW_FULLSCREEN: "全屏观看",
  12727. EXIT_FULLSCREEN: " 退出全屏",
  12728. ZOOM_IN: "放大",
  12729. ZOOM_OUT: "缩小",
  12730. FLOOR_NAME: "楼层",
  12731. FLOOR_ALL: "ALL",
  12732. FLOOR_Lang: ["Floor", ""],
  12733. TERMS: "条款",
  12734. PORT_TERMS: "port 条款",
  12735. TERMS_OF_USE: "使用条款",
  12736. CLOSE_TERMS: "关闭",
  12737. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12738. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12739. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12740. WEBVR_ENTER_WEBVR: "进入 VR",
  12741. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12742. WEBVR_LEARN_MORE: "了解更多",
  12743. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12744. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12745. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12746. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12747. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12748. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12749. VR_LEARN_MORE_CAPS: "了解更多",
  12750. VR_PREVIOUS_CAPS: "上一个’,",
  12751. VR_NEXT_CAPS: "下一个",
  12752. VR_GOT_IT_CAPS: "明白了",
  12753. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12754. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12755. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12756. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12757. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12758. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12759. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12760. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12761. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12762. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12763. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12764. VR_APP: "port VR 应用程序",
  12765. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12766. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12767. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12768. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12769. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12770. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12771. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12772. VR_ANDROID_DVICES: "Android 设备",
  12773. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12774. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12775. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12776. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12777. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12778. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12779. VR_DOWNLOAD_HERE: "在此下载",
  12780. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12781. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12782. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12783. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12784. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12785. SHARE_TO: "分享到",
  12786. SHARE_LINK: "直接链接",
  12787. SHARE_EXPLORE: "探索",
  12788. SHARE_AT: "在",
  12789. SHARE_WITH: "使用",
  12790. SHARE_3D: "以 3D",
  12791. SHARE_COPIED: "已复制!",
  12792. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12793. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12794. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12795. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12796. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12797. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12798. ERROR_GENERIC_ACTIONS_3: " 或",
  12799. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12800. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12801. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12802. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12803. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12804. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12805. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12806. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12807. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12808. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12809. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12810. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12811. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12812. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12813. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12814. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12815. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12816. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12817. LINK_TO_LOCATION: "地点链接",
  12818. MENU_COPY: "复制",
  12819. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12820. ROTATE: "旋转",
  12821. MOVE: "移动",
  12822. INSIDE: "内部",
  12823. ZOOM: "缩放",
  12824. HELP: "小帮手",
  12825. HELP_NAVIGATION_TAB: "导航",
  12826. HELP_MORE_HELP_TAB: "更多帮助",
  12827. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12828. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12829. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12830. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12831. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12832. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12833. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12834. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12835. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12836. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12837. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12838. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12839. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12840. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12841. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12842. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12843. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12844. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12845. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12846. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12847. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12848. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12849. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12850. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12851. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12852. HELP_MORE_HLR_A: "精彩片段集锦",
  12853. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12854. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12855. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12856. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12857. HELP_MORE_FLOORS_A: "楼层选择器",
  12858. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12859. HELP_MORE_TAG_A: "tag™ 贴文",
  12860. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12861. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12862. HELP_MORE_ZOOM_A: "缩放控件",
  12863. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12864. HELP_MORE_TOUR_A: "导览控件",
  12865. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12866. HELP_MORE_INSIDE_A: "内部视图",
  12867. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12868. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12869. HELP_MORE_VR_A: "VR 模式",
  12870. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12871. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12872. HELP_MORE_360_A: "360° 视图",
  12873. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12874. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12875. HELP_MORE_FULLSCREEN_A: "全屏",
  12876. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12877. CLOSE: "关闭"
  12878. }
  12879. }
  12880. , {}],
  12881. 110: [function(e, t, i) {
  12882. "use strict";
  12883. t.exports = {
  12884. PAGE_TITLE: "",
  12885. LOADING: "Lädt",
  12886. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12887. POWERED_BY: "Angetrieben von",
  12888. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12889. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12890. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12891. PRESENTED_BY: "Präsentiert von ",
  12892. MORE: "Mehr ",
  12893. LESS: "Weniger ",
  12894. TAG_CONTENT: "tag™ Inhalt",
  12895. SHOW: "Anzeigen",
  12896. HIDE: "Verbergen",
  12897. DOLLHOUSE: "Puppenhaus",
  12898. FLOOR_PLAN: "Grundriss",
  12899. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12900. CLOSE_HIGHLIGHTS: "Schließen",
  12901. PREVIOUS: "Vorheriges",
  12902. PLAY: "Abspielen",
  12903. PAUSE: "Pausieren",
  12904. NEXT: "Nächstes",
  12905. EXPLORE_3D_SPACE: "Innenraum betreten",
  12906. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12907. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12908. VIEW_IN_VR: "In VR ansehen",
  12909. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12910. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12911. ZOOM_IN: "Vergrößern",
  12912. ZOOM_OUT: "Verkleinern",
  12913. FLOOR_NAME: "Etage ",
  12914. FLOOR_ALL: "Alle",
  12915. TERMS: "Bedingungen",
  12916. PORT_TERMS: "port Bedingungen",
  12917. TERMS_OF_USE: "Nutzungsbedingungen",
  12918. TERMS_TEXT_FILE: "terms-de-DE.html",
  12919. CLOSE_TERMS: "Schließen",
  12920. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12921. HELP: "Hilfe",
  12922. HELP_NAVIGATION_TAB: "Navigation",
  12923. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12924. CLOSE: "Schließen",
  12925. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12926. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12927. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12928. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12929. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12930. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12931. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12932. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12933. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12934. 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.",
  12935. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12936. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12937. 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.",
  12938. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12939. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12940. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12941. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12942. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12943. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12944. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12945. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12946. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12947. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12948. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12949. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12950. HELP_MORE_HLR_A: "Liste das Highlight",
  12951. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12952. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12953. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12954. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12955. HELP_MORE_FLOORS_A: "Etage auswählen",
  12956. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12957. HELP_MORE_TAG_A: "tag™ Posts",
  12958. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12959. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12960. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12961. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12962. HELP_MORE_TOUR_A: "Tour Steuerung",
  12963. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12964. HELP_MORE_INSIDE_A: "Innenansicht",
  12965. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12966. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12967. HELP_MORE_VR_A: "VR Modus",
  12968. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12969. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12970. HELP_MORE_360_A: "360° Views Ansicht ",
  12971. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12972. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12973. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12974. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12975. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12976. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12977. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12978. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12979. WEBVR_LEARN_MORE: "Mehr Infos",
  12980. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12981. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12982. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12983. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12984. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12985. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12986. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12987. VR_APP: "port VR App",
  12988. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12989. 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",
  12990. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12991. VR_APP_FOR_ANDROID: "port VR app für Android",
  12992. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12993. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12994. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12995. VR_PREVIOUS_CAPS: "ZURÜCK",
  12996. VR_NEXT_CAPS: "WEITER",
  12997. VR_GOT_IT_CAPS: "VERSTANDEN",
  12998. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12999. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13000. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13001. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13002. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13003. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13004. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13005. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13006. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13007. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13008. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13009. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13010. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13011. VR_ANDROID_DVICES: "Android Geräte",
  13012. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13013. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13014. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13015. VR_DOWNLOAD_HERE: "Hier runterladen",
  13016. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13017. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13018. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13019. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13020. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13021. SHARE_TO: "Teilen auf",
  13022. SHARE_LINK: "Direkter Link",
  13023. SHARE_EXPLORE: "Umsehen",
  13024. SHARE_AT: "auf",
  13025. SHARE_WITH: "mit",
  13026. SHARE_3D: "in 3D",
  13027. SHARE_COPIED: "Kopiert!",
  13028. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13029. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13030. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13031. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13032. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13033. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13034. ERROR_GENERIC_ACTIONS_3: " oder ",
  13035. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13036. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13037. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13038. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13039. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13040. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13041. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13042. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13043. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13044. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13045. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13046. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13047. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13048. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13049. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13050. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13051. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13052. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13053. LINK_TO_LOCATION: "Link zu",
  13054. MENU_COPY: "Kopieren",
  13055. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13056. ROTATE: "Drehen",
  13057. INSIDE: "Drinnen",
  13058. MOVE: "Bewegen",
  13059. ZOOM: "Vergrößern"
  13060. }
  13061. }
  13062. , {}],
  13063. 111: [function(e, t, i) {
  13064. "use strict";
  13065. t.exports = {
  13066. PAGE_TITLE: "",
  13067. LOADING: "Loading",
  13068. PRESENTED_BY_CAPS: "PRESENTED BY",
  13069. POWERED_BY: "powered by ",
  13070. POWERED_BY_CAPS: "POWERED BY",
  13071. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13072. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13073. PRESENTED_BY: "Presented by ",
  13074. MORE: "More ",
  13075. LESS: "Less ",
  13076. TAG_CONTENT: "tag™ Content",
  13077. SHOW: "Show",
  13078. HIDE: "Hide",
  13079. DOLLHOUSE: "Dollhouse",
  13080. FLOOR_PLAN: "Floor plan",
  13081. OPEN_HIGHLIGHTS: "Open Highlights",
  13082. CLOSE_HIGHLIGHTS: "Close",
  13083. PREVIOUS: "Previous",
  13084. PLAY: "Play",
  13085. PAUSE: "Pause",
  13086. NEXT: "Next",
  13087. EXPLORE_3D_SPACE: "Explore 3D Space",
  13088. VIEW_DOLLHOUSE: "View dollhouse",
  13089. SOCIAL_SHARING: "Share this Space",
  13090. VIEW_IN_VR: "View in VR",
  13091. VIEW_FULLSCREEN: "全屏",
  13092. EXIT_FULLSCREEN: "退出全屏",
  13093. ZOOM_IN: "Zoom in",
  13094. ZOOM_OUT: "Zoom out",
  13095. FLOOR_NAME: "Floor ",
  13096. FLOOR_ALL: "全部",
  13097. TERMS: "Terms",
  13098. PORT_TERMS: "port terms",
  13099. TERMS_OF_USE: "Terms of Use",
  13100. TERMS_TEXT_FILE: "terms-en-US.html",
  13101. CLOSE_TERMS: "Close",
  13102. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13103. HELP: "Help",
  13104. HELP_NAVIGATION_TAB: "Navigation",
  13105. HELP_MORE_HELP_TAB: "More Help",
  13106. CLOSE: "Close",
  13107. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13108. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13109. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13110. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13111. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13112. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13113. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13114. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13115. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13116. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13117. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13118. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13119. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13120. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13121. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13122. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13123. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13124. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13125. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13126. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13127. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13128. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13129. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13130. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13131. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13132. HELP_MORE_HLR_A: "Highlight Reel",
  13133. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13134. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13135. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13136. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13137. HELP_MORE_FLOORS_A: "Floor Selector",
  13138. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13139. HELP_MORE_TAG_A: "tag™ Posts",
  13140. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13141. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13142. HELP_MORE_ZOOM_A: "Zoom Controls",
  13143. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13144. HELP_MORE_TOUR_A: "Tour Controls",
  13145. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13146. HELP_MORE_INSIDE_A: "Inside View",
  13147. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13148. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13149. HELP_MORE_VR_A: "VR Mode",
  13150. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13151. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13152. HELP_MORE_360_A: "360° Views",
  13153. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13154. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13155. HELP_MORE_FULLSCREEN_A: "Full screen",
  13156. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13157. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13158. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13159. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13160. WEBVR_ENTER_WEBVR: "ENTER VR",
  13161. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13162. WEBVR_LEARN_MORE: "Learn more",
  13163. WEBVR_VIEW_SPACE: "View Space in VR",
  13164. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13165. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13166. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13167. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13168. VR_PREVIOUS_CAPS: "PREVIOUS",
  13169. VR_NEXT_CAPS: "NEXT",
  13170. VR_GOT_IT_CAPS: "GOT IT",
  13171. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13172. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13173. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13174. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13175. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13176. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13177. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13178. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13179. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13180. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13181. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13182. VR_APP: "port VR App",
  13183. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13184. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13185. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13186. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13187. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13188. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13189. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13190. VR_ANDROID_DVICES: "Android Devices",
  13191. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13192. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13193. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13194. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13195. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13196. VR_APP_OPEN: "Open with the port VR app instead",
  13197. VR_DOWNLOAD_HERE: "Download here",
  13198. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13199. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13200. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13201. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13202. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13203. SHARE_TO: "Share to",
  13204. SHARE_LINK: "Direct Link",
  13205. SHARE_EXPLORE: "Explore ",
  13206. SHARE_AT: "at",
  13207. SHARE_WITH: "with",
  13208. SHARE_3D: " in 3D",
  13209. SHARE_COPIED: "Copied!",
  13210. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13211. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13212. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13213. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13214. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13215. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13216. ERROR_GENERIC_ACTIONS_3: " or ",
  13217. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13218. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13219. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13220. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13221. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13222. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13223. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13224. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13225. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13226. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13227. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13228. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13229. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13230. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13231. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13232. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13233. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13234. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13235. LINK_TO_LOCATION: "Link to location",
  13236. MENU_COPY: "Copy",
  13237. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13238. ROTATE: "Rotate",
  13239. INSIDE: "Inside",
  13240. MOVE: "Move",
  13241. ZOOM: "Zoom"
  13242. }
  13243. }
  13244. , {}],
  13245. 112: [function(e, t, i) {
  13246. "use strict";
  13247. t.exports = {
  13248. PAGE_TITLE: "",
  13249. LOADING: "Cargando",
  13250. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13251. POWERED_BY: "potenciando por ",
  13252. POWERED_BY_CAPS: "POTENCIADO POR ",
  13253. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13254. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13255. PRESENTED_BY: "Presentado por ",
  13256. MORE: "Más ",
  13257. LESS: "Menos ",
  13258. TAG_CONTENT: "Contenido de tag™",
  13259. SHOW: "Mostrar",
  13260. HIDE: "Ocultar",
  13261. DOLLHOUSE: "Dollhouse",
  13262. FLOOR_PLAN: "Planos",
  13263. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13264. CLOSE_HIGHLIGHTS: "Cerrar",
  13265. PREVIOUS: "Anterior",
  13266. PLAY: "Play",
  13267. PAUSE: "Pausa",
  13268. NEXT: "Siguiente",
  13269. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13270. VIEW_DOLLHOUSE: "Ver dollhouse",
  13271. SOCIAL_SHARING: "Compartir este espacio",
  13272. VIEW_IN_VR: "Ver en realidad virtual",
  13273. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13274. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13275. ZOOM_IN: "Acercar",
  13276. ZOOM_OUT: "Alejar",
  13277. FLOOR_NAME: "Piso ",
  13278. FLOOR_ALL: "Todas",
  13279. TERMS: "Condiciones",
  13280. PORT_TERMS: "port términos de uso",
  13281. TERMS_OF_USE: "Términos de uso",
  13282. TERMS_TEXT_FILE: "terms-es-MX.html",
  13283. CLOSE_TERMS: "Cerrar",
  13284. 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.",
  13285. HELP: "Ayuda",
  13286. HELP_NAVIGATION_TAB: "Navegación",
  13287. HELP_MORE_HELP_TAB: "Más Ayuda",
  13288. CLOSE: "Cerrar",
  13289. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13290. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13291. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13292. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13293. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13294. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13295. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13296. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13297. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13298. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13299. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13300. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13301. 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.",
  13302. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13303. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13304. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13305. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13306. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13307. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13308. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13309. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13310. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13311. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13312. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13313. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13314. HELP_MORE_HLR_A: "Galería destacada",
  13315. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13316. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13317. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13318. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13319. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13320. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13321. HELP_MORE_TAG_A: "tag™ Posts",
  13322. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13323. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13324. HELP_MORE_ZOOM_A: "Controles de zoom",
  13325. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13326. HELP_MORE_TOUR_A: "Controles de recorrido",
  13327. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13328. HELP_MORE_INSIDE_A: "Vista interior",
  13329. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13330. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13331. HELP_MORE_VR_A: "Modo de realidad virtual",
  13332. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13333. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13334. HELP_MORE_360_A: "360° Views",
  13335. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13336. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13337. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13338. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13339. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13340. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13341. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13342. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13343. WEBVR_LEARN_MORE: "Más información",
  13344. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13345. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13346. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13347. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13348. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13349. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13350. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13351. VR_APP: "port VR App",
  13352. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13353. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13354. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13355. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13356. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13357. VR_PREVIOUS_CAPS: "ANTERIOR",
  13358. VR_NEXT_CAPS: "SIGUIENTE",
  13359. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13360. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13361. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13362. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13363. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13364. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13365. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13366. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13367. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13368. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13369. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13370. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13371. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13372. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13373. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13374. VR_ANDROID_DVICES: "Dispositivos Android",
  13375. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13376. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13377. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13378. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13379. VR_DOWNLOAD_HERE: "Descargar aquí",
  13380. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13381. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13382. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13383. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13384. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13385. SHARE_TO: "Compartir en",
  13386. SHARE_LINK: "Enlace directo",
  13387. SHARE_EXPLORE: "Explorar ",
  13388. SHARE_AT: "en",
  13389. SHARE_WITH: "con",
  13390. SHARE_3D: " en 3D",
  13391. SHARE_COPIED: "¡Copiado!",
  13392. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13393. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13394. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13395. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13396. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13397. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13398. ERROR_GENERIC_ACTIONS_3: " o ",
  13399. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13400. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13401. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13402. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13403. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13404. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13405. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13406. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13407. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13408. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13409. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13410. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13411. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13412. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13413. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13414. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13415. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13416. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13417. LINK_TO_LOCATION: "Enlace a la ubicación",
  13418. MENU_COPY: "Copiar",
  13419. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13420. ROTATE: "Girar",
  13421. INSIDE: "Interior",
  13422. MOVE: "Moverse",
  13423. ZOOM: "Acercar o alejar"
  13424. }
  13425. }
  13426. , {}],
  13427. 113: [function(e, t, i) {
  13428. "use strict";
  13429. t.exports = {
  13430. PAGE_TITLE: "",
  13431. LOADING: "Chargement",
  13432. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13433. POWERED_BY: "alimenté par ",
  13434. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13435. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13436. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13437. PRESENTED_BY: "Présenté par ",
  13438. MORE: "Plus ",
  13439. LESS: "Moins ",
  13440. TAG_CONTENT: "Contenu tag™",
  13441. SHOW: "Montrer",
  13442. HIDE: "Cacher",
  13443. DOLLHOUSE: "Dollhouse",
  13444. FLOOR_PLAN: "Plan de sol",
  13445. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13446. CLOSE_HIGHLIGHTS: "Fermer",
  13447. PREVIOUS: "Précédent",
  13448. PLAY: "Lecture",
  13449. PAUSE: "Pause",
  13450. NEXT: "Suivant",
  13451. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13452. VIEW_DOLLHOUSE: "Voir dollhouse",
  13453. SOCIAL_SHARING: "Partager cet espace",
  13454. VIEW_IN_VR: "Voir en VR",
  13455. VIEW_FULLSCREEN: "Plein écran",
  13456. EXIT_FULLSCREEN: "Fermer plein écran",
  13457. ZOOM_IN: "Zoom avant",
  13458. ZOOM_OUT: "Zoom arrière",
  13459. FLOOR_NAME: "Étage ",
  13460. FLOOR_ALL: "Tous",
  13461. TERMS: "Mentions légales",
  13462. PORT_TERMS: "port mentions légales",
  13463. TERMS_OF_USE: "Conditions d'utilisation",
  13464. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13465. CLOSE_TERMS: "Fermer",
  13466. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13467. HELP: "Aide",
  13468. HELP_NAVIGATION_TAB: "Navigation",
  13469. HELP_MORE_HELP_TAB: "Aide",
  13470. CLOSE: "Fermer",
  13471. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13472. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13473. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13474. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13475. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13476. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13477. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13478. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13479. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13480. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13481. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13482. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13483. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13484. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13485. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13486. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13487. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13488. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13489. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13490. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13491. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13492. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13493. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13494. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13495. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13496. HELP_MORE_HLR_A: "Carrousel",
  13497. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13498. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13499. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13500. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13501. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13502. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13503. HELP_MORE_TAG_A: "tag™ Posts",
  13504. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13505. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13506. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13507. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13508. HELP_MORE_TOUR_A: "Commandes de la visite",
  13509. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13510. HELP_MORE_INSIDE_A: "Vue intérieure",
  13511. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13512. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13513. HELP_MORE_VR_A: "Mode RV",
  13514. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13515. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13516. HELP_MORE_360_A: "Vues 360°",
  13517. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13518. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13519. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13520. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13521. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13522. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13523. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13524. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13525. WEBVR_LEARN_MORE: "En savoir plus",
  13526. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13527. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13528. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13529. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13530. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13531. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13532. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13533. VR_NEXT_CAPS: "SUIVANT",
  13534. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13535. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13536. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13537. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13538. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13539. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13540. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13541. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13542. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13543. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13544. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13545. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13546. VR_APP: "port VR App",
  13547. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13548. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13549. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13550. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13551. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13552. 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",
  13553. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13554. VR_ANDROID_DVICES: "Appareils Android",
  13555. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13556. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13557. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13558. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13559. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13560. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13561. VR_DOWNLOAD_HERE: "Télécharger ici",
  13562. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13563. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13564. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13565. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13566. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13567. SHARE_TO: "Partager sur",
  13568. SHARE_LINK: "Lien direct",
  13569. SHARE_EXPLORE: "Explorer ",
  13570. SHARE_AT: "à",
  13571. SHARE_WITH: "avec",
  13572. SHARE_3D: " en 3D",
  13573. SHARE_COPIED: "Copié!",
  13574. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13575. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13576. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13577. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13578. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13579. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13580. ERROR_GENERIC_ACTIONS_3: " ou ",
  13581. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13582. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13583. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13584. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13585. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13586. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13587. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13588. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13589. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13590. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13591. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13592. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13593. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13594. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13595. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13596. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13597. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13598. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13599. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13600. MENU_COPY: "Copie",
  13601. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13602. ROTATE: "Faire pivoter",
  13603. INSIDE: "Intérieure",
  13604. MOVE: "Se déplacer",
  13605. ZOOM: "Zoom"
  13606. }
  13607. }
  13608. , {}],
  13609. 114: [function(e, t, i) {
  13610. "use strict";
  13611. t.exports = {
  13612. PAGE_TITLE: "",
  13613. LOADING: "読み込み中",
  13614. PRESENTED_BY_CAPS: "PRESENTED BY",
  13615. POWERED_BY: "powered by",
  13616. POWERED_BY_CAPS: "POWERED BY",
  13617. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13618. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13619. PRESENTED_BY: "Presented by ",
  13620. MORE: "全て表示 ",
  13621. LESS: "閉じる ",
  13622. TAG_CONTENT: "tag™コンテンツ ",
  13623. SHOW: "表示",
  13624. HIDE: "非表示",
  13625. DOLLHOUSE: "ドールハウス",
  13626. FLOOR_PLAN: "フロアプラン",
  13627. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13628. CLOSE_HIGHLIGHTS: "閉じる",
  13629. PREVIOUS: "前へ",
  13630. PLAY: "再生",
  13631. PAUSE: "一時停止",
  13632. NEXT: "次へ",
  13633. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13634. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13635. SOCIAL_SHARING: "このSpaceを共有する",
  13636. VIEW_IN_VR: "VRで表示",
  13637. VIEW_FULLSCREEN: "フルスクリーン表示",
  13638. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13639. ZOOM_IN: "ズームイン",
  13640. ZOOM_OUT: "ズームアウト",
  13641. FLOOR_NAME: "フロア ",
  13642. FLOOR_ALL: "すべて",
  13643. TERMS: "規約",
  13644. PORT_TERMS: "port規約",
  13645. TERMS_OF_USE: "利用規約",
  13646. CLOSE_TERMS: "閉じる",
  13647. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13648. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13649. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13650. WEBVR_ENTER_WEBVR: "VRに入る",
  13651. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13652. WEBVR_LEARN_MORE: "もっと詳しく",
  13653. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13654. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13655. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13656. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13657. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13658. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13659. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13660. VR_PREVIOUS_CAPS: "前へ",
  13661. VR_NEXT_CAPS: "次へ",
  13662. VR_GOT_IT_CAPS: "了解",
  13663. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13664. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13665. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13666. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13667. VR_WHAT_YOU_NEED: "必要なもの",
  13668. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13669. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13670. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13671. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13672. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13673. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13674. VR_APP: "port VRアプリ",
  13675. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13676. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13677. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13678. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13679. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13680. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13681. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13682. VR_ANDROID_DVICES: "Androidデバイス",
  13683. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13684. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13685. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13686. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13687. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13688. VR_APP_OPEN: "port VRアプリで開く",
  13689. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13690. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13691. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13692. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13693. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13694. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13695. SHARE_TO: "共有先",
  13696. SHARE_LINK: "ダイレクトリンク",
  13697. SHARE_EXPLORE: "探索",
  13698. SHARE_AT: "場所",
  13699. SHARE_WITH: "使用アプリ",
  13700. SHARE_3D: "3Dで",
  13701. SHARE_COPIED: "コピーされました!",
  13702. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13703. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13704. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13705. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13706. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13707. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13708. ERROR_GENERIC_ACTIONS_3: "または",
  13709. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13710. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13711. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13712. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13713. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13714. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13715. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13716. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13717. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13718. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13719. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13720. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13721. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13722. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13723. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13724. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13725. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13726. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13727. LINK_TO_LOCATION: "ロケーションへのリンク",
  13728. MENU_COPY: "コピー",
  13729. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13730. ROTATE: "回転",
  13731. MOVE: "移動",
  13732. INSIDE: "内側",
  13733. ZOOM: "ズーム",
  13734. HELP: "ヘルプ",
  13735. HELP_NAVIGATION_TAB: "ナビゲーション",
  13736. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13737. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13738. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13739. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13740. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13741. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13742. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13743. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13744. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13745. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13746. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13747. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13748. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13749. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13750. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13751. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13752. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13753. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13754. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13755. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13756. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13757. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13758. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13759. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13760. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13761. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13762. HELP_MORE_HLR_A: "ハイライト",
  13763. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13764. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13765. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13766. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13767. HELP_MORE_FLOORS_A: "フロアセレクター",
  13768. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13769. HELP_MORE_TAG_A: "tag™ Posts",
  13770. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13771. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13772. HELP_MORE_ZOOM_A: "ズームコントロール",
  13773. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13774. HELP_MORE_TOUR_A: "ツアーコントロール",
  13775. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13776. HELP_MORE_INSIDE_A: "内側ビュー",
  13777. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13778. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13779. HELP_MORE_VR_A: "VRモード",
  13780. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13781. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13782. HELP_MORE_360_A: "360° Views",
  13783. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13784. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13785. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13786. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13787. CLOSE: "閉じる"
  13788. }
  13789. }
  13790. , {}],
  13791. 115: [function(e, t, i) {
  13792. "use strict";
  13793. t.exports = {
  13794. PAGE_TITLE: "",
  13795. LOADING: "Загрузка",
  13796. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13797. POWERED_BY: "разработано на платформе ",
  13798. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13799. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13800. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13801. PRESENTED_BY: "Представлено ",
  13802. MORE: "Больше ",
  13803. LESS: "Меньше ",
  13804. TAG_CONTENT: "tag™ Контент",
  13805. SHOW: "Показать",
  13806. HIDE: "Скрыть",
  13807. DOLLHOUSE: "Dollhouse",
  13808. FLOOR_PLAN: "Планировка",
  13809. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13810. CLOSE_HIGHLIGHTS: "Закрыть",
  13811. PREVIOUS: "Предыдущий",
  13812. PLAY: "Воспроизвести",
  13813. PAUSE: "Пауза",
  13814. NEXT: "Следующий",
  13815. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13816. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13817. SOCIAL_SHARING: "Поделиться этой моделью",
  13818. VIEW_IN_VR: "Посмотреть в VR",
  13819. VIEW_FULLSCREEN: "Полный экран",
  13820. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13821. ZOOM_IN: "Увеличить",
  13822. ZOOM_OUT: "Уменьшить",
  13823. FLOOR_NAME: "Этаж ",
  13824. FLOOR_ALL: "Все",
  13825. TERMS: "Условия",
  13826. PORT_TERMS: "Правила пользования",
  13827. TERMS_OF_USE: "Условия использования",
  13828. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13829. CLOSE_TERMS: "Закрыть",
  13830. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13831. HELP: "Помощь",
  13832. HELP_NAVIGATION_TAB: "Навигация",
  13833. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13834. CLOSE: "Закрыть",
  13835. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13836. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13837. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13838. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13839. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13840. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13841. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13842. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13843. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13844. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13845. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13846. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13847. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13848. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13849. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13850. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13851. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13852. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13853. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13854. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13855. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13856. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13857. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13858. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13859. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13860. HELP_MORE_HLR_A: "Фотоколлаж",
  13861. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13862. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13863. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13864. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13865. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13866. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13867. HELP_MORE_TAG_A: "tag™ Posts",
  13868. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13869. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13870. HELP_MORE_ZOOM_A: "Масштаб",
  13871. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13872. HELP_MORE_TOUR_A: "Управление Туром",
  13873. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13874. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13875. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13876. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13877. HELP_MORE_VR_A: "Режим VR",
  13878. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13879. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13880. HELP_MORE_360_A: "360° Views",
  13881. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13882. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13883. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13884. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13885. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13886. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13887. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13888. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13889. WEBVR_LEARN_MORE: "Узнать больше",
  13890. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13891. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13892. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13893. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13894. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13895. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13896. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13897. VR_APP: "port VR App",
  13898. VR_APP_OPEN: "Или открыть через приложение port VR",
  13899. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13900. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13901. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13902. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13903. VR_VIEW_SPACE: "Запустить модель в VR",
  13904. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13905. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13906. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13907. VR_GOT_IT_CAPS: "ЯСНО",
  13908. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13909. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13910. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13911. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13912. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13913. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13914. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13915. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13916. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13917. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13918. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13919. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13920. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13921. VR_ANDROID_DVICES: "Android устройства",
  13922. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13923. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13924. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13925. VR_DOWNLOAD_HERE: "Скачать здесь",
  13926. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13927. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13928. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13929. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13930. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13931. SHARE_TO: "Поделиться",
  13932. SHARE_LINK: "Прямая ссылка",
  13933. SHARE_EXPLORE: "просмотреть",
  13934. SHARE_AT: "на",
  13935. SHARE_WITH: "с",
  13936. SHARE_3D: "в 3D",
  13937. SHARE_COPIED: "Скопировано!",
  13938. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13939. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13940. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13941. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13942. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13943. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13944. ERROR_GENERIC_ACTIONS_3: " или ",
  13945. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13946. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13947. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13948. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13949. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13950. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13951. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13952. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13953. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13954. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13955. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13956. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13957. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13958. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13959. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13960. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13961. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13962. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13963. LINK_TO_LOCATION: "Ссылка на местоположение",
  13964. MENU_COPY: "Копировать",
  13965. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13966. ROTATE: "Вращать",
  13967. MOVE: "Передвигаться",
  13968. INSIDE: "Вид изнутри",
  13969. ZOOM: "Масштаб"
  13970. }
  13971. }
  13972. , {}],
  13973. 116: [function(r, e, t) {
  13974. (function(i) {
  13975. "use strict";
  13976. function re(e) {
  13977. console.log("e1:" + e),
  13978. e = Math.round(.4 * e * 100),
  13979. console.log("e2:" + e);
  13980. var t = $(".progressbar");
  13981. t.find(".bar").css("width", e + "%"),
  13982. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13983. t.find(".perc").text(e + "%")
  13984. }
  13985. $("#gui-loading").fadeIn(200),
  13986. re(.1);
  13987. var e = g_version ? "modeldata.js" : "someData.json";
  13988. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13989. dataType: "json"
  13990. }).done(function(e) {
  13991. var t = matcher(e);
  13992. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13993. t.user = {
  13994. is_authenticated: !1,
  13995. 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"]
  13996. }
  13997. try{//处理一下导览数据
  13998. t.model.images = t.model.images.filter(e=>{
  13999. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14000. if(e.locations)e.locations = e.locations.filter(e=>e)
  14001. if(e.locations && e.locations.length == 0)return;
  14002. return e
  14003. })
  14004. }catch(e){console.log(e) }
  14005. window.editTool = new EditTools()
  14006. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14007. window.DATA = t
  14008. t.model.summary = t.summary
  14009. t.model.name = t.name
  14010. for(let i in t){
  14011. t[i] == "false" && (t[i] = false)
  14012. }
  14013. re(.7),
  14014. function() {
  14015. function y(e) {
  14016. t.update(e)
  14017. }
  14018. function A(e, t) {
  14019. ne.error(t),
  14020. n.error(t),
  14021. N.report(e, "error-" + t)
  14022. }
  14023. function C(e, t, i) {
  14024. try {
  14025. e.start(t)
  14026. } catch (e) {
  14027. throw ne.warn(e.message),
  14028. function(e) {
  14029. var t = O.details();
  14030. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14031. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14032. N.report(e, "error-webgl-generic"))
  14033. }(i.sid),
  14034. e
  14035. }
  14036. }
  14037. function I(e) {
  14038. e.stopPropagation(),
  14039. e.preventDefault()
  14040. }
  14041. window.DATA.hoticon && (g_HotImage = {
  14042. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14043. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14044. });
  14045. if (window.DATA.backgroundMusic) {
  14046. if(window.isLocal){
  14047. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14048. }else{
  14049. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14050. }
  14051. $("#volume").show();
  14052. }else if (g_version === "one"){
  14053. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  14054. $("#volume").show();
  14055. }
  14056. //隐藏公司logo
  14057. window.DATA.loadlogo && showLogo();
  14058. r("./lib/three75-shim"),
  14059. r("./lib/array-polyfill"),
  14060. r("./lib/performance-polyfill"),
  14061. r("./lib/shaders/CopyShader.js"),
  14062. r("./lib/shaders/HorizontalBlurShader.js"),
  14063. r("./lib/shaders/VerticalBlurShader.js"),
  14064. r("./lib/postprocessing/EffectComposer.js"),
  14065. r("./lib/postprocessing/RenderPass.js"),
  14066. r("./lib/postprocessing/MaskPass.js"),
  14067. r("./lib/postprocessing/ShaderPass.js"),
  14068. window.Promise || (window.Promise = r("promise-polyfill"));
  14069. var E = r("three")
  14070. , _ = r("three")
  14071. , b = (r("./util/sentry"),
  14072. r("./player"))
  14073. , w = r("./director")
  14074. , T = r("./controls/CameraControls")
  14075. , x = r("./model/ModelManager")
  14076. , S = r("./DisplayController")
  14077. , M = r("./label/LabelDisplayController")
  14078. , R = r("./enum/Viewmode")
  14079. , e = r("./util/logger")
  14080. , P = r("./showcase")
  14081. , O = r("./util/browser")
  14082. , L = r("./settings")
  14083. , D = r("./gui/gui")
  14084. , n = r("./gui/error")
  14085. , N = r("./analytics")
  14086. , F = r("./util/transitions")
  14087. , B = r("./effects")
  14088. , V = r("./objects/Skybox")
  14089. , k = (r("./util/common"),
  14090. r("./util/PanoramaCollection"),
  14091. r("./util/math"),
  14092. r("./util/showcase"))
  14093. , U = r("./util/camera")
  14094. , H = (r("./objects/Panorama"),
  14095. r("./cameras/PanoramaCamera"),
  14096. r("./preloaders"))
  14097. , z = r("events").EventEmitter
  14098. , G = r("./featureflags")
  14099. , W = (r("./util/lerp"),
  14100. r("./util/ajax"),
  14101. r("./ab"))
  14102. , j = r("./sdk/automation.js")
  14103. , Y = r("./scene/SceneRenderer")
  14104. , q = r("./scene/QuickstartManager")
  14105. , X = r("./tile/QualityManager.js")
  14106. , Z = r("./localization/localize")
  14107. , K = r("./tag/tagManager")
  14108. , Q = r("./tile/TileDownloader")
  14109. , J = r("./tile/PanoRenderer")
  14110. , ee = (r("./enum/PanoSizeClass"),
  14111. r("./enum/PanoramaEvents"),
  14112. r("./enum/SceneRendererEvents"))
  14113. , t = r("./gui/memoryUsage")
  14114. , te = r("./enum/RenderLayers")
  14115. , ie = r("./TimingData")
  14116. , ne = new e(i);
  14117. e.level = L.logLevel,
  14118. e.consoleEnabled = L.console,
  14119. function() {
  14120. var e = window.number//k.getModelIDFromQueryString();
  14121. if (!e)
  14122. return A(null, "loading-failed");
  14123. var t = k.parseSidUrl(e)
  14124. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14125. , n = {
  14126. panoElementsToLoad: 6,
  14127. modelElementsToLoad: 0,
  14128. totalElementsLoaded: 0,
  14129. totalElementsToLoad: 0,
  14130. totalPercentageLoaded: 0,
  14131. progressCallback: null
  14132. }
  14133. , r = document.getElementById("player")
  14134. , o = L.quickstart.enabled
  14135. , a = null
  14136. , s = null
  14137. , l = null
  14138. , c = null
  14139. , h = null
  14140. , u = null
  14141. , d = null
  14142. , p = null
  14143. , f = null
  14144. , g = null
  14145. , m = null
  14146. , v = new ie;
  14147. !function(e) {
  14148. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14149. z.defaultMaxListeners = 1e3,
  14150. function(e) {
  14151. e.addEventListener("dragenter", I, !1),
  14152. e.addEventListener("dragover", I, !1)
  14153. }(e),
  14154. O.valueFromHash("title", !0) || $(document).ready(function() {
  14155. $(".model-title").hide()
  14156. })
  14157. }(r),
  14158. function(e) {
  14159. return G.loadFeatureFlags(e).done(function(e) {
  14160. G.updateDependentSettings(e, L)
  14161. })
  14162. }({
  14163. urlBase: t.urlBase
  14164. }).then(function() {
  14165. return Z.init(),
  14166. function(e, t) {
  14167. var i = P.getModel({
  14168. url: t,
  14169. floors: O.valueFromHash("f", !0),
  14170. autoload: !1
  14171. });
  14172. return $.when(i, y).then(null, function(e) {
  14173. return this
  14174. })
  14175. }(0, e)
  14176. }).then(function(e) {
  14177. return re(.9),
  14178. function(e, t, i, n, r) {
  14179. ne.info("Model data loaded"),
  14180. ne.debug("UUID: " + e.data.job.uuid),
  14181. W.init(G.getFlags()),
  14182. i && N.initKeen({
  14183. token: i,
  14184. appId: n
  14185. }),
  14186. N.initSegment({
  14187. model: e.sid,
  14188. version: "2.25.6-0-gd87e5b1",
  14189. startSource: r.startSource,
  14190. token: t,
  14191. autoplay: r.autoplay,
  14192. quickstart: r.quickstart
  14193. })
  14194. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14195. startSource: i,
  14196. autoplay: L.autoplay,
  14197. quickstart: o
  14198. }),
  14199. g.urls.init()
  14200. }).then(function() {
  14201. return g.loadPanos()
  14202. }).then(function() {
  14203. s = U.getStartCameraOptions(g, g.panos);
  14204. //初始画面
  14205. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14206. $("<img/>").attr("src", e).on("load", function() {
  14207. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14208. $(this).remove()
  14209. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14210. })
  14211. }(window.DATA.camera_start.thumbImg);
  14212. {//初始化导览时间
  14213. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14214. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14215. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14216. /* if(DATA.tourWalkSpeed!=void 0){
  14217. let r = 100 / DATA.tourWalkSpeed;
  14218. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14219. window._settings.warp.flyTime = settings.flyTime * r
  14220. }else{
  14221. window._settings.warp.flyTime = settings.flyTime
  14222. } */
  14223. }
  14224. d = function(e) {
  14225. var t = new E.PerspectiveCamera;
  14226. t.layers.enable(te.PANOMARKERS),
  14227. t.layers.enable(te.RETICULE),
  14228. t.layers.enable(te.TAG);
  14229. var o = new E.Scene
  14230. , i = new E.AmbientLight(16777215);
  14231. return o.add(i),
  14232. o.skybox = new V,
  14233. o.add(o.skybox),
  14234. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14235. side: E.DoubleSide
  14236. })),
  14237. o.plane.position.y = 0,
  14238. o.plane.rotateX(-Math.PI / 2),
  14239. o.plane.material.visible = !1,
  14240. o.add(o.plane),
  14241. o.updateMatrixWorld(),
  14242. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14243. if (e.metadata && e.metadata.camera_position) {
  14244. var t = e.metadata.camera_position
  14245. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14246. i.position = t.clone(),
  14247. o.add(i);
  14248. var n = e.metadata.camera_quaternion
  14249. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14250. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14251. }
  14252. }),
  14253. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14254. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14255. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14256. new Y(o,t,B)
  14257. }(g),
  14258. m = function(e, t) {
  14259. var i = e ? 1 : 1e3
  14260. , n = W.tilegen || W.imgopt ? 6 : 2;
  14261. n = O.valueFromHash("tileconc", n);
  14262. var r = new X
  14263. , o = new Q({
  14264. concurrentDownloads: n
  14265. })
  14266. , a = new J
  14267. , s = new x
  14268. , l = new w
  14269. , c = new b(t)
  14270. , h = new T
  14271. , u = new S(i)
  14272. , d = new M
  14273. , p = new K;
  14274. return {
  14275. qualityManager: r,
  14276. panoRenderer: a,
  14277. tileDownloader: o,
  14278. player: c,
  14279. director: l,
  14280. modelManager: s,
  14281. tagManager: p,
  14282. displayController: u,
  14283. labelDisplayController: d,
  14284. controls: h
  14285. }
  14286. }(o, s.mode),
  14287. l = m.controls,
  14288. c = m.player,
  14289. h = m.director,
  14290. u = m.tagManager,
  14291. p = m.tileDownloader,
  14292. f = m.qualityManager,
  14293. m.panoRenderer,
  14294. function(e, t, i, n) {
  14295. var r = i.controls
  14296. , o = i.qualityManager
  14297. , a = i.panoRenderer
  14298. , s = i.tileDownloader
  14299. , l = i.modelManager;
  14300. r.init(n, l),
  14301. j.init(i.director, r, i.player, l, t),
  14302. o.init(l),
  14303. s.init(o),
  14304. a.init(t, s, o),
  14305. l.init(s, a, o),
  14306. l.addModel(e),
  14307. t.addComponent(F)
  14308. }(g, d, m, r),
  14309. c.director = h,
  14310. g.supportsTiles && p.start(),
  14311. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14312. o = !1);
  14313. var e = null;
  14314. if (o) {
  14315. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14316. var t = l.controls[R.PANORAMA];
  14317. a = new q(f,d.scene,d.camera,t,r),
  14318. C(d, r, g),
  14319. e = a.load(s).then(function() {
  14320. d.addComponent(a),
  14321. d.once(ee.AfterRender, function() {
  14322. ne.warn("First render after quickstart load finished.")
  14323. })
  14324. })
  14325. }
  14326. return window.flyToFirst = function() {
  14327. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14328. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14329. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14330. c.flyToPano({
  14331. pano: e,
  14332. lookAtPoint: i
  14333. })
  14334. }
  14335. ,
  14336. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14337. }).then(function() {
  14338. return function(e, t, i, n, r) {
  14339. return r.progressCallback = t,
  14340. N.sessionStart(),
  14341. e.load(n).progress(function(e, t) {
  14342. e.modelElementsToLoad = t[1],
  14343. function(e) {
  14344. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14345. }(e),
  14346. function(e) {
  14347. e.totalElementsLoaded++,
  14348. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14349. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14350. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14351. console.log("pro:" + e.totalPercentageLoaded),
  14352. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14353. }(e)
  14354. }
  14355. .bind(this, r))
  14356. }(g, D.onProgress, 0, !o, n)
  14357. }).then(function() {
  14358. s.quickstart = o,
  14359. function(e, t, i, n) {
  14360. var r = i.qualityManager
  14361. , o = i.panoRenderer
  14362. , a = i.tileDownloader
  14363. , s = i.modelManager
  14364. , l = i.player
  14365. , c = i.director
  14366. , h = i.tagManager
  14367. , u = i.displayController
  14368. , d = i.labelDisplayController
  14369. , p = i.controls;
  14370. t.scene.add(e),
  14371. t.qualityManager = r;
  14372. var f = {
  14373. camera: t.camera,
  14374. director: c,
  14375. modelManager: s,
  14376. tileDownloader: a,
  14377. panoRenderer: o,
  14378. qualityManager: r,
  14379. tagManager: h,
  14380. container: n,
  14381. controls: p
  14382. };
  14383. l.init(f),
  14384. l.setScene(t.scene),
  14385. h.init(s, l),
  14386. c.init(l, s),
  14387. u.init(c, l, s, h, n),
  14388. d.init(l, s, n),
  14389. B.bindEvents(l),
  14390. t.addComponent(h),
  14391. t.addComponent(l),
  14392. t.addComponent(o),
  14393. l.sceneRenderer = t
  14394. }(g, d, m, r),
  14395. d.started || C(d, r, g),
  14396. N.modelLoaded(g, c, l, L.autoplay),
  14397. function(e, t, i, n) {
  14398. return ne.info("Starting player in " + i.mode),
  14399. N.report(t.sid, "started-playing", n, i.quickstart),
  14400. e.start(i)
  14401. }(c, g, s, L.autoplay).done(function() {
  14402. h.autoTour()
  14403. }),
  14404. g.supportsTiles || new H(g,c).start();
  14405. o && (d.removeComponent(a),
  14406. a.destroy(),
  14407. s.pano.enter()),
  14408. D.init(g, h, c, l, d, s, N.getSessionId()),
  14409. D.endLoading(g, h, u),
  14410. d.once(ee.AfterRender, function() {
  14411. v.setAppReadyTime();
  14412. var e = v.calcFullLoadingTime();
  14413. ne.warn("Total load time: " + e / 1e3),
  14414. N.loadComplete(e),
  14415. ne.warn("First render after model load finished.");
  14416. editTool.loadDone('data', window.DATA)
  14417. }),
  14418. d.on(ee.MemoryUsageUpdated, y)
  14419. }).fail(A.bind(this, e))
  14420. }()
  14421. }()
  14422. }).fail(e=>{
  14423. alert("缺少someData文件,请检查场景码是否正确。")
  14424. })
  14425. }
  14426. ).call(this, "/js/main.js")
  14427. }
  14428. , {
  14429. "./DisplayController": 1,
  14430. "./TimingData": 2,
  14431. "./ab": 3,
  14432. "./analytics": 4,
  14433. "./cameras/PanoramaCamera": 7,
  14434. "./controls/CameraControls": 9,
  14435. "./director": 15,
  14436. "./effects": 16,
  14437. "./enum/PanoSizeClass": 36,
  14438. "./enum/PanoramaEvents": 37,
  14439. "./enum/RenderLayers": 41,
  14440. "./enum/SceneRendererEvents": 43,
  14441. "./enum/Viewmode": 51,
  14442. "./featureflags": 59,
  14443. "./gui/error": 64,
  14444. "./gui/gui": 65,
  14445. "./gui/memoryUsage": 73,
  14446. "./label/LabelDisplayController": 91,
  14447. "./lib/array-polyfill": 92,
  14448. "./lib/performance-polyfill": 95,
  14449. "./lib/postprocessing/EffectComposer.js": 96,
  14450. "./lib/postprocessing/MaskPass.js": 97,
  14451. "./lib/postprocessing/RenderPass.js": 98,
  14452. "./lib/postprocessing/ShaderPass.js": 99,
  14453. "./lib/shaders/CopyShader.js": 100,
  14454. "./lib/shaders/HorizontalBlurShader.js": 101,
  14455. "./lib/shaders/VerticalBlurShader.js": 102,
  14456. "./lib/three75-shim": 103,
  14457. "./localization/localize": 108,
  14458. "./tag/tagManager": 124,
  14459. "./model/ModelManager": 140,
  14460. "./objects/Panorama": 148,
  14461. "./objects/Skybox": 152,
  14462. "./player": 155,
  14463. "./preloaders": 156,
  14464. "./scene/QuickstartManager": 157,
  14465. "./scene/SceneRenderer": 158,
  14466. "./sdk/automation.js": 164,
  14467. "./settings": 166,
  14468. "./showcase": 168,
  14469. "./tile/PanoRenderer": 169,
  14470. "./tile/QualityManager.js": 170,
  14471. "./tile/TileDownloader": 171,
  14472. "./util/PanoramaCollection": 178,
  14473. "./util/ajax": 181,
  14474. "./util/browser": 182,
  14475. "./util/camera": 183,
  14476. "./util/common": 185,
  14477. "./util/lerp": 188,
  14478. "./util/logger": 189,
  14479. "./util/math": 190,
  14480. "./util/sentry": 192,
  14481. "./util/showcase": 193,
  14482. "./util/transitions": 195,
  14483. events: 202,
  14484. "promise-polyfill": 213,
  14485. three: 217
  14486. }],
  14487. 117: [function(e, t, i) {
  14488. "use strict";
  14489. function n(e) {
  14490. e = e || {},
  14491. r.RawShaderMaterial.call(this, a.extendObject({
  14492. fragmentShader: o.cube.fragmentShader,
  14493. vertexShader: o.cube.vertexShader,
  14494. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14495. name: "CubemapMaterial"
  14496. }, e))
  14497. }
  14498. var r = e("three")
  14499. , o = e("../shaders")
  14500. , a = e("../util/common");
  14501. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14502. t.exports = n
  14503. }
  14504. , {
  14505. "../shaders": 167,
  14506. "../util/common": 185,
  14507. three: 217
  14508. }],
  14509. 118: [function(e, t, i) {
  14510. "use strict";
  14511. function n(e) {
  14512. e = e || {},
  14513. r.RawShaderMaterial.call(this, a.extendObject({
  14514. fragmentShader: o.model.fragmentShader,
  14515. vertexShader: o.model.vertexShader,
  14516. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14517. name: "ModelTextureMaterial"
  14518. }, e))
  14519. }
  14520. var r = e("three")
  14521. , o = e("../shaders")
  14522. , a = e("../util/common");
  14523. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14524. i && (this.uniforms.progress.value = 0),
  14525. e.ensureSkyboxReadyForRender(),
  14526. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14527. this.uniforms.pano0Position.value.copy(e.position),
  14528. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14529. t.ensureSkyboxReadyForRender(),
  14530. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14531. this.uniforms.pano1Position.value.copy(t.position),
  14532. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14533. }
  14534. ,
  14535. t.exports = n
  14536. }
  14537. , {
  14538. "../shaders": 167,
  14539. "../util/common": 185,
  14540. three: 217
  14541. }],
  14542. 119: [function(m, v, e) {
  14543. (function(e) {
  14544. "use strict";
  14545. function t(e, t, i, n) {
  14546. this.div = null,
  14547. this.body = null,
  14548. this.label = e,
  14549. this.description = t,
  14550. this.parsedDescription = [],
  14551. this.media = i || {
  14552. type: null
  14553. },
  14554. this.loadingSpinner = null,
  14555. this.parser = new r({
  14556. supportLinks: !c.valueFromHash("mls"),
  14557. keepLinkLabels: !0
  14558. }),
  14559. this.state = g.CLOSED,
  14560. this.orientation = "",
  14561. this.initialTransform = "",
  14562. this.hovering = !1,
  14563. this.openTransition = null,
  14564. this.closeTransition = null,
  14565. this.openPromise = null,
  14566. this.closePromise = null,
  14567. this.animationTransition = null,
  14568. this.animationScale = 0
  14569. }
  14570. var r = m("../Parser/DescriptionParser")
  14571. , i = m("../Media/Link")
  14572. , n = m("../Media/Image")
  14573. , o = m("../Media/EmbedlyPlayer")
  14574. , a = m("../Media/EmbedlyEmbed")
  14575. , s = m("../../util/transitions")
  14576. , l = m("../../util/lerp")
  14577. , c = m("../../util/browser")
  14578. , b = m("./BillboardEvent")
  14579. , w = m("../Media/MediaEvent")
  14580. , h = m("../Parser/DescriptionChunkType")
  14581. , u = m("events").EventEmitter
  14582. , d = m("./billboardSettings")
  14583. , T = m("./overlaySettings")
  14584. , p = new (m("../../util/logger"))(e)
  14585. , f = document.getElementById("tag-billboards");
  14586. f.addEventListener("touchend", function(e) {
  14587. f.style.pointerEvents = "none"
  14588. }),
  14589. f.addEventListener("touchcancel", function(e) {
  14590. f.style.pointerEvents = "none"
  14591. });
  14592. var g = {
  14593. CLOSED: "closed",
  14594. OPENING: "opening",
  14595. OPEN: "open",
  14596. CLOSING: "closing",
  14597. ACTIVE: "active"
  14598. };
  14599. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14600. this.parsedDescription = this.parser.parse(this.description);
  14601. var t = document.createElement("div");
  14602. t.className = "tag-container has-hotzone",
  14603. this.div = t,
  14604. this.body = document.createElement("div"),
  14605. this.body.className = "tag-body";
  14606. var i = document.createElement("div");
  14607. i.classList.add("tag-content");
  14608. var n = document.createElement("div");
  14609. n.classList.add("tag-text-content");
  14610. var r = document.createElement("div");
  14611. r.className = "tag-label",
  14612. r.textContent = this.label,
  14613. n.appendChild(r);
  14614. var o = document.createElement("div");
  14615. o.className = "tag-desc",
  14616. n.appendChild(o),
  14617. i.appendChild(n),
  14618. this.body.appendChild(i),
  14619. this.appendDescriptionElements(this.parsedDescription, o),
  14620. this.appendMedia(),
  14621. t.appendChild(this.body),
  14622. f.appendChild(t),
  14623. this.bindEvents(t, this.body)
  14624. }
  14625. ,
  14626. t.prototype.bindEvents = function(i, e) {
  14627. function t(n) {
  14628. return function(e) {
  14629. if (!this.div.classList.contains("overlay")) {
  14630. var t, i = document.getElementById("player");
  14631. try {
  14632. t = new MouseEvent(n,e)
  14633. } catch (i) {
  14634. (t = document.createEvent("MouseEvents")).initMouseEvent(n, 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)
  14635. }
  14636. i.dispatchEvent(t)
  14637. }
  14638. }
  14639. }
  14640. e.addEventListener("mousedown", function(e) {
  14641. e.stopPropagation()
  14642. }),
  14643. e.addEventListener("mouseup", function(e) {
  14644. e.stopPropagation()
  14645. }),
  14646. i.addEventListener("touchstart", function(e) {
  14647. f.style.pointerEvents = "auto"
  14648. }),
  14649. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14650. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14651. e.addEventListener("mouseover", function(e) {
  14652. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14653. }
  14654. .bind(this)),
  14655. i.addEventListener("mouseenter", function(e) {
  14656. this.state !== g.CLOSING && (this.hovering = !0,
  14657. this.emit(b.ENTER))
  14658. }
  14659. .bind(this)),
  14660. i.addEventListener("mouseleave", function(e) {
  14661. this.hovering = !1,
  14662. this.emit(b.LEAVE)
  14663. }
  14664. .bind(this)),
  14665. i.addEventListener("gesturestart", function(e) {
  14666. e.preventDefault()
  14667. });
  14668. var n = i.querySelector(".tag-text-content")
  14669. , r = 0;
  14670. n.addEventListener("touchstart", function(e) {
  14671. r = e.changedTouches[0].clientY
  14672. }),
  14673. n.addEventListener("touchmove", function(t) {
  14674. function e(e) {
  14675. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14676. }
  14677. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14678. }),
  14679. i.addEventListener("touchmove", function(e) {
  14680. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14681. })
  14682. }
  14683. ,
  14684. t.prototype.appendDescriptionElements = function(e, i) {
  14685. 0 < e.length && this.div.classList.add("has-text"),
  14686. e.forEach(function(e, t) {
  14687. switch (e.type) {
  14688. case h.TEXT:
  14689. i.appendChild(this.createTextElement(e.text));
  14690. break;
  14691. case h.LINK:
  14692. i.appendChild(this.createLinkElement(e.link))
  14693. }
  14694. }
  14695. .bind(this))
  14696. }
  14697. ,
  14698. t.prototype.appendLoadingSpinner = function() {
  14699. this.loadingSpinner = document.createElement("div"),
  14700. this.loadingSpinner.classList.add("loading-spinner");
  14701. var e = document.createElement("div");
  14702. e.classList.add("gui-spinner-icon"),
  14703. this.loadingSpinner.appendChild(e),
  14704. this.body.appendChild(this.loadingSpinner)
  14705. }
  14706. ,
  14707. t.prototype.onMediaLoadFinished = function() {
  14708. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14709. this.applyOrientation(this.orientation),
  14710. this.loadingSpinner = null)
  14711. }
  14712. ,
  14713. t.prototype.appendMedia = function() {
  14714. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14715. this.appendLoadingSpinner();
  14716. var e = document.createElement("div");
  14717. e.classList.add("tag-media-content");
  14718. var t = document.createElement("i");
  14719. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14720. t.classList.add(e)
  14721. }),
  14722. this.body.appendChild(t),
  14723. this.body.appendChild(e),
  14724. this.media.type) {
  14725. case h.IMAGE:
  14726. e.appendChild(this.createImageElement(this.media, this.body));
  14727. break;
  14728. case h.VIDEO:
  14729. e.appendChild(this.createVideoElement(this.media, this.body));
  14730. break;
  14731. case h.RICH:
  14732. e.appendChild(this.createEmbedElement(this.media, this.body))
  14733. }
  14734. }
  14735. }
  14736. ,
  14737. t.prototype.createTextElement = function(e) {
  14738. var t = document.createElement("span");
  14739. return t.textContent = e,
  14740. t
  14741. }
  14742. ,
  14743. t.prototype.createLinkElement = function(e) {
  14744. var t = new i(e);
  14745. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14746. t.createDomElement()
  14747. }
  14748. ,
  14749. t.prototype.createImageElement = function(t, C) {
  14750. function e() {
  14751. function e() {
  14752. p || (E.classList.remove("view-image"),
  14753. a.classList.add("overlay"),
  14754. t(),
  14755. window.addEventListener("resize", A),
  14756. a.addEventListener("click", i),
  14757. c.addEventListener("click", r),
  14758. o.addEventListener("click", n),
  14759. p = !0,
  14760. _.emit(w.IMAGE_OPENED))
  14761. }
  14762. function t() {
  14763. C.classList.add("show-info"),
  14764. s.classList.remove("collapsible"),
  14765. s.style.height = "";
  14766. var e = parseFloat(getComputedStyle(v).lineHeight)
  14767. , t = g + e
  14768. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14769. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14770. , r = n
  14771. , o = r * I.aspect;
  14772. i < o && (r = (o = i) / I.aspect),
  14773. n < r && (o = (r = n) * I.aspect),
  14774. o += m,
  14775. r += m + t,
  14776. C.style.width = o + "px",
  14777. C.style.height = r + "px",
  14778. l.style.paddingTop = e + m + "px",
  14779. 0 < _.description.length && (s.classList.add("collapsible"),
  14780. s.style.height = s.clientHeight + 12 + "px",
  14781. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14782. }
  14783. function i(e) {
  14784. e.target === a && n()
  14785. }
  14786. function n() {
  14787. p && (p = !1,
  14788. E.classList.add("view-image"),
  14789. a.classList.remove("overlay"),
  14790. s.style.height = "",
  14791. l.style.paddingTop = "",
  14792. C.style.width = "",
  14793. C.style.height = "",
  14794. window.removeEventListener("resize", A),
  14795. a.removeEventListener("click", i),
  14796. c.removeEventListener("click", r),
  14797. o.removeEventListener("click", n),
  14798. _.emit(w.IMAGE_CLOSED),
  14799. _.close(!0))
  14800. }
  14801. function r(e) {
  14802. C.classList.toggle("show-info")
  14803. }
  14804. var a = _.div
  14805. , s = a.getElementsByClassName("tag-content")[0]
  14806. , l = a.getElementsByClassName("tag-media-content")[0]
  14807. , o = C.getElementsByClassName("close")[0]
  14808. , c = s.getElementsByClassName("tag-label")[0];
  14809. a.classList.add("has-image"),
  14810. E.classList.add("view-image"),
  14811. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14812. _.applyOrientation(_.orientation);
  14813. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14814. function() {
  14815. clearInterval(h),
  14816. clearTimeout(u),
  14817. h = setInterval(function() {
  14818. var e = a.clientHeight;
  14819. d !== e && (t(),
  14820. d = e)
  14821. }, 100),
  14822. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14823. }
  14824. );
  14825. I.on(w.IMAGE_OPENING, e),
  14826. _.on(b.ACTIVATE, e),
  14827. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14828. _.on(b.CLOSING, n)
  14829. }
  14830. var I = new n
  14831. , E = I.createDomElement();
  14832. this.once(b.OPENED, function() {
  14833. I.load(t.src).then(e).catch(function(e) {
  14834. p.warn("Failed to load image:", t.src),
  14835. p.warn("with error:", e)
  14836. }).then(this.onMediaLoadFinished.bind(this))
  14837. });
  14838. var _ = this;
  14839. return E
  14840. }
  14841. ,
  14842. t.prototype.createVideoElement = function(t, e) {
  14843. var i = new o({
  14844. autoPlay: !0,
  14845. autoResume: !0,
  14846. startMuted: !1,
  14847. loop: !1
  14848. })
  14849. , n = i.createDomElement();
  14850. return this.once(b.OPENED, function() {
  14851. i.load(t.src).then(function() {
  14852. this.div.classList.add("has-video"),
  14853. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14854. i.play()),
  14855. this.on(b.OPENING, i.show.bind(i)),
  14856. this.on(b.OPENED, i.play.bind(i)),
  14857. this.on(b.CLOSING, i.pause.bind(i)),
  14858. this.on(b.CLOSED, i.hide.bind(i))
  14859. }
  14860. .bind(this)).catch(function(e) {
  14861. p.warn("Failed to embed video:", t.src),
  14862. p.warn("with error:", e)
  14863. }).then(this.onMediaLoadFinished.bind(this))
  14864. }
  14865. .bind(this)),
  14866. n
  14867. }
  14868. ,
  14869. t.prototype.createEmbedElement = function(t, e) {
  14870. var i = new a
  14871. , n = i.createDomElement();
  14872. return this.once(b.OPENED, function() {
  14873. i.load(t.src).then(function() {
  14874. this.div.classList.add("has-embed"),
  14875. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14876. this.applyOrientation(this.orientation),
  14877. this.on(b.OPENING, i.show.bind(i)),
  14878. this.on(b.CLOSED, i.hide.bind(i))
  14879. }
  14880. .bind(this)).catch(function(e) {
  14881. p.warn("Failed to embed:", t.src),
  14882. p.warn("with error:", e)
  14883. }).then(this.onMediaLoadFinished.bind(this))
  14884. }
  14885. .bind(this)),
  14886. n
  14887. }
  14888. ,
  14889. t.prototype.open = function(e) {
  14890. return this.openPromise = $.Deferred(),
  14891. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14892. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14893. this.state !== g.OPEN && (this.emit(b.OPENING),
  14894. e && this.emit(b.ACTIVATING),
  14895. this.state = g.OPENING,
  14896. this.animateOpen(function() {
  14897. e && this.setActiveState(),
  14898. this.openPromise.resolve()
  14899. }
  14900. .bind(this)))
  14901. }
  14902. .bind(this), d.animation.openDelay),
  14903. s.cancel(this.closeTransition),
  14904. this.closePromise && this.closePromise.reject(),
  14905. this.closeTransition = void 0,
  14906. this.openPromise.promise())
  14907. }
  14908. ,
  14909. t.prototype.close = function(e) {
  14910. return this.closePromise = $.Deferred(),
  14911. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14912. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14913. this.state = g.CLOSING,
  14914. this.animateClose())
  14915. }
  14916. .bind(this), d.animation.closeDelay)),
  14917. s.cancel(this.openTransition),
  14918. this.openPromise && this.openPromise.reject(),
  14919. this.openTransition = void 0,
  14920. this.closePromise.resolve(),
  14921. this.closePromise.promise())
  14922. }
  14923. ,
  14924. t.prototype.setActiveState = function() {
  14925. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14926. this.emit(b.ACTIVATE),
  14927. this.div.classList.remove("has-hotzone"))
  14928. }
  14929. ,
  14930. t.prototype.animateOpen = function(e) {
  14931. if (this.state === g.OPENING) {
  14932. if (s.cancel(this.animationTransition),
  14933. c.detectSamsungNative())
  14934. return this.boardOrientation = null,
  14935. this.div.style.visibility = "visible",
  14936. this.emit(b.OPENED),
  14937. this.state = g.OPEN,
  14938. void (e && e());
  14939. this.div.style.webkitTransform = "scale(0)",
  14940. this.div.style.transform = "scale(0)",
  14941. this.div.style.visibility = "visible",
  14942. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14943. this.emit(b.OPENED),
  14944. this.state = g.OPEN,
  14945. e && e()
  14946. }
  14947. .bind(this))
  14948. }
  14949. }
  14950. ,
  14951. t.prototype.animateClose = function(e) {
  14952. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14953. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14954. this.emit(b.CLOSED),
  14955. this.state = g.CLOSED,
  14956. this.div.style.visibility = "hidden",
  14957. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14958. e && e()
  14959. }
  14960. .bind(this)))
  14961. }
  14962. ,
  14963. t.prototype.needsUpdate = function() {
  14964. return this.state !== g.CLOSED
  14965. }
  14966. ,
  14967. t.prototype.update = function(e, t) {
  14968. if (this.needsUpdate()) {
  14969. var i = (this.updateOrientation(e),
  14970. this.calcScale(t))
  14971. , n = {
  14972. x: (e.x + 1) * $("#player").width() / 2,
  14973. y: (e.y + 1) * $("#player").height() / 2
  14974. };
  14975. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14976. this.div.style.webkitTransform = this.div.screenTransform,
  14977. this.div.style.transform = this.div.screenTransform
  14978. }
  14979. }
  14980. ,
  14981. t.prototype.getDimensions = function() {
  14982. return this.div.getBoundingClientRect()
  14983. }
  14984. ,
  14985. t.prototype.calcScale = function(e) {
  14986. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14987. }
  14988. ,
  14989. t.prototype.updateOrientation = function(e) {
  14990. if (this.state !== g.ACTIVE) {
  14991. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14992. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14993. , n = "";
  14994. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14995. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14996. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14997. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14998. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14999. }
  15000. }
  15001. ,
  15002. t.prototype.applyOrientation = function(e) {
  15003. this.div.style.transform = this.div.style.webkitTransform = "",
  15004. this.div.classList.remove("tag-container-" + this.orientation),
  15005. this.div.classList.add("tag-container-" + e);
  15006. var t = window.getComputedStyle(this.div);
  15007. this.initialTransform = t.transform || t.webkitTransform,
  15008. "none" === this.initialTransform && (this.initialTransform = "");
  15009. var i = t.transform.slice(7, -1).split(",")
  15010. , n = -i[4]
  15011. , r = -i[5];
  15012. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15013. this.div.style.transformOrigin = n + "px " + r + "px",
  15014. this.orientation = e
  15015. }
  15016. ,
  15017. v.exports = t
  15018. }
  15019. ).call(this, "/js/tag/Billboard/Billboard.js")
  15020. }
  15021. , {
  15022. "../../util/browser": 182,
  15023. "../../util/lerp": 188,
  15024. "../../util/logger": 189,
  15025. "../../util/transitions": 195,
  15026. "../Media/EmbedlyEmbed": 125,
  15027. "../Media/EmbedlyPlayer": 126,
  15028. "../Media/Image": 128,
  15029. "../Media/Link": 129,
  15030. "../Media/MediaEvent": 131,
  15031. "../Parser/DescriptionChunkType": 133,
  15032. "../Parser/DescriptionParser": 134,
  15033. "./BillboardEvent": 120,
  15034. "./billboardSettings": 121,
  15035. "./overlaySettings": 122,
  15036. events: 202
  15037. }],
  15038. 120: [function(e, t, i) {
  15039. "use strict";
  15040. t.exports = Object.freeze({
  15041. ENTER: "billboard.enter",
  15042. LEAVE: "billboard.leave",
  15043. OPENING: "billboard.opening",
  15044. OPENED: "billboard.open",
  15045. CLOSING: "billboard.closing",
  15046. CLOSED: "billboard.closed",
  15047. ACTIVATING: "billboard.activating",
  15048. ACTIVATE: "billboard.activate"
  15049. })
  15050. }
  15051. , {}],
  15052. 121: [function(e, t, i) {
  15053. "use strict";
  15054. t.exports = Object.freeze({
  15055. animation: Object.freeze({
  15056. hoverOnClosing: !1,
  15057. openDelay: 100,
  15058. closeDelay: 50,
  15059. openDuration: 200,
  15060. closeDuration: 100
  15061. }),
  15062. boardToDiscRatio: 1.2
  15063. })
  15064. }
  15065. , {}],
  15066. 122: [function(e, t, i) {
  15067. "use strict";
  15068. t.exports = Object.freeze({
  15069. boundaryWidth: 30,
  15070. boundaryHeight: 0
  15071. })
  15072. }
  15073. , {}],
  15074. 123: [function(M, R, e) {
  15075. (function(e) {
  15076. "use strict";
  15077. function d(e, t, i) {
  15078. var n = i.version || "0";
  15079. "0" !== n && w.info("tag defined using version " + n),
  15080. this.model = e,
  15081. this.sid = t,
  15082. this.color = (new f.Color).set(i.color || o.tagDefault),
  15083. this.hoverColor = o._darken(this.color, .2),
  15084. this.floor = null,
  15085. this.floorIndex = i.floor,
  15086. this.mode = m.PANORAMA,
  15087. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15088. this.obj3d = null,
  15089. this.disc = null,
  15090. this.materials = {
  15091. disc: null,
  15092. pole: null
  15093. },
  15094. this.position = (new f.Vector3).copy(i.position),
  15095. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15096. this.discWorldPosition = null,
  15097. this.discScale = .05,
  15098. this.poleEnabled = i.stem.enabled,
  15099. this.billboard = new r(i.label,i.description,i.media,this),
  15100. this.visibleTransition = null,
  15101. this.hoveringDisc = !1
  15102. }
  15103. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  15104. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.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=="), x = t.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"), S = new f.PlaneBufferGeometry(1,1);
  15105. d.prototype = Object.create(b.prototype),
  15106. d.raycaster = new f.Raycaster,
  15107. d.prototype.bindEvents = function() {
  15108. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15109. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15110. }
  15111. ,
  15112. d.prototype.build = function() {
  15113. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15114. this.floor && (this.billboard.build(this.model.sid),
  15115. this.obj3d = this.buildObject3D(),
  15116. this.floor.add(this.obj3d)),
  15117. this
  15118. }
  15119. ,
  15120. d.prototype.buildObject3D = function() {
  15121. var e = new f.Object3D;
  15122. e.position.copy(this.position);
  15123. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15124. t.bg.value = x,
  15125. t.mask.value = T,
  15126. t.color.value.copy(this.color),
  15127. this.materials.disc = new f.RawShaderMaterial({
  15128. transparent: !0,
  15129. vertexShader: A.tagDisc.vertexShader,
  15130. fragmentShader: A.tagDisc.fragmentShader,
  15131. uniforms: t
  15132. }),
  15133. this.disc = new f.Mesh(S,this.materials.disc),
  15134. this.disc.layers.set(a.TAG),
  15135. this.disc.position.copy(this.discPosition),
  15136. this.disc.renderOrder = s.tagDisc;
  15137. var i = (this.disc.tag = this).buildPole();
  15138. return i.layers.set(a.TAG),
  15139. i.renderOrder = s.tagStem,
  15140. e.add(i),
  15141. e.layers.set(a.TAG),
  15142. e.add(this.disc)
  15143. }
  15144. ,
  15145. d.prototype.buildPole = function() {
  15146. var e = new f.BufferGeometry
  15147. , t = new Float32Array(6);
  15148. return t[0] = t[1] = t[2] = 0,
  15149. t[3] = this.discPosition.x,
  15150. t[4] = this.discPosition.y,
  15151. t[5] = this.discPosition.z,
  15152. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15153. this.materials.pole = new f.LineBasicMaterial({
  15154. linewidth: g.tags.pole.width,
  15155. color: g.tags.pole.color,
  15156. opacity: 0,
  15157. visible: this.poleEnabled,
  15158. transparent: !0,
  15159. depthWrite: !1
  15160. }),
  15161. new f.Line(e,this.materials.pole)
  15162. }
  15163. ,
  15164. d.prototype.setFreeState = function(e) {
  15165. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15166. this.materials.disc.uniforms.color.value = this.color
  15167. }
  15168. .bind(this))
  15169. }
  15170. ,
  15171. d.prototype.setHoverState = function(e) {
  15172. this.billboard.open(e),
  15173. this.materials.disc.uniforms.color.value = this.hoverColor
  15174. }
  15175. ,
  15176. d.prototype.hide = function(e, t) {
  15177. var i = $.Deferred();
  15178. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15179. return i.resolve().promise();
  15180. e = e || 0,
  15181. t = t || 0,
  15182. C.cancel(this.visibleTransition);
  15183. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15184. return this.visibleTransition = C.start((n = this,
  15185. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15186. o = I.property(n.materials.pole, "opacity", 0),
  15187. function(e) {
  15188. r(e),
  15189. n.materials.pole && o(e)
  15190. }
  15191. ), s * a, function() {
  15192. i.resolve()
  15193. }, l, E[g.warp.blendEasing]),
  15194. i.promise()
  15195. }
  15196. ,
  15197. d.prototype.show = function(e, t) {
  15198. var i = $.Deferred();
  15199. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15200. return i.resolve().promise();
  15201. e = e || 0,
  15202. t = t || 0,
  15203. C.cancel(this.visibleTransition);
  15204. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15205. return this.visibleTransition = C.start((n = this,
  15206. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15207. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15208. function(e) {
  15209. r(e),
  15210. n.materials.pole && o(e)
  15211. }
  15212. ), s * a, function() {
  15213. i.resolve()
  15214. }, l, E[g.warp.blendEasing]),
  15215. i.promise()
  15216. }
  15217. ,
  15218. d.prototype.closestPanoTowardTag = function(e, t) {
  15219. var i = []
  15220. , n = []
  15221. , r = this.disc.getWorldPosition();
  15222. if (e === m.PANORAMA) {
  15223. var o = t.position.clone().sub(r).normalize();
  15224. i.push(y.filters.isPanoAligned()),
  15225. i.push(y.filters.inPanoDirection(r, o, .5)),
  15226. i.push(y.filters.isNeighbourPanoTo(t)),
  15227. n.push(y.scoreFunctions.direction(r, o))
  15228. }
  15229. var a = new f.Vector3;
  15230. i.push(function(e) {
  15231. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15232. }, function(e) {
  15233. a.copy(r).sub(e.position);
  15234. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15235. , i = g.tags.navigate.tiltTolerance;
  15236. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15237. }),
  15238. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15239. var s = this.model.panos.sortByScore(i, n);
  15240. if (g.tags.navigate.lineOfSight) {
  15241. for (var l = 0; l < s.length; l++) {
  15242. var c = s[l].pano
  15243. , h = c.position.distanceTo(r);
  15244. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15245. return null;
  15246. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15247. var u = d.raycaster.intersectObjects(this.model.colliders);
  15248. if (0 === u.length || u[0].distance > h)
  15249. return c
  15250. }
  15251. return null
  15252. }
  15253. return 0 < s.length && s[0].pano
  15254. }
  15255. ,
  15256. d.prototype.examine = function(i) {
  15257. if(!player.currentPano)return;
  15258. var e = i.mode
  15259. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15260. , t = this.disc.getWorldPosition();
  15261. this.billboard.setActiveState();
  15262. var r = function() {
  15263. var e = this.billboard.getDimensions()
  15264. , t = new f.Vector3;
  15265. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15266. t.unproject(i.camera),
  15267. i.flyToPano({
  15268. pano: n,
  15269. lookAtPoint: t
  15270. })
  15271. }
  15272. .bind(this);
  15273. if (e === m.PANORAMA)
  15274. if (n !== i.currentPano) {
  15275. var o = {
  15276. pano: n,
  15277. lookAtPoint: t,
  15278. duration: null,
  15279. maxDistanceOverride: null,
  15280. skipWarpingCheck: !1
  15281. };
  15282. i.flyToPano(o, r)
  15283. } else
  15284. setTimeout(function() {
  15285. this.billboard.open().then(function() {
  15286. r()
  15287. })
  15288. }
  15289. .bind(this), 0);
  15290. else {
  15291. var a = {
  15292. pano: n
  15293. };
  15294. if (t) {
  15295. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15296. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15297. }
  15298. a.callback = r,
  15299. a.duration = 1500,
  15300. a.mode = m.PANORAMA,
  15301. i.flyToNewMode(a)
  15302. }
  15303. }
  15304. ,
  15305. d.prototype.update = (n = new f.Vector3,
  15306. function(e, t) {
  15307. this.discWorldPosition = this.disc.getWorldPosition(),
  15308. this.updateDisc(e, t),
  15309. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15310. n.z < 1 && (n.y *= -1,
  15311. this.billboard.update(n, this.getDiscRadius(n, t))))
  15312. }
  15313. ),
  15314. d.prototype.updateDisc = (l = new f.Vector3,
  15315. c = new f.Vector3,
  15316. h = new f.Vector3,
  15317. u = new f.Vector3,
  15318. p = new f.Vector3,
  15319. function(e, t) {
  15320. var i = g.tags.visibility
  15321. , n = g.tags.disc.scale
  15322. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15323. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15324. this.obj3d.visible) {
  15325. this.disc.quaternion.copy(t.quaternion);
  15326. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15327. l.copy(this.discWorldPosition).project(t),
  15328. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15329. h.set(o / 2, 0, 0).add(c),
  15330. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15331. p.copy(u).unproject(t);
  15332. var a = p.distanceTo(this.discWorldPosition)
  15333. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15334. this.discScale = a * s,
  15335. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15336. }
  15337. }
  15338. ),
  15339. d.prototype.getDiscRadius = (i = new f.Vector3,
  15340. function(e, t) {
  15341. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15342. Math.abs(e.x - i.x) * $("#player").width()
  15343. }
  15344. ),
  15345. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15346. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15347. }
  15348. ,
  15349. d.prototype.offScreen = function(e, t) {
  15350. var i = e.getWorldPosition().project(t);
  15351. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15352. }
  15353. ,
  15354. d.viewportScale = function() {
  15355. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15356. d.viewportHeight = $("#player").height(),
  15357. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15358. d.currentViewportScale
  15359. }
  15360. ,
  15361. R.exports = d
  15362. }
  15363. ).call(this, "/js/tag/tag.js")
  15364. }
  15365. , {
  15366. "../enum/Colors": 19,
  15367. "../enum/RenderLayers": 41,
  15368. "../enum/RenderOrder": 42,
  15369. "../enum/Viewmode": 51,
  15370. "../objects/Panorama": 148,
  15371. "../settings": 166,
  15372. "../shaders": 167,
  15373. "../util/common": 185,
  15374. "../util/easing": 186,
  15375. "../util/lerp": 188,
  15376. "../util/logger": 189,
  15377. "../util/math": 190,
  15378. "../util/texture": 194,
  15379. "../util/transitions": 195,
  15380. "./Billboard/Billboard": 119,
  15381. "./Billboard/BillboardEvent": 120,
  15382. events: 202,
  15383. three: 217
  15384. }],
  15385. 124: [function(M, R, e) {
  15386. (function(e) {
  15387. "use strict";
  15388. function t() {
  15389. this.tagState = T.IDLE,
  15390. this.intersectTag = null,
  15391. this.hoveredTag = null,
  15392. this.activeTag = null,
  15393. this.tagDiscs = [],
  15394. this.raycaster = new i.Raycaster,
  15395. this.modelManager = null,
  15396. this.player = null,
  15397. this.totaltags = 0,
  15398. this.navigatingViaTag = !1,
  15399. this.enabled = !1
  15400. }
  15401. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15402. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15403. r.extend(t, x),
  15404. t.prototype.init = function(e, t) {
  15405. this.modelManager = e,
  15406. this.player = t,
  15407. this.updateModel(),
  15408. this.bindEvents()
  15409. }
  15410. ,
  15411. t.prototype.update = function(e) {
  15412. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15413. }
  15414. ,
  15415. t.prototype.updateTags = function(e, t, i, n) {
  15416. for (var r in this.model.tags)
  15417. this.model.tags[r].update(e, t, i, n)
  15418. }
  15419. ,
  15420. t.prototype.updateModel = function() {
  15421. this.model = this.modelManager.getActiveModel(),
  15422. this.gettagsFromModel(),
  15423. this.totaltags = Object.keys(this.model.tags).length
  15424. }
  15425. ,
  15426. t.prototype.gettagsFromModel = function() {
  15427. for (var e in this.tagDiscs = [],
  15428. this.model.tags) {
  15429. var t = this.model.tags[e].disc;
  15430. t && this.tagDiscs.push(t)
  15431. }
  15432. }
  15433. ,
  15434. t.prototype.bindEvents = function() {
  15435. function e() {
  15436. Object.keys(this.model.tags).forEach(function(e) {
  15437. var t = this.model.tags[e];
  15438. t.bindEvents(),
  15439. t.billboard.on(y.LINK_CLICK, function(e) {
  15440. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15441. }
  15442. .bind(this)),
  15443. t.billboard.on(y.IMAGE_OPENED, function() {
  15444. this.tagState = T.EXAMINE,
  15445. this.emit(y.IMAGE_OPENED)
  15446. }
  15447. .bind(this)),
  15448. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15449. }
  15450. .bind(this))
  15451. }
  15452. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15453. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15454. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15455. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15456. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15457. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15458. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15459. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15460. e.call(this)
  15461. }
  15462. ,
  15463. t.prototype.navigateViaLink = function(e) {
  15464. var t = a.deserialize(e);
  15465. if (t)
  15466. if (t.mode === C.PANORAMA) {
  15467. try {
  15468. this.player.model.panos.get(t.panoId)
  15469. } catch (e) {
  15470. return void S.warn("Unable to find panorama location", t.panoId)
  15471. }
  15472. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15473. } else {
  15474. var i = {
  15475. cameraMode: t.mode,
  15476. position: t.position,
  15477. quaternion: t.quaternion,
  15478. scanId: t.panoId,
  15479. orthoZoom: t.zoom,
  15480. floorVisibility: t.floorVisibility,
  15481. thumbUrl: null,
  15482. name: null
  15483. };
  15484. this.player.flyToNewMode({
  15485. mode: t.mode,
  15486. duration: m.warp.outsideTime,
  15487. warpDest: new g(i),
  15488. force: !0
  15489. })
  15490. }
  15491. }
  15492. ,
  15493. t.prototype.handleWarpStart = function(e, t, i, n) {
  15494. this.dismissExaminedTag(),
  15495. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15496. e && (i = E.END),
  15497. this.hideShowTagsForBlackoutStyle(i, n))
  15498. }
  15499. ,
  15500. t.prototype.handleWarpInterruption = function(e, t, i) {
  15501. null != i || (i = m.warp.teleportTime),
  15502. this.hideShowTagsForBlackoutStyle(t, i)
  15503. }
  15504. ,
  15505. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15506. var i = 0
  15507. , n = 0
  15508. , r = t / 2;
  15509. switch (null != e || (e = E.MIDDLE),
  15510. e) {
  15511. case E.END:
  15512. this.hideAlltags(r);
  15513. break;
  15514. case E.BEGINNING:
  15515. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15516. break;
  15517. case E.NONE:
  15518. break;
  15519. case E.MIDDLE:
  15520. n = i = r,
  15521. this.hideAlltags(n),
  15522. setTimeout(function() {
  15523. this.showAlltags(i)
  15524. }
  15525. .bind(this), n);
  15526. break;
  15527. case E.FADEIN:
  15528. setTimeout(function() {
  15529. this.showAlltags(r)
  15530. }
  15531. .bind(this), r)
  15532. }
  15533. }
  15534. ,
  15535. t.prototype.onPlayerModeChanging = function(e, t) {
  15536. t !== C.PANORAMA && this.dismissExaminedTag(),
  15537. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15538. var i = t !== C.OUTDOOR;
  15539. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15540. }
  15541. ,
  15542. t.prototype.onPanoChange = function(e, t) {
  15543. var i = this.navigatingViaTag;
  15544. if (this.navigatingViaTag = !1,
  15545. !i) {
  15546. this.dismissExaminedTag();
  15547. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15548. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15549. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15550. }
  15551. }
  15552. ,
  15553. t.prototype.onPlayerReady = function(e, t, i) {
  15554. this.startAlltags(e, t ? i : null)
  15555. }
  15556. ,
  15557. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15558. this.updateClosestTags(e)
  15559. }
  15560. ,
  15561. t.prototype.dismissExaminedTag = function() {
  15562. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15563. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15564. this.hoveredTag = null)
  15565. }
  15566. ,
  15567. t.prototype.startAlltags = function(e, t) {
  15568. this.model.shouldShowtags = m.tags.enabled,
  15569. this.enabled = !0,
  15570. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15571. t && setTimeout(function() {
  15572. this.activateTag(this.model.getTagBySid(t))
  15573. }
  15574. .bind(this), m.tags.startup.fadeInDuration / 2))
  15575. }
  15576. ,
  15577. t.prototype.showAlltags = function(e, t, i) {
  15578. function n() {
  15579. ++o === this.totaltags && (this.model.tagsShown = !0,
  15580. r.resolve())
  15581. }
  15582. var r = $.Deferred();
  15583. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15584. return r.resolve().promise();
  15585. var o = 0;
  15586. for (var a in this.model.tags) {
  15587. this.model.tags[a].show(e, t).done(n.bind(this))
  15588. }
  15589. return r.promise()
  15590. }
  15591. ,
  15592. t.prototype.hideAlltags = function(e, t) {
  15593. function i() {
  15594. ++r === this.totaltags && (this.model.tagsShown = !1,
  15595. n.resolve())
  15596. }
  15597. var n = $.Deferred()
  15598. , r = 0;
  15599. for (var o in this.model.tags) {
  15600. var a = this.model.tags[o];
  15601. a.hide(e, t).done(i.bind(this)),
  15602. a === this.activeTag && this.dismissActiveTag()
  15603. }
  15604. return n.promise()
  15605. }
  15606. ,
  15607. t.prototype.enableHovering = function() {
  15608. this.enabled = !0
  15609. }
  15610. ,
  15611. t.prototype.disableHovering = function() {
  15612. this.enabled = !1
  15613. }
  15614. ,
  15615. t.prototype.activateTag = function(e, t) {
  15616. t = t || T.EXAMINE,
  15617. this.activeTag = e,
  15618. this.activeTag.hoveringDisc = !0,
  15619. this.activeTag.setHoverState(t === T.EXAMINE),
  15620. this.tagState = t,
  15621. this.emit(b.TagActivated, e)
  15622. }
  15623. ,
  15624. t.prototype.dismissActiveTag = function() {
  15625. this.activeTag.hoveringDisc = !1,
  15626. this.activeTag.setFreeState(!0);
  15627. var e = this.activeTag;
  15628. this.activeTag = null,
  15629. this.tagState = T.IDLE,
  15630. this.emit(b.TagDismissed, e)
  15631. }
  15632. ,
  15633. t.prototype.clickedOnTag = function(e) {
  15634. var t = function() {
  15635. this.navigatingViaTag = !0,
  15636. this.activeTag.examine(this.player),
  15637. this.emit(b.TagNavigation, this.activeTag)
  15638. }
  15639. .bind(this);
  15640. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15641. this.activeTag = this.intersectTag,
  15642. t(),
  15643. !0) : (this.dismissActiveTag(),
  15644. !1)
  15645. }
  15646. ,
  15647. t.prototype.intersecttag = (s = new i.Vector3,
  15648. l = new i.Vector3,
  15649. c = new i.Vector3,
  15650. function(e, t, i) {
  15651. if (!this.enabled)
  15652. return null;
  15653. var n = null
  15654. , r = this.tagDiscs.filter(function(e) {
  15655. return e.parent.visible
  15656. });
  15657. if (0 < r.length) {
  15658. var o = this.model.floors.reduce(function(e, t) {
  15659. return t.hidden ? e : e.concat(t.collider.children)
  15660. }, r);
  15661. s.set(e.x, e.y, -1).unproject(i),
  15662. l.set(e.x, e.y, 1).unproject(i),
  15663. c.copy(l).sub(s).normalize(),
  15664. this.raycaster.set(s, c);
  15665. var a = this.raycaster.intersectObjects(o);
  15666. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15667. }
  15668. return this.intersectTag = n,
  15669. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15670. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15671. this.hoveredTag = n
  15672. }
  15673. .bind(this)),
  15674. n.billboard.on(v.LEAVE, function() {
  15675. this.hoveredTag = null
  15676. }
  15677. .bind(this))),
  15678. this.activateTag(n, T.BROWSE))),
  15679. n
  15680. }
  15681. ),
  15682. t.prototype.rankedtagInDirection = (h = [],
  15683. u = [],
  15684. d = new i.Vector3,
  15685. p = new i.Vector3,
  15686. f = new i.Vector3,
  15687. function(e, t, i, n) {
  15688. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15689. var a = this.closesttags[o];
  15690. p.copy(a.position),
  15691. p.add(a.discPosition),
  15692. d.copy(t),
  15693. d.sub(p).negate(),
  15694. d.normalize();
  15695. var s = d.dot(n);
  15696. if (0 <= s && (f.copy(p),
  15697. f.project(i),
  15698. this.intersecttag(f, !1, i))) {
  15699. if (r >= h.length)
  15700. for (var l = 0; l < 64; l++)
  15701. h.push({
  15702. tag: a,
  15703. dot: s
  15704. });
  15705. var c = h[r];
  15706. c.tag = a,
  15707. c.dot = s,
  15708. c.position = math.projectPositionToCanvas(p, i),
  15709. u.push(c),
  15710. r++
  15711. }
  15712. }
  15713. return u.sort(function(e, t) {
  15714. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15715. }),
  15716. e < u.length ? u[e].tag : null
  15717. }
  15718. ),
  15719. t.prototype.updateClosestTags = (o = new i.Vector3,
  15720. function(e) {
  15721. this.closesttags || (this.closesttags = []),
  15722. this.closesttags.length = 0;
  15723. var t = this.model.tags;
  15724. if (t)
  15725. for (var i in t)
  15726. if (t.hasOwnProperty(i)) {
  15727. var n = t[i]
  15728. , r = n.position;
  15729. o.copy(e),
  15730. o.sub(r).negate(),
  15731. o.lengthSq() < 30 && this.closesttags.push(n)
  15732. }
  15733. }
  15734. ),
  15735. R.exports = t
  15736. }
  15737. ).call(this, "/js/tag/tagManager.js")
  15738. }
  15739. , {
  15740. "../controls/serializer": 14,
  15741. "../enum/BlackoutStyle": 18,
  15742. "../enum/tagEvents": 32,
  15743. "../enum/ModelManagerEvents": 33,
  15744. "../enum/PlayerEvents": 40,
  15745. "../enum/TagStates": 44,
  15746. "../enum/Viewmode": 51,
  15747. "../enum/WarpStyle": 52,
  15748. "../objects/Snapshot": 153,
  15749. "../settings": 166,
  15750. "../util/common": 185,
  15751. "../util/lerp": 188,
  15752. "../util/logger": 189,
  15753. "./Billboard/BillboardEvent": 120,
  15754. "./Media/LinkType": 130,
  15755. "./Media/MediaEvent": 131,
  15756. events: 202,
  15757. three: 217
  15758. }],
  15759. 125: [function(r, o, e) {
  15760. (function(e) {
  15761. "use strict";
  15762. function t() {
  15763. this.embedWrapper = null,
  15764. this.embedElement = null
  15765. }
  15766. var i = r("../../util/ajax")
  15767. , a = r("./mediaSettings")
  15768. , n = r("../../settings")
  15769. , s = new (r("../../util/logger"))(e);
  15770. t.prototype.createDomElement = function() {
  15771. return this.embedWrapper = document.createElement("div"),
  15772. this.embedWrapper.classList.add("tag-embed"),
  15773. this.embedWrapper.classList.add("hidden"),
  15774. this.embedWrapper
  15775. }
  15776. ,
  15777. t.prototype.load = function(e) {
  15778. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15779. return new Promise(function(r, o) {
  15780. i.get(t).then(function(e) {
  15781. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15782. this.embedWrapper.innerHTML = e.html;
  15783. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15784. if (this.embedWrapper.style.width = t + "px",
  15785. e.height) {
  15786. var i = e.height / e.width;
  15787. this.embedWrapper.style.height = t * i + "px"
  15788. }
  15789. this.embedElement = this.embedWrapper.firstChild;
  15790. var n = [];
  15791. try {
  15792. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15793. } catch (e) {
  15794. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15795. }
  15796. n.forEach(function(e) {
  15797. e.setAttribute("target", "_blank")
  15798. }),
  15799. this.embedElement.classList.add("hidden"),
  15800. this.embedWrapper.classList.remove("hidden"),
  15801. r()
  15802. } else
  15803. o("Not a valid embed")
  15804. }
  15805. .bind(this), function(e) {
  15806. o(e.response)
  15807. })
  15808. }
  15809. .bind(this))
  15810. }
  15811. ,
  15812. t.prototype.show = function() {
  15813. this.embedElement && this.embedElement.classList.remove("hidden")
  15814. }
  15815. ,
  15816. t.prototype.hide = function() {
  15817. this.embedElement && this.embedElement.classList.add("hidden")
  15818. }
  15819. ,
  15820. o.exports = t
  15821. }
  15822. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15823. }
  15824. , {
  15825. "../../settings": 166,
  15826. "../../util/ajax": 181,
  15827. "../../util/logger": 189,
  15828. "./mediaSettings": 132
  15829. }],
  15830. 126: [function(a, s, e) {
  15831. (function(e) {
  15832. "use strict";
  15833. function t(e) {
  15834. r.call(this),
  15835. this.options = e,
  15836. this.playerControls = null,
  15837. this.state = o.NOT_READY
  15838. }
  15839. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15840. Object.freeze({
  15841. NOT_READY: "player.not.ready",
  15842. CUED: "player.cued",
  15843. PLAYING: "player.playing",
  15844. PAUSED: "player.paused"
  15845. }));
  15846. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15847. return this.embedWrapper = document.createElement("div"),
  15848. this.embedWrapper.classList.add("tag-video"),
  15849. this.embedWrapper.classList.add("hidden"),
  15850. this.embedWrapper
  15851. }
  15852. ,
  15853. t.prototype.load = function(e) {
  15854. var t = function() {
  15855. function e(e) {
  15856. this.playerState = e
  15857. }
  15858. this.playerControls = new playerjs.Player(this.embedElement),
  15859. this.playerControls.on("ready", function(e) {
  15860. this.playerState = o.CUED,
  15861. this.options.startMuted && this.playerControls.mute()
  15862. }
  15863. .bind(this)),
  15864. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15865. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15866. this.playerControls.on("ended", function(e) {
  15867. this.playerControls.setCurrentTime(0),
  15868. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15869. }
  15870. .bind(this))
  15871. }
  15872. .bind(this);
  15873. return r.prototype.load.call(this, e).then(t.bind(this))
  15874. }
  15875. ,
  15876. t.prototype.play = (i = n.isMobile(),
  15877. function() {
  15878. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15879. }
  15880. ),
  15881. t.prototype.pause = function() {
  15882. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15883. }
  15884. ,
  15885. s.exports = t
  15886. }
  15887. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15888. }
  15889. , {
  15890. "../../util/browser": 182,
  15891. "../../util/logger": 189,
  15892. "./EmbedlyEmbed": 125
  15893. }],
  15894. 127: [function(t, i, e) {
  15895. (function(e) {
  15896. "use strict";
  15897. var r = t("../../util/ajax")
  15898. , o = new (t("./mediaSettings"),
  15899. t("../../util/logger"))(e)
  15900. , a = Promise.resolve();
  15901. i.exports.enqueue = function(i) {
  15902. function n() {}
  15903. return a = new Promise(function(e, t) {
  15904. a.catch(n).then(function() {
  15905. (o.debug("requesting file from embedly:", i.href),
  15906. r.get(i.href, {
  15907. responseType: i.responseType
  15908. }).then(function(e) {
  15909. return o.debug("requesting file finished:", i.href),
  15910. e
  15911. })).then(e, t)
  15912. })
  15913. }
  15914. )
  15915. }
  15916. }
  15917. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15918. }
  15919. , {
  15920. "../../util/ajax": 181,
  15921. "../../util/logger": 189,
  15922. "./mediaSettings": 132
  15923. }],
  15924. 128: [function(s, l, e) {
  15925. (function(e) {
  15926. "use strict";
  15927. function t() {
  15928. this.imageWrapper = null,
  15929. this.width = 0,
  15930. this.height = 0,
  15931. this.aspect = 1
  15932. }
  15933. var i = s("./MediaEvent")
  15934. , n = s("./EmbedlyQueue")
  15935. , r = s("events").EventEmitter
  15936. , o = s("../../util/logger")
  15937. , a = s("../../settings");
  15938. new o(e),
  15939. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15940. return this.imageWrapper = document.createElement("div"),
  15941. this.imageWrapper.classList.add("tag-image"),
  15942. this.imageWrapper.classList.add("hidden"),
  15943. this.imageWrapper.addEventListener("click", function(e) {
  15944. e.stopPropagation(),
  15945. this.emit(i.IMAGE_OPENING),
  15946. this.imageWrapper.style.pointerEvents = "none"
  15947. }
  15948. .bind(this)),
  15949. this.imageWrapper
  15950. }
  15951. ,
  15952. t.prototype.onClosed = function() {
  15953. this.imageWrapper.style.pointerEvents = "auto"
  15954. }
  15955. ,
  15956. t.prototype.load = function(e) {
  15957. var t = Math.max(window.screen.height, window.screen.width)
  15958. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15959. return new Promise(function(o, e) {
  15960. n.enqueue({
  15961. href: i,
  15962. responseType: "arraybuffer"
  15963. }).then(function(e) {
  15964. var t = new Uint8Array(e)
  15965. , i = new Blob([t])
  15966. , n = new window.Image;
  15967. n.addEventListener("load", function(e) {
  15968. var t = e.target;
  15969. this.width = t.naturalWidth,
  15970. this.height = t.naturalHeight,
  15971. this.aspect = this.width / this.height;
  15972. var i = e.target.src;
  15973. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15974. this.imageWrapper.style.width = this.width + "px",
  15975. this.imageWrapper.style.height = this.height + "px",
  15976. this.imageWrapper.classList.remove("hidden"),
  15977. o()
  15978. }
  15979. .bind(this));
  15980. var r = URL.createObjectURL(i);
  15981. n.src = r
  15982. }
  15983. .bind(this), e)
  15984. }
  15985. .bind(this))
  15986. }
  15987. ,
  15988. l.exports = t
  15989. }
  15990. ).call(this, "/js/tag/Media/Image.js")
  15991. }
  15992. , {
  15993. "../../settings": 166,
  15994. "../../util/logger": 189,
  15995. "./EmbedlyQueue": 127,
  15996. "./MediaEvent": 131,
  15997. events: 202
  15998. }],
  15999. 129: [function(e, t, i) {
  16000. "use strict";
  16001. function n(e) {
  16002. this.label = e.label,
  16003. this.href = e.url,
  16004. this.type = this.updateLinkForType(),
  16005. this.domElement = null,
  16006. this.id = c++
  16007. }
  16008. var r = e("./LinkType")
  16009. , o = e("./MediaEvent")
  16010. , a = e("../../util/browser")
  16011. , s = e("../../analytics")
  16012. , l = e("events").EventEmitter
  16013. , c = 0;
  16014. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16015. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16016. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  16017. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16018. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16019. r.MODEL) : r.EXT_LINK
  16020. }
  16021. ;
  16022. var h = {};
  16023. n.prototype.createDomElement = function() {
  16024. if (this.domElement = document.createElement("a"),
  16025. this.domElement.classList.add("tag-link"),
  16026. this.domElement.textContent = this.label,
  16027. this.type === r.EXT_LINK) {
  16028. this.domElement.textContent += " ";
  16029. var e = document.createElement("i");
  16030. e.classList.add("icon-ext-link"),
  16031. e.title = "Link to external web site",
  16032. this.domElement.appendChild(e)
  16033. }
  16034. return this.domElement.addEventListener("click", function(e) {
  16035. switch (e.stopPropagation(),
  16036. h[this.id] = !0,
  16037. s.trackAlways("click_tag_link", {
  16038. link_type: this.type,
  16039. link_count: c,
  16040. links_clicked: Object.keys(h).length
  16041. }),
  16042. this.type) {
  16043. case r.MODEL:
  16044. window.location.replace(this.href);
  16045. break;
  16046. case r.EXT_LINK:
  16047. window.open(this.href, "_blank")
  16048. }
  16049. this.emit(o.LINK_CLICK, {
  16050. type: this.type,
  16051. url: this.href
  16052. })
  16053. }
  16054. .bind(this)),
  16055. this.domElement
  16056. }
  16057. ,
  16058. t.exports = n
  16059. }
  16060. , {
  16061. "../../analytics": 4,
  16062. "../../util/browser": 182,
  16063. "./LinkType": 130,
  16064. "./MediaEvent": 131,
  16065. events: 202
  16066. }],
  16067. 130: [function(e, t, i) {
  16068. "use strict";
  16069. t.exports = {
  16070. NAVIGATION: "navigation",
  16071. MODEL: "model",
  16072. EXT_LINK: "ext-link"
  16073. }
  16074. }
  16075. , {}],
  16076. 131: [function(e, t, i) {
  16077. "use strict";
  16078. t.exports = Object.freeze({
  16079. LINK_CLICK: "mtmedia.link",
  16080. IMAGE_LOADED: "mtmedia.image.loaded",
  16081. IMAGE_OPENING: "mtmedia.image.opening",
  16082. IMAGE_OPENED: "mtmedia.image.opened",
  16083. IMAGE_CLOSING: "mtmedia.image.closing",
  16084. IMAGE_CLOSED: "mtmedia.image.closed",
  16085. VIDEO_START: "mtmedia.video.start",
  16086. VIDEO_PAUSE: "mtmedia.video.pause",
  16087. VIDEO_ENDED: "mtmedia.video.end"
  16088. })
  16089. }
  16090. , {}],
  16091. 132: [function(e, t, i) {
  16092. "use strict";
  16093. t.exports = Object.freeze({
  16094. maxEmbedWidth: 350,
  16095. defaultAspectRatio: .75
  16096. })
  16097. }
  16098. , {}],
  16099. 133: [function(e, t, i) {
  16100. "use strict";
  16101. t.exports = Object.freeze({
  16102. TEXT: "text",
  16103. LINK: "link",
  16104. IMAGE: "photo",
  16105. VIDEO: "video",
  16106. RICH: "rich"
  16107. })
  16108. }
  16109. , {}],
  16110. 134: [function(e, t, i) {
  16111. "use strict";
  16112. function n(e) {
  16113. this.capabilities = {
  16114. links: {
  16115. enable: e.supportLinks,
  16116. keepLabels: e.keepLinkLabels
  16117. }
  16118. }
  16119. }
  16120. var r = e("./DescriptionChunkType");
  16121. n.prototype.parse = function(e, i) {
  16122. var n = [];
  16123. return e.split("[").map(function(e, t) {
  16124. return 0 === t ? e : "[" + e
  16125. }).forEach(function(e) {
  16126. var t = this.findMarkdown(e);
  16127. if (t) {
  16128. if (-1 !== t.url.indexOf("javascript:"))
  16129. return;
  16130. this.addLinkChunk(n, t, i),
  16131. this.addTextChunk(n, e.slice(t.markdown.length))
  16132. } else
  16133. this.addTextChunk(n, e)
  16134. }
  16135. .bind(this)),
  16136. n
  16137. }
  16138. ,
  16139. n.prototype.findMarkdown = function(e) {
  16140. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16141. if (t) {
  16142. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16143. 0 !== n); )
  16144. r++;
  16145. var o = i.length - r;
  16146. return {
  16147. markdown: t[0].substring(0, t[0].length - o),
  16148. label: t[1],
  16149. url: t[2].substring(0, r)
  16150. }
  16151. }
  16152. }
  16153. ,
  16154. n.prototype.addTextChunk = function(e, t) {
  16155. 0 !== t.length && e.push({
  16156. type: r.TEXT,
  16157. text: t
  16158. })
  16159. }
  16160. ,
  16161. n.prototype.addLinkChunk = function(e, t) {
  16162. if (this.capabilities.links.enable) {
  16163. var i = {
  16164. label: t.label,
  16165. url: t.url
  16166. };
  16167. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16168. e.push({
  16169. type: r.LINK,
  16170. link: i
  16171. })
  16172. } else
  16173. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16174. }
  16175. ,
  16176. t.exports = n
  16177. }
  16178. , {
  16179. "./DescriptionChunkType": 133
  16180. }],
  16181. 135: [function(t, r, e) {
  16182. (function(e) {
  16183. "use strict";
  16184. var i = new (t("../util/logger"))(e)
  16185. , n = {
  16186. parseIdsFromChunkName: function(e, t) {
  16187. t.floorId = n.parseFloor(e),
  16188. t.roomId = n.parseRoom(e)
  16189. },
  16190. parseFloor: function(e) {
  16191. var t = e.match(/_group([0-9]+)/);
  16192. if (!t)
  16193. return 0;
  16194. try {
  16195. return parseInt(t[1], 10)
  16196. } catch (e) {
  16197. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16198. 0
  16199. }
  16200. },
  16201. parseRoom: function(e) {
  16202. var t = e.match(/_sub([0-9]+)/);
  16203. if (!t)
  16204. return -1;
  16205. try {
  16206. return parseInt(t[1], 10)
  16207. } catch (e) {
  16208. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16209. 0
  16210. }
  16211. }
  16212. };
  16213. r.exports = n
  16214. }
  16215. ).call(this, "/js/model/Chunks.js")
  16216. }
  16217. , {
  16218. "../util/logger": 189
  16219. }],
  16220. 136: [function(a, c, e) {
  16221. (function(e) {
  16222. "use strict";
  16223. function t(e) {
  16224. r.call(this),
  16225. this.model = e,
  16226. this.exploded = !1
  16227. }
  16228. var i = a("../objects/Floor")
  16229. , n = (a("../settings"),
  16230. a("../util/logger"))
  16231. , s = a("../util/transitions")
  16232. , r = a("../util/IndexedCollection")
  16233. , o = a("../util/common")
  16234. , l = a("../util/easing");
  16235. new n(e),
  16236. o.inherit(t, r),
  16237. t.prototype.add = function(e) {
  16238. r.prototype.add.call(this, e),
  16239. this.model.add(e)
  16240. }
  16241. ,
  16242. t.prototype.getIndex = function(e) {
  16243. return e.floorIndex
  16244. }
  16245. ,
  16246. t.prototype.build = function() {
  16247. this.list.forEach(function(e) {
  16248. e.build()
  16249. })
  16250. }
  16251. ,
  16252. t.prototype.size = function() {
  16253. return this.length
  16254. }
  16255. ,
  16256. t.prototype.sort = function() {
  16257. r.prototype.sort.call(this, function(e, t) {
  16258. return e.floorIndex - t.floorIndex
  16259. })
  16260. }
  16261. ,
  16262. t.prototype.nextFloor = function(e, t) {
  16263. return this.index[e.floorIndex + t] || null
  16264. }
  16265. ,
  16266. t.prototype.getFloorAtPoint = function(e) {
  16267. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16268. var r = this.list[n]
  16269. , o = r.distanceToPoint(e);
  16270. (!t || o < i) && (i = o,
  16271. t = r)
  16272. }
  16273. return t
  16274. }
  16275. ,
  16276. t.prototype.getOrMakeFloor = function(e) {
  16277. var t = this.index[e];
  16278. return t || (t = new i(this.model,e),
  16279. this.add(t)),
  16280. t
  16281. }
  16282. ,
  16283. t.prototype.hide = function() {
  16284. this.list.forEach(function(e) {
  16285. e.hide()
  16286. })
  16287. }
  16288. ,
  16289. t.prototype.show = function() {
  16290. this.list.forEach(function(e) {
  16291. e.show()
  16292. })
  16293. }
  16294. ,
  16295. t.prototype.names = function() {
  16296. return this.list.reduce(function(e, t) {
  16297. return e.concat(t.name)
  16298. }, [])
  16299. }
  16300. ,
  16301. t.prototype.toggleExplodeHorizontal = function() {
  16302. function i(e, t) {
  16303. a.copy(e.position),
  16304. e.position.x = r[e.floorIndex] * t,
  16305. e.position.y = 1 * e.floorIndex * t,
  16306. a.sub(e.position).multiplyScalar(-1),
  16307. e.panos.forEach(function(e) {
  16308. e.translate(a)
  16309. })
  16310. }
  16311. var n, r = [], o = 0;
  16312. this.list.forEach(function(e, t, i) {
  16313. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16314. o += n,
  16315. r[t] = o
  16316. }),
  16317. r = r.map(function(e) {
  16318. return e - o / 2
  16319. });
  16320. var a = this.list[0].position.clone();
  16321. this.exploded ? this.list.forEach(function(t) {
  16322. s.start(function(e) {
  16323. i(t, 1 - e)
  16324. }, 1500, null, 0, l.easeOutExpo)
  16325. }) : this.list.forEach(function(t) {
  16326. s.start(function(e) {
  16327. i(t, e)
  16328. }, 1500, null, 0, l.easeOutExpo)
  16329. }),
  16330. this.exploded = !this.exploded
  16331. }
  16332. ,
  16333. t.prototype.toggleExplodeVertical = function() {
  16334. function i(e, t) {
  16335. var i = i.copy(e.position);
  16336. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16337. i.sub(e.position).multiplyScalar(-1),
  16338. e.panos.forEach(function(e) {
  16339. e.translate(i)
  16340. })
  16341. }
  16342. var n = this.model.size;
  16343. this.list[0].position.clone(),
  16344. this.exploded ? this.list.forEach(function(t) {
  16345. s.start(function(e) {
  16346. i(t, 1 - e)
  16347. }, 1500, null, 0, l.easeOutExpo)
  16348. }) : this.list.forEach(function(t) {
  16349. s.start(function(e) {
  16350. i(t, e)
  16351. }, 1500, null, 0, l.easeOutExpo)
  16352. }),
  16353. this.exploded = !this.exploded
  16354. }
  16355. ,
  16356. c.exports = t
  16357. }
  16358. ).call(this, "/js/model/FloorCollection.js")
  16359. }
  16360. , {
  16361. "../objects/Floor": 146,
  16362. "../settings": 166,
  16363. "../util/IndexedCollection": 175,
  16364. "../util/common": 185,
  16365. "../util/easing": 186,
  16366. "../util/logger": 189,
  16367. "../util/transitions": 195
  16368. }],
  16369. 137: [function(r, o, e) {
  16370. (function(e) {
  16371. "use strict";
  16372. function h() {
  16373. n.call(this)
  16374. }
  16375. var u = r("../settings")
  16376. , t = r("../util/logger")
  16377. , d = r("../enum/Viewmode")
  16378. , p = r("../objects/Snapshot")
  16379. , i = (r("../util/math"),
  16380. r("../util/common"))
  16381. , n = r("../util/IndexedCollection")
  16382. , l = new t(e);
  16383. i.inherit(h, n),
  16384. h.prototype.getImage = function(e) {
  16385. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16386. }
  16387. ,
  16388. h.prototype.filterByModesAndReel = function(e, t) {
  16389. for (var i = [], n = 0; n < t.length; n += 1) {
  16390. var r = t[n]
  16391. , o = this.index[r.sid];
  16392. o && i.push(o)
  16393. }
  16394. var a = e[d.DOLLHOUSE]
  16395. , s = e[d.FLOORPLAN];
  16396. (i = i.filter(function(e) {
  16397. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16398. return !0;
  16399. var t;
  16400. try {
  16401. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16402. } catch (e) {
  16403. return l.debug(e.message),
  16404. !1
  16405. }
  16406. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16407. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16408. this.list = i,
  16409. this.reIndex()
  16410. }
  16411. ,
  16412. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16413. if (0 === this.list.length)
  16414. return [];
  16415. var locations = [];
  16416. var deal = (n, container)=>{
  16417. var r = n.thumbnail_signed_src,
  16418. o = n.name || "";
  16419. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16420. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16421. var a = panos.get(n.metadata.scan_id);
  16422. if (a && !a.isAligned()) return
  16423. }
  16424. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16425. if (s === d.MESH) return
  16426. if(window.isLocal)var src = manage.dealURL(r)
  16427. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16428. var l = {
  16429. cameraMode: s,
  16430. position: n.metadata.camera_position,
  16431. quaternion: n.metadata.camera_quaternion,
  16432. zoom: n.metadata.zoom,
  16433. panoId: n.metadata.scan_id,
  16434. orthoZoom: n.metadata.ortho_zoom,
  16435. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16436. thumbUrl: src,
  16437. name: h.filterImageName(o),
  16438. sid: n.sid
  16439. }
  16440. var item = new p(l);
  16441. item.momentTour = n.momentTour
  16442. item.dontRot = n.dontRot
  16443. item.rotTime = n.rotTime
  16444. container.push(item)
  16445. return item
  16446. }
  16447. }
  16448. this.list.forEach(image=>{
  16449. if(image.images){
  16450. var folder = $.extend({}, image )
  16451. folder.heroLocations = [];
  16452. image.images.list.forEach(child=>{
  16453. deal(child, folder.heroLocations);
  16454. })
  16455. folder.musicInfo = folder.musicInfo || {}
  16456. locations.push(folder)
  16457. delete folder.images;
  16458. delete folder.locations;
  16459. }else{
  16460. var item = deal(image, locations);
  16461. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16462. }
  16463. })
  16464. return locations
  16465. }
  16466. ,
  16467. h.prototype.getIndex = function(e) {
  16468. return e.sid
  16469. }
  16470. ,
  16471. h.filterImageName = function(e) {
  16472. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16473. }
  16474. ,
  16475. o.exports = h
  16476. }
  16477. ).call(this, "/js/model/ImageCollection.js")
  16478. }
  16479. , {
  16480. "../enum/Viewmode": 51,
  16481. "../objects/Snapshot": 153,
  16482. "../settings": 166,
  16483. "../util/IndexedCollection": 175,
  16484. "../util/common": 185,
  16485. "../util/logger": 189,
  16486. "../util/math": 190
  16487. }],
  16488. 138: [function(h, u, e) {
  16489. (function(e) {
  16490. "use strict";
  16491. function n() {
  16492. c.call(this)
  16493. }
  16494. var r = h("../label/Label")
  16495. , i = h("../settings")
  16496. , t = h("../util/logger")
  16497. , o = h("../util/math")
  16498. , a = h("../util/ajax")
  16499. , s = h("./RoomCollection")
  16500. , l = h("../util/common")
  16501. , c = h("../util/IndexedCollection");
  16502. new t(e),
  16503. l.inherit(n, c),
  16504. n.prototype.getIndex = function(e) {
  16505. return e.labelId
  16506. }
  16507. ,
  16508. n.prototype.associateWithRooms = function(e) {
  16509. this.forEach(function(t) {
  16510. e.forEach(function(e) {
  16511. e.roomId === t.roomId && (t.room = e)
  16512. })
  16513. })
  16514. }
  16515. ,
  16516. n.prototype.createFromLabelData = function(e) {
  16517. e.forEach(function(e) {
  16518. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16519. t = s.generateRoomId(e.floorId, t);
  16520. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16521. i.position = o.convertWorkshopVector(i.position),
  16522. this.add(i),
  16523. i.build()
  16524. }
  16525. .bind(this))
  16526. }
  16527. ,
  16528. n.prototype.load = function(e, t) {
  16529. return a.get(e, {
  16530. responseType: "json",
  16531. auth: t ? i.authorizationHeader : null
  16532. }).done(function(e) {
  16533. var t = [];
  16534. for (var i in e) {
  16535. var n = e[i];
  16536. t.push(n)
  16537. }
  16538. this.createFromLabelData(t)
  16539. }
  16540. .bind(this))
  16541. }
  16542. ,
  16543. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16544. var t = -1;
  16545. if (e) {
  16546. if(typeof e == 'number'){
  16547. t = parseInt(e)
  16548. }else{
  16549. var i = e.split("_");
  16550. t = parseInt(i[0])
  16551. }
  16552. }
  16553. return t
  16554. }
  16555. ,
  16556. u.exports = n
  16557. }
  16558. ).call(this, "/js/model/LabelCollection.js")
  16559. }
  16560. , {
  16561. "../label/Label": 90,
  16562. "../settings": 166,
  16563. "../util/IndexedCollection": 175,
  16564. "../util/ajax": 181,
  16565. "../util/common": 185,
  16566. "../util/logger": 189,
  16567. "../util/math": 190,
  16568. "./RoomCollection": 141
  16569. }],
  16570. 139: [function(P, O, e) {
  16571. (function(e) {
  16572. "use strict";
  16573. function t(e, t) {
  16574. o.Object3D.call(this),
  16575. this.sid = window.number;//t.sid,
  16576. this.data = t,
  16577. this.options = e,
  16578. this.urls = new i(e.urlFiles),
  16579. this.isPublic = void 0 !== t.is_public && t.is_public,
  16580. //创建heroLocations
  16581. this.images = new E(this),
  16582. this.images.extend(t.images),
  16583. this.images.forEach((info)=>{
  16584. if(info.locations){
  16585. info.images = new E(this);
  16586. info.images.extend(info.locations)
  16587. }
  16588. })
  16589. this.heroLocations = []
  16590. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16591. this.outdoorPanoLocations = [],
  16592. this.floors = new c(this),
  16593. this.floorsEnabled = void 0 === e.floors || e.floors,
  16594. this.changingFloor = !1,
  16595. this.chunks = [],
  16596. this.panos = new g,
  16597. this.colliders = [],
  16598. this.loadPanosPromise = null,
  16599. this.loadMeshTexturesPromise = null,
  16600. this.auxDataPromise = null,
  16601. this.meshTexturesLoaded = !1,
  16602. this.meshTextures = [],
  16603. this.tags = {},
  16604. this.tagsShown = !1,
  16605. this.shouldShowtags = !1,
  16606. this.has360Views = !1,
  16607. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16608. this.supportedModes = {},
  16609. this.supportedModes[s.PANORAMA] = !0,
  16610. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16611. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16612. this.supportedModes[s.TRANSITIONING] = !0,
  16613. this.supportsTiles = this.configureTiling(),
  16614. this.supportsVR = window.DATA.supportsVR || false//!0,
  16615. this.mode = s.DOLLHOUSE,
  16616. this.size = null,
  16617. this.center = null,
  16618. this.boundingBox = new o.Box3,
  16619. this.currentFloor = null,
  16620. this.allFloorsVisible = !0,
  16621. this.projectedPano0 = null,
  16622. this.projectedPano1 = null,
  16623. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16624. this.addFloor(new r(this,t,e.trim()))
  16625. }
  16626. .bind(this)),
  16627. this.waitQueue = [],
  16628. this.on("load", function(e) {
  16629. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16630. return !e.isLoadedCallback()
  16631. }),
  16632. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16633. }
  16634. .bind(this)),
  16635. this.setupCustomProperties(),
  16636. this.hots = {}
  16637. }
  16638. var o = P("three")
  16639. , a = P("../util/ajax")
  16640. , i = P("../util/ModelUrls")
  16641. , n = P("../objects/BoundingTextureSkybox")
  16642. , s = P("../enum/Viewmode")
  16643. , l = P("../enum/RenderOrder")
  16644. , r = (P("../enum/AlignmentType"),
  16645. P("../objects/Floor"))
  16646. , c = P("./FloorCollection")
  16647. , h = P("../objects/Chunk")
  16648. , u = (P("../objects/Room"),
  16649. P("../objects/Snapshot"),
  16650. P("../label/Label"),
  16651. P("../util/math"),
  16652. P("../settings"))
  16653. , d = P("../shaders")
  16654. , p = P("../util/logger")
  16655. , f = (P("../tag/tag"),
  16656. P("../tag/tagManager"),
  16657. P("../objects/Panorama"))
  16658. , g = P("../util/PanoramaCollection")
  16659. , m = P("../loaders/ModelLoader")
  16660. , v = P("../loaders/ModelTextureLoader")
  16661. , y = P("../loaders/SweepDataLoader")
  16662. , A = P("../util/transitions")
  16663. , C = (P("../util/easing"),
  16664. P("../util/lerp"),
  16665. P("../util/common"))
  16666. , I = (P("../util/texture"),
  16667. P("./../util/browser"))
  16668. , E = P("./ImageCollection")
  16669. , _ = P("./RoomCollection")
  16670. , b = P("./LabelCollection")
  16671. , w = P("./Chunks")
  16672. , T = P("./../util/showcase")
  16673. , x = P("../exception/BasicException")
  16674. , S = (P("../constants"),
  16675. P("events").EventEmitter)
  16676. // , M = P("hot")
  16677. , R = new p(e);
  16678. t.prototype = Object.create(o.Object3D.prototype),
  16679. C.extend(t, S),
  16680. t.prototype.setupCustomProperties = function() {
  16681. var t = u.modelAlpha;
  16682. Object.defineProperty(this, "alpha", {
  16683. get: function() {
  16684. return t
  16685. },
  16686. set: function(e) {
  16687. t = e,
  16688. this.chunks.forEach(function(e) {
  16689. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16690. })
  16691. }
  16692. })
  16693. }
  16694. ,
  16695. t.prototype.configureTiling = function() {
  16696. var e = function() {
  16697. try {
  16698. var e = document.createElement("canvas")
  16699. , t = e.getContext("webgl");
  16700. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16701. } catch (e) {
  16702. return 0
  16703. }
  16704. }();
  16705. if (e < 2048)
  16706. return !1;
  16707. R.warn("Max cube texture size: " + e);
  16708. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16709. var i = u.tiling.tilingFlagNames[t];
  16710. if ("1" === I.valueFromHash(i, null))
  16711. return !0;
  16712. if ("0" === I.valueFromHash(i, null))
  16713. return !1
  16714. }
  16715. return !!T.modelDataPromisesTiles(this.data)
  16716. }
  16717. ,
  16718. t.prototype.toggleAlpha = function() {
  16719. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16720. }
  16721. ,
  16722. t.prototype.load = function(e) {
  16723. var t = this.urls.init().then(function() {
  16724. return $.when(this.loadPanos(), this.loadMesh())
  16725. }
  16726. .bind(this));
  16727. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16728. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16729. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16730. }
  16731. ,
  16732. t.prototype.loadMesh = function() {
  16733. var n = $.Deferred()
  16734. , r = this;
  16735. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16736. if (0 === e.length) {
  16737. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16738. r.supportedModes[s.DOLLHOUSE] = !1,
  16739. r.supportedModes[s.FLOORPLAN] = !1;
  16740. var i = new h({
  16741. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16742. });
  16743. i.material.visible = !1,
  16744. i.rotateX(-Math.PI / 2),
  16745. i.geometry.computeBoundingBox(),
  16746. e = [i]
  16747. }
  16748. e.forEach(function(e) {
  16749. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16750. r.addChunk(t, e)
  16751. }),
  16752. r.floors.sort(),
  16753. n.resolve(r)
  16754. }, function(e, t) {
  16755. n.notify(e, t)
  16756. }, function(e) {
  16757. R.error(e),
  16758. n.reject("loading-failed")
  16759. }),
  16760. n.promise()
  16761. }
  16762. ,
  16763. t.prototype.loadMeshTextures = function() {
  16764. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16765. this.meshTexturesLoaded = !0
  16766. }
  16767. .bind(this))),
  16768. this.loadTexturesPromise
  16769. }
  16770. /* t.prototype.shineHots = function() {
  16771. A.trigger({
  16772. func: function(e) {
  16773. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16774. for(var i in this.hots){
  16775. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16776. }
  16777. }
  16778. .bind(this),
  16779. cycling: !0,
  16780. duration: 3e3,
  16781. name: "hotShine"
  16782. })
  16783. } */
  16784. ,
  16785. /* t.prototype.createHotItem = function(e, t) {
  16786. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16787. var o = document.createElement("li")
  16788. , a = document.createElement("span");
  16789. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute && e[n[r]].infoAttribute.title || "热点",
  16790. o.hot = t[n[r]],
  16791. o.appendChild(a),
  16792. i.appendChild(o)
  16793. }
  16794. document.querySelector("#hotListContent ul").appendChild(i),
  16795. console.log(i)
  16796. } */
  16797. t.prototype.createHotItem = function() {
  16798. var docFragment = document.createDocumentFragment();
  16799. this.hotGroup.children.forEach(hot=>{
  16800. if(hot.info.actionType.openHot){
  16801. var li = document.createElement('li');
  16802. var span = document.createElement('span');
  16803. span.innerHTML = hot.info.title || '热点';
  16804. // console.log(span.innerHTML);
  16805. li.hot = hot; // 列表每一项对应一个热点
  16806. li.appendChild(span);
  16807. docFragment.appendChild(li);
  16808. }
  16809. })
  16810. var ul = document.querySelector('#hotListContent ul');
  16811. ul.appendChild(docFragment);
  16812. }
  16813. ,
  16814. /* t.prototype.loadOverlays = function(overlays){
  16815. var overlays = window.data2 && window.data2.overlays
  16816. overlays && overlays.forEach((info)=>{
  16817. new Overlay(info)
  16818. })
  16819. Overlay.load()
  16820. }
  16821. */
  16822. t.prototype.loadhots = function() {
  16823. initHot(this)
  16824. var r = $.Deferred()
  16825. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16826. return a.get(e, {
  16827. responseType: "json",
  16828. auth: this.isPublic ? null : u.authorizationHeader
  16829. }).done(function(e) {
  16830. window.data2 = e;
  16831. editTool.loadDone('data2', e)
  16832. if(!e){
  16833. console.error("data2 is null")
  16834. }else{
  16835. g_data2 = hotMatcher(e)
  16836. this.hotsCount = 0;
  16837. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16838. //window.hotData = {}
  16839. /* if(e.hots){
  16840. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16841. sids.forEach((sid)=>{
  16842. this.hotsCount++,
  16843. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16844. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16845. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16846. window.hotData[sid] = e.hots[sid];
  16847. })
  16848. }*/
  16849. if(e.hots){
  16850. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16851. sids.forEach((sid)=>{
  16852. e.hots[sid].sid = sid
  16853. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16854. })
  16855. }
  16856. if(e.overlays){
  16857. e.overlays.forEach((info)=>{
  16858. new Hot(info, 'byOverlay')
  16859. })
  16860. }
  16861. this.createHotItem();
  16862. /* if(e.multiOverlays){
  16863. e.multiOverlays.forEach((info)=>{
  16864. new Hot(info)
  16865. })
  16866. }) */
  16867. Hot.startLoad()
  16868. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16869. }
  16870. r.resolve()
  16871. }
  16872. .bind(this)).fail(function() {
  16873. console.log("没有热点"),
  16874. editTool.loadDone('data2', null)
  16875. r.resolve()
  16876. }),
  16877. r
  16878. }
  16879. ,
  16880. t.prototype.loadPanos = function() {
  16881. if (this.loadPanosPromise)
  16882. return this.loadPanosPromise;
  16883. var e = new y(this);
  16884. return this.loadPanosPromise = e.load().then(function(e) {
  16885. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16886. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16887. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16888. else console.log(e.uuid)
  16889. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16890. }
  16891. .bind(this))),
  16892. this.panos.extend(e.map(function(e) {
  16893. return new f(this,e.uuid,e,this.supportsTiles)
  16894. }
  16895. .bind(this))),
  16896. this.panos.forEach(function(i) {
  16897. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16898. var t = this.panos.get(e);
  16899. t && this.panos.setNeighbour(i, t, !0)
  16900. }
  16901. .bind(this)),
  16902. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16903. }
  16904. .bind(this)),
  16905. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16906. this.supportedModes[s.PANORAMA] = !1),
  16907. $.when(this)
  16908. }
  16909. .bind(this)),
  16910. this.loadPanosPromise
  16911. }
  16912. ,
  16913. t.prototype.loadHighlightReel = function() {
  16914. var t = $.Deferred()
  16915. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16916. return a.get(e, {
  16917. responseType: "json",
  16918. auth: this.isPublic ? null : u.authorizationHeader
  16919. }).done(function(e) {
  16920. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16921. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16922. t.resolve()
  16923. }
  16924. .bind(this)).fail(function() {
  16925. R.warn("Getting highlight reel failed, no highlights available"),
  16926. t.resolve()
  16927. }),
  16928. t
  16929. }
  16930. ,
  16931. t.prototype.waitForLoad = function(e, t) {
  16932. t() || (this.waitQueue.push({
  16933. object: e,
  16934. isLoadedCallback: t
  16935. }),
  16936. 1 === this.waitQueue.length && this.emit("waiting"))
  16937. }
  16938. ,
  16939. t.prototype.hide = function() {
  16940. this.floors.hide()
  16941. }
  16942. ,
  16943. t.prototype.show = function() {
  16944. this.floors.show()
  16945. }
  16946. ,
  16947. t.prototype.floorNames = function() {
  16948. return this.floors.names()
  16949. }
  16950. ,
  16951. t.prototype.warpDestFloors = function(e, t) {
  16952. if (e && this.floors.length === e.length) {
  16953. var i = e.findIndex(function(e) {
  16954. return e
  16955. }
  16956. .bind(this));
  16957. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16958. } else
  16959. this.toggleAllFloors(!0)
  16960. }
  16961. ,
  16962. t.prototype.setFloor = function(e, t, i) {
  16963. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16964. this.allFloorsVisible = !1,
  16965. this._setFloor(e, t, i)
  16966. }
  16967. ,
  16968. t.prototype.toggleAllFloors = function(e) {
  16969. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16970. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16971. this._setFloor(this.currentFloor)
  16972. }
  16973. ,
  16974. t.prototype._setFloor = function(e, t, i) {
  16975. var n;
  16976. if (t = t || this.mode,
  16977. this.emit("floor.changed", e, t, this.currentFloor),
  16978. this.currentFloor = e,
  16979. t === s.PANORAMA) {
  16980. if (this.show(),
  16981. this.shouldShowtags && this.tagsShown)
  16982. for (n in this.tags)
  16983. this.tags[n].show(u.showFloorDuration)
  16984. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16985. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16986. }
  16987. .bind(this)),
  16988. this.shouldShowtags && this.tagsShown))
  16989. for (n in this.tags) {
  16990. var r = this.tags[n];
  16991. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16992. }
  16993. var o = this
  16994. , a = e;
  16995. A.start(function() {}, u.showFloorDelay, function() {
  16996. o.floors.forEach(function(t) {
  16997. t.chunks.forEach(function(e) {
  16998. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16999. })
  17000. })
  17001. }
  17002. .bind(this))
  17003. }
  17004. ,
  17005. t.prototype.toggleExplode = function() {
  17006. this.floors.toggleExplodeHorizontal()
  17007. }
  17008. ,
  17009. t.prototype.toggleExplodeUp = function() {
  17010. this.floors.toggleExplodeVertical()
  17011. }
  17012. ,
  17013. t.prototype.nextFloor = function(e) {
  17014. return this.floors.nextFloor(this.currentFloor, e)
  17015. }
  17016. ,
  17017. t.prototype.addFloor = function(e) {
  17018. this.floors.add(e)
  17019. }
  17020. ,
  17021. t.prototype.getFloorAtPoint = function(e) {
  17022. return this.floors.getFloorAtPoint(e)
  17023. }
  17024. ,
  17025. t.prototype.getTagBySid = function(e) {
  17026. return this.tags[e]
  17027. }
  17028. ,
  17029. t.prototype.addChunk = function(e, t) {
  17030. this.floors.getOrMakeFloor(e).addChunk(t),
  17031. this.chunks.push(t)
  17032. }
  17033. ,
  17034. t.prototype.setMode = function(t) {
  17035. if (!this.supportedModes[t])
  17036. throw new x("Mode not supported for this model: " + t);
  17037. this.mode = t
  17038. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17039. this.chunks.forEach(function(e) {
  17040. e.setMode(t)
  17041. })
  17042. }
  17043. ,
  17044. t.prototype.build = function() {
  17045. this.heroLocations = this.images.getHeroLocations(this.panos);
  17046. var e = function() {
  17047. 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()
  17048. }
  17049. .bind(this)();
  17050. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17051. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17052. }
  17053. .bind(this)) || e,
  17054. null === this.heroImage && R.warn("No hero image defined."),
  17055. this.currentFloor = this.floors.last(),
  17056. this.floors.build(),
  17057. this.colliders = this.floors.reduce(function(e, t) {
  17058. return e.concat(t.collider.children)
  17059. }, []),
  17060. this.panos.forEach(function(e) {
  17061. e.build1(),
  17062. e.on("enter", function() {
  17063. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17064. }
  17065. .bind(this))
  17066. }
  17067. .bind(this)),
  17068. this.panos.forEach(function(e) {
  17069. e.build2()
  17070. }),
  17071. this.floors.forEach(function(e) {
  17072. this.boundingBox.union(e.boundingBox)
  17073. }
  17074. .bind(this)),
  17075. this.size = this.boundingBox.size(),
  17076. this.center = this.boundingBox.center(),
  17077. this.floors.forEach(function(e) {
  17078. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17079. }
  17080. .bind(this)),
  17081. this.panos.populate_path_graph(),
  17082. this.skybox = new n(this.boundingBox),
  17083. this.skybox.matrixWorldNeedsUpdate = !0,
  17084. this.add(this.skybox),
  17085. setTimeout(function() {
  17086. //this.hotsCount && this.shineHots()
  17087. Hot.beginShineHot()
  17088. }
  17089. .bind(this), 1300),
  17090. this.tags)
  17091. this.tags[t].build();
  17092. //add-----
  17093. console.log('计算visiblePanos开始,可能需要一段时间')
  17094. for(let i in this.hots){
  17095. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  17096. }
  17097. console.log('计算visiblePanos完毕')
  17098. //---------
  17099. return R.debug("Done building model"),
  17100. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17101. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17102. this.buildRooms(),
  17103. this.labels.associateWithRooms(this.rooms),
  17104. $.when(this)
  17105. }
  17106. ,
  17107. t.prototype.loadLabels = function() {
  17108. this.labels = new b(this);
  17109. var e = $.Deferred();
  17110. window.DATA.showingLabels ? this.showingLabels = true : '';
  17111. if (!this.showingLabels)
  17112. return e.resolve();
  17113. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17114. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17115. R.warn("Getting labels failed, not displaying labels."),
  17116. e.resolve()
  17117. }),
  17118. e
  17119. }
  17120. ,
  17121. t.prototype.buildRooms = function() {
  17122. this.rooms = new _(this),
  17123. this.rooms.createFromChunks(this.chunks),
  17124. this.rooms.calcRoomBoundaries()
  17125. }
  17126. ,
  17127. t.prototype.updateProjectedPanos = function() {
  17128. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17129. }
  17130. ,
  17131. t.prototype.setProjectedPanos = function(t, i, n) {
  17132. null != n || (n = !0),
  17133. n = !!n,
  17134. this.projectedPano0 = t,
  17135. this.projectedPano1 = i,
  17136. this.skybox.material.setProjectedPanos(t, i, n),
  17137. this.chunks.forEach(function(e) {
  17138. e.materialInside.setProjectedPanos(t, i, n)
  17139. })
  17140. }
  17141. ,
  17142. t.prototype.setSide = function(t) {
  17143. this.floors.forEach(function(e) {
  17144. e.collider.material.side = t
  17145. })
  17146. }
  17147. ,
  17148. t.prototype.heroCount = function() {
  17149. return this.heroLocations ? this.heroLocations.length : 0
  17150. }
  17151. ,
  17152. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17153. if (e[0] < 0)
  17154. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17155. null;
  17156. if (this.heroCount() < 1)
  17157. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17158. null;
  17159. var t = this.heroLocations[e[0]];
  17160. if(t.heroLocations && e[1]!=void 0){
  17161. t = t.heroLocations[e[1]];
  17162. }
  17163. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17164. null) : t
  17165. }
  17166. ,
  17167. t.prototype.findPanoramicHero = function() {
  17168. for (var e in this.heroLocations)
  17169. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17170. return this.heroLocations[e];
  17171. return null
  17172. }
  17173. ,
  17174. t.prototype.listImagePanos = function() {
  17175. var i = []
  17176. , n = this;
  17177. return this.images.forEach(function(e) {
  17178. if (e.metadata && e.metadata.scan_id) {
  17179. var t = n.panos.get(e.metadata.scan_id);
  17180. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17181. }
  17182. }),
  17183. i
  17184. }
  17185. ,
  17186. t.prototype.fadePanoMarkers = function(e, t) {
  17187. this.panos.fadeMarkerOpacity(e, t)
  17188. }
  17189. ,
  17190. t.prototype.setSweepVisibility = function(t) {
  17191. this.panos.forEach(function(e) {
  17192. e.marker && (e.marker.visible = t)
  17193. })
  17194. }
  17195. ,
  17196. t.prototype.outsideAllowed = function() {
  17197. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17198. }
  17199. ,
  17200. O.exports = t
  17201. }
  17202. ).call(this, "/js/model/Model.js")
  17203. }
  17204. , {
  17205. "../constants": 8,
  17206. "../enum/AlignmentType": 17,
  17207. "../enum/RenderOrder": 42,
  17208. "../enum/Viewmode": 51,
  17209. "../exception/BasicException": 55,
  17210. "../label/Label": 90,
  17211. "../loaders/ModelLoader": 105,
  17212. "../loaders/ModelTextureLoader": 106,
  17213. "../loaders/SweepDataLoader": 107,
  17214. "../tag/tag": 123,
  17215. "../tag/tagManager": 124,
  17216. "../objects/BoundingTextureSkybox": 143,
  17217. "../objects/Chunk": 144,
  17218. "../objects/Floor": 146,
  17219. "../objects/Panorama": 148,
  17220. "../objects/Room": 150,
  17221. "../objects/Snapshot": 153,
  17222. "../settings": 166,
  17223. "../shaders": 167,
  17224. "../util/ModelUrls": 177,
  17225. "../util/PanoramaCollection": 178,
  17226. "../util/ajax": 181,
  17227. "../util/common": 185,
  17228. "../util/easing": 186,
  17229. "../util/lerp": 188,
  17230. "../util/logger": 189,
  17231. "../util/math": 190,
  17232. "../util/texture": 194,
  17233. "../util/transitions": 195,
  17234. "./../util/browser": 182,
  17235. "./../util/showcase": 193,
  17236. "./Chunks": 135,
  17237. "./FloorCollection": 136,
  17238. "./ImageCollection": 137,
  17239. "./LabelCollection": 138,
  17240. "./RoomCollection": 141,
  17241. events: 202,
  17242. three: 217,
  17243. //hot: "hot"
  17244. }],
  17245. 140: [function(e, t, i) {
  17246. "use strict";
  17247. function n() {
  17248. this.modelMap = {},
  17249. this.activeModel = null,
  17250. this.modelCount = 0,
  17251. this.tileDownloader = null,
  17252. this.panoRenderer = null
  17253. }
  17254. var r = (e("three"),
  17255. e("../util/common"))
  17256. , o = e("../exception/BasicException")
  17257. , a = e("../enum/ModelManagerEvents")
  17258. , s = e("../enum/PanoRendererEvents")
  17259. , l = e("events").EventEmitter;
  17260. n.prototype.init = function(e, t, i) {
  17261. this.tileDownloader = e,
  17262. this.panoRenderer = t,
  17263. this.qualityManager = i,
  17264. this.bindEvents()
  17265. }
  17266. ,
  17267. n.prototype.bindEvents = function() {
  17268. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17269. }
  17270. ,
  17271. n.prototype.onTileRendered = function(e, t, i, n) {}
  17272. ,
  17273. n.prototype.addModel = function(e) {
  17274. this.modelMap[e.sid] = e,
  17275. 0 === this.modelCount && this.activateModel(e.sid),
  17276. this.modelCount++,
  17277. this.emit(a.ModelAdded)
  17278. }
  17279. ,
  17280. n.prototype.getModel = function(e) {
  17281. return this.modelMap[e]
  17282. }
  17283. ,
  17284. n.prototype.activateModel = function(e) {
  17285. var t = this.modelMap[e];
  17286. if (!t)
  17287. throw new o("Tried to activate invalid model!");
  17288. var i = this.activeModel;
  17289. this.activeModel = t,
  17290. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17291. this.tileDownloader.setUrls(t.urls),
  17292. t.panos.forEach(function(e) {
  17293. e.attachToPanoRenderer(this.panoRenderer),
  17294. e.tileDownloader = this.tileDownloader,
  17295. e.qualityManager = this.qualityManager
  17296. }
  17297. .bind(this)),
  17298. this.emit(a.ActiveModelChanged, {
  17299. oldModel: i,
  17300. model: t
  17301. })
  17302. }
  17303. ,
  17304. n.prototype.getActiveModel = function() {
  17305. return this.activeModel
  17306. }
  17307. ,
  17308. r.extend(n, l),
  17309. t.exports = n
  17310. }
  17311. , {
  17312. "../enum/ModelManagerEvents": 33,
  17313. "../enum/PanoRendererEvents": 35,
  17314. "../exception/BasicException": 55,
  17315. "../util/common": 185,
  17316. events: 202,
  17317. three: 217
  17318. }],
  17319. 141: [function(r, l, e) {
  17320. (function(e) {
  17321. "use strict";
  17322. function o() {
  17323. n.call(this)
  17324. }
  17325. var a = r("../objects/Room")
  17326. , t = (r("../settings"),
  17327. r("../util/logger"))
  17328. , i = (r("../util/transitions"),
  17329. r("../util/easing"),
  17330. r("../util/common"))
  17331. , n = r("../util/IndexedCollection")
  17332. , s = r("./Chunks");
  17333. new t(e),
  17334. i.inherit(o, n),
  17335. o.prototype.getIndex = function(e) {
  17336. return e.roomId
  17337. }
  17338. ,
  17339. o.prototype.calcRoomBoundaries = function() {
  17340. this.forEach(function(e) {
  17341. e.calcBoundaries()
  17342. })
  17343. }
  17344. ,
  17345. o.prototype.createFromChunks = function(e) {
  17346. var n = {
  17347. floorId: -1,
  17348. roomId: -1
  17349. }
  17350. , r = {};
  17351. e.forEach(function(e) {
  17352. s.parseIdsFromChunkName(e.name, n);
  17353. var t = r[n.roomId];
  17354. if (!t) {
  17355. var i = o.generateRoomId(n.floorId, n.roomId);
  17356. t = new a(n.floorId,i),
  17357. this.add(t),
  17358. r[n.roomId] = t
  17359. }
  17360. t.addChunk(e)
  17361. }
  17362. .bind(this)),
  17363. this.calcRoomBoundaries()
  17364. }
  17365. ,
  17366. o.generateRoomId = function(e, t) {
  17367. return e + "_" + t
  17368. }
  17369. ,
  17370. l.exports = o
  17371. }
  17372. ).call(this, "/js/model/RoomCollection.js")
  17373. }
  17374. , {
  17375. "../objects/Room": 150,
  17376. "../settings": 166,
  17377. "../util/IndexedCollection": 175,
  17378. "../util/common": 185,
  17379. "../util/easing": 186,
  17380. "../util/logger": 189,
  17381. "../util/transitions": 195,
  17382. "./Chunks": 135
  17383. }],
  17384. 142: [function(e, t, i) {
  17385. "use strict";
  17386. function n(e, t, i) {
  17387. var n = (e = e.clone().expandByScalar(0.01)).size()
  17388. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17389. r.boundingBox = e,
  17390. o.Mesh.call(this, r, t),
  17391. this.position.copy(e.center()),
  17392. this.frustumCulled = !1,
  17393. i && this.add(new o.WireframeHelper(this))
  17394. }
  17395. var o = e("three");
  17396. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17397. t.exports = n
  17398. }
  17399. , {
  17400. three: 217
  17401. }],
  17402. 143: [function(l, c, e) {
  17403. (function(e) {
  17404. "use strict";
  17405. function t(e) {
  17406. s.time("Computing a nice bounding cubemap");
  17407. var t = new r({
  17408. side: i.BackSide,
  17409. transparent: !0
  17410. });
  17411. t.uniforms.modelAlpha.value = 0,
  17412. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17413. this.renderOrder = a.boundingSkybox,
  17414. n.call(this, e, t),
  17415. s.timeEnd("Computing a nice bounding cubemap")
  17416. }
  17417. var i = l("three")
  17418. , n = (l("../enum/Viewmode"),
  17419. l("../shaders"),
  17420. l("./BoundingMesh"))
  17421. , r = l("../materials/ModelTextureMaterial")
  17422. , o = l("../settings")
  17423. , a = l("../enum/RenderOrder")
  17424. , s = new (l("../util/logger"))(e);
  17425. (t.prototype = Object.create(n.prototype)).constructor = t,
  17426. c.exports = t
  17427. }
  17428. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17429. }
  17430. , {
  17431. "../enum/RenderOrder": 42,
  17432. "../enum/Viewmode": 51,
  17433. "../materials/ModelTextureMaterial": 118,
  17434. "../settings": 166,
  17435. "../shaders": 167,
  17436. "../util/logger": 189,
  17437. "./BoundingMesh": 142,
  17438. three: 217
  17439. }],
  17440. 144: [function(e, t, i) {
  17441. "use strict";
  17442. function n(e) {
  17443. this.materialInside = new s({
  17444. side: r.DoubleSide
  17445. });
  17446. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17447. this.materialOutside = new r.RawShaderMaterial({
  17448. fragmentShader: o.modelOutside.fragmentShader,
  17449. vertexShader: o.modelOutside.vertexShader,
  17450. uniforms: t,
  17451. side: r.FrontSide,
  17452. name: "chunkOut"
  17453. }),
  17454. r.Mesh.call(this, e.geometry, this.materialInside),
  17455. this.name = e.name || "",
  17456. this.textureName = e.textureName,
  17457. this.meshUrl = e.meshUrl
  17458. }
  17459. var r = e("three")
  17460. , o = e("../shaders")
  17461. , a = e("../enum/Viewmode")
  17462. , s = e("../materials/ModelTextureMaterial");
  17463. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17464. this.materialInside.uniforms.map.value = e,
  17465. this.materialOutside.uniforms.map.value = e
  17466. }
  17467. ,
  17468. n.prototype.setMode = function(e) {
  17469. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17470. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17471. t.transparent = this.material.transparent,
  17472. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17473. this.material = t
  17474. }
  17475. ,
  17476. t.exports = n
  17477. }
  17478. , {
  17479. "../enum/Viewmode": 51,
  17480. "../materials/ModelTextureMaterial": 118,
  17481. "../shaders": 167,
  17482. three: 217
  17483. }],
  17484. 145: [function(e, t, i) {
  17485. "use strict";
  17486. function n(e) {
  17487. this.chunksize = e || 10,
  17488. this.chunks = {},
  17489. this.boundingBoxes = {},
  17490. this.children = [],
  17491. this.offset = new m.Vector3(0,.5,0),
  17492. this.material = new m.MeshBasicMaterial({
  17493. color: 16777215 * Math.random(),
  17494. side: m.DoubleSide
  17495. })
  17496. }
  17497. var m = e("three");
  17498. e("../enum/Viewmode"),
  17499. n.prototype.add = function(e) {
  17500. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17501. u ? (t = u.position.array,
  17502. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17503. e.faces);
  17504. var d = new m.Vector3;
  17505. if (i)
  17506. for (n = 0,
  17507. r = i.length; n < r; n += 3) {
  17508. var p = 3 * i[n]
  17509. , f = 3 * i[n + 1]
  17510. , g = 3 * i[n + 2];
  17511. o = (t[p] + t[f] + t[g]) / 3,
  17512. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17513. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17514. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17515. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17516. this.boundingBoxes[l] = new m.Box3),
  17517. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17518. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17519. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17520. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17521. }
  17522. else
  17523. for (n = 0,
  17524. r = t.length; n < r; n += 9)
  17525. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17526. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17527. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17528. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17529. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17530. this.boundingBoxes[l] = new m.Box3),
  17531. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17532. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17533. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17534. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17535. }
  17536. ,
  17537. n.prototype.build = function() {
  17538. var e = new m.Object3D;
  17539. for (var t in e.material = this.material,
  17540. this.chunks) {
  17541. var i = this.chunks[t]
  17542. , n = new m.BufferGeometry;
  17543. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17544. n.boundingBox = this.boundingBoxes[t];
  17545. var r = new m.Mesh(n,this.material);
  17546. r.material.visible = !1,
  17547. e.add(r),
  17548. this.chunks[t] = []
  17549. }
  17550. return e
  17551. }
  17552. ,
  17553. t.exports = n
  17554. }
  17555. , {
  17556. "../enum/Viewmode": 51,
  17557. three: 217
  17558. }],
  17559. 146: [function(e, t, i) {
  17560. "use strict";
  17561. var n = e("three")
  17562. , r = e("../settings")
  17563. , o = e("../util/common")
  17564. , a = e("../util/lerp")
  17565. , s = e("./ChunkedCollider")
  17566. , l = e("../util/transitions")
  17567. , c = e("../util/easing")
  17568. , h = (e("../objects/Panorama"),
  17569. e("../enum/RenderOrder"));
  17570. e("../localization/localize");
  17571. function u(e, t, i) {
  17572. n.Object3D.call(this),
  17573. this.model = e,
  17574. this.floorIndex = t,
  17575. this.lang = r.languageTag,
  17576. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17577. this.panos = [],
  17578. this.chunks = [],
  17579. this.colliderBuilder = new s(3),
  17580. this.collider = null,
  17581. this.center = null,
  17582. this.boundingBox = new n.Box3,
  17583. this.size = null,
  17584. this.hidden = !1,
  17585. this.conservativeBoundingBox = new n.Box3,
  17586. this.debugColor = 16777215 * Math.random(),
  17587. this.transition = null
  17588. }
  17589. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17590. this.model.setFloor(this, e)
  17591. }
  17592. ,
  17593. u.prototype.hide = function(e) {
  17594. if (!this.hidden || this.transition) {
  17595. this.chunks.forEach(function(e) {
  17596. e.material.transparent = !0
  17597. }),
  17598. l.cancel(this.transition);
  17599. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17600. , i = e ? 0 : r.hideFloorDelay / t;
  17601. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17602. this.hidden = !0
  17603. }
  17604. .bind(this), i, c.easeInOutQuad)
  17605. }
  17606. }
  17607. ,
  17608. u.prototype.show = function(e) {
  17609. if (this.hidden || this.transition) {
  17610. this.hidden = !1,
  17611. l.cancel(this.transition);
  17612. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17613. , i = e ? 0 : r.showFloorDelay / t;
  17614. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17615. this.hidden || this.chunks.forEach(function(e) {
  17616. e.material.transparent = !1
  17617. })
  17618. }
  17619. .bind(this), i, c.easeInOutQuad)
  17620. }
  17621. }
  17622. ,
  17623. u.prototype.toggle = function(e, t) {
  17624. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17625. }
  17626. ,
  17627. u.prototype.containsPoint = function(t) {
  17628. return this.collider.children.some(function(e) {
  17629. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17630. e.geometry.boundingBox.containsPoint(t)
  17631. })
  17632. }
  17633. ,
  17634. u.prototype.distanceToPoint = function(i) {
  17635. var n = null
  17636. , r = 1 / 0;
  17637. return this.collider.children.forEach(function(e) {
  17638. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17639. var t = e.geometry.boundingBox.distanceToPoint(i);
  17640. (!n || t < r) && (r = t,
  17641. n = e)
  17642. }),
  17643. r
  17644. }
  17645. ,
  17646. u.prototype.addChunk = function(e) {
  17647. e.renderOrder = h.ghostFloor,
  17648. this.add(e),
  17649. this.chunks.push(e),
  17650. this.boundingBox.union(e.geometry.boundingBox),
  17651. this.size = this.boundingBox.size(),
  17652. this.colliderBuilder.add(e.geometry)
  17653. }
  17654. ,
  17655. u.prototype.addPano = function(e) {
  17656. this.panos.push(e),
  17657. this.add(e.skyboxMesh),
  17658. e.marker && this.add(e.marker);
  17659. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17660. var t = new n.Vector3(1,1,1)
  17661. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17662. this.boundingBox.union(i)
  17663. }
  17664. }
  17665. ,
  17666. u.prototype.build = function() {
  17667. this.collider = this.colliderBuilder.build(!0),
  17668. this.add(this.collider),
  17669. this.center = this.boundingBox.center(),
  17670. this.conservativeBoundingBox.copy(this.boundingBox),
  17671. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17672. return e.geometry.boundingBox.min.y
  17673. }), 5),
  17674. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17675. return e.geometry.boundingBox.max.y
  17676. }), 5),
  17677. this.colliderBuilder = null
  17678. }
  17679. ,
  17680. u.prototype.toShortString = function() {
  17681. return o.nth(this.floorIndex + 1)
  17682. }
  17683. ,
  17684. u.prototype.toString = function() {
  17685. return this.name
  17686. }
  17687. ,
  17688. t.exports = u
  17689. }
  17690. , {
  17691. "../enum/RenderOrder": 42,
  17692. "../localization/localize": 108,
  17693. "./strings-cn-CN": 109,
  17694. "../objects/Panorama": 148,
  17695. "../settings": 166,
  17696. "../util/common": 185,
  17697. "../util/easing": 186,
  17698. "../util/lerp": 188,
  17699. "../util/transitions": 195,
  17700. "./ChunkedCollider": 145,
  17701. three: 217
  17702. }],
  17703. 147: [function(e, t, i) {
  17704. "use strict";
  17705. function n(e) {
  17706. this.player = e,
  17707. this.obj3d = null,
  17708. this.UP = new u.Vector3(0,1,0)
  17709. }
  17710. var u = e("three")
  17711. , d = e("../settings");
  17712. n.prototype.prefs = {
  17713. linewidth: 3,
  17714. height: .07,
  17715. opacity: .45,
  17716. endScale: .05
  17717. },
  17718. n.prototype.discard = function() {
  17719. if (this.obj3d) {
  17720. var e = this.obj3d.parent;
  17721. e && e.remove(this.obj3d)
  17722. }
  17723. this.obj3d = null
  17724. }
  17725. ,
  17726. n.prototype.draw = function() {
  17727. if (this.discard(),
  17728. d.showNeighbors) {
  17729. var e = this.player.currentPano.floor;
  17730. this.obj3d = new u.Object3D;
  17731. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17732. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17733. i.y += this.prefs.height;
  17734. var n = .1525
  17735. , r = new u.Matrix4;
  17736. for (var o in t)
  17737. if (t[o]) {
  17738. var a = this.player.model.panos.get(o)
  17739. , s = (a.position.clone().sub(this.player.model.position),
  17740. a.position.clone().sub(a.floorPosition))
  17741. , l = a.floorPosition.clone().sub(this.player.model.position);
  17742. l.y += this.prefs.height;
  17743. var c = new u.Geometry;
  17744. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  17745. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  17746. r.identity().setPosition(s),
  17747. c.applyMatrix(r),
  17748. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17749. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17750. r.lookAt(l, i, this.UP).setPosition(l),
  17751. c.applyMatrix(r),
  17752. c.vertices.push(l, i);
  17753. var h = new u.Line(c,new u.LineBasicMaterial({
  17754. color: a.debugColor.getHex(),
  17755. transparent: !0,
  17756. opacity: this.prefs.opacity,
  17757. depthWrite: !1,
  17758. name: "sLine" + o,
  17759. linewidth: this.prefs.linewidth
  17760. }));
  17761. this.obj3d.add(h)
  17762. }
  17763. e.add(this.obj3d)
  17764. }
  17765. }
  17766. ,
  17767. n.prototype.update = function() {
  17768. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17769. }
  17770. ,
  17771. t.exports = n
  17772. }
  17773. , {
  17774. "../settings": 166,
  17775. three: 217
  17776. }],
  17777. 148: [function(S, M, e) {
  17778. (function(e) {
  17779. "use strict";
  17780. function r(e, t, i, n) {
  17781. this.model = e,
  17782. this.id = t,
  17783. this.alignmentType = i.alignmentType || c.ALIGNED,
  17784. this.neighbourUUIDs = i.neighbours,
  17785. this.neighbourPanos = null,
  17786. this.floor = null,
  17787. this.floorIndex = i.floor,
  17788. this.failedLoadingAt = 0,
  17789. this.maxLoadRetries = 4,
  17790. this.origin = i.position.clone(),
  17791. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17792. this.quaternion = i.quaternion.clone(),
  17793. this.skyboxMesh = new s.Mesh(E),
  17794. this.skyboxMesh.position.copy(this.position),
  17795. this.skyboxMesh.quaternion.copy(this.quaternion),
  17796. this.skyboxMesh.name = "skybox",
  17797. this.skyboxMesh.visible = !1,
  17798. this.skyboxMesh.updateMatrix(),
  17799. this.skyboxMesh.updateMatrixWorld(),
  17800. this.marker = null,
  17801. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  17802. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17803. map: b,
  17804. side: s.DoubleSide,
  17805. opacity: 0,
  17806. transparent: !0,
  17807. depthWrite: !1
  17808. })),
  17809. this.marker.visible = this.showFloorMarker,
  17810. this.marker.renderOrder = l.panoMarker,
  17811. this.marker.name = "marker",
  17812. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17813. this.marker.updateMatrixWorld(),
  17814. a.colorMarkerOnLoad && this.on("load", function() {
  17815. this.marker.material.color.set(65280)
  17816. })),
  17817. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17818. this.floorPosition = i.puck ? i.puck.clone() : null,
  17819. this.tiled = n,
  17820. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17821. this.solidSkybox.flipY = !1,
  17822. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17823. this.solidSkybox.magFilter = s.LinearFilter,
  17824. this.solidSkybox.generateMipmaps = !1)),
  17825. this.zoomed = !1,
  17826. this.panoRenderer = null,
  17827. this.qualityManager = null,
  17828. this.tileDownloader = null,
  17829. this.tiledPanoRenderTarget = null,
  17830. this.minimumTiledPanoLoaded = !1,
  17831. this.highestPartialTileRenderOpCompleted = 0,
  17832. this.highestFullTileRenderOpCompleted = 0,
  17833. this.shouldRedrawOnBaseLoaded = !1,
  17834. this.lockUntilRenderingComplete = !1,
  17835. a.colorMarkerOnLoad && this.on("load", function() {
  17836. this.marker.material.color.set(65280)
  17837. }),
  17838. (e = new s.TextureLoader).setCrossOrigin(!0);
  17839. var r = e.load("images/texture.jpg");
  17840. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17841. color: 16777215,
  17842. transparent: !0,
  17843. opacity: .75,
  17844. map: r
  17845. })),
  17846. this.vrMarker.boluoType = "vr",
  17847. this.vrMarker.position.z = 1,
  17848. this.vrMarker.enabled = !0,
  17849. this.vrMarker.visible = !1,
  17850. window.vrMarkers = window.vrMarkers || [],
  17851. window.vrMarkers.push(this.vrMarker),
  17852. this.marker && this.marker.add(this.vrMarker),
  17853. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17854. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17855. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17856. this.adjustAngleEnable) {
  17857. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17858. this.skyboxMesh.quaternion.multiply(i);
  17859. var o = new s.Quaternion;
  17860. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17861. this.skyboxMesh.quaternion.multiply(o),
  17862. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17863. this.skyboxMesh.quaternion.multiply(n),
  17864. this.skyboxMesh.updateMatrix(),
  17865. this.skyboxMesh.updateMatrixWorld(),
  17866. this.model.updateProjectedPanos()
  17867. }
  17868. }
  17869. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17870. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17871. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17872. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17873. S("../enum/GLCubeFaces"),
  17874. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  17875. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17876. function() {
  17877. this.setZoomed(!1),
  17878. this.emit("enter", {
  17879. oldPano: t,
  17880. newPano: this
  17881. }),
  17882. t = this
  17883. }
  17884. ),
  17885. r.prototype.exit = function() {
  17886. this.tiled ? (this.clearWaitDeferreds(),
  17887. this.minimumTiledPanoLoaded = !1,
  17888. this.tiledPanoRenderTarget = null,
  17889. this.setZoomed(!1),
  17890. this.panoRenderer.deactivateTiledPano(this),
  17891. this.highestPartialTileRenderOpCompleted = 0,
  17892. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17893. this.solidSkybox.loaded = !1,
  17894. this.solidSkybox.version = 0),
  17895. this.emit("exit")
  17896. }
  17897. ,
  17898. r.prototype.hoverOn = function(e) {
  17899. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17900. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17901. }
  17902. ,
  17903. r.prototype.hoverOff = function(e) {
  17904. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17905. }
  17906. ,
  17907. r.prototype.build1 = function() {
  17908. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17909. this.floor.addPano(this),
  17910. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17911. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17912. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17913. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17914. }
  17915. ,
  17916. r.prototype.build2 = function() {
  17917. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17918. this.height = this.position.distanceTo(this.floorPosition),
  17919. this.placeMarker()
  17920. }
  17921. ,
  17922. r.prototype.interpolateFloorPosition = function() {
  17923. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17924. return !!e.floorPosition
  17925. }).sort(function(e, t) {
  17926. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17927. }
  17928. .bind(this))
  17929. , t = this.position.clone();
  17930. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17931. t
  17932. }
  17933. ,
  17934. r.prototype.raycastFloorPosition = function() {
  17935. I.warn("Performance warning: Raycasting to find floor position");
  17936. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17937. return e.length ? e[0].point : null
  17938. }
  17939. ,
  17940. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  17941. function() {
  17942. I.warn("Performance warning: Raycasting to find floor index");
  17943. for (var e = 0; e < i.length; e++) {
  17944. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17945. if (t.length)
  17946. return t[0].object.parent.parent
  17947. }
  17948. return null
  17949. }
  17950. ),
  17951. r.prototype.placeMarker = function() {
  17952. this.marker && (this.marker.position.copy(this.floorPosition),
  17953. this.marker.position.y += .05,
  17954. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17955. }
  17956. ,
  17957. r.prototype.translate = function(e) {
  17958. this.position.add(e),
  17959. this.floorPosition.add(e)
  17960. }
  17961. ,
  17962. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17963. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17964. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17965. }
  17966. ,
  17967. r.prototype.attachToPanoRenderer = function(e) {
  17968. this.panoRenderer = e,
  17969. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17970. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17971. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17972. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17973. }
  17974. ;
  17975. var w, T, x = {};
  17976. r.prototype.getWaitDeferred = function(e) {
  17977. var t = x[this.id];
  17978. t || (t = {},
  17979. x[this.id] = t);
  17980. var i = t[e];
  17981. return i || (i = {
  17982. deferred: $.Deferred(),
  17983. active: !1
  17984. },
  17985. t[e] = i),
  17986. i
  17987. }
  17988. ,
  17989. r.prototype.resetWaitDeferred = function(e) {
  17990. var t = this.getWaitDeferred(e);
  17991. t.active = !1,
  17992. t.deferred = $.Deferred()
  17993. }
  17994. ,
  17995. r.prototype.clearWaitDeferreds = function() {
  17996. var e = x[this.id];
  17997. for (var t in e || (e = {},
  17998. x[this.id] = e),
  17999. e)
  18000. if (e.hasOwnProperty(t)) {
  18001. var i = e[t];
  18002. i.active = !1,
  18003. i.deferred = $.Deferred()
  18004. }
  18005. }
  18006. ,
  18007. r.prototype.loadTiledPano = (new s.Vector3,
  18008. w = [],
  18009. T = [],
  18010. function(e, t, i, n, r, o) {
  18011. null != n || (n = !0),
  18012. null != r || (r = !0);
  18013. var a = this.getWaitDeferred(e)
  18014. , s = a.deferred
  18015. , l = null
  18016. , c = null;
  18017. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18018. c = i.vFov)),
  18019. !this.isLoaded(e)) {
  18020. if (!a.active) {
  18021. if (a.active = !0,
  18022. i) {
  18023. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18024. w[this.id + ":" + e] = {
  18025. tileCount: 0,
  18026. targetTileCount: h
  18027. },
  18028. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18029. }
  18030. T[this.id] || (T[this.id] = !0,
  18031. this.on(f.LoadComplete, function(e, t) {
  18032. var i = this.getWaitDeferred(e).deferred;
  18033. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18034. this.resetWaitDeferred(e))
  18035. }
  18036. .bind(this)),
  18037. this.on(f.LoadFailed, function(e) {
  18038. var t = this.getWaitDeferred(e).deferred;
  18039. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18040. this.resetWaitDeferred(e))
  18041. }
  18042. .bind(this)),
  18043. this.on(f.TileLoaded, function(e, t, i) {
  18044. var n = this.getWaitDeferred(e).deferred;
  18045. if (n && "pending" === n.state()) {
  18046. n.notify(e, t, i);
  18047. var r = w[this.id + ":" + e];
  18048. r && (r.tileCount++,
  18049. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18050. n.resolve(e, i),
  18051. this.resetWaitDeferred(e)))
  18052. }
  18053. }
  18054. .bind(this)))
  18055. }
  18056. this.tileDownloader.clearForceQueue(),
  18057. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18058. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18059. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18060. }
  18061. return s.promise()
  18062. }
  18063. ),
  18064. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18065. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18066. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18067. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18068. }
  18069. ,
  18070. r.prototype.onTileRendered = function(e, t, i, n) {
  18071. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18072. }
  18073. ,
  18074. r.prototype.onPanoRendered = function(e, t, i, n) {
  18075. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18076. this.updateSkyboxForZoomLevel(),
  18077. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18078. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18079. this.emit("load", t),
  18080. this.model.emit("load", this),
  18081. this.emit(f.LoadComplete, t, i))
  18082. }
  18083. ,
  18084. r.prototype.setZoomed = function(e) {
  18085. this.zoomed = e,
  18086. this.updateSkyboxForZoomLevel()
  18087. }
  18088. ,
  18089. r.prototype.ensureSkyboxReadyForRender = function() {
  18090. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18091. this.solidSkybox.loaded = !0)
  18092. }
  18093. ,
  18094. r.prototype.updateSkyboxForZoomLevel = function() {
  18095. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18096. }
  18097. ,
  18098. r.prototype.getSkyboxTexture = function() {
  18099. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18100. }
  18101. ,
  18102. r.prototype.onTileRenderFail = function(e, t, i) {
  18103. e === this.id && this.emit(f.LoadFailed, t)
  18104. }
  18105. ,
  18106. r.prototype.isLoaded = function(e) {
  18107. if (this.tiled) {
  18108. if (e && "string" == typeof e)
  18109. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18110. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18111. }
  18112. if (e && "number" == typeof e)
  18113. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18114. return !!this.solidSkybox.high || e in this.solidSkybox
  18115. }
  18116. ,
  18117. r.prototype.loadCube = function(a) {
  18118. if (this.isLoaded(a))
  18119. return I.info("Skipping load of pano, already loaded"),
  18120. $.when();
  18121. this.emit("loading", a),
  18122. this.model.emit("loading", this);
  18123. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18124. , e = n.filter(function(e) {
  18125. return !e
  18126. });
  18127. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18128. a = "high",
  18129. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18130. var t = 0
  18131. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18132. return u.getImage(n[t])
  18133. }
  18134. .bind(this));
  18135. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18136. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18137. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18138. this.solidSkybox.low = null),
  18139. this.solidSkybox.needsUpdate = !0,
  18140. this.emit("load", a),
  18141. this.model.emit("load", this),
  18142. this
  18143. }
  18144. .bind(this), function() {
  18145. I.error("Downloading cubemap for pano", this.id, "failed"),
  18146. this.failedLoadingAt = Date.now()
  18147. }
  18148. .bind(this), function() {
  18149. return $.when(++t, 6)
  18150. })
  18151. }
  18152. ,
  18153. r.raycastsSkipped = 0,
  18154. r.raycastsDone = 0,
  18155. r.prototype.findNeighourPanos = function() {
  18156. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18157. this.model.panos.forEach(function(e) {
  18158. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18159. var t = this.position.distanceTo(e.position);
  18160. if (t > a.panoramaNeighbourMaxDistance)
  18161. return this.model.panos.setNeighbour(this, e, !1),
  18162. void r.raycastsSkipped++;
  18163. var i = e.position.clone().sub(this.position).normalize()
  18164. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18165. r.raycastsDone++,
  18166. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18167. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  18168. }
  18169. }
  18170. .bind(this)),
  18171. this.model.panos.neighbourMap[this.id]
  18172. }
  18173. ,
  18174. r.prototype.worldPosition = function() {
  18175. return this.position
  18176. }
  18177. ,
  18178. r.prototype.addTextSprite = function(e, color, parent) {
  18179. this.removeTextSprite();
  18180. var ratio = 16;
  18181. var i = document.createElement("canvas")
  18182. , n = i.getContext("2d");
  18183. i.width = 1024,
  18184. i.height = i.width / ratio;
  18185. n.font = " 30px Arial",
  18186. n.fillStyle = "white";
  18187. var r = n.measureText(e).width;
  18188. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18189. var o = new s.Texture(i);
  18190. o.needsUpdate = !0;
  18191. var a = new s.SpriteMaterial({
  18192. map: o,
  18193. color: color || 16428055,
  18194. depthTest:false
  18195. });
  18196. this.text3d = new s.Sprite(a)
  18197. if(parent){
  18198. parent.add(this.text3d)
  18199. }else{
  18200. this.text3d.position.copy(this.skyboxMesh.position)
  18201. this.floor.add(this.text3d)
  18202. }
  18203. var scale = 5
  18204. this.text3d.scale.y = scale/ratio
  18205. this.text3d.scale.x = scale
  18206. }
  18207. ,
  18208. r.prototype.removeTextSprite = function() {
  18209. this.text3d && (this.text3d.parent.remove(this.text3d),
  18210. this.text3d.material.map.dispose(),
  18211. this.text3d = null)
  18212. }
  18213. ,
  18214. r.prototype.isAligned = function() {
  18215. return this.alignmentType === c.ALIGNED
  18216. }
  18217. ,
  18218. r.filters = {
  18219. inDirection: function(t, i, n) {
  18220. return function(e) {
  18221. return e.position.clone().sub(t).normalize().dot(i) > n
  18222. }
  18223. },
  18224. inFloorDirection: function(t, i, n) {
  18225. return function(e) {
  18226. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18227. }
  18228. },
  18229. inPanoDirection: function(n, r, o) {
  18230. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18231. function(e) {
  18232. var t = e.floorPosition.clone().sub(n).normalize()
  18233. , i = e.position.clone().sub(n).normalize();
  18234. return t.dot(r) > o || i.dot(r) > o
  18235. }
  18236. },
  18237. atFloor: function(t) {
  18238. return function(e) {
  18239. return !t || e.floor === t
  18240. }
  18241. },
  18242. not: function(t) {
  18243. return function(e) {
  18244. return e !== t
  18245. }
  18246. },
  18247. notIn: function(t) {
  18248. return function(e) {
  18249. return -1 === t.indexOf(e)
  18250. }
  18251. },
  18252. isLoaded: function() {
  18253. return function(e) {
  18254. return e.isLoaded()
  18255. }
  18256. },
  18257. isNotLoaded: function() {
  18258. return function(e) {
  18259. return !e.isLoaded()
  18260. }
  18261. },
  18262. isCloseEnoughTo: function(t, i) {
  18263. return function(e) {
  18264. return t.distanceTo(e.floorPosition) < i
  18265. }
  18266. },
  18267. hasMinimumHeightDifferenceTo: function(t, i) {
  18268. return function(e) {
  18269. return Math.abs(e.position.y - t.y) > i
  18270. }
  18271. },
  18272. isNotBehindNormal: function(t, i) {
  18273. var n = new s.Vector3;
  18274. return i = i.clone(),
  18275. function(e) {
  18276. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18277. }
  18278. },
  18279. isNeighbourPanoTo: function(t) {
  18280. return function(e) {
  18281. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18282. }
  18283. },
  18284. isNeighbourOfNeighbourTo: function(n) {
  18285. return function(i) {
  18286. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18287. var t = n.model.panos.get(e);
  18288. return !!t && t.neighbourPanos[i.id]
  18289. })
  18290. }
  18291. },
  18292. isNotRecentlyFailed: function(t) {
  18293. return function(e) {
  18294. return Date.now() - e.failedLoadingAt > t
  18295. }
  18296. },
  18297. isOnVisibleFloor: function() {
  18298. return function(e) {
  18299. return !e.floor.hidden
  18300. }
  18301. },
  18302. isPanoAligned: function() {
  18303. return function(e) {
  18304. return e.isAligned()
  18305. }
  18306. }
  18307. },
  18308. r.sortFunctions = {
  18309. distanceToPoint: function(i) {
  18310. return function(e, t) {
  18311. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18312. }
  18313. },
  18314. floorDistanceToPoint: function(i) {
  18315. return function(e, t) {
  18316. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18317. }
  18318. },
  18319. choose: function(i) {
  18320. return function(e, t) {
  18321. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18322. }
  18323. }
  18324. },
  18325. r.scoreFunctions = {
  18326. distance: function(t, i) {
  18327. return i = i || a.navigation.distanceFactor,
  18328. function(e) {
  18329. return t ? t.position.distanceTo(e.position) * i : 0
  18330. }
  18331. },
  18332. distanceSquared: function(t, i) {
  18333. return i = i || a.navigation.distanceFactor,
  18334. function(e) {
  18335. return t ? t.position.distanceToSquared(e.position) * i : 0
  18336. }
  18337. },
  18338. direction: function(t, i) {
  18339. return function(e) {
  18340. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18341. }
  18342. },
  18343. angle: function(t, i) {
  18344. return function(e) {
  18345. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18346. }
  18347. },
  18348. inFieldOfView: function(t, i) {
  18349. return function(e) {
  18350. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18351. }
  18352. },
  18353. optionality: function(t) {
  18354. return function(e) {
  18355. return e.neighbourUUIDs.filter(function(e) {
  18356. return !(e in t.neighbourUUIDs) && e !== t.id
  18357. }).length * a.navigation.optionalityFactor
  18358. }
  18359. },
  18360. penalizeHeightDifferenceUnder: function(t, i) {
  18361. return function(e) {
  18362. return t.y - e.position.y < i ? -20 : 0
  18363. }
  18364. }
  18365. },
  18366. M.exports = r
  18367. }
  18368. ).call(this, "/js/objects/Panorama.js")
  18369. }
  18370. , {
  18371. "../enum/AlignmentType": 17,
  18372. "../enum/GLCubeFaces": 25,
  18373. "../enum/PanoRendererEvents": 35,
  18374. "../enum/PanoSizeClass": 36,
  18375. "../enum/PanoramaEvents": 37,
  18376. "../enum/RenderLayers": 41,
  18377. "../enum/RenderOrder": 42,
  18378. "../enum/TileDownloaderEvents": 45,
  18379. "../enum/Viewmode": 51,
  18380. "../exception/BasicException": 55,
  18381. "../scene/SceneRenderer": 158,
  18382. "../settings": 166,
  18383. "../tile/TileUtils": 174,
  18384. "../util/ajax": 181,
  18385. "../util/common": 185,
  18386. "../util/lerp": 188,
  18387. "../util/logger": 189,
  18388. "../util/panorama": 191,
  18389. "../util/texture": 194,
  18390. "../util/transitions": 195,
  18391. events: 202,
  18392. three: 217
  18393. }],
  18394. 149: [function(e, t, i) {
  18395. "use strict";
  18396. function n(e) {
  18397. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18398. t.map.value = d,
  18399. t.opacity.value = 0,
  18400. t.color.value.set(o.reticuleColor),
  18401. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18402. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18403. side: r.DoubleSide,
  18404. depthWrite: !1,
  18405. depthTest: !1,
  18406. transparent: !0,
  18407. vertexShader: c.waypoint.vertexShader,
  18408. fragmentShader: c.waypoint.fragmentShader,
  18409. uniforms: t,
  18410. name: "waypoint",
  18411. opacity: 0,
  18412. visible: t.showMouseMarker
  18413. })),
  18414. this.layers.set(h.RETICULE),
  18415. this.renderOrder = u.reticule,
  18416. this.player = e,
  18417. this.direction = new r.Vector3,
  18418. this.hidden = !0,
  18419. this.mouseLastMoveTime = Date.now()
  18420. }
  18421. var r = e("three")
  18422. , o = e("../settings")
  18423. , a = e("../util/transitions")
  18424. , s = e("../util/texture")
  18425. , l = e("../util/lerp")
  18426. , c = e("../shaders")
  18427. , h = e("../enum/RenderLayers")
  18428. , u = e("../enum/RenderOrder")
  18429. , d = s.load("images/reticule-256x256.png");
  18430. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18431. this.hidden = i,
  18432. this.mouseLastMoveTime = Date.now()
  18433. }
  18434. ,
  18435. n.prototype.hide = function() {
  18436. this.hidden || (this.hidden = !0,
  18437. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18438. }
  18439. ,
  18440. n.prototype.show = function() {
  18441. this.hidden = !1,
  18442. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18443. }
  18444. ,
  18445. n.prototype.update = function() {
  18446. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18447. }
  18448. ,
  18449. n.prototype.updatePosition = function(e, t) {
  18450. if (!this.hidden) {
  18451. if (!t)
  18452. return this.hide();
  18453. var i = t.point
  18454. , n = e.distanceTo(i)
  18455. , r = 1 + .01 * n;
  18456. n < 1 && (r -= 1 - n),
  18457. this.show(),
  18458. this.scale.set(r, r, r),
  18459. this.direction = this.direction.multiplyScalar(.8),
  18460. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18461. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18462. this.lookAt(this.position.clone().add(this.direction))
  18463. }
  18464. }
  18465. ,
  18466. n.prototype.writeAstag = function() {
  18467. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18468. , t = new Date;
  18469. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18470. var i = {
  18471. enabled: !0,
  18472. version: "0",
  18473. created: t.toISOString(),
  18474. created_by: "APITest",
  18475. position: this.position.clone(),
  18476. stem: {
  18477. enabled: o.tags.pole.enabled,
  18478. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18479. },
  18480. label: "tag " + this.tagCount,
  18481. description: "Description " + e,
  18482. floor: function(e) {
  18483. if (e.currentFloor) {
  18484. var t = e.floors.indexOf(e.currentFloor);
  18485. return -1 < t ? t : void 0
  18486. }
  18487. }(this.player.model),
  18488. type: "info",
  18489. metadata: {
  18490. preferred_camera: {
  18491. mode: this.player.mode
  18492. }
  18493. }
  18494. };
  18495. console.log("--------------------------"),
  18496. console.log(JSON.stringify(i));
  18497. var n = this.player.model.addtag(e, i).build();
  18498. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18499. n.visible || n.show(o.tags.startup.fadeInDuration))
  18500. }
  18501. ,
  18502. t.exports = n
  18503. }
  18504. , {
  18505. "../enum/RenderLayers": 41,
  18506. "../enum/RenderOrder": 42,
  18507. "../settings": 166,
  18508. "../shaders": 167,
  18509. "../util/lerp": 188,
  18510. "../util/texture": 194,
  18511. "../util/transitions": 195,
  18512. three: 217
  18513. }],
  18514. 150: [function(e, t, i) {
  18515. "use strict";
  18516. function n(e, t) {
  18517. this.chunks = [],
  18518. this.floorId = e,
  18519. this.roomId = t,
  18520. this.position = new l.Vector3
  18521. }
  18522. var l = e("three");
  18523. n.prototype.addChunk = function(e) {
  18524. this.chunks.push(e)
  18525. }
  18526. ,
  18527. n.prototype.calcBoundaries = function() {
  18528. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18529. var a = this.chunks[o].geometry.attributes.position;
  18530. if (a)
  18531. for (var s = 0; s < a.array.length; s += 3)
  18532. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18533. t.add(e),
  18534. 0 === s ? (i.copy(e),
  18535. n.copy(e)) : (i.max(e),
  18536. n.min(e)),
  18537. r++
  18538. }
  18539. 0 < r ? (t.multiplyScalar(1 / r),
  18540. this.average = t) : this.average = null,
  18541. this.boundsMax = i,
  18542. this.boundsMin = n,
  18543. this.center = new l.Vector3,
  18544. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18545. }
  18546. ,
  18547. t.exports = n
  18548. }
  18549. , {
  18550. three: 217
  18551. }],
  18552. 151: [function(o, v, e) {
  18553. (function(e) {
  18554. "use strict";
  18555. function t(e, t, i) {
  18556. this.obj3d = null,
  18557. this.nodes = [],
  18558. this.colorHull = [],
  18559. this.shortPaths = {},
  18560. this.floorHull = null,
  18561. this.cameraHull = null,
  18562. this.floorPathDistance = 0,
  18563. this.floorCurvePoints = null,
  18564. this.floorCurveColors = null,
  18565. this.camCurvePoints = null,
  18566. this.warpDestHeroLoc = null,
  18567. this.warpDestPano = null,
  18568. this.warpPathPoints = null,
  18569. this.warpPathLengths = [0],
  18570. this.warpLength = 0,
  18571. this.closeWarpDistance = 4,
  18572. this.UP = U.UP.clone(),
  18573. this.longestStep = 0,
  18574. this.upcomingTransType = null,
  18575. this.burnsDir = 1,
  18576. this.prevNextDist = 0,
  18577. this.nextI = 0,
  18578. this.activeTransType = null,
  18579. this.lastTransType = null,
  18580. this.bunnyObj = null,
  18581. this.director = e,
  18582. this.player = t,
  18583. this.playerControls = i,
  18584. this.modelManager = t.modelManager,
  18585. this.updateModel(),
  18586. this.updateDefaultsFromModelData(),
  18587. this.bindEvents(),
  18588. this.warping = !1,
  18589. this.waitingToWarp = !1,
  18590. this.warpInterrupted = !1,
  18591. this.warpInterruptionBlackoutStyle = null,
  18592. this.warpInterruptionTravelTime = null
  18593. }
  18594. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18595. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18596. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18597. path: n.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"),
  18598. pathEnd: n.load("images/End.png"),
  18599. pathStart: n.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==")
  18600. };
  18601. t.prototype.setScene = function(e) {
  18602. this.createCpm(e),
  18603. this.createBunnyObj(e)
  18604. }
  18605. ,
  18606. t.prototype.updateModel = function() {
  18607. this.model = this.modelManager.getActiveModel()
  18608. }
  18609. ,
  18610. t.prototype.bindEvents = function() {
  18611. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18612. }
  18613. ,
  18614. t.prototype.updateDefaultsFromModelData = function() {
  18615. this.model.data
  18616. }
  18617. ,
  18618. t.prototype.pointPathDistance = function(e) {
  18619. for (var t = 0, i = 1; i < e.length; i += 1)
  18620. t += e[i - 1].distanceTo(e[i]);
  18621. return t
  18622. }
  18623. ,
  18624. t.prototype.pointPathLengths = function(e) {
  18625. for (var t = [0], i = 1; i < e.length; i += 1)
  18626. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18627. return t
  18628. }
  18629. ,
  18630. t.prototype.interpAlongPath = function(e, t, i) {
  18631. var n, r = new P.Vector3, o = t[t.length - 1];
  18632. if (i < 1) {
  18633. n = i * o;
  18634. for (var a = 1; a < t.length; a += 1)
  18635. if (t[a] > n) {
  18636. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18637. return r.copy(e[a]),
  18638. r.sub(e[a - 1]),
  18639. r.multiplyScalar(s),
  18640. r.add(e[a - 1]),
  18641. r
  18642. }
  18643. } else
  18644. r.copy(e[e.length - 1]);
  18645. return r
  18646. }
  18647. ,
  18648. t.prototype.pathHeight = function() {
  18649. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18650. }
  18651. ,
  18652. t.prototype.createBunnyObj = function(e) {
  18653. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18654. this.bunnyObj.visible = D.warp.showBunny),
  18655. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18656. e.add(this.bunnyObj)
  18657. }
  18658. ,
  18659. t.prototype.createCpm = function(e) {
  18660. if (!this.currentPanoMarker) {
  18661. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18662. t.material.uniforms.opacity.value = 0,
  18663. this.currentPanoMarker = {
  18664. mesh: t,
  18665. placed: !1
  18666. }
  18667. }
  18668. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18669. this.placeCpm(),
  18670. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18671. }
  18672. ,
  18673. t.prototype.placeCpm = function() {
  18674. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18675. var e = this.player.currentPano.floor;
  18676. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18677. e.add(this.currentPanoMarker.mesh)),
  18678. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18679. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18680. this.currentPanoMarker.placed = !0
  18681. } else
  18682. this.popOutCpm()
  18683. }
  18684. ,
  18685. t.prototype.fadeInCpm = function(e) {
  18686. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18687. }
  18688. ,
  18689. t.prototype.fadeOutCpm = function(e) {
  18690. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18691. }
  18692. ,
  18693. t.prototype.popInCpm = function() {
  18694. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18695. }
  18696. ,
  18697. t.prototype.popOutCpm = function() {
  18698. this.fadeOutCpm(2)
  18699. }
  18700. ,
  18701. t.prototype.brushPrefs = {
  18702. linewidth: 7,
  18703. strokeWidth: 15,
  18704. cvSegments: 48,
  18705. paveStep: .1,
  18706. paveWidth: .2,
  18707. lookBlendDist: 3,
  18708. maxTurn: P.Math.degToRad(2)
  18709. },
  18710. t.prototype.panoPathDistance = function(e) {
  18711. var t = this.model.panos;
  18712. if (!e || e.length < 2)
  18713. return 0;
  18714. for (var i = [], n = 0; n < e.length; n += 1)
  18715. i.push(t.get(e[n]).floorPosition);
  18716. return this.pointPathDistance(i)
  18717. }
  18718. ,
  18719. t.prototype.loadTileTexture = function(t) {
  18720. var e = n.load(t, function(e) {
  18721. e.wrapS = P.RepeatWrapping,
  18722. e.wrapT = P.RepeatWrapping,
  18723. e.needsUpdate = !0,
  18724. H.debug('path texture "' + t + '" is ready')
  18725. }, function() {
  18726. H.error('path texture "' + t + '" failed')
  18727. });
  18728. return e.mapping = P.UVMapping,
  18729. e
  18730. }
  18731. ,
  18732. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18733. return new l({
  18734. cameraMode: n,
  18735. position: e,
  18736. quaternion: t,
  18737. panoId: i,
  18738. orthoZoom: o,
  18739. floorVisibility: r,
  18740. thumbUrl: null,
  18741. name: null
  18742. })
  18743. }
  18744. ,
  18745. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18746. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18747. }
  18748. ,
  18749. t.prototype.setWarpDestination = function(e) {
  18750. this.warpDestHeroLoc = e
  18751. }
  18752. ,
  18753. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18754. var t = this.getHeroDescriptorByHeroIndex(e);
  18755. return null !== t && (this.setWarpDestination(t),
  18756. !0)
  18757. }
  18758. ,
  18759. t.prototype.setWarpDestinationByPano = function(e, t) {
  18760. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18761. }
  18762. ,
  18763. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18764. var i = this.model.panos.get(e);
  18765. if (i) {
  18766. t = t || new P.Quaternion;
  18767. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18768. return this.setWarpDestination(n),
  18769. !0
  18770. }
  18771. return !1
  18772. }
  18773. ,
  18774. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18775. var t = this.model.heroCount();
  18776. if (null !== this.warpDestHeroLoc && t < 1)
  18777. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18778. this.model.getHeroDescriptorByIndex(0);
  18779. var i = this.model.getHeroDescriptorByIndex(e);
  18780. if (i) {
  18781. var n = i.isPano() ? i.panoId : i.cameraMode;
  18782. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18783. }
  18784. return i
  18785. }
  18786. ,
  18787. t.prototype.getHeroDescriptorByPano = function(e) {
  18788. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18789. }
  18790. ,
  18791. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18792. var t = this.getHeroIndexFromPanoId(e);
  18793. return this.getHeroDescriptorByHeroIndex(t)
  18794. }
  18795. ,
  18796. t.prototype.getHeroIndexFromPanoId = function(e) {
  18797. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18798. var i = this.model.heroLocations[t]
  18799. , n = this.getHeroId(i);
  18800. if (n && n === e)
  18801. return t
  18802. }
  18803. return -1
  18804. }
  18805. ,
  18806. t.prototype.getHeroPano = function(e) {
  18807. if (null === e)
  18808. return H.warn("getHeroPano(): no destination"),
  18809. null;
  18810. var t = this.getHeroId(e)
  18811. , i = this.model.panos.get(t);
  18812. return void 0 === i && (i = null,
  18813. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18814. i
  18815. }
  18816. ,
  18817. t.prototype.getHeroId = function(e) {
  18818. return e.panoId
  18819. }
  18820. ,
  18821. t.prototype.setWarpDestPano = function() {
  18822. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18823. this.warpDestPano
  18824. }
  18825. ,
  18826. t.prototype.brushToWarpPano = function(e, t) {
  18827. if (this.discardPathObject(),
  18828. !this.setWarpDestPano())
  18829. return !1;
  18830. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18831. !this.warpDestPano)
  18832. return H.info("No brush"),
  18833. !1;
  18834. if (!this.player.currentPano)
  18835. return H.debug("No current pano, visibility undefined"),
  18836. !1;
  18837. if (!this.warpDestPano)
  18838. return H.info("No wPano, visibility undefined"),
  18839. !1;
  18840. if (!this.warpDestPano.isAligned())
  18841. return H.debug("Cannot brush to unaligned pano"),
  18842. !1;
  18843. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18844. , n = !0;
  18845. if (this.player.currentPano.id === this.warpDestPano.id)
  18846. H.debug("Already at destination pano");
  18847. else {
  18848. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18849. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18850. this.obj3d = new P.Object3D,
  18851. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18852. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18853. e = t) : (this.setPathHulls(this.nodes),
  18854. this.setFloorCurves(),
  18855. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  18856. this.player.currentPano.floor.add(this.obj3d);
  18857. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18858. , o = e === L.STD;
  18859. if (!n && (i || o)) {
  18860. if (r) {
  18861. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18862. this.obj3d.add(a)
  18863. }
  18864. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18865. this.obj3d.add(s)
  18866. }
  18867. this.appearSlow()
  18868. }
  18869. return this.upcomingTransType = e,
  18870. !n
  18871. }
  18872. ,
  18873. t.prototype.findShortestPath = function(e, t) {
  18874. if (!e || !t)
  18875. return null;
  18876. var i = D.warp.walkExtraPanosDistance
  18877. , n = e.id + ":" + t.id + ":" + i;
  18878. if (this.shortPaths.hasOwnProperty(n))
  18879. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18880. var r = t.id + ":" + e.id + ":" + i;
  18881. if (this.shortPaths.hasOwnProperty(r))
  18882. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18883. var o = this.model.panos.aStarSearch(e, t);
  18884. return this.model.panos.includeNodesNearPath(o, i),
  18885. this.shortPaths[n] = o ? o.slice() : null,
  18886. o
  18887. }
  18888. ,
  18889. t.prototype.makePathHulls = function(e) {
  18890. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18891. r = (t = h.get(e[0])).floor.floorIndex;
  18892. for (var u = 0; u < e.length; u += 1)
  18893. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18894. s.push(i),
  18895. l.push(t.position.clone()),
  18896. n = t.floor.floorIndex,
  18897. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18898. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18899. return a > this.longestStep && (this.longestStep = a,
  18900. H.debug("path contains " + a + " meter segment")),
  18901. {
  18902. floor: s,
  18903. camera: l,
  18904. color: c
  18905. }
  18906. }
  18907. ,
  18908. t.prototype.makeFloorCurves = function(e, t, i) {
  18909. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18910. , r = this.pointPathDistance(e) - 2 * n
  18911. , o = e.slice(0)
  18912. , a = o[1].clone().sub(o[0]);
  18913. a.y = 0,
  18914. a.normalize().multiplyScalar(n),
  18915. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18916. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18917. a.normalize().multiplyScalar(n),
  18918. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18919. var s = new P.CatmullRomCurve3(o)
  18920. , l = Math.floor(r / i);
  18921. l = 4 * Math.floor(l / 4),
  18922. l = Math.max(4, l);
  18923. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18924. h = 0,
  18925. c = u[f].distanceTo(e[0]);
  18926. for (var g = 1; g < e.length; g += 1)
  18927. p.copy(u[f]).sub(e[g]),
  18928. p.y *= 4,
  18929. p.length() < c && (h = g);
  18930. d.push(t[h])
  18931. }
  18932. return {
  18933. distance: r,
  18934. points: u,
  18935. colors: d
  18936. }
  18937. }
  18938. ,
  18939. t.prototype.makeCameraCurvePoints = function(e, t) {
  18940. var i = this.pointPathDistance(e);
  18941. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18942. }
  18943. ,
  18944. t.prototype.makeCameraCurveTangents = function(e, t) {
  18945. var i = this.pointPathDistance(e)
  18946. , n = new P.CatmullRomCurve3(e)
  18947. , r = Math.max(2, Math.floor(i / t));
  18948. r = r || 5;
  18949. for (var o = [], a = 0; a <= r; a++)
  18950. o.push(n.getTangentAt(a / r));
  18951. return o
  18952. }
  18953. ,
  18954. t.prototype.setPathHulls = function(e) {
  18955. var t = this.makePathHulls(e);
  18956. this.floorHull = t.floor,
  18957. this.cameraHull = t.camera,
  18958. this.colorHull = t.color
  18959. }
  18960. ,
  18961. t.prototype.setFloorCurves = function() {
  18962. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18963. this.floorPathDistance = e.distance,
  18964. this.floorCurvePoints = e.points,
  18965. this.floorCurveColors = e.colors
  18966. }
  18967. ,
  18968. t.prototype.setCameraCurvePoints = function() {
  18969. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18970. }
  18971. ,
  18972. t.prototype.chooseWarpPath = function(e) {
  18973. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18974. if (this.player.currentPano === this.warpDestPano || !e)
  18975. return this.warpPathPoints = null,
  18976. this.warpLength = 0,
  18977. !1;
  18978. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18979. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18980. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18981. t.multiplyScalar(.15).add(r.position),
  18982. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18983. t.y = r.position.y,
  18984. i.y = this.warpDestPano.position.y,
  18985. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18986. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18987. this.setCameraCurvePoints(),
  18988. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18989. this.warpLength = 0,
  18990. this.warpPathLengths = [0];
  18991. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  18992. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18993. var h = o.length();
  18994. o.y *= D.warp.climbEffort;
  18995. var u = o.length() / h;
  18996. if (1 < c) {
  18997. o.setY(0).normalize(),
  18998. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18999. var d = Math.min(1, o.dot(a))
  19000. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19001. u = Math.max(p, u)
  19002. }
  19003. this.warpLength += h * u,
  19004. this.warpPathLengths[c] = this.warpLength
  19005. }
  19006. return !0
  19007. }
  19008. ,
  19009. t.prototype.drawPathRibbon = function(e, t) {
  19010. this.bunnyObj.visible = D.warp.showBunny;
  19011. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  19012. a.copy(e[s]),
  19013. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19014. a.normalize(),
  19015. n.crossVectors(a, U.UP),
  19016. n.multiplyScalar(i);
  19017. var l = (new P.Vector3).copy(e[s]).add(r);
  19018. l.sub(n),
  19019. o.vertices.push(l),
  19020. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19021. o.vertices.push(l)
  19022. }
  19023. var c, h, u, d = 0;
  19024. for (s = 0; s < e.length - 1; s += 1) {
  19025. var p = 2 * s
  19026. , f = d
  19027. , g = d += e[s + 1].distanceTo(e[s])
  19028. , m = t[s]
  19029. , v = t[s + 1];
  19030. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19031. o.faces.push(c),
  19032. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19033. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19034. o.faces.push(c),
  19035. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19036. }
  19037. o.computeFaceNormals(),
  19038. o.computeVertexNormals(),
  19039. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19040. u.opacity.value = 0,
  19041. u.color.value.set(D.path.color),
  19042. new P.RawShaderMaterial({
  19043. side: P.DoubleSide,
  19044. depthWrite: !1,
  19045. transparent: !0,
  19046. vertexShader: C.ribbon.vertexShader,
  19047. fragmentShader: C.ribbon.fragmentShader,
  19048. uniforms: u,
  19049. name: "ribbonT",
  19050. opacity: 0
  19051. })) : new P.MeshBasicMaterial({
  19052. color: 16777215,
  19053. side: P.DoubleSide,
  19054. name: "ribbonOut",
  19055. vertexColors: P.VertexColors
  19056. });
  19057. var y = new P.Mesh(o,h);
  19058. return y.name = "ribbon",
  19059. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19060. y
  19061. }
  19062. ,
  19063. t.prototype.drawPathPavement = function(e) {
  19064. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19065. r.copy(e[o]),
  19066. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19067. r.normalize(),
  19068. i.crossVectors(r, U.UP),
  19069. i.multiplyScalar(this.brushPrefs.paveWidth),
  19070. (t = (new P.Vector3).copy(e[o])).sub(i),
  19071. n.vertices.push(t),
  19072. n.vertices.push((new P.Vector3).copy(e[o])),
  19073. (t = (new P.Vector3).copy(e[o])).add(i),
  19074. n.vertices.push(t);
  19075. var a, s, l;
  19076. for (o = 0; o < e.length - 1; o += 1)
  19077. a = 3 * o + 1,
  19078. l = .25 + (s = .25 * o),
  19079. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19080. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19081. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19082. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19083. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19084. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19085. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19086. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19087. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19088. color: D.path.color,
  19089. side: P.DoubleSide,
  19090. transparent: !0,
  19091. depthWrite: !1,
  19092. opacity: 0,
  19093. name: "paveT",
  19094. map: I.path
  19095. }) : new P.MeshBasicMaterial({
  19096. color: D.path.color,
  19097. side: P.DoubleSide,
  19098. transparent: !0,
  19099. depthWrite: !1,
  19100. opacity: 1,
  19101. name: "paveO",
  19102. map: I.path
  19103. });
  19104. return new P.Mesh(n,c)
  19105. }
  19106. ,
  19107. t.prototype.hintPrefs = {
  19108. rad: .18,
  19109. width: .0125,
  19110. depth: .0625,
  19111. setBack: -.04,
  19112. markRad: .25,
  19113. markInnerRad: .16
  19114. },
  19115. t.prototype.makeWaypointObj = function(e, t) {
  19116. var i = new P.Geometry
  19117. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19118. , r = this.pathHeight();
  19119. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  19120. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19121. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19122. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19123. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19124. o.map.value = e,
  19125. o.opacity.value = 0,
  19126. o.color.value.set(D.path.color);
  19127. var a = {
  19128. side: P.DoubleSide,
  19129. depthWrite: !1,
  19130. transparent: !0,
  19131. vertexShader: C.waypoint.vertexShader,
  19132. fragmentShader: C.waypoint.fragmentShader,
  19133. uniforms: o,
  19134. name: "waypoint",
  19135. opacity: 0
  19136. };
  19137. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19138. a.name = "wayPtOut");
  19139. var s = new P.RawShaderMaterial(a)
  19140. , l = new P.Mesh(i,s);
  19141. return l.name = t,
  19142. l
  19143. }
  19144. ,
  19145. t.prototype.makeStartMarker = function(e, t) {
  19146. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19147. i.y = 0,
  19148. i.normalize();
  19149. var n = Math.acos(i.x)
  19150. , r = this.makeWaypointObj(I.pathStart, "Start");
  19151. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19152. r.position.copy(e),
  19153. r
  19154. }
  19155. ,
  19156. t.prototype.makeEndMarker = function(e) {
  19157. var t = this.makeWaypointObj(I.pathEnd, "End")
  19158. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19159. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19160. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19161. t.position.copy(e),
  19162. t
  19163. }
  19164. ,
  19165. t.prototype.pathClean = function(e) {
  19166. if (e) {
  19167. for (var t in e.children)
  19168. this.pathClean(e.children[t]);
  19169. e.geometry && e.geometry.dispose(),
  19170. e.material && e.material.dispose()
  19171. }
  19172. }
  19173. ,
  19174. t.prototype.discardPathObject = function() {
  19175. if (this.obj3d) {
  19176. var e = this.obj3d.parent;
  19177. e && e.remove(this.obj3d),
  19178. this.pathClean(this.obj3d)
  19179. }
  19180. this.obj3d = null,
  19181. this.popInCpm()
  19182. }
  19183. ,
  19184. t.prototype.discardSlow = function() {
  19185. if (this.obj3d) {
  19186. if (this.player.mode !== O.PANORAMA)
  19187. return void this.discardPathObject();
  19188. for (var e, t = 0, i = function() {
  19189. this.discardPathObject()
  19190. }
  19191. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19192. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19193. t += 1,
  19194. i = null);
  19195. 0 === t && this.discardPathObject(),
  19196. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19197. }
  19198. }
  19199. ,
  19200. t.prototype.appearSlow = function() {
  19201. var e;
  19202. this.fadeOutCpm(D.path.fadeInTime);
  19203. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19204. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19205. }
  19206. ,
  19207. t.prototype.update = function() {
  19208. this.obj3d && this.obj3d.updateMatrixWorld()
  19209. }
  19210. ,
  19211. t.prototype.calcBurnsAmount = function(e) {
  19212. var n = P.Math.degToRad(D.warp.burnsAngle);
  19213. if (this.player.mode !== O.PANORAMA)
  19214. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19215. var t = this.burnsDir * n;
  19216. if (this.upcomingTransType === L.BLACK)
  19217. return t;
  19218. var i = e;
  19219. if (null === i)
  19220. return H.warn("Transition request for non-highlight"),
  19221. t;
  19222. var r = this.getHeroDescriptorByHeroIndex(i);
  19223. if (null === r)
  19224. return t;
  19225. if (!r.isPano())
  19226. return t;
  19227. function o(e) {
  19228. var t = Math.acos(Math.min(1, e.dot(l)))
  19229. , i = (new P.Vector3).crossVectors(l, e);
  19230. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19231. }
  19232. var a = this.getHeroPano(r)
  19233. , s = this.playerControls.cameras[O.PANORAMA]
  19234. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19235. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19236. if (a === this.player.currentPano)
  19237. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19238. var h = this.findShortestPath(this.player.currentPano, a);
  19239. if (null == h || h.length < 1)
  19240. return H.debug("Empty path ahead..."),
  19241. t;
  19242. var u = this.makePathHulls(h)
  19243. , d = new P.CatmullRomCurve3(u.camera)
  19244. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19245. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19246. }
  19247. ,
  19248. t.prototype.waitNextStep = function(e, t, i) {
  19249. var o = null == i ? D.warp.tourStepDelay : i;
  19250. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19251. var a = new P.Euler
  19252. , s = new P.Vector3;
  19253. H.debug("Starting wait: " + (void 0 !== t));
  19254. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19255. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19256. , c = function() {
  19257. this.endWarpState(),
  19258. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19259. t && t()
  19260. }
  19261. .bind(this)
  19262. , n = function(e, t) {
  19263. if (this.warpInterrupted)
  19264. return c(),
  19265. !0;
  19266. var i = t || 1e3 / 60;
  19267. if (D.warp.doBurns && !currentLocation.dontRot )
  19268. if (this.player.mode === O.PANORAMA) {
  19269. var n = this.playerControls.cameras[O.PANORAMA];
  19270. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19271. var r = o == 0 ? l : i * l / o;
  19272. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19273. a.y += r,
  19274. s.set(0, 0, -1),
  19275. s.applyEuler(a),
  19276. s.add(n.position),
  19277. n.controls.lookAt(s),
  19278. n.controls.lookVector.copy(s),
  19279. n.lookAt(s)
  19280. } else
  19281. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19282. }
  19283. .bind(this);
  19284. this.startWarpState(),
  19285. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19286. }
  19287. ,
  19288. t.prototype.warpToNonPano = function(e) {
  19289. if (this.discardPathObject(),
  19290. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19291. var t = function() {
  19292. e && e()
  19293. }
  19294. .bind(this);
  19295. this.player.flyToNewMode({
  19296. mode: this.warpDestHeroLoc.cameraMode,
  19297. duration: D.warp.outsideTime,
  19298. warpDest: this.warpDestHeroLoc,
  19299. callback: t,
  19300. force: !0
  19301. })
  19302. } else
  19303. H.warn("no warp destination!!!"),
  19304. e && e()
  19305. }
  19306. ,
  19307. t.prototype._resetWarpShaderParams = function(e) {
  19308. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19309. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19310. }
  19311. ,
  19312. t.prototype._clearWarpShading = function() {
  19313. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19314. this._resetWarpShaderParams(e[t]),
  19315. e[t].visible = !0;
  19316. this._resetWarpShaderParams(this.model.skybox)
  19317. }
  19318. ,
  19319. t.prototype._warpStopFlying = function() {
  19320. this.activeTransType = null,
  19321. this.placeCpm()
  19322. }
  19323. ,
  19324. t.prototype._wrapupTravelOnlyBits = function() {
  19325. this._warpStopFlying(),
  19326. this.warpPathPoints && (this.player.currentPano.exit(),
  19327. this.warpDestPano.enter(),
  19328. this.player.currentPano = this.warpDestPano),
  19329. this.player.spider.draw(),
  19330. this.placeCpm()
  19331. }
  19332. ,
  19333. t.prototype._wrapupTravel = function(e) {
  19334. this._wrapupTravelOnlyBits(),
  19335. this.warpCameraAim(e)
  19336. }
  19337. ,
  19338. t.prototype._wrapupWarpShading = function(e) {
  19339. this._clearWarpShading(),
  19340. this._wrapupTravel(e)
  19341. }
  19342. ,
  19343. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19344. t !== z.END && this._clearWarpShading(),
  19345. this._wrapupTravelOnlyBits(),
  19346. this.upcomingTransType = null,
  19347. e && e()
  19348. }
  19349. ,
  19350. t.prototype._warpCameraAim = function(e, t) {
  19351. var i = this.warpDestHeroLoc.quaternion
  19352. , n = this.playerControls.cameras[O.PANORAMA]
  19353. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19354. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19355. , a = P.Math.radToDeg(Math.acos(o))
  19356. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19357. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19358. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19359. c.y = N.constrainedTurn(c.y),
  19360. this.burnsDir = Math.sign(c.y);
  19361. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19362. , u = new P.Vector3
  19363. , d = function(e, t) {
  19364. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19365. h.y = l.y + e * c.y,
  19366. h.z = l.z + e * c.z,
  19367. u.set(0, 0, -1),
  19368. u.applyEuler(h),
  19369. u.add(n.position),
  19370. n.controls.lookAt(u),
  19371. n.controls.lookVector.copy(u),
  19372. void n.lookAt(u))
  19373. }
  19374. .bind(this);
  19375. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19376. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19377. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19378. )
  19379. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19380. void (t && t())) */
  19381. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19382. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19383. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19384. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19385. void (t && t()))
  19386. }
  19387. ,
  19388. t.prototype._warpBendAim = function(e, t, i, n) {
  19389. var r = n || 0
  19390. , o = this.playerControls.cameras[O.PANORAMA]
  19391. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19392. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19393. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19394. l.y = N.constrainedTurn(l.y);
  19395. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19396. l.x = c * Math.sign(l.x),
  19397. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19398. this.burnsDir = Math.sign(l.y),
  19399. c *= Math.sign(l.y),
  19400. l.y = c;
  19401. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19402. , u = new P.Vector3
  19403. , d = function(e, t) {
  19404. if (e < .5)
  19405. h.x = s.x + e * l.x,
  19406. h.y = s.y + e * l.y,
  19407. h.z = s.z + e * l.z;
  19408. else {
  19409. var i = (1 - e) * D.warp.softBendEnd;
  19410. h.x = a.x - i * l.x,
  19411. h.y = a.y - i * l.y,
  19412. h.z = a.z - i * l.z
  19413. }
  19414. u.set(0, 0, -1),
  19415. u.applyEuler(h),
  19416. u.add(o.position),
  19417. o.controls.lookAt(u),
  19418. o.controls.lookVector.copy(u),
  19419. o.lookAt(u)
  19420. }
  19421. .bind(this);
  19422. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19423. }
  19424. ,
  19425. t.prototype._warpStepCameraAim = function(e, t, i) {
  19426. var n = this.playerControls.cameras[O.PANORAMA]
  19427. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19428. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19429. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19430. a.y = N.constrainedTurn(a.y),
  19431. this.burnsDir = Math.sign(a.y);
  19432. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19433. , l = new P.Vector3
  19434. , c = function(e, t) {
  19435. e < .5 ? s.copy(o) : s.copy(r),
  19436. l.set(0, 0, -1),
  19437. l.applyEuler(s),
  19438. l.add(n.position),
  19439. n.controls.lookAt(l),
  19440. n.controls.lookVector.copy(l),
  19441. n.lookAt(l)
  19442. }
  19443. .bind(this);
  19444. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19445. }
  19446. ,
  19447. t.prototype.setBurnsDir = function() {
  19448. var e = this.playerControls.cameras[O.PANORAMA]
  19449. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19450. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19451. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19452. n.y = N.constrainedTurn(n.y),
  19453. this.burnsDir = Math.sign(n.y)
  19454. }
  19455. ,
  19456. t.prototype.stepWarpPath = function(firstPos, e ) {
  19457. var i = this.playerControls.cameras[O.PANORAMA];
  19458. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19459. if (!n){
  19460. return i.position.copy(this.warpDestPano.position),
  19461. !0;
  19462. }
  19463. /* if (!this.warpPathPoints)
  19464. return i.position.copy(this.warpDestPano.position),
  19465. !0;
  19466. var n = this.warpPathPoints[0] */
  19467. var r = this.warpDestPano.position;
  19468. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19469. var o = new P.Vector3;
  19470. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19471. i.position.copy(o)
  19472. } else
  19473. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19474. }
  19475. ,
  19476. t.prototype.interruptAndFastForward = function(e, t) {
  19477. this.warping && (this.warpInterrupted = !0,
  19478. this.warpInterruptionBlackoutStyle = e,
  19479. this.warpInterruptionTravelTime = t,
  19480. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19481. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19482. }
  19483. ,
  19484. t.prototype.warpCameraAim = function(e) {
  19485. var t = D.warp.minWarpTime;
  19486. if (this.upcomingTransType === L.BLACK)
  19487. t = D.warp.teleportTime;
  19488. else {
  19489. var i = this.playerControls.cameras[O.PANORAMA]
  19490. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19491. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19492. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19493. o.y = N.constrainedTurn(o.y);
  19494. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19495. t = Math.max(t, a)
  19496. }
  19497. var s = function() {
  19498. this._warpStopFlying(),
  19499. this.discardSlow(),
  19500. e && e()
  19501. }
  19502. .bind(this);
  19503. this._warpCameraAim(t, s)
  19504. }
  19505. ,
  19506. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19507. this.model.skybox.material.uniforms.blackout.value = n;
  19508. var r = F.uniform(this.model.skybox, "progress", 1)
  19509. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19510. , a = !1
  19511. , s = function() {
  19512. if (this.warpInterrupted)
  19513. return a = !0
  19514. }
  19515. .bind(this)
  19516. , l = function(e, t) {
  19517. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19518. }
  19519. .bind(this)
  19520. , c = function(e, t) {
  19521. return i && a ? (o(0),
  19522. !0) : void o(e, t)
  19523. }
  19524. .bind(this);
  19525. V.start(s, e, null, t, null, "safeHaltWatch"),
  19526. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19527. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19528. }
  19529. ,
  19530. t.prototype.warpTravel_STD = function(e) {
  19531. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19532. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19533. t += this.warpLength * D.warp.timePerMeter,
  19534. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19535. function n(e) {
  19536. var t = i;
  19537. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19538. }
  19539. var y = !1
  19540. , r = this.warpDestHeroLoc.quaternion
  19541. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19542. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19543. , a = A.dot(o)
  19544. , C = P.Math.radToDeg(Math.acos(a))
  19545. , s = function() {
  19546. return m.lookAt(g, l, U.UP),
  19547. u.setFromRotationMatrix(m, D.warp.eOrder),
  19548. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19549. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19550. N.constrainedTurn(v.y)
  19551. }
  19552. .bind(this)
  19553. , I = function(e, t) {
  19554. if (this.warpInterrupted)
  19555. return y = !0
  19556. }
  19557. .bind(this)
  19558. , E = function(e, t) {
  19559. return y || !this.warpPathPoints ? (k.blur(0),
  19560. !0) : void k.blur(e)
  19561. }
  19562. .bind(this)
  19563. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19564. , b = function(e, t) {
  19565. return y || !this.warpPathPoints ? (_(0),
  19566. !0) : void _(e, t)
  19567. }
  19568. .bind(this)
  19569. , w = function(e, t) {
  19570. if (!this.warpPathPoints)
  19571. return h.position.copy(this.warpDestPano.position),
  19572. !0;
  19573. if (y)
  19574. return !0;
  19575. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19576. h.position.copy(i),
  19577. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19578. }
  19579. .bind(this)
  19580. , T = function(e, t) {
  19581. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19582. !0)
  19583. }
  19584. .bind(this)
  19585. , x = function(e, t) {
  19586. if (y)
  19587. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19588. !0;
  19589. if (!this.warpPathPoints)
  19590. return !0;
  19591. var i = this.warpLength * e
  19592. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19593. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19594. D.warp.matchCam && (n *= 1 - r),
  19595. m.lookAt(g, l, U.UP),
  19596. u.setFromRotationMatrix(m, D.warp.eOrder),
  19597. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19598. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19599. v.y = N.constrainedTurn(v.y),
  19600. u.x = p.x + n * v.x,
  19601. u.y = p.y + n * v.y,
  19602. u.z = p.z + n * v.z,
  19603. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19604. v.y = N.constrainedTurn(v.y);
  19605. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19606. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19607. f.x = f.x + v.x * D.warp.turnFriction,
  19608. f.y = f.y + v.y * D.warp.turnFriction,
  19609. f.z = f.z + v.z * D.warp.turnFriction,
  19610. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19611. var a = l.clone().sub(g).normalize();
  19612. if (C < D.warp.maxAimRotation && 0 < r) {
  19613. var s = 1 - r;
  19614. a.x = a.x * s + r * A.x,
  19615. a.y = a.y * s + r * A.y,
  19616. a.z = a.z * s + r * A.z,
  19617. a.normalize()
  19618. }
  19619. this.bunnyObj.position.copy(h.position).add(a),
  19620. d.set(0, 0, -1).applyEuler(f).normalize(),
  19621. d.multiplyScalar(8),
  19622. d.add(h.position),
  19623. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19624. h.controls.lookVector.copy(d),
  19625. h.lookAt(d))
  19626. }
  19627. .bind(this)
  19628. , S = function() {
  19629. y ? (this.discardSlow(),
  19630. this.upcomingTransType = L.BLACK,
  19631. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19632. }
  19633. .bind(this);
  19634. T(0);
  19635. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19636. , R = M / (t += M);
  19637. this.warpCommonParameters(t, R, !0, z.NONE),
  19638. V.start(I, t, null, 0, null, "_haltWatcher"),
  19639. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19640. V.start(E, t, null, R, n, "blurring")),
  19641. V.start(b, t, null, R, n, "modelAlpha"),
  19642. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19643. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19644. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19645. }
  19646. ,
  19647. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19648. var r = e || 0;
  19649. null != t || (t = D.warp.teleportTime),
  19650. this.warpCommonParameters(t, r, !1, i),
  19651. this.model.chunks.forEach(function(e) {
  19652. e.material.uniforms.blackout.value = i
  19653. }),
  19654. this._warpBendAim(null, t, null, r);
  19655. //add
  19656. var done = ()=>{
  19657. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19658. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19659. //Overlay.updateVisibles([this.player.currentPano])
  19660. }
  19661. var o = function() {
  19662. this.wrapupWarpShadingOnly(n, i)
  19663. done()
  19664. }
  19665. .bind(this);
  19666. var firstPos = this.player.position.clone()//add
  19667. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19668. }
  19669. ,
  19670. t.prototype.flightStepWalk = (a = new P.Vector3,
  19671. s = new P.Vector3,
  19672. function(e, t, i) {
  19673. if (this.warpInterrupted)
  19674. i && i();
  19675. else if (this.activeTransType !== L.WALK)
  19676. this._clearWarpShading(),
  19677. this._warpStopFlying(),
  19678. this.player.spider.draw(),
  19679. this.placeCpm(),
  19680. i && i();
  19681. else if (this.player.currentPano !== e) {
  19682. var n = {
  19683. pano: e,
  19684. lookAtPoint: t,
  19685. duration: null,
  19686. maxDistanceOverride: D.warp.walkMaxDist,
  19687. skipWarpingCheck: !1,
  19688. constantMoveSpeed: !0
  19689. };
  19690. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19691. n.zoomLevel = this.warpDestHeroLoc.zoom
  19692. }
  19693. n.duration = function(e, t) {
  19694. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19695. s.copy(U.FORWARD),
  19696. this.player.getDirection(s),
  19697. a.copy(t).sub(e.position).normalize();
  19698. var n = a.dot(s)
  19699. , r = Math.acos(n)
  19700. , o = r / i;
  19701. .001 < o && (i *= o / .001, //-----这是什么????
  19702. r < 1 && (i *= 1.2))
  19703. return i / DATA.tourWalkSpeed * 100
  19704. }
  19705. .call(this, e, t),
  19706. this.player.nonInterruptingFlyToPano(n, i)
  19707. } else
  19708. i && i()
  19709. }
  19710. ),
  19711. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19712. return this.flightStepWalk.bind(this, e, t, i)
  19713. }
  19714. ,
  19715. t.prototype.warpTravel_WALK = (f = [],
  19716. function(e) {
  19717. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19718. var o = this.nodes[r]
  19719. , a = t.get(o);
  19720. this.nodes.length,
  19721. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19722. i && n || (f.push(o),
  19723. i = a)
  19724. }
  19725. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19726. var s = f.length
  19727. , l = t.get(f[s - 1])
  19728. , c = new Array(s + 1);
  19729. c[c.length - 1] = function() {
  19730. e && e()
  19731. }
  19732. .bind(this);
  19733. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19734. var d = f[h];
  19735. l = t.get(d);
  19736. var p = new P.Vector3;
  19737. this.getLookAtForWalkingTourNode(f, h, p),
  19738. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19739. h--
  19740. }
  19741. c[0]()
  19742. }
  19743. ),
  19744. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19745. h = new P.Vector3,
  19746. u = new P.Vector3,
  19747. d = new P.Vector3,
  19748. p = new P.Vector3,
  19749. function(e, t, i) {
  19750. var n = e.length;
  19751. if (n <= t)
  19752. return !1;
  19753. var r = 1
  19754. , o = 1;
  19755. h.set(0, 0, 0),
  19756. p.set(0, 0, 0);
  19757. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19758. if (a = this.player.model.panos.get(e[s]),
  19759. this.getOrientationForWalkingTourNode(e, s, u),
  19760. s === t && c.copy(u),
  19761. d.copy(u),
  19762. t < s) {
  19763. var l = d.dot(c) < .65;
  19764. r *= l ? .2 : .75,
  19765. o *= l ? .2 : .4
  19766. }
  19767. u.multiplyScalar(r),
  19768. h.add(u),
  19769. p.lerp(a.position, o)
  19770. }
  19771. return h.normalize(),
  19772. i.copy(p),
  19773. i.add(h),
  19774. !0
  19775. }
  19776. ),
  19777. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19778. var n = e.length;
  19779. if (n <= t)
  19780. return !1;
  19781. if (t === n - 1)
  19782. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19783. else {
  19784. var r = this.player.model.panos.get(e[t])
  19785. , o = this.player.model.panos.get(e[t + 1]);
  19786. i.copy(o.position).sub(r.position)
  19787. }
  19788. return i.normalize(),
  19789. !0
  19790. }
  19791. ,
  19792. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19793. if (this.activeTransType = this.upcomingTransType,
  19794. this.lastTransType = this.activeTransType,
  19795. this.upcomingTransType = null,
  19796. e)
  19797. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19798. this._clearWarpShading(),
  19799. this._warpStopFlying(),
  19800. this.player.spider.draw(),
  19801. this.placeCpm(),
  19802. n && n()
  19803. }
  19804. .bind(this)) : this.warpTravel_STD(n);
  19805. else {
  19806. var r = function() {
  19807. this._wrapupTravel(n)
  19808. }
  19809. .bind(this)
  19810. , o = {
  19811. pano: this.warpDestPano,
  19812. lookAtPoint: null,
  19813. duration: null,
  19814. maxDistanceOverride: null,
  19815. skipWarpingCheck: !1
  19816. };
  19817. this.player.flyToPano(o, r)
  19818. }
  19819. }
  19820. ,
  19821. t.prototype.startWarpState = function() {
  19822. this.warping = !0,
  19823. this.warpInterrupted = !1,
  19824. this.warpInterruptionBlackoutStyle = null,
  19825. this.warpInterruptionTravelTime = null
  19826. }
  19827. ,
  19828. t.prototype.endWarpState = function() {
  19829. this.warping = !1
  19830. }
  19831. ,
  19832. t.prototype.warpToPano = function(e, t, i, n) {
  19833. if (this.warping)
  19834. H.warn("Cannot warp when already warping");
  19835. else {
  19836. if (this.upcomingTransType = e,
  19837. this.activeTransType = null,
  19838. !this.setWarpDestPano())
  19839. return this.upcomingTransType = null,
  19840. void this.warpToNonPano(n);
  19841. if (this.player.mode !== O.PANORAMA)
  19842. return this.upcomingTransType = null,
  19843. this.discardSlow(),
  19844. void this.player.flyToNewMode({
  19845. mode: O.PANORAMA,
  19846. pano: this.warpDestPano,
  19847. duration: D.warp.outsideTime,
  19848. warpDest: this.warpDestHeroLoc,
  19849. callback: n,
  19850. force: !0
  19851. });
  19852. if (!this.warpDestPano)
  19853. return H.warn("no warp destination, callback dropped"),
  19854. void (this.upcomingTransType = null);
  19855. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  19856. , o = this.chooseWarpPath(r);
  19857. if (o && this.upcomingTransType !== L.WALK) {
  19858. var a = function() {
  19859. this.waitingToWarp = !1,
  19860. this.warpToPano(e, t, i, n)
  19861. }
  19862. .bind(this);
  19863. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19864. return void (this.waitingToWarp = !0)
  19865. }
  19866. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19867. this.player.currentPano = this.warpDestPano,
  19868. this.placeCpm(),
  19869. this.fadeOutCpm(D.path.fadeOutTime),
  19870. this.player.spider.draw()),
  19871. H.debug("Warping to pano ", this.warpDestPano.position),
  19872. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19873. this.startWarpState();
  19874. var s = function() {
  19875. this.endWarpState(),
  19876. n && n()
  19877. }
  19878. .bind(this);
  19879. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19880. }
  19881. }
  19882. ,
  19883. v.exports = t
  19884. }
  19885. ).call(this, "/js/objects/ShowPath.js")
  19886. }
  19887. , {
  19888. "../constants": 8,
  19889. "../effects": 16,
  19890. "../enum/BlackoutStyle": 18,
  19891. "../enum/ModelManagerEvents": 33,
  19892. "../enum/PlayerEvents": 40,
  19893. "../enum/RenderOrder": 42,
  19894. "../enum/Vectors": 50,
  19895. "../enum/Viewmode": 51,
  19896. "../enum/WarpStyle": 52,
  19897. "../gui/gui": 65,
  19898. "../model/ModelManager": 140,
  19899. "../objects/Snapshot": 153,
  19900. "../settings": 166,
  19901. "../shaders": 167,
  19902. "../util/easing": 186,
  19903. "../util/lerp": 188,
  19904. "../util/logger": 189,
  19905. "../util/math": 190,
  19906. "../util/texture": 194,
  19907. "../util/transitions": 195,
  19908. three: 217
  19909. }],
  19910. 152: [function(e, t, i) {
  19911. "use strict";
  19912. function n() {
  19913. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19914. , t = new r.RawShaderMaterial({
  19915. fragmentShader: o.skysphere.fragmentShader,
  19916. vertexShader: o.skysphere.vertexShader,
  19917. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19918. side: r.BackSide,
  19919. name: "skysphere"
  19920. });
  19921. t.uniforms.radius.value = e.parameters.radius,
  19922. r.Mesh.call(this, e, t)
  19923. }
  19924. var r = e("three")
  19925. , o = e("../shaders")
  19926. , a = e("../settings");
  19927. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19928. t.exports = n
  19929. }
  19930. , {
  19931. "../settings": 166,
  19932. "../shaders": 167,
  19933. three: 217
  19934. }],
  19935. 153: [function(r, o, e) {
  19936. (function(e) {
  19937. "use strict";
  19938. function t(e) {
  19939. n.call(this, e),
  19940. this.sid = e.sid,
  19941. this.panoId = e.panoId,
  19942. this.orthoZoom = e.orthoZoom,
  19943. this.floorVisibility = e.floorVisibility,
  19944. this.thumbUrl = e.thumbUrl,
  19945. this.name = e.name,
  19946. this.zoom = e.zoom
  19947. }
  19948. var i = (r("three"),
  19949. r("../util/logger"))
  19950. , n = (r("../settings"),
  19951. r("../enum/Viewmode"),
  19952. r("../util/common"),
  19953. r("../util/transitions"),
  19954. r("../util/lerp"),
  19955. r("../util/ajax"),
  19956. r("../util/texture"),
  19957. r("./View"));
  19958. r("events").EventEmitter,
  19959. new i(e),
  19960. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19961. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19962. }
  19963. ,
  19964. o.exports = t
  19965. }
  19966. ).call(this, "/js/objects/Snapshot.js")
  19967. }
  19968. , {
  19969. "../enum/Viewmode": 51,
  19970. "../settings": 166,
  19971. "../util/ajax": 181,
  19972. "../util/common": 185,
  19973. "../util/lerp": 188,
  19974. "../util/logger": 189,
  19975. "../util/texture": 194,
  19976. "../util/transitions": 195,
  19977. "./View": 154,
  19978. events: 202,
  19979. three: 217
  19980. }],
  19981. 154: [function(o, a, e) {
  19982. (function(e) {
  19983. "use strict";
  19984. function t(e) {
  19985. e = e || {},
  19986. this.position = new i.Vector3,
  19987. this.quaternion = new i.Quaternion,
  19988. this.update(e)
  19989. }
  19990. var i = o("three")
  19991. , n = o("../util/logger")
  19992. , r = (o("../settings"),
  19993. o("../enum/Viewmode"),
  19994. o("../util/common"),
  19995. o("../util/transitions"),
  19996. o("../util/lerp"),
  19997. o("../util/ajax"),
  19998. o("../util/texture"),
  19999. o("events").EventEmitter);
  20000. new n(e),
  20001. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20002. return !!this.cameraMode
  20003. }
  20004. ,
  20005. t.prototype.update = function(e) {
  20006. return this.cameraMode = e.cameraMode || this.cameraMode,
  20007. this.pano = e.pano || this.pano,
  20008. e.position && this.position.copy(e.position),
  20009. e.quaternion && this.quaternion.copy(e.quaternion),
  20010. this
  20011. }
  20012. ,
  20013. a.exports = t
  20014. }
  20015. ).call(this, "/js/objects/View.js")
  20016. }
  20017. , {
  20018. "../enum/Viewmode": 51,
  20019. "../settings": 166,
  20020. "../util/ajax": 181,
  20021. "../util/common": 185,
  20022. "../util/lerp": 188,
  20023. "../util/logger": 189,
  20024. "../util/texture": 194,
  20025. "../util/transitions": 195,
  20026. events: 202,
  20027. three: 217
  20028. }],
  20029. 155: [function(J, ee, e) {
  20030. (function(e) {
  20031. "use strict";
  20032. function t(e) {
  20033. this.currentPano = null,
  20034. this.nextPano = null,
  20035. this.camera = null,
  20036. this.paused = !1,
  20037. this.flying = !1,
  20038. this.sceneIntersectionPlane = null,
  20039. this.target = new B.Vector3,
  20040. this.mouse = new B.Vector3(1.1,1.1,.5),
  20041. this.mouseAtMouseDown = new B.Vector2,
  20042. this.mouseCouldBeClickToMove = !1,
  20043. this.mouseLastMoveTime = Date.now(),
  20044. this.mouseDown = !1,
  20045. this.mouseDownTimer = null,
  20046. this.couldBeLongTap = !1,
  20047. this.containsMouse = !0,
  20048. this.isTouchEvent = !1,
  20049. this.isPanoHover = !1,
  20050. this.reticule = new n(this),
  20051. this.panoMarkers = [],
  20052. this.spider = new s(this),
  20053. this.quaternion = new B.Quaternion,
  20054. this.position = new B.Vector3(15,10,15),
  20055. this.previousState = null,
  20056. this.lastInsideView = new o,
  20057. this.last360View = new o,
  20058. this.raycaster = new B.Raycaster,
  20059. this.intersect = null,
  20060. this.lastChangeTime = Date.now(),
  20061. this.history = new h,
  20062. this.cameraControls = null,
  20063. this.path = null,
  20064. this.model = null,
  20065. this.domElement = null,
  20066. this.cachedPanoCandidates = null,
  20067. this.basePanoSize = 0,
  20068. this.standardPanoSize = 0,
  20069. this.highPanoSize = 0,
  20070. this.ultraHighPanoSize = 0,
  20071. this.zoomLevel = 1,
  20072. this.zooming = 0,
  20073. this.zoomSpeed = .5,
  20074. this.scrollZoomSpeed = .06,
  20075. this.zoomSpeedAdjust = .05,
  20076. this.defaultZoomIncrement = .2,
  20077. this.baseFov = k.insideFOV,
  20078. this.zoomFov = this.baseFov,
  20079. this.zoomEnabled = !0,
  20080. this.preRenderingEnabled = !1,
  20081. this.setupCustomProperties(e),
  20082. this.zoomStats = new v,
  20083. this.modeTran = 'dollhouse-panorama'
  20084. this.currentCursor = '';
  20085. window.player = this
  20086. }
  20087. var B = J("three")
  20088. , i = J("./util/logger")
  20089. , n = J("./objects/Reticule")
  20090. , a = J("./objects/Panorama")
  20091. , r = J("./objects/ShowPath")
  20092. , o = J("./objects/View")
  20093. , s = (J("./objects/Snapshot"),
  20094. J("./objects/NSpider"))
  20095. , V = J("./enum/Viewmode")
  20096. , T = (J("./enum/TagStates"),
  20097. J("./enum/Vectors"))
  20098. , l = J("./enum/Keys")
  20099. , k = (J("./enum/AlignmentType"),
  20100. J("./settings"))
  20101. , x = J("./util/common")
  20102. , U = (J("./util/browser"),
  20103. J("./util/math"))
  20104. , H = J("./util/lerp")
  20105. , z = J("./util/easing")
  20106. , G = J("./util/transitions")
  20107. , c = J("events").EventEmitter
  20108. , h = (J("./shaders"),
  20109. J("./util/history"))
  20110. , S = (J("./util/camera"),
  20111. J("./model/ModelManager"),
  20112. J("./enum/PathDiscardMode"))
  20113. , M = J("./enum/PathDisplayMode")
  20114. , W = J("./enum/PlayerEvents")
  20115. , u = J("./enum/ControlEvents")
  20116. , d = J("./enum/ModelManagerEvents")
  20117. , R = J("./enum/WarpStyle")
  20118. , P = J("./enum/BlackoutStyle")
  20119. , p = J("./exception/BasicException")
  20120. , f = J("./enum/PanoSizeClass")
  20121. , g = (J("./tile/TileDownloader"),
  20122. J("./tile/TilePrioritizer"))
  20123. , m = (J("./enum/PanoramaEvents"),
  20124. J("./enum/ZoomEvents"))
  20125. , v = J("./util/ZoomStats")
  20126. , y = J("./constants")
  20127. , j = J("./util/common")
  20128. , A = J("./util/cameraLight")
  20129. //, C = J("hot")
  20130. , Y = new i(e)
  20131. , q = Object.freeze({
  20132. FlyToPano: G.getUniqueId(),
  20133. FlyToNewMode: G.getUniqueId(),
  20134. FlyToSameMode: G.getUniqueId(),
  20135. FlyToViewFloor: G.getUniqueId(),
  20136. LookTransition: G.getUniqueId(),
  20137. ZoomTransition: G.getUniqueId()
  20138. });
  20139. function I(e) {
  20140. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20141. o[r] = n.charCodeAt(r);
  20142. return new Blob([o],{
  20143. type: i
  20144. })
  20145. }
  20146. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20147. this.modelManager = e.modelManager,
  20148. this.tileDownloader = e.tileDownloader,
  20149. this.panoRenderer = e.panoRenderer,
  20150. this.qualityManager = e.qualityManager,
  20151. this.domElement = e.container,
  20152. this.camera = e.camera,
  20153. this.tagManager = e.tagManager,
  20154. this.cameraControls = e.controls,
  20155. this.path = new r(e.director,this,e.controls),
  20156. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20157. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20158. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20159. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20160. this.tileDownloader.processPriorityQueue = !1,
  20161. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20162. this.bindEvents(e.container),
  20163. this.updateModel()
  20164. }
  20165. ,
  20166. t.prototype.screenShot = function(i) {
  20167. if (!this.flying && !this.flyingToTag) {
  20168. var n = this.sceneRenderer;
  20169. n.updateScreenSize(i)
  20170. this.model.panos.forEach(e=>{
  20171. if(e.marker){
  20172. e.marker.forceHide = e.marker.visible
  20173. e.marker.visible = !1;
  20174. }
  20175. })
  20176. /* for (var e in this.model.hots)
  20177. this.model.hots[e].mesh.visible = !1; */
  20178. player.model.hotGroup.visible = false
  20179. this.reticule.visible = !1,
  20180. this.reticule.forceUnvisible = !0,
  20181. this.path.currentPanoMarker.mesh.visible = !1,
  20182. setTimeout(function() {
  20183. n.renderer.clear(!0, !0, !0),
  20184. n.renderer.render(n.scene, n.camera);
  20185. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20186. i.f && i.f(e)
  20187. n.updateScreenSize({
  20188. resize: !0
  20189. })
  20190. this.reticule.visible = !0
  20191. player.model.hotGroup.visible = true
  20192. this.model.panos.forEach(e=>{
  20193. e.marker && (e.marker.visible = e.marker.forceHide);
  20194. })
  20195. this.path.currentPanoMarker.mesh.visible = !0,
  20196. n.renderer.render(n.scene, n.camera)
  20197. }
  20198. .bind(this), 30)
  20199. }
  20200. }
  20201. ;
  20202. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20203. t.prototype.getWrapShot = function() {
  20204. var i = this.getSnapAngleInfo()
  20205. , n = ",{\r\t" + i
  20206. , r = arguments[0];
  20207. this.screenShot({
  20208. width: g_snapShotWidth,
  20209. height: g_snapShotHeight,
  20210. type: "image/jpeg",
  20211. f: function(e) {
  20212. if (r && r.__callback)
  20213. return r.__callback(e, i);
  20214. var t = new Image;
  20215. t.src = e,
  20216. t.onload = function() {
  20217. var e = function(r, i) {
  20218. function n(e, t) {
  20219. var i = o || r
  20220. , n = document.createElement("canvas");
  20221. n.width = i.width,
  20222. n.height = i.height,
  20223. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20224. o = Q(e, n, t)
  20225. }
  20226. function e() {
  20227. var e = o || r
  20228. , t = I(e.src);
  20229. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20230. t = I(e.src)),
  20231. (o = o || new Image).base64Src = e.src,
  20232. o.src = window.URL.createObjectURL(t)
  20233. }
  20234. var o, t = Math.max(r.width, r.height);
  20235. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20236. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20237. e())),
  20238. o || r
  20239. }(this, {
  20240. maxSize: g_snapShotWidth,
  20241. oldType: "jpeg"
  20242. });
  20243. e.src.replace(function(e) {
  20244. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20245. }("image/jpeg"), "image/octet-stream");
  20246. var t = "snap" + (new Date).getTime();
  20247. !function(e, t) {
  20248. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20249. i.href = e,
  20250. i.download = t;
  20251. var n = document.createEvent("MouseEvents");
  20252. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20253. i.dispatchEvent(n)
  20254. }(e.src, t + ".jpg"),
  20255. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20256. n += '\r\t"sid":"' + t + '",',
  20257. n += '\r\t"name":"' + t + '"\r}',
  20258. logData(n)
  20259. }
  20260. }
  20261. })
  20262. }
  20263. /* ,
  20264. t.prototype.getSnapAngleInfo = function() {
  20265. var e = {}
  20266. , t = '"metadata":{'
  20267. , i = this.camera.quaternion.clone();
  20268. switch (this.mode) {
  20269. case "panorama":
  20270. e.scan_id = this.currentPano.id,
  20271. t += '"scan_id":"' + this.currentPano.id + '",';
  20272. break;
  20273. case "floorplan":
  20274. e.camera_mode = 1,
  20275. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20276. t += '"camera_mode":1,',
  20277. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20278. break;
  20279. case "dollhouse":
  20280. e.camera_mode = 2,
  20281. t += '"camera_mode":2,'
  20282. }
  20283. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20284. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20285. n.x *= -1,
  20286. n.w *= -1,
  20287. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20288. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20289. e.zoom = this.zoomLevel,
  20290. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20291. }
  20292. , */
  20293. t.prototype.getSnapAngleInfo = function(){
  20294. var info = {};
  20295. var str = '"metadata":{';
  20296. var q = this.camera.quaternion.clone();
  20297. switch (this.mode) {
  20298. case "panorama":
  20299. info.scan_id = this.currentPano.id;
  20300. str += ('"scan_id":"'+this.currentPano.id+'",');
  20301. break;
  20302. case "floorplan":
  20303. info.camera_mode = 1;
  20304. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20305. q.multiply(this.camera.quaternion);
  20306. str += ('"camera_mode":1,');
  20307. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20308. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20309. break;
  20310. case "dollhouse":
  20311. info.camera_mode = 2;
  20312. str += ('"camera_mode":2,');
  20313. break;
  20314. }
  20315. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20316. //console.log(info.camera_position)
  20317. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20318. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20319. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20320. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20321. out.x *= -1;
  20322. out.w *= -1;
  20323. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20324. }else{
  20325. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20326. } */
  20327. info.zoom = this.zoomLevel;
  20328. //console.log(info.camera_quaternion)
  20329. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20330. // fyz 扩展编辑页面, 加上导览点缩放值
  20331. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20332. console.log(str)
  20333. return str;
  20334. }
  20335. //------end
  20336. ,
  20337. t.prototype.setupCustomProperties = function(e) {
  20338. var i = e || V.PANORAMA;
  20339. Object.defineProperty(this, "mode", {
  20340. get: function() {
  20341. return i
  20342. },
  20343. set: function(e) {
  20344. var t = i;
  20345. i = e,
  20346. this.onModeUpdated(t, i)
  20347. }
  20348. })
  20349. }
  20350. ,
  20351. t.prototype.isInMode = function() {
  20352. for (var e = 0; e < arguments.length; e++)
  20353. if (this.mode === arguments[e])
  20354. return !0;
  20355. return !1
  20356. }
  20357. ,
  20358. t.prototype.isOutsideMode = function(e) {
  20359. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20360. }
  20361. ,
  20362. t.prototype.is360View = function(e, t) {
  20363. return e === V.PANORAMA && t && !t.isAligned()
  20364. }
  20365. ,
  20366. t.prototype.setScene = function(e) {
  20367. this.sceneIntersectionPlane = e.plane,
  20368. this.path.setScene(e),
  20369. this.moveReticuleToScene(e)
  20370. }
  20371. ,
  20372. t.prototype.moveReticuleToScene = function(e) {
  20373. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20374. e.add(this.reticule)
  20375. }
  20376. ,
  20377. t.prototype.updateModel = function() {
  20378. function n(e) {
  20379. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20380. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20381. , n = t.position.y + (e - i.target.y)
  20382. , r = k.showFloorDuration + k.showFloorDelay;
  20383. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20384. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20385. }
  20386. this.model = this.modelManager.getActiveModel(),
  20387. this.model.on("floor.changed", function(e, t, i) {
  20388. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20389. }
  20390. .bind(this)),
  20391. this.model.on("allfloors.toggled", function(e, t) {
  20392. if (this.mode === V.DOLLHOUSE) {
  20393. var i = e ? this.model.center.y : i = t.center.y;
  20394. n.call(this, i)
  20395. }
  20396. }
  20397. .bind(this)),
  20398. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20399. var t = this;
  20400. this.model.panos.list.forEach(function(e) {
  20401. e.vrMarker.addEventListener("click", function() {
  20402. t.flyToPano({
  20403. pano: e
  20404. })
  20405. })
  20406. })
  20407. }
  20408. ,
  20409. t.prototype.updateModelDependentData = function() {
  20410. this.cameraControls.setModelForControls(this.model),
  20411. this.getPanoMarkersFromModel(this.model)
  20412. }
  20413. ,
  20414. t.prototype.onModelChanged = function() {
  20415. this.updateModel(),
  20416. this.updateModelDependentData()
  20417. }
  20418. ,
  20419. t.prototype.getPanoMarkersFromModel = function(e) {
  20420. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20421. return t.marker ? e.concat(t.marker) : e
  20422. }, [])
  20423. }
  20424. ,
  20425. t.prototype.handleControlMove = function(e) {
  20426. this.emit(W.Move, e)
  20427. }
  20428. ,
  20429. t.prototype.handleControlInputStart = function(e) {
  20430. this.emit(W.InputStart, e)
  20431. }
  20432. ,
  20433. t.prototype.onModeUpdated = function(e, t) {
  20434. this.cameraControls.activateControls(t),
  20435. this.emit(W.ModeChanged, e, t)
  20436. }
  20437. ,
  20438. t.prototype.isWarping = function() {
  20439. return this.path.warping
  20440. }
  20441. ,
  20442. t.prototype.isWaitingToWarp = function() {
  20443. return this.path.waitingToWarp
  20444. }
  20445. ,
  20446. t.prototype.getLabelScaleFactor = function() {
  20447. if (this.isOutsideMode()) {
  20448. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20449. }
  20450. return .5
  20451. }
  20452. ,
  20453. t.prototype.bindEvents = function(e) {
  20454. e !== document && e.setAttribute("tabindex", -1),
  20455. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20456. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20457. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20458. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20459. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20460. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20461. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20462. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20463. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20464. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20465. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20466. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20467. document.addEventListener("pointerup", ()=>{//add
  20468. window.transformControls && transformControls.onPointerUp()
  20469. }),
  20470. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20471. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20472. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20473. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20474. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20475. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20476. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20477. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20478. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20479. window.getSeft && getSeft(this)
  20480. }
  20481. ,
  20482. t.prototype.onMouseDown = function(e) {
  20483. e.currentTarget !== document && e.currentTarget.focus(),
  20484. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20485. this.updateIntersect())
  20486. }
  20487. ,
  20488. t.prototype.onMouseMove = function(e) {
  20489. this.isTouchEvent = !1,
  20490. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20491. }
  20492. ,
  20493. t.prototype.onMouseOver = function(e) {
  20494. this.containsMouse = !0,
  20495. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20496. }
  20497. ,
  20498. t.prototype.onMouseOut = function(e) {
  20499. this.containsMouse = !1
  20500. }
  20501. ,
  20502. t.prototype.onMouseUp = function(e) {
  20503. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20504. }
  20505. ,
  20506. t.prototype.onTouchStart = function(e) {
  20507. if (e.currentTarget !== document && e.currentTarget.focus(),
  20508. !this.mouseDown) {
  20509. this.couldBeLongTap = !0;
  20510. var t = x.average(e.changedTouches, "clientX")
  20511. , i = x.average(e.changedTouches, "clientY");
  20512. this.handleInputStart.call(this, t, i, !0),
  20513. this.mouseDownTimer = setTimeout(function() {
  20514. this.updateIntersect(),
  20515. this.handleInputEnd.call(this, t, i, !0)
  20516. }
  20517. .bind(this), k.input.longTapThreshold)
  20518. }
  20519. }
  20520. ,
  20521. t.prototype.onTouchMove = function(e) {
  20522. var t = x.average(e.changedTouches, "clientX")
  20523. , i = x.average(e.changedTouches, "clientY");
  20524. this.handleInputMove.call(this, t, i, !0)
  20525. }
  20526. ,
  20527. t.prototype.onTouchEnd = function(e) {
  20528. if (clearTimeout(this.mouseDownTimer),
  20529. this.mouseDown) {
  20530. this.couldBeLongTap = !1,
  20531. this.updateIntersect();
  20532. var t = x.average(e.changedTouches, "clientX")
  20533. , i = x.average(e.changedTouches, "clientY");
  20534. this.handleInputEnd.call(this, t, i, !0)
  20535. }
  20536. }
  20537. ,
  20538. t.prototype.onPointerDown = function(e) {
  20539. return e.currentTarget !== document && e.currentTarget.focus(),
  20540. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20541. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20542. void (this.mouseDownTimer = setTimeout(function() {
  20543. this.updateIntersect(),
  20544. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20545. }
  20546. .bind(this), k.input.longTapThreshold)))
  20547. }
  20548. ,
  20549. t.prototype.onPointerMove = function(e) {
  20550. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20551. }
  20552. ,
  20553. t.prototype.onPointerUp = function(e) {
  20554. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20555. this.couldBeLongTap = !1,
  20556. this.updateIntersect(),
  20557. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20558. }
  20559. ,
  20560. t.prototype.onPointerOut = function(e) {
  20561. this.mouseDown = !1
  20562. }
  20563. ,
  20564. t.prototype.onPointerCancel = function(e) {
  20565. this.mouseDown = !1
  20566. }
  20567. ,
  20568. t.prototype.onKeyDown = function(e) {
  20569. var t = function() {
  20570. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20571. }
  20572. .bind(this)
  20573. , i = e.which;
  20574. switch (i) {
  20575. case l.F:
  20576. t(),
  20577. this.changeFloor(-1);
  20578. break;
  20579. case l.R:
  20580. t(),
  20581. this.changeFloor(1)
  20582. }
  20583. if (this.mode === V.PANORAMA)
  20584. switch (i) {
  20585. case l.UPARROW:
  20586. case l.W:
  20587. this.flyLocalDirection(T.FORWARD.clone());
  20588. break;
  20589. case l.DOWNARROW:
  20590. case l.S:
  20591. this.flyLocalDirection(T.BACK.clone());
  20592. break;
  20593. case l.A:
  20594. this.flyLocalDirection(T.LEFT.clone());
  20595. break;
  20596. case l.D:
  20597. this.flyLocalDirection(T.RIGHT.clone())
  20598. }
  20599. }
  20600. ,
  20601. t.prototype.handleScrollPinchZoom = function(e) {
  20602. var t = e
  20603. , i = this.zoomLevel;
  20604. this.zoomBy(t),
  20605. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20606. }
  20607. ,
  20608. t.prototype.handleControlPinch = function(e) {
  20609. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20610. }
  20611. ,
  20612. t.prototype.handleControlScroll = function(e) {
  20613. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20614. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20615. }
  20616. ,
  20617. t.prototype.handleInputStart = function(e, t, i) {
  20618. var n = this.handelPadding(e, t);
  20619. e = n.x,
  20620. t = n.y,
  20621. this.isTouchEvent = i,
  20622. U.convertScreenPositionToNDC(e, t, this.mouse),
  20623. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20624. this.mouseCouldBeClickToMove = !0,
  20625. this.mouseDown = !0
  20626. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20627. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20628. window.transformControls && transformControls.onPointerDown()
  20629. }
  20630. ,
  20631. t.prototype.handelPadding = function(e, t) {
  20632. return this.pad || (this.pad = {
  20633. x: dom.getOffset("left", $("#player")[0]),
  20634. y: dom.getOffset("top", $("#player")[0])
  20635. }),
  20636. {
  20637. x: e - this.pad.x,
  20638. y: t - this.pad.y
  20639. }
  20640. }
  20641. ,
  20642. t.prototype.handleInputMove = function(e, t, i) {
  20643. var n = this.handelPadding(e, t);
  20644. e = n.x,
  20645. t = n.y,
  20646. this.isTouchEvent = i,
  20647. U.convertScreenPositionToNDC(e, t, this.mouse);
  20648. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20649. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20650. this.couldBeLongTap = !1,
  20651. clearTimeout(this.mouseDownTimer)),
  20652. this.mouseLastMoveTime = Date.now(),
  20653. this.reticule.move(e, t, i)
  20654. window.transformControls && transformControls.onPointerMove()
  20655. }
  20656. ,
  20657. t.prototype.handleInputEnd = function(e, t, i) {
  20658. if (this.isTouchEvent = i,
  20659. this.mouseDown = !1,
  20660. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20661. !i && this.couldBeLongTap)
  20662. return !0;
  20663. if (this.handleLongTap())
  20664. return !0;
  20665. window.transformControls && transformControls.onPointerUp()
  20666. if (this.mouseCouldBeClickToMove) {
  20667. if (this.flying)
  20668. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20669. !0;
  20670. //add----
  20671. if (this.checkHotClick())
  20672. return !0;
  20673. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20674. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20675. return;
  20676. }
  20677. if (window.VisiSet && VisiSet.setTagVisible ) {
  20678. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20679. return;
  20680. }
  20681. if (window.VisiSet && VisiSet.setPanoLog ) {
  20682. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20683. return;
  20684. }
  20685. if(this.hoveringPlane){
  20686. this.clickOverlay(this.hoveringPlane)
  20687. return;
  20688. }
  20689. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20690. return EditOverlay.addPlane({intersect:this.intersect});
  20691. }
  20692. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20693. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20694. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20695. } */
  20696. //----------
  20697. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20698. this.history.invalidate(),
  20699. this.intersect)
  20700. return this.flyToPanoClosestToMouse();
  20701. if (this.mode === V.PANORAMA) {
  20702. var n = this.closestPanoInDirection(this.getMouseDirection());
  20703. return n ? this.flyToPano({
  20704. pano: n
  20705. }) : this.bump(this.getMouseDirection())
  20706. }
  20707. }
  20708. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20709. }
  20710. ,
  20711. t.prototype.handleLongTap = function() {
  20712. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20713. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20714. !0
  20715. }
  20716. ,
  20717. t.prototype.checktagClick = function() {
  20718. if (this.tagManager.intersectTag) {
  20719. var e = this.isTouchEvent
  20720. , t = this.tagManager.clickedOnTag(e, this);
  20721. return e || t || G.cancelById(q.LookTransition),
  20722. !0
  20723. }
  20724. if (this.tagManager.activeTag)
  20725. return this.tagManager.dismissActiveTag(),
  20726. !1
  20727. }
  20728. ,
  20729. t.prototype.rankedtagInDirection = function(e, t) {
  20730. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20731. }
  20732. ,
  20733. t.prototype.start = function(e) {
  20734. $(".toolLeft").removeClass("unable");
  20735. $(".toolTop").removeClass("unable");
  20736. //-------------------
  20737. window.initTransformCtl(B)
  20738. //this.model.loadOverlays()
  20739. //window.EditOverlay && window.EditOverlay.init(B);
  20740. window.VisiSet && VisiSet.init()
  20741. //-------------------
  20742. var t = e.mode
  20743. , i = e.pano
  20744. , n = e.position
  20745. , r = e.quaternion
  20746. , o = e.tag
  20747. , a = e.quickstart
  20748. , s = $.Deferred();
  20749. this.updateModelDependentData(),
  20750. this.updateFromControls(),
  20751. this.findDefaultViews();
  20752. var l = this.is360View(t, i);
  20753. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20754. s.done(function(e) {
  20755. this.emit(W.Ready, l, e, o)
  20756. }
  20757. .bind(this)),
  20758. s.promise()
  20759. }
  20760. ,
  20761. t.prototype.startOutside = function(e, t) {
  20762. var i = e.mode
  20763. , n = e.pano
  20764. , r = e.position
  20765. , o = e.quaternion
  20766. , a = e.zoom
  20767. , s = e.floorVisibility
  20768. , l = e.tag;
  20769. this.emit(W.StartOutside, k[i].transitionTime),
  20770. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20771. G.cancelById(q.FlyToViewFloor),
  20772. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20773. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20774. }
  20775. ,
  20776. t.prototype.startInside = function(e, t, i, n, r) {
  20777. r = r || $.Deferred();
  20778. var o = (this.currentPano = e) && !e.isAligned();
  20779. if (t = o ? e.position : t || e.position,
  20780. i = i || e.quaternion,
  20781. e) {
  20782. var a = this.startInside.bind(this, e, t, i, n, r);
  20783. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20784. return
  20785. }
  20786. //add
  20787. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20788. //this.updateHotVisible()
  20789. //EditOverlay.updatePano()
  20790. editTool.hotpoint.updatePano()
  20791. Hot.updateVisibles([this.currentPano])
  20792. return this.mode = V.PANORAMA,
  20793. e.floor.enter(this.mode),
  20794. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20795. this.switchCameraMode(this.mode, i),
  20796. this.emit(W.StartInside, o),
  20797. r.resolve(!0),
  20798. r
  20799. }
  20800. ,
  20801. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20802. if (r = r || $.Deferred(),
  20803. this.dollhouseMode(),
  20804. !i)
  20805. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20806. r.resolve(!1),
  20807. r;
  20808. e = e || i.position;
  20809. var o = n || this.cameraControls.activeControl.camera.quaternion
  20810. , a = i.position;
  20811. return this.fitDollhouse(a, e, o),
  20812. setTimeout(function(e) {
  20813. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20814. var t = {
  20815. mode: V.PANORAMA,
  20816. pano: i,
  20817. quaternion: n,
  20818. callback: function() {
  20819. this.emit(W.FlyinFinished),
  20820. r.resolve(!0)
  20821. }
  20822. .bind(this)
  20823. };
  20824. this.flyToNewMode(t)
  20825. }
  20826. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20827. r
  20828. }
  20829. ,
  20830. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20831. K = {},
  20832. function(t, e, i, n, r, o, a, s, l, c) {
  20833. if (function() {
  20834. for (var e in Z)
  20835. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20836. return !0;
  20837. return !1
  20838. }())
  20839. return !0;
  20840. var h = function(e, t, i) {
  20841. j.delayOneFrame(function() {
  20842. Z[e] = !1,
  20843. r && r(t, i)
  20844. }
  20845. .bind(this))
  20846. }
  20847. .bind(this, t.id)
  20848. , u = function(e, t) {
  20849. j.delayOneFrame(function() {
  20850. Z[e] = !1,
  20851. o && o(t)
  20852. }
  20853. .bind(this))
  20854. }
  20855. .bind(this, t.id);
  20856. try {
  20857. return null != s || (s = !0),
  20858. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  20859. Z[t.id] && (K[t.id] = performance.now()),
  20860. Z[t.id]
  20861. } catch (e) {
  20862. throw Z[t.id] = !1,
  20863. K[t.id] = performance.now() - 5e3,
  20864. e
  20865. }
  20866. }
  20867. ),
  20868. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20869. if (!e)
  20870. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20871. return r && this.model.waitForLoad(e, function() {
  20872. return e.isLoaded(i)
  20873. }),
  20874. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20875. !0)
  20876. }
  20877. ,
  20878. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20879. function(e, t, i, n, r, o, a, s) {
  20880. if (!e)
  20881. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20882. return X.copy(T.FORWARD),
  20883. this.getDirection(X),
  20884. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20885. return e.isLoaded(t)
  20886. }),
  20887. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20888. i && i(e, t)
  20889. }
  20890. .bind(this)).fail(function(e) {
  20891. n && n(e)
  20892. }
  20893. .bind(this)).progress(function(e, t, i) {
  20894. r && r(e, t, i)
  20895. }
  20896. .bind(this)),
  20897. !0)
  20898. }
  20899. ),
  20900. t.prototype.switchCameraMode = function(e, t) {
  20901. var i = this.cameraControls.controls[e]
  20902. , n = i.camera;
  20903. switch (e) {
  20904. case V.PANORAMA:
  20905. n.position.copy(this.currentPano.position);
  20906. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20907. i.lookAt(r.add(n.position));
  20908. break;
  20909. case V.DOLLHOUSE:
  20910. var o = this.position.clone();
  20911. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20912. n.position.copy(o),
  20913. i.target.copy(this.target.clone().setY(this.model.center.y));
  20914. break;
  20915. //for多楼层 且 让模型刚好适应屏幕
  20916. /* var box = this.model.boundingBox.clone();
  20917. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20918. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20919. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20920. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20921. console.log(boxSize.x,distance, boxSize.length() / 2)
  20922. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20923. if(this.mode === V.PANORAMA){
  20924. i.target.copy(this.model.center);
  20925. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20926. }else{
  20927. i.target.copy(this.target.clone().setY(this.model.center.y))
  20928. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20929. }
  20930. vec.multiplyScalar(distance )
  20931. n.position.copy(i.target.clone().add(vec)) */
  20932. break
  20933. case V.FLOORPLAN:
  20934. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20935. i.target.copy(this.model.center).setY(0),
  20936. i.zoomToContain(this.model.size),
  20937. i.rotateToView(this.model.size, this.getDirection())
  20938. }
  20939. i.update(0)
  20940. }
  20941. ,
  20942. t.prototype.update = (new B.Vector3,
  20943. N = {},
  20944. F = [],
  20945. function(e) {
  20946. this.updatePersistentZooming(e),
  20947. this.updateFromControls(e),
  20948. this.getCurrentNodePanos(F)
  20949. if(this.hasChanged(N)){
  20950. this.lastChangeTime = Date.now(),
  20951. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20952. this.emit(W.ViewChanged)
  20953. //add:
  20954. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  20955. this.intersectHot && this.intersectHot.showTitle()
  20956. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  20957. for(var i in this.model.hots){
  20958. this.model.hots[i].update(this)
  20959. }
  20960. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  20961. overlay.update()
  20962. }) */
  20963. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20964. }
  20965. this.model.supportsTiles && (this.updateTileDownloader(F),
  20966. this.updatePanoRenderer(F)),
  20967. this.updatePreRendering(F),
  20968. this.reticule.update(),
  20969. this.path.update(),
  20970. this.spider.update(),
  20971. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20972. this.updateControlLocks(),
  20973. this.model.supportsTiles && this.updateZoomPano()
  20974. }
  20975. ),
  20976. t.prototype.updatePersistentZooming = function(e) {
  20977. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20978. }
  20979. ,
  20980. t.prototype.updateControlLocks = function() {
  20981. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20982. }
  20983. ,
  20984. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20985. function(e) {
  20986. var t = this.nextPano || this.currentPano;
  20987. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20988. this.getDirection(D),
  20989. this.panoRenderer.updateDirection(D))
  20990. }
  20991. ),
  20992. t.prototype.cleanupInactivePanos = (O = [],
  20993. L = [],
  20994. function() {
  20995. O.length = 0,
  20996. O.push(this.currentPano),
  20997. this.nextPano && O.push(this.nextPano);
  20998. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20999. L.push(this.panoRenderer.activePanos[e]);
  21000. for (var t = 0; t < L.length; t++) {
  21001. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21002. i.id === O[r].id && (n = !1);
  21003. n && i.exit()
  21004. }
  21005. }
  21006. ),
  21007. t.prototype.updatePreRendering = (w = {},
  21008. function(e) {
  21009. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21010. var t = this.nextPano || this.currentPano;
  21011. if (t && e && 1 < e.length) {
  21012. var i = e.findIndex(function(e) {
  21013. if (e.id === t.id)
  21014. return !0
  21015. });
  21016. if (0 <= i && i + 1 < e.length) {
  21017. var n = e[i + 1];
  21018. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21019. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21020. window.setTimeout(function(e) {
  21021. w[e.id] = !1
  21022. }
  21023. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21024. }
  21025. .bind(this, n), k.tiling.panoPreRenderDelay),
  21026. w[n.id] = !0)
  21027. }
  21028. }
  21029. }
  21030. }
  21031. ),
  21032. t.prototype.enablePreRendering = function() {
  21033. this.preRenderingEnabled = !0
  21034. }
  21035. ,
  21036. t.prototype.disablePreRendering = function() {
  21037. this.preRenderingEnabled = !1,
  21038. this.cleanupInactivePanos()
  21039. }
  21040. ,
  21041. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21042. function(e) {
  21043. var t = this.nextPano || this.currentPano;
  21044. t && (b.copy(T.FORWARD),
  21045. this.getDirection(b),
  21046. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21047. this.tileDownloader.processPriorityQueue = !0)
  21048. }
  21049. ),
  21050. t.prototype.updateFromControls = function(e) {
  21051. null != e || (e = 0),
  21052. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21053. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21054. this.position.copy(this.cameraControls.activeControl.camera.position),
  21055. this.target.copy(this.cameraControls.activeControl.target),
  21056. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21057. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21058. this.camera.position.copy(this.position),
  21059. this.camera.quaternion.copy(this.quaternion),
  21060. this.camera.updateMatrix(),
  21061. this.camera.updateMatrixWorld()
  21062. }
  21063. ,
  21064. t.prototype.hasChanged = function(e) {
  21065. if (!this.previousState)
  21066. return this.previousState = {
  21067. allFloorsVisible: this.model.allFloorsVisible,
  21068. position: this.position.clone(),
  21069. quaternion: this.quaternion.clone(),
  21070. mouse: this.mouse.clone(),
  21071. labelScaleFactor: this.getLabelScaleFactor(),
  21072. currentFloor: this.model.currentFloor,
  21073. projectionMatrix: this.camera.projectionMatrix.clone(),
  21074. worldMatrix: this.camera.matrixWorld.clone(),
  21075. mode: this.mode,
  21076. modelPosition: this.model.position.clone(),
  21077. modelCenter: this.model.center.clone(),
  21078. zoomLevel: this.zoomLevel
  21079. },
  21080. !0;
  21081. 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;
  21082. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21083. e.moved = !this.position.equals(this.previousState.position),
  21084. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21085. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21086. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21087. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21088. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21089. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21090. e.modeChanged = this.mode !== this.previousState.mode,
  21091. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21092. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21093. e.nextPanoActive = null !== this.nextPano,
  21094. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21095. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21096. this.previousState.position.copy(this.position),
  21097. this.previousState.quaternion.copy(this.quaternion),
  21098. this.previousState.mouse.copy(this.mouse),
  21099. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21100. this.previousState.currentFloor = this.model.currentFloor,
  21101. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21102. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21103. this.previousState.mode = this.mode,
  21104. this.previousState.modelPosition.copy(this.model.position),
  21105. this.previousState.modelCenter.copy(this.model.center),
  21106. this.previousState.zoomLevel = this.zoomLevel,
  21107. !t
  21108. }
  21109. ,
  21110. t.prototype.updateIntersect = function() {
  21111. var e = this.flying || this.isWarping()
  21112. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21113. , i = G.getById(q.LookTransition);
  21114. e || t || this.isTouchEvent || i.length && i[0].running;
  21115. {//clear:
  21116. if(this.intersectHot) this.intersectHot.hideTitle()
  21117. this.intersectHot = null
  21118. $("#player").css("cursor", "")
  21119. $(".toolRight .spotList ul li").removeClass("active")
  21120. }
  21121. var deal = ()=>{
  21122. if(this.intersect && this.intersect.object.visible ){
  21123. if("hotSprite" == this.intersect.object.type){
  21124. this.intersectHot = this.intersect.object
  21125. while(!(this.intersectHot instanceof Hot)){
  21126. this.intersectHot = this.intersectHot.parent
  21127. }
  21128. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21129. this.intersectHot.showTitle()
  21130. }
  21131. }
  21132. }
  21133. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21134. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21135. deal()
  21136. if(this.intersect){
  21137. $("#player").css("cursor", "pointer");
  21138. }
  21139. if(this.intersectHot){
  21140. this.intersect = null
  21141. }
  21142. return
  21143. }else if (g_HotStatus) {//加热点
  21144. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21145. if(this.intersect){
  21146. $("#player").css("cursor", "cell")
  21147. }else{
  21148. $("#player").css("cursor", "not-allowed")
  21149. }
  21150. return;
  21151. }else{
  21152. if(this.model.hotGroup){
  21153. if(editTool.atPanel == 'hotpoint'){
  21154. var hots = this.model.hotGroup.children
  21155. }else{
  21156. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21157. }
  21158. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21159. if(this.intersect){
  21160. deal()
  21161. this.intersectHot && $("#player").css("cursor", "pointer");
  21162. }
  21163. }
  21164. }
  21165. this.intersect = this.getMouseIntersect(),
  21166. this.intersect && this.updateClosestPano(this.intersect),
  21167. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21168. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21169. }
  21170. ,
  21171. t.prototype.checkHotClick = function() {
  21172. if (this.intersectHot){
  21173. if (window.VisiSet && VisiSet.setTagVisible ) {
  21174. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21175. return;
  21176. }else if(editTool.atPanel == 'hotpoint'){
  21177. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21178. var sure = confirm("是否保存当前热点?")
  21179. if(sure){
  21180. editTool.hotpoint.saveHot().then(()=>{
  21181. editTool.hotpoint.editHot(this.intersectHot)
  21182. })
  21183. }else{
  21184. editTool.hotpoint.editHot(this.intersectHot)
  21185. }
  21186. }else{
  21187. editTool.hotpoint.editHot(this.intersectHot)
  21188. }
  21189. }else{
  21190. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21191. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21192. }
  21193. this.intersectHot.examine()
  21194. }
  21195. return !0
  21196. }
  21197. }
  21198. ,
  21199. t.prototype.getMouseDirection = function(e) {
  21200. e = e || this.mouse;
  21201. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21202. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21203. }
  21204. ,
  21205. t.prototype.hoverOverlay = function(mesh){
  21206. if(!mesh){
  21207. this.hoveringPlane = null;
  21208. $("#player").css("cursor",this.currentCursor || "" );
  21209. }else{
  21210. var overlay = mesh.parent;
  21211. $("#player").css("cursor","pointer");
  21212. this.hoveringPlane = overlay;
  21213. return true;
  21214. }
  21215. },
  21216. t.prototype.clickOverlay = function(overlay){
  21217. if(this.openOverlay && !overlay)return;
  21218. var plane = overlay.plane;
  21219. if(overlay.texType == "video"){
  21220. overlay.switchPlay(!!overlay.pausedByUser)
  21221. }
  21222. if(window.EditOverlay && EditOverlay.editing){
  21223. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21224. var sure = confirm("是否保存当前展览?")
  21225. if(sure){
  21226. $("#overlayProp button.submit").click()
  21227. }else{
  21228. EditOverlay.closeOverlayPanel('cancel')
  21229. }
  21230. }
  21231. EditOverlay.beginEdit(overlay);
  21232. return;
  21233. }
  21234. },
  21235. t.prototype.getMouseIntersect = function(e, t1) {
  21236. e = e || this.mouse.clone()
  21237. var t = t1 || this.model.floors.reduce(function(e, t) {
  21238. return t.hidden ? e : e.concat(t.collider.children)
  21239. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21240. t = t.slice(0)
  21241. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21242. this.raycaster.set(i, this.getMouseDirection(e));
  21243. var n = this.raycaster.intersectObjects(t , true );//add true
  21244. var o = n[0];
  21245. if(o){
  21246. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21247. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21248. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21249. o.horizontal = .8 < o.normal.y);
  21250. return o
  21251. }
  21252. }
  21253. ,
  21254. t.prototype.updateClosestPano = function(e) {
  21255. var t = [a.filters.isPanoAligned()];
  21256. if (this.mode === V.PANORAMA) {
  21257. if (!this.currentPano)
  21258. return;
  21259. t.push(a.filters.not(this.currentPano)),
  21260. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21261. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21262. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21263. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21264. } else{
  21265. t.push((pano)=>{ // add
  21266. return this.checkHasNeighbor(pano)
  21267. })
  21268. t.push(a.filters.isOnVisibleFloor()),
  21269. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21270. }
  21271. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21272. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21273. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21274. this.closestPano = i) : this.isPanoHover = !1
  21275. }
  21276. ,
  21277. t.prototype.dollhouseMode = function(e, t) {
  21278. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21279. this.mode = V.DOLLHOUSE,
  21280. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21281. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21282. , n = new B.Vector3(15,10,15);
  21283. if (e && t) {
  21284. var r = T.FORWARD.clone().applyQuaternion(t)
  21285. , o = this.model.center.clone().sub(e).dot(r);
  21286. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21287. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21288. }
  21289. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21290. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21291. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21292. this.updateFromControls(),
  21293. this.model.alpha = 1,
  21294. this.model.skybox.material.uniforms.opacity.value = 0
  21295. }
  21296. ,
  21297. t.prototype.insideMode = function(e, t) {
  21298. var i = $.Deferred()
  21299. , n = t || null;
  21300. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21301. var r = [a.filters.isPanoAligned()];
  21302. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21303. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21304. this.flyToNewMode({
  21305. mode: V.PANORAMA,
  21306. pano: e,
  21307. callback: n
  21308. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21309. } else {
  21310. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21311. i.reject(o)
  21312. }
  21313. return i.promise()
  21314. }
  21315. ,
  21316. t.prototype.fitDollhouse = function(e, t, i) {
  21317. var maxY = this.model.boundingBox.max.y;//add
  21318. var n = T.FORWARD.clone().applyQuaternion(i);
  21319. i = n.clone().add(e);
  21320. this.cameraControls.activeControl.target.copy(i),
  21321. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21322. }
  21323. ,
  21324. t.prototype.floorplanMode = function(e, t, i) {
  21325. this.mode = V.FLOORPLAN;
  21326. var n = this.cameraControls.controls[V.FLOORPLAN];
  21327. n.reset();
  21328. var r = e || this.model.center;
  21329. if (n.target.copy(r).setY(0),
  21330. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21331. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21332. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21333. t) {
  21334. var o = T.LEFT.clone().applyQuaternion(t);
  21335. n.rotateLeft(-Math.atan2(o.x, o.z))
  21336. } else
  21337. n.rotateToView(this.model.size, this.getDirection());
  21338. n.update(0)
  21339. }
  21340. ,
  21341. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21342. return e.skipWarpingCheck = !0,
  21343. this.flyToPano(e, t)
  21344. }
  21345. ,
  21346. t.prototype.updateMarkerVisi = function() {//加
  21347. if(this.mode != "panorama")return;
  21348. this.model.panos.list.forEach((pano)=>{
  21349. if(!pano.marker)return;
  21350. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21351. })
  21352. }
  21353. ,
  21354. /* t.prototype.updateHotVisible = function(pano){
  21355. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21356. var hots = this.model.hots;
  21357. pano = pano || this.currentPano;
  21358. for (var index in hots){
  21359. var visible;
  21360. if(this.mode != "panorama"){
  21361. visible = true;
  21362. }else{
  21363. //hots[index].mesh.material.depthTest = false;
  21364. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21365. }
  21366. hots[index].mesh.visible = visible;
  21367. }
  21368. }
  21369. */
  21370. t.prototype.flyToPano = function(e, t) {
  21371. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21372. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21373. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21374. if (aim){
  21375. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21376. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21377. }
  21378. else aimQua = aimQua
  21379. var zoomLevel = e.zoomLevel || 1 //add
  21380. if(this.flying) return t && t(e)
  21381. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21382. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21383. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21384. t && t(),
  21385. !1;
  21386. this.updateLastView()
  21387. if (this.mode !== V.PANORAMA)
  21388. return void this.flyToNewMode({
  21389. mode: V.PANORAMA,
  21390. pano: n,
  21391. duration: o,
  21392. quaternion: aimQua,
  21393. callback: t
  21394. });
  21395. if (!n || (h = x.deepExtend(e), u = function() {
  21396. j.delayOneFrame(function() {
  21397. this.flyToPano(h, t)
  21398. }.bind(this))
  21399. }.bind(this),
  21400. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21401. var d = function(e) {
  21402. t && t(e)
  21403. }
  21404. .bind(this);
  21405. this.currentPano || (this.currentPano = n,
  21406. this.path.placeCpm(),
  21407. this.path.fadeOutCpm(k.path.fadeOutTime),
  21408. this.spider.draw());
  21409. var p = o;
  21410. if ("number" != typeof o) {
  21411. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21412. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21413. }
  21414. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21415. zoomLevel !== this.zoomLevel)
  21416. switch (k.zoom.transitionStyle) {
  21417. case 1:
  21418. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21419. break;
  21420. case 2:
  21421. return h = x.deepExtend(e),
  21422. u = this.flyToPano.bind(this, h, t),
  21423. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21424. }
  21425. if (aimQua) {
  21426. G.cancelById(q.LookTransition),
  21427. p *= k.transition.aimSlowFactor;
  21428. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21429. , y = g.clone()
  21430. , A = new B.Vector3;
  21431. if (n === this.currentPano) {
  21432. var C = T.FORWARD.clone().applyQuaternion(g)
  21433. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21434. , E = C.angleTo(I);
  21435. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21436. void G.start(function(e) {
  21437. y.copy(g),
  21438. H.quaternion(y, aimQua)(e),
  21439. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21440. this.cameraControls.activeControl.lookAt(A)
  21441. }
  21442. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21443. }
  21444. }
  21445. if (n === this.currentPano )
  21446. return void d();
  21447. this.flying = !0;
  21448. var _ = this.position.clone()
  21449. , b = this.currentPano;
  21450. Y.debug("Flying to pano ", n.position);
  21451. this.emit(W.PanoChosen, this.currentPano, n);
  21452. this.emit(W.FlyingStarted, n.position, _, n, b);
  21453. //this.updateHotVisible(n); //更新热点显示
  21454. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21455. Hot.updateVisibles([this.currentPano, n])
  21456. aimQua && G.start(function(e) {
  21457. y.copy(g),
  21458. H.quaternion(y, aimQua)(e),
  21459. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21460. this.cameraControls.activeControl.lookAt(A)
  21461. }
  21462. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21463. var w = c ? null : z[k.transition.movementEasing];
  21464. this.nextPano = n;
  21465. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21466. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21467. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21468. this.flying = !1,
  21469. this.currentPano !== n && this.currentPano.exit(),
  21470. n.enter(),
  21471. this.currentPano = n,
  21472. this.nextPano = null,
  21473. this.path.placeCpm(),
  21474. this.path.fadeOutCpm(k.path.fadeOutTime),
  21475. this.spider.draw(),
  21476. this.emit(W.FlyingEnded, n.position, _, n, b),
  21477. this.updateMarkerVisi();//add
  21478. d(e)
  21479. if(this.mode == "panorama" ){
  21480. //EditOverlay.updatePano()
  21481. editTool.hotpoint.updatePano()
  21482. Hot.updateVisibles([this.currentPano])
  21483. }
  21484. }
  21485. .bind(this), 0, w, "camFly", q.FlyToPano)
  21486. }
  21487. }
  21488. ,
  21489. window._transitionPosId = 9999
  21490. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21491. G.cancelById(_transitionPosId)
  21492. var begin = function(object, pos, qua, scale){
  21493. if(pos){
  21494. if(!same(object.position, pos, 0.01)){
  21495. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21496. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21497. }
  21498. if(qua && !same(object.quaternion, qua, 1e-6)){
  21499. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21500. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21501. }
  21502. if(scale && !same(object.scale, scale, 0.001)){
  21503. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21504. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21505. }
  21506. }
  21507. }
  21508. var same = function(vec1, vec2, diff){
  21509. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21510. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21511. return s
  21512. }
  21513. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21514. /* this.model.hotGroup.children.forEach(overlay=>{
  21515. var panoData = overlay.transformAtPanos[sid]
  21516. var useCustom = !panoData
  21517. //if(overlay.usingTransformData || !useCustom){
  21518. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21519. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21520. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21521. overlay.getScaleBySize(panoData.width , panoData.height)
  21522. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21523. begin(overlay, pos, qua, scale )
  21524. //}
  21525. overlay.usingTransformData = !useCustom
  21526. }) */
  21527. for(let i in this.model.hots){//是否判断visible?
  21528. var hot = this.model.hots[i];
  21529. var panoData = hot.info.transformAtPanos[sid];
  21530. var useCustom = !panoData
  21531. //if(hot.usingTransformData || !useCustom){
  21532. var pos = useCustom ? hot.info.position : panoData.pos;
  21533. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21534. begin(hot, pos/* , qua */ )
  21535. //}
  21536. //hot.usingTransformData = !useCustom;
  21537. }
  21538. }
  21539. window._tranOutsideFocus = 4399
  21540. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21541. console.log("focusPoint")
  21542. if(this.mode == "floorplan"){
  21543. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21544. var control = player.cameraControls.controls.floorplan;
  21545. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21546. var currentScale = control.absoluteScale;
  21547. var currentTarget = control.target.clone()
  21548. G.cancelById(window._tranOutsideFocus, true);
  21549. G.start(function(progress){
  21550. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21551. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21552. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21553. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21554. }else if(player.mode == "dollhouse"){
  21555. var control = player.cameraControls.controls.dollhouse;
  21556. var radius = o.radius || 8;
  21557. var currentTarget = control.target.clone()
  21558. var dir = control.offset.clone().normalize()
  21559. var currentRadius = control.offset.length();
  21560. G.cancelById(window._tranOutsideFocus, true);
  21561. G.start(function(progress){
  21562. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21563. let radius_ = radius*progress+currentRadius*(1-progress)
  21564. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21565. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21566. }else if(this.mode == 'panorama'){
  21567. this.flyToPano({
  21568. lookAtPoint: o.aim.clone() ,
  21569. pano: this.currentPano,
  21570. aimDuration: o.dur || 600
  21571. })
  21572. }
  21573. }
  21574. t.prototype.fastForwardActivePanoFlight = function(e) {
  21575. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21576. G.adjustSpeed(q.FlyToPano, e),
  21577. G.adjustSpeed(q.LookTransition, e)
  21578. }
  21579. ,
  21580. t.prototype.flyToPanoClosestToMouse = function() {
  21581. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21582. this.intersect && this.updateClosestPano(this.intersect)),
  21583. this.closestPano)
  21584. return this.flyToPano({
  21585. pano: this.closestPano
  21586. });
  21587. var e = this.getMouseDirection();
  21588. this.flyDirection(e) || this.flyToPano({
  21589. pano: this.currentPano
  21590. })
  21591. }
  21592. ,
  21593. t.prototype.flyLocalDirection = function(e) {
  21594. var t = this.getDirection(e)
  21595. , i = 1 === e.z ? .4 : .75
  21596. , n = 1 === Math.abs(e.x);
  21597. return this.flyDirection(t, i, n)
  21598. }
  21599. ,
  21600. t.prototype.flyDirection = function(e, t, i) {
  21601. Hot.closePopup();//xzw add
  21602. var n = $.Deferred();
  21603. this.history.invalidate();
  21604. var r = this.closestPanoInDirection(e, t, i);
  21605. return r ? this.flyToPano({
  21606. pano: r
  21607. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21608. n.resolve(!1)),
  21609. n.promise()
  21610. }
  21611. ,
  21612. t.prototype.closestPanoInDirection = function(e, t, i) {
  21613. return this.rankedPanoInDirection(0, e, t, i)
  21614. }
  21615. ,
  21616. t.prototype.rankedPanoInDirection = (_ = {
  21617. pano: null,
  21618. candidates: []
  21619. },
  21620. function(e, t, i, n) {
  21621. e = e || 0,
  21622. i = void 0 !== i ? i : .75;
  21623. var r = n ? "angle" : "direction";
  21624. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21625. this.cachedPanoCandidates = _.candidates,
  21626. _.pano
  21627. }
  21628. ),
  21629. t.prototype.bump = function(e) {
  21630. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21631. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21632. if (.5 < Math.abs(a))
  21633. t = function() {
  21634. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21635. }
  21636. .bind(this),
  21637. i = function() {
  21638. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21639. }
  21640. .bind(this);
  21641. else {
  21642. var s = this.camera.position.clone()
  21643. , l = e.clone();
  21644. this.raycaster.set(s, l);
  21645. var c = this.model.floors.reduce(function(e, t) {
  21646. return e.concat(t.collider.children)
  21647. }, [])
  21648. , h = this.raycaster.intersectObjects(c)
  21649. , u = 0 < h.length ? h[0].distance / 25 : .04
  21650. , d = s.clone().add(l.multiplyScalar(u));
  21651. t = function() {
  21652. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21653. }
  21654. .bind(this),
  21655. i = function() {
  21656. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21657. }
  21658. .bind(this)
  21659. }
  21660. n = function() {
  21661. this.flying = !1
  21662. }
  21663. .bind(this),
  21664. this.flying = !0,
  21665. t()
  21666. }
  21667. }
  21668. ,
  21669. t.prototype.changeFloor = function(e) {
  21670. if (!this.is360View(this.mode, this.currentPano))
  21671. if (this.mode === V.PANORAMA) {
  21672. var t = this.history.reversePano(e);
  21673. t && t.isAligned() ? this.flyToPano({
  21674. pano: t
  21675. }) : this.changeFloorByScore(e)
  21676. } else
  21677. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21678. }
  21679. ,
  21680. t.prototype.changeFloorByScore = (E = {
  21681. pano: null,
  21682. candidates: []
  21683. },
  21684. function(e) {
  21685. var t = this.model.nextFloor(e);
  21686. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  21687. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21688. this.history.push(e, this.currentPano),
  21689. this.flyToPano({
  21690. pano: E.pano
  21691. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21692. }
  21693. ),
  21694. t.prototype.gotoFloor = function(e) {
  21695. var t = e - this.model.currentFloor.floorIndex;
  21696. this.changeFloor(t)
  21697. }
  21698. ,
  21699. t.prototype.getDirection = function(e) {
  21700. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21701. }
  21702. ,
  21703. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21704. if (r = r || $.Deferred(),
  21705. this.mode === V.TRANSITIONING)
  21706. return Y.warn("should not be transitioning here"),
  21707. n && n(!1),
  21708. r.reject().promise();
  21709. var o = i || !1
  21710. , a = i ? i.position : this.position
  21711. , s = this.position.clone()
  21712. , l = this.currentPano;
  21713. if (Y.debug("New pose in mode " + this.mode),
  21714. !e || (retryCallback = function() {
  21715. j.delayOneFrame(function() {
  21716. this.flyToSameMode(e, t, i, n, r)
  21717. }
  21718. .bind(this))
  21719. }
  21720. .bind(this),
  21721. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21722. var c = function() {
  21723. this.emit(W.FlyingEnded, a, s, e, l),
  21724. n && n(!0)
  21725. }
  21726. .bind(this)
  21727. , h = k[this.mode]
  21728. , u = void 0 !== t ? t : h.transitionTime
  21729. , d = new B.Vector3
  21730. , p = new B.Vector3;
  21731. if (this.emit(W.FlyingStarted, a, s, e, l),
  21732. this.mode === V.PANORAMA)
  21733. Y.warn("we should not be here for panorama views");
  21734. else if (this.mode === V.DOLLHOUSE)
  21735. if (o) {
  21736. var f = new B.Vector3(0,1,0);
  21737. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21738. this.model.warpDestFloors(i.floorVisibility),
  21739. p.copy(i.position);
  21740. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21741. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21742. , v = 3;
  21743. m.length ? (d.copy(m[0].point),
  21744. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21745. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21746. var y = (new B.Matrix4).lookAt(p, d, f)
  21747. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21748. , C = d.distanceTo(p)
  21749. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21750. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21751. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21752. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21753. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21754. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21755. this.path.burnsDir = Math.sign(b.y);
  21756. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21757. , T = new B.Vector3;
  21758. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21759. G.start(function(e, t) {
  21760. w.x = E.x + e * b.x,
  21761. w.y = E.y + e * b.y,
  21762. w.z = E.z + e * b.z;
  21763. var i = _ + e * (C - _);
  21764. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21765. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21766. }
  21767. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21768. G.start(function(e, t) {
  21769. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21770. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21771. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21772. }
  21773. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21774. } else
  21775. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21776. else if (this.path.placeCpm(),
  21777. this.path.fadeInCpm(k.path.fadeInTime),
  21778. i) {
  21779. this.model.warpDestFloors(i.floorVisibility);
  21780. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21781. , S = this.cameraControls.controls[V.FLOORPLAN]
  21782. , M = S.target.clone()
  21783. , R = i.position.clone().sub(M)
  21784. , P = x.position.clone().sub(S.target).length()
  21785. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21786. , L = Math.atan2(S.offset.x, S.offset.z)
  21787. , D = Math.atan2(O.x, O.z)
  21788. , N = S.absoluteScale
  21789. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21790. G.start(function(e, t) {
  21791. S.target.copy(R).multiplyScalar(e).add(M);
  21792. var i = L + (D - L) * e;
  21793. S.offset.x = P * Math.sin(i),
  21794. S.offset.z = P * Math.cos(i),
  21795. x.position.copy(S.target).add(S.offset),
  21796. S.absoluteScale = N + e * (F - N),
  21797. S.update(),
  21798. this.quaternion.copy(x.quaternion),
  21799. this.position.copy(x.position),
  21800. this.target.copy(S.target),
  21801. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21802. }
  21803. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21804. } else
  21805. Y.info("flyToSameMode() funny floorplan view? skipping");
  21806. return G.setTimeout(function(e) {
  21807. this.mode = e,
  21808. c(),
  21809. r.resolve(!0)
  21810. }
  21811. .bind(this, this.mode), u, q.FlyToSameMode),
  21812. this.mode = V.TRANSITIONING,
  21813. r.promise()
  21814. }
  21815. }
  21816. ,
  21817. t.prototype.flyToNewMode = function(e, t) {
  21818. Hot.closePopup();//xzw add
  21819. var i = (e = e || {}).mode
  21820. , n = e.pano
  21821. , r = e.duration
  21822. , o = e.warpDest
  21823. , a = e.callback
  21824. , s = e.force
  21825. , l = e.quaternion;
  21826. if (t = t || $.Deferred(),
  21827. this.isWarping())
  21828. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21829. a && a(!1),
  21830. t.reject("Cannot change mode during tour transition").promise();
  21831. if (this.mode === V.TRANSITIONING)
  21832. return a && a(!1),
  21833. t.reject("Cannot change mode during mode transition").promise();
  21834. if (i === this.mode)
  21835. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21836. t.promise()) : (a && a(!1),
  21837. t.reject("Already in " + i + " mode").promise());
  21838. var c = o || !1;
  21839. Y.debug("Switching mode to " + i);
  21840. var h = function() {
  21841. j.delayOneFrame(function() {
  21842. this.flyToNewMode(e, t)
  21843. }
  21844. .bind(this))
  21845. }
  21846. .bind(this);
  21847. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21848. return t.promise();
  21849. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21850. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21851. this.model.waitForLoad(this.model, function() {
  21852. return this.model.meshTexturesLoaded
  21853. }
  21854. .bind(this)),
  21855. this.model.loadMeshTextures().done(h),
  21856. t.promise();
  21857. this.history.invalidate(),
  21858. this.updateLastView();
  21859. var u = this.mode
  21860. , d = this.cameraControls.cameras[i];
  21861. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21862. var p = void 0 !== r ? r : e.transitionTime;
  21863. this.emit(W.ModeChanging, u, i, n),
  21864. n && (this.currentPano = n),
  21865. this.switchCameraMode(i, l),
  21866. G.cancelById(q.LookTransition);
  21867. var f = (new B.Vector3).copy(this.position);
  21868. this.modeTran = this.mode + "-" + i;
  21869. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  21870. VisiSet.finishSetPanoVisible()
  21871. VisiSet.finishSetTagVisible()
  21872. VisiSet.finishSetPanoLog()
  21873. }
  21874. if(editTool.atPanel == "screen"){
  21875. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21876. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21877. }
  21878. if(i == "panorama"){
  21879. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21880. }else{
  21881. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21882. }
  21883. if (i === V.PANORAMA)
  21884. this.emit(W.PanoChosen, n, n),
  21885. setTimeout(function() {
  21886. n.floor.enter(i)
  21887. }
  21888. .bind(this), p / 2),
  21889. this.path.fadeOutCpm(k.path.fadeOutTime);
  21890. else if (i === V.DOLLHOUSE) {
  21891. if (c && (this.model.stayPut = !0),
  21892. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21893. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21894. this.path.placeCpm(),
  21895. this.path.fadeInCpm(k.path.fadeInTime),
  21896. c) {
  21897. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21898. f.set(15, 10, 15);
  21899. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21900. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21901. v.length ? (g.copy(v[0].point),
  21902. f.copy(o.position),
  21903. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  21904. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21905. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21906. f.add(this.model.position),
  21907. d.position.copy(f),
  21908. this.cameraControls.controls[V.DOLLHOUSE].update()
  21909. }
  21910. } else if (this.path.placeCpm(),
  21911. this.path.fadeInCpm(k.path.fadeInTime),
  21912. o) {
  21913. this.model.warpDestFloors(o.floorVisibility);
  21914. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21915. , A = this.cameraControls.controls[V.FLOORPLAN]
  21916. , C = y.position.clone().sub(A.target)
  21917. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21918. , E = Math.atan2(I.x, I.z);
  21919. A.target.copy(o.position);
  21920. var _ = C.length();
  21921. A.offset.x = _ * Math.sin(E),
  21922. A.offset.y = 0,
  21923. A.offset.z = _ * Math.cos(E),
  21924. y.position.copy(A.target).add(A.offset),
  21925. A.target.clone().sub(d.position),
  21926. d.quaternion.copy(o.quaternion),
  21927. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21928. A.absoluteScale = A.currentScale,
  21929. A.update()
  21930. } else
  21931. this.model.currentFloor.enter(i);
  21932. var b = this.currentPano
  21933. , w = this.position.clone();
  21934. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21935. this.flying = !0,
  21936. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21937. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21938. d.controls.update()),
  21939. e.blackoutStyle = P.FADEIN,
  21940. p = k.show360Views.transitionTime,
  21941. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21942. this.mode = i,
  21943. this.path && this.path.popOutCpm(),
  21944. e.blackoutStyle = P.END,
  21945. p = k.show360Views.transitionTime,
  21946. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21947. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21948. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21949. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21950. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21951. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21952. G.setTimeout(function() {
  21953. this.flying = !1,
  21954. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21955. this.currentPano.enter(),
  21956. this.path.placeCpm(),
  21957. this.path.fadeOutCpm(k.path.fadeOutTime),
  21958. this.spider.draw()),
  21959. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21960. this.mode = i,
  21961. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21962. if (this.afterCModeFuc) {
  21963. //手动加的函数
  21964. var cf = this.afterCModeFuc;
  21965. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21966. cf();
  21967. }
  21968. this.updateMarkerVisi();//add
  21969. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  21970. if(this.mode == "panorama" ){
  21971. //EditOverlay.updatePano()
  21972. editTool.hotpoint.updatePano()
  21973. }
  21974. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21975. if(this.mode == V.PANORAMA){
  21976. Hot.updateVisibles([this.currentPano])
  21977. }else{
  21978. Hot.updateVisibles(true)
  21979. this.model.hotGroup.children.forEach(overlay=>{
  21980. if(overlay.animateInfo){
  21981. GifTexDeal.start(overlay.animation)
  21982. }
  21983. })
  21984. }
  21985. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21986. t.resolve())
  21987. }
  21988. .bind(this), p, q.FlyToNewMode),
  21989. this.mode = V.TRANSITIONING,
  21990. //EditOverlay.updatePano(),//add
  21991. editTool.hotpoint.updatePano(),//add
  21992. //u == "panorama" && this.updateHotVisible(),
  21993. t.promise()
  21994. }
  21995. ,
  21996. t.prototype.fade360View = function(e, t, i) {
  21997. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21998. $(this.domElement).fadeOut(.5 * e, function() {
  21999. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22000. this.model.alpha = i.modelAlpha,
  22001. this.position.copy(t.position),
  22002. this.quaternion.copy(t.quaternion),
  22003. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22004. $(this.domElement).fadeIn(.5 * e)
  22005. }
  22006. .bind(this))
  22007. }
  22008. ,
  22009. t.prototype.findDefaultViews = function() {
  22010. this.findDefaultView(this.lastInsideView, !0),
  22011. this.findDefaultView(this.last360View, !1)
  22012. }
  22013. ,
  22014. t.prototype.findDefaultView = function(e, i) {
  22015. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22016. if (e.cameraMode !== V.PANORAMA)
  22017. return !1;
  22018. var t = r.get(e.panoId);
  22019. return t && t.isAligned() === i
  22020. });
  22021. 0 <= o ? (t = r.get(n[o].panoId),
  22022. e.update({
  22023. cameraMode: V.PANORAMA,
  22024. pano: t,
  22025. position: n[o].position,
  22026. quaternion: n[o].quaternion
  22027. })) : 0 <= (o = r.list.findIndex(function(e) {
  22028. return e.isAligned() === i
  22029. })) ? (t = r.list[o],
  22030. e.update({
  22031. cameraMode: V.PANORAMA,
  22032. pano: t,
  22033. position: t.position
  22034. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22035. }
  22036. ,
  22037. t.prototype.updateLastView = function() {
  22038. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22039. pano: this.currentPano,
  22040. position: this.position,
  22041. quaternion: this.quaternion
  22042. })
  22043. }
  22044. ,
  22045. t.prototype.goToLastView = function(e, t) {
  22046. var i = $.Deferred()
  22047. , n = i.resolve.bind(i)
  22048. , r = i.reject.bind(i)
  22049. , o = e ? this.lastInsideView : this.last360View;
  22050. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22051. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22052. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22053. mode: o.cameraMode,
  22054. pano: o.pano,
  22055. quaternion: o.quaternion,
  22056. callback: t
  22057. }).done(n).fail(r),
  22058. i.promise()
  22059. }
  22060. ,
  22061. t.prototype.fadeToView = function(e, t, i, n) {
  22062. var r = $.Deferred()
  22063. , o = r.resolve.bind(r)
  22064. , a = r.reject.bind(r);
  22065. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22066. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22067. a("Cannot go to illegal view"),
  22068. r.promise();
  22069. var s = (k[t.cameraMode],
  22070. function() {
  22071. $(this.domElement).fadeIn(.5 * i),
  22072. n && n(),
  22073. o()
  22074. }
  22075. .bind(this))
  22076. , l = e ? P.FADEIN : P.END;
  22077. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22078. $(this.domElement).fadeOut(.5 * i, function() {
  22079. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22080. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22081. pano: t.pano,
  22082. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22083. duration: 0
  22084. }, s) : this.flyToNewMode({
  22085. mode: t.cameraMode,
  22086. quaternion: t.quaternion,
  22087. duration: 0,
  22088. callback: s
  22089. })
  22090. }
  22091. .bind(this)),
  22092. r.promise()
  22093. }
  22094. ,
  22095. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22096. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22097. this.flying)
  22098. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22099. o && o(),
  22100. !1;
  22101. null != e || (e = M.Show),
  22102. this.history.invalidate(),
  22103. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22104. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22105. return this.emit(W.WarpStarted, a, i, n, r),
  22106. n = n || P.MIDDLE,
  22107. this.path.warpToPano(i, n, r, function() {
  22108. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22109. this.emit(W.WarpEnded, i),
  22110. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22111. o && o()
  22112. }
  22113. .bind(this)),
  22114. e === M.Hide && this.path.discardPathObject(),
  22115. !0
  22116. }
  22117. ,
  22118. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22119. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22120. s && s(),
  22121. !1)
  22122. }
  22123. ,
  22124. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22125. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22126. a && a(),
  22127. !1)
  22128. }
  22129. ,
  22130. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22131. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22132. }
  22133. ,
  22134. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22135. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22136. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22137. t && t(),
  22138. !1)
  22139. }
  22140. ,
  22141. t.prototype.aimTourCamera = function(e, t, i, n) {
  22142. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22143. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22144. }
  22145. ,
  22146. t.prototype.showPathToHeroLocation = function(e) {
  22147. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22148. }
  22149. ,
  22150. t.prototype.tourInterlude = function(e, t) {
  22151. this.history.invalidate(),
  22152. this.path.discardSlow();
  22153. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间
  22154. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22155. var rotTime
  22156. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22157. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22158. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22159. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22160. rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : timeEachItem;
  22161. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22162. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22163. }
  22164. rotTime = Math.max(0, rotTime)
  22165. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22166. }else{
  22167. rotTime = currentLocation.rotTime * 1000
  22168. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22169. }
  22170. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22171. t && t()
  22172. }
  22173. .bind(this), rotTime)
  22174. }
  22175. ,
  22176. t.prototype.stopInterlude = function() {
  22177. this.interruptAndFastForward(null, 0)
  22178. }
  22179. ,
  22180. t.prototype.interruptAndFastForward = function(e, t) {
  22181. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22182. this.flying && this.emit(W.FlyingInterrupted),
  22183. this.path.interruptAndFastForward(e, t)
  22184. }
  22185. ,
  22186. t.prototype.setSize = function(e, t) {
  22187. var i = e / t;
  22188. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22189. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22190. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22191. this.cameraControls.cameras) {
  22192. var o = this.cameraControls.cameras[r];
  22193. o.fov = this.baseFov * (1 / this.zoomLevel),
  22194. o.updateAspect(i)
  22195. }
  22196. }
  22197. ,
  22198. t.prototype.toJSON = function() {
  22199. var e = {};
  22200. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22201. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22202. return e.hidden ? 0 : 1
  22203. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22204. e
  22205. }
  22206. ,
  22207. t.prototype.getCurrentNodePanos = function(e) {
  22208. if (this.model.panos.map,
  22209. e.length = 0,
  22210. this.path.nodes)
  22211. for (var t = 0; t < this.path.nodes.length; t++) {
  22212. var i = this.path.nodes[t];
  22213. e.push(this.model.panos.get(i))
  22214. }
  22215. }
  22216. ,
  22217. t.prototype.zoomIncrementally = function(e) {
  22218. var t = this.zoomLevel;
  22219. this.zoomTo(this.zoomLevel + e),
  22220. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22221. }
  22222. ,
  22223. t.prototype.zoomInIncrementally = function(e) {
  22224. e = e || this.defaultZoomIncrement,
  22225. this.zoomIncrementally(e)
  22226. }
  22227. ,
  22228. t.prototype.zoomOutIncrementally = function(e) {
  22229. e = e || -this.defaultZoomIncrement,
  22230. this.zoomIncrementally(e)
  22231. }
  22232. ,
  22233. t.prototype.zoomBy = function(e) {
  22234. this.zoomTo(this.zoomLevel * e)
  22235. }
  22236. ,
  22237. t.prototype.zoomIn = function() {
  22238. this.zoomBy(1 + this.zoomSpeed)
  22239. }
  22240. ,
  22241. t.prototype.zoomOut = function() {
  22242. this.zoomBy(1 - this.zoomSpeed)
  22243. }
  22244. ,
  22245. t.prototype.zoomTo = function(e, t) {
  22246. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22247. e > k.zoom.max && (e = k.zoom.max),
  22248. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22249. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22250. e === k.zoom.min && this.emit(m.ZoomMin)),
  22251. this.cameraControls.activeControl)) {
  22252. var i = this.cameraControls.activeControl.camera;
  22253. this.zoomLevel = e,
  22254. i.fov = this.baseFov * (1 / this.zoomLevel),
  22255. i.updateProjectionMatrix(),
  22256. this.zoomFov = i.fov
  22257. }
  22258. }
  22259. ,
  22260. t.prototype.increaseZoomSpeed = function() {
  22261. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22262. }
  22263. ,
  22264. t.prototype.decreaseZoomSpeed = function() {
  22265. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22266. }
  22267. ,
  22268. t.prototype.clampZoomSpeed = function(e) {
  22269. return e < 0 ? 0 : e
  22270. }
  22271. ,
  22272. t.prototype.activatePersistentZooming = function(e) {
  22273. this.zooming = e ? 1 : -1
  22274. }
  22275. ,
  22276. t.prototype.deactivatePersistentZooming = function() {
  22277. this.zooming = 0
  22278. }
  22279. ,
  22280. t.prototype.zoomDefault = function() {
  22281. this.zoomTo(1, !0)
  22282. }
  22283. window.fovTranId = 333;//add
  22284. t.prototype.smoothZoomToDefault = function(e, t) {
  22285. G.cancelById(window.fovTranId)
  22286. var i, n = this.zoomLevel, r = function(e) {
  22287. 1 < e && (e = 1),
  22288. i = n * (1 - e) + e,
  22289. this.zoomTo(i, !0)
  22290. }
  22291. .bind(this), o = function() {
  22292. this.zoomDefault(),
  22293. t && window.setTimeout(t, 50)
  22294. }
  22295. .bind(this);
  22296. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22297. }
  22298. ,
  22299. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22300. G.cancelById(window.fovTranId)
  22301. var i,
  22302. n = this.zoomLevel,
  22303. aimLevel = zoomLevel || this.baseFov / fov
  22304. if (n == aimLevel) return
  22305. var fun = function (e) {
  22306. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22307. }.bind(this)
  22308. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22309. }
  22310. ,
  22311. t.prototype.updateZoomPano = function() {
  22312. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22313. var e = this.currentPano;
  22314. if (e) {
  22315. var t = this.zoomLevel > k.zoom.activationThreshold
  22316. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22317. t);
  22318. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22319. this.panoRenderer.setZoomingActive(i, e, !0);
  22320. var n = function(e, t) {
  22321. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22322. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22323. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22324. e.setZoomed(t)
  22325. }
  22326. .bind(this);
  22327. i && !e.zoomed ? (n(e, !0),
  22328. this.panoRenderer.enableUltraHighQualityMode(function() {
  22329. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22330. i && n(e, !0)
  22331. }
  22332. .bind(this))) : !t && e.zoomed && n(e, !1)
  22333. }
  22334. }
  22335. },
  22336. //--------
  22337. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22338. var f2;
  22339. if (this.mode == mode) {
  22340. f1 && f1()
  22341. } else {
  22342. f2 = f1;
  22343. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22344. this.afterCModeFuc = function() {
  22345. this.afterCModeFuc = f2
  22346. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22347. }.bind(this)
  22348. } else {
  22349. this.afterCModeFuc = f2;//飞入后执行
  22350. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22351. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22352. }catch(e){}
  22353. }
  22354. }
  22355. }
  22356. ,
  22357. t.prototype.checkHasNeighbor = function(pano){//add
  22358. for(var i in pano.neighbourPanos ){
  22359. if(i == pano.id)continue;
  22360. if(pano.neighbourPanos[i]){
  22361. return true;
  22362. }
  22363. }
  22364. }
  22365. ,
  22366. ee.exports = t
  22367. }
  22368. ).call(this, "/js/player.js")
  22369. }
  22370. , {
  22371. "./constants": 8,
  22372. "./enum/AlignmentType": 17,
  22373. "./enum/BlackoutStyle": 18,
  22374. "./enum/ControlEvents": 21,
  22375. "./enum/Keys": 30,
  22376. "./enum/ModelManagerEvents": 33,
  22377. "./enum/PanoSizeClass": 36,
  22378. "./enum/PanoramaEvents": 37,
  22379. "./enum/PathDiscardMode": 38,
  22380. "./enum/PathDisplayMode": 39,
  22381. "./enum/PlayerEvents": 40,
  22382. "./enum/TagStates": 44,
  22383. "./enum/Vectors": 50,
  22384. "./enum/Viewmode": 51,
  22385. "./enum/WarpStyle": 52,
  22386. "./enum/ZoomEvents": 53,
  22387. "./exception/BasicException": 55,
  22388. "./model/ModelManager": 140,
  22389. "./objects/NSpider": 147,
  22390. "./objects/Panorama": 148,
  22391. "./objects/Reticule": 149,
  22392. "./objects/ShowPath": 151,
  22393. "./objects/Snapshot": 153,
  22394. "./objects/View": 154,
  22395. "./settings": 166,
  22396. "./shaders": 167,
  22397. "./tile/TileDownloader": 171,
  22398. "./tile/TilePrioritizer": 172,
  22399. "./util/ZoomStats": 179,
  22400. "./util/browser": 182,
  22401. "./util/camera": 183,
  22402. "./util/cameraLight": 184,
  22403. "./util/common": 185,
  22404. "./util/easing": 186,
  22405. "./util/history": 187,
  22406. "./util/lerp": 188,
  22407. "./util/logger": 189,
  22408. "./util/math": 190,
  22409. "./util/transitions": 195,
  22410. // hot: "hot",
  22411. scaleImg: "scaleImg",
  22412. events: 202,
  22413. three: 217
  22414. }],
  22415. scaleImg: [function(e, t) {
  22416. var i = t;
  22417. (function() {
  22418. function e(e, t, i, n) {
  22419. function r() {
  22420. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22421. U.height = p,
  22422. H = U.getContext("2d")
  22423. }
  22424. function o(e) {
  22425. if (e) {
  22426. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22427. for (t = 0; t < ie; t += 4)
  22428. n[t] = e[t] * ne | 0,
  22429. n[t + 1] = e[t + 1] * ne | 0,
  22430. n[t + 2] = e[t + 2] * ne | 0,
  22431. n[t + 3] = e[t + 3] * ne | 0;
  22432. return delete e,
  22433. i
  22434. }
  22435. return H.getImageData(0, 0, d, p)
  22436. }
  22437. function a(e, t, i, n, r) {
  22438. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22439. }
  22440. var s, l;
  22441. if (t || (t = e.input,
  22442. i = e.output,
  22443. n = e.inputRemovable,
  22444. e.scale && (e = e.scale)),
  22445. t.src)
  22446. if (s = document.createElement("canvas"),
  22447. null != t.naturalWidth)
  22448. s.width = t.naturalWidth,
  22449. s.height = t.naturalHeight;
  22450. else if (null != t.runtimeStyle) {
  22451. var c = t.runtimeStyle
  22452. , h = c.width
  22453. , u = c.height;
  22454. c.width = "auto",
  22455. c.height = "auto",
  22456. s.width = t.width,
  22457. s.height = t.height,
  22458. c.width = h,
  22459. c.height = u
  22460. } else {
  22461. h = t.width,
  22462. u = t.height;
  22463. t.removeAttribute && (t.removeAttribute("width"),
  22464. t.removeAttribute("height")),
  22465. s.width = t.width,
  22466. s.height = t.height,
  22467. t.width = h,
  22468. t.height = u
  22469. }
  22470. else
  22471. s = t;
  22472. l = s.getContext("2d"),
  22473. t.src && l.drawImage(t, 0, 0);
  22474. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22475. if (!f || !g)
  22476. return !1;
  22477. (t.src || n) && s.clearRect(0, 0, f, g),
  22478. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22479. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22480. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22481. e * g + .5 | 0);
  22482. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22483. if (1 < re || 1 < oe)
  22484. for (r(),
  22485. G = (z = o()).data,
  22486. C = 0; C < p; C++)
  22487. for (V = (y = C / oe) - (w = 0 | y),
  22488. j = w * $,
  22489. W = w < 1 ? j : j - $,
  22490. w < g - 2 ? (Y = j + $,
  22491. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22492. A = 0; A < d; A++,
  22493. te += 4)
  22494. Z = (b = 0 | (v = A / re)) << 2,
  22495. b < f - 2 ? (K = Z + 4,
  22496. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22497. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22498. ++Z,
  22499. ++K,
  22500. ++Q,
  22501. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22502. ++Z,
  22503. ++K,
  22504. ++Q,
  22505. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22506. ++Z,
  22507. ++K,
  22508. ++Q,
  22509. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22510. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22511. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22512. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22513. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22514. else {
  22515. if (le.Float32Array)
  22516. L = new Float32Array(ie);
  22517. else
  22518. for (L = [],
  22519. te = 0; te < ie; ++te)
  22520. L[te] = 0;
  22521. for (y = 0; y < g; y++)
  22522. for (I = (_ = 0 | (C = y * oe)) * J,
  22523. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22524. R = C + oe - _ - 1),
  22525. v = 0; v < f; v++,
  22526. ee += 4)
  22527. switch (A = v * re,
  22528. E = 0 | A,
  22529. te = I + (E << 2),
  22530. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22531. P && (x = 1 + E - A,
  22532. S = A + re - E - 1),
  22533. D = m[ee],
  22534. F = m[ee + 1],
  22535. B = m[ee + 2],
  22536. N = m[ee + 3],
  22537. P + O) {
  22538. case 0:
  22539. L[te] += D * ae,
  22540. L[te + 1] += F * ae,
  22541. L[te + 2] += B * ae,
  22542. L[te + 3] += N * ae;
  22543. break;
  22544. case 1:
  22545. T = x * oe,
  22546. L[te] += D * T,
  22547. L[te + 1] += F * T,
  22548. L[te + 2] += B * T,
  22549. L[te + 3] += N * T,
  22550. T = S * oe,
  22551. L[te + 4] += D * T,
  22552. L[te + 5] += F * T,
  22553. L[te + 6] += B * T,
  22554. L[te + 7] += N * T;
  22555. break;
  22556. case 2:
  22557. T = re * M,
  22558. L[te] += D * T,
  22559. L[te + 1] += F * T,
  22560. L[te + 2] += B * T,
  22561. L[te + 3] += N * T,
  22562. T = re * R,
  22563. L[te += J] += D * T,
  22564. L[te + 1] += F * T,
  22565. L[te + 2] += B * T,
  22566. L[te + 3] += N * T;
  22567. break;
  22568. default:
  22569. T = x * M,
  22570. L[te] += D * T,
  22571. L[te + 1] += F * T,
  22572. L[te + 2] += B * T,
  22573. L[te + 3] += N * T,
  22574. T = S * M,
  22575. L[te + 4] += D * T,
  22576. L[te + 5] += F * T,
  22577. L[te + 6] += B * T,
  22578. L[te + 7] += N * T,
  22579. T = x * R,
  22580. L[te += J] += D * T,
  22581. L[te + 1] += F * T,
  22582. L[te + 2] += B * T,
  22583. L[te + 3] += N * T,
  22584. T = S * R,
  22585. L[te + 4] += D * T,
  22586. L[te + 5] += F * T,
  22587. L[te + 6] += B * T,
  22588. L[te + 7] += N * T
  22589. }
  22590. delete m,
  22591. r(),
  22592. z = o(L)
  22593. }
  22594. if (H.putImageData(z, 0, 0),
  22595. "string" == typeof i) {
  22596. var se;
  22597. if ("png" === i || "jpeg" === i)
  22598. return (se = n && t.src ? t : new Image).width = d,
  22599. se.height = p,
  22600. se.src = U.toDataURL("image/" + i, .85),
  22601. se;
  22602. if ("png-src" === i || "jpeg-src" === i)
  22603. return U.toDataURL("image/" + i.split("-")[0], .85)
  22604. }
  22605. return U
  22606. }
  22607. var le = this;
  22608. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22609. exports.scale = e) : c = e
  22610. }
  22611. ).call(this),
  22612. i.exports = c
  22613. }
  22614. , {}],
  22615. 156: [function(i, n, e) {
  22616. (function(e) {
  22617. "use strict";
  22618. function t(e, t) {
  22619. this.model = e,
  22620. this.panos = e.panos,
  22621. this.player = t,
  22622. this.imagePanos = this.listImagePanos(),
  22623. this.retryMinimumTime = 1e4
  22624. }
  22625. var r = (i("three"),
  22626. i("./enum/Viewmode"))
  22627. , o = (i("./settings"),
  22628. i("./objects/Panorama"))
  22629. , a = new (i("./util/logger"))(e);
  22630. t.prototype.start = function() {
  22631. this.loadNextPano(function(e) {
  22632. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22633. setTimeout(function() {
  22634. this.start()
  22635. }
  22636. .bind(this), 1e3))
  22637. }
  22638. .bind(this))
  22639. }
  22640. ,
  22641. t.prototype.validLoadTarget = function(e) {
  22642. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22643. }
  22644. ,
  22645. t.prototype.listImagePanos = function() {
  22646. var i = []
  22647. , n = this;
  22648. return this.model.images.forEach(function(e) {
  22649. if (e.metadata && e.metadata.scan_id) {
  22650. var t = n.model.panos.get(e.metadata.scan_id);
  22651. t && !t.isLoaded("high") && i.push(t)
  22652. }
  22653. }),
  22654. i
  22655. }
  22656. ,
  22657. t.prototype.nextNotLoadedImage = function() {
  22658. for (; 0 < this.imagePanos.length; ) {
  22659. var e = this.imagePanos[0];
  22660. if (!e.isLoaded("high"))
  22661. return e;
  22662. this.imagePanos.shift()
  22663. }
  22664. return null
  22665. }
  22666. ,
  22667. t.prototype.loadNextPano = function(e) {
  22668. var t, i, n = this.model.waitQueue.filter(function(e) {
  22669. return e.object instanceof o
  22670. });
  22671. 0 < n.length ? (t = n[0].object,
  22672. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22673. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22674. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22675. t = this.imagePanos[0],
  22676. a.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())])) && a.debug("Normal pano selection: neighbor " + t.id),
  22677. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22678. a.debug("Preloading " + i + "-res pano " + t.id),
  22679. t.loadCube(i).done(e).fail(function() {
  22680. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22681. e()
  22682. })) : e && e(null)
  22683. }
  22684. ,
  22685. n.exports = t
  22686. }
  22687. ).call(this, "/js/preloaders.js")
  22688. }
  22689. , {
  22690. "./enum/Viewmode": 51,
  22691. "./objects/Panorama": 148,
  22692. "./settings": 166,
  22693. "./util/logger": 189,
  22694. three: 217
  22695. }],
  22696. 157: [function(a, s, e) {
  22697. (function(e) {
  22698. "use strict";
  22699. function t(e, t, i, n, r) {
  22700. this.qualityManager = e,
  22701. this.scene = t,
  22702. this.camera = i,
  22703. this.container = r,
  22704. this.controls = n,
  22705. this.controls.enabled = !0,
  22706. this.controls.locked = !0,
  22707. this.quickstartCamera = n.camera,
  22708. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22709. this.skybox = null
  22710. }
  22711. var i = a("three")
  22712. , n = a("../util/logger")
  22713. , o = a("../constants")
  22714. , h = (a("../util/transitions"),
  22715. a("../util/lerp"),
  22716. a("../util/easing"),
  22717. a("../enum/Vectors"))
  22718. , u = a("../enum/PanoSizeClass")
  22719. , r = (a("../materials/ModelTextureMaterial"),
  22720. a("../materials/CubemapMaterial"))
  22721. , d = (a("../cameras/PanoramaCamera"),
  22722. a("../controls/PanoramaControls"),
  22723. a("../tile/TileUtils"),
  22724. a("../util/camera"),
  22725. a("../util/cameraLight"))
  22726. , p = (a("../util/browser"),
  22727. a("../settings"),
  22728. a("../gui/helpManager"),
  22729. new n(e));
  22730. t.prototype.load = function(e) {
  22731. e.pano.shouldRedrawOnBaseLoaded = !0;
  22732. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22733. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22734. var a = this.qualityManager.getPanoSize(u.BASE)
  22735. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22736. if (e.pano.tiled) {
  22737. p.warn("Loading startPano, TILED", e.pano.id);
  22738. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22739. , c = this.quickstartCamera.fov;
  22740. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22741. t = e.pano.loadTiledPano(s, r, {
  22742. hFov: l,
  22743. vFov: c
  22744. }, !1, !1, !0),
  22745. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22746. } else
  22747. p.warn("Loading startPano", e.pano.id),
  22748. t = e.pano.loadCube("high");
  22749. return $.when(t).then(function() {
  22750. n.init(e.pano, e.quaternion),
  22751. e.pano.tiled ? i.done(function() {
  22752. e.pano.lockUntilRenderingComplete = !1,
  22753. this.controls.locked = !1
  22754. }
  22755. .bind(this)) : this.controls.locked = !1
  22756. }
  22757. .bind(this))
  22758. }
  22759. ,
  22760. t.prototype.init = function(e, t) {
  22761. p.info("Quickstart done loading, adding scene objects"),
  22762. e.lockUntilRenderingComplete = !0,
  22763. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22764. side: i.BackSide
  22765. })),
  22766. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22767. this.skybox.quaternion.copy(e.quaternion),
  22768. this.scene.add(this.skybox),
  22769. $(this.container).show()
  22770. }
  22771. ,
  22772. t.prototype.update = function(e) {
  22773. this.controls.update(e),
  22774. this.camera.copy(this.quickstartCamera)
  22775. }
  22776. ,
  22777. t.prototype.setSize = function(e, t) {
  22778. this.quickstartCamera.updateAspect(e / t)
  22779. }
  22780. ,
  22781. t.prototype.destroy = function() {
  22782. this.scene.remove(this.skybox)
  22783. }
  22784. ,
  22785. s.exports = t
  22786. }
  22787. ).call(this, "/js/scene/QuickstartManager.js")
  22788. }
  22789. , {
  22790. "../cameras/PanoramaCamera": 7,
  22791. "../constants": 8,
  22792. "../controls/PanoramaControls": 13,
  22793. "../enum/PanoSizeClass": 36,
  22794. "../enum/Vectors": 50,
  22795. "../gui/helpManager": 68,
  22796. "../materials/CubemapMaterial": 117,
  22797. "../materials/ModelTextureMaterial": 118,
  22798. "../settings": 166,
  22799. "../tile/TileUtils": 174,
  22800. "../util/browser": 182,
  22801. "../util/camera": 183,
  22802. "../util/cameraLight": 184,
  22803. "../util/easing": 186,
  22804. "../util/lerp": 188,
  22805. "../util/logger": 189,
  22806. "../util/transitions": 195,
  22807. three: 217
  22808. }],
  22809. 158: [function(e, t, i) {
  22810. "use strict";
  22811. function h(e, t, i) {
  22812. this.scene = e,
  22813. this.camera = t,
  22814. this.renderer = null,
  22815. this.effects = i,
  22816. this.animateCallback = null,
  22817. this.composer = null,
  22818. this.qualityManager = null,
  22819. e.renderWidth = 0,
  22820. e.renderHeight = 0,
  22821. this.updateClock = new M.Clock,
  22822. this.components = [],
  22823. this.updateListeners = [],
  22824. this.resizeListeners = [],
  22825. this.forceUpdateSize = !1,
  22826. this.started = !1,
  22827. this.textures = {},
  22828. this.suspendedObjects = []
  22829. }
  22830. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  22831. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22832. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22833. this.components.push(e),
  22834. e.update && this.updateListeners.push(e),
  22835. e.setSize && (this.resizeListeners.push(e),
  22836. this.forceUpdateSize = !0)
  22837. }
  22838. ,
  22839. h.prototype.removeComponent = function(t) {
  22840. function e(e) {
  22841. return e !== t
  22842. }
  22843. this.components = this.components.filter(e),
  22844. this.updateListeners = this.updateListeners.filter(e),
  22845. this.resizeListeners = this.resizeListeners.filter(e)
  22846. }
  22847. ,
  22848. h.prototype.start = function(e) {
  22849. if (this.started)
  22850. throw new l("Can't start SceneRenderer, already started");
  22851. this.createContext(e),
  22852. //u.isMobile() && this.boluoVrInit(),
  22853. this.initComposer(),
  22854. this.started = !0,
  22855. (b = b.bind(this))()
  22856. }
  22857. ,
  22858. h.prototype.createContext = function(e) {
  22859. try {
  22860. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22861. this.renderer.autoClear = !0,
  22862. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22863. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22864. this.emit(r.ContextCreated)
  22865. } catch (e) {
  22866. throw new c("Unable to create a WebGL rendering context")
  22867. }
  22868. d.profiling.enabled && this.overrideTextures(),
  22869. e.appendChild(this.renderer.domElement)
  22870. }
  22871. ,
  22872. h.prototype.overrideTextures = function() {
  22873. var d = this.renderer.context
  22874. , t = 0
  22875. , i = d.createTexture;
  22876. d.createTexture = function() {
  22877. var e = i.call(d);
  22878. return e.id = t++,
  22879. this.textures[e.id] = e
  22880. }
  22881. .bind(this);
  22882. var p = d.texImage2D;
  22883. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22884. var c, h = this.getTextureTypeFromTarget(d, e);
  22885. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22886. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22887. s = r,
  22888. n = (l = o).naturalWidth,
  22889. r = l.naturalHeight,
  22890. p.call(d, e, t, i, a, s, l));
  22891. var u = this.textures[c.id];
  22892. u.width = h === f.TextureCube ? 6 * n : n,
  22893. u.height = r
  22894. }
  22895. .bind(this);
  22896. var n = d.deleteTexture;
  22897. d.deleteTexture = function(e) {
  22898. delete this.textures[e.id],
  22899. n.call(d, e)
  22900. }
  22901. .bind(this)
  22902. }
  22903. ,
  22904. h.prototype.updateTextureMemory = (n = null,
  22905. function() {
  22906. var e = 0;
  22907. for (var t in this.textures) {
  22908. var i = this.textures[t];
  22909. i.width && i.height && (e += i.width * i.height * 4)
  22910. }
  22911. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22912. n = e
  22913. }
  22914. ),
  22915. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22916. switch (t) {
  22917. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22918. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22919. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22920. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22921. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22922. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22923. return f.TextureCube;
  22924. case e.TEXTURE_2D:
  22925. return f.Texture2D;
  22926. default:
  22927. return null
  22928. }
  22929. }
  22930. ,
  22931. h.prototype.initComposer = function() {
  22932. this.composer = new M.EffectComposer(this.renderer),
  22933. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22934. this.composer.addPass(this.effects.hblurPass),
  22935. this.composer.addPass(this.effects.vblurPass)
  22936. }
  22937. ,
  22938. h.prototype.setSize = function(e, t, i) {
  22939. this.renderWidth = e,
  22940. this.renderHeight = t,
  22941. this.effects.aspect = e / t,
  22942. this.renderer.setSize(e, t, !1, i),
  22943. this.composer.setSize(e, t);
  22944. for (var n = 0; n < this.resizeListeners.length; n++)
  22945. this.resizeListeners[n].setSize(e, t)
  22946. }
  22947. ,
  22948. h.prototype.render = function() {
  22949. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22950. }
  22951. ,
  22952. h.prototype.boluoVrInit = function() {
  22953. console.log("boluoVrInit"),
  22954. this.isHuawei5X = u.detectHUAWEI5X(),
  22955. this.oldRenderer = this.renderer,
  22956. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22957. window.panoCamera = this.camera;
  22958. var i = this;
  22959. window._vrEnabled = !1,
  22960. Object.defineProperty(window, "vrEnabled", {
  22961. get: function() {
  22962. return window._vrEnabled
  22963. },
  22964. set: function(e) {
  22965. (e = !!e) ? (i.renderer = i.newRenderer,
  22966. window.vrMarkers.forEach(function(e) {
  22967. e.visible = !0
  22968. })) : (i.renderer = i.oldRenderer,
  22969. window.vrMarkers.forEach(function(e) {
  22970. e.visible = !1
  22971. })),
  22972. i.cursor.visible = e,
  22973. i.setSize($("#player").width(), $("#player").height()),
  22974. window._vrEnabled = e,
  22975. setTimeout(function() {
  22976. console.log(player.cameraControls.activeControl.camera.fov)
  22977. }, 500)
  22978. }
  22979. }),
  22980. this.createCursor(.5, !1, 1, 16777215, 0);
  22981. var e = {
  22982. setSize: function(e, t) {
  22983. i.camera.aspect = e / t
  22984. }
  22985. };
  22986. this.resizeListeners.push(e),
  22987. this.vrLoadingInit()
  22988. }
  22989. ,
  22990. h.prototype.vrLoadingInit = function() {
  22991. var e = new (e = function(camera) {
  22992. var t = this
  22993. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22994. , i = new M.MeshBasicMaterial({
  22995. color: 4967932,
  22996. side: M.DoubleSide
  22997. })
  22998. , n = new M.Mesh(e,i);
  22999. (this.mesh = n).position.z = -2,
  23000. n.scale.set(.08, .08, .08),
  23001. n.visible = !1,
  23002. //window.player.camera.add(n),
  23003. camera.add(n),
  23004. t.enabled = !1,
  23005. this.update = function(e) {
  23006. 1 == t.enabled && (n.rotation.z += 15 * e)
  23007. }
  23008. }
  23009. )(this.camera);
  23010. window.Loading = e,
  23011. this.updateListeners.push(e)
  23012. }
  23013. ,
  23014. h.prototype.createCursor = function(e, t, i, n, r) {
  23015. var o, a = new M.SpriteMaterial({
  23016. opacity: i,
  23017. color: n,
  23018. transparent: t,
  23019. map: this.boluoGetTexture("images/cursor.png"),
  23020. needsUpdate: !0,
  23021. side: M.DoubleSide
  23022. });
  23023. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23024. a.map.repeat = new M.Vector2(1 / 17,1),
  23025. a.depthTest = !1,
  23026. a.blending = M.AdditiveBlending,
  23027. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23028. o.position.z = -2,
  23029. o.visible = !1,
  23030. o.name = "cursor",
  23031. this.camera.add(o),
  23032. this.scene.add(this.camera),
  23033. this.cursor = o;
  23034. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23035. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23036. this.updateListeners.push(s)
  23037. }
  23038. ,
  23039. h.prototype.CursorAnimation = function(e, t, o) {
  23040. this.cursor = t,
  23041. this.raycaster = new M.Raycaster,
  23042. this.targetEventObj = {},
  23043. this.type = 1,
  23044. this.tweenFlag = !0;
  23045. var s = this;
  23046. this.target = o,
  23047. console.log(o.uuid),
  23048. this.euler = new M.Euler,
  23049. this.q0 = new M.Quaternion,
  23050. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23051. this.zee = new M.Vector3(0,0,1),
  23052. this.alpha = -1e3,
  23053. this.beta = -1e3,
  23054. this.gamma = -1e3,
  23055. this.orient = M.Math.degToRad(window.orientation || 0),
  23056. window.addEventListener("orientationchange", function() {
  23057. s.orient = M.Math.degToRad(window.orientation || 0)
  23058. }),
  23059. window.addEventListener("deviceorientation", function(e) {
  23060. var t = M.Math.degToRad(e.alpha)
  23061. , i = M.Math.degToRad(e.beta)
  23062. , n = M.Math.degToRad(e.gamma);
  23063. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23064. -1e3 === s.beta && (s.beta = i),
  23065. -1e3 === s.gamma && (s.gamma = n),
  23066. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23067. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23068. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23069. s.beta = i,
  23070. s.gamma = n),
  23071. h.vrDebug) {
  23072. $("#info-device-orientation").css("display", "block");
  23073. var r = "";
  23074. r += "alpha=(" + s.alpha + ")<BR/>",
  23075. r += "beta=(" + s.beta + ")<BR/>",
  23076. r += "gamma=" + s.gamma + "<BR/>",
  23077. document.getElementById("info-device-orientation").innerHTML = r
  23078. }
  23079. }),
  23080. this.setObjectQuaternion = function(e, t, i, n, r) {
  23081. s.euler.set(i, t, -n, "YXZ"),
  23082. e.setFromEuler(s.euler),
  23083. e.multiply(s.q1),
  23084. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23085. o.updateMatrixWorld()
  23086. }
  23087. ,
  23088. parent !== window && window.addEventListener("message", function(e) {
  23089. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23090. o && o.alpha && o.beta && o.gamma && (t = a,
  23091. i = M.Math.degToRad(o.alpha),
  23092. n = M.Math.degToRad(o.beta),
  23093. r = M.Math.degToRad(o.gamma),
  23094. t ? (-1e3 === s.alpha && (s.alpha = i),
  23095. -1e3 === s.beta && (s.beta = n),
  23096. -1e3 === s.gamma && (s.gamma = r),
  23097. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23098. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23099. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23100. s.beta = n,
  23101. s.gamma = r))
  23102. }),
  23103. this.update = function(e) {
  23104. TWEEN.update(),
  23105. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23106. this.triggerTargetEvent())
  23107. }
  23108. ,
  23109. this.triggerTargetEvent = function() {
  23110. var e = this.choseObj()
  23111. , t = e ? e.object : void 0;
  23112. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23113. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23114. t && t.enabled && this.startAnimate(function() {
  23115. this.clickCallback(t)
  23116. }
  23117. .bind(this))) : this.type,
  23118. this.targetEventObj.lastObj = t)
  23119. }
  23120. ,
  23121. this.choseObj = function() {
  23122. this.raycaster.setFromCamera({
  23123. x: 0,
  23124. y: 0
  23125. }, o);
  23126. var e = (this.raycaster.ray,
  23127. window.vrMarkers)
  23128. , t = this.raycaster.intersectObjects(e);
  23129. if (0 < t.length)
  23130. return t[0]
  23131. }
  23132. ,
  23133. this.clickCallback = function(e) {
  23134. this.runTHREEAction(e, "onclick")
  23135. }
  23136. ,
  23137. this.runTHREEAction = function(e, t) {
  23138. switch (t) {
  23139. case "onclick":
  23140. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23141. e()
  23142. });
  23143. break;
  23144. case "onhover":
  23145. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23146. e()
  23147. });
  23148. break;
  23149. case "onout":
  23150. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23151. e()
  23152. })
  23153. }
  23154. }
  23155. ,
  23156. this.startAnimate = function(e) {
  23157. this.tweenFlag && this.initAnimation(e)
  23158. }
  23159. ,
  23160. this.initAnimation = function(e) {
  23161. var t = this
  23162. , i = this.cursor.material.map.offset;
  23163. t.tweenFlag = !1,
  23164. this.cursorAnimate = new TWEEN.Tween(i).to({
  23165. x: 1
  23166. }, 1e3).onStart(function() {
  23167. t.tweenFlag = !1
  23168. }).onStop(function() {
  23169. t.tweenFlag = !0,
  23170. this.x = 0,
  23171. i.x = 0
  23172. }).onUpdate(function() {}).onComplete(function() {
  23173. e(),
  23174. i.x = 0,
  23175. setTimeout(function() {
  23176. t.tweenFlag = !0
  23177. }, 1500)
  23178. }),
  23179. this.cursorAnimate.easing(function(e) {
  23180. return Math.floor(17 * e) / 17
  23181. }),
  23182. this.cursorAnimate.start()
  23183. }
  23184. ,
  23185. this.autoCursorPosition = function(e) {
  23186. this.cursor.scale.set(.3, .3, .3)
  23187. }
  23188. }
  23189. ,
  23190. h.prototype.vrRenderer = function(a, i, e) {
  23191. var s = new i.vrCamera(e);
  23192. s.bananaAspect = .8,
  23193. this.width,
  23194. this.height;
  23195. i = this;
  23196. this.setSize = function(e, t) {
  23197. a.setSize.call(this, e, t),
  23198. i.width = e,
  23199. i.height = t
  23200. }
  23201. ,
  23202. this.render = function(e, t, i, n) {
  23203. var r, o;
  23204. if (window.cameraQua = t.quaternion.clone(),
  23205. t.__RESS__SKIP__STEREO__)
  23206. return a.render(e, t, i, n);
  23207. if ("PerspectiveCamera" === t.type)
  23208. r = s.cameraL,
  23209. o = s.cameraR,
  23210. e.updateMatrixWorld(),
  23211. null === t.parent && t.updateMatrixWorld(),
  23212. s.vrCameraUpdate(t);
  23213. else {
  23214. if ("OrthographicCamera" !== t.type)
  23215. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23216. r = o = t
  23217. }
  23218. a.setScissorTest(!0),
  23219. a.setScissor(0, 0, this.width / 2, this.height),
  23220. a.setViewport(0, 0, this.width / 2, this.height),
  23221. a.render.call(this, e, r, i, n),
  23222. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23223. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23224. a.render.call(this, e, o, i, n),
  23225. a.setScissorTest(!1)
  23226. }
  23227. ,
  23228. this.__proto__ = {
  23229. __proto__: a
  23230. }
  23231. }
  23232. ,
  23233. h.prototype.vrCamera = function(e) {
  23234. this.type = "StereoCamera",
  23235. this._aspect = 1,
  23236. this._overlap = .064,
  23237. this.cameraL = new M.PerspectiveCamera,
  23238. this.cameraL.layers.enable(1),
  23239. this.cameraL.matrixAutoUpdate = !1,
  23240. this.cameraR = new M.PerspectiveCamera,
  23241. this.cameraR.layers.enable(2),
  23242. this.cameraR.matrixAutoUpdate = !1,
  23243. this.eyeRight = new M.Matrix4,
  23244. this.eyeLeft = new M.Matrix4,
  23245. this.vrCameraNeedsUpdate = !0,
  23246. window.vrCameraL = this.cameraL,
  23247. Object.defineProperty(this, "bananaAspect", {
  23248. get: function() {
  23249. return this._aspect
  23250. },
  23251. set: function(e) {
  23252. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23253. this._aspect = e
  23254. }
  23255. }),
  23256. Object.defineProperty(this, "overlap", {
  23257. get: function() {
  23258. return this._overlap
  23259. },
  23260. set: function(e) {
  23261. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23262. this._overlap = e
  23263. }
  23264. }),
  23265. this.vrCameraUpdate = function(e) {
  23266. if (this.vrCameraNeedsUpdate = !0,
  23267. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23268. this.vrCameraNeedsUpdate) {
  23269. this.vrCameraNeedsUpdate = !1,
  23270. console.debug("vrCameraUpdate"),
  23271. this.bananaFocus = e.focus,
  23272. this.bananaFov = e.fov,
  23273. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23274. this.bananaNear = e.near,
  23275. this.bananaFar = e.far,
  23276. console.debug(e.aspect),
  23277. this.bananaFocus = 10;
  23278. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  23279. this.eyeLeft.elements[12] = -r,
  23280. this.eyeRight.elements[12] = r,
  23281. t = -a * this.bananaReal_aspect + o,
  23282. i = a * this.bananaReal_aspect + o,
  23283. n.elements[0] = 2 * this.bananaNear / (i - t),
  23284. n.elements[8] = (i + t) / (i - t),
  23285. this.cameraL.projectionMatrix.copy(n),
  23286. t = -a * this.bananaReal_aspect - o,
  23287. i = a * this.bananaReal_aspect - o,
  23288. n.elements[0] = 2 * this.bananaNear / (i - t),
  23289. n.elements[8] = (i + t) / (i - t),
  23290. this.cameraR.projectionMatrix.copy(n)
  23291. }
  23292. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23293. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23294. }
  23295. }
  23296. ,
  23297. h.prototype.boluoGetTexture = function(e) {
  23298. var t = new M.TextureLoader;
  23299. return t.crossOrigin = "anonymous",
  23300. t.load(e)
  23301. }
  23302. ,
  23303. h.prototype.updateScreenSize = function(e) {
  23304. var t, i, n, r = !1;
  23305. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23306. n = e.height,
  23307. r = !0,
  23308. t = 1) : (i = $("#player").width(),
  23309. n = $("#player").height(),
  23310. e && e.resize && (o = this.renderWidth,
  23311. a = this.renderHeight),
  23312. i === o && n === a && !this.forceUpdateSize || (o = i,
  23313. a = n,
  23314. r = !0,
  23315. t = window.devicePixelRatio)),
  23316. r && (this.setSize(i, n, t),
  23317. this.forceUpdateSize = !1)
  23318. }
  23319. ,
  23320. h.prototype.updateComponents = function() {
  23321. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23322. this.updateListeners[t].update(e)
  23323. }
  23324. ,
  23325. h.prototype.suspend = function() {
  23326. this.started = !1,
  23327. this.suspendedObjects = this.scene.children.map(function(e) {
  23328. return this.scene.remove(e),
  23329. e
  23330. }
  23331. .bind(this)),
  23332. this.render()
  23333. }
  23334. ,
  23335. h.prototype.resume = function() {
  23336. this.suspendedObjects.forEach(function(e) {
  23337. this.scene.add(e)
  23338. }
  23339. .bind(this)),
  23340. this.suspendedObjects = [],
  23341. this.started = !0,
  23342. b()
  23343. }
  23344. ;
  23345. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23346. this.started && (window.requestAnimationFrame(b),
  23347. this.updateScreenSize(),
  23348. this.updateComponents(),
  23349. this.updateTextureMemory(),
  23350. this.render(),
  23351. this.emit(r.AfterRender))
  23352. };
  23353. h.prototype.getImageData = (E = document.createElement("canvas"),
  23354. _ = E.getContext("2d"),
  23355. function(e, t, i) {
  23356. return E.width === t && E.height === i || (E.width = t,
  23357. E.height = i),
  23358. _.drawImage(e, 0, 0, t, i),
  23359. _.getImageData(0, 0, t, i)
  23360. }
  23361. ),
  23362. h.prototype.initSizedTexture2D = function(e, t, i) {
  23363. var n = this.renderer
  23364. , r = n.context
  23365. , o = n.state
  23366. , a = new M.Texture(null);
  23367. !(a.flipY = !1) !== i && (i = !1),
  23368. a.generateMipmaps = i;
  23369. var s = n.paramThreeToGL(a.format)
  23370. , l = n.paramThreeToGL(a.type)
  23371. , c = n.properties.get(a)
  23372. , h = r.createTexture();
  23373. o.bindTexture(r.TEXTURE_2D, h),
  23374. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23375. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23376. a.wrapS = t,
  23377. a.wrapT = t;
  23378. var u = n.paramThreeToGL(t);
  23379. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23380. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23381. i ? (a.magFilter = M.LinearFilter,
  23382. a.minFilter = M.LinearMipMapLinearFilter,
  23383. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23384. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23385. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23386. a.minFilter = M.LinearFilter,
  23387. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23388. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23389. o.bindTexture(r.TEXTURE_2D, null),
  23390. c.__webglTexture = h,
  23391. a
  23392. }
  23393. ,
  23394. h.prototype.initSizedCubeMap = function(e, t) {
  23395. var i = this.renderer
  23396. , n = i.context
  23397. , r = i.state
  23398. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23399. o.flipY = !1,
  23400. o.generateMipmaps = t;
  23401. var a = i.paramThreeToGL(o.format)
  23402. , s = i.paramThreeToGL(o.type)
  23403. , l = i.properties.get(o)
  23404. , c = n.createTexture();
  23405. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23406. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23407. for (var h = 0; h < 6; h++)
  23408. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23409. return t ? (o.magFilter = M.LinearFilter,
  23410. o.minFilter = M.LinearMipMapLinearFilter,
  23411. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23412. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23413. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23414. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23415. o.minFilter = M.LinearFilter,
  23416. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23417. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23418. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23419. l.__image__webglTextureCube = c,
  23420. o
  23421. }
  23422. ,
  23423. h.prototype.deallocateCubeTexture = function(e) {
  23424. var t = this.renderer
  23425. , i = t.context
  23426. , n = t.properties.get(e);
  23427. i.deleteTexture(n.__image__webglTextureCube)
  23428. }
  23429. ,
  23430. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23431. var a = this.renderer
  23432. , s = a.context
  23433. , l = a.state
  23434. , c = a.properties.get(t);
  23435. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23436. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23437. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23438. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23439. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23440. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23441. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23442. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23443. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23444. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23445. l.bindTexture(s.TEXTURE_2D, null)
  23446. }
  23447. ,
  23448. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23449. var s = this.renderer
  23450. , l = s.context
  23451. , c = s.state
  23452. , h = s.properties.get(t);
  23453. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23454. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23455. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23456. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23457. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23458. }
  23459. ,
  23460. h.prototype.rebuildMipMaps2D = function(e) {
  23461. var t = this.renderer
  23462. , i = t.context
  23463. , n = t.state;
  23464. t.properties.get(e),
  23465. i.generateMipmap(i.TEXTURE_2D),
  23466. n.bindTexture(i.TEXTURE_2D, null)
  23467. }
  23468. ,
  23469. h.prototype.rebuildMipMaps3D = function(e) {
  23470. var t = this.renderer
  23471. , i = t.context
  23472. , n = t.state
  23473. , r = t.properties.get(e);
  23474. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23475. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23476. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23477. }
  23478. ,
  23479. h.prototype.renderToCubeMap = (P = !1,
  23480. F = N = D = L = O = null,
  23481. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23482. this.renderer.context,
  23483. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23484. (O = new M.Scene).add(L),
  23485. D = new M.ShaderMaterial({
  23486. uniforms: {
  23487. tDiffuse: {
  23488. type: "t",
  23489. value: null
  23490. },
  23491. alpha: {
  23492. type: "f",
  23493. value: 1
  23494. }
  23495. },
  23496. vertexShader: R.basicTextured.vertexShader,
  23497. fragmentShader: R.basicTextured.fragmentShader,
  23498. depthWrite: !1,
  23499. depthTest: !1,
  23500. side: M.DoubleSide
  23501. }),
  23502. N = new M.PlaneBufferGeometry(1,1),
  23503. (F = new M.Mesh(N,D)).position.z = 0,
  23504. O.add(F),
  23505. P = !0);
  23506. var m = N.getAttribute("uv");
  23507. m.setDynamic(!0),
  23508. m.needsUpdate = !0;
  23509. var v = m.array
  23510. , y = r / i
  23511. , A = o / n
  23512. , C = a / i
  23513. , I = s / n;
  23514. v[0] = y,
  23515. v[1] = A + I,
  23516. v[2] = y + C,
  23517. v[3] = A + I,
  23518. v[4] = y,
  23519. v[5] = A,
  23520. v[6] = y + C,
  23521. v[7] = A;
  23522. var E = N.getAttribute("position");
  23523. E.setDynamic(!0),
  23524. E.needsUpdate = !0;
  23525. var _ = E.array
  23526. , b = l / t.width - .5
  23527. , w = c / t.height - .5
  23528. , T = h / t.width
  23529. , x = u / t.height;
  23530. _[0] = b,
  23531. _[1] = w + x,
  23532. _[3] = b + T,
  23533. _[4] = w + x,
  23534. _[6] = b,
  23535. _[7] = w,
  23536. _[9] = b + T,
  23537. _[10] = w,
  23538. this.renderer.properties.get(e),
  23539. D.uniforms.tDiffuse.value = e,
  23540. D.blending = p || M.NoBlending,
  23541. D.transparent = !!f,
  23542. null != g || (g = 1),
  23543. D.uniforms.alpha.value = g,
  23544. D.needUpdate = !0,
  23545. t.activeCubeFace = d,
  23546. t.viewport.set(0, 0, t.width, t.height);
  23547. var S = this.renderer.autoClear;
  23548. this.renderer.autoClear = !1,
  23549. this.renderer.render(O, L, t, !1),
  23550. this.renderer.autoClear = S
  23551. }
  23552. ),
  23553. h.prototype.copyCubeMap = (g = !1,
  23554. C = A = y = v = m = null,
  23555. I = new M.Euler,
  23556. new M.Vector3,
  23557. function(e, t, i, n, r, o, a, s, l) {
  23558. this.renderer,
  23559. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23560. (m = new M.Scene).add(v),
  23561. y = new M.ShaderMaterial({
  23562. uniforms: {
  23563. tDiffuse: {
  23564. type: "t",
  23565. value: null
  23566. },
  23567. alpha: {
  23568. type: "f",
  23569. value: 1
  23570. }
  23571. },
  23572. vertexShader: R.copyCubeMap.vertexShader,
  23573. fragmentShader: R.copyCubeMap.fragmentShader,
  23574. depthWrite: !1,
  23575. depthTest: !1,
  23576. side: M.DoubleSide
  23577. }),
  23578. A = new M.BoxGeometry(2,2,2),
  23579. C = new M.Mesh(A,y),
  23580. m.add(C),
  23581. g = !0);
  23582. for (var c = 0; c < 6; c++)
  23583. h.getCubeOrientationForCubeFace(c, I),
  23584. C.rotation.copy(I),
  23585. C.matrixWorldNeedsUpdate = !0,
  23586. C.updateMatrixWorld(),
  23587. y.uniforms.tDiffuse.value = e,
  23588. y.blending = a || M.NoBlending,
  23589. y.transparent = !!s,
  23590. null != l || (l = 1),
  23591. y.uniforms.alpha.value = l,
  23592. y.needUpdate = !0,
  23593. t.activeCubeFace = c,
  23594. t.viewport.set(0, 0, r, o),
  23595. this.renderer.render(m, v, t, !1)
  23596. }
  23597. ),
  23598. h.getLookAtForCubeFace = function(e, t) {
  23599. switch (e) {
  23600. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23601. t.set(1, 0, 0);
  23602. break;
  23603. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23604. t.set(-1, 0, 0);
  23605. break;
  23606. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23607. t.set(0, 1, 0);
  23608. break;
  23609. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23610. t.set(0, -1, 0);
  23611. break;
  23612. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23613. t.set(0, 0, 1);
  23614. break;
  23615. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23616. t.set(0, 0, -1)
  23617. }
  23618. }
  23619. ,
  23620. h.getCubeOrientationForCubeFace = function(e, t) {
  23621. switch (e) {
  23622. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23623. t.set(0, -Math.PI / 2, 0);
  23624. break;
  23625. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23626. t.set(0, Math.PI / 2, 0);
  23627. break;
  23628. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23629. t.set(Math.PI / 2, Math.PI, 0);
  23630. break;
  23631. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23632. t.set(-Math.PI / 2, Math.PI, 0);
  23633. break;
  23634. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23635. t.set(0, -Math.PI, 0);
  23636. break;
  23637. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23638. t.set(0, 0, 0)
  23639. }
  23640. }
  23641. ,
  23642. t.exports = h
  23643. }
  23644. , {
  23645. "../enum/GLCubeFaces": 25,
  23646. "../enum/GLTextureType": 26,
  23647. "../enum/SceneRendererEvents": 43,
  23648. "../exception/BasicException": 55,
  23649. "../exception/RendererCreationException": 57,
  23650. "../settings": 166,
  23651. "../shaders": 167,
  23652. "../util/browser": 182,
  23653. events: 202,
  23654. three: 217
  23655. }],
  23656. 159: [function(e, t, i) {
  23657. "use strict";
  23658. function n(e) {
  23659. this.messenger = new a(e),
  23660. this.clientKey = null
  23661. }
  23662. var o = e("../util/ajax")
  23663. , r = e("./PostMessageType")
  23664. , a = e("./postmessage")
  23665. , s = e("./VersionInfo")
  23666. , l = e("events").EventEmitter
  23667. , c = window.location.origin + "/api/v1/user/";
  23668. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23669. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23670. }
  23671. ,
  23672. n.prototype.waitForConnection = function() {
  23673. return new Promise(function(t, i) {
  23674. this.messenger.on(r.CONNECT, function(e) {
  23675. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23676. }
  23677. .bind(this))
  23678. }
  23679. .bind(this))
  23680. }
  23681. ,
  23682. n.prototype.onConnectionReceived = function(i) {
  23683. return this.messenger.setTarget(i.source, i.origin),
  23684. this.verifyConnection(i).then(function(e, t) {
  23685. this.messenger.send({
  23686. type: r.ACCEPT,
  23687. toId: i.fromId,
  23688. warning: t
  23689. }),
  23690. this.clientKey = e,
  23691. this.messenger.removeAllListeners(r.CONNECT),
  23692. this.bindEvents()
  23693. }
  23694. .bind(this), function(e) {
  23695. this.messenger.send({
  23696. type: r.REJECT,
  23697. toId: i.fromId,
  23698. reason: e
  23699. }),
  23700. this.messenger.setTarget()
  23701. }
  23702. .bind(this))
  23703. }
  23704. ,
  23705. n.prototype.verifyConnection = function(r) {
  23706. return new Promise(function(e, t) {
  23707. var i;
  23708. if (s.isDeprecated(r.sdkVersion))
  23709. i = "这个版本正在被弃用";
  23710. else if (!s.isSupported(r.sdkVersion))
  23711. return t("不支持此版本的SDK");
  23712. var n = {
  23713. cache: !1,
  23714. headers: {
  23715. "X-port-Application-Key": r.applicationKey,
  23716. "X-port-Referrer": r.origin
  23717. }
  23718. };
  23719. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23720. }
  23721. )
  23722. }
  23723. ,
  23724. n.prototype.onMessageReceived = function(t) {
  23725. if (this.validateClientApplicationKey(t.applicationKey)) {
  23726. var i = this;
  23727. t.onDone = function(e) {
  23728. e.toId = t.fromId,
  23729. e.uid = t.uid,
  23730. e.type = r.RESPONSE,
  23731. i.messenger.send(e)
  23732. }
  23733. ,
  23734. this.emit(r.ACTION, t)
  23735. }
  23736. }
  23737. ,
  23738. n.prototype.validateClientApplicationKey = function(e) {
  23739. return this.clientKey === e
  23740. }
  23741. ,
  23742. n.prototype.sendEvent = function(e, t) {
  23743. this.messenger.send({
  23744. type: r.EVENT,
  23745. eventType: e,
  23746. eventData: t
  23747. })
  23748. }
  23749. ,
  23750. t.exports = n
  23751. }
  23752. , {
  23753. "../util/ajax": 181,
  23754. "./PostMessageType": 160,
  23755. "./VersionInfo": 163,
  23756. "./postmessage": 165,
  23757. events: 202
  23758. }],
  23759. 160: [function(e, t, i) {
  23760. "use strict";
  23761. t.exports = Object.freeze({
  23762. CONNECT: "postmessage.connect",
  23763. ACCEPT: "postmessage.accept",
  23764. REJECT: "postmessage.reject",
  23765. ACTION: "postmessage.action",
  23766. RESPONSE: "postmessage.response",
  23767. EVENT: "postmessage.event"
  23768. })
  23769. }
  23770. , {}],
  23771. 161: [function(e, t, i) {
  23772. "use strict";
  23773. t.exports = Object.freeze({
  23774. MOVE: "sdk.move",
  23775. ENTER_PANO: "sdk.enterpano",
  23776. MODEL_LOADED: "sdk.modelloaded"
  23777. })
  23778. }
  23779. , {}],
  23780. 162: [function(e, t, i) {
  23781. "use strict";
  23782. t.exports = Object.freeze({
  23783. FLY: "transition.fly",
  23784. FADEOUT: "transition.fade",
  23785. INSTANT: "transition.instant"
  23786. })
  23787. }
  23788. , {}],
  23789. 163: [function(e, t, i) {
  23790. "use strict";
  23791. t.exports = {
  23792. current: "1.0",
  23793. supported: ["1.0"],
  23794. deprecated: [],
  23795. isSupported: function(e) {
  23796. return -1 !== this.supported.indexOf(e)
  23797. },
  23798. isDeprecated: function(e) {
  23799. return -1 !== this.deprecated.indexOf(e)
  23800. },
  23801. isValid: function(e) {
  23802. return this.isSupported(e) || this.isDeprecated(e)
  23803. }
  23804. }
  23805. }
  23806. , {}],
  23807. 164: [function(q, X, e) {
  23808. (function(e) {
  23809. "use strict";
  23810. function r(e, t, i) {
  23811. e = e && e.toLowerCase().trim();
  23812. var n = new C.UP.clone
  23813. , r = Math.PI / 3
  23814. , o = Math.PI / 2;
  23815. switch (e) {
  23816. case "left":
  23817. i.copy(t),
  23818. i.applyAxisAngle(n, o);
  23819. break;
  23820. case "right":
  23821. i.copy(t),
  23822. i.applyAxisAngle(n, -o);
  23823. break;
  23824. case "forwardleft":
  23825. i.copy(t),
  23826. i.applyAxisAngle(n, r);
  23827. break;
  23828. case "forwardright":
  23829. i.copy(t),
  23830. i.applyAxisAngle(n, -r);
  23831. break;
  23832. case "forward":
  23833. default:
  23834. i.copy(t)
  23835. }
  23836. return i
  23837. }
  23838. function o(e, t) {
  23839. if (e) {
  23840. var i = {
  23841. pano: e,
  23842. lookAtPoint: null,
  23843. duration: null,
  23844. maxDistanceOverride: null,
  23845. skipWarpingCheck: !1
  23846. };
  23847. this.player.flyToPano(i, function() {
  23848. t && t({
  23849. success: !0,
  23850. message: "Transition complete."
  23851. })
  23852. })
  23853. } else
  23854. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23855. t && t({
  23856. success: !1,
  23857. error: "Unable to find pano."
  23858. })
  23859. }
  23860. function a(e, t) {
  23861. t.copy(C.FORWARD),
  23862. e.getDirection(t)
  23863. }
  23864. function c(i) {
  23865. return {
  23866. panos: i.panos.list.map(function(e) {
  23867. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23868. return {
  23869. uuid: e.id,
  23870. aligned: e.alignmentType === g.ALIGNED,
  23871. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23872. position: function(e) {
  23873. return e.alignmentType !== g.ALIGNED ? null : {
  23874. x: e.position.x,
  23875. y: e.position.y,
  23876. z: e.position.z
  23877. }
  23878. }(e),
  23879. rotation: function(e) {
  23880. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23881. return {
  23882. x: h.Math.radToDeg(t._x),
  23883. y: h.Math.radToDeg(t._y),
  23884. z: h.Math.radToDeg(t._z)
  23885. }
  23886. }(e),
  23887. thumbnail: t
  23888. }
  23889. })
  23890. }
  23891. }
  23892. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  23893. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23894. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23895. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23896. N.angle = 0,
  23897. N.angleTravelled = 0,
  23898. N.playerDirection = new h.Vector3,
  23899. N.lastFacingDirection = new h.Vector3,
  23900. N.onDone = null,
  23901. N.player = null,
  23902. N.start = function(e, t, i, n) {
  23903. N.active = !0,
  23904. e && t && (t = 0),
  23905. N.angle = e || t,
  23906. N.xAngle = e,
  23907. N.yAngle = t,
  23908. N.angleTravelled = 0,
  23909. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23910. i.getDirection(N.playerDirection),
  23911. N.lastFacingDirection.copy(N.playerDirection),
  23912. N.projectVectors(),
  23913. N.onDone = n,
  23914. N.player = i,
  23915. N()
  23916. }
  23917. ,
  23918. N.projectVectors = function() {
  23919. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23920. N.lastFacingDirection.projectOnPlane(C.UP))
  23921. }
  23922. ,
  23923. N), P = (i = new h.Vector3,
  23924. function(e) {
  23925. e ? (i.copy(e.position),
  23926. i.add(e.discPosition),
  23927. s.projectPositionToCanvas(i, this.player.camera, i),
  23928. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23929. }
  23930. ), O = (l = new h.Vector3,
  23931. function(e) {
  23932. var t = this.player.getDirection();
  23933. l.copy(t);
  23934. var i = l.y;
  23935. l.y = 0,
  23936. l.normalize();
  23937. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23938. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23939. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23940. 0;
  23941. this.player.mode === I.DOLLHOUSE && (n = -n);
  23942. var r = function() {
  23943. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23944. }
  23945. .call(this) - .1
  23946. , o = function() {
  23947. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23948. }
  23949. .call(this) + .1
  23950. , a = n + e;
  23951. r < a ? a = r : a < o && (a = o);
  23952. var s = a - n;
  23953. return 0 < e && s < .01 && (s = 0),
  23954. e < 0 && -.01 < s && (s = 0),
  23955. s
  23956. }
  23957. ), L = (t = new h.Euler,
  23958. function(e) {
  23959. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23960. {
  23961. position: {
  23962. x: e.position.x,
  23963. y: e.position.y,
  23964. z: e.position.z
  23965. },
  23966. rotation: {
  23967. x: h.Math.radToDeg(t.x),
  23968. y: h.Math.radToDeg(t.y),
  23969. z: 0
  23970. },
  23971. pano: e.currentPano ? e.currentPano.id : null,
  23972. mode: e.mode
  23973. }
  23974. }
  23975. ), D = null;
  23976. function N() {
  23977. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23978. N.player.getDirection(N.playerDirection),
  23979. N.projectVectors();
  23980. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23981. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23982. N.onDone && (0,
  23983. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23984. window.setTimeout(N, 4))
  23985. }
  23986. X.exports = {
  23987. init: function(e, t, i, n, r) {
  23988. Y.init(e, t, i, r),
  23989. D = new Promise(function(e, t) {
  23990. i.on(_.Ready, function() {
  23991. e()
  23992. })
  23993. }
  23994. .bind(this));
  23995. var o = new u(window)
  23996. , a = o.waitForConnection();
  23997. a.then(function(e) {
  23998. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23999. });
  24000. var s, l = (s = Date.now(),
  24001. function() {
  24002. if (!(Date.now() - s < 100)) {
  24003. var e = L(i);
  24004. o.sendEvent(b.MOVE, {
  24005. state: e
  24006. }),
  24007. s = Date.now()
  24008. }
  24009. }
  24010. );
  24011. i.on(_.Move, l),
  24012. i.on(_.ViewChanged, l),
  24013. n.on(p.ActiveModelChanged, function(e) {
  24014. function t(e) {
  24015. var t, i = e.newPano.id;
  24016. e.oldPano && (t = e.oldPano.id),
  24017. i !== t && o.sendEvent(b.ENTER_PANO, {
  24018. oldPano: t,
  24019. newPano: i
  24020. })
  24021. }
  24022. var i = e.model
  24023. , n = e.oldModel;
  24024. Y.model = i,
  24025. a.then(function() {
  24026. o.sendEvent(b.MODEL_LOADED, {
  24027. metadata: c(i)
  24028. })
  24029. }),
  24030. n && n.panos.forEach(function(e) {
  24031. e.removeEventListener("enter", t)
  24032. }),
  24033. i.panos.forEach(function(e) {
  24034. e.on("enter", t)
  24035. })
  24036. })
  24037. }
  24038. };
  24039. var F, B, V, k, U, H, z, G, W, j, Y = {
  24040. director: null,
  24041. player: null,
  24042. controls: null,
  24043. sceneRenderer: null,
  24044. model: null,
  24045. init: function(e, t, i, n) {
  24046. this.director = e,
  24047. this.player = i,
  24048. this.controls = t,
  24049. this.sceneRenderer = n
  24050. },
  24051. handleToObject: {},
  24052. objectToHandle: {},
  24053. handleCount: 0,
  24054. onMessageReceive: function(e) {
  24055. if (e) {
  24056. var t = e.targetFunction
  24057. , i = e.params
  24058. , n = e.onDone;
  24059. t && this[t] && this[t](i, n)
  24060. }
  24061. },
  24062. waitForInit: function(e, t) {
  24063. D.then(t.bind({
  24064. success: !0,
  24065. message: "Init complete."
  24066. }))
  24067. },
  24068. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24069. j = new h.Quaternion,
  24070. function(e, t) {
  24071. var i = e.pano
  24072. , n = e.rotation
  24073. , r = e.transition;
  24074. if (!this.model)
  24075. return t({
  24076. success: !1,
  24077. error: "The model has not been loaded yet"
  24078. });
  24079. var o = this.model.panos.get(i);
  24080. if (!o)
  24081. return t({
  24082. success: !1,
  24083. error: i + " does not exist in this model"
  24084. });
  24085. if (!n)
  24086. return t({
  24087. sucess: !1,
  24088. erorr: n + " is not a valid rotation"
  24089. });
  24090. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24091. console.log(n.z);
  24092. var a = {
  24093. success: !0,
  24094. message: i
  24095. };
  24096. if (r === v.FADEOUT)
  24097. j.setFromEuler(W),
  24098. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24099. else {
  24100. var s, l;
  24101. r === v.INSTANT && (l = s = 0);
  24102. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24103. this.player.flyToPano({
  24104. pano: o,
  24105. lookAtPoint: c,
  24106. duration: s,
  24107. aimDuration: l
  24108. }, t.bind(this, a))
  24109. }
  24110. }
  24111. ),
  24112. moveInDirection: function(e, t) {
  24113. var i = e.direction;
  24114. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24115. void (t && t({
  24116. success: !1,
  24117. error: "Invalid direction."
  24118. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24119. t(e ? {
  24120. success: !0,
  24121. message: "moved " + i
  24122. } : {
  24123. success: !1,
  24124. error: "Cannot move in direction: " + i
  24125. })
  24126. })
  24127. },
  24128. getPose: function(e, t) {
  24129. return this.player.camera.position,
  24130. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24131. t({
  24132. success: !0,
  24133. message: L(this.player)
  24134. })
  24135. },
  24136. takeScreenShot: (z = new h.PerspectiveCamera,
  24137. G = new h.WebGLRenderTarget,
  24138. function(e, t) {
  24139. if (!e.resolution)
  24140. return t({
  24141. success: !1,
  24142. error: "An invalid resolution was specified"
  24143. });
  24144. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24145. var i = this.sceneRenderer.renderer.getSize();
  24146. e.resolution.width = i.width,
  24147. e.resolution.height = i.height
  24148. }
  24149. z.layers.set(T.DEFAULT),
  24150. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24151. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24152. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24153. var n = e.resolution.width
  24154. , r = e.resolution.height
  24155. , o = n / r;
  24156. z.position.copy(this.sceneRenderer.camera.position),
  24157. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24158. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24159. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24160. G.setSize(n, r),
  24161. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24162. var a = new Uint8Array(n * r * 4);
  24163. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24164. var s = S.encode({
  24165. data: a,
  24166. width: n,
  24167. height: r,
  24168. heading: 180,
  24169. pitch: 0
  24170. }, {
  24171. quality: 75,
  24172. flipY: !0
  24173. });
  24174. t({
  24175. success: !0,
  24176. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24177. })
  24178. }
  24179. ),
  24180. findRankedPano: (U = new h.Vector3,
  24181. H = new h.Vector3,
  24182. function(e, t) {
  24183. a(this.player, H),
  24184. r(t, H, U);
  24185. var i = this.player.rankedPanoInDirection(e, U);
  24186. if (i) {
  24187. var n = this.objectToHandle[i.id];
  24188. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24189. this.handleToObject[n] = i),
  24190. n
  24191. }
  24192. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24193. -1
  24194. }
  24195. ),
  24196. findRankedtag: (V = new h.Vector3,
  24197. k = new h.Vector3,
  24198. function(e, t) {
  24199. a(this.player, k),
  24200. r(t, k, V);
  24201. var i = this.player.rankedtagInDirection(e, V);
  24202. if (i) {
  24203. var n = this.objectToHandle[i.sid];
  24204. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24205. this.handleToObject[n] = i),
  24206. n
  24207. }
  24208. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24209. -1
  24210. }
  24211. ),
  24212. clickNearesttag: function(e) {
  24213. this.clickRankedtag(0, e)
  24214. },
  24215. clickRankedtag: function(e, t) {
  24216. var i = function(e, t) {
  24217. var i = this.findRankedtag(e, t);
  24218. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24219. null)
  24220. }
  24221. .call(this, e, t);
  24222. i && P.call(this, i)
  24223. },
  24224. clickNearestPano: function(e, t) {
  24225. this.clickRankedPano(0, e, t)
  24226. },
  24227. clickRankedPano: function(e, t, i) {
  24228. var n = function(e, t) {
  24229. var i = this.findRankedPano(e, t);
  24230. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24231. null)
  24232. }
  24233. .call(this, e, t);
  24234. n ? o.call(this, n, i) : i(null)
  24235. },
  24236. clickPano: function(e, t) {
  24237. var i = this.handleTable[e];
  24238. i ? o.call(this, i, t) : t(null)
  24239. },
  24240. rotateDirection: function(e, t) {
  24241. var i = e.direction
  24242. , n = e.angle;
  24243. if (!R.active) {
  24244. var r = 0
  24245. , o = 0
  24246. , a = 0
  24247. , s = 0;
  24248. if (!n || isNaN(n))
  24249. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24250. void (t && t({
  24251. success: !1,
  24252. error: "Invalid rotation angle."
  24253. }));
  24254. if (this.player.mode === I.TRANSITIONING)
  24255. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24256. void (t && t({
  24257. success: !1,
  24258. error: "Cannot rotate while transitioning"
  24259. }));
  24260. if (i === m.RIGHT || i === m.LEFT)
  24261. i === m.RIGHT && (n = -n),
  24262. r = 0 < n ? -1 : 1,
  24263. a = n;
  24264. else {
  24265. if (i !== m.UP && i !== m.DOWN)
  24266. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24267. void (t && t({
  24268. success: !1,
  24269. error: "Invalid direction for rotation."
  24270. }));
  24271. if (this.player.mode === I.FLOORPLAN)
  24272. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24273. void (t && t({
  24274. success: !1,
  24275. error: "Cannot rotate " + i + " in floorplan mode"
  24276. }));
  24277. if (i === m.DOWN && (n = -n),
  24278. 0 === (n = O.call(this, n)))
  24279. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24280. void (t && t({
  24281. success: !1,
  24282. error: "Already at maximum rotation in direction: " + i
  24283. }));
  24284. o = 0 < n ? 1 : -1,
  24285. s = n
  24286. }
  24287. var l = n;
  24288. n = h.Math.degToRad(n),
  24289. a = h.Math.degToRad(a),
  24290. s = h.Math.degToRad(s);
  24291. var c = this.controls.activeControl;
  24292. c.startRotating(r, o),
  24293. R.start(a, s, this.player, function() {
  24294. c.stopRotating(!0),
  24295. t && t({
  24296. success: !0,
  24297. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24298. })
  24299. })
  24300. }
  24301. },
  24302. rotate: (F = new h.Vector3,
  24303. B = new h.Vector3,
  24304. function(e, t) {
  24305. var i = e.xAngle
  24306. , n = e.yAngle;
  24307. if (!R.active) {
  24308. if (i = i || 0,
  24309. n = n || 0,
  24310. isNaN(i) || isNaN(n))
  24311. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24312. void (t && t({
  24313. success: !1,
  24314. error: "Invalid rotation angle."
  24315. }));
  24316. if (this.player.mode === I.TRANSITIONING)
  24317. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24318. void (t && t({
  24319. success: !1,
  24320. error: "Cannot rotate while transitioning"
  24321. }));
  24322. Math.abs(i) < .01 && (i = 0),
  24323. Math.abs(n) < .01 && (n = 0);
  24324. var r = n;
  24325. n = O.call(this, n);
  24326. var o = 0 < r ? "UP" : "DOWN";
  24327. if (!(i = -i) && r && !n)
  24328. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24329. void (t && t({
  24330. success: !1,
  24331. error: "Already at maximum rotation in direction: " + o
  24332. }));
  24333. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24334. var a = n;
  24335. n = h.Math.degToRad(n),
  24336. i = h.Math.degToRad(i),
  24337. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24338. this.player.getDirection(F),
  24339. B.copy(F).applyAxisAngle(C.UP, i),
  24340. B.applyAxisAngle(C.RIGHT, n);
  24341. var s = (F.angleTo(B),
  24342. 0 < i ? -1 : i < 0 ? 1 : 0)
  24343. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24344. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24345. var c = this.controls.activeControl;
  24346. c.startRotating(s, l),
  24347. R.start(i, n, this.player, function() {
  24348. c.stopRotating(!0),
  24349. t && t({
  24350. success: !0,
  24351. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24352. })
  24353. })
  24354. }
  24355. }
  24356. ),
  24357. panCamera: function(e, i) {
  24358. function t(e) {
  24359. switch (r.removeAllListeners(w.AutoPanComplete),
  24360. r.removeAllListeners(w.AutoPanInterrupt),
  24361. r.removeAllListeners(w.AutoPanClamped),
  24362. e) {
  24363. case w.AutoPanInterrupt:
  24364. i({
  24365. success: !0,
  24366. message: "Camera panning interrupted."
  24367. });
  24368. break;
  24369. case w.AutoPanClamped:
  24370. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24371. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24372. return void i({
  24373. success: !1,
  24374. error: "Already at edge of current model bounds."
  24375. });
  24376. var t = "The view point is outside the bounds for the current model. ";
  24377. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24378. console.warn(t)
  24379. }
  24380. case w.AutoPanComplete:
  24381. i({
  24382. success: !0,
  24383. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24384. })
  24385. }
  24386. }
  24387. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24388. return i({
  24389. success: !1,
  24390. error: "Camera panning is not available in the current mode: " + this.player.mode
  24391. });
  24392. var n = e.position
  24393. , r = this.player.control;
  24394. r.setAutoPanPosition(n.x, n.z),
  24395. r.autoPan = !0;
  24396. var o = function(e, t) {
  24397. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24398. };
  24399. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24400. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24401. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24402. },
  24403. click: function(e, t) {
  24404. var i = e.x
  24405. , n = e.y;
  24406. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24407. n = n / 100 * $("#player").height()),
  24408. this.player.handleInputStart(i, n),
  24409. this.player.updateIntersect(),
  24410. this.player.handleInputEnd(i, n)
  24411. },
  24412. mouseOver: function(e, t) {
  24413. var i = e.x
  24414. , n = e.y;
  24415. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24416. n = n / 100 * $("#player").height()),
  24417. this.player.handleInputMove(i, n),
  24418. this.player.updateIntersect()
  24419. },
  24420. moveToMode: function(e, t) {
  24421. function i(e) {
  24422. t(e ? {
  24423. success: !1,
  24424. error: "Failed to load new mode: " + e
  24425. } : {
  24426. success: !0,
  24427. message: "Moved to new mode: " + n
  24428. })
  24429. }
  24430. var n = e.mode;
  24431. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24432. i()
  24433. }, function(e) {
  24434. i(e)
  24435. }) : t({
  24436. success: !1,
  24437. error: "Invalid mode selection"
  24438. })
  24439. }
  24440. }
  24441. }
  24442. ).call(this, "/js/sdk/automation.js")
  24443. }
  24444. , {
  24445. "../constants": 8,
  24446. "../enum/AlignmentType": 17,
  24447. "../enum/ControlEvents": 21,
  24448. "../enum/Direction": 22,
  24449. "../enum/GLCubeFaces": 25,
  24450. "../enum/Keys": 30,
  24451. "../enum/ModelManagerEvents": 33,
  24452. "../enum/PlayerEvents": 40,
  24453. "../enum/RenderLayers": 41,
  24454. "../enum/Vectors": 50,
  24455. "../enum/Viewmode": 51,
  24456. "../enum/WarpStyle": 52,
  24457. "../lib/jpeg_encoder": 94,
  24458. "../sdk/SdkEvents": 161,
  24459. "../settings": 166,
  24460. "../util/common": 185,
  24461. "../util/logger": 189,
  24462. "../util/math": 190,
  24463. "../util/panorama": 191,
  24464. "./ApiHost": 159,
  24465. "./PostMessageType": 160,
  24466. "./TransitionStyles": 162,
  24467. three: 217
  24468. }],
  24469. 165: [function(e, t, i) {
  24470. "use strict";
  24471. function n(e) {
  24472. this.sourceWindow = e,
  24473. this.targetWindow = null,
  24474. this.targetOrigin = null,
  24475. this.id = Math.floor(1e5 * Math.random()),
  24476. this.bindEvents()
  24477. }
  24478. var r = e("./PostMessageType")
  24479. , o = e("events").EventEmitter;
  24480. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24481. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24482. }
  24483. ,
  24484. n.prototype.setTarget = function(e, t) {
  24485. this.targetWindow = e,
  24486. this.targetOrigin = t
  24487. }
  24488. ,
  24489. n.prototype.onPostmessageReceived = function(e) {
  24490. var t = e.origin || e.originalEvent.origin
  24491. , i = e.source;
  24492. switch (e.data.type) {
  24493. case r.CONNECT:
  24494. break;
  24495. case r.RESPONSE:
  24496. if (this.id !== e.data.toId)
  24497. return;
  24498. default:
  24499. if (!this.validateMessageOrigin(t))
  24500. return
  24501. }
  24502. var n = e.data;
  24503. n.source = i,
  24504. n.origin = t,
  24505. n.timestamp = Date.now(),
  24506. this.emit(e.data.type, n)
  24507. }
  24508. ,
  24509. n.prototype.validateMessageOrigin = function(e) {
  24510. return "*" === this.targetOrigin || e === this.targetOrigin
  24511. }
  24512. ,
  24513. n.prototype.send = function(e) {
  24514. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24515. this.targetWindow.postMessage(e, this.targetOrigin))
  24516. }
  24517. ,
  24518. t.exports = n
  24519. }
  24520. , {
  24521. "./PostMessageType": 160,
  24522. events: 202
  24523. }],
  24524. 166: [function(e, t, i) {
  24525. "use strict";
  24526. var n = e("three")
  24527. , r = e("./util/browser")
  24528. , o = e("./enum/Viewmode")
  24529. , a = e("./enum/VROption")
  24530. , s = e("./enum/Colors")
  24531. , l = e("./enum/WarpStyle")
  24532. , c = e("./util/easing")
  24533. , h = e("./util/common")
  24534. , u = e("./util/showcase")
  24535. , d = e("./constants")
  24536. , p = {
  24537. debug: !1,
  24538. version: "2.25.6-0-gd87e5b1",
  24539. languageTag: r.valueFromHash("lang", null),
  24540. pageTitle: "四维虚拟漫游",
  24541. authorizationHeader: u.getAuthorizationHeader(),
  24542. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24543. logLevel: r.valueFromHash("log", 2),
  24544. skyboxRadius: 2500,
  24545. modelBoundsPadding: 5,
  24546. showNeighbors: !1,
  24547. brand: r.valueFromHash("brand", !0),
  24548. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24549. startHighlights: r.valueFromHash("hl", -1),
  24550. specialEdition: r.valueFromHash("bn", 0),
  24551. useWheel: r.valueFromHash("wh", !0),
  24552. crossOrigin: "anonymous",
  24553. fancierTransition: !1,
  24554. wireframe: !1,
  24555. skyboxWireframe: !1,
  24556. modelAlpha: 1,
  24557. highlightPanoSelection: !1,
  24558. showSweeps: !0,
  24559. showSkyboxes: !1,
  24560. showMesh: !0,
  24561. showFloors: !1,
  24562. showFloorDuration: 300,
  24563. showFloorDelay: 300,
  24564. hideFloorDuration: 300,
  24565. hideFloorDelay: 0,
  24566. reticuleOpacityTransitionTime: 250,
  24567. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24568. markerOpacityTransitionTime: 500,
  24569. guiAnimationSpeed: 250,
  24570. highlightAnimationDuration: 500,
  24571. modelComponentLoadSpinnerDelay: 150,
  24572. captureErrors: !1,
  24573. maxMobileTextures: 6,
  24574. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24575. startupFlyinDelay: 3e3,
  24576. dollhouseDefault: {
  24577. minDistance: 1,//15, //编辑页面给近一些
  24578. maxDistance: 50,
  24579. minPolarAngle: n.Math.degToRad(10),
  24580. maxPolarAngle: n.Math.degToRad(90)
  24581. },
  24582. hideReticuleTimeout: 1e3,
  24583. analytics: {
  24584. inactivityThreshold: 30,
  24585. sessionTrackingRate: .15,
  24586. maxTrackedErrors: 20,
  24587. sessionDurationPingFrequency: 10,
  24588. sessionDurationTimeout: 15
  24589. },
  24590. flydown: {
  24591. movementEasing: "easeInOutQuad",
  24592. movementDelay: .001,
  24593. rotationEasing: "easeInOutQuad",
  24594. rotationDelay: .5,
  24595. modelTextureDelay: .75,
  24596. skyboxDelay: .75
  24597. },
  24598. transition: {
  24599. flySpeed: .001,
  24600. flyTime: 750,
  24601. flytimeMaxDistanceThreshold: 5,
  24602. flytimeDistanceMultiplier: 150,
  24603. aimTime: 1500,
  24604. aimSlowFactor: 1.5,
  24605. blur: .8,
  24606. movementEasing: "easeInOutQuad",
  24607. blendEasing: "easeInOutQuad",
  24608. fastForwardFactor: 3
  24609. },
  24610. show360Views: {
  24611. enabled: !0,
  24612. transitionTime: 1e3
  24613. },
  24614. quickstart: {
  24615. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24616. animation: 1400,
  24617. showTextDelay: 500,
  24618. fadeOutDelay: 3e3,
  24619. fovChange: 10
  24620. },
  24621. appConfig: {
  24622. webvr_version: null,
  24623. segment_key: null,
  24624. embedly_key: null,
  24625. branch_key: null,
  24626. keen_write_key: null,
  24627. keen_project_id: null
  24628. },
  24629. vr: {
  24630. enabled: !0,
  24631. allowWebVR: !1,
  24632. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24633. },
  24634. share: {
  24635. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24636. },
  24637. input: {
  24638. longTapThreshold: 200,
  24639. moveToleranceNDC: .08,
  24640. touchMoveThreshold: 25
  24641. },
  24642. help: {
  24643. modalStayDuration: 600
  24644. },
  24645. immersive: {
  24646. timeToShowAgain: 1250,
  24647. uiStayDuration: 600
  24648. },
  24649. tourInteraction: {
  24650. disabled: "0" === r.valueFromHash("tourcta", null),
  24651. showPauseButton: 1e3,
  24652. showModal: 1500,
  24653. allowNextClick: 200,
  24654. largeModal: "1" === r.valueFromHash("tourcta", null),
  24655. smallModal: "2" === r.valueFromHash("tourcta", null)
  24656. },
  24657. labels: {
  24658. enabled: !1,
  24659. hideUntilStart: !0,
  24660. fadeInDuration: 250,
  24661. fadeInDelay: 250,
  24662. fadeOutDuration: 250,
  24663. fadeOutDelay: 0,
  24664. zoomHideThreshhold: {
  24665. mobile: r.isSmallScreen() ? .45 : .6,
  24666. desktop: 2
  24667. },
  24668. zoomTruncateThreshhold: {
  24669. mobile: r.isSmallScreen() ? .35 : .45,
  24670. desktop: .85
  24671. },
  24672. minLengthForTruncate: 16,
  24673. truncateLength: 12,
  24674. truncateSuffix: "..."
  24675. },
  24676. tags: {
  24677. enabled: r.valueFromHash("mt", 1),
  24678. startup: {
  24679. hideUntilStart: !0,
  24680. fadeInDuration: 500,
  24681. fadeInDelay: 100
  24682. },
  24683. visibility: {
  24684. anyDistance: !0,
  24685. visibleDistance: 8,
  24686. cameraClearance: .1,
  24687. alphaTestLevel: .05,
  24688. hideViaFloor: !0,
  24689. hideOffScreenDisc: !1,
  24690. hideOffScreenObject: !1
  24691. },
  24692. disc: {
  24693. opacity: 1,
  24694. disabledOpacity: .5,
  24695. scale: {
  24696. nearBound: 1.5,
  24697. farBound: 4.8,
  24698. linkFarBound: !1,
  24699. linkPercent: 40,
  24700. maxSize: 80,
  24701. minSize: 40,
  24702. baseViewportSize: 800,
  24703. responsiveness: 100
  24704. }
  24705. },
  24706. pole: {
  24707. enabled: !0,
  24708. height: .5,
  24709. width: 2,
  24710. opacity: .5,
  24711. color: "white"
  24712. },
  24713. navigate: {
  24714. nearestPano: !0,
  24715. lineOfSight: !0,
  24716. reactivate: !0,
  24717. aimAt: "disc",
  24718. tiltTolerance: 25,
  24719. rotateSpeedFactor: .6
  24720. }
  24721. },
  24722. path: {
  24723. color: window.DATA.floorMarkerColor || s.newBlue,
  24724. colorUp: s._desat(s.newBlue, .5),
  24725. colorDown: s._darken(s.newBlue, .35),
  24726. opacity: .5,
  24727. style: "ribbon",
  24728. height: .025,
  24729. ribbonWidth: .24,
  24730. outsideHeight: .5,
  24731. waypointRadius: .5,
  24732. waypointIndoorRadius: .24,
  24733. waypointPulse: 1e3,
  24734. typ: l.BLACK,
  24735. meshFree: r.valueFromHash("mf", 1),
  24736. mapGuides: r.valueFromHash("guides", !0),
  24737. fadeInTime: 400,
  24738. fadeOutTime: 300
  24739. },
  24740. warp: {
  24741. nearPanoDist: .1,
  24742. matchCam: !1,
  24743. blur: .33,
  24744. fastTime: 1500,
  24745. teleportTime: 1500,//瞬间过渡的时间
  24746. flytimeDistanceMultiplier:150,//add
  24747. flyTime:750,//add
  24748. outsideTime: 2e3,
  24749. lookAheadMax: .3,
  24750. lookAheadDist: 2.5,
  24751. softPushDist: .37,
  24752. softPushEnd: .3,
  24753. softBendAngle: 8,
  24754. softBendTilt: 4,
  24755. softBendEnd: .3,
  24756. doBurns: !0,
  24757. burnsAngle: 8,
  24758. minBurnsAngle: 35,
  24759. minDownAngle: -35,
  24760. maxTurnPerSec: 280,
  24761. maxAimPerSec: 35,
  24762. minRotation: 12,
  24763. maxAimRotation: 33.2,
  24764. turnFriction: .2,
  24765. flySpeed: .01,
  24766. minWarpTime: 1200,
  24767. warpInterruptionRedirectTime: 500,
  24768. tourStepDelay: r.valueFromHash("st", 0),
  24769. walkDelay: 0,
  24770. walkMaxDist: 50,
  24771. walkMinDist: .8,
  24772. walkSlideShowThreshhold: 3e3,
  24773. walkExtraPanosDistance: .4,
  24774. timePerMeter: 1200,
  24775. motionLeadTime: 5e3,
  24776. movementEasing: "easeInOutQuad",
  24777. blendEasing: "easeInOutQuad",
  24778. showBunny: !1,
  24779. loop: r.valueFromHash("lp", !1),
  24780. auto: r.valueFromHash("ts", -1),
  24781. eOrder: "YXZ",
  24782. stepFactor: .25,
  24783. brakeStrength: 2,
  24784. minBrakeAngle: .1,
  24785. maxBrakeAngle: 1.8,
  24786. climbEffort: 4
  24787. },
  24788. rotationFriction: .05,
  24789. rotationAccelerationInside: 4.5,
  24790. rotationAccelerationOutside: .15,
  24791. rotationAfterMoveMultiplier: 40,
  24792. rotationAfterMoveHistoryCount: 5,
  24793. panFriction: .09,
  24794. panAccelerationOutside: 60,
  24795. onload: r.valueFromHash("onload", o.PANORAMA),
  24796. zoomNearLimit: .1,
  24797. zoomFarLimit: 50,
  24798. navigation: {
  24799. panoScores: !1,
  24800. mouseDirection: !0,
  24801. filterStrictness: .75,
  24802. angleFactor: -30,
  24803. directionFactor: 10,
  24804. distanceFactor: -1,
  24805. optionalityFactor: 3
  24806. },
  24807. sdkInit: !1,
  24808. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24809. console: r.valueFromHash("console", !1),
  24810. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24811. panoramaNeighbourMaxDistance: 5,
  24812. panoFloorClickRadius: .35,
  24813. showScreenshotLocations: !1,
  24814. showAxis: !1,
  24815. showNeighbourRaycasts: !1,
  24816. colorMarkerOnLoad: !1,
  24817. colorMarkerByFloor: !1,
  24818. tiling: {
  24819. panoPreRenderRepeatDelay: 2500,
  24820. panoPreRenderDelay: 500,
  24821. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24822. tilingFlagNames: ["usetiles", "tiles"],
  24823. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24824. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24825. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24826. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24827. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24828. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24829. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24830. customCompression: r.valueFromHash("tilecustcomp", 0),
  24831. mobileHighQualityOverride: 1,
  24832. allowUltraHighResolution: !0
  24833. },
  24834. zoom: {
  24835. enabled: !0,
  24836. forceOff: r.valueFromHash("nozoom", 0),
  24837. overridemax: r.valueFromHash("maxzoom", null),
  24838. overridemin: r.valueFromHash("minzoom", null),
  24839. max: d.highQualityMaxZoom,
  24840. min: 1,
  24841. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24842. activationThreshold: 1.1,
  24843. restoreTime: 500
  24844. },
  24845. profiling: {
  24846. enabled: r.valueFromHash("mem", !1)
  24847. }
  24848. };
  24849. (p = h.deepExtend(p, d, {
  24850. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24851. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24852. panorama: {
  24853. transitionTime: 1e3,
  24854. modelAlpha: 0,
  24855. modelAlphaDelay: p.flydown.modelTextureDelay,
  24856. modelAlphaLength: 1,
  24857. skyboxOpacity: 1,
  24858. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24859. skyboxOpacityLength: .9,
  24860. fovLength: 1,
  24861. fovDelay: 0,
  24862. cameraMatrixDuration: .8,
  24863. cameraMatrixDelay: 0,
  24864. cameraMatrixEase: c.easeInCubic,
  24865. reticuleOpacity: 1,
  24866. markerOpacity: .3,
  24867. markerOpacityOnHover: 1
  24868. },
  24869. dollhouse: {
  24870. transitionTime: 1e3,
  24871. modelAlpha: 1,
  24872. modelAlphaDelay: 0,
  24873. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24874. skyboxOpacity: 0,
  24875. skyboxOpacityDelay: 0,
  24876. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24877. fovLength: 1,
  24878. fovDelay: 0,
  24879. cameraMatrixDuration: .8,
  24880. cameraMatrixDelay: .3,
  24881. cameraMatrixEase: c.easeInCubic,
  24882. reticuleOpacity: 1,
  24883. markerOpacity: 0,
  24884. markerOpacityOnHover: 0
  24885. },
  24886. floorplan: {
  24887. transitionTime: 1e3,
  24888. modelAlpha: 1,
  24889. modelAlphaDelay: 0,
  24890. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24891. skyboxOpacity: 0,
  24892. skyboxOpacityDelay: 0,
  24893. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24894. fovLength: 1,
  24895. fovDelay: 0,
  24896. cameraMatrixDuration: .5,
  24897. cameraMatrixDelay: 0,
  24898. cameraMatrixEase: c.easeOutCubic,
  24899. reticuleOpacity: 1,
  24900. markerOpacity: 0,
  24901. markerOpacityOnHover: 0,
  24902. cameraHeight: 50
  24903. },
  24904. transitioning: {
  24905. reticuleOpacity: 0,
  24906. markerOpacity: .3,
  24907. markerOpacityOnHover: 1
  24908. },
  24909. "floorplan-dollhouse": {
  24910. rotationDelay: 0,
  24911. rotationDuration: 1
  24912. },
  24913. "floorplan-panorama": {
  24914. rotationDelay: .5,
  24915. rotationDuration: 1
  24916. },
  24917. "dollhouse-panorama": {
  24918. rotationDelay: .5,
  24919. rotationDuration: 1
  24920. },
  24921. "dollhouse-floorplan": {
  24922. rotationDelay: 0,
  24923. rotationDuration: 1,
  24924. cameraMatrixDuration: 1.05,
  24925. cameraMatrixDelay: .5
  24926. },
  24927. "panorama-dollhouse": {
  24928. rotationDelay: 0,
  24929. rotationDuration: .5
  24930. },
  24931. "panorama-floorplan": {
  24932. transitionTime: 1500,
  24933. rotationDelay: 0,
  24934. rotationDuration: .5
  24935. }
  24936. })).path.meshFree && (p.path.typ = l.WALK),
  24937. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24938. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24939. window._settings = t.exports = p
  24940. }
  24941. , {
  24942. "./constants": 8,
  24943. "./enum/Colors": 19,
  24944. "./enum/VROption": 47,
  24945. "./enum/Viewmode": 51,
  24946. "./enum/WarpStyle": 52,
  24947. "./util/browser": 182,
  24948. "./util/common": 185,
  24949. "./util/easing": 186,
  24950. "./util/showcase": 193,
  24951. three: 217
  24952. }],
  24953. 167: [function(e, t, i) {
  24954. "use strict";
  24955. var n = e("three")
  24956. , r = e("./settings")
  24957. , 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"
  24958. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24959. t.exports = {
  24960. basicTextured: {
  24961. uniforms: {
  24962. tDiffuse: {
  24963. type: "t",
  24964. value: null
  24965. },
  24966. alpha: {
  24967. type: "f",
  24968. value: 1
  24969. }
  24970. },
  24971. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24972. 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}"
  24973. },
  24974. copyCubeMap: {
  24975. uniforms: {
  24976. tDiffuse: {
  24977. type: "t",
  24978. value: null
  24979. },
  24980. alpha: {
  24981. type: "f",
  24982. value: 1
  24983. }
  24984. },
  24985. 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}",
  24986. 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}"
  24987. },
  24988. cube: {
  24989. uniforms: {
  24990. map: {
  24991. type: "t",
  24992. value: null
  24993. },
  24994. opacity: {
  24995. type: "f",
  24996. value: 1
  24997. }
  24998. },
  24999. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25000. 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"
  25001. },
  25002. model: {
  25003. uniforms: {
  25004. map: {
  25005. type: "t",
  25006. value: null
  25007. },
  25008. modelAlpha: {
  25009. type: "f",
  25010. value: r.modelAlpha
  25011. },
  25012. opacity: {
  25013. type: "f",
  25014. value: 1
  25015. },
  25016. progress: {
  25017. type: "f",
  25018. value: 0
  25019. },
  25020. blackout: {
  25021. type: "i",
  25022. value: 0
  25023. },
  25024. pano0Map: {
  25025. type: "t",
  25026. value: null
  25027. },
  25028. pano0Position: {
  25029. type: "v3",
  25030. value: new n.Vector3
  25031. },
  25032. pano0Matrix: {
  25033. type: "m4",
  25034. value: new n.Matrix4
  25035. },
  25036. pano1Map: {
  25037. type: "t",
  25038. value: null
  25039. },
  25040. pano1Position: {
  25041. type: "v3",
  25042. value: new n.Vector3
  25043. },
  25044. pano1Matrix: {
  25045. type: "m4",
  25046. value: new n.Matrix4
  25047. }
  25048. },
  25049. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 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 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25050. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform 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\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  25051. },
  25052. hot: {
  25053. uniforms: {
  25054. color: {
  25055. type: "c",
  25056. value: new n.Color(16720384)
  25057. },
  25058. opac: {
  25059. type: "f",
  25060. value: 0
  25061. },
  25062. texture1: {
  25063. type: "t",
  25064. value: null
  25065. },
  25066. texture2: {
  25067. type: "t",
  25068. value: null
  25069. }
  25070. },
  25071. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25072. 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"
  25073. },
  25074. modelOutside: {
  25075. uniforms: {
  25076. map: {
  25077. type: "t",
  25078. value: null
  25079. },
  25080. opacity: {
  25081. type: "f",
  25082. value: 1
  25083. }
  25084. },
  25085. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25086. 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"
  25087. },
  25088. ribbon: {
  25089. uniforms: {
  25090. map: {
  25091. type: "t",
  25092. value: null
  25093. },
  25094. opacity: {
  25095. type: "f",
  25096. value: 1
  25097. },
  25098. color: {
  25099. type: "c",
  25100. value: new n.Color(r.path.color)
  25101. }
  25102. },
  25103. 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",
  25104. 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"
  25105. },
  25106. waypoint: {
  25107. uniforms: {
  25108. map: {
  25109. type: "t",
  25110. value: null
  25111. },
  25112. opacity: {
  25113. type: "f",
  25114. value: 1
  25115. },
  25116. pulse: {
  25117. type: "f",
  25118. value: 1
  25119. },
  25120. nearFade: {
  25121. type: "v2",
  25122. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25123. },
  25124. color: {
  25125. type: "c",
  25126. value: new n.Color(r.reticuleColor)
  25127. }
  25128. },
  25129. 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",
  25130. 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"
  25131. },
  25132. modelDebug: {
  25133. uniforms: {
  25134. map: {
  25135. type: "t",
  25136. value: null
  25137. },
  25138. modelAlpha: {
  25139. type: "f",
  25140. value: r.modelAlpha
  25141. },
  25142. depthmapRatio: {
  25143. type: "f",
  25144. value: 0
  25145. },
  25146. opacity: {
  25147. type: "f",
  25148. value: 1
  25149. },
  25150. progress: {
  25151. type: "f",
  25152. value: 0
  25153. },
  25154. considerOcclusion: {
  25155. type: "i",
  25156. value: r.fancierTransition
  25157. },
  25158. highlightPanoSelection: {
  25159. type: "i",
  25160. value: 0
  25161. },
  25162. useThirdPano: {
  25163. type: "i",
  25164. value: r.useThirdPano
  25165. },
  25166. pano0Map: {
  25167. type: "t",
  25168. value: null
  25169. },
  25170. pano0Depth: {
  25171. type: "t",
  25172. value: null
  25173. },
  25174. pano0Position: {
  25175. type: "v3",
  25176. value: new n.Vector3
  25177. },
  25178. pano0Matrix: {
  25179. type: "m4",
  25180. value: new n.Matrix4
  25181. },
  25182. pano0Weight: {
  25183. type: "f",
  25184. value: r.transition.pano0Weight
  25185. },
  25186. pano1Map: {
  25187. type: "t",
  25188. value: null
  25189. },
  25190. pano1Depth: {
  25191. type: "t",
  25192. value: null
  25193. },
  25194. pano1Position: {
  25195. type: "v3",
  25196. value: new n.Vector3
  25197. },
  25198. pano1Matrix: {
  25199. type: "m4",
  25200. value: new n.Matrix4
  25201. },
  25202. pano1Weight: {
  25203. type: "f",
  25204. value: r.transition.pano1Weight
  25205. },
  25206. pano2Map: {
  25207. type: "t",
  25208. value: null
  25209. },
  25210. pano2Depth: {
  25211. type: "t",
  25212. value: null
  25213. },
  25214. pano2Position: {
  25215. type: "v3",
  25216. value: new n.Vector3
  25217. },
  25218. pano2Matrix: {
  25219. type: "m4",
  25220. value: new n.Matrix4
  25221. },
  25222. pano2Weight: {
  25223. type: "f",
  25224. value: r.transition.pano2Weight
  25225. }
  25226. },
  25227. 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",
  25228. 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"
  25229. },
  25230. customDepth: {
  25231. uniforms: {
  25232. panoPosition: {
  25233. type: "v3",
  25234. value: new n.Vector3
  25235. }
  25236. },
  25237. 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",
  25238. 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"
  25239. },
  25240. skysphere: {
  25241. uniforms: {
  25242. radius: {
  25243. type: "f",
  25244. value: 0
  25245. }
  25246. },
  25247. 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",
  25248. 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"
  25249. },
  25250. tagDisc: {
  25251. uniforms: {
  25252. opacity: {
  25253. type: "f",
  25254. value: 0
  25255. },
  25256. color: {
  25257. type: "c",
  25258. value: new n.Color
  25259. },
  25260. bg: {
  25261. type: "t",
  25262. value: null
  25263. },
  25264. mask: {
  25265. type: "t",
  25266. value: null
  25267. }
  25268. },
  25269. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25270. 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"
  25271. }
  25272. }
  25273. window.shaders = t.exports;
  25274. }
  25275. , {
  25276. "./settings": 166,
  25277. three: 217
  25278. }],
  25279. 168: [function(E, _, e) {
  25280. (function(e) {
  25281. "use strict";
  25282. var t = E("three")
  25283. , i = (E("url"),
  25284. E("./util/ajax"))
  25285. , n = E("./settings")
  25286. , r = E("./util/logger")
  25287. , o = E("./util/math")
  25288. , a = E("./util/showcase")
  25289. , s = E("./objects/Panorama")
  25290. , l = new r(e)
  25291. , c = E("./model/Model")
  25292. , h = E("./shaders")
  25293. , u = E("./util/transitions")
  25294. , d = E("./objects/Chunk")
  25295. , p = E("./objects/Reticule")
  25296. , f = E("./objects/Skybox")
  25297. , g = E("./objects/Floor")
  25298. , m = E("./cameras/DollhouseCamera")
  25299. , v = E("./cameras/FloorplanCamera")
  25300. , y = E("./cameras/PanoramaCamera")
  25301. , A = E("./controls/DollhouseControls")
  25302. , C = E("./controls/FloorplanControls")
  25303. , I = E("./controls/PanoramaControls");
  25304. t.ImageUtils.crossOrigin = n.crossOrigin,
  25305. _.exports = {
  25306. shaders: h,
  25307. transitions: u,
  25308. Model: c,
  25309. Chunk: d,
  25310. Floor: g,
  25311. Skybox: f,
  25312. Reticule: p,
  25313. Panorama: s,
  25314. DollhouseCamera: m,
  25315. FloorplanCamera: v,
  25316. PanoramaCamera: y,
  25317. DollhouseControls: A,
  25318. FloorplanControls: C,
  25319. PanoramaControls: I,
  25320. getModel: function(e) {
  25321. if (!e.url)
  25322. throw 'getModel(): missing parameter "url"';
  25323. e.autoload = void 0 === e.autoload || e.autoload;
  25324. var t = a.parseSidUrl(e.url);
  25325. e.urlBase = t.urlBase,
  25326. e.urlModel = t.urlModel,
  25327. e.urlFiles = t.urlFiles;
  25328. var i = this._getPlatformError();
  25329. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25330. this._loadModel().then(this._buildModel.bind(this)))
  25331. },
  25332. _getPlatformError: function() {
  25333. 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"
  25334. },
  25335. _loadModel: function() {
  25336. return i.get(this.options.urlModel, {
  25337. responseType: "json",
  25338. prefetchFrom: "model",
  25339. auth: a.getAuthorizationHeader()
  25340. }).then(null, function() {
  25341. return l.warn("Model loading failed at initial metadata load"),
  25342. "loading-failed"
  25343. })
  25344. },
  25345. _buildModel: function(e) {
  25346. e = a.normalizeModeldata(e, o);
  25347. var t = new c(this.options,e);
  25348. return this.options.autoload ? t.load(!0) : $.when(t)
  25349. }
  25350. }
  25351. }
  25352. ).call(this, "/js/showcase.js")
  25353. }
  25354. , {
  25355. "./cameras/DollhouseCamera": 5,
  25356. "./cameras/FloorplanCamera": 6,
  25357. "./cameras/PanoramaCamera": 7,
  25358. "./controls/DollhouseControls": 10,
  25359. "./controls/FloorplanControls": 11,
  25360. "./controls/PanoramaControls": 13,
  25361. "./model/Model": 139,
  25362. "./objects/Chunk": 144,
  25363. "./objects/Floor": 146,
  25364. "./objects/Panorama": 148,
  25365. "./objects/Reticule": 149,
  25366. "./objects/Skybox": 152,
  25367. "./settings": 166,
  25368. "./shaders": 167,
  25369. "./util/ajax": 181,
  25370. "./util/logger": 189,
  25371. "./util/math": 190,
  25372. "./util/showcase": 193,
  25373. "./util/transitions": 195,
  25374. three: 217,
  25375. url: 208
  25376. }],
  25377. 169: [function(e, t, i) {
  25378. "use strict";
  25379. function l(e) {
  25380. var t = {
  25381. renderTarget: null,
  25382. inUse: !1,
  25383. size: -1,
  25384. pano: null
  25385. };
  25386. return t.inUse = !0,
  25387. t.size = e,
  25388. function(e) {
  25389. O.push(e)
  25390. }(t),
  25391. t
  25392. }
  25393. function c(e) {
  25394. for (var t = 0; t < O.length; t++) {
  25395. var i = O[t];
  25396. if (i.renderTarget === e)
  25397. return !(i.inUse = !1)
  25398. }
  25399. return !1
  25400. }
  25401. function n() {
  25402. this.tileDirectory = {},
  25403. this.activeRenderTargetDescriptors = {},
  25404. this.activePanos = [],
  25405. this.panoLODDescriptors = {},
  25406. this.panoDescriptors = {},
  25407. this.tileTrees = {},
  25408. this.sceneRenderer = null,
  25409. this.tileDownloader = null,
  25410. this.forceQueue = [],
  25411. this.uploadQueues = {},
  25412. this.uploadInterval = null,
  25413. this.uploadIntervalCancelled = !1,
  25414. this.usingTileOverlay = !1,
  25415. this.overlayTilesLoaded = !1,
  25416. this.overlayTileBase = null,
  25417. this.overlayTilesBasic = {},
  25418. this.overlayTilesEnhanced = {},
  25419. this.zoomRenderTarget = null,
  25420. this.zoomPano = null,
  25421. this.zoomingActive = !1,
  25422. this.zoomPanoId = null,
  25423. this.zoomPanoRenderingDisabled = !1,
  25424. this.direction = new _.Vector3,
  25425. this.initTime = -1,
  25426. this.maxBaseUploadsPerFrame = R,
  25427. this.maxNonBaseUploadsPerFrame = M
  25428. }
  25429. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  25430. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25431. e("../objects/Panorama"),
  25432. e("./TileTree")), y = (e("./TileDownloader"),
  25433. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25434. e("../util/browser"),
  25435. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  25436. Base: 0,
  25437. Remaining: 1
  25438. }, O = [];
  25439. function L(e) {
  25440. var t = e.shift();
  25441. return t.uploadQueued = !1,
  25442. t
  25443. }
  25444. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25445. this.sceneRenderer = e,
  25446. this.tileDownloader = t,
  25447. this.qualityManager = i,
  25448. this.bindEvents(),
  25449. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25450. this.initTime = performance.now()
  25451. }
  25452. ,
  25453. n.prototype.getActivePanoTextures = function(e) {
  25454. e = e || [];
  25455. for (var t = 0; t < O.length; t++) {
  25456. var i = O[t];
  25457. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25458. }
  25459. }
  25460. ,
  25461. n.prototype.hasQueuedTiles = function() {
  25462. var e = this.peekNextFromUploadQueue();
  25463. return null != e
  25464. }
  25465. ,
  25466. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25467. return this.activeRenderTargetDescriptors[e]
  25468. }
  25469. ,
  25470. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25471. this.activeRenderTargetDescriptors[e] = t
  25472. }
  25473. ,
  25474. n.prototype.loadOverlayTiles = function() {
  25475. if (0 !== d.tiling.overlayStyle) {
  25476. var n = 0
  25477. , e = function(e, t, i) {
  25478. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25479. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25480. ++n === r.length && (this.overlayTilesLoaded = !0)
  25481. }
  25482. .bind(this)
  25483. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25484. r.forEach(function(e) {
  25485. this.tileDownloader.loadImage(e[0], 0, e[1])
  25486. }
  25487. .bind(this)),
  25488. this.usingTileOverlay = !0
  25489. } else
  25490. this.usingTileOverlay = !1
  25491. }
  25492. ,
  25493. n.prototype.bindEvents = function() {
  25494. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25495. }
  25496. ,
  25497. n.prototype.setupZoomRenderTarget = function() {
  25498. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25499. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25500. return;
  25501. var e = this.zoomRenderTarget;
  25502. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25503. e) {
  25504. var t = e.width
  25505. , i = this.zoomRenderTarget.width;
  25506. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25507. e.texture.dispose(),
  25508. e.texture.loaded = !1,
  25509. e.texture.version = 0,
  25510. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25511. e.texture = null
  25512. }
  25513. this.zoomPanoRenderingDisabled = !1
  25514. } else
  25515. this.zoomPanoRenderingDisabled = !0
  25516. }
  25517. ,
  25518. n.prototype.enableUltraHighQualityMode = function(t) {
  25519. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25520. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25521. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25522. e && (this.qualityManager.enableUltraHighQualityMode(),
  25523. this.setupZoomRenderTarget(),
  25524. t())
  25525. }
  25526. .bind(this))
  25527. }
  25528. }
  25529. ,
  25530. n.prototype.activateTiledPano = function(e, t, i) {
  25531. i && this.clearAllQueuedUploads();
  25532. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25533. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25534. this.linkAllTilesAndNodes(e);
  25535. var r = this.getActiveRenderTargetDescriptor(e.id)
  25536. , o = t;
  25537. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25538. !r || o !== r.size) {
  25539. if (r && c(r.renderTarget),
  25540. !(r = function(e) {
  25541. for (var t = 0; t < O.length; t++) {
  25542. var i = O[t];
  25543. if (!i.inUse && i.size === e)
  25544. return i.inUse = !0,
  25545. i
  25546. }
  25547. return null
  25548. }(o))) {
  25549. var a = this.initTiledPano(o, !1);
  25550. (r = l(a.width)).renderTarget = a
  25551. }
  25552. r.pano = e,
  25553. this.resetPanoDescriptor(e.id),
  25554. this.resetPanoLODDescriptors(e.id),
  25555. this.resetRenderStatus(e.id, !0, !0)
  25556. }
  25557. this.setActiveRenderTargetDescriptor(e.id, r);
  25558. var s = i ? 0 : 1;
  25559. return this.updateActivePanos(e, s),
  25560. r.renderTarget
  25561. }
  25562. ,
  25563. n.prototype.deactivateTiledPano = function(e) {
  25564. var t = this.getActiveRenderTargetDescriptor(e.id);
  25565. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25566. this.setActiveRenderTargetDescriptor(e.id, null);
  25567. var i = this.getUploadQueueForPano(e.id);
  25568. this.clearUploadQueue(i),
  25569. this.updateActivePanos()
  25570. }
  25571. ,
  25572. n.prototype.updateActivePanos = (s = [],
  25573. function(e, t) {
  25574. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25575. e && s.length === t && s.push(e);
  25576. var n = this.activePanos[i]
  25577. , r = this.getActiveRenderTargetDescriptor(n.id);
  25578. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25579. }
  25580. e && t >= s.length && s.push(e),
  25581. this.activePanos.length = 0,
  25582. this.activePanos.push.apply(this.activePanos, s)
  25583. }
  25584. ),
  25585. n.prototype.getActivePanoCount = function() {
  25586. return this.activePanos.length
  25587. }
  25588. ,
  25589. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25590. var i = null;
  25591. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25592. for (var n = function(e, t, i, n) {
  25593. o && (t.tile.zoomUploaded = !1),
  25594. r && (t.tile.uploaded = !1)
  25595. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25596. this.getTileTree(e, a).breadthFirst({
  25597. callback: n.bind(this, a),
  25598. minLevel: i
  25599. })
  25600. }
  25601. }
  25602. ,
  25603. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25604. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25605. t.tile.zoomUploaded = t.tile.uploaded,
  25606. t.zoomCovered = t.covered
  25607. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25608. this.getTileTree(e, n).breadthFirst({
  25609. callback: i.bind(this, n),
  25610. maxLevel: t
  25611. })
  25612. }
  25613. }
  25614. ,
  25615. n.prototype.renderPanoTiles = (h = [],
  25616. function(e, t, i, n) {
  25617. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25618. t = t || this.direction || m.FORWARD;
  25619. var r = this.getActiveRenderTargetDescriptor(e);
  25620. if (!this.isRenderTargetDescriptorValid(r))
  25621. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25622. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25623. var a = this.getTileTree(e, o);
  25624. h.length = 0,
  25625. a.breadthFirst({
  25626. saveVisited: h
  25627. });
  25628. for (var s = 0; s < h.length; s++) {
  25629. var l = h[s];
  25630. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25631. }
  25632. }
  25633. this.updateDirection(t)
  25634. }
  25635. ),
  25636. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25637. return e && e.renderTarget
  25638. }
  25639. ,
  25640. n.prototype.isPanoActive = function(e) {
  25641. var t = this.getActiveRenderTargetDescriptor(e);
  25642. return this.isRenderTargetDescriptorValid(t)
  25643. }
  25644. ,
  25645. n.prototype.isPanoZoomed = function(e) {
  25646. return this.zoomingActive && this.zoomPanoId === e
  25647. }
  25648. ,
  25649. n.prototype.initTileTree = function(e, t, i) {
  25650. var n = this.tileTrees[e];
  25651. n || (n = [],
  25652. this.tileTrees[e] = n);
  25653. var r = n[t];
  25654. if (!r) {
  25655. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25656. r = new v(A.TILE_SIZE,o),
  25657. n[t] = r
  25658. }
  25659. }
  25660. ,
  25661. n.prototype.getTileTree = function(e, t) {
  25662. var i = this.tileTrees[e];
  25663. if (!i)
  25664. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25665. var n = i[t];
  25666. if (!n)
  25667. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25668. return n
  25669. }
  25670. ,
  25671. n.prototype.initTiledPano = function(e, t) {
  25672. var i = this.sceneRenderer.renderer
  25673. , n = (i.context,
  25674. new _.WebGLRenderTargetCube(e,e,{
  25675. stencilBuffer: !1
  25676. }))
  25677. , r = new _.CubeTexture([]);
  25678. (n.texture = r).image = [null, null, null, null, null, null],
  25679. r.flipY = !0,
  25680. t ? (r.generateMipmaps = !0,
  25681. r.magFilter = _.LinearFilter,
  25682. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25683. r.magFilter = _.LinearFilter,
  25684. r.minFilter = _.LinearFilter),
  25685. r.format = _.RGBAFormat,
  25686. i.setRenderTarget(n),
  25687. i.setRenderTarget(null);
  25688. var o = i.properties.get(r);
  25689. return o.__image__webglTextureCube = o.__webglTexture,
  25690. n
  25691. }
  25692. ,
  25693. n.prototype.getUploadQueueForPano = function(e) {
  25694. var t = this.uploadQueues[e];
  25695. return t || (t = [],
  25696. this.uploadQueues[e] = t),
  25697. t
  25698. }
  25699. ,
  25700. n.prototype.isTileUploaded = function(e) {
  25701. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25702. }
  25703. ,
  25704. n.prototype.setUploaded = function(e, t) {
  25705. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25706. }
  25707. ,
  25708. n.prototype.queueTileUpload = function(e, t, i) {
  25709. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25710. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25711. var r = this.getUploadQueueForPano(e.panoId);
  25712. 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),
  25713. e.uploadQueued = !0,
  25714. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25715. }
  25716. }
  25717. ,
  25718. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25719. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25720. }
  25721. ,
  25722. n.prototype.getTopUploadQueue = function() {
  25723. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25724. for (var n = 0; n < this.activePanos.length; n++)
  25725. if (e = this.activePanos[n],
  25726. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25727. switch (i) {
  25728. case P.Base:
  25729. if (0 === t[0].level)
  25730. return t;
  25731. break;
  25732. case P.Remaining:
  25733. return t
  25734. }
  25735. return null
  25736. }
  25737. ,
  25738. n.prototype.getNextFromUploadQueue = function() {
  25739. if (0 < this.forceQueue.length)
  25740. return L(this.forceQueue);
  25741. var e = this.getTopUploadQueue();
  25742. return e && 0 < e.length ? L(e) : null
  25743. }
  25744. ,
  25745. n.prototype.peekNextFromUploadQueue = function() {
  25746. if (0 < this.forceQueue.length)
  25747. return this.forceQueue[0];
  25748. var e = this.getTopUploadQueue();
  25749. return e && 0 < e.length ? e[0] : null
  25750. }
  25751. ,
  25752. n.prototype.clearAllQueuedUploads = function() {
  25753. this.clearAllUploadQueues(null, 0)
  25754. }
  25755. ,
  25756. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25757. this.clearAllUploadQueues(e, 0)
  25758. }
  25759. ,
  25760. n.prototype.clearAllUploadQueues = function(e, t) {
  25761. if (e)
  25762. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25763. this.clearUploadQueue(this.forceQueue, t, e);
  25764. else {
  25765. for (var i = 0; i < this.activePanos.length; i++) {
  25766. var n = this.activePanos[i];
  25767. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25768. }
  25769. this.clearUploadQueue(this.forceQueue, t)
  25770. }
  25771. }
  25772. ,
  25773. n.prototype.clearUploadQueue = function(e, t, i) {
  25774. null != t || (t = 0);
  25775. for (var n = 0; n < e.length; ) {
  25776. var r = e[n];
  25777. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25778. e.splice(n, 1)) : n++
  25779. }
  25780. }
  25781. ,
  25782. n.prototype.refreshUploadInterval = (a = null,
  25783. function(e) {
  25784. this.uploadIntervalCancelled || (a = a || function() {
  25785. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25786. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25787. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25788. }
  25789. .bind(this),
  25790. null != e || (e = x),
  25791. T || (e = S),
  25792. this.uploadInterval = window.setTimeout(a, e),
  25793. this.uploadIntervalDelay = e)
  25794. }
  25795. ),
  25796. n.prototype.update = (r = performance.now(),
  25797. o = 0,
  25798. function() {
  25799. this.uploadIntervalCancelled = !0,
  25800. window.clearTimeout(this.uploadInterval),
  25801. this.uploadInterval = null;
  25802. var e = performance.now() - r;
  25803. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25804. r = performance.now()),
  25805. o++
  25806. }
  25807. ),
  25808. n.prototype.updateUploadQueue = function(e, t) {
  25809. e = e || 1;
  25810. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25811. var r = this.getNextFromUploadQueue();
  25812. if (!r)
  25813. break;
  25814. if (0 !== r.level ? i++ : n++,
  25815. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25816. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25817. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25818. }
  25819. }
  25820. }
  25821. ,
  25822. n.prototype.updateDirection = function(e) {
  25823. if (e = e || this.direction) {
  25824. this.direction = e;
  25825. for (var t = 0; t < this.activePanos.length; t++) {
  25826. var i = this.activePanos[t]
  25827. , n = this.getUploadQueueForPano(i.id);
  25828. y.sortPanoTiles(n, i, this.direction)
  25829. }
  25830. }
  25831. }
  25832. ,
  25833. n.prototype.uploadTile = (I = {},
  25834. new _.Vector4,
  25835. E = d.tiling.overlayStyle,
  25836. function(e, t) {
  25837. var i = e.panoId
  25838. , n = e.image
  25839. , r = e.tileSize
  25840. , o = e.panoSize
  25841. , a = e.tileIndex
  25842. , s = (e.faceTileIndex,
  25843. e.totalTiles)
  25844. , l = (e.face,
  25845. e.tileX)
  25846. , c = e.tileY
  25847. , h = !0
  25848. , u = !1
  25849. , d = (this.getPanoDescriptor(i),
  25850. this.getPanoLODDescriptor(i, o))
  25851. , p = this.getActiveRenderTargetDescriptor(i)
  25852. , f = p.renderTarget
  25853. , g = p.size;
  25854. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25855. g = this.qualityManager.getMaxZoomPanoSize()),
  25856. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25857. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25858. this.isTileUploaded(e) && (u = h = !1)),
  25859. h) {
  25860. var m = r / o * g
  25861. , v = l * r / o * g
  25862. , y = c * r / o * g;
  25863. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25864. var A = I[r];
  25865. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25866. 1 === E || 2 === E) {
  25867. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25868. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25869. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25870. } else
  25871. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25872. d.uploadCount++,
  25873. this.emit(b.TileRenderSuccess, i, o, a, s),
  25874. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25875. this.setUploaded(e, !0),
  25876. this.addCoverageForNode(e.node)
  25877. } else
  25878. this.setUploaded(e, !1);
  25879. return e.uploadAttempted || (d.uploadAttempts++,
  25880. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25881. e.uploadAttempted = !0,
  25882. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25883. u
  25884. }
  25885. ),
  25886. n.prototype.linkTileAndNode = function(e, t) {
  25887. (t.tile = e).node = t
  25888. }
  25889. ,
  25890. n.prototype.linkAllTilesAndNodes = function(a) {
  25891. for (var e = function(e, t, i, n, r) {
  25892. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25893. this.linkTileAndNode(o, i)
  25894. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25895. var i = this.getTileTree(a.id, t);
  25896. i.breadthFirst({
  25897. callback: e.bind(this, i, t)
  25898. })
  25899. }
  25900. }
  25901. ,
  25902. n.prototype.anyUploaded = function(e) {
  25903. if (!e)
  25904. return !1;
  25905. if (e.tile && this.isTileUploaded(e.tile))
  25906. return !0;
  25907. if (e.children)
  25908. for (var t = 0; t < e.children.length; t++) {
  25909. var i = e.children[t];
  25910. if (this.anyUploaded(i))
  25911. return !0
  25912. }
  25913. return !1
  25914. }
  25915. ,
  25916. n.prototype.setNodeCovered = function(e, t) {
  25917. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25918. }
  25919. ,
  25920. n.prototype.isNodeCovered = function(e) {
  25921. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25922. }
  25923. ,
  25924. n.prototype.addCoverageForNode = function(e) {
  25925. if (this.setNodeCovered(e, !0),
  25926. e.parent && e.covered) {
  25927. var t = e.parent;
  25928. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25929. }
  25930. }
  25931. ,
  25932. n.prototype.calcFullCoverage = function(e) {
  25933. var t = !1;
  25934. if (e.children)
  25935. for (var i = 0; i < e.children.length; i++) {
  25936. var n = e.children[i];
  25937. t = t || this.calcFullCoverage(n)
  25938. }
  25939. e.covered = e.tile.uploaded || t
  25940. }
  25941. ,
  25942. n.prototype.nodeSubcovered = function(e) {
  25943. if (!e.children)
  25944. return !1;
  25945. for (var t = 0; t < e.children.length; t++)
  25946. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25947. return !1;
  25948. return !0
  25949. }
  25950. ,
  25951. n.prototype.resetPanoDescriptor = function(e) {
  25952. this.getPanoDescriptor(e)
  25953. }
  25954. ,
  25955. n.prototype.getPanoDescriptor = function(e) {
  25956. var t = this.panoDescriptors[e];
  25957. return t || (t = {},
  25958. this.panoDescriptors[e] = t),
  25959. t
  25960. }
  25961. ,
  25962. n.prototype.resetPanoLODDescriptors = function(e) {
  25963. var t = this.getPanoLODDescriptors(e);
  25964. for (var i in t)
  25965. if (t.hasOwnProperty(i)) {
  25966. var n = t[i];
  25967. n.uploadCount = 0,
  25968. n.uploadAttempts = 0
  25969. }
  25970. }
  25971. ,
  25972. n.prototype.getPanoLODDescriptor = function(e, t) {
  25973. var i = this.getPanoLODDescriptors(e)
  25974. , n = i[t];
  25975. return n || (n = {
  25976. uploadCount: 0,
  25977. uploadAttempts: 0
  25978. },
  25979. i[t] = n),
  25980. n
  25981. }
  25982. ,
  25983. n.prototype.getPanoLODDescriptors = function(e) {
  25984. var t = this.panoLODDescriptors[e];
  25985. return t || (t = {},
  25986. this.panoLODDescriptors[e] = t),
  25987. t
  25988. }
  25989. ,
  25990. n.prototype.onTileDownloaded = function(e) {
  25991. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25992. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25993. if (i.downloaded = !0,
  25994. i.image = e.image,
  25995. i.panoSize = e.panoSize,
  25996. i.tileX = e.tileX,
  25997. i.tileY = e.tileY,
  25998. i.totalTiles = e.totalTiles,
  25999. i.tileIndex = e.tileIndex,
  26000. i.faceTileIndex = e.faceTileIndex,
  26001. i.face = e.face,
  26002. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26003. i.panoId = e.panoId,
  26004. i.tileSize = e.tileSize,
  26005. i.direction = (new _.Vector3).copy(e.direction),
  26006. i.node = null,
  26007. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26008. this.isPanoActive(i.panoId)) {
  26009. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26010. this.linkTileAndNode(i, n),
  26011. this.queueTileUpload(i, !0)
  26012. }
  26013. }
  26014. ,
  26015. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26016. var r = this.tileDirectory[e];
  26017. r || (r = {},
  26018. this.tileDirectory[e] = r);
  26019. var o = 16384 * t + 1024 * i + n
  26020. , a = r[o];
  26021. return a || (a = {
  26022. downloaded: !1,
  26023. uploaded: !1,
  26024. zoomUploaded: !1
  26025. },
  26026. r[o] = a),
  26027. a._key = e + ":" + t + ":" + i + ":" + n,
  26028. a._tileKey = o,
  26029. a
  26030. }
  26031. ,
  26032. n.prototype.setZoomingActive = function(e, t, i) {
  26033. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26034. this.zoomPanoId = t.id,
  26035. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26036. }
  26037. ,
  26038. n.prototype.updateZoomedPanoFromBase = function(e) {
  26039. if (!this.zoomPanoRenderingDisabled) {
  26040. var t = this.getActiveRenderTargetDescriptor(e.id);
  26041. if (t && t.renderTarget) {
  26042. var i = this.qualityManager.getMaxZoomPanoSize()
  26043. , n = t.renderTarget
  26044. , r = t.size;
  26045. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26046. this.copyBaseRenderStatusToZoomed(e.id)
  26047. }
  26048. }
  26049. }
  26050. ,
  26051. t.exports = n
  26052. }
  26053. , {
  26054. "../enum/GLCubeFaces": 25,
  26055. "../enum/PanoRendererEvents": 35,
  26056. "../enum/PanoSizeClass": 36,
  26057. "../enum/SceneRendererEvents": 43,
  26058. "../enum/TileDownloaderEvents": 45,
  26059. "../enum/Vectors": 50,
  26060. "../exception/BasicException": 55,
  26061. "../objects/Panorama": 148,
  26062. "../settings": 166,
  26063. "../util/browser": 182,
  26064. "../util/panorama": 191,
  26065. "./TileDownloader": 171,
  26066. "./TilePrioritizer": 172,
  26067. "./TileTree": 173,
  26068. "./TileUtils": 174,
  26069. events: 202,
  26070. three: 217
  26071. }],
  26072. 170: [function(e, t, i) {
  26073. "use strict";
  26074. function n(e, t, i) {
  26075. this.maxNavPanoSize = -1,
  26076. this.maxZoomPanoSize = -1,
  26077. this.devicePixelDensity = e,
  26078. this.deviceScreenSize = t,
  26079. this.clientBandwidth = i,
  26080. this.panoSizeClassMap = {},
  26081. this.useHighResolutionPanos = !0,
  26082. this.useUltraHighResolutionPanos = !1,
  26083. this.modelHasUltraHighPanos = !1
  26084. }
  26085. var r = e("../enum/PanoSizeClass")
  26086. , o = e("../settings")
  26087. , a = e("../util/browser")
  26088. , s = e("../constants")
  26089. , l = e("../util/showcase")
  26090. , c = e("../enum/ModelManagerEvents");
  26091. n.prototype.init = function(e) {
  26092. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26093. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26094. this.highSize = this.getPanoSize(r.HIGH),
  26095. this.standardSize = this.getPanoSize(r.STANDARD),
  26096. this.baseSize = this.getPanoSize(r.BASE),
  26097. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26098. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26099. this.updateMaximums(),
  26100. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26101. }
  26102. ,
  26103. n.prototype.updateFromModel = function(e) {
  26104. this.updateHighResolutionSettings(e),
  26105. this.updateUltraHighResolutionSettings(e)
  26106. }
  26107. ,
  26108. n.prototype.updateHighResolutionSettings = function(e) {
  26109. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26110. this.updateMaximums()
  26111. }
  26112. ,
  26113. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26114. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26115. this.updateMaximums()
  26116. }
  26117. ,
  26118. n.prototype.enableUltraHighQualityMode = function() {
  26119. this.modelHasUltraHighPanos = !0,
  26120. this.updateUltraHighResolutionSettings(null)
  26121. }
  26122. ,
  26123. n.prototype.ultraHighQualityModeEnabled = function() {
  26124. return this.modelHasUltraHighPanos
  26125. }
  26126. ,
  26127. n.prototype.onModelChanged = function(e) {
  26128. this.updateFromModel(e.model),
  26129. this.updateMaximums()
  26130. }
  26131. ,
  26132. n.prototype.updateMaximums = function() {
  26133. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26134. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26135. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26136. }
  26137. ,
  26138. n.prototype.buildPanoSizeClassMap = function() {
  26139. this.panoSizeClassMap[r.BASE] = 512,
  26140. this.panoSizeClassMap[r.STANDARD] = 1024,
  26141. this.panoSizeClassMap[r.HIGH] = 2048,
  26142. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26143. }
  26144. ,
  26145. n.prototype.getPanoSize = function(e) {
  26146. return this.panoSizeClassMap[e]
  26147. }
  26148. ,
  26149. n.prototype.getMaxPossiblePanoSize = function() {
  26150. return this.getPanoSize(r.ULTRAHIGH)
  26151. }
  26152. ,
  26153. n.prototype.getMaxPanoSize = function() {
  26154. return this.maxZoomPanoSize
  26155. }
  26156. ,
  26157. n.prototype.getMaxNavPanoSize = function() {
  26158. return this.maxNavPanoSize
  26159. }
  26160. ,
  26161. n.prototype.getMaxZoomPanoSize = function() {
  26162. return this.maxZoomPanoSize
  26163. }
  26164. ,
  26165. n.prototype.detectMaxNavPanoSizeClass = function() {
  26166. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26167. }
  26168. ,
  26169. n.prototype.detectMaxNavPanoSize = function() {
  26170. var e = this.detectMaxNavPanoSizeClass();
  26171. return this.getPanoSize(e)
  26172. }
  26173. ,
  26174. n.prototype.detectMaxZoomPanoSize = function() {
  26175. 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)
  26176. }
  26177. ,
  26178. t.exports = n
  26179. }
  26180. , {
  26181. "../constants": 8,
  26182. "../enum/ModelManagerEvents": 33,
  26183. "../enum/PanoSizeClass": 36,
  26184. "../settings": 166,
  26185. "../util/browser": 182,
  26186. "../util/showcase": 193
  26187. }],
  26188. 171: [function(A, C, e) {
  26189. (function(e) {
  26190. "use strict";
  26191. function i(e) {
  26192. this.panos = null,
  26193. this.retryMinimumTime = 1e4,
  26194. this.urls = null,
  26195. this.panoLoadCallbacks = {},
  26196. this.downloadDescriptors = {},
  26197. this.priorityQueue = [],
  26198. this.forceQueue = [],
  26199. this.activeDownloads = [],
  26200. this.qualityManager = null,
  26201. this.tilePrioritizer = null,
  26202. this.refreshInterval = null,
  26203. this.processPriorityQueue = !1,
  26204. this.concurrentDownloads = e.concurrentDownloads || 1,
  26205. this.downloadTestResults = {}
  26206. }
  26207. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26208. A("../settings")), r = (A("../objects/Panorama"),
  26209. A("../util/logger")), o = (A("../enum/Vectors"),
  26210. A("../enum/PanoSizeClass"),
  26211. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26212. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26213. Object.freeze({
  26214. Testing: 1,
  26215. Success: 2,
  26216. Fail: 3
  26217. }));
  26218. i.prototype = Object.create(l.prototype),
  26219. i.IDLE_REFRESH_DELAY = 500,
  26220. i.ACTIVE_REFRESH_DELAY = 16,
  26221. i.DOWNLOAD_RETRIES = 4,
  26222. i.prototype.init = function(e) {
  26223. this.qualityManager = e
  26224. }
  26225. ,
  26226. i.prototype.setUrls = function(e) {
  26227. this.urls = e
  26228. }
  26229. ,
  26230. i.prototype.setPanoData = function(e, t, i) {
  26231. this.panos = e,
  26232. this.imagePanos = t,
  26233. this.panoGroupId = i
  26234. }
  26235. ,
  26236. i.prototype.start = function() {
  26237. this.refreshUpdateInterval(0)
  26238. }
  26239. ,
  26240. i.prototype.stop = function() {
  26241. window.cancel(this.refreshInterval)
  26242. }
  26243. ,
  26244. i.prototype.refreshUpdateInterval = function(e) {
  26245. e = e || 0,
  26246. this.refreshInterval = window.setTimeout(function() {
  26247. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26248. }
  26249. .bind(this), e)
  26250. }
  26251. ,
  26252. i.prototype.update = function() {
  26253. var e = 0 < this.forceQueue.length;
  26254. return this.processQueueForDownloading(this.forceQueue),
  26255. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26256. 0 < this.priorityQueue.length && (e = !0),
  26257. this.processQueueForDownloading(this.priorityQueue)),
  26258. e
  26259. }
  26260. ,
  26261. i.prototype.forceQueueTilesForPano = (p = [],
  26262. f = [],
  26263. function(e, t, i, n, r, o) {
  26264. p.length = 0;
  26265. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26266. var l = a[s];
  26267. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26268. }
  26269. if (i && 0 < p.length) {
  26270. g.sortPanoTiles(p, e, i),
  26271. f.length = 0,
  26272. m.matchingTilesInDirection(e, t, i, n, r, f);
  26273. for (var c = 0, h = function(e) {
  26274. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26275. }; c < p.length; ) {
  26276. var u = p[c];
  26277. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26278. }
  26279. }
  26280. for (var d = 0; d < p.length; d++)
  26281. this.forceQueue.push(p[d]);
  26282. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26283. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26284. o && this.processQueueForDownloading(this.forceQueue, !0)
  26285. }
  26286. ),
  26287. i.prototype.clearForceQueue = function() {
  26288. this.clearQueue(this.forceQueue)
  26289. }
  26290. ,
  26291. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26292. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26293. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26294. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26295. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26296. }
  26297. ,
  26298. i.prototype.clearQueue = function(e) {
  26299. this.setStatusForAllDescriptors(e, v.None),
  26300. e.length = 0
  26301. }
  26302. ,
  26303. i.prototype.clearFromQueue = function(e, t, i) {
  26304. for (var n = 0; n < e.length; n++) {
  26305. var r = e[n];
  26306. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26307. }
  26308. }
  26309. ,
  26310. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26311. for (var i = 0; i < e.length; i++) {
  26312. var n = e[i];
  26313. n && (n.status = t)
  26314. }
  26315. }
  26316. ,
  26317. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26318. for (var i = 0; i < e.length; i++) {
  26319. var n = e[i];
  26320. n && (n.status !== t ? n.status = t : e[i] = null)
  26321. }
  26322. }
  26323. ,
  26324. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26325. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26326. , n = i[t];
  26327. return n || (n = this.buildDownloadDescriptorArray(t),
  26328. i[t] = n,
  26329. this.initTileDownloadDescriptors(n, e, t)),
  26330. n
  26331. }
  26332. ,
  26333. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26334. var t = this.downloadDescriptors[e.id];
  26335. return t || (t = {},
  26336. this.downloadDescriptors[e.id] = t),
  26337. t
  26338. }
  26339. ,
  26340. i.prototype.processQueueForDownloading = function(e, t) {
  26341. if (this.cleanupActiveDownloads(),
  26342. this.activeDownloads.length < this.concurrentDownloads || t)
  26343. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26344. var r = e.shift();
  26345. r && (this.startDownload(r),
  26346. n++)
  26347. }
  26348. }
  26349. ,
  26350. i.prototype.testDownload = function(t, e, i) {
  26351. var n = this.downloadTestResults[t];
  26352. if (n)
  26353. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26354. else {
  26355. this.downloadTestResults[t] = y.Testing;
  26356. var r = this.panos.list[0]
  26357. , o = this.getTileUrl(r.id, t, e, 0)
  26358. , a = function(e) {
  26359. this.downloadTestResults[t] = y.Success,
  26360. i(!0)
  26361. }
  26362. .bind(this)
  26363. , s = function() {
  26364. this.downloadTestResults[t] = y.Fail,
  26365. i(!1)
  26366. }
  26367. .bind(this);
  26368. this.loadImage(o, 0, a, s)
  26369. }
  26370. }
  26371. ,
  26372. i.prototype.startDownload = function(e) {
  26373. e.status = v.Downloading;
  26374. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26375. this.activeDownloads.push(e),
  26376. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26377. }
  26378. ,
  26379. i.prototype.downloadFailed = function(e, t) {}
  26380. ,
  26381. i.prototype.downloadComplete = function(e, t) {
  26382. if (e.panoGroupId === this.panoGroupId) {
  26383. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26384. e.status = v.Downloaded,
  26385. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26386. var n = {
  26387. panoId: e.pano.id,
  26388. image: t,
  26389. tileSize: e.tileSize,
  26390. panoSize: e.panoSize,
  26391. tileIndex: e.tileIndex,
  26392. faceTileIndex: e.faceTileIndex,
  26393. totalTiles: e.totalTiles,
  26394. face: e.face,
  26395. tileX: e.tileX,
  26396. tileY: e.tileY,
  26397. direction: e.direction
  26398. };
  26399. e.image = t,
  26400. this.emit(o.TileDownloadSuccess, n),
  26401. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26402. panoId: e.pano.id,
  26403. tileSize: e.tileSize,
  26404. panoSize: e.panoSize
  26405. },
  26406. this.emit(o.PanoDownloadComplete, n),
  26407. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26408. }
  26409. }
  26410. ,
  26411. i.prototype.cleanupActiveDownloads = (n = [],
  26412. function() {
  26413. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26414. var t = this.activeDownloads[e];
  26415. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26416. }
  26417. this.activeDownloads.length = 0,
  26418. this.activeDownloads.push.apply(this.activeDownloads, n)
  26419. }
  26420. ),
  26421. i.prototype.isPanoDownloaded = function(e, t) {
  26422. var i = this.getTileDownloadDescriptors(e, t);
  26423. if (i.length <= 0)
  26424. return !1;
  26425. for (var n = 0; n < i.length; n++) {
  26426. if (i[n].status !== v.Downloaded)
  26427. return !1
  26428. }
  26429. return !0
  26430. }
  26431. ,
  26432. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26433. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26434. this.panoLoadCallbacks[o] = {
  26435. onLoad: i,
  26436. onFail: n,
  26437. onProgress: r
  26438. }
  26439. }
  26440. ,
  26441. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26442. var i = e.id + ":" + t;
  26443. return this.panoLoadCallbacks[i]
  26444. }
  26445. ,
  26446. i.prototype.buildDownloadDescriptorArray = function(e) {
  26447. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26448. var r = this.buildDownloadDescriptor();
  26449. i.push(r)
  26450. }
  26451. return i
  26452. }
  26453. ,
  26454. i.prototype.buildDownloadDescriptor = function() {
  26455. return {
  26456. panoGroupId: null,
  26457. pano: null,
  26458. panoSize: -1,
  26459. tileSize: -1,
  26460. tileIndex: -1,
  26461. totalTiles: -1,
  26462. faceTileIndex: -1,
  26463. status: v.None,
  26464. url: null,
  26465. image: null,
  26466. direction: new t.Vector3,
  26467. face: -1,
  26468. cubeFace: -1,
  26469. tileX: -1,
  26470. tileY: -1
  26471. }
  26472. }
  26473. ,
  26474. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26475. for (var n = 0; n < e.length; n++) {
  26476. var r = e[n];
  26477. this.initTileDownloadDescriptor(r, t, i, n)
  26478. }
  26479. }
  26480. ,
  26481. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26482. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26483. e.face = m.getFaceForTile(i, n),
  26484. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26485. e.panoGroupId = this.panoGroupId,
  26486. e.pano = t,
  26487. e.panoSize = i,
  26488. e.tileSize = r,
  26489. e.tileIndex = n,
  26490. e.totalTiles = m.getTileCountForSize(i),
  26491. e.status = v.None,
  26492. e.image = null,
  26493. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26494. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26495. }
  26496. ,
  26497. i.prototype.getTileUrl = (c = {
  26498. 256: "256",
  26499. 512: "512",
  26500. 1024: "1k",
  26501. 2048: "2k",
  26502. 4096: "4k"
  26503. },
  26504. h = {
  26505. face: -1,
  26506. faceTileIndex: -1,
  26507. tileX: -1,
  26508. tileY: -1
  26509. },
  26510. function(e, t, i, n) {
  26511. m.getTileLocation(t, n, h);
  26512. var r = Math.floor(t / i)
  26513. , o = r * r
  26514. , a = Math.floor(n / o)
  26515. , s = "";
  26516. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26517. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26518. return d.changeIfTileGenerating(l)
  26519. }
  26520. ),
  26521. i.prototype.loadImage = function(e, t, i, n) {
  26522. s.getImage(e, t).then(function(e) {
  26523. i(e)
  26524. }).fail(n)
  26525. }
  26526. ,
  26527. C.exports = i
  26528. }
  26529. ).call(this, "/js/tile/TileDownloader.js")
  26530. }
  26531. , {
  26532. "../ab": 3,
  26533. "../enum/DownloadStatus": 24,
  26534. "../enum/GLCubeFaces": 25,
  26535. "../enum/PanoSizeClass": 36,
  26536. "../enum/TileDownloaderEvents": 45,
  26537. "../enum/Vectors": 50,
  26538. "../enum/Viewmode": 51,
  26539. "../objects/Panorama": 148,
  26540. "../settings": 166,
  26541. "../util/ajax": 181,
  26542. "../util/logger": 189,
  26543. "../util/panorama": 191,
  26544. "./TilePrioritizer": 172,
  26545. "./TileUtils": 174,
  26546. events: 202,
  26547. three: 217
  26548. }],
  26549. 172: [function(n, C, e) {
  26550. (function(e) {
  26551. "use strict";
  26552. function h(e, t, i, n, r) {
  26553. this.qualityManager = e,
  26554. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26555. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26556. this.baseSize = t,
  26557. this.standardSize = i,
  26558. this.highSize = n,
  26559. this.ultraHighSize = r,
  26560. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26561. }
  26562. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26563. n("../settings"),
  26564. n("../settings"),
  26565. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26566. n("../enum/PanoSizeClass"),
  26567. n("../enum/ModelManagerEvents"),
  26568. n("../enum/GLCubeFaces"),
  26569. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26570. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26571. new t(e),
  26572. Object.freeze({
  26573. None: 0,
  26574. DirectionalFOV: 1
  26575. }));
  26576. h.PriorityCriteria = function(e, t, i, n, r) {
  26577. this.pano = e,
  26578. this.cameraPosition = (new o.Vector3).copy(t),
  26579. this.cameraDir = (new o.Vector3).copy(i),
  26580. this.panoSpaceDir = (new o.Vector3).copy(n),
  26581. this.upcomingPanos = r,
  26582. this.copy = function(e) {
  26583. this.pano = e.pano,
  26584. this.cameraPosition.copy(e.cameraPosition),
  26585. this.cameraDir.copy(e.cameraDir),
  26586. this.panoSpaceDir.copy(e.panoSpaceDir),
  26587. this.upcomingPanos = r
  26588. }
  26589. ,
  26590. this.zoomingActive = !1
  26591. }
  26592. ,
  26593. h.DIRECTIONAL_FOV = 180,
  26594. h.DIRECTIONAL_FOV_NARROW = 120,
  26595. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26596. h.MAX_SCORED_PANOS_TOADD = 2,
  26597. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26598. h.DIRECTION_SCORE_STRICTNESS = .75,
  26599. h.appendQueue = function(e, t) {
  26600. if (e && t)
  26601. for (var i = 0; i < t.length; i++)
  26602. e.push(t[i])
  26603. }
  26604. ,
  26605. h.prototype.updateCriteria = function(e, t, i, n) {
  26606. this.priorityCriteria.pano = e,
  26607. this.priorityCriteria.cameraPosition.copy(t),
  26608. this.priorityCriteria.cameraDir.copy(i),
  26609. this.priorityCriteria.upcomingPanos = n,
  26610. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26611. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26612. }
  26613. ,
  26614. h.prototype.filterAndPrioritize = (u = [],
  26615. p = [],
  26616. f = [],
  26617. function(e, t, i) {
  26618. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26619. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26620. var n = this.baseSize
  26621. , r = this.standardSize
  26622. , o = this.highSize
  26623. , a = this.ultraHighSize;
  26624. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26625. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26626. f.length = 0,
  26627. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26628. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26629. h.appendQueue(e, f),
  26630. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26631. f.length = 0,
  26632. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26633. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26634. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26635. h.appendQueue(e, f),
  26636. f.length = 0,
  26637. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26638. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26639. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26640. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26641. h.appendQueue(e, f),
  26642. this.queueTilesForPanos(e, u, i, n)
  26643. }
  26644. ),
  26645. h.prototype.canDownloadSize = function(e) {
  26646. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26647. }
  26648. ,
  26649. h.prototype.populateNeighborPanos = function(e, t, i) {
  26650. (i = i || []).length = 0;
  26651. var n = t.getNeighbours(e);
  26652. for (var r in n)
  26653. if (n.hasOwnProperty(r)) {
  26654. var o = t.get(r);
  26655. i.push(o)
  26656. }
  26657. return i
  26658. }
  26659. ,
  26660. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26661. (i = i || []).length = 0;
  26662. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26663. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26664. , s = t.sortByScore(o, a);
  26665. if (s)
  26666. for (var l = 0; l < s.length && l < r; l++) {
  26667. var c = s[l].pano;
  26668. i.push(c)
  26669. }
  26670. return i
  26671. }
  26672. ,
  26673. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26674. for (var o = 0, a = 0; a < t.length; a++) {
  26675. var s = t[a];
  26676. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26677. r && r <= o)
  26678. break
  26679. }
  26680. return o
  26681. }
  26682. ,
  26683. h.prototype.queueTilesForPano = (r = {
  26684. filter: a.None
  26685. },
  26686. function(e, t, i, n) {
  26687. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26688. }
  26689. ),
  26690. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26691. function(e, t, i, n, r, o, a, s) {
  26692. for (var l = 0, c = 0; c < i.length; c++) {
  26693. var h = i[c];
  26694. d.copy(h.position),
  26695. d.sub(r),
  26696. d.normalize();
  26697. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26698. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26699. s && s <= l))
  26700. break
  26701. }
  26702. return l
  26703. }
  26704. ),
  26705. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26706. for (var l = 0, c = 0; c < i.length; c++) {
  26707. var h = i[c];
  26708. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26709. s && s <= l)
  26710. break
  26711. }
  26712. return l
  26713. }
  26714. ,
  26715. h.prototype.queueTilesInDirectionForPano = (s = {
  26716. filter: a.DirectionalFOV,
  26717. direction: new o.Vector3,
  26718. fov: 60
  26719. },
  26720. l = new o.Vector3,
  26721. function(e, t, i, n, r, o, a) {
  26722. return l.copy(o),
  26723. m.getRelativeDirection(i.quaternion, l),
  26724. s.direction.copy(l),
  26725. s.fov = a,
  26726. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26727. }
  26728. ),
  26729. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26730. function(e, t, i, n, r) {
  26731. var o = t.getTileDownloadDescriptors(i, n);
  26732. c.length = 0,
  26733. this.filterTileDownloadDescriptors(i, o, c, r);
  26734. for (var a = 0, s = 0; s < c.length; s++) {
  26735. var l = c[s];
  26736. l && (e.push(l),
  26737. a++)
  26738. }
  26739. return a
  26740. }
  26741. ),
  26742. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26743. function(e, t, i, n) {
  26744. var r, o;
  26745. switch (n.filter) {
  26746. case a.DirectionalFOV:
  26747. for (r = 0; r < t.length; r++)
  26748. o = t[r],
  26749. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26750. break;
  26751. default:
  26752. for (r = 0; r < t.length; r++)
  26753. o = t[r],
  26754. i.push(o)
  26755. }
  26756. for (r = 0; r < i.length; r++)
  26757. o = i[r],
  26758. this.canIncludeDescriptor(o) || (i[r] = null)
  26759. }
  26760. ),
  26761. h.prototype.canIncludeDescriptor = function(e) {
  26762. return e.status !== i.Downloading && e.status !== i.Downloaded
  26763. }
  26764. ,
  26765. h.prototype.canIncludePano = function(e, t) {
  26766. return !e.isLoaded(t)
  26767. }
  26768. ,
  26769. h.getFOVDotThreshold = function(e) {
  26770. return Math.cos(o.Math.degToRad(e / 2))
  26771. }
  26772. ;
  26773. var y = (A._panoSpaceDir = new o.Vector3,
  26774. A._fovThreshold = -1,
  26775. A._fovThresholdNarrow = -1,
  26776. A);
  26777. function A(e, t) {
  26778. var i = A._panoSpaceDir
  26779. , n = A._fovThreshold
  26780. , r = A._fovThresholdNarrow
  26781. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26782. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26783. return e._dot = o,
  26784. t._dot = a,
  26785. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  26786. }
  26787. h.sortPanoTiles = function(e, t, i) {
  26788. y._panoSpaceDir.copy(i),
  26789. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26790. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26791. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26792. e.sort(y)
  26793. }
  26794. ,
  26795. h.insertSortedPanoTile = function(e, t, i, n) {
  26796. y._panoSpaceDir.copy(n),
  26797. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26798. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26799. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26800. for (var r = -1, o = 0; o < e.length; o++) {
  26801. if (y(t, e[o]) <= 0) {
  26802. r = o;
  26803. break
  26804. }
  26805. }
  26806. if (-1 === r)
  26807. e[e.length] = t;
  26808. else {
  26809. for (var a = e.length; r < a; a--)
  26810. e[a] = e[a - 1];
  26811. e[r] = t
  26812. }
  26813. }
  26814. ,
  26815. h.prototype.setZoomingActive = function(e) {
  26816. e !== this.zoomingActive && (this.zoomingActive = e)
  26817. }
  26818. ,
  26819. C.exports = h
  26820. }
  26821. ).call(this, "/js/tile/TilePrioritizer.js")
  26822. }
  26823. , {
  26824. "../enum/DownloadStatus": 24,
  26825. "../enum/GLCubeFaces": 25,
  26826. "../enum/ModelManagerEvents": 33,
  26827. "../enum/PanoSizeClass": 36,
  26828. "../enum/Vectors": 50,
  26829. "../enum/Viewmode": 51,
  26830. "../objects/Panorama": 148,
  26831. "../settings": 166,
  26832. "../util/browser": 182,
  26833. "../util/logger": 189,
  26834. "../util/math": 190,
  26835. "./TileUtils": 174,
  26836. events: 202,
  26837. three: 217
  26838. }],
  26839. 173: [function(e, t, i) {
  26840. "use strict";
  26841. function f(e, t) {
  26842. this.levels = t,
  26843. this.tileSize = e,
  26844. this.root = null,
  26845. this.allNodes = [],
  26846. function(e) {
  26847. e.root = function e(t, i, n) {
  26848. if (n > t.levels)
  26849. return null;
  26850. var r = new a(t,i);
  26851. t.allNodes.push(r);
  26852. for (var o = 0; o < s; o++)
  26853. r.children[o] = e(t, r, n + 1);
  26854. return r
  26855. }(e, null, 0)
  26856. }(this)
  26857. }
  26858. function a(e, t) {
  26859. this.tree = e,
  26860. this.parent = t,
  26861. this.children = [],
  26862. this.id = ++n
  26863. }
  26864. var g = (e("three"),
  26865. e("./TileUtils"),
  26866. e("../objects/Panorama"),
  26867. e("../util/panorama"),
  26868. e("events").EventEmitter,
  26869. 2)
  26870. , s = g * g;
  26871. f.TraversalType = Object.freeze({
  26872. PreOrder: 0,
  26873. PostOrder: 1
  26874. });
  26875. var n = 0;
  26876. f.getLevelCountForSize = function(e, t) {
  26877. var i = 0;
  26878. for (t < e && (t = e); !((t /= g) < e); )
  26879. i++;
  26880. return i
  26881. }
  26882. ,
  26883. f.getSizeForLevel = function(e, t) {
  26884. return Math.pow(g, t) * e
  26885. }
  26886. ,
  26887. f.prototype.getSubNode = function(e, t, i) {
  26888. (!t || e < this.tileSize) && (t = 0),
  26889. (!i || e < this.tileSize) && (i = 0),
  26890. e < this.tileSize && (e = this.tileSize);
  26891. var n = f.getLevelCountForSize(this.tileSize, e);
  26892. return function e(t, i, n, r, o) {
  26893. if (!t)
  26894. return null;
  26895. if (0 === n)
  26896. return t;
  26897. if (!t.children || 0 === t.children.length)
  26898. return null;
  26899. var a = Math.pow(g, n) / g
  26900. , s = r % a
  26901. , l = o % a
  26902. , c = Math.floor(o / a)
  26903. , h = Math.floor(r / a)
  26904. , u = c * g + h;
  26905. return e(t.children[u], i + 1, n - 1, s, l)
  26906. }(this.root, 0, n, t, i)
  26907. }
  26908. ,
  26909. f.prototype.breadthFirst = function(e) {
  26910. var t = !!(e = e || {}).nullLevelEnd
  26911. , i = e.maxLevel
  26912. , n = e.minLevel
  26913. , r = e.callback
  26914. , o = e.saveVisited
  26915. , a = []
  26916. , s = {}
  26917. , l = 0;
  26918. for (a.push(this.root),
  26919. a.push(s); 0 < a.length && !(i && i < l); ) {
  26920. var c = a.shift();
  26921. if (c === s)
  26922. (!n || n <= l) && (r && t && r(null),
  26923. o && t && o.push(null)),
  26924. 0 < a.length && a.push(s),
  26925. l++,
  26926. 0;
  26927. else {
  26928. if (c.children)
  26929. for (var h = 0; h < c.children.length; h++) {
  26930. c.children[h] && a.push(c.children[h])
  26931. }
  26932. var u = this.getFaceIndexFromNode(c);
  26933. (!n || n <= l) && (r && r(c, l, u),
  26934. o && o.push(c)),
  26935. 0
  26936. }
  26937. }
  26938. }
  26939. ,
  26940. f.prototype.getFaceIndexFromNode = function(e) {
  26941. if (!e)
  26942. return -1;
  26943. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26944. var o = i.parent;
  26945. if (!o)
  26946. break;
  26947. for (var a = -1, s = 0; s < o.children.length; s++)
  26948. o.children[s] === i && (a = s);
  26949. n = a % g * t + n,
  26950. r = Math.floor(a / g) * t + r,
  26951. t *= g,
  26952. i = o
  26953. }
  26954. return r * t + n
  26955. }
  26956. ,
  26957. f.prototype.depthFirst = function(e, t, i) {
  26958. !function e(t, i, n, r, o, a, s, l) {
  26959. if (t) {
  26960. s = s || f.TraversalType.PreOrder;
  26961. var c = r * g + n;
  26962. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26963. a && a.push(t)),
  26964. t.children && 0 !== t.children.length) {
  26965. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26966. for (var p = 0; p < g; p++)
  26967. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26968. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26969. a && a.push(t))
  26970. }
  26971. }
  26972. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26973. }
  26974. ,
  26975. t.exports = f
  26976. }
  26977. , {
  26978. "../objects/Panorama": 148,
  26979. "../util/panorama": 191,
  26980. "./TileUtils": 174,
  26981. events: 202,
  26982. three: 217
  26983. }],
  26984. 174: [function(e, t, i) {
  26985. "use strict";
  26986. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26987. b.TILE_SIZE = 512,
  26988. b.FACES_PER_PANO = 6,
  26989. b.LocationOnTile = {
  26990. Center: 0,
  26991. UpperLeft: 1,
  26992. UpperRight: 2,
  26993. LowerRight: 3,
  26994. LowerLeft: 4
  26995. },
  26996. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26997. var l = e / t
  26998. , c = t / e * 2
  26999. , h = c / 2
  27000. , u = n / l * 2 - 1 + h
  27001. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27002. switch (o = o || b.LocationOnTile.Center) {
  27003. case b.LocationOnTile.UpperLeft:
  27004. u -= h,
  27005. d += h,
  27006. u += a * c;
  27007. break;
  27008. case b.LocationOnTile.UpperRight:
  27009. u += h,
  27010. d += h,
  27011. d -= a * c;
  27012. break;
  27013. case b.LocationOnTile.LowerRight:
  27014. u += h,
  27015. d -= h,
  27016. u -= a * c;
  27017. break;
  27018. case b.LocationOnTile.LowerLeft:
  27019. u -= h,
  27020. d -= h,
  27021. d += a * c;
  27022. break;
  27023. case b.LocationOnTile.Center:
  27024. }
  27025. switch (i) {
  27026. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27027. _.setVector(s, -1, d, -u);
  27028. break;
  27029. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27030. _.setVector(s, 1, d, u);
  27031. break;
  27032. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27033. _.setVector(s, -u, 1, -d);
  27034. break;
  27035. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27036. _.setVector(s, -u, -1, d);
  27037. break;
  27038. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27039. _.setVector(s, -u, d, 1);
  27040. break;
  27041. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27042. _.setVector(s, u, d, -1)
  27043. }
  27044. _.normalize(s)
  27045. }
  27046. ,
  27047. b.getFaceForTile = function(e, t) {
  27048. var i = b.TILE_SIZE;
  27049. e < b.TILE_SIZE && (i = e);
  27050. var n = Math.floor(e / i)
  27051. , r = n * n;
  27052. return Math.floor(t / r)
  27053. }
  27054. ,
  27055. b.getTileLocation = function(e, t, i) {
  27056. var n = b.TILE_SIZE;
  27057. e < b.TILE_SIZE && (n = e);
  27058. var r = b.getFaceForTile(e, t)
  27059. , o = Math.floor(e / n)
  27060. , a = t - r * (o * o);
  27061. i.tileX = a % o,
  27062. i.tileY = Math.floor(a / o),
  27063. i.face = r,
  27064. i.faceTileIndex = a
  27065. }
  27066. ,
  27067. b.getTileCountForSize = function(e) {
  27068. if (e <= b.TILE_SIZE)
  27069. return b.FACES_PER_PANO;
  27070. var t = Math.floor(e / b.TILE_SIZE);
  27071. return t * t * b.FACES_PER_PANO
  27072. }
  27073. ,
  27074. b.getRelativeDirection = (r = new _.Matrix4,
  27075. o = new _.Quaternion,
  27076. function(e, t) {
  27077. o.copy(e),
  27078. o.inverse(),
  27079. r.makeRotationFromQuaternion(o),
  27080. r.applyToVector3(t),
  27081. _.normalize(t)
  27082. }
  27083. ),
  27084. b.matchingTilesInDirection = (c = new _.Vector3,
  27085. h = new _.Vector3(0,0,-1),
  27086. u = new _.Quaternion,
  27087. l = {
  27088. face: -1,
  27089. faceTileIndex: -1,
  27090. tileX: -1,
  27091. tileY: -1
  27092. },
  27093. d = function(e, t, i) {
  27094. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27095. b.getTileLocation(e, o, l),
  27096. t && !t(l) || (r++,
  27097. i && (a = l,
  27098. i.push({
  27099. face: a.face,
  27100. faceTileIndex: a.faceTileIndex,
  27101. tileX: a.tileX,
  27102. tileY: a.tileY
  27103. })));
  27104. var a;
  27105. return r
  27106. }
  27107. ,
  27108. function(e, t, i, n, r, o) {
  27109. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27110. if (b.getTileCountForSize(t),
  27111. !n && !r)
  27112. return d(t, null, o);
  27113. var s = !!r;
  27114. return r = r || n,
  27115. r = Math.max(0, Math.min(r, 360)),
  27116. n = Math.max(0, Math.min(n, 360)),
  27117. _.copyVector(i, c),
  27118. b.getRelativeDirection(e.quaternion, c),
  27119. s ? (u.setFromUnitVectors(c, h),
  27120. d(t, function(e) {
  27121. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27122. }, o)) : d(t, function(e) {
  27123. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27124. }, o)
  27125. }
  27126. ),
  27127. b.isTileWithinFrustum = (E = new _.Vector3,
  27128. function(e, t, i, n, r, o, a, s) {
  27129. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  27130. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27131. _.applyQuaternionToVector(o, E),
  27132. -1e-5 <= E.z)
  27133. ;
  27134. else {
  27135. var A = -1 / E.z
  27136. , C = E.x * A
  27137. , I = E.y * A;
  27138. l < I ? p++ : I < c && f++,
  27139. h < C ? g++ : C < u && m++,
  27140. v++
  27141. }
  27142. return f !== v && p !== v && g !== v && m !== v
  27143. }
  27144. ),
  27145. b.isTileWithinFOV = (p = new _.Vector3,
  27146. f = new _.Vector3(0,1,0),
  27147. g = new _.Vector3(1,0,0),
  27148. function(e, t, i, n, r, o, a) {
  27149. var s = b.mapFaceToCubemapFace(i);
  27150. if (_.cross(o, f, g),
  27151. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27152. b.isWithinFOV(p, o, a, null))
  27153. return !0;
  27154. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27155. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27156. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27157. b.isWithinFOV(p, o, a, null))
  27158. return !0;
  27159. h += l
  27160. }
  27161. return !1
  27162. }
  27163. ),
  27164. b.isWithinFOV = (a = new _.Vector3,
  27165. s = new _.Vector3,
  27166. function(e, t, i, n) {
  27167. if (_.copyVector(e, s),
  27168. n) {
  27169. _.copyVector(n, a),
  27170. _.normalize(a);
  27171. var r = _.dot(a, e);
  27172. a.x *= r,
  27173. a.y *= r,
  27174. a.z *= r,
  27175. _.subVector(s, a)
  27176. }
  27177. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27178. return Math.cos(o) <= _.dot(s, t)
  27179. }
  27180. ),
  27181. b.mapFaceToCubemapFace = (n = {
  27182. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27183. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27184. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27185. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27186. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27187. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27188. },
  27189. function(e) {
  27190. return n[e]
  27191. }
  27192. ),
  27193. t.exports = b
  27194. }
  27195. , {
  27196. "../enum/GLCubeFaces": 25,
  27197. "../util/MathLight": 176
  27198. }],
  27199. 175: [function(i, n, e) {
  27200. (function(e) {
  27201. "use strict";
  27202. function t() {
  27203. this.list = [],
  27204. this.index = {},
  27205. Object.defineProperty(this, "length", {
  27206. get: function() {
  27207. return this.list.length
  27208. }
  27209. })
  27210. }
  27211. new (i("./common"),
  27212. i("./logger"))(e),
  27213. t.prototype.forEach = function(e) {
  27214. this.list.forEach(e)
  27215. }
  27216. ,
  27217. t.prototype.add = function(e) {
  27218. this.list.push(e),
  27219. this.index[this.getIndex(e)] = e
  27220. }
  27221. ,
  27222. t.prototype.getIndex = function(e) {
  27223. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27224. }
  27225. ,
  27226. t.prototype.extend = function(e) {
  27227. for (var t = 0; t < e.length; t++)
  27228. this.add(e[t])
  27229. }
  27230. ,
  27231. t.prototype.get = function(e) {
  27232. return this.index[e]
  27233. }
  27234. ,
  27235. t.prototype.first = function() {
  27236. return this.list[0]
  27237. }
  27238. ,
  27239. t.prototype.last = function() {
  27240. return this.list[this.list.length - 1]
  27241. }
  27242. ,
  27243. t.prototype.reIndex = function() {
  27244. this.index = {};
  27245. var t = this;
  27246. this.forEach(function(e) {
  27247. t.index[t.getIndex(e)] = e
  27248. })
  27249. }
  27250. ,
  27251. t.prototype.filter = function(e) {
  27252. var t = this.list.filter(e);
  27253. return this.reIndex(),
  27254. t
  27255. }
  27256. ,
  27257. t.prototype.reduce = function(e, t) {
  27258. return this.list.reduce(e, t)
  27259. }
  27260. ,
  27261. t.prototype.sort = function(e) {
  27262. return this.list.sort(e)
  27263. }
  27264. ,
  27265. t.prototype.indexOf = function(e) {
  27266. for (var t = 0; t < this.list.length; ++t)
  27267. if (this.list[t] === e)
  27268. return t;
  27269. return -1
  27270. }
  27271. ,
  27272. n.exports = t
  27273. }
  27274. ).call(this, "/js/util/IndexedCollection.js")
  27275. }
  27276. , {
  27277. "./common": 185,
  27278. "./logger": 189
  27279. }],
  27280. 176: [function(e, t, i) {
  27281. "use strict";
  27282. e("../constants");
  27283. var n, r, o = {};
  27284. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27285. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27286. o.Vector3 = function(e, t, i) {
  27287. this.x = e || 0,
  27288. this.y = t || 0,
  27289. this.z = i || 0
  27290. }
  27291. ,
  27292. o.Matrix4 = function() {
  27293. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27294. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27295. }
  27296. ,
  27297. o.Matrix4.prototype = {
  27298. identity: function() {
  27299. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27300. this
  27301. },
  27302. copy: function(e) {
  27303. return this.elements.set(e.elements),
  27304. this
  27305. },
  27306. applyToVector3: function(e) {
  27307. var t = e.x
  27308. , i = e.y
  27309. , n = e.z
  27310. , r = this.elements;
  27311. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27312. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27313. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27314. this
  27315. },
  27316. getInverse: function(e, t) {
  27317. var i = this.elements
  27318. , n = e.elements
  27319. , r = n[0]
  27320. , o = n[1]
  27321. , a = n[2]
  27322. , s = n[3]
  27323. , l = n[4]
  27324. , c = n[5]
  27325. , h = n[6]
  27326. , u = n[7]
  27327. , d = n[8]
  27328. , p = n[9]
  27329. , f = n[10]
  27330. , g = n[11]
  27331. , m = n[12]
  27332. , v = n[13]
  27333. , y = n[14]
  27334. , A = n[15]
  27335. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27336. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27337. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27338. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27339. , b = r * C + o * I + a * E + s * _;
  27340. if (0 == b) {
  27341. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27342. if (t)
  27343. throw new Error(w);
  27344. return console.warn(w),
  27345. this.identity()
  27346. }
  27347. var T = 1 / b;
  27348. return i[0] = C * T,
  27349. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27350. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27351. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27352. i[4] = I * T,
  27353. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27354. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27355. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27356. i[8] = E * T,
  27357. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27358. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27359. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27360. i[12] = _ * T,
  27361. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27362. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27363. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27364. this
  27365. },
  27366. makeRotationFromQuaternion: function(e) {
  27367. var t = this.elements
  27368. , i = e.x
  27369. , n = e.y
  27370. , r = e.z
  27371. , o = e.w
  27372. , a = i + i
  27373. , s = n + n
  27374. , l = r + r
  27375. , c = i * a
  27376. , h = i * s
  27377. , u = i * l
  27378. , d = n * s
  27379. , p = n * l
  27380. , f = r * l
  27381. , g = o * a
  27382. , m = o * s
  27383. , v = o * l;
  27384. return t[0] = 1 - (d + f),
  27385. t[4] = h - v,
  27386. t[8] = u + m,
  27387. t[1] = h + v,
  27388. t[5] = 1 - (c + f),
  27389. t[9] = p - g,
  27390. t[2] = u - m,
  27391. t[6] = p + g,
  27392. t[10] = 1 - (c + d),
  27393. t[3] = 0,
  27394. t[7] = 0,
  27395. t[11] = 0,
  27396. t[12] = 0,
  27397. t[13] = 0,
  27398. t[14] = 0,
  27399. t[15] = 1,
  27400. this
  27401. }
  27402. },
  27403. o.Quaternion = function(e, t, i, n) {
  27404. this._x = e || 0,
  27405. this._y = t || 0,
  27406. this._z = i || 0,
  27407. this._w = void 0 !== n ? n : 1
  27408. }
  27409. ,
  27410. o.Quaternion.prototype = {
  27411. get x() {
  27412. return this._x
  27413. },
  27414. set x(e) {
  27415. this._x = e
  27416. },
  27417. get y() {
  27418. return this._y
  27419. },
  27420. set y(e) {
  27421. this._y = e
  27422. },
  27423. get z() {
  27424. return this._z
  27425. },
  27426. set z(e) {
  27427. this._z = e
  27428. },
  27429. get w() {
  27430. return this._w
  27431. },
  27432. set w(e) {
  27433. this._w = e
  27434. },
  27435. copy: function(e) {
  27436. this._x = e.x,
  27437. this._y = e.y,
  27438. this._z = e.z,
  27439. this._w = e.w
  27440. },
  27441. inverse: function() {
  27442. return this.conjugate().normalize()
  27443. },
  27444. conjugate: function() {
  27445. return this._x *= -1,
  27446. this._y *= -1,
  27447. this._z *= -1,
  27448. this
  27449. },
  27450. length: function() {
  27451. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27452. },
  27453. normalize: function() {
  27454. var e = this.length();
  27455. return 0 === e ? (this._x = 0,
  27456. this._y = 0,
  27457. this._z = 0,
  27458. this._w = 1) : (e = 1 / e,
  27459. this._x = this._x * e,
  27460. this._y = this._y * e,
  27461. this._z = this._z * e,
  27462. this._w = this._w * e),
  27463. this
  27464. },
  27465. setFromAxisAngle: function(e, t) {
  27466. var i = t / 2
  27467. , n = Math.sin(i);
  27468. return this._x = e.x * n,
  27469. this._y = e.y * n,
  27470. this._z = e.z * n,
  27471. this._w = Math.cos(i),
  27472. this
  27473. },
  27474. setFromUnitVectors: function(e, t) {
  27475. return void 0 === n && (n = new o.Vector3),
  27476. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27477. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27478. this._x = n.x,
  27479. this._y = n.y,
  27480. this._z = n.z,
  27481. this._w = r,
  27482. this.normalize()
  27483. },
  27484. multiply: function(e) {
  27485. return this.multiplyQuaternions(this, e)
  27486. },
  27487. premultiply: function(e) {
  27488. return this.multiplyQuaternions(e, this)
  27489. },
  27490. multiplyQuaternions: function(e, t) {
  27491. var i = e._x
  27492. , n = e._y
  27493. , r = e._z
  27494. , o = e._w
  27495. , a = t._x
  27496. , s = t._y
  27497. , l = t._z
  27498. , c = t._w;
  27499. return this._x = i * c + o * a + n * l - r * s,
  27500. this._y = n * c + o * s + r * a - i * l,
  27501. this._z = r * c + o * l + i * s - n * a,
  27502. this._w = o * c - i * a - n * s - r * l,
  27503. this
  27504. }
  27505. },
  27506. o.convertWorkshopVector = function(e) {
  27507. return new o.Vector3(-e.x,e.y,e.z)
  27508. }
  27509. ,
  27510. o.convertWorkshopQuaternion = function(e) {
  27511. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27512. }
  27513. ,
  27514. o.convertWorkshopOrthoZoom = function(e) {
  27515. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27516. }
  27517. ,
  27518. o.convertWorkshopPanoramaQuaternion = function(e) {
  27519. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27520. }
  27521. ,
  27522. o.normalize = function(e) {
  27523. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27524. , i = Math.sqrt(t);
  27525. e.x /= i,
  27526. e.y /= i,
  27527. e.z /= i
  27528. }
  27529. ,
  27530. o.dot = function(e, t) {
  27531. return e.x * t.x + e.y * t.y + e.z * t.z
  27532. }
  27533. ,
  27534. o.cross = function(e, t, i) {
  27535. var n = e.x
  27536. , r = e.y
  27537. , o = e.z;
  27538. i.x = r * t.z - o * t.y,
  27539. i.y = o * t.x - n * t.z,
  27540. i.z = n * t.y - r * t.x
  27541. }
  27542. ,
  27543. o.setVector = function(e, t, i, n) {
  27544. e.x = t,
  27545. e.y = i,
  27546. e.z = n
  27547. }
  27548. ,
  27549. o.copyVector = function(e, t) {
  27550. t.x = e.x,
  27551. t.y = e.y,
  27552. t.z = e.z
  27553. }
  27554. ,
  27555. o.addVector = function(e, t) {
  27556. e.x += t.x,
  27557. e.y += t.y,
  27558. e.z += t.z
  27559. }
  27560. ,
  27561. o.subVector = function(e, t) {
  27562. e.x -= t.x,
  27563. e.y -= t.y,
  27564. e.z -= t.z
  27565. }
  27566. ,
  27567. o.applyQuaternionToVector = function(e, t) {
  27568. var i = t.x
  27569. , n = t.y
  27570. , r = t.z
  27571. , o = e.x
  27572. , a = e.y
  27573. , s = e.z
  27574. , l = e.w
  27575. , c = l * i + a * r - s * n
  27576. , h = l * n + s * i - o * r
  27577. , u = l * r + o * n - a * i
  27578. , d = -o * i - a * n - s * r;
  27579. t.x = c * l + d * -o + h * -s - u * -a,
  27580. t.y = h * l + d * -a + u * -o - c * -s,
  27581. t.z = u * l + d * -s + c * -a - h * -o
  27582. }
  27583. ,
  27584. o.angleBetweenVectors = function(e, t) {
  27585. return Math.acos(o.dot(e, t))
  27586. }
  27587. ,
  27588. t.exports = o
  27589. }
  27590. , {
  27591. "../constants": 8
  27592. }],
  27593. 177: [function(c, h, e) {
  27594. (function(e) {
  27595. "use strict";
  27596. function t(e) {
  27597. this.cache = null,
  27598. this.expires = 0
  27599. }
  27600. function i() {
  27601. this.baseUrl = null,
  27602. this.cache = null,
  27603. this.expires = 0
  27604. }
  27605. function n() {
  27606. this.baseUrl = null,
  27607. this.expires = 0
  27608. }
  27609. function r(e) {
  27610. this.initialLoadingPromise = null,
  27611. this.endpoint = e + "?type=3",
  27612. this.urlContainer = null,
  27613. this.authorizationHeader = s.getAuthorizationHeader(),
  27614. this.containerClasses = [n, i, t]
  27615. }
  27616. c("./ajax");
  27617. var o = c("./logger")
  27618. , a = c("../constants")
  27619. , s = c("./showcase")
  27620. , l = (c("../ab"),
  27621. new o(e));
  27622. t.prototype = {
  27623. version: 1,
  27624. validate: function(e) {
  27625. return "catalog.json"in e && 0 < Object.keys(e).length
  27626. },
  27627. update: function(e) {
  27628. return this.cache = e,
  27629. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27630. $.when()
  27631. },
  27632. get: function(e) {
  27633. return this.cache[e]
  27634. }
  27635. },
  27636. i.prototype = {
  27637. version: 2,
  27638. validate: function(e) {
  27639. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27640. },
  27641. update: function(e) {
  27642. return this.baseUrl = e["base.url"],
  27643. this.cache = e,
  27644. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27645. $.when()
  27646. },
  27647. get: function(e) {
  27648. var t = this.cache[e];
  27649. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27650. }
  27651. },
  27652. n.prototype = {
  27653. version: 3,
  27654. validate: function(e) {
  27655. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27656. },
  27657. update: function(e) {
  27658. return this.baseUrl = e.templates[0],
  27659. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27660. $.when()
  27661. },
  27662. get: function(e) {
  27663. return this.baseUrl.replace("{{filename}}", e)
  27664. }
  27665. },
  27666. r.prototype = {
  27667. init: function() {
  27668. return this.initialLoadingPromise || (setInterval(function() {
  27669. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27670. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27671. this.refresh().done(function() {
  27672. l.debug("Refreshed")
  27673. }).fail(function() {
  27674. l.error("Failed url refresh, urls might go stale soon")
  27675. }))
  27676. }
  27677. .bind(this), a.signedUrlCheckInterval),
  27678. this.initialLoadingPromise = this.refresh()),
  27679. this.initialLoadingPromise
  27680. },
  27681. refresh: function(e) {
  27682. return {},
  27683. $.Deferred().resolve()
  27684. },
  27685. get: function(e) {
  27686. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27687. }
  27688. },
  27689. h.exports = r
  27690. }
  27691. ).call(this, "/js/util/ModelUrls.js")
  27692. }
  27693. , {
  27694. "../ab": 3,
  27695. "../constants": 8,
  27696. "./ajax": 181,
  27697. "./logger": 189,
  27698. "./showcase": 193
  27699. }],
  27700. 178: [function(l, c, e) {
  27701. (function(e) {
  27702. "use strict";
  27703. function t() {
  27704. i.call(this),
  27705. this.neighbourMap = {},
  27706. this.map = null
  27707. }
  27708. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  27709. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27710. n.inherit(t, i),
  27711. t.prototype.getIndex = function(e) {
  27712. return e.id
  27713. }
  27714. ,
  27715. t.prototype.find = function(e, t) {
  27716. var i = n.filterAll(this.list, e);
  27717. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27718. i = n.stableSort(i, e)
  27719. }),
  27720. i[0])
  27721. }
  27722. ,
  27723. t.prototype.sortByScore = function(e, t) {
  27724. var i = n.filterAll(this.list, e);
  27725. return 0 === i.length ? null : i = i.map(function(i) {
  27726. return {
  27727. pano: i,
  27728. score: t.reduce(function(e, t) {
  27729. return e + t(i)
  27730. }, 0)
  27731. }
  27732. }).sort(function(e, t) {
  27733. return t.score - e.score
  27734. })
  27735. }
  27736. ,
  27737. t.prototype.lowestByScore = function(e, t, i) {
  27738. return this.findRankedByScore(0, e, t, i)
  27739. }
  27740. ,
  27741. t.prototype.findRankedByScore = function(e, t, i, n) {
  27742. n && (n.candidates = null,
  27743. n.pano = null),
  27744. e = e || 0;
  27745. var r = this.sortByScore(t, i);
  27746. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27747. n.pano = r[e].pano),
  27748. r[e].pano)
  27749. }
  27750. ,
  27751. t.prototype.showPanoScores = function(e) {
  27752. this.list.forEach(function(e) {
  27753. e.removeTextSprite()
  27754. });
  27755. var t = 6344768;
  27756. e.forEach(function(e) {
  27757. e.pano.addTextSprite(e.score.toFixed(2), t),
  27758. t = 16428055
  27759. })
  27760. }
  27761. ,
  27762. t.prototype.isNeighbour = function(e, t) {
  27763. return this.neighbourMap[e.id][t.id]
  27764. }
  27765. ,
  27766. t.prototype.getNeighbours = function(e) {
  27767. return this.neighbourMap[e.id]
  27768. }
  27769. ,
  27770. t.prototype.setNeighbour = function(e, t, i) {
  27771. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27772. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27773. this.neighbourMap[e.id][e.id] = !0,
  27774. this.neighbourMap[t.id][t.id] = !0,
  27775. this.neighbourMap[e.id][t.id] = i,
  27776. this.neighbourMap[t.id][e.id] = i,
  27777. this.neighbourMap[e.id]
  27778. }
  27779. ,
  27780. t.prototype.findClosest = function(e, t) {
  27781. var i = [r.filters.isPanoAligned()];
  27782. return t && i.push(r.filters.inDirection(e, t, .75)),
  27783. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27784. }
  27785. ,
  27786. t.prototype.dualNeighbors = function(e, t) {
  27787. var i, n = [];
  27788. for (i in this.neighbourMap[e.id])
  27789. this.neighbourMap[t.id][i] && n.push(i);
  27790. return n
  27791. }
  27792. ,
  27793. t.prototype.populate_path_graph = function() {
  27794. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27795. for (e = 0; e < this.list.length; e += 1) {
  27796. for (t in s = !(a = {}),
  27797. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27798. if (i[t]) {
  27799. o = this.index[t],
  27800. u.copy(r.floorPosition),
  27801. u.sub(o.floorPosition);
  27802. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27803. , p = (Math.abs(u.y),
  27804. Math.max(d, .01),
  27805. Math.max(0, Math.abs(u.y) - .2));
  27806. n = 0 < p ? (1,
  27807. p = Math.pow(4 * p, 2),
  27808. d = Math.pow(d, 2),
  27809. Math.sqrt(p * p + d * d)) : (1,
  27810. u.length()),
  27811. a[o.id] = n,
  27812. s = !0
  27813. }
  27814. s ? c[r.id] = a : h += 1
  27815. }
  27816. this.map = c,
  27817. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27818. }
  27819. ,
  27820. t.prototype.aStarSearch = function(e, t) {
  27821. var i = Date.now()
  27822. , n = new o({
  27823. start: e,
  27824. isEnd: function(e) {
  27825. return e === t
  27826. },
  27827. neighbor: function(e) {
  27828. var t = e.neighbourPanos || e.findNeighourPanos()
  27829. , i = [];
  27830. for (var n in t)
  27831. t[n] && i.push(this.index[n]); //add: t[n] &&
  27832. return i
  27833. }
  27834. .bind(this),
  27835. distance: function(e, t) {
  27836. return this.map[e.id][t.id]
  27837. }
  27838. .bind(this),
  27839. heuristic: function(e, t) {
  27840. return 1
  27841. }
  27842. .bind(this),
  27843. hash: function(e) {
  27844. return e.id
  27845. },
  27846. timeout: 5e3
  27847. });
  27848. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27849. "success" !== n.status)
  27850. return T.debug("Did not find A* path from " + e + " to " + t),
  27851. null;
  27852. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27853. var r = [];
  27854. return n.path.forEach(function(e) {
  27855. r.push(e.id)
  27856. }),
  27857. r
  27858. }
  27859. ,
  27860. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27861. g = new w.Vector3,
  27862. m = new w.Vector3,
  27863. v = new w.Vector3,
  27864. y = new w.Vector3,
  27865. A = new w.Vector3,
  27866. C = new w.Vector3,
  27867. I = new w.Vector3,
  27868. E = [],
  27869. _ = new w.Vector3,
  27870. b = new w.Vector3,
  27871. function(e, t) {
  27872. if (e)
  27873. for (var i = function(e, t, i) {
  27874. return y.copy(t).sub(e),
  27875. y.dot(i)
  27876. }, n = function(e, t) {
  27877. return i(_, e.position, m) - i(_, t.position, m)
  27878. }, r = 0; r < e.length - 1; ) {
  27879. var o = e[r]
  27880. , a = e[r + 1]
  27881. , s = this.index[o]
  27882. , l = this.index[a];
  27883. _.copy(s.position),
  27884. b.copy(l.position),
  27885. E.length = 0,
  27886. f.copy(b).sub(_),
  27887. m.copy(f).normalize();
  27888. for (var c = 0; c < this.list.length; c++) {
  27889. var h = this.list[c];
  27890. y.copy(h.position).sub(_);
  27891. var u = y.dot(m);
  27892. 0 < u && (C.copy(m),
  27893. C.multiplyScalar(u),
  27894. A.copy(y),
  27895. A.sub(C),
  27896. A.length() < t && (g.copy(f).negate(),
  27897. v.copy(g).normalize(),
  27898. I.copy(h.position).sub(b),
  27899. 0 < I.dot(v) && E.push(h)))
  27900. }
  27901. if (0 < E.length) {
  27902. E.sort(n);
  27903. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27904. e[d] = e[d - E.length];
  27905. for (var p = 0; p < E.length; p++)
  27906. e[p + r + 1] = E[p].id
  27907. }
  27908. r += E.length + 1
  27909. }
  27910. }
  27911. ),
  27912. t.prototype.fadeMarkerOpacity = function(e, t) {
  27913. var i = void 0 === e ? a.panorama.markerOpacity : e
  27914. , n = this.list.findIndex(function(e) {
  27915. return e.marker
  27916. });
  27917. if (!(n < 0)) {
  27918. var r = this.list[n].marker.material.opacity;
  27919. if (r !== e) {
  27920. var o = i - r;
  27921. s.trigger({
  27922. func: function(e, t) {
  27923. var i = r + e * o;
  27924. this.forEach(function(e) {
  27925. e.marker && (e.marker.material.opacity = i)
  27926. })
  27927. }
  27928. .bind(this),
  27929. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27930. name: "_fpm"
  27931. })
  27932. }
  27933. }
  27934. }
  27935. ,
  27936. c.exports = t
  27937. }
  27938. ).call(this, "/js/util/PanoramaCollection.js")
  27939. }
  27940. , {
  27941. "../objects/Panorama": 148,
  27942. "../settings": 166,
  27943. "./IndexedCollection": 175,
  27944. "./aStar": 180,
  27945. "./common": 185,
  27946. "./logger": 189,
  27947. "./transitions": 195,
  27948. three: 217
  27949. }],
  27950. 179: [function(e, t, i) {
  27951. "use strict";
  27952. function n() {
  27953. this.actionSequence = [],
  27954. this.actionSequenceInProgress = !1
  27955. }
  27956. function r(e, t, i, n) {
  27957. c.trackAlways("zoom_" + e, {
  27958. from: t,
  27959. to: i,
  27960. pano: n
  27961. })
  27962. }
  27963. var o, a, s, l, c = e("../analytics");
  27964. n.prototype.reset = function(e) {
  27965. this.actionSequenceInProgress = !1,
  27966. this.actionSequence.length = 0
  27967. }
  27968. ,
  27969. n.prototype.addZoomAction = (a = o = null,
  27970. s = !1,
  27971. l = function() {
  27972. if (o = null,
  27973. 0 < this.actionSequence.length) {
  27974. var e = this.actionSequence[0].start
  27975. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27976. 1 === e ? function(e, t) {
  27977. r("initial", 1, e, t)
  27978. }(t, a) : function(e, t, i) {
  27979. r("followup", e, t, i)
  27980. }(e, t, a)
  27981. }
  27982. this.reset()
  27983. }
  27984. ,
  27985. function(e, t, i) {
  27986. if (e !== t) {
  27987. s || (l = l.bind(this),
  27988. s = !0),
  27989. o && (window.clearTimeout(o),
  27990. o = null),
  27991. i === a && this.actionSequenceInProgress || (this.reset(),
  27992. a = i),
  27993. this.actionSequenceInProgress = !0;
  27994. var n = {
  27995. start: e,
  27996. end: t
  27997. };
  27998. this.actionSequence.push(n),
  27999. o = window.setTimeout(l, 150)
  28000. }
  28001. }
  28002. ),
  28003. t.exports = n
  28004. }
  28005. , {
  28006. "../analytics": 4
  28007. }],
  28008. 180: [function(e, t, i) {
  28009. "use strict";
  28010. function g(e) {
  28011. if (void 0 === e.parent)
  28012. return [e.data];
  28013. var t = g(e.parent);
  28014. return t.push(e.data),
  28015. t
  28016. }
  28017. function m(e) {
  28018. return e.toString()
  28019. }
  28020. function v(e, t) {
  28021. return e.f - t.f
  28022. }
  28023. var y = e("Set")
  28024. , A = e("heap")
  28025. , C = e("dict");
  28026. t.exports = function(e) {
  28027. void 0 === e.timeout && (e.timeout = 1 / 0);
  28028. var t = e.hash || m
  28029. , i = {
  28030. data: e.start,
  28031. g: 0,
  28032. h: e.heuristic(e.start)
  28033. }
  28034. , n = i;
  28035. i.f = i.h;
  28036. var r = new y
  28037. , o = new A(v)
  28038. , a = C();
  28039. o.push(i),
  28040. a.set(t(i.data), i);
  28041. for (var s = new Date; o.size(); ) {
  28042. if (new Date - s > e.timeout)
  28043. return {
  28044. status: "timeout",
  28045. cost: n.g,
  28046. path: g(n)
  28047. };
  28048. var l = o.pop();
  28049. if (a.delete(t(l.data)),
  28050. e.isEnd(l.data))
  28051. return {
  28052. status: "success",
  28053. cost: l.g,
  28054. path: g(l)
  28055. };
  28056. r.add(t(l.data));
  28057. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28058. var u = c[h];
  28059. if (!r.contains(t(u))) {
  28060. var d = l.g + e.distance(l.data, u)
  28061. , p = a.get(t(u))
  28062. , f = !1;
  28063. if (void 0 === p)
  28064. p = {
  28065. data: u
  28066. },
  28067. a.set(t(u), p);
  28068. else {
  28069. if (p.g < d)
  28070. continue;
  28071. f = !0
  28072. }
  28073. p.parent = l,
  28074. p.g = d,
  28075. p.h = e.heuristic(u),
  28076. p.f = d + p.h,
  28077. p.h < n.h && (n = p),
  28078. f ? o.heapify() : o.push(p)
  28079. }
  28080. }
  28081. }
  28082. return {
  28083. status: "noPath",
  28084. cost: n.g,
  28085. path: g(n)
  28086. }
  28087. }
  28088. }
  28089. , {
  28090. Set: 196,
  28091. dict: 210,
  28092. heap: 211
  28093. }],
  28094. 181: [function(i, n, e) {
  28095. (function(e) {
  28096. "use strict";
  28097. function s(e, t, i) {
  28098. function n() {
  28099. l.warn("Retrying ", t),
  28100. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28101. }
  28102. var r = function(e, t, i) {
  28103. var n = new XMLHttpRequest;
  28104. if (i && "withCredentials"in n)
  28105. n.open(e, t, i);
  28106. else if ("undefined" != typeof XDomainRequest)
  28107. (n = new XDomainRequest).open(e, t);
  28108. else {
  28109. if (i)
  28110. throw "Browser does not support CORS!";
  28111. n.open(e, t)
  28112. }
  28113. return n
  28114. }(e, t, !1);
  28115. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28116. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28117. i.responseType)
  28118. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28119. r.responseType = i.responseType;
  28120. else {
  28121. if ("image/jpeg" !== i.responseType)
  28122. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28123. r.responseType = "arraybuffer"
  28124. }
  28125. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28126. i.auth && r.setRequestHeader("Authorization", i.auth),
  28127. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28128. r.setRequestHeader("Content-Type", "application/json")),
  28129. "object" == typeof i.headers)
  28130. for (var o in i.headers)
  28131. r.setRequestHeader(o, i.headers[o]);
  28132. var a = $.Deferred();
  28133. return r.onreadystatechange = function(e) {
  28134. if (4 === this.readyState)
  28135. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28136. i.retries++,
  28137. setTimeout(n, 1e3);
  28138. else if (200 === this.status) {
  28139. var t = function(e, t) {
  28140. var i = e.response;
  28141. if ("json" === t && "object" != typeof i)
  28142. try {
  28143. i = JSON.parse(e.responseText)
  28144. } catch (e) {
  28145. return void a.reject({
  28146. error: "Failed parsing JSON"
  28147. })
  28148. }
  28149. else if ("image/jpeg" === t) {
  28150. var n = new Uint8Array(e.response)
  28151. , r = new Blob([n],{
  28152. type: "image/jpeg"
  28153. })
  28154. , o = URL.createObjectURL(r);
  28155. (i = new Image).src = o,
  28156. i.crossOrigin = "Anonymous",
  28157. i.onload = function() {
  28158. URL.revokeObjectURL(o)
  28159. }
  28160. }
  28161. return i
  28162. }(this, i.responseType);
  28163. a.resolve(t)
  28164. } else
  28165. a.reject(this)
  28166. }
  28167. ,
  28168. r.onprogress = function(e) {
  28169. a.notify(e)
  28170. }
  28171. ,
  28172. r.send(i.data),
  28173. a.promise()
  28174. }
  28175. function o(e, t) {
  28176. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28177. return t.headers && function(t) {
  28178. return Object.keys(t).sort().map(function(e) {
  28179. return {
  28180. key: e,
  28181. value: t[e]
  28182. }
  28183. })
  28184. }(t.headers).forEach(function(e) {
  28185. i += "__" + e.key + ":" + e.value
  28186. }),
  28187. i
  28188. }
  28189. var t = i("./logger")
  28190. , a = i("../ab")
  28191. , l = new t(e);
  28192. window.URL = window.URL || window.webkitURL,
  28193. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28194. window.DATA = window.DATA || {},
  28195. n.exports = {
  28196. get: function(e, t) {
  28197. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28198. if (n) {
  28199. var r = function(e, t) {
  28200. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28201. }(e, t);
  28202. if (r)
  28203. return r
  28204. }
  28205. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28206. n && function(e, t, i) {
  28207. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28208. }(e, t, i),
  28209. i
  28210. },
  28211. post: function(e, t) {
  28212. return s("POST", e, t)
  28213. },
  28214. patch: function(e, t) {
  28215. return s("PATCH", e, t)
  28216. },
  28217. getImage: function(e, t) {
  28218. function i() {
  28219. l.warn("Retrying ", e),
  28220. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28221. }
  28222. var n = $.Deferred()
  28223. , r = new Image
  28224. , o = this;
  28225. return e = a.changeIfImageOptimzing(e),
  28226. null != t || (t = 3),
  28227. r.onerror = function() {
  28228. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28229. }
  28230. ,
  28231. r.onload = function() {
  28232. n.resolve(r)
  28233. }
  28234. ,
  28235. r.crossOrigin = "anonymous",
  28236. r.src = e,
  28237. n
  28238. }
  28239. }
  28240. }
  28241. ).call(this, "/js/util/ajax.js")
  28242. }
  28243. , {
  28244. "../ab": 3,
  28245. "./logger": 189
  28246. }],
  28247. 182: [function(e, t, i) {
  28248. "use strict";
  28249. function n(e, t) {
  28250. var i = window.navigator.userAgent.match(e);
  28251. return i = i ? i[1].split(t) : [],
  28252. {
  28253. major: parseInt(i[0]) || 0,
  28254. minor: parseInt(i[1]) || 0,
  28255. patch: parseInt(i[2]) || 0
  28256. }
  28257. }
  28258. var r = e("../exception/DeviceMismatchException");
  28259. window.browser = t.exports = {
  28260. isFullscreen: function() {
  28261. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28262. },
  28263. supportsFullscreen: function() {
  28264. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28265. },
  28266. isPointerLocked: function() {
  28267. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28268. },
  28269. requestFullscreen: function(e, t) {
  28270. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28271. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28272. },
  28273. requestPointerLock: function() {
  28274. var e;
  28275. if (document.fullscreenElement)
  28276. e = document.fullscreenElement();
  28277. else if (document.mozFullscreenElement)
  28278. e = document.mozFullscreenElement();
  28279. else if (document.mozFullScreenElement)
  28280. e = document.mozFullScreenElement();
  28281. else {
  28282. if (!document.webkitFullscreenElement)
  28283. return;
  28284. e = document.webkitFullscreenElement()
  28285. }
  28286. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28287. e.requestPointerLock(),
  28288. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28289. },
  28290. exitPointerLock: function() {
  28291. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28292. document.exitPointerLock()
  28293. },
  28294. exitFullscreen: function() {
  28295. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28296. },
  28297. details: function() {
  28298. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28299. return e ? {
  28300. name: e[1],
  28301. version: parseInt(e[2]),
  28302. platform: navigator.platform
  28303. } : {}
  28304. },
  28305. is: function(e) {
  28306. return this.details() && this.details().name === e
  28307. },
  28308. inIframe: function() {
  28309. return window.parent !== window
  28310. },
  28311. aspectRatio: function() {
  28312. var e = $("#player").width() / $("#player").height();
  28313. return isFinite(e) ? e : 0
  28314. },
  28315. userAgent: function() {
  28316. return window.navigator.userAgent
  28317. },
  28318. isMobile: function() {
  28319. var e = navigator.userAgent || navigator.vendor || window.opera;
  28320. 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))
  28321. },
  28322. isLandscape: function() {
  28323. return this.isMobile && 1 < this.aspectRatio()
  28324. },
  28325. isSmallScreen: function() {
  28326. return screen.width / window.devicePixelRatio < 240
  28327. },
  28328. detectIE: function() {
  28329. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28330. },
  28331. detectSafari: function() {
  28332. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28333. },
  28334. detectFirefox: function() {
  28335. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28336. },
  28337. detectChrome: function() {
  28338. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28339. },
  28340. detectOpera: function() {
  28341. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28342. },
  28343. detectIOS: function() {
  28344. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28345. },
  28346. detectIPad: function() {
  28347. var e = window.navigator.userAgent;
  28348. return /iPad/.test(e)
  28349. },
  28350. detectIPod: function() {
  28351. var e = window.navigator.userAgent;
  28352. return /iPod/.test(e)
  28353. },
  28354. detectIPhone: function() {
  28355. var e = window.navigator.userAgent;
  28356. return /iPhone/.test(e)
  28357. },
  28358. detectAndroid: function() {
  28359. return -1 !== window.navigator.userAgent.indexOf("Android")
  28360. },
  28361. detectAndroidMobile: function() {
  28362. var e = window.navigator.userAgent;
  28363. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28364. },
  28365. detectSamsungNative: function() {
  28366. var e = window.navigator.userAgent;
  28367. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28368. },
  28369. detectSamsungS6: function() {
  28370. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28371. },
  28372. detectHUAWEI5X: function() {
  28373. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28374. },
  28375. detectWebVR: function() {
  28376. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28377. },
  28378. getVRDisplay: function() {
  28379. var t = $.Deferred();
  28380. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28381. 1 <= e.length && t.resolve(e[0]),
  28382. t.reject(null)
  28383. }),
  28384. t) : t.reject(null)
  28385. },
  28386. iosVersion: function() {
  28387. if (!this.detectIOS())
  28388. throw new r("Did not detect an iDevice");
  28389. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28390. },
  28391. androidVersion: function() {
  28392. if (!this.detectAndroid())
  28393. throw new r("Did not detect an Android based device");
  28394. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28395. },
  28396. valueFromCookie: function(e, t) {
  28397. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28398. if (!i)
  28399. return t;
  28400. var n = i[1];
  28401. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28402. },
  28403. valueFromHash: function(e, t) {
  28404. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28405. if (!i)
  28406. return t;
  28407. var n = i[1];
  28408. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28409. }
  28410. }
  28411. }
  28412. , {
  28413. "../exception/DeviceMismatchException": 56
  28414. }],
  28415. 183: [function(i, n, e) {
  28416. (function(e) {
  28417. "use strict";
  28418. var o = i("../controls/serializer")
  28419. , a = i("../util/math")
  28420. , s = i("./browser")
  28421. , l = i("../enum/Viewmode")
  28422. , t = i("../util/logger")
  28423. , c = i("three")
  28424. , h = new t(e);
  28425. n.exports = {
  28426. getStartCameraOptions: function(e, t) {
  28427. var i = function(e) {
  28428. var t = s.valueFromHash("start", "")
  28429. , i = {};
  28430. if ("" !== t) {
  28431. h.debug("Start override found in parameters, trying to parse..."),
  28432. i = function(e) {
  28433. return o.deserialize(e)
  28434. }(t) || {};
  28435. var n = s.valueFromHash("tag", null);
  28436. n && (i.tag = n),
  28437. i.panoId && (i.pano = e.get(i.panoId))
  28438. }
  28439. return i
  28440. }(t);
  28441. if (0 < Object.keys(i).length)
  28442. return i;
  28443. if (e.heroImage)
  28444. i = function(e, t) {
  28445. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28446. return {};
  28447. var i = {}
  28448. , n = e.heroImage.metadata;
  28449. h.debug("Using start position from thumbnail image"),
  28450. i.position = n.camera_position,
  28451. i.quaternion = n.camera_quaternion;
  28452. try {
  28453. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28454. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28455. } catch (e) {
  28456. h.debug(e.message)
  28457. }
  28458. return i
  28459. }(e, t);
  28460. else if (window.DATA.camera_start) {
  28461. var n = window.DATA.camera_start;
  28462. try {
  28463. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28464. i.position = (new c.Vector3).fromArray(n.camera.position),
  28465. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28466. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28467. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28468. h.debug("Using camera_start"),
  28469. h.debug("Modeldata pano: ", i.pano.quaternion),
  28470. h.debug("Camera start pano: ", n.pano.quaternion)),
  28471. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28472. } catch (e) {
  28473. h.warn(e.message)
  28474. if(i.mode == "panorama" && !i.pano){
  28475. i.pano = t.list[0]
  28476. }
  28477. }
  28478. }
  28479. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28480. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28481. i.pano = t.findClosest(i.position) ,
  28482. i.quaternion = i.pano.quaternion),
  28483. 0 === Object.keys(i).length) {
  28484. var r = t.list[0];
  28485. r && (i.mode = l.PANORAMA,
  28486. i.pano = r,
  28487. i.position = r.position,
  28488. i.quaternion = r.quaternion,
  28489. h.info("Starting at 1st pano " + r.id))
  28490. }
  28491. return i.mode = i.mode || l.DOLLHOUSE,
  28492. i
  28493. }
  28494. }
  28495. }
  28496. ).call(this, "/js/util/camera.js")
  28497. }
  28498. , {
  28499. "../controls/serializer": 14,
  28500. "../enum/Viewmode": 51,
  28501. "../util/logger": 189,
  28502. "../util/math": 190,
  28503. "./browser": 182,
  28504. three: 217
  28505. }],
  28506. 184: [function(e, t, i) {
  28507. "use strict";
  28508. function r(e, t, i) {
  28509. var n = t
  28510. , r = i;
  28511. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28512. }
  28513. function o(e, t, i) {
  28514. var n = t
  28515. , r = i;
  28516. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28517. }
  28518. var a = e("./MathLight");
  28519. t.exports = {
  28520. clampVFOV: function(e, t, i, n) {
  28521. return t < r(e, i, n) ? o(t, i, n) : e
  28522. },
  28523. getHFOVForCamera: function(e, t, i) {
  28524. return r(e.fov, t, i)
  28525. },
  28526. getHFOVFromVFOV: r,
  28527. getVFOVFromHFOV: o
  28528. }
  28529. window.MathLight = t.exports
  28530. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28531. var prec = Math.pow(10, - (precision || 4));
  28532. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28533. if(e1.w){
  28534. return s1 && Math.abs(e1.w - e2.w) < prec
  28535. }else return s1
  28536. }
  28537. }
  28538. , {
  28539. "./MathLight": 176
  28540. }],
  28541. 185: [function(e, t, i) {
  28542. "use strict";
  28543. var a = e("three");
  28544. t.exports = {
  28545. delayOneFrame: function(e) {
  28546. window.setTimeout(e, 1)
  28547. },
  28548. normalizeUrl: function(e) {
  28549. return e.replace("https://", "http://")
  28550. },
  28551. domainFromUrl: function(e) {
  28552. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28553. return t ? t[3] : e
  28554. },
  28555. average: function(e, t) {
  28556. if (0 === e.length)
  28557. return null;
  28558. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28559. i += t ? e[r][t] : e[r],
  28560. n++
  28561. }
  28562. return i / n
  28563. },
  28564. countUnique: function(e) {
  28565. for (var t = {}, i = 0; i < e.length; i++)
  28566. t[e[i]] = 1 + (t[e[i]] || 0);
  28567. return Object.keys(t).length
  28568. },
  28569. averageVectors: function(e, t) {
  28570. var i = new a.Vector3;
  28571. if (0 === e.length)
  28572. return i;
  28573. for (var n = 0, r = 0; r < e.length; r++) {
  28574. var o = t ? e[r][t] : e[r];
  28575. i.add(o),
  28576. n++
  28577. }
  28578. return i.divideScalar(n)
  28579. },
  28580. equalLists: function(e, t) {
  28581. if (e.length !== t.length)
  28582. return !1;
  28583. for (var i = 0; i < e.length; i++)
  28584. if (e[i] !== t[i])
  28585. return !1;
  28586. return !0
  28587. },
  28588. lowerMedian: function(e, t) {
  28589. return 0 === e.length ? null : (t = t || 2,
  28590. e.sort(function(e, t) {
  28591. return e - t
  28592. }),
  28593. e[Math.floor(e.length / t)])
  28594. },
  28595. stableSort: function(e, n) {
  28596. return e.map(function(e, t) {
  28597. return {
  28598. value: e,
  28599. index: t
  28600. }
  28601. }).sort(function(e, t) {
  28602. var i = n(e.value, t.value);
  28603. return 0 !== i ? i : e.index - t.index
  28604. }).map(function(e) {
  28605. return e.value
  28606. })
  28607. },
  28608. filterAll: function(e, i) {
  28609. return e.filter(function(t) {
  28610. return i.every(function(e) {
  28611. return e(t)
  28612. })
  28613. })
  28614. },
  28615. formatDate: function(e) {
  28616. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28617. },
  28618. formatDatetime: function(e) {
  28619. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28620. },
  28621. randomString: function(e) {
  28622. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28623. t += i.charAt(Math.floor(Math.random() * i.length));
  28624. return t
  28625. },
  28626. uint8ToBase64: function(e, t) {
  28627. t && "number" == typeof t || (t = 8192);
  28628. for (var i = [], n = 0; n < e.length; n += t)
  28629. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28630. return btoa(i.join(""))
  28631. },
  28632. uuid4: function e(t) {
  28633. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28634. },
  28635. nth: function(e) {
  28636. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28637. },
  28638. extendObject: function(t, i) {
  28639. return Object.keys(i).forEach(function(e) {
  28640. t[e] = i[e]
  28641. }),
  28642. t
  28643. },
  28644. deepExtend: function e(t) {
  28645. t = t || {};
  28646. for (var i = 1; i < arguments.length; i++) {
  28647. var n = arguments[i];
  28648. if (n)
  28649. for (var r in n)
  28650. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28651. }
  28652. return t
  28653. },
  28654. inherit: function(e, t) {
  28655. e.prototype = Object.create(t.prototype),
  28656. e.prototype.constructor = e
  28657. },
  28658. extend: function(e, t) {
  28659. for (var i in t.prototype)
  28660. e.prototype[i] = t.prototype[i]
  28661. },
  28662. getVisiblePano : function(positions = [], panos, options={}){//add
  28663. var visiblePanos = [];
  28664. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  28665. panos.forEach((pano)=>{
  28666. if(!pano.isAligned())return;
  28667. var A = pano.position.clone();
  28668. var posB = options.posAtPanos[pano.id] || positions;
  28669. var posLength = posB.length
  28670. for(let i=0;i<posLength;i++){
  28671. var B = posB[i];
  28672. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  28673. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  28674. if (!o || !o.length){ //只要有一点可见,就算整体可见
  28675. visiblePanos.push(pano.id);
  28676. break;
  28677. }
  28678. }
  28679. })
  28680. return visiblePanos
  28681. }
  28682. ,
  28683. sortByScore : function(list, request, rank) {
  28684. var i = this.filterAll(list, request);
  28685. return 0 === i.length ? null : i = i.map(function(e) {
  28686. return {
  28687. item: e,
  28688. score: rank.reduce(function(t, i) {
  28689. return t + i(e);
  28690. }, 0)
  28691. };
  28692. }).sort(function(e, t) {
  28693. return t.score - e.score;
  28694. });
  28695. }
  28696. ,
  28697. getFileNameFromUrl:function(url){
  28698. return url.split('/').pop();
  28699. }
  28700. },
  28701. Math.sign = function(e) {
  28702. return e < 0 ? -1 : 1
  28703. }
  28704. window.common = t.exports
  28705. }
  28706. , {
  28707. three: 217
  28708. }],
  28709. 186: [function(e, t, i) {
  28710. "use strict";
  28711. var r = {
  28712. linearTween: function(e, t, i, n) {
  28713. return i * e / n + t
  28714. },
  28715. easeInQuad: function(e, t, i, n) {
  28716. return i * (e /= n) * e + t
  28717. },
  28718. easeOutQuad: function(e, t, i, n) {
  28719. return -i * (e /= n) * (e - 2) + t
  28720. },
  28721. easeInOutQuad: function(e, t, i, n) {
  28722. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28723. },
  28724. easeInCubic: function(e, t, i, n) {
  28725. return i * (e /= n) * e * e + t
  28726. },
  28727. easeOutCubic: function(e, t, i, n) {
  28728. return e /= n,
  28729. i * (--e * e * e + 1) + t
  28730. },
  28731. easeInOutCubic: function(e, t, i, n) {
  28732. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28733. },
  28734. easeInQuart: function(e, t, i, n) {
  28735. return i * (e /= n) * e * e * e + t
  28736. },
  28737. easeOutQuart: function(e, t, i, n) {
  28738. return e /= n,
  28739. -i * (--e * e * e * e - 1) + t
  28740. },
  28741. easeInOutQuart: function(e, t, i, n) {
  28742. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28743. },
  28744. easeInQuint: function(e, t, i, n) {
  28745. return i * (e /= n) * e * e * e * e + t
  28746. },
  28747. easeOutQuint: function(e, t, i, n) {
  28748. return e /= n,
  28749. i * (--e * e * e * e * e + 1) + t
  28750. },
  28751. easeInOutQuint: function(e, t, i, n) {
  28752. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28753. },
  28754. easeInSine: function(e, t, i, n) {
  28755. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28756. },
  28757. easeOutSine: function(e, t, i, n) {
  28758. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28759. },
  28760. easeInOutSine: function(e, t, i, n) {
  28761. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28762. },
  28763. easeInExpo: function(e, t, i, n) {
  28764. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28765. },
  28766. easeOutExpo: function(e, t, i, n) {
  28767. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28768. },
  28769. easeInOutExpo: function(e, t, i, n) {
  28770. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28771. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28772. },
  28773. easeInCirc: function(e, t, i, n) {
  28774. return e /= n,
  28775. -i * (Math.sqrt(1 - e * e) - 1) + t
  28776. },
  28777. easeOutCirc: function(e, t, i, n) {
  28778. return e /= n,
  28779. e--,
  28780. i * Math.sqrt(1 - e * e) + t
  28781. },
  28782. easeInOutCirc: function(e, t, i, n) {
  28783. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28784. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28785. },
  28786. easeInElastic: function(e, t, i, n) {
  28787. var r = 1.70158
  28788. , o = 0
  28789. , a = i;
  28790. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28791. r = a < Math.abs(i) ? (a = i,
  28792. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28793. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28794. },
  28795. easeOutElastic: function(e, t, i, n) {
  28796. var r = 1.70158
  28797. , o = 0
  28798. , a = i;
  28799. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28800. r = a < Math.abs(i) ? (a = i,
  28801. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28802. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28803. },
  28804. easeInOutElastic: function(e, t, i, n) {
  28805. var r = 1.70158
  28806. , o = 0
  28807. , a = i;
  28808. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28809. r = a < Math.abs(i) ? (a = i,
  28810. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28811. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28812. },
  28813. easeInBack: function(e, t, i, n, r) {
  28814. return void 0 === r && (r = 1.70158),
  28815. i * (e /= n) * e * ((r + 1) * e - r) + t
  28816. },
  28817. easeOutBack: function(e, t, i, n, r) {
  28818. return void 0 === r && (r = 1.70158),
  28819. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28820. },
  28821. easeInOutBack: function(e, t, i, n, r) {
  28822. return void 0 === r && (r = 1.70158),
  28823. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  28824. },
  28825. easeOutBounce: function(e, t, i, n) {
  28826. 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
  28827. },
  28828. easeInBounce: function(e, t, i, n) {
  28829. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28830. },
  28831. easeInOutBounce: function(e, t, i, n) {
  28832. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  28833. }
  28834. };
  28835. window.easing = t.exports = r
  28836. }
  28837. , {}],
  28838. 187: [function(e, t, i) {
  28839. "use strict";
  28840. function n() {
  28841. this.events = [],
  28842. this.valid = !1
  28843. }
  28844. var r = e("../enum/Joystick");
  28845. n.prototype.push = function(e, t) {
  28846. this.events.push({
  28847. direction: e,
  28848. pano: t
  28849. }),
  28850. this.valid = !0
  28851. }
  28852. ,
  28853. n.prototype.pop = function(e) {
  28854. var t = this.events.pop();
  28855. return this.events.length < 1 && (this.valid = !1),
  28856. t
  28857. }
  28858. ,
  28859. n.prototype.peek = function() {
  28860. return this.events.length ? this.events[this.events.length - 1] : {
  28861. direction: null,
  28862. pano: null
  28863. }
  28864. }
  28865. ,
  28866. n.prototype.invalidate = function() {
  28867. this.events = [],
  28868. this.valid = !1
  28869. }
  28870. ,
  28871. n.prototype.reversePano = function(e) {
  28872. if (!this.valid)
  28873. return null;
  28874. var t = this.peek();
  28875. return r.opposite(e) === t.direction ? (this.pop(),
  28876. t.pano) : null
  28877. }
  28878. ,
  28879. t.exports = n
  28880. }
  28881. , {
  28882. "../enum/Joystick": 29
  28883. }],
  28884. 188: [function(e, t, i) {
  28885. "use strict";
  28886. t.exports = {
  28887. vector: function(t, i) {
  28888. var n = t.clone();
  28889. return i = i.clone(),
  28890. function(e) {
  28891. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28892. }
  28893. },
  28894. quaternion: function(t, i) {
  28895. var n = t.clone();
  28896. return function(e) {
  28897. t.copy(n).slerp(i, e)
  28898. }
  28899. },
  28900. property: function(t, i, n, r) {
  28901. var o = t[i];
  28902. return function(e) {
  28903. t[i] = o * (1 - e) + n * e,
  28904. r && r(t[i])
  28905. }
  28906. },
  28907. uniform: function(t, i, n) {
  28908. var r = t.material.uniforms[i].value;
  28909. return function(e) {
  28910. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28911. }
  28912. },
  28913. matrix4: function(o, a) {
  28914. var s = o.clone();
  28915. return function(e) {
  28916. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28917. t[r] = i[r] * (1 - e) + n[r] * e
  28918. }
  28919. },
  28920. allUniforms: function(e, t, i) {
  28921. var n = e.map(function(e) {
  28922. return this.uniform(e, t, i)
  28923. }
  28924. .bind(this));
  28925. return function(t) {
  28926. n.forEach(function(e) {
  28927. e(t)
  28928. })
  28929. }
  28930. }
  28931. }
  28932. }
  28933. , {}],
  28934. 189: [function(e, t, i) {
  28935. "use strict";
  28936. function h(n) {
  28937. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28938. if (h.consoleEnabled) {
  28939. var l = function(e) {
  28940. $("#debug-console").append("<p>" + e + "</p>"),
  28941. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28942. };
  28943. e = function(e) {
  28944. l(Array.prototype.slice.call(arguments).join(" "))
  28945. }
  28946. ,
  28947. t = function(e) {
  28948. l(Array.prototype.slice.call(arguments).join(" "))
  28949. }
  28950. ,
  28951. i = function(e) {
  28952. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28953. }
  28954. ,
  28955. r = function(e) {
  28956. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28957. }
  28958. } else
  28959. console.log ? (e = console.log,
  28960. t = console.info ? console.info : console.log,
  28961. i = console.warn ? console.warn : console.log,
  28962. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28963. ;
  28964. function c(e) {
  28965. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28966. }
  28967. return {
  28968. debug: function() {
  28969. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28970. },
  28971. info: function() {
  28972. h.level >= h.levels.info && t.apply(console, c(arguments))
  28973. },
  28974. warn: function() {
  28975. (function(e, t) {
  28976. if (u) {
  28977. var i = Array.prototype.slice.call(e).join(" ");
  28978. u.captureMessage(i, {
  28979. level: t,
  28980. path: n,
  28981. timestamp: h.timestamp()
  28982. })
  28983. }
  28984. }
  28985. )(arguments, "warn"),
  28986. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28987. },
  28988. error: function() {
  28989. (function(e, t) {
  28990. if (u) {
  28991. var i = Array.prototype.slice.call(e).join(" ");
  28992. u.captureException(new Error(i), {
  28993. level: t,
  28994. path: n,
  28995. timestamp: h.timestamp()
  28996. })
  28997. }
  28998. }
  28999. )(arguments, "error"),
  29000. h.level >= h.levels.error && r.apply(console, c(arguments))
  29001. },
  29002. v3str: function(e, t) {
  29003. var i = void 0 === t ? 2 : t;
  29004. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29005. },
  29006. eulstr: function(e, t) {
  29007. var i = void 0 === t ? 2 : t;
  29008. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29009. },
  29010. time: function(e) {
  29011. h.level >= h.levels.debug && (s[e] = Date.now())
  29012. },
  29013. timeEnd: function(e) {
  29014. if (h.level >= h.levels.debug) {
  29015. var t = s[e];
  29016. if (!t)
  29017. return;
  29018. var i = (Date.now() - t) / 1e3;
  29019. this.debug(e, i + "s")
  29020. }
  29021. }
  29022. }
  29023. }
  29024. var u = window.Raven;
  29025. h.timestamp = function() {
  29026. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29027. }
  29028. ,
  29029. h.level = (h.levels = {
  29030. debug: 3,
  29031. info: 2,
  29032. warn: 1,
  29033. error: 0
  29034. }).info,
  29035. t.exports = h
  29036. }
  29037. , {}],
  29038. 190: [function(e, t, i) {
  29039. "use strict";
  29040. var o = e("three")
  29041. , r = e("../enum/GLCubeFaces");
  29042. e("../constants");
  29043. t.exports = {
  29044. convertVisionVector: function(e) {
  29045. return new o.Vector3(e.x,e.z,-e.y)
  29046. },
  29047. convertVisionQuaternion: function(e) {
  29048. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  29049. },
  29050. convertWorkshopVector: function(e) {
  29051. return new o.Vector3(-e.x,e.y,e.z)
  29052. },
  29053. convertWorkshopQuaternion: function(e) {
  29054. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29055. },
  29056. convertWorkshopPanoramaQuaternion: function(e) {
  29057. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  29058. },
  29059. convertWorkshopOrthoZoom: function(e) {
  29060. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29061. },
  29062. toPrecision: function(e, t) {
  29063. function i(e, t) {
  29064. var i = Math.pow(10, t);
  29065. return Math.round(e * i) / i
  29066. }
  29067. if (e instanceof Array) {
  29068. for (var n = 0; n < e.length; n++)
  29069. e[n] = i(e[n], t);
  29070. return e
  29071. }
  29072. return i(e, t)
  29073. },
  29074. isEmptyQuaternion: function(e) {
  29075. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29076. },
  29077. projectPositionToCanvas: function(e, t, i) {
  29078. (i = i || new o.Vector3).copy(e);
  29079. var n = .5 * $("#player").width()
  29080. , r = .5 * $("#player").height();
  29081. return i.project(t),
  29082. i.x = i.x * n + n,
  29083. i.y = -i.y * r + r,
  29084. i
  29085. },
  29086. convertScreenPositionToNDC: function(e, t, i) {
  29087. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29088. i.y = -t / $("#player").height() * 2 + 1,
  29089. i
  29090. },
  29091. constrainedTurn: function(e) {
  29092. var t = e % (2 * Math.PI);
  29093. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29094. },
  29095. getFOVDotThreshold: function(e) {
  29096. return Math.cos(o.Math.degToRad(e / 2))
  29097. },
  29098. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29099. switch (e) {
  29100. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29101. i.set(1, t.y, t.x);
  29102. break;
  29103. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29104. i.set(-1, t.y, -t.x);
  29105. break;
  29106. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29107. i.set(-t.x, 1, -t.y);
  29108. break;
  29109. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29110. i.set(-t.x, -1, t.y);
  29111. break;
  29112. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29113. i.set(-t.x, t.y, 1);
  29114. break;
  29115. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29116. i.set(t.x, t.y, -1)
  29117. }
  29118. n && i.normalize()
  29119. },
  29120. //add:
  29121. getPos2d : function(point, camera, dom){
  29122. var camera = camera ;
  29123. var dom = dom;
  29124. 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);
  29125. var x,y;
  29126. x = (pos.x + 1) / 2 * dom.clientWidth;
  29127. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29128. var inSight = x <= dom.clientWidth && x >= 0
  29129. && y <= dom.clientHeight && y >= 0
  29130. return {
  29131. pos: new THREE.Vector2(x,y),
  29132. vector: pos,
  29133. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29134. inSight : inSight //在屏幕范围内可见
  29135. };
  29136. },
  29137. getDirByLonLat: function(lon, lat) {
  29138. var dir = new THREE.Vector3();
  29139. var phi = THREE.Math.degToRad(90 - lat);
  29140. var theta = THREE.Math.degToRad(lon);
  29141. dir.x = Math.sin(phi) * Math.cos(theta);
  29142. dir.y = Math.cos(phi);
  29143. dir.z = Math.sin(phi) * Math.sin(theta);
  29144. return dir.negate();
  29145. }
  29146. }
  29147. window.math = t.exports
  29148. }
  29149. , {
  29150. "../constants": 8,
  29151. "../enum/GLCubeFaces": 25,
  29152. three: 217
  29153. }],
  29154. 191: [function(e, t, i) {
  29155. "use strict";
  29156. function o(e) {
  29157. return r[e]
  29158. }
  29159. var n = e("../enum/GLCubeFaces")
  29160. , a = [0, 1, 2, 3, 4, 5]
  29161. , r = {
  29162. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29163. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29164. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29165. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29166. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29167. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29168. };
  29169. t.exports = {
  29170. mapFaceToCubemapFace: o,
  29171. getCubemapUrls: function(i, n, r) {
  29172. return a.map(function(e, t) {
  29173. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29174. }
  29175. .bind(this))
  29176. }
  29177. }
  29178. }
  29179. , {
  29180. "../enum/GLCubeFaces": 25
  29181. }],
  29182. 192: [function(e, t, i) {
  29183. "use strict";
  29184. t.exports = {
  29185. captureErrors: function(e, t, i) {
  29186. if ("Raven"in window) {
  29187. Raven.config(e, t).install(),
  29188. i && Raven.setTagsContext(i);
  29189. var n = console.warn
  29190. , r = console.error;
  29191. console.warn = function() {
  29192. var e = Array.prototype.slice.call(arguments);
  29193. Raven.captureMessage(e.join(" "), {
  29194. level: "warning"
  29195. }),
  29196. n.apply(console, e)
  29197. }
  29198. ,
  29199. console.error = function() {
  29200. var e = Array.prototype.slice.call(arguments);
  29201. Raven.captureException(new Error(e.join(" ")), {
  29202. level: "error"
  29203. }),
  29204. r.apply(console, e)
  29205. }
  29206. } else
  29207. console.error("Raven not found, not capturing errors.")
  29208. }
  29209. }
  29210. }
  29211. , {}],
  29212. 193: [function(c, h, e) {
  29213. (function(e) {
  29214. "use strict";
  29215. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29216. getAuthorizationHeader: function() {
  29217. var e = n.valueFromHash("auth");
  29218. if (e)
  29219. return e.replace(",", " ");
  29220. var t = n.valueFromCookie("token");
  29221. return t ? "Token " + t : null
  29222. },
  29223. parseSidUrl: function(e) {
  29224. var t, i;
  29225. if (t = g_Prefix,
  29226. (e = e || "").match(/^https?/)) {
  29227. o.parse(e);
  29228. t = g_Prefix,
  29229. i = e
  29230. } else
  29231. i = (t = g_Prefix) + "data/" + e;
  29232. return {
  29233. urlBase: t,
  29234. urlModel: i,
  29235. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29236. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29237. }
  29238. },
  29239. getModelIDFromQueryString: function() {
  29240. return n.valueFromHash("model") || n.valueFromHash("m")
  29241. },
  29242. /* normalizeModeldata: function(e, i) {
  29243. e = JSON.parse(JSON.stringify(e));
  29244. var n = null;
  29245. if (e.images.forEach(function(t) {
  29246. if (t.metadata) {
  29247. if ("string" == typeof t.metadata)
  29248. try {
  29249. t.metadata = JSON.parse(t.metadata)
  29250. } catch (e) {
  29251. s.warn("Unable to parse image metadata"),
  29252. t.metadata = null
  29253. }
  29254. else
  29255. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29256. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29257. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  29258. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29259. t.metadata.zoom = t.metadata.zoom || 1),
  29260. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29261. }
  29262. }),
  29263. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29264. var t = {};
  29265. t.pano = {
  29266. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29267. position: i.convertWorkshopVector(n.scan_position),
  29268. uuid: n.scan_id
  29269. },
  29270. t.camera = {
  29271. quaternion: n.camera_quaternion,
  29272. position: n.camera_position
  29273. },
  29274. e.startPano = t
  29275. }
  29276. return e
  29277. }, */
  29278. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29279. e = JSON.parse(JSON.stringify(e));
  29280. var i = null;
  29281. var deal = function(n) {
  29282. if(!n.metadata) return;
  29283. if ("string" == typeof n.metadata)
  29284. try {
  29285. n.metadata = JSON.parse(n.metadata)
  29286. } catch (e) {
  29287. s.warn("Unable to parse image metadata"),
  29288. n.metadata = null
  29289. }
  29290. else{
  29291. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29292. }
  29293. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29294. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29295. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29296. }else{
  29297. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29298. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29299. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29300. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29301. }
  29302. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29303. }
  29304. //改
  29305. e.images.forEach(info=>{
  29306. if(info.locations){
  29307. info.locations.forEach(a=>deal(a))
  29308. }else{
  29309. deal(info)
  29310. }
  29311. })
  29312. //icon初始视角的:
  29313. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29314. var n = {};
  29315. n.pano = {
  29316. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29317. position: t.convertWorkshopVector(i.scan_position),
  29318. uuid: i.scan_id
  29319. },
  29320. n.camera = {
  29321. quaternion: i.camera_quaternion,
  29322. position: i.camera_position
  29323. },
  29324. e.startPano = n
  29325. }
  29326. return e
  29327. },
  29328. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29329. function(e) {
  29330. if (!e)
  29331. throw new Error("Vision version is required");
  29332. var t = i.exec(e);
  29333. if (null === t)
  29334. throw new Error("String is not a vision version: " + e);
  29335. return parseInt(t[1])
  29336. }
  29337. ),
  29338. modelDataPromisesTiles: function(e) {
  29339. var t = e.vision_version || window.DATA.vision_version;
  29340. if (t)
  29341. try {
  29342. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29343. } catch (e) {
  29344. s.warn("Invalid vision version: " + t)
  29345. }
  29346. return !1
  29347. }
  29348. };
  29349. h.exports = l
  29350. }
  29351. ).call(this, "/js/util/showcase.js")
  29352. }
  29353. , {
  29354. "../constants": 8,
  29355. "./browser": 182,
  29356. "./logger": 189,
  29357. three: 217,
  29358. url: 208
  29359. }],
  29360. 194: [function(e, t, i) {
  29361. "use strict";
  29362. var r = e("../util/ajax")
  29363. , o = e("three")
  29364. , a = e("../settings")
  29365. , s = {};
  29366. t.exports = {
  29367. load: function(e, t, i) {
  29368. var n = s[e];
  29369. return n ? t && setTimeout(function() {
  29370. t(n)
  29371. }, 1) : (n = new o.Texture,
  29372. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29373. n.magFilter = o.LinearFilter,
  29374. n.generateMipmaps = !1),
  29375. n.sourceFile = e,
  29376. s[e] = n,
  29377. r.getImage(e).then(function(e) {
  29378. n.image = e,
  29379. n.needsUpdate = !0,
  29380. t && t(n)
  29381. }).fail(i)),
  29382. n
  29383. },
  29384. loadBase64: function(e, t) {
  29385. t = t || "png";
  29386. var i = new o.Texture;
  29387. return i.image = document.createElement("img"),
  29388. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29389. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29390. i.magFilter = o.LinearFilter,
  29391. i.generateMipmaps = !1),
  29392. i.needsUpdate = !0,
  29393. i
  29394. },
  29395. isLoaded: function(e) {
  29396. return !!s[e]
  29397. }
  29398. }
  29399. window.Texture = t.exports
  29400. }
  29401. , {
  29402. "../settings": 166,
  29403. "../util/ajax": 181,
  29404. three: 217
  29405. }],
  29406. 195: [function(e, t, i) {
  29407. "use strict";
  29408. var l = e("./easing");
  29409. window.transitions = t.exports = {
  29410. globalDone: null,
  29411. funcs: [],
  29412. counter: 0,
  29413. uniqueID: 0,
  29414. start: function(e, t, i, n, r, o, a) {
  29415. return n = n || 0,
  29416. this.funcs.push({
  29417. func: e,
  29418. current: -n * Math.abs(t),
  29419. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29420. done: i,
  29421. easing: r || l.linearTween,
  29422. cycling: t < 0,
  29423. running: !0,
  29424. debug: n < 0,
  29425. name: o || "T" + this.counter,
  29426. id: void 0 === a ? this.counter : a,
  29427. paused: !1
  29428. }),
  29429. e(0, 16),
  29430. this.counter += 1,
  29431. e
  29432. },
  29433. trigger: function(e) {
  29434. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29435. , i = e.func || function() {}
  29436. , n = void 0 === e.duration ? 0 : e.duration;
  29437. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29438. var r = e.done || null
  29439. , o = e.easing || l.linearTween
  29440. , a = e.name || "R" + this.counter
  29441. , s = void 0 === e.id ? this.counter : e.id;
  29442. return this.start(i, n, r, t, o, a, s)
  29443. },
  29444. setTimeout: function(e, t, i) {
  29445. var n = void 0 === i ? this.counter : i;
  29446. return this.trigger({
  29447. done: e,
  29448. duration: void 0 === t ? 0 : t,
  29449. name: "O" + this.counter,
  29450. id: n
  29451. })
  29452. },
  29453. pause: function() {
  29454. this.paused = !0
  29455. },
  29456. resume: function() {
  29457. this.paused = !1
  29458. },
  29459. update: function(n) {
  29460. this.funcs.forEach(function(e) {
  29461. if (!(e.paused || (e.current += 1e3 * n,
  29462. e.current < 0)))
  29463. if (e.current >= e.duration && !e.cycling) {
  29464. var t = e.easing(1, 0, 1, 1);
  29465. e.func(t, 1e3 * n),
  29466. e.done && e.done(),
  29467. e.running = !1
  29468. } else {
  29469. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29470. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29471. e.running = !1)
  29472. }
  29473. });
  29474. var e = this.funcs.length;
  29475. this.funcs = this.funcs.filter(function(e) {
  29476. return e.running
  29477. });
  29478. var t = this.funcs.length;
  29479. if (0 < e && 0 === t && this.globalDone) {
  29480. var i = this.globalDone;
  29481. this.globalDone = null,
  29482. i()
  29483. }
  29484. },
  29485. adjustSpeed: function(e, t) {
  29486. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29487. var r = i[n];
  29488. r.duration /= t,
  29489. r.current /= t
  29490. }
  29491. },
  29492. getById: function(t) {
  29493. return this.funcs.filter(function(e) {
  29494. return t === e.id
  29495. })
  29496. },
  29497. get: function(e) {
  29498. for (var t = 0; t < this.funcs.length; t += 1)
  29499. if (this.funcs[t].func === e)
  29500. return this.funcs[t];
  29501. return null
  29502. },
  29503. isRunning: function(e) {
  29504. var t = this.get(e);
  29505. return null !== t && t.running
  29506. },
  29507. countActive: function() {
  29508. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29509. e += this.funcs[t].running;
  29510. return e
  29511. },
  29512. listActive: function() {
  29513. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29514. this.funcs[t].running && e.push(this.funcs[t].name);
  29515. return e
  29516. },
  29517. done: function(e) {
  29518. this.globalDone = e
  29519. },
  29520. cancelById: function(e) {
  29521. var t = void 0 === e ? 0 : e;
  29522. this.funcs = this.funcs.filter(function(e) {
  29523. return e.id !== t
  29524. })
  29525. },
  29526. cancel: function(t) {
  29527. this.funcs = this.funcs.filter(function(e) {
  29528. return e.func !== t
  29529. })
  29530. },
  29531. getUniqueId: function() {
  29532. return this.uniqueID -= 1,
  29533. this.uniqueID
  29534. }
  29535. }
  29536. }
  29537. , {
  29538. "./easing": 186
  29539. }],
  29540. 196: [function(e, t, i) {
  29541. function n(e) {
  29542. if (this.set = {},
  29543. this.infContains = function() {
  29544. return !0
  29545. }
  29546. ,
  29547. "object" == typeof e)
  29548. if (e instanceof Array)
  29549. for (var t = 0; t < e.length; t++)
  29550. this.set[e[t]] = !0;
  29551. else
  29552. this.set = e;
  29553. else if ("function" == typeof e)
  29554. this.infContains = e;
  29555. else if (void 0 !== e)
  29556. throw new Error("set must be either an array or an object.")
  29557. }
  29558. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29559. return !!this.set[e]
  29560. }
  29561. ,
  29562. n.prototype.add = function(e) {
  29563. if (1 == arguments.length)
  29564. this.set[e] = !0;
  29565. else
  29566. for (var t = 0; t < arguments.length; t++)
  29567. this.set[arguments[t]] = !0
  29568. }
  29569. ,
  29570. n.prototype.addAll = function(e) {
  29571. if ("object" != typeof e && !(e instanceof Array))
  29572. throw new Error("arr must be an array.");
  29573. for (var t = 0; t < e.length; t++)
  29574. this.add(e[t])
  29575. }
  29576. ,
  29577. n.prototype.delete = n.prototype.remove = function(e) {
  29578. if (1 == arguments.length)
  29579. delete this.set[e];
  29580. else
  29581. for (var t = 0; t < arguments.length; t++)
  29582. delete this.set[arguments[t]]
  29583. }
  29584. ,
  29585. n.prototype.clear = function() {
  29586. this.set = {}
  29587. }
  29588. ,
  29589. n.prototype.size = function() {
  29590. return Object.keys(this.set).length
  29591. }
  29592. ,
  29593. n.prototype.toString = function() {
  29594. return "{" + Object.keys(this.set).toString() + "}"
  29595. }
  29596. ,
  29597. n.prototype["*values"] = n.prototype.toArray = function() {
  29598. return void 0 === this.set ? [] : Object.keys(this.set)
  29599. }
  29600. }
  29601. , {}],
  29602. 197: [function(e, t, i) {}
  29603. , {}],
  29604. 198: [function(N, e, F) {
  29605. (function(e) {
  29606. "use strict";
  29607. function i() {
  29608. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29609. }
  29610. function o(e, t) {
  29611. if (i() < t)
  29612. throw new RangeError("Invalid typed array length");
  29613. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29614. e.length = t),
  29615. e
  29616. }
  29617. function u(e, t, i) {
  29618. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29619. return new u(e,t,i);
  29620. if ("number" != typeof e)
  29621. return n(this, e, t, i);
  29622. if ("string" == typeof t)
  29623. throw new Error("If encoding is specified then the first argument must be a string");
  29624. return a(this, e)
  29625. }
  29626. function n(e, t, i, n) {
  29627. if ("number" == typeof t)
  29628. throw new TypeError('"value" argument must not be a number');
  29629. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29630. if (t.byteLength,
  29631. i < 0 || t.byteLength < i)
  29632. throw new RangeError("'offset' is out of bounds");
  29633. if (t.byteLength < i + (n || 0))
  29634. throw new RangeError("'length' is out of bounds");
  29635. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29636. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29637. e
  29638. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29639. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29640. !u.isEncoding(i))
  29641. throw new TypeError('"encoding" must be a valid string encoding');
  29642. var n = 0 | c(t, i)
  29643. , r = (e = o(e, n)).write(t, i);
  29644. return r !== n && (e = e.slice(0, r)),
  29645. e
  29646. }(e, t, i) : function(e, t) {
  29647. if (u.isBuffer(t)) {
  29648. var i = 0 | l(t.length);
  29649. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29650. e
  29651. }
  29652. if (t) {
  29653. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29654. return "number" != typeof t.length || function(e) {
  29655. return e != e
  29656. }(t.length) ? o(e, 0) : s(e, t);
  29657. if ("Buffer" === t.type && L(t.data))
  29658. return s(e, t.data)
  29659. }
  29660. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29661. }(e, t)
  29662. }
  29663. function r(e) {
  29664. if ("number" != typeof e)
  29665. throw new TypeError('"size" argument must be a number');
  29666. if (e < 0)
  29667. throw new RangeError('"size" argument must not be negative')
  29668. }
  29669. function a(e, t) {
  29670. if (r(t),
  29671. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29672. !u.TYPED_ARRAY_SUPPORT)
  29673. for (var i = 0; i < t; ++i)
  29674. e[i] = 0;
  29675. return e
  29676. }
  29677. function s(e, t) {
  29678. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29679. e = o(e, i);
  29680. for (var n = 0; n < i; n += 1)
  29681. e[n] = 255 & t[n];
  29682. return e
  29683. }
  29684. function l(e) {
  29685. if (e >= i())
  29686. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29687. return 0 | e
  29688. }
  29689. function c(e, t) {
  29690. if (u.isBuffer(e))
  29691. return e.length;
  29692. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29693. return e.byteLength;
  29694. "string" != typeof e && (e = "" + e);
  29695. var i = e.length;
  29696. if (0 === i)
  29697. return 0;
  29698. for (var n = !1; ; )
  29699. switch (t) {
  29700. case "ascii":
  29701. case "latin1":
  29702. case "binary":
  29703. return i;
  29704. case "utf8":
  29705. case "utf-8":
  29706. case void 0:
  29707. return S(e).length;
  29708. case "ucs2":
  29709. case "ucs-2":
  29710. case "utf16le":
  29711. case "utf-16le":
  29712. return 2 * i;
  29713. case "hex":
  29714. return i >>> 1;
  29715. case "base64":
  29716. return M(e).length;
  29717. default:
  29718. if (n)
  29719. return S(e).length;
  29720. t = ("" + t).toLowerCase(),
  29721. n = !0
  29722. }
  29723. }
  29724. function h(e, t, i) {
  29725. var n = e[t];
  29726. e[t] = e[i],
  29727. e[i] = n
  29728. }
  29729. function d(e, t, i, n, r) {
  29730. if (0 === e.length)
  29731. return -1;
  29732. if ("string" == typeof i ? (n = i,
  29733. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29734. i = +i,
  29735. isNaN(i) && (i = r ? 0 : e.length - 1),
  29736. i < 0 && (i = e.length + i),
  29737. i >= e.length) {
  29738. if (r)
  29739. return -1;
  29740. i = e.length - 1
  29741. } else if (i < 0) {
  29742. if (!r)
  29743. return -1;
  29744. i = 0
  29745. }
  29746. if ("string" == typeof t && (t = u.from(t, n)),
  29747. u.isBuffer(t))
  29748. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29749. if ("number" == typeof t)
  29750. return t &= 255,
  29751. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  29752. throw new TypeError("val must be string, number or Buffer")
  29753. }
  29754. function p(e, t, i, n, r) {
  29755. function o(e, t) {
  29756. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29757. }
  29758. var a, s = 1, l = e.length, c = t.length;
  29759. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29760. if (e.length < 2 || t.length < 2)
  29761. return -1;
  29762. l /= s = 2,
  29763. c /= 2,
  29764. i /= 2
  29765. }
  29766. if (r) {
  29767. var h = -1;
  29768. for (a = i; a < l; a++)
  29769. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29770. if (-1 === h && (h = a),
  29771. a - h + 1 === c)
  29772. return h * s
  29773. } else
  29774. -1 !== h && (a -= a - h),
  29775. h = -1
  29776. } else
  29777. for (l < i + c && (i = l - c),
  29778. a = i; 0 <= a; a--) {
  29779. for (var u = !0, d = 0; d < c; d++)
  29780. if (o(e, a + d) !== o(t, d)) {
  29781. u = !1;
  29782. break
  29783. }
  29784. if (u)
  29785. return a
  29786. }
  29787. return -1
  29788. }
  29789. function g(e, t, i, n) {
  29790. i = Number(i) || 0;
  29791. var r = e.length - i;
  29792. n ? r < (n = Number(n)) && (n = r) : n = r;
  29793. var o = t.length;
  29794. if (o % 2 != 0)
  29795. throw new TypeError("Invalid hex string");
  29796. o / 2 < n && (n = o / 2);
  29797. for (var a = 0; a < n; ++a) {
  29798. var s = parseInt(t.substr(2 * a, 2), 16);
  29799. if (isNaN(s))
  29800. return a;
  29801. e[i + a] = s
  29802. }
  29803. return a
  29804. }
  29805. function m(e, t, i, n) {
  29806. return R(function(e) {
  29807. for (var t = [], i = 0; i < e.length; ++i)
  29808. t.push(255 & e.charCodeAt(i));
  29809. return t
  29810. }(t), e, i, n)
  29811. }
  29812. function f(e, t, i) {
  29813. i = Math.min(e.length, i);
  29814. for (var n = [], r = t; r < i; ) {
  29815. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29816. if (r + u <= i)
  29817. switch (u) {
  29818. case 1:
  29819. c < 128 && (h = c);
  29820. break;
  29821. case 2:
  29822. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29823. break;
  29824. case 3:
  29825. o = e[r + 1],
  29826. a = e[r + 2],
  29827. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29828. break;
  29829. case 4:
  29830. o = e[r + 1],
  29831. a = e[r + 2],
  29832. s = e[r + 3],
  29833. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  29834. }
  29835. null === h ? (h = 65533,
  29836. u = 1) : 65535 < h && (h -= 65536,
  29837. n.push(h >>> 10 & 1023 | 55296),
  29838. h = 56320 | 1023 & h),
  29839. n.push(h),
  29840. r += u
  29841. }
  29842. return function(e) {
  29843. var t = e.length;
  29844. if (t <= D)
  29845. return String.fromCharCode.apply(String, e);
  29846. for (var i = "", n = 0; n < t; )
  29847. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29848. return i
  29849. }(n)
  29850. }
  29851. function v(e, t, i) {
  29852. var n = "";
  29853. i = Math.min(e.length, i);
  29854. for (var r = t; r < i; ++r)
  29855. n += String.fromCharCode(127 & e[r]);
  29856. return n
  29857. }
  29858. function y(e, t, i) {
  29859. var n = "";
  29860. i = Math.min(e.length, i);
  29861. for (var r = t; r < i; ++r)
  29862. n += String.fromCharCode(e[r]);
  29863. return n
  29864. }
  29865. function A(e, t, i) {
  29866. var n, r = e.length;
  29867. (!t || t < 0) && (t = 0),
  29868. (!i || i < 0 || r < i) && (i = r);
  29869. for (var o = "", a = t; a < i; ++a)
  29870. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29871. return o
  29872. }
  29873. function C(e, t, i) {
  29874. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29875. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29876. return r
  29877. }
  29878. function I(e, t, i) {
  29879. if (e % 1 != 0 || e < 0)
  29880. throw new RangeError("offset is not uint");
  29881. if (i < e + t)
  29882. throw new RangeError("Trying to access beyond buffer length")
  29883. }
  29884. function E(e, t, i, n, r, o) {
  29885. if (!u.isBuffer(e))
  29886. throw new TypeError('"buffer" argument must be a Buffer instance');
  29887. if (r < t || t < o)
  29888. throw new RangeError('"value" argument is out of bounds');
  29889. if (i + n > e.length)
  29890. throw new RangeError("Index out of range")
  29891. }
  29892. function _(e, t, i, n) {
  29893. t < 0 && (t = 65535 + t + 1);
  29894. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29895. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29896. }
  29897. function b(e, t, i, n) {
  29898. t < 0 && (t = 4294967295 + t + 1);
  29899. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29900. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29901. }
  29902. function w(e, t, i, n) {
  29903. if (i + n > e.length)
  29904. throw new RangeError("Index out of range");
  29905. if (i < 0)
  29906. throw new RangeError("Index out of range")
  29907. }
  29908. function T(e, t, i, n, r) {
  29909. return r || w(e, 0, i, 4),
  29910. O.write(e, t, i, n, 23, 4),
  29911. i + 4
  29912. }
  29913. function x(e, t, i, n, r) {
  29914. return r || w(e, 0, i, 8),
  29915. O.write(e, t, i, n, 52, 8),
  29916. i + 8
  29917. }
  29918. function S(e, t) {
  29919. t = t || 1 / 0;
  29920. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29921. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29922. if (!r) {
  29923. if (56319 < i) {
  29924. -1 < (t -= 3) && o.push(239, 191, 189);
  29925. continue
  29926. }
  29927. if (a + 1 === n) {
  29928. -1 < (t -= 3) && o.push(239, 191, 189);
  29929. continue
  29930. }
  29931. r = i;
  29932. continue
  29933. }
  29934. if (i < 56320) {
  29935. -1 < (t -= 3) && o.push(239, 191, 189),
  29936. r = i;
  29937. continue
  29938. }
  29939. i = 65536 + (r - 55296 << 10 | i - 56320)
  29940. } else
  29941. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29942. if (r = null,
  29943. i < 128) {
  29944. if ((t -= 1) < 0)
  29945. break;
  29946. o.push(i)
  29947. } else if (i < 2048) {
  29948. if ((t -= 2) < 0)
  29949. break;
  29950. o.push(i >> 6 | 192, 63 & i | 128)
  29951. } else if (i < 65536) {
  29952. if ((t -= 3) < 0)
  29953. break;
  29954. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29955. } else {
  29956. if (!(i < 1114112))
  29957. throw new Error("Invalid code point");
  29958. if ((t -= 4) < 0)
  29959. break;
  29960. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29961. }
  29962. }
  29963. return o
  29964. }
  29965. function M(e) {
  29966. return P.toByteArray(function(e) {
  29967. if ((e = function(e) {
  29968. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29969. }(e).replace(t, "")).length < 2)
  29970. return "";
  29971. for (; e.length % 4 != 0; )
  29972. e += "=";
  29973. return e
  29974. }(e))
  29975. }
  29976. function R(e, t, i, n) {
  29977. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29978. t[r + i] = e[r];
  29979. return r
  29980. }
  29981. var P = N("base64-js")
  29982. , O = N("ieee754")
  29983. , L = N("isarray");
  29984. F.Buffer = u,
  29985. F.SlowBuffer = function(e) {
  29986. return +e != e && (e = 0),
  29987. u.alloc(+e)
  29988. }
  29989. ,
  29990. F.INSPECT_MAX_BYTES = 50,
  29991. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29992. try {
  29993. var e = new Uint8Array(1);
  29994. return e.__proto__ = {
  29995. __proto__: Uint8Array.prototype,
  29996. foo: function() {
  29997. return 42
  29998. }
  29999. },
  30000. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30001. } catch (e) {
  30002. return !1
  30003. }
  30004. }(),
  30005. F.kMaxLength = i(),
  30006. u.poolSize = 8192,
  30007. u._augment = function(e) {
  30008. return e.__proto__ = u.prototype,
  30009. e
  30010. }
  30011. ,
  30012. u.from = function(e, t, i) {
  30013. return n(null, e, t, i)
  30014. }
  30015. ,
  30016. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30017. u.__proto__ = Uint8Array,
  30018. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30019. value: null,
  30020. configurable: !0
  30021. })),
  30022. u.alloc = function(e, t, i) {
  30023. return function(e, t, i, n) {
  30024. return r(t),
  30025. 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)
  30026. }(null, e, t, i)
  30027. }
  30028. ,
  30029. u.allocUnsafe = function(e) {
  30030. return a(null, e)
  30031. }
  30032. ,
  30033. u.allocUnsafeSlow = function(e) {
  30034. return a(null, e)
  30035. }
  30036. ,
  30037. u.isBuffer = function(e) {
  30038. return !(null == e || !e._isBuffer)
  30039. }
  30040. ,
  30041. u.compare = function(e, t) {
  30042. if (!u.isBuffer(e) || !u.isBuffer(t))
  30043. throw new TypeError("Arguments must be Buffers");
  30044. if (e === t)
  30045. return 0;
  30046. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30047. if (e[r] !== t[r]) {
  30048. i = e[r],
  30049. n = t[r];
  30050. break
  30051. }
  30052. return i < n ? -1 : n < i ? 1 : 0
  30053. }
  30054. ,
  30055. u.isEncoding = function(e) {
  30056. switch (String(e).toLowerCase()) {
  30057. case "hex":
  30058. case "utf8":
  30059. case "utf-8":
  30060. case "ascii":
  30061. case "latin1":
  30062. case "binary":
  30063. case "base64":
  30064. case "ucs2":
  30065. case "ucs-2":
  30066. case "utf16le":
  30067. case "utf-16le":
  30068. return !0;
  30069. default:
  30070. return !1
  30071. }
  30072. }
  30073. ,
  30074. u.concat = function(e, t) {
  30075. if (!L(e))
  30076. throw new TypeError('"list" argument must be an Array of Buffers');
  30077. if (0 === e.length)
  30078. return u.alloc(0);
  30079. var i;
  30080. if (void 0 === t)
  30081. for (i = t = 0; i < e.length; ++i)
  30082. t += e[i].length;
  30083. var n = u.allocUnsafe(t)
  30084. , r = 0;
  30085. for (i = 0; i < e.length; ++i) {
  30086. var o = e[i];
  30087. if (!u.isBuffer(o))
  30088. throw new TypeError('"list" argument must be an Array of Buffers');
  30089. o.copy(n, r),
  30090. r += o.length
  30091. }
  30092. return n
  30093. }
  30094. ,
  30095. u.byteLength = c,
  30096. u.prototype._isBuffer = !0,
  30097. u.prototype.swap16 = function() {
  30098. var e = this.length;
  30099. if (e % 2 != 0)
  30100. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30101. for (var t = 0; t < e; t += 2)
  30102. h(this, t, t + 1);
  30103. return this
  30104. }
  30105. ,
  30106. u.prototype.swap32 = function() {
  30107. var e = this.length;
  30108. if (e % 4 != 0)
  30109. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30110. for (var t = 0; t < e; t += 4)
  30111. h(this, t, t + 3),
  30112. h(this, t + 1, t + 2);
  30113. return this
  30114. }
  30115. ,
  30116. u.prototype.swap64 = function() {
  30117. var e = this.length;
  30118. if (e % 8 != 0)
  30119. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30120. for (var t = 0; t < e; t += 8)
  30121. h(this, t, t + 7),
  30122. h(this, t + 1, t + 6),
  30123. h(this, t + 2, t + 5),
  30124. h(this, t + 3, t + 4);
  30125. return this
  30126. }
  30127. ,
  30128. u.prototype.toString = function() {
  30129. var e = 0 | this.length;
  30130. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30131. var n, r, o, a = !1;
  30132. if ((void 0 === t || t < 0) && (t = 0),
  30133. t > this.length)
  30134. return "";
  30135. if ((void 0 === i || i > this.length) && (i = this.length),
  30136. i <= 0)
  30137. return "";
  30138. if ((i >>>= 0) <= (t >>>= 0))
  30139. return "";
  30140. for (e = e || "utf8"; ; )
  30141. switch (e) {
  30142. case "hex":
  30143. return A(this, t, i);
  30144. case "utf8":
  30145. case "utf-8":
  30146. return f(this, t, i);
  30147. case "ascii":
  30148. return v(this, t, i);
  30149. case "latin1":
  30150. case "binary":
  30151. return y(this, t, i);
  30152. case "base64":
  30153. return n = this,
  30154. o = i,
  30155. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30156. case "ucs2":
  30157. case "ucs-2":
  30158. case "utf16le":
  30159. case "utf-16le":
  30160. return C(this, t, i);
  30161. default:
  30162. if (a)
  30163. throw new TypeError("Unknown encoding: " + e);
  30164. e = (e + "").toLowerCase(),
  30165. a = !0
  30166. }
  30167. }
  30168. .apply(this, arguments)
  30169. }
  30170. ,
  30171. u.prototype.equals = function(e) {
  30172. if (!u.isBuffer(e))
  30173. throw new TypeError("Argument must be a Buffer");
  30174. return this === e || 0 === u.compare(this, e)
  30175. }
  30176. ,
  30177. u.prototype.inspect = function() {
  30178. var e = ""
  30179. , t = F.INSPECT_MAX_BYTES;
  30180. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30181. this.length > t && (e += " ... ")),
  30182. "<Buffer " + e + ">"
  30183. }
  30184. ,
  30185. u.prototype.compare = function(e, t, i, n, r) {
  30186. if (!u.isBuffer(e))
  30187. throw new TypeError("Argument must be a Buffer");
  30188. if (void 0 === t && (t = 0),
  30189. void 0 === i && (i = e ? e.length : 0),
  30190. void 0 === n && (n = 0),
  30191. void 0 === r && (r = this.length),
  30192. t < 0 || i > e.length || n < 0 || r > this.length)
  30193. throw new RangeError("out of range index");
  30194. if (r <= n && i <= t)
  30195. return 0;
  30196. if (r <= n)
  30197. return -1;
  30198. if (i <= t)
  30199. return 1;
  30200. if (this === e)
  30201. return 0;
  30202. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  30203. if (l[h] !== c[h]) {
  30204. o = l[h],
  30205. a = c[h];
  30206. break
  30207. }
  30208. return o < a ? -1 : a < o ? 1 : 0
  30209. }
  30210. ,
  30211. u.prototype.includes = function(e, t, i) {
  30212. return -1 !== this.indexOf(e, t, i)
  30213. }
  30214. ,
  30215. u.prototype.indexOf = function(e, t, i) {
  30216. return d(this, e, t, i, !0)
  30217. }
  30218. ,
  30219. u.prototype.lastIndexOf = function(e, t, i) {
  30220. return d(this, e, t, i, !1)
  30221. }
  30222. ,
  30223. u.prototype.write = function(e, t, i, n) {
  30224. if (void 0 === t)
  30225. n = "utf8",
  30226. i = this.length,
  30227. t = 0;
  30228. else if (void 0 === i && "string" == typeof t)
  30229. n = t,
  30230. i = this.length,
  30231. t = 0;
  30232. else {
  30233. if (!isFinite(t))
  30234. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30235. t |= 0,
  30236. isFinite(i) ? (i |= 0,
  30237. void 0 === n && (n = "utf8")) : (n = i,
  30238. i = void 0)
  30239. }
  30240. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30241. if ((void 0 === i || p < i) && (i = p),
  30242. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30243. throw new RangeError("Attempt to write outside buffer bounds");
  30244. n = n || "utf8";
  30245. for (var f = !1; ; )
  30246. switch (n) {
  30247. case "hex":
  30248. return g(this, e, t, i);
  30249. case "utf8":
  30250. case "utf-8":
  30251. return u = t,
  30252. d = i,
  30253. R(S(e, (h = this).length - u), h, u, d);
  30254. case "ascii":
  30255. return m(this, e, t, i);
  30256. case "latin1":
  30257. case "binary":
  30258. return m(this, e, t, i);
  30259. case "base64":
  30260. return s = this,
  30261. l = t,
  30262. c = i,
  30263. R(M(e), s, l, c);
  30264. case "ucs2":
  30265. case "ucs-2":
  30266. case "utf16le":
  30267. case "utf-16le":
  30268. return o = t,
  30269. a = i,
  30270. R(function(e, t) {
  30271. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30272. i = e.charCodeAt(a),
  30273. n = i >> 8,
  30274. r = i % 256,
  30275. o.push(r),
  30276. o.push(n);
  30277. return o
  30278. }(e, (r = this).length - o), r, o, a);
  30279. default:
  30280. if (f)
  30281. throw new TypeError("Unknown encoding: " + n);
  30282. n = ("" + n).toLowerCase(),
  30283. f = !0
  30284. }
  30285. }
  30286. ,
  30287. u.prototype.toJSON = function() {
  30288. return {
  30289. type: "Buffer",
  30290. data: Array.prototype.slice.call(this._arr || this, 0)
  30291. }
  30292. }
  30293. ;
  30294. var D = 4096;
  30295. u.prototype.slice = function(e, t) {
  30296. var i, n = this.length;
  30297. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30298. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30299. t < e && (t = e),
  30300. u.TYPED_ARRAY_SUPPORT)
  30301. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30302. else {
  30303. var r = t - e;
  30304. i = new u(r,void 0);
  30305. for (var o = 0; o < r; ++o)
  30306. i[o] = this[o + e]
  30307. }
  30308. return i
  30309. }
  30310. ,
  30311. u.prototype.readUIntLE = function(e, t, i) {
  30312. e |= 0,
  30313. t |= 0,
  30314. i || I(e, t, this.length);
  30315. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30316. n += this[e + o] * r;
  30317. return n
  30318. }
  30319. ,
  30320. u.prototype.readUIntBE = function(e, t, i) {
  30321. e |= 0,
  30322. t |= 0,
  30323. i || I(e, t, this.length);
  30324. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30325. n += this[e + --t] * r;
  30326. return n
  30327. }
  30328. ,
  30329. u.prototype.readUInt8 = function(e, t) {
  30330. return t || I(e, 1, this.length),
  30331. this[e]
  30332. }
  30333. ,
  30334. u.prototype.readUInt16LE = function(e, t) {
  30335. return t || I(e, 2, this.length),
  30336. this[e] | this[e + 1] << 8
  30337. }
  30338. ,
  30339. u.prototype.readUInt16BE = function(e, t) {
  30340. return t || I(e, 2, this.length),
  30341. this[e] << 8 | this[e + 1]
  30342. }
  30343. ,
  30344. u.prototype.readUInt32LE = function(e, t) {
  30345. return t || I(e, 4, this.length),
  30346. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30347. }
  30348. ,
  30349. u.prototype.readUInt32BE = function(e, t) {
  30350. return t || I(e, 4, this.length),
  30351. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30352. }
  30353. ,
  30354. u.prototype.readIntLE = function(e, t, i) {
  30355. e |= 0,
  30356. t |= 0,
  30357. i || I(e, t, this.length);
  30358. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30359. n += this[e + o] * r;
  30360. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30361. n
  30362. }
  30363. ,
  30364. u.prototype.readIntBE = function(e, t, i) {
  30365. e |= 0,
  30366. t |= 0,
  30367. i || I(e, t, this.length);
  30368. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30369. o += this[e + --n] * r;
  30370. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30371. o
  30372. }
  30373. ,
  30374. u.prototype.readInt8 = function(e, t) {
  30375. return t || I(e, 1, this.length),
  30376. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30377. }
  30378. ,
  30379. u.prototype.readInt16LE = function(e, t) {
  30380. t || I(e, 2, this.length);
  30381. var i = this[e] | this[e + 1] << 8;
  30382. return 32768 & i ? 4294901760 | i : i
  30383. }
  30384. ,
  30385. u.prototype.readInt16BE = function(e, t) {
  30386. t || I(e, 2, this.length);
  30387. var i = this[e + 1] | this[e] << 8;
  30388. return 32768 & i ? 4294901760 | i : i
  30389. }
  30390. ,
  30391. u.prototype.readInt32LE = function(e, t) {
  30392. return t || I(e, 4, this.length),
  30393. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30394. }
  30395. ,
  30396. u.prototype.readInt32BE = function(e, t) {
  30397. return t || I(e, 4, this.length),
  30398. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30399. }
  30400. ,
  30401. u.prototype.readFloatLE = function(e, t) {
  30402. return t || I(e, 4, this.length),
  30403. O.read(this, e, !0, 23, 4)
  30404. }
  30405. ,
  30406. u.prototype.readFloatBE = function(e, t) {
  30407. return t || I(e, 4, this.length),
  30408. O.read(this, e, !1, 23, 4)
  30409. }
  30410. ,
  30411. u.prototype.readDoubleLE = function(e, t) {
  30412. return t || I(e, 8, this.length),
  30413. O.read(this, e, !0, 52, 8)
  30414. }
  30415. ,
  30416. u.prototype.readDoubleBE = function(e, t) {
  30417. return t || I(e, 8, this.length),
  30418. O.read(this, e, !1, 52, 8)
  30419. }
  30420. ,
  30421. u.prototype.writeUIntLE = function(e, t, i, n) {
  30422. e = +e,
  30423. t |= 0,
  30424. i |= 0,
  30425. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30426. var r = 1
  30427. , o = 0;
  30428. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30429. this[t + o] = e / r & 255;
  30430. return t + i
  30431. }
  30432. ,
  30433. u.prototype.writeUIntBE = function(e, t, i, n) {
  30434. e = +e,
  30435. t |= 0,
  30436. i |= 0,
  30437. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30438. var r = i - 1
  30439. , o = 1;
  30440. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30441. this[t + r] = e / o & 255;
  30442. return t + i
  30443. }
  30444. ,
  30445. u.prototype.writeUInt8 = function(e, t, i) {
  30446. return e = +e,
  30447. t |= 0,
  30448. i || E(this, e, t, 1, 255, 0),
  30449. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30450. this[t] = 255 & e,
  30451. t + 1
  30452. }
  30453. ,
  30454. u.prototype.writeUInt16LE = function(e, t, i) {
  30455. return e = +e,
  30456. t |= 0,
  30457. i || E(this, e, t, 2, 65535, 0),
  30458. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30459. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30460. t + 2
  30461. }
  30462. ,
  30463. u.prototype.writeUInt16BE = function(e, t, i) {
  30464. return e = +e,
  30465. t |= 0,
  30466. i || E(this, e, t, 2, 65535, 0),
  30467. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30468. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30469. t + 2
  30470. }
  30471. ,
  30472. u.prototype.writeUInt32LE = function(e, t, i) {
  30473. return e = +e,
  30474. t |= 0,
  30475. i || E(this, e, t, 4, 4294967295, 0),
  30476. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30477. this[t + 2] = e >>> 16,
  30478. this[t + 1] = e >>> 8,
  30479. this[t] = 255 & e) : b(this, e, t, !0),
  30480. t + 4
  30481. }
  30482. ,
  30483. u.prototype.writeUInt32BE = function(e, t, i) {
  30484. return e = +e,
  30485. t |= 0,
  30486. i || E(this, e, t, 4, 4294967295, 0),
  30487. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30488. this[t + 1] = e >>> 16,
  30489. this[t + 2] = e >>> 8,
  30490. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30491. t + 4
  30492. }
  30493. ,
  30494. u.prototype.writeIntLE = function(e, t, i, n) {
  30495. if (e = +e,
  30496. t |= 0,
  30497. !n) {
  30498. var r = Math.pow(2, 8 * i - 1);
  30499. E(this, e, t, i, r - 1, -r)
  30500. }
  30501. var o = 0
  30502. , a = 1
  30503. , s = 0;
  30504. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30505. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30506. this[t + o] = (e / a >> 0) - s & 255;
  30507. return t + i
  30508. }
  30509. ,
  30510. u.prototype.writeIntBE = function(e, t, i, n) {
  30511. if (e = +e,
  30512. t |= 0,
  30513. !n) {
  30514. var r = Math.pow(2, 8 * i - 1);
  30515. E(this, e, t, i, r - 1, -r)
  30516. }
  30517. var o = i - 1
  30518. , a = 1
  30519. , s = 0;
  30520. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30521. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30522. this[t + o] = (e / a >> 0) - s & 255;
  30523. return t + i
  30524. }
  30525. ,
  30526. u.prototype.writeInt8 = function(e, t, i) {
  30527. return e = +e,
  30528. t |= 0,
  30529. i || E(this, e, t, 1, 127, -128),
  30530. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30531. e < 0 && (e = 255 + e + 1),
  30532. this[t] = 255 & e,
  30533. t + 1
  30534. }
  30535. ,
  30536. u.prototype.writeInt16LE = function(e, t, i) {
  30537. return e = +e,
  30538. t |= 0,
  30539. i || E(this, e, t, 2, 32767, -32768),
  30540. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30541. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30542. t + 2
  30543. }
  30544. ,
  30545. u.prototype.writeInt16BE = function(e, t, i) {
  30546. return e = +e,
  30547. t |= 0,
  30548. i || E(this, e, t, 2, 32767, -32768),
  30549. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30550. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30551. t + 2
  30552. }
  30553. ,
  30554. u.prototype.writeInt32LE = function(e, t, i) {
  30555. return e = +e,
  30556. t |= 0,
  30557. i || E(this, e, t, 4, 2147483647, -2147483648),
  30558. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30559. this[t + 1] = e >>> 8,
  30560. this[t + 2] = e >>> 16,
  30561. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30562. t + 4
  30563. }
  30564. ,
  30565. u.prototype.writeInt32BE = function(e, t, i) {
  30566. return e = +e,
  30567. t |= 0,
  30568. i || E(this, e, t, 4, 2147483647, -2147483648),
  30569. e < 0 && (e = 4294967295 + e + 1),
  30570. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30571. this[t + 1] = e >>> 16,
  30572. this[t + 2] = e >>> 8,
  30573. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30574. t + 4
  30575. }
  30576. ,
  30577. u.prototype.writeFloatLE = function(e, t, i) {
  30578. return T(this, e, t, !0, i)
  30579. }
  30580. ,
  30581. u.prototype.writeFloatBE = function(e, t, i) {
  30582. return T(this, e, t, !1, i)
  30583. }
  30584. ,
  30585. u.prototype.writeDoubleLE = function(e, t, i) {
  30586. return x(this, e, t, !0, i)
  30587. }
  30588. ,
  30589. u.prototype.writeDoubleBE = function(e, t, i) {
  30590. return x(this, e, t, !1, i)
  30591. }
  30592. ,
  30593. u.prototype.copy = function(e, t, i, n) {
  30594. if (i = i || 0,
  30595. n || 0 === n || (n = this.length),
  30596. t >= e.length && (t = e.length),
  30597. t = t || 0,
  30598. 0 < n && n < i && (n = i),
  30599. n === i)
  30600. return 0;
  30601. if (0 === e.length || 0 === this.length)
  30602. return 0;
  30603. if (t < 0)
  30604. throw new RangeError("targetStart out of bounds");
  30605. if (i < 0 || i >= this.length)
  30606. throw new RangeError("sourceStart out of bounds");
  30607. if (n < 0)
  30608. throw new RangeError("sourceEnd out of bounds");
  30609. n > this.length && (n = this.length),
  30610. e.length - t < n - i && (n = e.length - t + i);
  30611. var r, o = n - i;
  30612. if (this === e && i < t && t < n)
  30613. for (r = o - 1; 0 <= r; --r)
  30614. e[r + t] = this[r + i];
  30615. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30616. for (r = 0; r < o; ++r)
  30617. e[r + t] = this[r + i];
  30618. else
  30619. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30620. return o
  30621. }
  30622. ,
  30623. u.prototype.fill = function(e, t, i, n) {
  30624. if ("string" == typeof e) {
  30625. if ("string" == typeof t ? (n = t,
  30626. t = 0,
  30627. i = this.length) : "string" == typeof i && (n = i,
  30628. i = this.length),
  30629. 1 === e.length) {
  30630. var r = e.charCodeAt(0);
  30631. r < 256 && (e = r)
  30632. }
  30633. if (void 0 !== n && "string" != typeof n)
  30634. throw new TypeError("encoding must be a string");
  30635. if ("string" == typeof n && !u.isEncoding(n))
  30636. throw new TypeError("Unknown encoding: " + n)
  30637. } else
  30638. "number" == typeof e && (e &= 255);
  30639. if (t < 0 || this.length < t || this.length < i)
  30640. throw new RangeError("Out of range index");
  30641. if (i <= t)
  30642. return this;
  30643. var o;
  30644. if (t >>>= 0,
  30645. i = void 0 === i ? this.length : i >>> 0,
  30646. "number" == typeof (e = e || 0))
  30647. for (o = t; o < i; ++o)
  30648. this[o] = e;
  30649. else {
  30650. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30651. , s = a.length;
  30652. for (o = 0; o < i - t; ++o)
  30653. this[o + t] = a[o % s]
  30654. }
  30655. return this
  30656. }
  30657. ;
  30658. var t = /[^+\/0-9A-Za-z-_]/g
  30659. }
  30660. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30661. }
  30662. , {
  30663. "base64-js": 199,
  30664. ieee754: 200,
  30665. isarray: 201
  30666. }],
  30667. 199: [function(e, t, i) {
  30668. "use strict";
  30669. function l(e) {
  30670. var t = e.length;
  30671. if (0 < t % 4)
  30672. throw new Error("Invalid string. Length must be a multiple of 4");
  30673. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30674. }
  30675. function c(e, t, i) {
  30676. for (var n, r = [], o = t; o < i; o += 3)
  30677. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30678. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30679. var a;
  30680. return r.join("")
  30681. }
  30682. i.byteLength = function(e) {
  30683. return 3 * e.length / 4 - l(e)
  30684. }
  30685. ,
  30686. i.toByteArray = function(e) {
  30687. var t, i, n, r, o, a = e.length;
  30688. r = l(e),
  30689. o = new d(3 * a / 4 - r),
  30690. i = 0 < r ? a - 4 : a;
  30691. var s = 0;
  30692. for (t = 0; t < i; t += 4,
  30693. 3)
  30694. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30695. o[s++] = n >> 16 & 255,
  30696. o[s++] = n >> 8 & 255,
  30697. o[s++] = 255 & n;
  30698. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30699. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30700. o[s++] = n >> 8 & 255,
  30701. o[s++] = 255 & n),
  30702. o
  30703. }
  30704. ,
  30705. i.fromByteArray = function(e) {
  30706. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30707. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30708. return 1 == n ? (t = e[i - 1],
  30709. r += h[t >> 2],
  30710. r += h[t << 4 & 63],
  30711. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30712. r += h[t >> 10],
  30713. r += h[t >> 4 & 63],
  30714. r += h[t << 2 & 63],
  30715. r += "="),
  30716. o.push(r),
  30717. o.join("")
  30718. }
  30719. ;
  30720. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30721. h[r] = n[r],
  30722. u[n.charCodeAt(r)] = r;
  30723. u["-".charCodeAt(0)] = 62,
  30724. u["_".charCodeAt(0)] = 63
  30725. }
  30726. , {}],
  30727. 200: [function(e, t, i) {
  30728. i.read = function(e, t, i, n, r) {
  30729. 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];
  30730. for (u += d,
  30731. o = p & (1 << -h) - 1,
  30732. p >>= -h,
  30733. h += s; 0 < h; o = 256 * o + e[t + u],
  30734. u += d,
  30735. h -= 8)
  30736. ;
  30737. for (a = o & (1 << -h) - 1,
  30738. o >>= -h,
  30739. h += n; 0 < h; a = 256 * a + e[t + u],
  30740. u += d,
  30741. h -= 8)
  30742. ;
  30743. if (0 === o)
  30744. o = 1 - c;
  30745. else {
  30746. if (o === l)
  30747. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30748. a += Math.pow(2, n),
  30749. o -= c
  30750. }
  30751. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30752. }
  30753. ,
  30754. i.write = function(e, t, i, n, r, o) {
  30755. 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;
  30756. for (t = Math.abs(t),
  30757. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30758. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30759. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30760. l *= 2),
  30761. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30762. l /= 2),
  30763. h <= a + u ? (s = 0,
  30764. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30765. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30766. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30767. p += f,
  30768. s /= 256,
  30769. r -= 8)
  30770. ;
  30771. for (a = a << r | s,
  30772. c += r; 0 < c; e[i + p] = 255 & a,
  30773. p += f,
  30774. a /= 256,
  30775. c -= 8)
  30776. ;
  30777. e[i + p - f] |= 128 * g
  30778. }
  30779. }
  30780. , {}],
  30781. 201: [function(e, t, i) {
  30782. var n = {}.toString;
  30783. t.exports = Array.isArray || function(e) {
  30784. return "[object Array]" == n.call(e)
  30785. }
  30786. }
  30787. , {}],
  30788. 202: [function(e, t, i) {
  30789. function n() {
  30790. this._events = this._events || {},
  30791. this._maxListeners = this._maxListeners || void 0
  30792. }
  30793. function l(e) {
  30794. return "function" == typeof e
  30795. }
  30796. function c(e) {
  30797. return "object" == typeof e && null !== e
  30798. }
  30799. function h(e) {
  30800. return void 0 === e
  30801. }
  30802. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30803. n.prototype._maxListeners = void 0,
  30804. n.defaultMaxListeners = 10,
  30805. n.prototype.setMaxListeners = function(e) {
  30806. if (!function(e) {
  30807. return "number" == typeof e
  30808. }(e) || e < 0 || isNaN(e))
  30809. throw TypeError("n must be a positive number");
  30810. return this._maxListeners = e,
  30811. this
  30812. }
  30813. ,
  30814. n.prototype.emit = function(e) {
  30815. var t, i, n, r, o, a;
  30816. if (this._events || (this._events = {}),
  30817. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30818. if ((t = arguments[1])instanceof Error)
  30819. throw t;
  30820. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30821. throw s.context = t,
  30822. s
  30823. }
  30824. if (h(i = this._events[e]))
  30825. return !1;
  30826. if (l(i))
  30827. switch (arguments.length) {
  30828. case 1:
  30829. i.call(this);
  30830. break;
  30831. case 2:
  30832. i.call(this, arguments[1]);
  30833. break;
  30834. case 3:
  30835. i.call(this, arguments[1], arguments[2]);
  30836. break;
  30837. default:
  30838. r = Array.prototype.slice.call(arguments, 1),
  30839. i.apply(this, r)
  30840. }
  30841. else if (c(i))
  30842. for (r = Array.prototype.slice.call(arguments, 1),
  30843. n = (a = i.slice()).length,
  30844. o = 0; o < n; o++)
  30845. a[o].apply(this, r);
  30846. return !0
  30847. }
  30848. ,
  30849. n.prototype.on = n.prototype.addListener = function(e, t) {
  30850. var i;
  30851. if (!l(t))
  30852. throw TypeError("listener must be a function");
  30853. return this._events || (this._events = {}),
  30854. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30855. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30856. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  30857. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30858. "function" == typeof console.trace && console.trace())),
  30859. this
  30860. }
  30861. ,
  30862. n.prototype.once = function(e, t) {
  30863. function i() {
  30864. this.removeListener(e, i),
  30865. n || (n = !0,
  30866. t.apply(this, arguments))
  30867. }
  30868. if (!l(t))
  30869. throw TypeError("listener must be a function");
  30870. var n = !1;
  30871. return i.listener = t,
  30872. this.on(e, i),
  30873. this
  30874. }
  30875. ,
  30876. n.prototype.removeListener = function(e, t) {
  30877. var i, n, r, o;
  30878. if (!l(t))
  30879. throw TypeError("listener must be a function");
  30880. if (!this._events || !this._events[e])
  30881. return this;
  30882. if (r = (i = this._events[e]).length,
  30883. n = -1,
  30884. i === t || l(i.listener) && i.listener === t)
  30885. delete this._events[e],
  30886. this._events.removeListener && this.emit("removeListener", e, t);
  30887. else if (c(i)) {
  30888. for (o = r; 0 < o--; )
  30889. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30890. n = o;
  30891. break
  30892. }
  30893. if (n < 0)
  30894. return this;
  30895. 1 === i.length ? (i.length = 0,
  30896. delete this._events[e]) : i.splice(n, 1),
  30897. this._events.removeListener && this.emit("removeListener", e, t)
  30898. }
  30899. return this
  30900. }
  30901. ,
  30902. n.prototype.removeAllListeners = function(e) {
  30903. var t, i;
  30904. if (!this._events)
  30905. return this;
  30906. if (!this._events.removeListener)
  30907. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30908. this;
  30909. if (0 === arguments.length) {
  30910. for (t in this._events)
  30911. "removeListener" !== t && this.removeAllListeners(t);
  30912. return this.removeAllListeners("removeListener"),
  30913. this._events = {},
  30914. this
  30915. }
  30916. if (l(i = this._events[e]))
  30917. this.removeListener(e, i);
  30918. else if (i)
  30919. for (; i.length; )
  30920. this.removeListener(e, i[i.length - 1]);
  30921. return delete this._events[e],
  30922. this
  30923. }
  30924. ,
  30925. n.prototype.listeners = function(e) {
  30926. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30927. }
  30928. ,
  30929. n.prototype.listenerCount = function(e) {
  30930. if (this._events) {
  30931. var t = this._events[e];
  30932. if (l(t))
  30933. return 1;
  30934. if (t)
  30935. return t.length
  30936. }
  30937. return 0
  30938. }
  30939. ,
  30940. n.listenerCount = function(e, t) {
  30941. return e.listenerCount(t)
  30942. }
  30943. }
  30944. , {}],
  30945. 203: [function(e, t, i) {
  30946. function n() {
  30947. throw new Error("setTimeout has not been defined")
  30948. }
  30949. function r() {
  30950. throw new Error("clearTimeout has not been defined")
  30951. }
  30952. function o(t) {
  30953. if (h === setTimeout)
  30954. return setTimeout(t, 0);
  30955. if ((h === n || !h) && setTimeout)
  30956. return h = setTimeout,
  30957. setTimeout(t, 0);
  30958. try {
  30959. return h(t, 0)
  30960. } catch (e) {
  30961. try {
  30962. return h.call(null, t, 0)
  30963. } catch (e) {
  30964. return h.call(this, t, 0)
  30965. }
  30966. }
  30967. }
  30968. function a() {
  30969. g && p && (g = !1,
  30970. p.length ? f = p.concat(f) : m = -1,
  30971. f.length && s())
  30972. }
  30973. function s() {
  30974. if (!g) {
  30975. var e = o(a);
  30976. g = !0;
  30977. for (var t = f.length; t; ) {
  30978. for (p = f,
  30979. f = []; ++m < t; )
  30980. p && p[m].run();
  30981. m = -1,
  30982. t = f.length
  30983. }
  30984. p = null,
  30985. g = !1,
  30986. function(t) {
  30987. if (u === clearTimeout)
  30988. return clearTimeout(t);
  30989. if ((u === r || !u) && clearTimeout)
  30990. return u = clearTimeout,
  30991. clearTimeout(t);
  30992. try {
  30993. u(t)
  30994. } catch (e) {
  30995. try {
  30996. return u.call(null, t)
  30997. } catch (e) {
  30998. return u.call(this, t)
  30999. }
  31000. }
  31001. }(e)
  31002. }
  31003. }
  31004. function l(e, t) {
  31005. this.fun = e,
  31006. this.array = t
  31007. }
  31008. function c() {}
  31009. var h, u, d = t.exports = {};
  31010. !function() {
  31011. try {
  31012. h = "function" == typeof setTimeout ? setTimeout : n
  31013. } catch (e) {
  31014. h = n
  31015. }
  31016. try {
  31017. u = "function" == typeof clearTimeout ? clearTimeout : r
  31018. } catch (e) {
  31019. u = r
  31020. }
  31021. }();
  31022. var p, f = [], g = !1, m = -1;
  31023. d.nextTick = function(e) {
  31024. var t = new Array(arguments.length - 1);
  31025. if (1 < arguments.length)
  31026. for (var i = 1; i < arguments.length; i++)
  31027. t[i - 1] = arguments[i];
  31028. f.push(new l(e,t)),
  31029. 1 !== f.length || g || o(s)
  31030. }
  31031. ,
  31032. l.prototype.run = function() {
  31033. this.fun.apply(null, this.array)
  31034. }
  31035. ,
  31036. d.title = "browser",
  31037. d.browser = !0,
  31038. d.env = {},
  31039. d.argv = [],
  31040. d.version = "",
  31041. d.versions = {},
  31042. d.on = c,
  31043. d.addListener = c,
  31044. d.once = c,
  31045. d.off = c,
  31046. d.removeListener = c,
  31047. d.removeAllListeners = c,
  31048. d.emit = c,
  31049. d.binding = function(e) {
  31050. throw new Error("process.binding is not supported")
  31051. }
  31052. ,
  31053. d.cwd = function() {
  31054. return "/"
  31055. }
  31056. ,
  31057. d.chdir = function(e) {
  31058. throw new Error("process.chdir is not supported")
  31059. }
  31060. ,
  31061. d.umask = function() {
  31062. return 0
  31063. }
  31064. }
  31065. , {}],
  31066. 204: [function(e, O, L) {
  31067. (function(P) {
  31068. !function(e) {
  31069. function v(e) {
  31070. throw new RangeError(g[e])
  31071. }
  31072. function r(e, t) {
  31073. for (var i = e.length, n = []; i--; )
  31074. n[i] = t(e[i]);
  31075. return n
  31076. }
  31077. function t(e, t) {
  31078. var i = e.split("@")
  31079. , n = "";
  31080. return 1 < i.length && (n = i[0] + "@",
  31081. e = i[1]),
  31082. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31083. }
  31084. function y(e) {
  31085. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31086. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  31087. r--) : n.push(t);
  31088. return n
  31089. }
  31090. function A(e) {
  31091. return r(e, function(e) {
  31092. var t = "";
  31093. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31094. e = 56320 | 1023 & e),
  31095. t + R(e)
  31096. }).join("")
  31097. }
  31098. function C(e, t) {
  31099. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31100. }
  31101. function I(e, t, i) {
  31102. var n = 0;
  31103. for (e = i ? M(e / u) : e >> 1,
  31104. e += M(e / t); m * w >> 1 < e; n += _)
  31105. e = M(e / m);
  31106. return M(n + (m + 1) * e / (e + h))
  31107. }
  31108. function i(e) {
  31109. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31110. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31111. n = 0; n < i; ++n)
  31112. 128 <= e.charCodeAt(n) && v("not-basic"),
  31113. d.push(e.charCodeAt(n));
  31114. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31115. for (o = f,
  31116. a = 1,
  31117. s = _; p <= r && v("invalid-input"),
  31118. u = e.charCodeAt(r++),
  31119. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31120. f += l * a,
  31121. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31122. a > M(E / (h = _ - c)) && v("overflow"),
  31123. a *= h;
  31124. m = I(f - o, t = d.length + 1, 0 == o),
  31125. M(f / t) > E - g && v("overflow"),
  31126. g += M(f / t),
  31127. f %= t,
  31128. d.splice(f++, 0, g)
  31129. }
  31130. return A(d)
  31131. }
  31132. function n(e) {
  31133. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31134. for (d = (e = y(e)).length,
  31135. t = x,
  31136. o = T,
  31137. a = i = 0; a < d; ++a)
  31138. (u = e[a]) < 128 && m.push(R(u));
  31139. for (n = r = m.length,
  31140. r && m.push(S); n < d; ) {
  31141. for (s = E,
  31142. a = 0; a < d; ++a)
  31143. t <= (u = e[a]) && u < s && (s = u);
  31144. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31145. i += (s - t) * p,
  31146. t = s,
  31147. a = 0; a < d; ++a)
  31148. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31149. u == t) {
  31150. for (l = i,
  31151. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31152. g = l - h,
  31153. f = _ - h,
  31154. m.push(R(C(h + g % f, 0))),
  31155. l = M(g / f);
  31156. m.push(R(C(l, 0))),
  31157. o = I(i, p, n == r),
  31158. i = 0,
  31159. ++n
  31160. }
  31161. ++i,
  31162. ++t
  31163. }
  31164. return m.join("")
  31165. }
  31166. var o = "object" == typeof L && L && !L.nodeType && L
  31167. , a = "object" == typeof O && O && !O.nodeType && O
  31168. , s = "object" == typeof P && P;
  31169. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31170. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  31171. overflow: "Overflow: input needs wider integers to process",
  31172. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31173. "invalid-input": "Invalid input"
  31174. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31175. if (l = {
  31176. version: "1.4.1",
  31177. ucs2: {
  31178. decode: y,
  31179. encode: A
  31180. },
  31181. decode: i,
  31182. encode: n,
  31183. toASCII: function(e) {
  31184. return t(e, function(e) {
  31185. return p.test(e) ? "xn--" + n(e) : e
  31186. })
  31187. },
  31188. toUnicode: function(e) {
  31189. return t(e, function(e) {
  31190. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31191. })
  31192. }
  31193. },
  31194. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31195. define("punycode", function() {
  31196. return l
  31197. });
  31198. else if (o && a)
  31199. if (O.exports == o)
  31200. a.exports = l;
  31201. else
  31202. for (c in l)
  31203. l.hasOwnProperty(c) && (o[c] = l[c]);
  31204. else
  31205. e.punycode = l
  31206. }(this)
  31207. }
  31208. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31209. }
  31210. , {}],
  31211. 205: [function(e, t, i) {
  31212. "use strict";
  31213. t.exports = function(e, t, i, n) {
  31214. t = t || "&",
  31215. i = i || "=";
  31216. var r = {};
  31217. if ("string" != typeof e || 0 === e.length)
  31218. return r;
  31219. var o = /\+/g;
  31220. e = e.split(t);
  31221. var a = 1e3;
  31222. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31223. var s, l, c = e.length;
  31224. 0 < a && a < c && (c = a);
  31225. for (var h = 0; h < c; ++h) {
  31226. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31227. d = 0 <= m ? (u = g.substr(0, m),
  31228. g.substr(m + 1)) : (u = g,
  31229. ""),
  31230. p = decodeURIComponent(u),
  31231. f = decodeURIComponent(d),
  31232. s = r,
  31233. l = p,
  31234. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31235. }
  31236. return r
  31237. }
  31238. ;
  31239. var v = Array.isArray || function(e) {
  31240. return "[object Array]" === Object.prototype.toString.call(e)
  31241. }
  31242. }
  31243. , {}],
  31244. 206: [function(e, t, i) {
  31245. "use strict";
  31246. function o(e, t) {
  31247. if (e.map)
  31248. return e.map(t);
  31249. for (var i = [], n = 0; n < e.length; n++)
  31250. i.push(t(e[n], n));
  31251. return i
  31252. }
  31253. function a(e) {
  31254. switch (typeof e) {
  31255. case "string":
  31256. return e;
  31257. case "boolean":
  31258. return e ? "true" : "false";
  31259. case "number":
  31260. return isFinite(e) ? e : "";
  31261. default:
  31262. return ""
  31263. }
  31264. }
  31265. t.exports = function(i, n, r, e) {
  31266. return n = n || "&",
  31267. r = r || "=",
  31268. null === i && (i = void 0),
  31269. "object" == typeof i ? o(l(i), function(e) {
  31270. var t = encodeURIComponent(a(e)) + r;
  31271. return s(i[e]) ? o(i[e], function(e) {
  31272. return t + encodeURIComponent(a(e))
  31273. }).join(n) : t + encodeURIComponent(a(i[e]))
  31274. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31275. }
  31276. ;
  31277. var s = Array.isArray || function(e) {
  31278. return "[object Array]" === Object.prototype.toString.call(e)
  31279. }
  31280. , l = Object.keys || function(e) {
  31281. var t = [];
  31282. for (var i in e)
  31283. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31284. return t
  31285. }
  31286. }
  31287. , {}],
  31288. 207: [function(e, t, i) {
  31289. "use strict";
  31290. i.decode = i.parse = e("./decode"),
  31291. i.encode = i.stringify = e("./encode")
  31292. }
  31293. , {
  31294. "./decode": 205,
  31295. "./encode": 206
  31296. }],
  31297. 208: [function(e, t, i) {
  31298. "use strict";
  31299. function x() {
  31300. this.protocol = null,
  31301. this.slashes = null,
  31302. this.auth = null,
  31303. this.host = null,
  31304. this.port = null,
  31305. this.hostname = null,
  31306. this.hash = null,
  31307. this.search = null,
  31308. this.query = null,
  31309. this.pathname = null,
  31310. this.path = null,
  31311. this.href = null
  31312. }
  31313. function n(e, t, i) {
  31314. if (e && D.isObject(e) && e instanceof x)
  31315. return e;
  31316. var n = new x;
  31317. return n.parse(e, t, i),
  31318. n
  31319. }
  31320. var L = e("punycode")
  31321. , D = e("./util");
  31322. i.parse = n,
  31323. i.resolve = function(e, t) {
  31324. return n(e, !1, !0).resolve(t)
  31325. }
  31326. ,
  31327. i.resolveObject = function(e, t) {
  31328. return e ? n(e, !1, !0).resolveObject(t) : t
  31329. }
  31330. ,
  31331. i.format = function(e) {
  31332. return D.isString(e) && (e = n(e)),
  31333. e instanceof x ? e.format() : x.prototype.format.call(e)
  31334. }
  31335. ,
  31336. i.Url = x;
  31337. var N = /^([a-z0-9.+-]+:)/i
  31338. , r = /:[0-9]*$/
  31339. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31340. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31341. , B = ["'"].concat(o)
  31342. , V = ["%", "/", "?", ";", "#"].concat(B)
  31343. , k = ["/", "?", "#"]
  31344. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31345. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31346. , z = {
  31347. javascript: !0,
  31348. "javascript:": !0
  31349. }
  31350. , G = {
  31351. javascript: !0,
  31352. "javascript:": !0
  31353. }
  31354. , W = {
  31355. http: !0,
  31356. https: !0,
  31357. ftp: !0,
  31358. gopher: !0,
  31359. file: !0,
  31360. "http:": !0,
  31361. "https:": !0,
  31362. "ftp:": !0,
  31363. "gopher:": !0,
  31364. "file:": !0
  31365. }
  31366. , j = e("querystring");
  31367. x.prototype.parse = function(e, t, i) {
  31368. if (!D.isString(e))
  31369. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31370. var n = e.indexOf("?")
  31371. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31372. , o = e.split(r);
  31373. o[0] = o[0].replace(/\\/g, "/");
  31374. var a = e = o.join(r);
  31375. if (a = a.trim(),
  31376. !i && 1 === e.split("#").length) {
  31377. var s = F.exec(a);
  31378. if (s)
  31379. return this.path = a,
  31380. this.href = a,
  31381. this.pathname = s[1],
  31382. s[2] ? (this.search = s[2],
  31383. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31384. this.query = {}),
  31385. this
  31386. }
  31387. var l = N.exec(a);
  31388. if (l) {
  31389. var c = (l = l[0]).toLowerCase();
  31390. this.protocol = c,
  31391. a = a.substr(l.length)
  31392. }
  31393. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31394. var h = "//" === a.substr(0, 2);
  31395. !h || l && G[l] || (a = a.substr(2),
  31396. this.slashes = !0)
  31397. }
  31398. if (!G[l] && (h || l && !W[l])) {
  31399. for (var u = -1, d = 0; d < k.length; d++) {
  31400. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31401. }
  31402. var p, f;
  31403. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31404. a = a.slice(f + 1),
  31405. this.auth = decodeURIComponent(p)),
  31406. u = -1;
  31407. for (d = 0; d < V.length; d++) {
  31408. var g;
  31409. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31410. }
  31411. -1 === u && (u = a.length),
  31412. this.host = a.slice(0, u),
  31413. a = a.slice(u),
  31414. this.parseHost(),
  31415. this.hostname = this.hostname || "";
  31416. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31417. if (!m)
  31418. for (var v = this.hostname.split(/\./), y = (d = 0,
  31419. v.length); d < y; d++) {
  31420. var A = v[d];
  31421. if (A && !A.match(U)) {
  31422. for (var C = "", I = 0, E = A.length; I < E; I++)
  31423. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31424. if (!C.match(U)) {
  31425. var _ = v.slice(0, d)
  31426. , b = v.slice(d + 1)
  31427. , w = A.match(H);
  31428. w && (_.push(w[1]),
  31429. b.unshift(w[2])),
  31430. b.length && (a = "/" + b.join(".") + a),
  31431. this.hostname = _.join(".");
  31432. break
  31433. }
  31434. }
  31435. }
  31436. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31437. m || (this.hostname = L.toASCII(this.hostname));
  31438. var T = this.port ? ":" + this.port : ""
  31439. , x = this.hostname || "";
  31440. this.host = x + T,
  31441. this.href += this.host,
  31442. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31443. "/" !== a[0] && (a = "/" + a))
  31444. }
  31445. if (!z[c])
  31446. for (d = 0,
  31447. y = B.length; d < y; d++) {
  31448. var S = B[d];
  31449. if (-1 !== a.indexOf(S)) {
  31450. var M = encodeURIComponent(S);
  31451. M === S && (M = escape(S)),
  31452. a = a.split(S).join(M)
  31453. }
  31454. }
  31455. var R = a.indexOf("#");
  31456. -1 !== R && (this.hash = a.substr(R),
  31457. a = a.slice(0, R));
  31458. var P = a.indexOf("?");
  31459. if (-1 !== P ? (this.search = a.substr(P),
  31460. this.query = a.substr(P + 1),
  31461. t && (this.query = j.parse(this.query)),
  31462. a = a.slice(0, P)) : t && (this.search = "",
  31463. this.query = {}),
  31464. a && (this.pathname = a),
  31465. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31466. this.pathname || this.search) {
  31467. T = this.pathname || "";
  31468. var O = this.search || "";
  31469. this.path = T + O
  31470. }
  31471. return this.href = this.format(),
  31472. this
  31473. }
  31474. ,
  31475. x.prototype.format = function() {
  31476. var e = this.auth || "";
  31477. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31478. e += "@");
  31479. var t = this.protocol || ""
  31480. , i = this.pathname || ""
  31481. , n = this.hash || ""
  31482. , r = !1
  31483. , o = "";
  31484. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31485. this.port && (r += ":" + this.port)),
  31486. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31487. var a = this.search || o && "?" + o || "";
  31488. return t && ":" !== t.substr(-1) && (t += ":"),
  31489. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31490. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31491. n && "#" !== n.charAt(0) && (n = "#" + n),
  31492. a && "?" !== a.charAt(0) && (a = "?" + a),
  31493. t + r + (i = i.replace(/[?#]/g, function(e) {
  31494. return encodeURIComponent(e)
  31495. })) + (a = a.replace("#", "%23")) + n
  31496. }
  31497. ,
  31498. x.prototype.resolve = function(e) {
  31499. return this.resolveObject(n(e, !1, !0)).format()
  31500. }
  31501. ,
  31502. x.prototype.resolveObject = function(e) {
  31503. if (D.isString(e)) {
  31504. var t = new x;
  31505. t.parse(e, !1, !0),
  31506. e = t
  31507. }
  31508. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31509. var o = n[r];
  31510. i[o] = this[o]
  31511. }
  31512. if (i.hash = e.hash,
  31513. "" === e.href)
  31514. return i.href = i.format(),
  31515. i;
  31516. if (e.slashes && !e.protocol) {
  31517. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31518. var l = a[s];
  31519. "protocol" !== l && (i[l] = e[l])
  31520. }
  31521. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31522. i.href = i.format(),
  31523. i
  31524. }
  31525. if (e.protocol && e.protocol !== i.protocol) {
  31526. if (!W[e.protocol]) {
  31527. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31528. var u = c[h];
  31529. i[u] = e[u]
  31530. }
  31531. return i.href = i.format(),
  31532. i
  31533. }
  31534. if (i.protocol = e.protocol,
  31535. e.host || G[e.protocol])
  31536. i.pathname = e.pathname;
  31537. else {
  31538. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31539. ;
  31540. e.host || (e.host = ""),
  31541. e.hostname || (e.hostname = ""),
  31542. "" !== d[0] && d.unshift(""),
  31543. d.length < 2 && d.unshift(""),
  31544. i.pathname = d.join("/")
  31545. }
  31546. if (i.search = e.search,
  31547. i.query = e.query,
  31548. i.host = e.host || "",
  31549. i.auth = e.auth,
  31550. i.hostname = e.hostname || e.host,
  31551. i.port = e.port,
  31552. i.pathname || i.search) {
  31553. var p = i.pathname || ""
  31554. , f = i.search || "";
  31555. i.path = p + f
  31556. }
  31557. return i.slashes = i.slashes || e.slashes,
  31558. i.href = i.format(),
  31559. i
  31560. }
  31561. var g = i.pathname && "/" === i.pathname.charAt(0)
  31562. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31563. , v = m || g || i.host && e.pathname
  31564. , y = v
  31565. , A = i.pathname && i.pathname.split("/") || []
  31566. , C = (d = e.pathname && e.pathname.split("/") || [],
  31567. i.protocol && !W[i.protocol]);
  31568. if (C && (i.hostname = "",
  31569. i.port = null,
  31570. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31571. i.host = "",
  31572. e.protocol && (e.hostname = null,
  31573. e.port = null,
  31574. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31575. e.host = null),
  31576. v = v && ("" === d[0] || "" === A[0])),
  31577. m)
  31578. i.host = e.host || "" === e.host ? e.host : i.host,
  31579. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31580. i.search = e.search,
  31581. i.query = e.query,
  31582. A = d;
  31583. else if (d.length)
  31584. (A = A || []).pop(),
  31585. A = A.concat(d),
  31586. i.search = e.search,
  31587. i.query = e.query;
  31588. else if (!D.isNullOrUndefined(e.search)) {
  31589. if (C)
  31590. i.hostname = i.host = A.shift(),
  31591. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31592. i.host = i.hostname = w.shift());
  31593. return i.search = e.search,
  31594. i.query = e.query,
  31595. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31596. i.href = i.format(),
  31597. i
  31598. }
  31599. if (!A.length)
  31600. return i.pathname = null,
  31601. i.search ? i.path = "/" + i.search : i.path = null,
  31602. i.href = i.format(),
  31603. i;
  31604. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31605. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31606. _++) : _ && (A.splice(b, 1),
  31607. _--);
  31608. if (!v && !y)
  31609. for (; _--; )
  31610. A.unshift("..");
  31611. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31612. E && "/" !== A.join("/").substr(-1) && A.push("");
  31613. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31614. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31615. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31616. i.host = i.hostname = w.shift()));
  31617. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31618. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31619. i.path = null),
  31620. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31621. i.auth = e.auth || i.auth,
  31622. i.slashes = i.slashes || e.slashes,
  31623. i.href = i.format(),
  31624. i
  31625. }
  31626. ,
  31627. x.prototype.parseHost = function() {
  31628. var e = this.host
  31629. , t = r.exec(e);
  31630. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31631. e = e.substr(0, e.length - t.length)),
  31632. e && (this.hostname = e)
  31633. }
  31634. }
  31635. , {
  31636. "./util": 209,
  31637. punycode: 204,
  31638. querystring: 207
  31639. }],
  31640. 209: [function(e, t, i) {
  31641. "use strict";
  31642. t.exports = {
  31643. isString: function(e) {
  31644. return "string" == typeof e
  31645. },
  31646. isObject: function(e) {
  31647. return "object" == typeof e && null !== e
  31648. },
  31649. isNull: function(e) {
  31650. return null === e
  31651. },
  31652. isNullOrUndefined: function(e) {
  31653. return null == e
  31654. }
  31655. }
  31656. }
  31657. , {}],
  31658. 210: [function(e, t, i) {
  31659. "use strict";
  31660. function r(e) {
  31661. return c + e
  31662. }
  31663. function s(e) {
  31664. if ("string" != typeof e)
  31665. throw new TypeError("key must be a string.")
  31666. }
  31667. var l = Object.prototype.hasOwnProperty
  31668. , c = "~";
  31669. t.exports = function(t) {
  31670. var o = Object.create(null)
  31671. , n = 0
  31672. , a = {};
  31673. return function(e, t) {
  31674. for (var i in t)
  31675. Object.defineProperty(e, i, {
  31676. value: t[i],
  31677. configurable: !0,
  31678. writable: !0
  31679. })
  31680. }(a, {
  31681. get: function(e, t) {
  31682. s(e);
  31683. var i = r(e);
  31684. return i in o ? o[i] : t
  31685. },
  31686. set: function(e, t) {
  31687. s(e);
  31688. var i = r(e);
  31689. return i in o || ++n,
  31690. o[i] = t
  31691. },
  31692. has: function(e) {
  31693. return s(e),
  31694. r(e)in o
  31695. },
  31696. delete: function(e) {
  31697. s(e);
  31698. var t = r(e);
  31699. return t in o && (--n,
  31700. delete o[t],
  31701. !0)
  31702. },
  31703. clear: function() {
  31704. o = Object.create(null),
  31705. n = 0
  31706. },
  31707. forEach: function(e, t) {
  31708. if ("function" != typeof e)
  31709. throw new TypeError("`callback` must be a function");
  31710. for (var i in o)
  31711. if (l.call(o, i)) {
  31712. var n = i.substring(c.length)
  31713. , r = o[i];
  31714. e.call(t, r, n, a)
  31715. }
  31716. }
  31717. }),
  31718. Object.defineProperty(a, "size", {
  31719. get: function() {
  31720. return n
  31721. },
  31722. configurable: !0
  31723. }),
  31724. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31725. a.set(e, t[e])
  31726. }),
  31727. a
  31728. }
  31729. }
  31730. , {}],
  31731. 211: [function(e, t, i) {
  31732. t.exports = e("./lib/heap")
  31733. }
  31734. , {
  31735. "./lib/heap": 212
  31736. }],
  31737. 212: [function(e, y, A) {
  31738. (function() {
  31739. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31740. function v(e) {
  31741. this.cmp = null != e ? e : d,
  31742. this.nodes = []
  31743. }
  31744. l = Math.floor,
  31745. m = Math.min,
  31746. d = function(e, t) {
  31747. return e < t ? -1 : t < e ? 1 : 0
  31748. }
  31749. ,
  31750. g = function(e, t, i, n, r) {
  31751. var o;
  31752. if (null == i && (i = 0),
  31753. null == r && (r = d),
  31754. i < 0)
  31755. throw new Error("lo must be non-negative");
  31756. for (null == n && (n = e.length); i < n; )
  31757. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31758. return [].splice.apply(e, [i, i - i].concat(t)),
  31759. t
  31760. }
  31761. ,
  31762. t = function(e, t, i) {
  31763. return null == i && (i = d),
  31764. e.push(t),
  31765. h(e, 0, e.length - 1, i)
  31766. }
  31767. ,
  31768. f = function(e, t) {
  31769. var i, n;
  31770. return null == t && (t = d),
  31771. i = e.pop(),
  31772. e.length ? (n = e[0],
  31773. e[0] = i,
  31774. u(e, 0, t)) : n = i,
  31775. n
  31776. }
  31777. ,
  31778. i = function(e, t, i) {
  31779. var n;
  31780. return null == i && (i = d),
  31781. n = e[0],
  31782. e[0] = t,
  31783. u(e, 0, i),
  31784. n
  31785. }
  31786. ,
  31787. c = function(e, t, i) {
  31788. var n;
  31789. return null == i && (i = d),
  31790. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31791. e[0] = n[1],
  31792. u(e, 0, i)),
  31793. t
  31794. }
  31795. ,
  31796. p = function(i, e) {
  31797. var t, n, r, o, a, s;
  31798. for (null == e && (e = d),
  31799. a = [],
  31800. n = 0,
  31801. r = (o = function() {
  31802. s = [];
  31803. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31804. s.push(e);
  31805. return s
  31806. }
  31807. .apply(this).reverse()).length; n < r; n++)
  31808. t = o[n],
  31809. a.push(u(i, t, e));
  31810. return a
  31811. }
  31812. ,
  31813. o = function(e, t, i) {
  31814. var n;
  31815. if (null == i && (i = d),
  31816. -1 !== (n = e.indexOf(t)))
  31817. return h(e, 0, n, i),
  31818. u(e, n, i)
  31819. }
  31820. ,
  31821. n = function(e, t, i) {
  31822. var n, r, o, a, s;
  31823. if (null == i && (i = d),
  31824. !(r = e.slice(0, t)).length)
  31825. return r;
  31826. for (p(r, i),
  31827. o = 0,
  31828. a = (s = e.slice(t)).length; o < a; o++)
  31829. n = s[o],
  31830. c(r, n, i);
  31831. return r.sort(i).reverse()
  31832. }
  31833. ,
  31834. r = function(e, t, i) {
  31835. var n, r, o, a, s, l, c, h, u;
  31836. if (null == i && (i = d),
  31837. 10 * t <= e.length) {
  31838. if (!(o = e.slice(0, t).sort(i)).length)
  31839. return o;
  31840. for (r = o[o.length - 1],
  31841. a = 0,
  31842. l = (c = e.slice(t)).length; a < l; a++)
  31843. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31844. o.pop(),
  31845. r = o[o.length - 1]);
  31846. return o
  31847. }
  31848. for (p(e, i),
  31849. u = [],
  31850. s = 0,
  31851. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31852. u.push(f(e, i));
  31853. return u
  31854. }
  31855. ,
  31856. h = function(e, t, i, n) {
  31857. var r, o, a;
  31858. for (null == n && (n = d),
  31859. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31860. e[i] = o,
  31861. i = a;
  31862. return e[i] = r
  31863. }
  31864. ,
  31865. u = function(e, t, i) {
  31866. var n, r, o, a, s;
  31867. for (null == i && (i = d),
  31868. r = e.length,
  31869. o = e[s = t],
  31870. n = 2 * t + 1; n < r; )
  31871. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31872. e[t] = e[n],
  31873. n = 2 * (t = n) + 1;
  31874. return e[t] = o,
  31875. h(e, s, t, i)
  31876. }
  31877. ,
  31878. v.push = t,
  31879. v.pop = f,
  31880. v.replace = i,
  31881. v.pushpop = c,
  31882. v.heapify = p,
  31883. v.updateItem = o,
  31884. v.nlargest = n,
  31885. v.nsmallest = r,
  31886. v.prototype.push = function(e) {
  31887. return t(this.nodes, e, this.cmp)
  31888. }
  31889. ,
  31890. v.prototype.pop = function() {
  31891. return f(this.nodes, this.cmp)
  31892. }
  31893. ,
  31894. v.prototype.peek = function() {
  31895. return this.nodes[0]
  31896. }
  31897. ,
  31898. v.prototype.contains = function(e) {
  31899. return -1 !== this.nodes.indexOf(e)
  31900. }
  31901. ,
  31902. v.prototype.replace = function(e) {
  31903. return i(this.nodes, e, this.cmp)
  31904. }
  31905. ,
  31906. v.prototype.pushpop = function(e) {
  31907. return c(this.nodes, e, this.cmp)
  31908. }
  31909. ,
  31910. v.prototype.heapify = function() {
  31911. return p(this.nodes, this.cmp)
  31912. }
  31913. ,
  31914. v.prototype.updateItem = function(e) {
  31915. return o(this.nodes, e, this.cmp)
  31916. }
  31917. ,
  31918. v.prototype.clear = function() {
  31919. return this.nodes = []
  31920. }
  31921. ,
  31922. v.prototype.empty = function() {
  31923. return 0 === this.nodes.length
  31924. }
  31925. ,
  31926. v.prototype.size = function() {
  31927. return this.nodes.length
  31928. }
  31929. ,
  31930. v.prototype.clone = function() {
  31931. var e;
  31932. return (e = new v).nodes = this.nodes.slice(0),
  31933. e
  31934. }
  31935. ,
  31936. v.prototype.toArray = function() {
  31937. return this.nodes.slice(0)
  31938. }
  31939. ,
  31940. v.prototype.insert = v.prototype.push,
  31941. v.prototype.top = v.prototype.peek,
  31942. v.prototype.front = v.prototype.peek,
  31943. v.prototype.has = v.prototype.contains,
  31944. v.prototype.copy = v.prototype.clone,
  31945. e = v,
  31946. a = this,
  31947. s = function() {
  31948. return e
  31949. }
  31950. ,
  31951. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31952. }
  31953. ).call(this)
  31954. }
  31955. , {}],
  31956. 213: [function(e, t, i) {
  31957. function n() {}
  31958. function o(e) {
  31959. if ("object" != typeof this)
  31960. throw new TypeError("Promises must be constructed via new");
  31961. if ("function" != typeof e)
  31962. throw new TypeError("not a function");
  31963. this._state = 0,
  31964. this._handled = !1,
  31965. this._value = void 0,
  31966. this._deferreds = [],
  31967. h(e, this)
  31968. }
  31969. function r(i, n) {
  31970. for (; 3 === i._state; )
  31971. i = i._value;
  31972. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31973. void o._immediateFn(function() {
  31974. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31975. if (null !== e) {
  31976. var t;
  31977. try {
  31978. t = e(i._value)
  31979. } catch (e) {
  31980. return void s(n.promise, e)
  31981. }
  31982. a(n.promise, t)
  31983. } else
  31984. (1 === i._state ? a : s)(n.promise, i._value)
  31985. }))
  31986. }
  31987. function a(e, t) {
  31988. try {
  31989. if (t === e)
  31990. throw new TypeError("A promise cannot be resolved with itself.");
  31991. if (t && ("object" == typeof t || "function" == typeof t)) {
  31992. var i = t.then;
  31993. if (t instanceof o)
  31994. return e._state = 3,
  31995. e._value = t,
  31996. void l(e);
  31997. if ("function" == typeof i)
  31998. return void h(function(e, t) {
  31999. return function() {
  32000. e.apply(t, arguments)
  32001. }
  32002. }(i, t), e)
  32003. }
  32004. e._state = 1,
  32005. e._value = t,
  32006. l(e)
  32007. } catch (t) {
  32008. s(e, t)
  32009. }
  32010. }
  32011. function s(e, t) {
  32012. e._state = 2,
  32013. e._value = t,
  32014. l(e)
  32015. }
  32016. function l(e) {
  32017. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32018. e._handled || o._unhandledRejectionFn(e._value)
  32019. });
  32020. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32021. r(e, e._deferreds[t]);
  32022. e._deferreds = null
  32023. }
  32024. function c(e, t, i) {
  32025. this.onFulfilled = "function" == typeof e ? e : null,
  32026. this.onRejected = "function" == typeof t ? t : null,
  32027. this.promise = i
  32028. }
  32029. function h(e, t) {
  32030. var i = !1;
  32031. try {
  32032. e(function(e) {
  32033. i || (i = !0,
  32034. a(t, e))
  32035. }, function(e) {
  32036. i || (i = !0,
  32037. s(t, e))
  32038. })
  32039. } catch (e) {
  32040. if (i)
  32041. return;
  32042. i = !0,
  32043. s(t, e)
  32044. }
  32045. }
  32046. var u, d;
  32047. u = this,
  32048. d = setTimeout,
  32049. o.prototype.catch = function(e) {
  32050. return this.then(null, e)
  32051. }
  32052. ,
  32053. o.prototype.then = function(e, t) {
  32054. var i = new this.constructor(n);
  32055. return r(this, new c(e,t,i)),
  32056. i
  32057. }
  32058. ,
  32059. o.all = function(e) {
  32060. var s = Array.prototype.slice.call(e);
  32061. return new o(function(n, r) {
  32062. function o(t, e) {
  32063. try {
  32064. if (e && ("object" == typeof e || "function" == typeof e)) {
  32065. var i = e.then;
  32066. if ("function" == typeof i)
  32067. return void i.call(e, function(e) {
  32068. o(t, e)
  32069. }, r)
  32070. }
  32071. s[t] = e,
  32072. 0 == --a && n(s)
  32073. } catch (e) {
  32074. r(e)
  32075. }
  32076. }
  32077. if (0 === s.length)
  32078. return n([]);
  32079. for (var a = s.length, e = 0; e < s.length; e++)
  32080. o(e, s[e])
  32081. }
  32082. )
  32083. }
  32084. ,
  32085. o.resolve = function(t) {
  32086. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32087. e(t)
  32088. }
  32089. )
  32090. }
  32091. ,
  32092. o.reject = function(i) {
  32093. return new o(function(e, t) {
  32094. t(i)
  32095. }
  32096. )
  32097. }
  32098. ,
  32099. o.race = function(r) {
  32100. return new o(function(e, t) {
  32101. for (var i = 0, n = r.length; i < n; i++)
  32102. r[i].then(e, t)
  32103. }
  32104. )
  32105. }
  32106. ,
  32107. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32108. setImmediate(e)
  32109. }
  32110. || function(e) {
  32111. d(e, 0)
  32112. }
  32113. ,
  32114. o._unhandledRejectionFn = function(e) {
  32115. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32116. }
  32117. ,
  32118. o._setImmediateFn = function(e) {
  32119. o._immediateFn = e
  32120. }
  32121. ,
  32122. o._setUnhandledRejectionFn = function(e) {
  32123. o._unhandledRejectionFn = e
  32124. }
  32125. ,
  32126. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32127. }
  32128. , {}],
  32129. 214: [function(p, i, e) {
  32130. (function(d) {
  32131. var e, t;
  32132. e = this,
  32133. t = function(I, e) {
  32134. "use strict";
  32135. var a, t, u, i, s, n, r, o = {};
  32136. return o.ByteBuffer = I,
  32137. o.Long = I.Long || null,
  32138. o.VERSION = "5.0.1",
  32139. o.WIRE_TYPES = {},
  32140. o.WIRE_TYPES.VARINT = 0,
  32141. o.WIRE_TYPES.BITS64 = 1,
  32142. o.WIRE_TYPES.LDELIM = 2,
  32143. o.WIRE_TYPES.STARTGROUP = 3,
  32144. o.WIRE_TYPES.ENDGROUP = 4,
  32145. o.WIRE_TYPES.BITS32 = 5,
  32146. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32147. o.TYPES = {
  32148. int32: {
  32149. name: "int32",
  32150. wireType: o.WIRE_TYPES.VARINT,
  32151. defaultValue: 0
  32152. },
  32153. uint32: {
  32154. name: "uint32",
  32155. wireType: o.WIRE_TYPES.VARINT,
  32156. defaultValue: 0
  32157. },
  32158. sint32: {
  32159. name: "sint32",
  32160. wireType: o.WIRE_TYPES.VARINT,
  32161. defaultValue: 0
  32162. },
  32163. int64: {
  32164. name: "int64",
  32165. wireType: o.WIRE_TYPES.VARINT,
  32166. defaultValue: o.Long ? o.Long.ZERO : void 0
  32167. },
  32168. uint64: {
  32169. name: "uint64",
  32170. wireType: o.WIRE_TYPES.VARINT,
  32171. defaultValue: o.Long ? o.Long.UZERO : void 0
  32172. },
  32173. sint64: {
  32174. name: "sint64",
  32175. wireType: o.WIRE_TYPES.VARINT,
  32176. defaultValue: o.Long ? o.Long.ZERO : void 0
  32177. },
  32178. bool: {
  32179. name: "bool",
  32180. wireType: o.WIRE_TYPES.VARINT,
  32181. defaultValue: !1
  32182. },
  32183. double: {
  32184. name: "double",
  32185. wireType: o.WIRE_TYPES.BITS64,
  32186. defaultValue: 0
  32187. },
  32188. string: {
  32189. name: "string",
  32190. wireType: o.WIRE_TYPES.LDELIM,
  32191. defaultValue: ""
  32192. },
  32193. bytes: {
  32194. name: "bytes",
  32195. wireType: o.WIRE_TYPES.LDELIM,
  32196. defaultValue: null
  32197. },
  32198. fixed32: {
  32199. name: "fixed32",
  32200. wireType: o.WIRE_TYPES.BITS32,
  32201. defaultValue: 0
  32202. },
  32203. sfixed32: {
  32204. name: "sfixed32",
  32205. wireType: o.WIRE_TYPES.BITS32,
  32206. defaultValue: 0
  32207. },
  32208. fixed64: {
  32209. name: "fixed64",
  32210. wireType: o.WIRE_TYPES.BITS64,
  32211. defaultValue: o.Long ? o.Long.UZERO : void 0
  32212. },
  32213. sfixed64: {
  32214. name: "sfixed64",
  32215. wireType: o.WIRE_TYPES.BITS64,
  32216. defaultValue: o.Long ? o.Long.ZERO : void 0
  32217. },
  32218. float: {
  32219. name: "float",
  32220. wireType: o.WIRE_TYPES.BITS32,
  32221. defaultValue: 0
  32222. },
  32223. enum: {
  32224. name: "enum",
  32225. wireType: o.WIRE_TYPES.VARINT,
  32226. defaultValue: 0
  32227. },
  32228. message: {
  32229. name: "message",
  32230. wireType: o.WIRE_TYPES.LDELIM,
  32231. defaultValue: null
  32232. },
  32233. group: {
  32234. name: "group",
  32235. wireType: o.WIRE_TYPES.STARTGROUP,
  32236. defaultValue: null
  32237. }
  32238. },
  32239. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  32240. o.ID_MIN = 1,
  32241. o.ID_MAX = 536870911,
  32242. o.convertFieldsToCamelCase = !1,
  32243. o.populateAccessors = !0,
  32244. o.populateDefaults = !0,
  32245. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32246. r.XHR = function() {
  32247. for (var e = [function() {
  32248. return new XMLHttpRequest
  32249. }
  32250. , function() {
  32251. return new ActiveXObject("Msxml2.XMLHTTP")
  32252. }
  32253. , function() {
  32254. return new ActiveXObject("Msxml3.XMLHTTP")
  32255. }
  32256. , function() {
  32257. return new ActiveXObject("Microsoft.XMLHTTP")
  32258. }
  32259. ], t = null, i = 0; i < e.length; i++) {
  32260. try {
  32261. t = e[i]()
  32262. } catch (e) {
  32263. continue
  32264. }
  32265. break
  32266. }
  32267. if (!t)
  32268. throw Error("XMLHttpRequest is not supported");
  32269. return t
  32270. }
  32271. ,
  32272. r.fetch = function(e, i) {
  32273. if (i && "function" != typeof i && (i = null),
  32274. r.IS_NODE) {
  32275. var t = p("fs");
  32276. if (i)
  32277. t.readFile(e, function(e, t) {
  32278. i(e ? null : "" + t)
  32279. });
  32280. else
  32281. try {
  32282. return t.readFileSync(e)
  32283. } catch (e) {
  32284. return null
  32285. }
  32286. } else {
  32287. var n = r.XHR();
  32288. if (n.open("GET", e, !!i),
  32289. n.setRequestHeader("Accept", "text/plain"),
  32290. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32291. !i)
  32292. return n.send(null),
  32293. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32294. if (n.onreadystatechange = function() {
  32295. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32296. }
  32297. ,
  32298. 4 == n.readyState)
  32299. return;
  32300. n.send(null)
  32301. }
  32302. }
  32303. ,
  32304. r.toCamelCase = function(e) {
  32305. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32306. return t.toUpperCase()
  32307. })
  32308. }
  32309. ,
  32310. r),
  32311. o.Lang = {
  32312. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32313. RULE: /^(?:required|optional|repeated|map)$/,
  32314. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32315. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32316. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32317. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32318. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32319. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32320. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32321. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32322. NUMBER_OCT: /^0[0-7]+$/,
  32323. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32324. BOOL: /^(?:true|false)$/i,
  32325. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32326. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32327. WHITESPACE: /\s/,
  32328. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32329. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32330. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32331. },
  32332. o.DotProto = function(r, a) {
  32333. function s(e, t) {
  32334. var i = -1
  32335. , n = 1;
  32336. if ("-" == e.charAt(0) && (n = -1,
  32337. e = e.substring(1)),
  32338. a.NUMBER_DEC.test(e))
  32339. i = parseInt(e);
  32340. else if (a.NUMBER_HEX.test(e))
  32341. i = parseInt(e.substring(2), 16);
  32342. else {
  32343. if (!a.NUMBER_OCT.test(e))
  32344. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32345. i = parseInt(e.substring(1), 8)
  32346. }
  32347. if (i = n * i | 0,
  32348. !t && i < 0)
  32349. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32350. return i
  32351. }
  32352. function o(e) {
  32353. var t = 1;
  32354. if ("-" == e.charAt(0) && (t = -1,
  32355. e = e.substring(1)),
  32356. a.NUMBER_DEC.test(e))
  32357. return t * parseInt(e, 10);
  32358. if (a.NUMBER_HEX.test(e))
  32359. return t * parseInt(e.substring(2), 16);
  32360. if (a.NUMBER_OCT.test(e))
  32361. return t * parseInt(e.substring(1), 8);
  32362. if ("inf" === e)
  32363. return t * (1 / 0);
  32364. if ("nan" === e)
  32365. return NaN;
  32366. if (a.NUMBER_FLT.test(e))
  32367. return t * parseFloat(e);
  32368. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32369. }
  32370. function n(e, t, i) {
  32371. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32372. e[t].push(i))
  32373. }
  32374. function t(e) {
  32375. this.source = e + "",
  32376. this.index = 0,
  32377. this.line = 1,
  32378. this.stack = [],
  32379. this._stringOpen = null
  32380. }
  32381. var e = {}
  32382. , i = t.prototype;
  32383. i._readString = function() {
  32384. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32385. e.lastIndex = this.index - 1;
  32386. var t = e.exec(this.source);
  32387. if (!t)
  32388. throw Error("unterminated string");
  32389. return this.index = e.lastIndex,
  32390. this.stack.push(this._stringOpen),
  32391. this._stringOpen = null,
  32392. t[1]
  32393. }
  32394. ,
  32395. i.next = function() {
  32396. if (0 < this.stack.length)
  32397. return this.stack.shift();
  32398. if (this.index >= this.source.length)
  32399. return null;
  32400. if (null !== this._stringOpen)
  32401. return this._readString();
  32402. var e, t, i;
  32403. do {
  32404. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32405. if ("\n" === i && ++this.line,
  32406. ++this.index === this.source.length)
  32407. return null;
  32408. if ("/" === this.source.charAt(this.index))
  32409. if (++this.index,
  32410. "/" === this.source.charAt(this.index)) {
  32411. for (; "\n" !== this.source.charAt(++this.index); )
  32412. if (this.index == this.source.length)
  32413. return null;
  32414. ++this.index,
  32415. ++this.line,
  32416. e = !0
  32417. } else {
  32418. if ("*" !== (i = this.source.charAt(this.index)))
  32419. return "/";
  32420. do {
  32421. if ("\n" === i && ++this.line,
  32422. ++this.index === this.source.length)
  32423. return null;
  32424. t = i,
  32425. i = this.source.charAt(this.index)
  32426. } while ("*" !== t || "/" !== i);++this.index,
  32427. e = !0
  32428. }
  32429. } while (e);if (this.index === this.source.length)
  32430. return null;
  32431. var n = this.index;
  32432. if (a.DELIM.lastIndex = 0,
  32433. !a.DELIM.test(this.source.charAt(n++)))
  32434. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32435. ++n;
  32436. var r = this.source.substring(this.index, this.index = n);
  32437. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32438. r
  32439. }
  32440. ,
  32441. i.peek = function() {
  32442. if (0 === this.stack.length) {
  32443. var e = this.next();
  32444. if (null === e)
  32445. return null;
  32446. this.stack.push(e)
  32447. }
  32448. return this.stack[0]
  32449. }
  32450. ,
  32451. i.skip = function(e) {
  32452. var t = this.next();
  32453. if (t !== e)
  32454. throw Error("illegal '" + t + "', '" + e + "' expected")
  32455. }
  32456. ,
  32457. i.omit = function(e) {
  32458. return this.peek() === e && (this.next(),
  32459. !0)
  32460. }
  32461. ,
  32462. i.toString = function() {
  32463. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32464. }
  32465. ,
  32466. e.Tokenizer = t;
  32467. function l(e) {
  32468. this.tn = new t(e),
  32469. this.proto3 = !1
  32470. }
  32471. var c = l.prototype;
  32472. return c.parse = function() {
  32473. var e, t, i = {
  32474. name: "[ROOT]",
  32475. package: null,
  32476. messages: [],
  32477. enums: [],
  32478. imports: [],
  32479. options: {},
  32480. services: []
  32481. }, n = !0;
  32482. try {
  32483. for (; e = this.tn.next(); )
  32484. switch (e) {
  32485. case "package":
  32486. if (!n || null !== i.package)
  32487. throw Error("unexpected 'package'");
  32488. if (e = this.tn.next(),
  32489. !a.TYPEREF.test(e))
  32490. throw Error("illegal package name: " + e);
  32491. this.tn.skip(";"),
  32492. i.package = e;
  32493. break;
  32494. case "import":
  32495. if (!n)
  32496. throw Error("unexpected 'import'");
  32497. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32498. e = this._readString(),
  32499. this.tn.skip(";"),
  32500. t || i.imports.push(e);
  32501. break;
  32502. case "syntax":
  32503. if (!n)
  32504. throw Error("unexpected 'syntax'");
  32505. this.tn.skip("="),
  32506. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32507. this.tn.skip(";");
  32508. break;
  32509. case "message":
  32510. this._parseMessage(i, null),
  32511. n = !1;
  32512. break;
  32513. case "enum":
  32514. this._parseEnum(i),
  32515. n = !1;
  32516. break;
  32517. case "option":
  32518. this._parseOption(i);
  32519. break;
  32520. case "service":
  32521. this._parseService(i);
  32522. break;
  32523. case "extend":
  32524. this._parseExtend(i);
  32525. break;
  32526. default:
  32527. throw Error("unexpected '" + e + "'")
  32528. }
  32529. } catch (e) {
  32530. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32531. e
  32532. }
  32533. return delete i.name,
  32534. i
  32535. }
  32536. ,
  32537. l.parse = function(e) {
  32538. return new l(e).parse()
  32539. }
  32540. ,
  32541. c._readString = function() {
  32542. var e, t, i = "";
  32543. do {
  32544. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32545. throw Error("illegal string delimiter: " + t);
  32546. i += this.tn.next(),
  32547. this.tn.skip(t),
  32548. e = this.tn.peek()
  32549. } while ('"' === e || '"' === e);return i
  32550. }
  32551. ,
  32552. c._readValue = function(e) {
  32553. var t = this.tn.peek();
  32554. if ('"' === t || "'" === t)
  32555. return this._readString();
  32556. if (this.tn.next(),
  32557. a.NUMBER.test(t))
  32558. return o(t);
  32559. if (a.BOOL.test(t))
  32560. return "true" === t.toLowerCase();
  32561. if (e && a.TYPEREF.test(t))
  32562. return t;
  32563. throw Error("illegal value: " + t)
  32564. }
  32565. ,
  32566. c._parseOption = function(e, t) {
  32567. var i = this.tn.next()
  32568. , n = !1;
  32569. if ("(" === i && (n = !0,
  32570. i = this.tn.next()),
  32571. !a.TYPEREF.test(i))
  32572. throw Error("illegal option name: " + i);
  32573. var r = i;
  32574. n && (this.tn.skip(")"),
  32575. r = "(" + r + ")",
  32576. i = this.tn.peek(),
  32577. a.FQTYPEREF.test(i) && (r += i,
  32578. this.tn.next())),
  32579. this.tn.skip("="),
  32580. this._parseOptionValue(e, r),
  32581. t || this.tn.skip(";")
  32582. }
  32583. ,
  32584. c._parseOptionValue = function(e, t) {
  32585. var i = this.tn.peek();
  32586. if ("{" !== i)
  32587. n(e.options, t, this._readValue(!0));
  32588. else
  32589. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32590. if (!a.NAME.test(i))
  32591. throw Error("illegal option name: " + t + "." + i);
  32592. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32593. }
  32594. }
  32595. ,
  32596. c._parseService = function(e) {
  32597. var t = this.tn.next();
  32598. if (!a.NAME.test(t))
  32599. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32600. var i = {
  32601. name: t,
  32602. rpc: {},
  32603. options: {}
  32604. };
  32605. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32606. if ("option" === t)
  32607. this._parseOption(i);
  32608. else {
  32609. if ("rpc" !== t)
  32610. throw Error("illegal service token: " + t);
  32611. this._parseServiceRPC(i)
  32612. }
  32613. this.tn.omit(";"),
  32614. e.services.push(i)
  32615. }
  32616. ,
  32617. c._parseServiceRPC = function(e) {
  32618. var t = this.tn.next();
  32619. if (!a.NAME.test(t))
  32620. throw Error("illegal rpc service method name: " + t);
  32621. var i = t
  32622. , n = {
  32623. request: null,
  32624. response: null,
  32625. request_stream: !1,
  32626. response_stream: !1,
  32627. options: {}
  32628. };
  32629. if (this.tn.skip("("),
  32630. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32631. t = this.tn.next()),
  32632. !a.TYPEREF.test(t))
  32633. throw Error("illegal rpc service request type: " + t);
  32634. if (n.request = t,
  32635. this.tn.skip(")"),
  32636. "returns" !== (t = this.tn.next()).toLowerCase())
  32637. throw Error("illegal rpc service request type delimiter: " + t);
  32638. if (this.tn.skip("("),
  32639. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32640. t = this.tn.next()),
  32641. n.response = t,
  32642. this.tn.skip(")"),
  32643. "{" === (t = this.tn.peek())) {
  32644. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32645. if ("option" !== t)
  32646. throw Error("illegal rpc service token: " + t);
  32647. this._parseOption(n)
  32648. }
  32649. this.tn.omit(";")
  32650. } else
  32651. this.tn.skip(";");
  32652. void 0 === e.rpc && (e.rpc = {}),
  32653. e.rpc[i] = n
  32654. }
  32655. ,
  32656. c._parseMessage = function(e, t) {
  32657. var i = !!t
  32658. , n = this.tn.next()
  32659. , r = {
  32660. name: "",
  32661. fields: [],
  32662. enums: [],
  32663. messages: [],
  32664. options: {},
  32665. services: [],
  32666. oneofs: {}
  32667. };
  32668. if (!a.NAME.test(n))
  32669. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32670. for (r.name = n,
  32671. i && (this.tn.skip("="),
  32672. t.id = s(this.tn.next()),
  32673. r.isGroup = !0),
  32674. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32675. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32676. if (a.RULE.test(n))
  32677. this._parseMessageField(r, n);
  32678. else if ("oneof" === n)
  32679. this._parseMessageOneOf(r);
  32680. else if ("enum" === n)
  32681. this._parseEnum(r);
  32682. else if ("message" === n)
  32683. this._parseMessage(r);
  32684. else if ("option" === n)
  32685. this._parseOption(r);
  32686. else if ("service" === n)
  32687. this._parseService(r);
  32688. else if ("extensions" === n)
  32689. r.extensions = this._parseExtensionRanges();
  32690. else if ("reserved" === n)
  32691. this._parseIgnored();
  32692. else if ("extend" === n)
  32693. this._parseExtend(r);
  32694. else {
  32695. if (!a.TYPEREF.test(n))
  32696. throw Error("illegal message token: " + n);
  32697. if (!this.proto3)
  32698. throw Error("illegal field rule: " + n);
  32699. this._parseMessageField(r, "optional", n)
  32700. }
  32701. return this.tn.omit(";"),
  32702. e.messages.push(r),
  32703. r
  32704. }
  32705. ,
  32706. c._parseIgnored = function() {
  32707. for (; ";" !== this.tn.peek(); )
  32708. this.tn.next();
  32709. this.tn.skip(";")
  32710. }
  32711. ,
  32712. c._parseMessageField = function(e, t, i) {
  32713. if (!a.RULE.test(t))
  32714. throw Error("illegal message field rule: " + t);
  32715. var n, r = {
  32716. rule: t,
  32717. type: "",
  32718. name: "",
  32719. options: {},
  32720. id: 0
  32721. };
  32722. if ("map" === t) {
  32723. if (i)
  32724. throw Error("illegal type: " + i);
  32725. if (this.tn.skip("<"),
  32726. n = this.tn.next(),
  32727. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32728. throw Error("illegal message field type: " + n);
  32729. if (r.keytype = n,
  32730. this.tn.skip(","),
  32731. n = this.tn.next(),
  32732. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32733. throw Error("illegal message field: " + n);
  32734. if (r.type = n,
  32735. this.tn.skip(">"),
  32736. n = this.tn.next(),
  32737. !a.NAME.test(n))
  32738. throw Error("illegal message field name: " + n);
  32739. r.name = n,
  32740. this.tn.skip("="),
  32741. r.id = s(this.tn.next()),
  32742. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32743. this.tn.skip(";")
  32744. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32745. var o = this._parseMessage(e, r);
  32746. if (!/^[A-Z]/.test(o.name))
  32747. throw Error("illegal group name: " + o.name);
  32748. r.type = o.name,
  32749. r.name = o.name.toLowerCase(),
  32750. this.tn.omit(";")
  32751. } else {
  32752. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32753. throw Error("illegal message field type: " + i);
  32754. if (r.type = i,
  32755. n = this.tn.next(),
  32756. !a.NAME.test(n))
  32757. throw Error("illegal message field name: " + n);
  32758. r.name = n,
  32759. this.tn.skip("="),
  32760. r.id = s(this.tn.next()),
  32761. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32762. this.tn.skip(";")
  32763. }
  32764. return e.fields.push(r),
  32765. r
  32766. }
  32767. ,
  32768. c._parseMessageOneOf = function(e) {
  32769. var t = this.tn.next();
  32770. if (!a.NAME.test(t))
  32771. throw Error("illegal oneof name: " + t);
  32772. var i, n = t, r = [];
  32773. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32774. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32775. r.push(i.id);
  32776. this.tn.omit(";"),
  32777. e.oneofs[n] = r
  32778. }
  32779. ,
  32780. c._parseFieldOptions = function(e) {
  32781. this.tn.skip("[");
  32782. for (var t = !0; "]" !== this.tn.peek(); )
  32783. t || this.tn.skip(","),
  32784. this._parseOption(e, !0),
  32785. t = !1;
  32786. this.tn.next()
  32787. }
  32788. ,
  32789. c._parseEnum = function(e) {
  32790. var t = {
  32791. name: "",
  32792. values: [],
  32793. options: {}
  32794. }
  32795. , i = this.tn.next();
  32796. if (!a.NAME.test(i))
  32797. throw Error("illegal name: " + i);
  32798. for (t.name = i,
  32799. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32800. if ("option" === i)
  32801. this._parseOption(t);
  32802. else {
  32803. if (!a.NAME.test(i))
  32804. throw Error("illegal name: " + i);
  32805. this.tn.skip("=");
  32806. var n = {
  32807. name: i,
  32808. id: s(this.tn.next(), !0)
  32809. };
  32810. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32811. options: {}
  32812. }),
  32813. this.tn.skip(";"),
  32814. t.values.push(n)
  32815. }
  32816. this.tn.omit(";"),
  32817. e.enums.push(t)
  32818. }
  32819. ,
  32820. c._parseExtensionRanges = function() {
  32821. var e, t, i, n = [];
  32822. do {
  32823. for (t = []; ; ) {
  32824. switch (e = this.tn.next()) {
  32825. case "min":
  32826. i = r.ID_MIN;
  32827. break;
  32828. case "max":
  32829. i = r.ID_MAX;
  32830. break;
  32831. default:
  32832. i = o(e)
  32833. }
  32834. if (t.push(i),
  32835. 2 === t.length)
  32836. break;
  32837. if ("to" !== this.tn.peek()) {
  32838. t.push(i);
  32839. break
  32840. }
  32841. this.tn.next()
  32842. }
  32843. n.push(t)
  32844. } while (this.tn.omit(","));return this.tn.skip(";"),
  32845. n
  32846. }
  32847. ,
  32848. c._parseExtend = function(e) {
  32849. var t = this.tn.next();
  32850. if (!a.TYPEREF.test(t))
  32851. throw Error("illegal extend reference: " + t);
  32852. var i = {
  32853. ref: t,
  32854. fields: []
  32855. };
  32856. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32857. if (a.RULE.test(t))
  32858. this._parseMessageField(i, t);
  32859. else {
  32860. if (!a.TYPEREF.test(t))
  32861. throw Error("illegal extend token: " + t);
  32862. if (!this.proto3)
  32863. throw Error("illegal field rule: " + t);
  32864. this._parseMessageField(i, "optional", t)
  32865. }
  32866. return this.tn.omit(";"),
  32867. e.messages.push(i),
  32868. i
  32869. }
  32870. ,
  32871. c.toString = function() {
  32872. return "Parser at line " + this.tn.line
  32873. }
  32874. ,
  32875. e.Parser = l,
  32876. e
  32877. }(o, o.Lang),
  32878. o.Reflect = function(g) {
  32879. function a(e, t) {
  32880. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32881. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32882. if ("string" == typeof e)
  32883. return g.Long.fromString(e, t || !1, 10);
  32884. if ("number" == typeof e)
  32885. return g.Long.fromNumber(e, t || !1);
  32886. throw Error("not convertible to Long")
  32887. }
  32888. function m(e, t) {
  32889. var i = t.readVarint32()
  32890. , n = 7 & i
  32891. , r = i >>> 3;
  32892. switch (n) {
  32893. case g.WIRE_TYPES.VARINT:
  32894. for (; 128 == (128 & (i = t.readUint8())); )
  32895. ;
  32896. break;
  32897. case g.WIRE_TYPES.BITS64:
  32898. t.offset += 8;
  32899. break;
  32900. case g.WIRE_TYPES.LDELIM:
  32901. i = t.readVarint32(),
  32902. t.offset += i;
  32903. break;
  32904. case g.WIRE_TYPES.STARTGROUP:
  32905. m(r, t);
  32906. break;
  32907. case g.WIRE_TYPES.ENDGROUP:
  32908. if (r === e)
  32909. return !1;
  32910. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32911. case g.WIRE_TYPES.BITS32:
  32912. t.offset += 4;
  32913. break;
  32914. default:
  32915. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32916. }
  32917. return !0
  32918. }
  32919. function h(e, t, i) {
  32920. this.builder = e,
  32921. this.parent = t,
  32922. this.name = i,
  32923. this.className
  32924. }
  32925. var s = {}
  32926. , e = h.prototype;
  32927. e.fqn = function() {
  32928. for (var e = this.name, t = this; null != (t = t.parent); )
  32929. e = t.name + "." + e;
  32930. return e
  32931. }
  32932. ,
  32933. e.toString = function(e) {
  32934. return (e ? this.className + " " : "") + this.fqn()
  32935. }
  32936. ,
  32937. e.build = function() {
  32938. throw Error(this.toString(!0) + " cannot be built directly")
  32939. }
  32940. ,
  32941. s.T = h;
  32942. function l(e, t, i, n, r) {
  32943. h.call(this, e, t, i),
  32944. this.className = "Namespace",
  32945. this.children = [],
  32946. this.options = n || {},
  32947. this.syntax = r || "proto2"
  32948. }
  32949. var t = l.prototype = Object.create(h.prototype);
  32950. t.getChildren = function(e) {
  32951. if (null == (e = e || null))
  32952. return this.children.slice();
  32953. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32954. this.children[i]instanceof e && t.push(this.children[i]);
  32955. return t
  32956. }
  32957. ,
  32958. t.addChild = function(e) {
  32959. var t;
  32960. if (t = this.getChild(e.name))
  32961. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32962. t.name = t.originalName;
  32963. else {
  32964. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32965. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32966. e.name = e.originalName
  32967. }
  32968. this.children.push(e)
  32969. }
  32970. ,
  32971. t.getChild = function(e) {
  32972. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32973. if (this.children[i][t] === e)
  32974. return this.children[i];
  32975. return null
  32976. }
  32977. ,
  32978. t.resolve = function(e, t) {
  32979. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32980. if ("" === n[o]) {
  32981. for (; null !== r.parent; )
  32982. r = r.parent;
  32983. o++
  32984. }
  32985. do {
  32986. do {
  32987. if (!(r instanceof s.Namespace)) {
  32988. r = null;
  32989. break
  32990. }
  32991. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32992. r = null;
  32993. break
  32994. }
  32995. r = i,
  32996. o++
  32997. } while (o < n.length);if (null != r)
  32998. break;
  32999. if (null !== this.parent)
  33000. return this.parent.resolve(e, t)
  33001. } while (null != r);return r
  33002. }
  33003. ,
  33004. t.qn = function(e) {
  33005. for (var t = [], i = e; t.unshift(i.name),
  33006. null !== (i = i.parent); )
  33007. ;
  33008. for (var n = 1; n <= t.length; n++) {
  33009. var r = t.slice(t.length - n);
  33010. if (e === this.resolve(r, e instanceof s.Namespace))
  33011. return r.join(".")
  33012. }
  33013. return e.fqn()
  33014. }
  33015. ,
  33016. t.build = function() {
  33017. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33018. (e = i[n])instanceof l && (t[e.name] = e.build());
  33019. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33020. value: this.buildOpt()
  33021. }),
  33022. t
  33023. }
  33024. ,
  33025. t.buildOpt = function() {
  33026. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33027. var r = t[i]
  33028. , o = this.options[t[i]];
  33029. e[r] = o
  33030. }
  33031. return e
  33032. }
  33033. ,
  33034. t.getOption = function(e) {
  33035. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33036. }
  33037. ,
  33038. s.Namespace = l;
  33039. function u(e, t, i, n) {
  33040. if (this.type = e,
  33041. this.resolvedType = t,
  33042. this.isMapKey = i,
  33043. this.syntax = n,
  33044. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33045. throw Error("Invalid map key type: " + e.name)
  33046. }
  33047. var i = u.prototype;
  33048. u.defaultFieldValue = function(e) {
  33049. if ("string" == typeof e && (e = g.TYPES[e]),
  33050. void 0 === e.defaultValue)
  33051. throw Error("default value for type " + e.name + " is not supported");
  33052. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33053. }
  33054. ,
  33055. i.verifyValue = function(t) {
  33056. function i(e, t) {
  33057. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33058. }
  33059. var n = this;
  33060. switch (this.type) {
  33061. case g.TYPES.int32:
  33062. case g.TYPES.sint32:
  33063. case g.TYPES.sfixed32:
  33064. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33065. 4294967295 < t ? 0 | t : t;
  33066. case g.TYPES.uint32:
  33067. case g.TYPES.fixed32:
  33068. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33069. t < 0 ? t >>> 0 : t;
  33070. case g.TYPES.int64:
  33071. case g.TYPES.sint64:
  33072. case g.TYPES.sfixed64:
  33073. if (g.Long)
  33074. try {
  33075. return a(t, !1)
  33076. } catch (e) {
  33077. i(typeof t, e.message)
  33078. }
  33079. else
  33080. i(typeof t, "requires Long.js");
  33081. case g.TYPES.uint64:
  33082. case g.TYPES.fixed64:
  33083. if (g.Long)
  33084. try {
  33085. return a(t, !0)
  33086. } catch (e) {
  33087. i(typeof t, e.message)
  33088. }
  33089. else
  33090. i(typeof t, "requires Long.js");
  33091. case g.TYPES.bool:
  33092. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33093. t;
  33094. case g.TYPES.float:
  33095. case g.TYPES.double:
  33096. return "number" != typeof t && i(typeof t, "not a number"),
  33097. t;
  33098. case g.TYPES.string:
  33099. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33100. "" + t;
  33101. case g.TYPES.bytes:
  33102. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33103. case g.TYPES.enum:
  33104. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33105. for (o = 0; o < e.length; o++) {
  33106. if (e[o].name == t)
  33107. return e[o].id;
  33108. if (e[o].id == t)
  33109. return e[o].id
  33110. }
  33111. if ("proto3" === this.syntax)
  33112. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33113. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33114. t;
  33115. i(t, "not a valid enum value");
  33116. case g.TYPES.group:
  33117. case g.TYPES.message:
  33118. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33119. t instanceof this.resolvedType.clazz)
  33120. return t;
  33121. if (t instanceof g.Builder.Message) {
  33122. var r = {};
  33123. for (var o in t)
  33124. t.hasOwnProperty(o) && (r[o] = t[o]);
  33125. t = r
  33126. }
  33127. return new this.resolvedType.clazz(t)
  33128. }
  33129. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33130. }
  33131. ,
  33132. i.calculateLength = function(e, t) {
  33133. if (null === t)
  33134. return 0;
  33135. var i;
  33136. switch (this.type) {
  33137. case g.TYPES.int32:
  33138. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33139. case g.TYPES.uint32:
  33140. return I.calculateVarint32(t);
  33141. case g.TYPES.sint32:
  33142. return I.calculateVarint32(I.zigZagEncode32(t));
  33143. case g.TYPES.fixed32:
  33144. case g.TYPES.sfixed32:
  33145. case g.TYPES.float:
  33146. return 4;
  33147. case g.TYPES.int64:
  33148. case g.TYPES.uint64:
  33149. return I.calculateVarint64(t);
  33150. case g.TYPES.sint64:
  33151. return I.calculateVarint64(I.zigZagEncode64(t));
  33152. case g.TYPES.fixed64:
  33153. case g.TYPES.sfixed64:
  33154. return 8;
  33155. case g.TYPES.bool:
  33156. return 1;
  33157. case g.TYPES.enum:
  33158. return I.calculateVarint32(t);
  33159. case g.TYPES.double:
  33160. return 8;
  33161. case g.TYPES.string:
  33162. return i = I.calculateUTF8Bytes(t),
  33163. I.calculateVarint32(i) + i;
  33164. case g.TYPES.bytes:
  33165. if (t.remaining() < 0)
  33166. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33167. return I.calculateVarint32(t.remaining()) + t.remaining();
  33168. case g.TYPES.message:
  33169. return i = this.resolvedType.calculate(t),
  33170. I.calculateVarint32(i) + i;
  33171. case g.TYPES.group:
  33172. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33173. }
  33174. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33175. }
  33176. ,
  33177. i.encodeValue = function(e, t, i) {
  33178. if (null === t)
  33179. return i;
  33180. switch (this.type) {
  33181. case g.TYPES.int32:
  33182. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33183. break;
  33184. case g.TYPES.uint32:
  33185. i.writeVarint32(t);
  33186. break;
  33187. case g.TYPES.sint32:
  33188. i.writeVarint32ZigZag(t);
  33189. break;
  33190. case g.TYPES.fixed32:
  33191. i.writeUint32(t);
  33192. break;
  33193. case g.TYPES.sfixed32:
  33194. i.writeInt32(t);
  33195. break;
  33196. case g.TYPES.int64:
  33197. case g.TYPES.uint64:
  33198. i.writeVarint64(t);
  33199. break;
  33200. case g.TYPES.sint64:
  33201. i.writeVarint64ZigZag(t);
  33202. break;
  33203. case g.TYPES.fixed64:
  33204. i.writeUint64(t);
  33205. break;
  33206. case g.TYPES.sfixed64:
  33207. i.writeInt64(t);
  33208. break;
  33209. case g.TYPES.bool:
  33210. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33211. break;
  33212. case g.TYPES.enum:
  33213. i.writeVarint32(t);
  33214. break;
  33215. case g.TYPES.float:
  33216. i.writeFloat32(t);
  33217. break;
  33218. case g.TYPES.double:
  33219. i.writeFloat64(t);
  33220. break;
  33221. case g.TYPES.string:
  33222. i.writeVString(t);
  33223. break;
  33224. case g.TYPES.bytes:
  33225. if (t.remaining() < 0)
  33226. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33227. var n = t.offset;
  33228. i.writeVarint32(t.remaining()),
  33229. i.append(t),
  33230. t.offset = n;
  33231. break;
  33232. case g.TYPES.message:
  33233. var r = (new I).LE();
  33234. this.resolvedType.encode(t, r),
  33235. i.writeVarint32(r.offset),
  33236. i.append(r.flip());
  33237. break;
  33238. case g.TYPES.group:
  33239. this.resolvedType.encode(t, i),
  33240. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33241. break;
  33242. default:
  33243. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33244. }
  33245. return i
  33246. }
  33247. ,
  33248. i.decode = function(e, t, i) {
  33249. if (t != this.type.wireType)
  33250. throw Error("Unexpected wire type for element");
  33251. var n, r;
  33252. switch (this.type) {
  33253. case g.TYPES.int32:
  33254. return 0 | e.readVarint32();
  33255. case g.TYPES.uint32:
  33256. return e.readVarint32() >>> 0;
  33257. case g.TYPES.sint32:
  33258. return 0 | e.readVarint32ZigZag();
  33259. case g.TYPES.fixed32:
  33260. return e.readUint32() >>> 0;
  33261. case g.TYPES.sfixed32:
  33262. return 0 | e.readInt32();
  33263. case g.TYPES.int64:
  33264. return e.readVarint64();
  33265. case g.TYPES.uint64:
  33266. return e.readVarint64().toUnsigned();
  33267. case g.TYPES.sint64:
  33268. return e.readVarint64ZigZag();
  33269. case g.TYPES.fixed64:
  33270. return e.readUint64();
  33271. case g.TYPES.sfixed64:
  33272. return e.readInt64();
  33273. case g.TYPES.bool:
  33274. return !!e.readVarint32();
  33275. case g.TYPES.enum:
  33276. return e.readVarint32();
  33277. case g.TYPES.float:
  33278. return e.readFloat();
  33279. case g.TYPES.double:
  33280. return e.readDouble();
  33281. case g.TYPES.string:
  33282. return e.readVString();
  33283. case g.TYPES.bytes:
  33284. if (r = e.readVarint32(),
  33285. e.remaining() < r)
  33286. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33287. return (n = e.clone()).limit = n.offset + r,
  33288. e.offset += r,
  33289. n;
  33290. case g.TYPES.message:
  33291. return r = e.readVarint32(),
  33292. this.resolvedType.decode(e, r);
  33293. case g.TYPES.group:
  33294. return this.resolvedType.decode(e, -1, i)
  33295. }
  33296. throw Error("[INTERNAL] Illegal decode type")
  33297. }
  33298. ,
  33299. i.valueFromString = function(e) {
  33300. if (!this.isMapKey)
  33301. throw Error("valueFromString() called on non-map-key element");
  33302. switch (this.type) {
  33303. case g.TYPES.int32:
  33304. case g.TYPES.sint32:
  33305. case g.TYPES.sfixed32:
  33306. case g.TYPES.uint32:
  33307. case g.TYPES.fixed32:
  33308. return this.verifyValue(parseInt(e));
  33309. case g.TYPES.int64:
  33310. case g.TYPES.sint64:
  33311. case g.TYPES.sfixed64:
  33312. case g.TYPES.uint64:
  33313. case g.TYPES.fixed64:
  33314. return this.verifyValue(e);
  33315. case g.TYPES.bool:
  33316. return "true" === e;
  33317. case g.TYPES.string:
  33318. return this.verifyValue(e);
  33319. case g.TYPES.bytes:
  33320. return I.fromBinary(e)
  33321. }
  33322. }
  33323. ,
  33324. i.valueToString = function(e) {
  33325. if (!this.isMapKey)
  33326. throw Error("valueToString() called on non-map-key element");
  33327. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33328. }
  33329. ,
  33330. s.Element = u;
  33331. var d = function(e, t, i, n, r, o) {
  33332. l.call(this, e, t, i, n, o),
  33333. this.className = "Message",
  33334. this.extensions = void 0,
  33335. this.clazz = null,
  33336. this.isGroup = !!r,
  33337. this._fields = null,
  33338. this._fieldsById = null,
  33339. this._fieldsByName = null
  33340. }
  33341. , n = d.prototype = Object.create(l.prototype);
  33342. n.build = function(e) {
  33343. if (this.clazz && !e)
  33344. return this.clazz;
  33345. var t = function(u, a) {
  33346. function d(e, i, n, r) {
  33347. if (null === e || "object" != typeof e) {
  33348. if (r && r instanceof u.Reflect.Enum) {
  33349. var t = u.Reflect.Enum.getName(r.object, e);
  33350. if (null !== t)
  33351. return t
  33352. }
  33353. return e
  33354. }
  33355. if (I.isByteBuffer(e))
  33356. return i ? e.toBase64() : e.toBuffer();
  33357. if (u.Long.isLong(e))
  33358. return n ? e.toString() : u.Long.fromValue(e);
  33359. var o;
  33360. if (Array.isArray(e))
  33361. return o = [],
  33362. e.forEach(function(e, t) {
  33363. o[t] = d(e, i, n, r)
  33364. }),
  33365. o;
  33366. if (o = {},
  33367. e instanceof u.Map) {
  33368. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33369. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33370. return o
  33371. }
  33372. var l = e.$type
  33373. , c = void 0;
  33374. for (var h in e)
  33375. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33376. return o
  33377. }
  33378. var s = a.getChildren(u.Reflect.Message.Field)
  33379. , l = a.getChildren(u.Reflect.Message.OneOf)
  33380. , c = function(e, t) {
  33381. u.Builder.Message.call(this);
  33382. for (var i = 0, n = l.length; i < n; ++i)
  33383. this[l[i].name] = null;
  33384. for (i = 0,
  33385. n = s.length; i < n; ++i) {
  33386. var r = s[i];
  33387. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33388. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33389. }
  33390. var o;
  33391. if (0 < arguments.length)
  33392. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  33393. for (i = 0,
  33394. n = arguments.length; i < n; ++i)
  33395. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33396. else
  33397. this.$set(e)
  33398. }
  33399. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33400. o.add = function(e, t, i) {
  33401. var n = a._fieldsByName[e];
  33402. if (!i) {
  33403. if (!n)
  33404. throw Error(this + "#" + e + " is undefined");
  33405. if (!(n instanceof u.Reflect.Message.Field))
  33406. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33407. if (!n.repeated)
  33408. throw Error(this + "#" + e + " is not a repeated field");
  33409. t = n.verifyValue(t, !0)
  33410. }
  33411. return null === this[e] && (this[e] = []),
  33412. this[e].push(t),
  33413. this
  33414. }
  33415. ,
  33416. o.$add = o.add,
  33417. o.set = function(e, t, i) {
  33418. if (e && "object" == typeof e) {
  33419. for (var n in i = t,
  33420. e)
  33421. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33422. return this
  33423. }
  33424. var r = a._fieldsByName[e];
  33425. if (i)
  33426. this[e] = t;
  33427. else {
  33428. if (!r)
  33429. throw Error(this + "#" + e + " is not a field: undefined");
  33430. if (!(r instanceof u.Reflect.Message.Field))
  33431. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33432. this[r.name] = t = r.verifyValue(t)
  33433. }
  33434. if (r && r.oneof) {
  33435. var o = this[r.oneof.name];
  33436. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33437. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33438. }
  33439. return this
  33440. }
  33441. ,
  33442. o.$set = o.set,
  33443. o.get = function(e, t) {
  33444. if (t)
  33445. return this[e];
  33446. var i = a._fieldsByName[e];
  33447. if (!(i && i instanceof u.Reflect.Message.Field))
  33448. throw Error(this + "#" + e + " is not a field: undefined");
  33449. if (!(i instanceof u.Reflect.Message.Field))
  33450. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33451. return this[i.name]
  33452. }
  33453. ,
  33454. o.$get = o.get;
  33455. for (var e = 0; e < s.length; e++) {
  33456. var t = s[e];
  33457. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33458. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33459. return e.toUpperCase().replace("_", "")
  33460. });
  33461. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33462. function t(e, t) {
  33463. return this[i.name] = t ? e : i.verifyValue(e),
  33464. this
  33465. }
  33466. function n() {
  33467. return this[i.name]
  33468. }
  33469. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33470. return "_" + e
  33471. });
  33472. null === a.getChild("set" + e) && (o["set" + e] = t),
  33473. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33474. null === a.getChild("get" + e) && (o["get" + e] = n),
  33475. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33476. }(t)
  33477. }
  33478. return o.encode = function(t, e) {
  33479. "boolean" == typeof t && (e = t,
  33480. t = void 0);
  33481. var i = !1;
  33482. t || (t = new I,
  33483. i = !0);
  33484. var n = t.littleEndian;
  33485. try {
  33486. return a.encode(this, t.LE(), e),
  33487. (i ? t.flip() : t).LE(n)
  33488. } catch (e) {
  33489. throw t.LE(n),
  33490. e
  33491. }
  33492. }
  33493. ,
  33494. c.encode = function(e, t, i) {
  33495. return new c(e).encode(t, i)
  33496. }
  33497. ,
  33498. o.calculate = function() {
  33499. return a.calculate(this)
  33500. }
  33501. ,
  33502. o.encodeDelimited = function(e, t) {
  33503. var i = !1;
  33504. e || (e = new I,
  33505. i = !0);
  33506. var n = (new I).LE();
  33507. return a.encode(this, n, t).flip(),
  33508. e.writeVarint32(n.remaining()),
  33509. e.append(n),
  33510. i ? e.flip() : e
  33511. }
  33512. ,
  33513. o.encodeAB = function() {
  33514. try {
  33515. return this.encode().toArrayBuffer()
  33516. } catch (e) {
  33517. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33518. e
  33519. }
  33520. }
  33521. ,
  33522. o.toArrayBuffer = o.encodeAB,
  33523. o.encodeNB = function() {
  33524. try {
  33525. return this.encode().toBuffer()
  33526. } catch (e) {
  33527. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33528. e
  33529. }
  33530. }
  33531. ,
  33532. o.toBuffer = o.encodeNB,
  33533. o.encode64 = function() {
  33534. try {
  33535. return this.encode().toBase64()
  33536. } catch (e) {
  33537. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33538. e
  33539. }
  33540. }
  33541. ,
  33542. o.toBase64 = o.encode64,
  33543. o.encodeHex = function() {
  33544. try {
  33545. return this.encode().toHex()
  33546. } catch (e) {
  33547. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33548. e
  33549. }
  33550. }
  33551. ,
  33552. o.toHex = o.encodeHex,
  33553. o.toRaw = function(e, t) {
  33554. return d(this, !!e, !!t, this.$type)
  33555. }
  33556. ,
  33557. o.encodeJSON = function() {
  33558. return JSON.stringify(d(this, !0, !0, this.$type))
  33559. }
  33560. ,
  33561. c.decode = function(t, e, i) {
  33562. "string" == typeof e && (i = e,
  33563. e = -1),
  33564. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33565. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33566. try {
  33567. var r = a.decode(t.LE());
  33568. return t.LE(n),
  33569. r
  33570. } catch (e) {
  33571. throw t.LE(n),
  33572. e
  33573. }
  33574. }
  33575. ,
  33576. c.decodeDelimited = function(t, e) {
  33577. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33578. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33579. return null;
  33580. var i = t.offset
  33581. , n = t.readVarint32();
  33582. if (t.remaining() < n)
  33583. return t.offset = i,
  33584. null;
  33585. try {
  33586. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33587. return t.offset += n,
  33588. r
  33589. } catch (e) {
  33590. throw t.offset += n,
  33591. e
  33592. }
  33593. }
  33594. ,
  33595. c.decode64 = function(e) {
  33596. return c.decode(e, "base64")
  33597. }
  33598. ,
  33599. c.decodeHex = function(e) {
  33600. return c.decode(e, "hex")
  33601. }
  33602. ,
  33603. c.decodeJSON = function(e) {
  33604. return new c(JSON.parse(e))
  33605. }
  33606. ,
  33607. o.toString = function() {
  33608. return a.toString()
  33609. }
  33610. ,
  33611. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33612. value: a.buildOpt()
  33613. }),
  33614. Object.defineProperty(o, "$options", {
  33615. value: c.$options
  33616. }),
  33617. Object.defineProperty(c, "$type", {
  33618. value: a
  33619. }),
  33620. Object.defineProperty(o, "$type", {
  33621. value: a
  33622. })),
  33623. c
  33624. }(g, this);
  33625. this._fields = [],
  33626. this._fieldsById = {},
  33627. this._fieldsByName = {};
  33628. for (var i, n = 0, r = this.children.length; n < r; n++)
  33629. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33630. if (t.hasOwnProperty(i.name))
  33631. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33632. t[i.name] = i.build()
  33633. } else if (i instanceof d.Field)
  33634. i.build(),
  33635. this._fields.push(i),
  33636. this._fieldsById[i.id] = i,
  33637. this._fieldsByName[i.name] = i;
  33638. else if (!(i instanceof d.OneOf || i instanceof v))
  33639. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33640. return this.clazz = t
  33641. }
  33642. ,
  33643. n.encode = function(e, t, i) {
  33644. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33645. r = e[(n = this._fields[a]).name],
  33646. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33647. if (null === o)
  33648. return t;
  33649. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33650. throw l.encoded = t,
  33651. l
  33652. }
  33653. ,
  33654. n.calculate = function(e) {
  33655. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33656. if (i = e[(t = this._fields[r]).name],
  33657. t.required && null === i)
  33658. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33659. n += t.calculate(i, e)
  33660. }
  33661. return n
  33662. }
  33663. ,
  33664. n.decode = function(e, t, i) {
  33665. t = "number" == typeof t ? t : -1;
  33666. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33667. if (o = (n = e.readVarint32()) >>> 3,
  33668. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33669. if (o !== i)
  33670. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33671. break
  33672. }
  33673. if (a = this._fieldsById[o]) {
  33674. if (a.repeated && !a.options.packed)
  33675. l[a.name].push(a.decode(r, e));
  33676. else if (a.map) {
  33677. var c = a.decode(r, e);
  33678. l[a.name].set(c[0], c[1])
  33679. } else if (l[a.name] = a.decode(r, e),
  33680. a.oneof) {
  33681. var h = l[a.oneof.name];
  33682. null !== h && h !== a.name && (l[h] = null),
  33683. l[a.oneof.name] = a.name
  33684. }
  33685. } else
  33686. switch (r) {
  33687. case g.WIRE_TYPES.VARINT:
  33688. e.readVarint32();
  33689. break;
  33690. case g.WIRE_TYPES.BITS32:
  33691. e.offset += 4;
  33692. break;
  33693. case g.WIRE_TYPES.BITS64:
  33694. e.offset += 8;
  33695. break;
  33696. case g.WIRE_TYPES.LDELIM:
  33697. var u = e.readVarint32();
  33698. e.offset += u;
  33699. break;
  33700. case g.WIRE_TYPES.STARTGROUP:
  33701. for (; m(o, e); )
  33702. ;
  33703. break;
  33704. default:
  33705. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33706. }
  33707. }
  33708. for (var d = 0, p = this._fields.length; d < p; ++d)
  33709. if (null === l[(a = this._fields[d]).name])
  33710. if ("proto3" === this.syntax)
  33711. l[a.name] = a.defaultValue;
  33712. else {
  33713. if (a.required) {
  33714. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33715. throw f.decoded = l,
  33716. f
  33717. }
  33718. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33719. }
  33720. return l
  33721. }
  33722. ,
  33723. s.Message = d;
  33724. function c(e, t, i, n, r, o, a, s, l, c) {
  33725. h.call(this, e, t, o),
  33726. this.className = "Message.Field",
  33727. this.required = "required" === i,
  33728. this.repeated = "repeated" === i,
  33729. this.map = "map" === i,
  33730. this.keyType = n || null,
  33731. this.type = r,
  33732. this.resolvedType = null,
  33733. this.id = a,
  33734. this.options = s || {},
  33735. this.defaultValue = null,
  33736. this.oneof = l || null,
  33737. this.syntax = c || "proto2",
  33738. this.originalName = this.name,
  33739. this.element = null,
  33740. this.keyElement = null,
  33741. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33742. }
  33743. var r = c.prototype = Object.create(h.prototype);
  33744. r.build = function() {
  33745. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33746. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33747. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  33748. }
  33749. ,
  33750. r.verifyValue = function(e, t) {
  33751. function i(e, t) {
  33752. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33753. }
  33754. t = t || !1;
  33755. var n, r = this;
  33756. if (null === e)
  33757. return this.required && i(typeof e, "required"),
  33758. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33759. null;
  33760. if (!this.repeated || t)
  33761. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33762. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33763. this.element.verifyValue(e));
  33764. Array.isArray(e) || (e = [e]);
  33765. var o = [];
  33766. for (n = 0; n < e.length; n++)
  33767. o.push(this.element.verifyValue(e[n]));
  33768. return o
  33769. }
  33770. ,
  33771. r.hasWirePresence = function(e, t) {
  33772. if ("proto3" !== this.syntax)
  33773. return null !== e;
  33774. if (this.oneof && t[this.oneof.name] === this.name)
  33775. return !0;
  33776. switch (this.type) {
  33777. case g.TYPES.int32:
  33778. case g.TYPES.sint32:
  33779. case g.TYPES.sfixed32:
  33780. case g.TYPES.uint32:
  33781. case g.TYPES.fixed32:
  33782. return 0 !== e;
  33783. case g.TYPES.int64:
  33784. case g.TYPES.sint64:
  33785. case g.TYPES.sfixed64:
  33786. case g.TYPES.uint64:
  33787. case g.TYPES.fixed64:
  33788. return 0 !== e.low || 0 !== e.high;
  33789. case g.TYPES.bool:
  33790. return e;
  33791. case g.TYPES.float:
  33792. case g.TYPES.double:
  33793. return 0 !== e;
  33794. case g.TYPES.string:
  33795. return 0 < e.length;
  33796. case g.TYPES.bytes:
  33797. return 0 < e.remaining();
  33798. case g.TYPES.enum:
  33799. return 0 !== e;
  33800. case g.TYPES.message:
  33801. return null !== e;
  33802. default:
  33803. return !0
  33804. }
  33805. }
  33806. ,
  33807. r.encode = function(t, r, e) {
  33808. if (null === this.type || "object" != typeof this.type)
  33809. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33810. if (null === t || this.repeated && 0 == t.length)
  33811. return r;
  33812. try {
  33813. var i;
  33814. if (this.repeated)
  33815. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33816. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33817. r.ensureCapacity(r.offset += 1);
  33818. var n = r.offset;
  33819. for (i = 0; i < t.length; i++)
  33820. this.element.encodeValue(this.id, t[i], r);
  33821. var o = r.offset - n
  33822. , a = I.calculateVarint32(o);
  33823. if (1 < a) {
  33824. var s = r.slice(n, r.offset);
  33825. n += a - 1,
  33826. r.offset = n,
  33827. r.append(s)
  33828. }
  33829. r.writeVarint32(o, n - a)
  33830. } else
  33831. for (i = 0; i < t.length; i++)
  33832. r.writeVarint32(this.id << 3 | this.type.wireType),
  33833. this.element.encodeValue(this.id, t[i], r);
  33834. else
  33835. this.map ? t.forEach(function(e, t, i) {
  33836. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33837. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33838. r.writeVarint32(n),
  33839. r.writeVarint32(8 | this.keyType.wireType),
  33840. this.keyElement.encodeValue(1, t, r),
  33841. r.writeVarint32(16 | this.type.wireType),
  33842. this.element.encodeValue(2, e, r)
  33843. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33844. this.element.encodeValue(this.id, t, r))
  33845. } catch (e) {
  33846. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33847. }
  33848. return r
  33849. }
  33850. ,
  33851. r.calculate = function(t, e) {
  33852. if (t = this.verifyValue(t),
  33853. null === this.type || "object" != typeof this.type)
  33854. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33855. if (null === t || this.repeated && 0 == t.length)
  33856. return 0;
  33857. var r = 0;
  33858. try {
  33859. var i, n;
  33860. if (this.repeated)
  33861. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33862. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33863. i = n = 0; i < t.length; i++)
  33864. n += this.element.calculateLength(this.id, t[i]);
  33865. r += I.calculateVarint32(n),
  33866. r += n
  33867. } else
  33868. for (i = 0; i < t.length; i++)
  33869. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33870. r += this.element.calculateLength(this.id, t[i]);
  33871. else
  33872. this.map ? t.forEach(function(e, t, i) {
  33873. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33874. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33875. r += I.calculateVarint32(n),
  33876. r += n
  33877. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33878. r += this.element.calculateLength(this.id, t))
  33879. } catch (e) {
  33880. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33881. }
  33882. return r
  33883. }
  33884. ,
  33885. r.decode = function(e, t, i) {
  33886. var n, r;
  33887. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  33888. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33889. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33890. r = t.readVarint32(),
  33891. r = t.offset + r;
  33892. for (var o = []; t.offset < r; )
  33893. o.push(this.decode(this.type.wireType, t, !0));
  33894. return o
  33895. }
  33896. if (this.map) {
  33897. var a = u.defaultFieldValue(this.keyType);
  33898. if (n = u.defaultFieldValue(this.type),
  33899. r = t.readVarint32(),
  33900. t.remaining() < r)
  33901. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33902. var s = t.clone();
  33903. for (s.limit = s.offset + r,
  33904. t.offset += r; 0 < s.remaining(); ) {
  33905. var l = s.readVarint32();
  33906. e = 7 & l;
  33907. var c = l >>> 3;
  33908. if (1 == c)
  33909. a = this.keyElement.decode(s, e, c);
  33910. else {
  33911. if (2 != c)
  33912. throw Error("Unexpected tag in map field key/value submessage");
  33913. n = this.element.decode(s, e, c)
  33914. }
  33915. }
  33916. return [a, n]
  33917. }
  33918. return this.element.decode(t, e, this.id)
  33919. }
  33920. ,
  33921. s.Message.Field = c;
  33922. function o(e, t, i, n, r, o, a) {
  33923. c.call(this, e, t, i, null, n, r, o, a),
  33924. this.extension
  33925. }
  33926. o.prototype = Object.create(c.prototype),
  33927. s.Message.ExtensionField = o;
  33928. s.Message.OneOf = function(e, t, i) {
  33929. h.call(this, e, t, i),
  33930. this.fields = []
  33931. }
  33932. ;
  33933. var p = function(e, t, i, n, r) {
  33934. l.call(this, e, t, i, n, r),
  33935. this.className = "Enum",
  33936. this.object = null
  33937. };
  33938. p.getName = function(e, t) {
  33939. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33940. if (e[i = n[r]] === t)
  33941. return i;
  33942. return null
  33943. }
  33944. ,
  33945. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33946. if (this.object && !e)
  33947. return this.object;
  33948. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33949. t[i[n].name] = i[n].id;
  33950. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33951. value: this.buildOpt(),
  33952. enumerable: !1
  33953. }),
  33954. this.object = t
  33955. }
  33956. ,
  33957. s.Enum = p;
  33958. function f(e, t, i, n) {
  33959. h.call(this, e, t, i),
  33960. this.className = "Enum.Value",
  33961. this.id = n
  33962. }
  33963. f.prototype = Object.create(h.prototype),
  33964. s.Enum.Value = f;
  33965. var v = function(e, t, i, n) {
  33966. h.call(this, e, t, i),
  33967. this.field = n
  33968. };
  33969. v.prototype = Object.create(h.prototype),
  33970. s.Extension = v;
  33971. var y = function(e, t, i, n) {
  33972. l.call(this, e, t, i, n),
  33973. this.className = "Service",
  33974. this.clazz = null
  33975. };
  33976. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33977. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33978. for (var o = function(e) {
  33979. t.Builder.Service.call(this),
  33980. this.rpcImpl = e || function(e, t, i) {
  33981. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33982. }
  33983. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33984. !function(n) {
  33985. e[n.name] = function(e, i) {
  33986. try {
  33987. try {
  33988. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33989. } catch (e) {
  33990. if (!(e instanceof TypeError))
  33991. throw e
  33992. }
  33993. if (null === e || "object" != typeof e)
  33994. throw Error("Illegal arguments");
  33995. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33996. this.rpcImpl(n.fqn(), e, function(e, t) {
  33997. if (!e) {
  33998. null === t && (t = "");
  33999. try {
  34000. t = n.resolvedResponseType.clazz.decode(t)
  34001. } catch (e) {}
  34002. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  34003. }
  34004. i(e)
  34005. })
  34006. } catch (e) {
  34007. setTimeout(i.bind(this, e), 0)
  34008. }
  34009. }
  34010. ,
  34011. o[n.name] = function(e, t, i) {
  34012. new o(e)[n.name](t, i)
  34013. }
  34014. ,
  34015. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34016. value: n.buildOpt()
  34017. }),
  34018. Object.defineProperty(e[n.name], "$options", {
  34019. value: o[n.name].$options
  34020. }))
  34021. }(i[n]);
  34022. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34023. value: r.buildOpt()
  34024. }),
  34025. Object.defineProperty(e, "$options", {
  34026. value: o.$options
  34027. }),
  34028. Object.defineProperty(o, "$type", {
  34029. value: r
  34030. }),
  34031. Object.defineProperty(e, "$type", {
  34032. value: r
  34033. })),
  34034. o
  34035. }(g, this)
  34036. }
  34037. ,
  34038. s.Service = y;
  34039. function A(e, t, i, n) {
  34040. h.call(this, e, t, i),
  34041. this.className = "Service.Method",
  34042. this.options = n || {}
  34043. }
  34044. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34045. s.Service.Method = A;
  34046. function C(e, t, i, n, r, o, a, s) {
  34047. A.call(this, e, t, i, s),
  34048. this.className = "Service.RPCMethod",
  34049. this.requestName = n,
  34050. this.responseName = r,
  34051. this.requestStream = o,
  34052. this.responseStream = a,
  34053. this.resolvedRequestType = null,
  34054. this.resolvedResponseType = null
  34055. }
  34056. return C.prototype = Object.create(A.prototype),
  34057. s.Service.RPCMethod = C,
  34058. s
  34059. }(o),
  34060. o.Builder = (i = (u = o).Lang,
  34061. s = o.Reflect,
  34062. n = h.prototype,
  34063. h.isMessage = function(e) {
  34064. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34065. }
  34066. ,
  34067. h.isMessageField = function(e) {
  34068. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34069. }
  34070. ,
  34071. h.isEnum = function(e) {
  34072. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34073. }
  34074. ,
  34075. h.isService = function(e) {
  34076. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34077. }
  34078. ,
  34079. h.isExtend = function(e) {
  34080. return "string" == typeof e.ref
  34081. }
  34082. ,
  34083. n.reset = function() {
  34084. return this.ptr = this.ns,
  34085. this
  34086. }
  34087. ,
  34088. n.define = function(e) {
  34089. if ("string" != typeof e || !i.TYPEREF.test(e))
  34090. throw Error("illegal namespace: " + e);
  34091. return e.split(".").forEach(function(e) {
  34092. var t = this.ptr.getChild(e);
  34093. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34094. this.ptr = t
  34095. }, this),
  34096. this
  34097. }
  34098. ,
  34099. n.create = function(e) {
  34100. if (!e)
  34101. return this;
  34102. if (Array.isArray(e)) {
  34103. if (0 === e.length)
  34104. return this;
  34105. e = e.slice()
  34106. } else
  34107. e = [e];
  34108. for (var t = [e]; 0 < t.length; ) {
  34109. if (e = t.pop(),
  34110. !Array.isArray(e))
  34111. throw Error("not a valid namespace: " + JSON.stringify(e));
  34112. for (; 0 < e.length; ) {
  34113. var i = e.shift();
  34114. if (h.isMessage(i)) {
  34115. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34116. , n = {};
  34117. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34118. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34119. }, this),
  34120. i.fields && i.fields.forEach(function(e) {
  34121. if (null !== o.getChild(0 | e.id))
  34122. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34123. if (e.options && "object" != typeof e.options)
  34124. throw Error("illegal field options in " + o.name + "#" + e.name);
  34125. var t = null;
  34126. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34127. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34128. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34129. t && t.fields.push(e),
  34130. o.addChild(e)
  34131. }, this);
  34132. var r = [];
  34133. if (i.enums && i.enums.forEach(function(e) {
  34134. r.push(e)
  34135. }),
  34136. i.messages && i.messages.forEach(function(e) {
  34137. r.push(e)
  34138. }),
  34139. i.services && i.services.forEach(function(e) {
  34140. r.push(e)
  34141. }),
  34142. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34143. this.ptr.addChild(o),
  34144. 0 < r.length) {
  34145. t.push(e),
  34146. e = r,
  34147. r = null,
  34148. this.ptr = o,
  34149. o = null;
  34150. continue
  34151. }
  34152. r = null
  34153. } else if (h.isEnum(i))
  34154. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34155. i.values.forEach(function(e) {
  34156. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34157. }, this),
  34158. this.ptr.addChild(o);
  34159. else if (h.isService(i))
  34160. o = new s.Service(this,this.ptr,i.name,i.options),
  34161. Object.keys(i.rpc).forEach(function(e) {
  34162. var t = i.rpc[e];
  34163. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34164. }, this),
  34165. this.ptr.addChild(o);
  34166. else {
  34167. if (!h.isExtend(i))
  34168. throw Error("not a valid definition: " + JSON.stringify(i));
  34169. if (o = this.ptr.resolve(i.ref, !0))
  34170. i.fields.forEach(function(t) {
  34171. if (null !== o.getChild(0 | t.id))
  34172. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34173. if (o.extensions) {
  34174. var i = !1;
  34175. if (o.extensions.forEach(function(e) {
  34176. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34177. }),
  34178. !i)
  34179. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34180. }
  34181. var e = t.name;
  34182. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34183. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34184. , r = new s.Extension(this,this.ptr,t.name,n);
  34185. n.extension = r,
  34186. this.ptr.addChild(r),
  34187. o.addChild(n)
  34188. }, this);
  34189. else if (!/\.?google\.protobuf\./.test(i.ref))
  34190. throw Error("extended message " + i.ref + " is not defined")
  34191. }
  34192. o = i = null
  34193. }
  34194. e = null,
  34195. this.ptr = this.ptr.parent
  34196. }
  34197. return this.resolved = !1,
  34198. this.result = null,
  34199. this
  34200. }
  34201. ,
  34202. n.import = function(t, e) {
  34203. var i = "/";
  34204. if ("string" == typeof e) {
  34205. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34206. !0 === this.files[e])
  34207. return this.reset();
  34208. this.files[e] = !0
  34209. } else if ("object" == typeof e) {
  34210. var n = e.root;
  34211. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34212. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34213. var r = n + i + e.file;
  34214. if (!0 === this.files[r])
  34215. return this.reset();
  34216. this.files[r] = !0
  34217. }
  34218. if (t.imports && 0 < t.imports.length) {
  34219. var o, a = !1;
  34220. "object" == typeof e ? (this.importRoot = e.root,
  34221. a = !0,
  34222. o = this.importRoot,
  34223. e = e.file,
  34224. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  34225. i = "\\") : o = "." : o = null;
  34226. for (var s = 0; s < t.imports.length; s++)
  34227. if ("string" == typeof t.imports[s]) {
  34228. if (!o)
  34229. throw Error("cannot determine import root");
  34230. var l = t.imports[s];
  34231. if ("google/protobuf/descriptor.proto" === l)
  34232. continue;
  34233. if (l = o + i + l,
  34234. !0 === this.files[l])
  34235. continue;
  34236. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34237. var c = u.Util.fetch(l);
  34238. if (null === c)
  34239. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34240. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34241. } else
  34242. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34243. return t + "_import" + s + "." + i
  34244. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34245. a && (this.importRoot = null)
  34246. }
  34247. t.package && this.define(t.package),
  34248. t.syntax && function t(i) {
  34249. i.messages && i.messages.forEach(function(e) {
  34250. e.syntax = i.syntax,
  34251. t(e)
  34252. }),
  34253. i.enums && i.enums.forEach(function(e) {
  34254. e.syntax = i.syntax
  34255. })
  34256. }(t);
  34257. var h = this.ptr;
  34258. return t.options && Object.keys(t.options).forEach(function(e) {
  34259. h.options[e] = t.options[e]
  34260. }),
  34261. t.messages && (this.create(t.messages),
  34262. this.ptr = h),
  34263. t.enums && (this.create(t.enums),
  34264. this.ptr = h),
  34265. t.services && (this.create(t.services),
  34266. this.ptr = h),
  34267. t.extends && this.create(t.extends),
  34268. this.reset()
  34269. }
  34270. ,
  34271. n.resolveAll = function() {
  34272. var e;
  34273. if (null == this.ptr || "object" == typeof this.ptr.type)
  34274. return this;
  34275. if (this.ptr instanceof s.Namespace)
  34276. this.ptr.children.forEach(function(e) {
  34277. this.ptr = e,
  34278. this.resolveAll()
  34279. }, this);
  34280. else if (this.ptr instanceof s.Message.Field) {
  34281. if (i.TYPE.test(this.ptr.type))
  34282. this.ptr.type = u.TYPES[this.ptr.type];
  34283. else {
  34284. if (!i.TYPEREF.test(this.ptr.type))
  34285. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34286. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34287. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34288. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34289. if (this.ptr.type = u.TYPES.enum,
  34290. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34291. throw Error("proto3 message cannot reference proto2 enum")
  34292. } else {
  34293. if (!(e instanceof s.Message))
  34294. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34295. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34296. }
  34297. }
  34298. if (this.ptr.map) {
  34299. if (!i.TYPE.test(this.ptr.keyType))
  34300. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34301. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34302. }
  34303. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34304. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34305. throw Error("illegal service type in " + this.ptr.toString(!0));
  34306. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34307. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34308. if (this.ptr.resolvedRequestType = e,
  34309. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34310. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34311. this.ptr.resolvedResponseType = e
  34312. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34313. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34314. return this.reset()
  34315. }
  34316. ,
  34317. n.build = function(e) {
  34318. if (this.reset(),
  34319. this.resolved || (this.resolveAll(),
  34320. this.resolved = !0,
  34321. this.result = null),
  34322. null === this.result && (this.result = this.ns.build()),
  34323. !e)
  34324. return this.result;
  34325. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34326. if (!i[t[n]]) {
  34327. i = null;
  34328. break
  34329. }
  34330. i = i[t[n]]
  34331. }
  34332. return i
  34333. }
  34334. ,
  34335. n.lookup = function(e, t) {
  34336. return e ? this.ns.resolve(e, t) : this.ns
  34337. }
  34338. ,
  34339. n.toString = function() {
  34340. return "Builder"
  34341. }
  34342. ,
  34343. h.Message = function() {}
  34344. ,
  34345. h.Enum = function() {}
  34346. ,
  34347. h.Service = function() {}
  34348. ,
  34349. h),
  34350. o.Map = (a = o.Reflect,
  34351. (t = c.prototype).clear = function() {
  34352. this.map = {}
  34353. }
  34354. ,
  34355. t.delete = function(e) {
  34356. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34357. , i = t in this.map;
  34358. return delete this.map[t],
  34359. i
  34360. }
  34361. ,
  34362. t.entries = function() {
  34363. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34364. t.push([(e = this.map[i[n]]).key, e.value]);
  34365. return l(t)
  34366. }
  34367. ,
  34368. t.keys = function() {
  34369. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34370. e.push(this.map[t[i]].key);
  34371. return l(e)
  34372. }
  34373. ,
  34374. t.values = function() {
  34375. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34376. e.push(this.map[t[i]].value);
  34377. return l(e)
  34378. }
  34379. ,
  34380. t.forEach = function(e, t) {
  34381. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34382. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34383. }
  34384. ,
  34385. t.set = function(e, t) {
  34386. var i = this.keyElem.verifyValue(e)
  34387. , n = this.valueElem.verifyValue(t);
  34388. return this.map[this.keyElem.valueToString(i)] = {
  34389. key: i,
  34390. value: n
  34391. },
  34392. this
  34393. }
  34394. ,
  34395. t.get = function(e) {
  34396. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34397. if (t in this.map)
  34398. return this.map[t].value
  34399. }
  34400. ,
  34401. t.has = function(e) {
  34402. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34403. }
  34404. ,
  34405. c),
  34406. o.loadProto = function(e, t, i) {
  34407. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34408. t = void 0),
  34409. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34410. }
  34411. ,
  34412. o.protoFromString = o.loadProto,
  34413. o.loadProtoFile = function(t, i, n) {
  34414. if (i && "object" == typeof i ? (n = i,
  34415. i = null) : i && "function" == typeof i || (i = null),
  34416. i)
  34417. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34418. if (null !== e)
  34419. try {
  34420. i(null, o.loadProto(e, n, t))
  34421. } catch (e) {
  34422. i(e)
  34423. }
  34424. else
  34425. i(Error("Failed to fetch file"))
  34426. });
  34427. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34428. return null === e ? null : o.loadProto(e, n, t)
  34429. }
  34430. ,
  34431. o.protoFromFile = o.loadProtoFile,
  34432. o.newBuilder = function(e) {
  34433. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34434. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34435. new o.Builder(e)
  34436. }
  34437. ,
  34438. o.loadJson = function(e, t, i) {
  34439. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34440. t = null),
  34441. t && "object" == typeof t || (t = o.newBuilder()),
  34442. "string" == typeof e && (e = JSON.parse(e)),
  34443. t.import(e, i),
  34444. t.resolveAll(),
  34445. t
  34446. }
  34447. ,
  34448. o.loadJsonFile = function(t, i, n) {
  34449. if (i && "object" == typeof i ? (n = i,
  34450. i = null) : i && "function" == typeof i || (i = null),
  34451. i)
  34452. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34453. if (null !== e)
  34454. try {
  34455. i(null, o.loadJson(JSON.parse(e), n, t))
  34456. } catch (e) {
  34457. i(e)
  34458. }
  34459. else
  34460. i(Error("Failed to fetch file"))
  34461. });
  34462. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34463. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34464. }
  34465. ,
  34466. o;
  34467. function l(e) {
  34468. var t = 0;
  34469. return {
  34470. next: function() {
  34471. return t < e.length ? {
  34472. done: !1,
  34473. value: e[t++]
  34474. } : {
  34475. done: !0
  34476. }
  34477. }
  34478. }
  34479. }
  34480. function c(e, t) {
  34481. if (!e.map)
  34482. throw Error("field is not a map");
  34483. if (this.field = e,
  34484. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34485. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34486. this.map = {},
  34487. Object.defineProperty(this, "size", {
  34488. get: function() {
  34489. return Object.keys(this.map).length
  34490. }
  34491. }),
  34492. t)
  34493. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34494. var r = this.keyElem.valueFromString(i[n])
  34495. , o = this.valueElem.verifyValue(t[i[n]]);
  34496. this.map[this.keyElem.valueToString(r)] = {
  34497. key: r,
  34498. value: o
  34499. }
  34500. }
  34501. }
  34502. function h(e) {
  34503. this.ns = new s.Namespace(this,null,""),
  34504. this.ptr = this.ns,
  34505. this.resolved = !1,
  34506. this.result = null,
  34507. this.files = {},
  34508. this.importRoot = null,
  34509. this.options = e || {}
  34510. }
  34511. }
  34512. ,
  34513. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  34514. }
  34515. ).call(this, p("_process"))
  34516. }
  34517. , {
  34518. _process: 203,
  34519. bytebuffer: 215,
  34520. fs: 197,
  34521. path: 197
  34522. }],
  34523. 215: [function(t, e, i) {
  34524. var n, r;
  34525. n = this,
  34526. r = function(l) {
  34527. "use strict";
  34528. function s(e) {
  34529. var t = 0;
  34530. return function() {
  34531. return t < e.length ? e.charCodeAt(t++) : null
  34532. }
  34533. }
  34534. function c() {
  34535. var e = []
  34536. , t = [];
  34537. return function() {
  34538. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34539. e.length = 0),
  34540. void Array.prototype.push.apply(e, arguments))
  34541. }
  34542. }
  34543. function n(e, t, i, n, r) {
  34544. 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];
  34545. for (u += d,
  34546. o = p & (1 << -h) - 1,
  34547. p >>= -h,
  34548. h += s; 0 < h; o = 256 * o + e[t + u],
  34549. u += d,
  34550. h -= 8)
  34551. ;
  34552. for (a = o & (1 << -h) - 1,
  34553. o >>= -h,
  34554. h += n; 0 < h; a = 256 * a + e[t + u],
  34555. u += d,
  34556. h -= 8)
  34557. ;
  34558. if (0 === o)
  34559. o = 1 - c;
  34560. else {
  34561. if (o === l)
  34562. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34563. a += Math.pow(2, n),
  34564. o -= c
  34565. }
  34566. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34567. }
  34568. function r(e, t, i, n, r, o) {
  34569. 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;
  34570. for (t = Math.abs(t),
  34571. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34572. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34573. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34574. l *= 2),
  34575. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34576. l /= 2),
  34577. h <= a + u ? (s = 0,
  34578. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34579. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34580. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34581. p += f,
  34582. s /= 256,
  34583. r -= 8)
  34584. ;
  34585. for (a = a << r | s,
  34586. c += r; 0 < c; e[i + p] = 255 & a,
  34587. p += f,
  34588. a /= 256,
  34589. c -= 8)
  34590. ;
  34591. e[i + p - f] |= 128 * g
  34592. }
  34593. var f = function(e, t, i) {
  34594. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34595. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34596. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34597. !i) {
  34598. if ((e |= 0) < 0)
  34599. throw RangeError("Illegal capacity");
  34600. t = !!t,
  34601. i = !!i
  34602. }
  34603. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34604. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34605. this.offset = 0,
  34606. this.markedOffset = -1,
  34607. this.limit = e,
  34608. this.littleEndian = t,
  34609. this.noAssert = i
  34610. };
  34611. f.VERSION = "5.0.1",
  34612. f.LITTLE_ENDIAN = !0,
  34613. f.BIG_ENDIAN = !1,
  34614. f.DEFAULT_CAPACITY = 16,
  34615. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34616. f.DEFAULT_NOASSERT = !1,
  34617. f.Long = l || null;
  34618. var a = f.prototype;
  34619. a.__isByteBuffer__,
  34620. Object.defineProperty(a, "__isByteBuffer__", {
  34621. value: !0,
  34622. enumerable: !1,
  34623. configurable: !1
  34624. });
  34625. var o = new ArrayBuffer(0)
  34626. , i = String.fromCharCode;
  34627. f.accessor = function() {
  34628. return Uint8Array
  34629. }
  34630. ,
  34631. f.allocate = function(e, t, i) {
  34632. return new f(e,t,i)
  34633. }
  34634. ,
  34635. f.concat = function(e, t, i, n) {
  34636. "boolean" != typeof t && "string" == typeof t || (n = i,
  34637. i = t,
  34638. t = void 0);
  34639. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34640. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34641. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34642. if (0 === o)
  34643. return new f(0,i,n);
  34644. var l, c = new f(o,i,n);
  34645. for (a = 0; a < s; )
  34646. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34647. c.offset += r);
  34648. return c.limit = c.offset,
  34649. c.offset = 0,
  34650. c
  34651. }
  34652. ,
  34653. f.isByteBuffer = function(e) {
  34654. return !0 === (e && e.__isByteBuffer__)
  34655. }
  34656. ,
  34657. f.type = function() {
  34658. return ArrayBuffer
  34659. }
  34660. ,
  34661. f.wrap = function(e, t, i, n) {
  34662. if ("string" != typeof t && (n = i,
  34663. i = t,
  34664. t = void 0),
  34665. "string" == typeof e)
  34666. switch (void 0 === t && (t = "utf8"),
  34667. t) {
  34668. case "base64":
  34669. return f.fromBase64(e, i);
  34670. case "hex":
  34671. return f.fromHex(e, i);
  34672. case "binary":
  34673. return f.fromBinary(e, i);
  34674. case "utf8":
  34675. return f.fromUTF8(e, i);
  34676. case "debug":
  34677. return f.fromDebug(e, i);
  34678. default:
  34679. throw Error("Unsupported encoding: " + t)
  34680. }
  34681. if (null === e || "object" != typeof e)
  34682. throw TypeError("Illegal buffer");
  34683. var r;
  34684. if (f.isByteBuffer(e))
  34685. return (r = a.clone.call(e)).markedOffset = -1,
  34686. r;
  34687. if (e instanceof Uint8Array)
  34688. r = new f(0,i,n),
  34689. 0 < e.length && (r.buffer = e.buffer,
  34690. r.offset = e.byteOffset,
  34691. r.limit = e.byteOffset + e.byteLength,
  34692. r.view = new Uint8Array(e.buffer));
  34693. else if (e instanceof ArrayBuffer)
  34694. r = new f(0,i,n),
  34695. 0 < e.byteLength && (r.buffer = e,
  34696. r.offset = 0,
  34697. r.limit = e.byteLength,
  34698. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34699. else {
  34700. if ("[object Array]" !== Object.prototype.toString.call(e))
  34701. throw TypeError("Illegal buffer");
  34702. (r = new f(e.length,i,n)).limit = e.length;
  34703. for (var o = 0; o < e.length; ++o)
  34704. r.view[o] = e[o]
  34705. }
  34706. return r
  34707. }
  34708. ,
  34709. a.writeBitSet = function(e, t) {
  34710. var i = void 0 === t;
  34711. if (i && (t = this.offset),
  34712. !this.noAssert) {
  34713. if (!(e instanceof Array))
  34714. throw TypeError("Illegal BitSet: Not an array");
  34715. if ("number" != typeof t || t % 1 != 0)
  34716. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34717. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34718. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34719. }
  34720. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34721. for (t += this.writeVarint32(o, t); a--; )
  34722. 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,
  34723. this.writeByte(n, t++);
  34724. if (s < o) {
  34725. var l = 0;
  34726. for (n = 0; s < o; )
  34727. n |= (1 & !!e[s++]) << l++;
  34728. this.writeByte(n, t++)
  34729. }
  34730. return i ? (this.offset = t,
  34731. this) : t - r
  34732. }
  34733. ,
  34734. a.readBitSet = function(e) {
  34735. var t = void 0 === e;
  34736. t && (e = this.offset);
  34737. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34738. for (e += n.length; o--; )
  34739. i = this.readByte(e++),
  34740. s[a++] = !!(1 & i),
  34741. s[a++] = !!(2 & i),
  34742. s[a++] = !!(4 & i),
  34743. s[a++] = !!(8 & i),
  34744. s[a++] = !!(16 & i),
  34745. s[a++] = !!(32 & i),
  34746. s[a++] = !!(64 & i),
  34747. s[a++] = !!(128 & i);
  34748. if (a < r) {
  34749. var l = 0;
  34750. for (i = this.readByte(e++); a < r; )
  34751. s[a++] = !!(i >> l++ & 1)
  34752. }
  34753. return t && (this.offset = e),
  34754. s
  34755. }
  34756. ,
  34757. a.readBytes = function(e, t) {
  34758. var i = void 0 === t;
  34759. if (i && (t = this.offset),
  34760. !this.noAssert) {
  34761. if ("number" != typeof t || t % 1 != 0)
  34762. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34763. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34764. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34765. }
  34766. var n = this.slice(t, t + e);
  34767. return i && (this.offset += e),
  34768. n
  34769. }
  34770. ,
  34771. a.writeBytes = a.append,
  34772. a.writeInt8 = function(e, t) {
  34773. var i = void 0 === t;
  34774. if (i && (t = this.offset),
  34775. !this.noAssert) {
  34776. if ("number" != typeof e || e % 1 != 0)
  34777. throw TypeError("Illegal value: " + e + " (not an integer)");
  34778. if (e |= 0,
  34779. "number" != typeof t || t % 1 != 0)
  34780. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34781. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34782. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34783. }
  34784. t += 1;
  34785. var n = this.buffer.byteLength;
  34786. return n < t && this.resize((n *= 2) > t ? n : t),
  34787. t -= 1,
  34788. this.view[t] = e,
  34789. i && (this.offset += 1),
  34790. this
  34791. }
  34792. ,
  34793. a.writeByte = a.writeInt8,
  34794. a.readInt8 = function(e) {
  34795. var t = void 0 === e;
  34796. if (t && (e = this.offset),
  34797. !this.noAssert) {
  34798. if ("number" != typeof e || e % 1 != 0)
  34799. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34800. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34801. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34802. }
  34803. var i = this.view[e];
  34804. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34805. t && (this.offset += 1),
  34806. i
  34807. }
  34808. ,
  34809. a.readByte = a.readInt8,
  34810. a.writeUint8 = function(e, t) {
  34811. var i = void 0 === t;
  34812. if (i && (t = this.offset),
  34813. !this.noAssert) {
  34814. if ("number" != typeof e || e % 1 != 0)
  34815. throw TypeError("Illegal value: " + e + " (not an integer)");
  34816. if (e >>>= 0,
  34817. "number" != typeof t || t % 1 != 0)
  34818. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34819. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34820. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34821. }
  34822. t += 1;
  34823. var n = this.buffer.byteLength;
  34824. return n < t && this.resize((n *= 2) > t ? n : t),
  34825. t -= 1,
  34826. this.view[t] = e,
  34827. i && (this.offset += 1),
  34828. this
  34829. }
  34830. ,
  34831. a.writeUInt8 = a.writeUint8,
  34832. a.readUint8 = function(e) {
  34833. var t = void 0 === e;
  34834. if (t && (e = this.offset),
  34835. !this.noAssert) {
  34836. if ("number" != typeof e || e % 1 != 0)
  34837. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34838. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34839. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34840. }
  34841. var i = this.view[e];
  34842. return t && (this.offset += 1),
  34843. i
  34844. }
  34845. ,
  34846. a.readUInt8 = a.readUint8,
  34847. a.writeInt16 = function(e, t) {
  34848. var i = void 0 === t;
  34849. if (i && (t = this.offset),
  34850. !this.noAssert) {
  34851. if ("number" != typeof e || e % 1 != 0)
  34852. throw TypeError("Illegal value: " + e + " (not an integer)");
  34853. if (e |= 0,
  34854. "number" != typeof t || t % 1 != 0)
  34855. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34856. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34857. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34858. }
  34859. t += 2;
  34860. var n = this.buffer.byteLength;
  34861. return n < t && this.resize((n *= 2) > t ? n : t),
  34862. t -= 2,
  34863. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34864. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34865. this.view[t + 1] = 255 & e),
  34866. i && (this.offset += 2),
  34867. this
  34868. }
  34869. ,
  34870. a.writeShort = a.writeInt16,
  34871. a.readInt16 = function(e) {
  34872. var t = void 0 === e;
  34873. if (t && (e = this.offset),
  34874. !this.noAssert) {
  34875. if ("number" != typeof e || e % 1 != 0)
  34876. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34877. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34878. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34879. }
  34880. var i = 0;
  34881. return this.littleEndian ? (i = this.view[e],
  34882. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34883. i |= this.view[e + 1]),
  34884. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34885. t && (this.offset += 2),
  34886. i
  34887. }
  34888. ,
  34889. a.readShort = a.readInt16,
  34890. a.writeUint16 = function(e, t) {
  34891. var i = void 0 === t;
  34892. if (i && (t = this.offset),
  34893. !this.noAssert) {
  34894. if ("number" != typeof e || e % 1 != 0)
  34895. throw TypeError("Illegal value: " + e + " (not an integer)");
  34896. if (e >>>= 0,
  34897. "number" != typeof t || t % 1 != 0)
  34898. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34899. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34900. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34901. }
  34902. t += 2;
  34903. var n = this.buffer.byteLength;
  34904. return n < t && this.resize((n *= 2) > t ? n : t),
  34905. t -= 2,
  34906. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34907. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34908. this.view[t + 1] = 255 & e),
  34909. i && (this.offset += 2),
  34910. this
  34911. }
  34912. ,
  34913. a.writeUInt16 = a.writeUint16,
  34914. a.readUint16 = function(e) {
  34915. var t = void 0 === e;
  34916. if (t && (e = this.offset),
  34917. !this.noAssert) {
  34918. if ("number" != typeof e || e % 1 != 0)
  34919. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34920. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34921. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34922. }
  34923. var i = 0;
  34924. return this.littleEndian ? (i = this.view[e],
  34925. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34926. i |= this.view[e + 1]),
  34927. t && (this.offset += 2),
  34928. i
  34929. }
  34930. ,
  34931. a.readUInt16 = a.readUint16,
  34932. a.writeInt32 = function(e, t) {
  34933. var i = void 0 === t;
  34934. if (i && (t = this.offset),
  34935. !this.noAssert) {
  34936. if ("number" != typeof e || e % 1 != 0)
  34937. throw TypeError("Illegal value: " + e + " (not an integer)");
  34938. if (e |= 0,
  34939. "number" != typeof t || t % 1 != 0)
  34940. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34941. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34942. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34943. }
  34944. t += 4;
  34945. var n = this.buffer.byteLength;
  34946. return n < t && this.resize((n *= 2) > t ? n : t),
  34947. t -= 4,
  34948. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34949. this.view[t + 2] = e >>> 16 & 255,
  34950. this.view[t + 1] = e >>> 8 & 255,
  34951. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34952. this.view[t + 1] = e >>> 16 & 255,
  34953. this.view[t + 2] = e >>> 8 & 255,
  34954. this.view[t + 3] = 255 & e),
  34955. i && (this.offset += 4),
  34956. this
  34957. }
  34958. ,
  34959. a.writeInt = a.writeInt32,
  34960. a.readInt32 = function(e) {
  34961. var t = void 0 === e;
  34962. if (t && (e = this.offset),
  34963. !this.noAssert) {
  34964. if ("number" != typeof e || e % 1 != 0)
  34965. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34966. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34967. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34968. }
  34969. var i = 0;
  34970. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34971. i |= this.view[e + 1] << 8,
  34972. i |= this.view[e],
  34973. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34974. i |= this.view[e + 2] << 8,
  34975. i |= this.view[e + 3],
  34976. i += this.view[e] << 24 >>> 0),
  34977. i |= 0,
  34978. t && (this.offset += 4),
  34979. i
  34980. }
  34981. ,
  34982. a.readInt = a.readInt32,
  34983. a.writeUint32 = function(e, t) {
  34984. var i = void 0 === t;
  34985. if (i && (t = this.offset),
  34986. !this.noAssert) {
  34987. if ("number" != typeof e || e % 1 != 0)
  34988. throw TypeError("Illegal value: " + e + " (not an integer)");
  34989. if (e >>>= 0,
  34990. "number" != typeof t || t % 1 != 0)
  34991. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34992. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34993. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34994. }
  34995. t += 4;
  34996. var n = this.buffer.byteLength;
  34997. return n < t && this.resize((n *= 2) > t ? n : t),
  34998. t -= 4,
  34999. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35000. this.view[t + 2] = e >>> 16 & 255,
  35001. this.view[t + 1] = e >>> 8 & 255,
  35002. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35003. this.view[t + 1] = e >>> 16 & 255,
  35004. this.view[t + 2] = e >>> 8 & 255,
  35005. this.view[t + 3] = 255 & e),
  35006. i && (this.offset += 4),
  35007. this
  35008. }
  35009. ,
  35010. a.writeUInt32 = a.writeUint32,
  35011. a.readUint32 = function(e) {
  35012. var t = void 0 === e;
  35013. if (t && (e = this.offset),
  35014. !this.noAssert) {
  35015. if ("number" != typeof e || e % 1 != 0)
  35016. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35017. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35018. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35019. }
  35020. var i = 0;
  35021. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35022. i |= this.view[e + 1] << 8,
  35023. i |= this.view[e],
  35024. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35025. i |= this.view[e + 2] << 8,
  35026. i |= this.view[e + 3],
  35027. i += this.view[e] << 24 >>> 0),
  35028. t && (this.offset += 4),
  35029. i
  35030. }
  35031. ,
  35032. a.readUInt32 = a.readUint32,
  35033. l && (a.writeInt64 = function(e, t) {
  35034. var i = void 0 === t;
  35035. if (i && (t = this.offset),
  35036. !this.noAssert) {
  35037. if ("number" == typeof e)
  35038. e = l.fromNumber(e);
  35039. else if ("string" == typeof e)
  35040. e = l.fromString(e);
  35041. else if (!(e && e instanceof l))
  35042. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35043. if ("number" != typeof t || t % 1 != 0)
  35044. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35045. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35046. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35047. }
  35048. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35049. t += 8;
  35050. var n = this.buffer.byteLength;
  35051. n < t && this.resize((n *= 2) > t ? n : t),
  35052. t -= 8;
  35053. var r = e.low
  35054. , o = e.high;
  35055. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35056. this.view[t + 2] = r >>> 16 & 255,
  35057. this.view[t + 1] = r >>> 8 & 255,
  35058. this.view[t] = 255 & r,
  35059. t += 4,
  35060. this.view[t + 3] = o >>> 24 & 255,
  35061. this.view[t + 2] = o >>> 16 & 255,
  35062. this.view[t + 1] = o >>> 8 & 255,
  35063. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35064. this.view[t + 1] = o >>> 16 & 255,
  35065. this.view[t + 2] = o >>> 8 & 255,
  35066. this.view[t + 3] = 255 & o,
  35067. t += 4,
  35068. this.view[t] = r >>> 24 & 255,
  35069. this.view[t + 1] = r >>> 16 & 255,
  35070. this.view[t + 2] = r >>> 8 & 255,
  35071. this.view[t + 3] = 255 & r),
  35072. i && (this.offset += 8),
  35073. this
  35074. }
  35075. ,
  35076. a.writeLong = a.writeInt64,
  35077. a.readInt64 = function(e) {
  35078. var t = void 0 === e;
  35079. if (t && (e = this.offset),
  35080. !this.noAssert) {
  35081. if ("number" != typeof e || e % 1 != 0)
  35082. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35083. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35084. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35085. }
  35086. var i = 0
  35087. , n = 0;
  35088. this.littleEndian ? (i = this.view[e + 2] << 16,
  35089. i |= this.view[e + 1] << 8,
  35090. i |= this.view[e],
  35091. i += this.view[e + 3] << 24 >>> 0,
  35092. e += 4,
  35093. n = this.view[e + 2] << 16,
  35094. n |= this.view[e + 1] << 8,
  35095. n |= this.view[e],
  35096. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35097. n |= this.view[e + 2] << 8,
  35098. n |= this.view[e + 3],
  35099. n += this.view[e] << 24 >>> 0,
  35100. e += 4,
  35101. i = this.view[e + 1] << 16,
  35102. i |= this.view[e + 2] << 8,
  35103. i |= this.view[e + 3],
  35104. i += this.view[e] << 24 >>> 0);
  35105. var r = new l(i,n,!1);
  35106. return t && (this.offset += 8),
  35107. r
  35108. }
  35109. ,
  35110. a.readLong = a.readInt64,
  35111. a.writeUint64 = function(e, t) {
  35112. var i = void 0 === t;
  35113. if (i && (t = this.offset),
  35114. !this.noAssert) {
  35115. if ("number" == typeof e)
  35116. e = l.fromNumber(e);
  35117. else if ("string" == typeof e)
  35118. e = l.fromString(e);
  35119. else if (!(e && e instanceof l))
  35120. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35121. if ("number" != typeof t || t % 1 != 0)
  35122. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35123. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35124. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35125. }
  35126. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35127. t += 8;
  35128. var n = this.buffer.byteLength;
  35129. n < t && this.resize((n *= 2) > t ? n : t),
  35130. t -= 8;
  35131. var r = e.low
  35132. , o = e.high;
  35133. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35134. this.view[t + 2] = r >>> 16 & 255,
  35135. this.view[t + 1] = r >>> 8 & 255,
  35136. this.view[t] = 255 & r,
  35137. t += 4,
  35138. this.view[t + 3] = o >>> 24 & 255,
  35139. this.view[t + 2] = o >>> 16 & 255,
  35140. this.view[t + 1] = o >>> 8 & 255,
  35141. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35142. this.view[t + 1] = o >>> 16 & 255,
  35143. this.view[t + 2] = o >>> 8 & 255,
  35144. this.view[t + 3] = 255 & o,
  35145. t += 4,
  35146. this.view[t] = r >>> 24 & 255,
  35147. this.view[t + 1] = r >>> 16 & 255,
  35148. this.view[t + 2] = r >>> 8 & 255,
  35149. this.view[t + 3] = 255 & r),
  35150. i && (this.offset += 8),
  35151. this
  35152. }
  35153. ,
  35154. a.writeUInt64 = a.writeUint64,
  35155. a.readUint64 = function(e) {
  35156. var t = void 0 === e;
  35157. if (t && (e = this.offset),
  35158. !this.noAssert) {
  35159. if ("number" != typeof e || e % 1 != 0)
  35160. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35161. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35162. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35163. }
  35164. var i = 0
  35165. , n = 0;
  35166. this.littleEndian ? (i = this.view[e + 2] << 16,
  35167. i |= this.view[e + 1] << 8,
  35168. i |= this.view[e],
  35169. i += this.view[e + 3] << 24 >>> 0,
  35170. e += 4,
  35171. n = this.view[e + 2] << 16,
  35172. n |= this.view[e + 1] << 8,
  35173. n |= this.view[e],
  35174. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35175. n |= this.view[e + 2] << 8,
  35176. n |= this.view[e + 3],
  35177. n += this.view[e] << 24 >>> 0,
  35178. e += 4,
  35179. i = this.view[e + 1] << 16,
  35180. i |= this.view[e + 2] << 8,
  35181. i |= this.view[e + 3],
  35182. i += this.view[e] << 24 >>> 0);
  35183. var r = new l(i,n,!0);
  35184. return t && (this.offset += 8),
  35185. r
  35186. }
  35187. ,
  35188. a.readUInt64 = a.readUint64),
  35189. a.writeFloat32 = function(e, t) {
  35190. var i = void 0 === t;
  35191. if (i && (t = this.offset),
  35192. !this.noAssert) {
  35193. if ("number" != typeof e)
  35194. throw TypeError("Illegal value: " + e + " (not a number)");
  35195. if ("number" != typeof t || t % 1 != 0)
  35196. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35197. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35198. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35199. }
  35200. t += 4;
  35201. var n = this.buffer.byteLength;
  35202. return n < t && this.resize((n *= 2) > t ? n : t),
  35203. t -= 4,
  35204. r(this.view, e, t, this.littleEndian, 23, 4),
  35205. i && (this.offset += 4),
  35206. this
  35207. }
  35208. ,
  35209. a.writeFloat = a.writeFloat32,
  35210. a.readFloat32 = function(e) {
  35211. var t = void 0 === e;
  35212. if (t && (e = this.offset),
  35213. !this.noAssert) {
  35214. if ("number" != typeof e || e % 1 != 0)
  35215. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35216. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35217. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35218. }
  35219. var i = n(this.view, e, this.littleEndian, 23, 4);
  35220. return t && (this.offset += 4),
  35221. i
  35222. }
  35223. ,
  35224. a.readFloat = a.readFloat32,
  35225. a.writeFloat64 = function(e, t) {
  35226. var i = void 0 === t;
  35227. if (i && (t = this.offset),
  35228. !this.noAssert) {
  35229. if ("number" != typeof e)
  35230. throw TypeError("Illegal value: " + e + " (not a number)");
  35231. if ("number" != typeof t || t % 1 != 0)
  35232. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35233. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35234. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35235. }
  35236. t += 8;
  35237. var n = this.buffer.byteLength;
  35238. return n < t && this.resize((n *= 2) > t ? n : t),
  35239. t -= 8,
  35240. r(this.view, e, t, this.littleEndian, 52, 8),
  35241. i && (this.offset += 8),
  35242. this
  35243. }
  35244. ,
  35245. a.writeDouble = a.writeFloat64,
  35246. a.readFloat64 = function(e) {
  35247. var t = void 0 === e;
  35248. if (t && (e = this.offset),
  35249. !this.noAssert) {
  35250. if ("number" != typeof e || e % 1 != 0)
  35251. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35252. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35253. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35254. }
  35255. var i = n(this.view, e, this.littleEndian, 52, 8);
  35256. return t && (this.offset += 8),
  35257. i
  35258. }
  35259. ,
  35260. a.readDouble = a.readFloat64,
  35261. f.MAX_VARINT32_BYTES = 5,
  35262. f.calculateVarint32 = function(e) {
  35263. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35264. }
  35265. ,
  35266. f.zigZagEncode32 = function(e) {
  35267. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35268. }
  35269. ,
  35270. f.zigZagDecode32 = function(e) {
  35271. return e >>> 1 ^ -(1 & e) | 0
  35272. }
  35273. ,
  35274. a.writeVarint32 = function(e, t) {
  35275. var i = void 0 === t;
  35276. if (i && (t = this.offset),
  35277. !this.noAssert) {
  35278. if ("number" != typeof e || e % 1 != 0)
  35279. throw TypeError("Illegal value: " + e + " (not an integer)");
  35280. if (e |= 0,
  35281. "number" != typeof t || t % 1 != 0)
  35282. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35283. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35284. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35285. }
  35286. var n, r = f.calculateVarint32(e);
  35287. t += r;
  35288. var o = this.buffer.byteLength;
  35289. for (o < t && this.resize((o *= 2) > t ? o : t),
  35290. t -= r,
  35291. e >>>= 0; 128 <= e; )
  35292. n = 127 & e | 128,
  35293. this.view[t++] = n,
  35294. e >>>= 7;
  35295. return this.view[t++] = e,
  35296. i ? (this.offset = t,
  35297. this) : r
  35298. }
  35299. ,
  35300. a.writeVarint32ZigZag = function(e, t) {
  35301. return this.writeVarint32(f.zigZagEncode32(e), t)
  35302. }
  35303. ,
  35304. a.readVarint32 = function(e) {
  35305. var t = void 0 === e;
  35306. if (t && (e = this.offset),
  35307. !this.noAssert) {
  35308. if ("number" != typeof e || e % 1 != 0)
  35309. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35310. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35311. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35312. }
  35313. var i, n = 0, r = 0;
  35314. do {
  35315. if (!this.noAssert && e > this.limit) {
  35316. var o = Error("Truncated");
  35317. throw o.truncated = !0,
  35318. o
  35319. }
  35320. i = this.view[e++],
  35321. n < 5 && (r |= (127 & i) << 7 * n),
  35322. ++n
  35323. } while (0 != (128 & i));return r |= 0,
  35324. t ? (this.offset = e,
  35325. r) : {
  35326. value: r,
  35327. length: n
  35328. }
  35329. }
  35330. ,
  35331. a.readVarint32ZigZag = function(e) {
  35332. var t = this.readVarint32(e);
  35333. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35334. t
  35335. }
  35336. ,
  35337. l && (f.MAX_VARINT64_BYTES = 10,
  35338. f.calculateVarint64 = function(e) {
  35339. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35340. var t = e.toInt() >>> 0
  35341. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35342. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35343. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  35344. }
  35345. ,
  35346. f.zigZagEncode64 = function(e) {
  35347. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35348. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35349. }
  35350. ,
  35351. f.zigZagDecode64 = function(e) {
  35352. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35353. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35354. }
  35355. ,
  35356. a.writeVarint64 = function(e, t) {
  35357. var i = void 0 === t;
  35358. if (i && (t = this.offset),
  35359. !this.noAssert) {
  35360. if ("number" == typeof e)
  35361. e = l.fromNumber(e);
  35362. else if ("string" == typeof e)
  35363. e = l.fromString(e);
  35364. else if (!(e && e instanceof l))
  35365. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35366. if ("number" != typeof t || t % 1 != 0)
  35367. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35368. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35369. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35370. }
  35371. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35372. var n = f.calculateVarint64(e)
  35373. , r = e.toInt() >>> 0
  35374. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35375. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35376. t += n;
  35377. var s = this.buffer.byteLength;
  35378. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35379. t -= n,
  35380. n) {
  35381. case 10:
  35382. this.view[t + 9] = a >>> 7 & 1;
  35383. case 9:
  35384. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35385. case 8:
  35386. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35387. case 7:
  35388. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35389. case 6:
  35390. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35391. case 5:
  35392. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35393. case 4:
  35394. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35395. case 3:
  35396. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35397. case 2:
  35398. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35399. case 1:
  35400. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35401. }
  35402. return i ? (this.offset += n,
  35403. this) : n
  35404. }
  35405. ,
  35406. a.writeVarint64ZigZag = function(e, t) {
  35407. return this.writeVarint64(f.zigZagEncode64(e), t)
  35408. }
  35409. ,
  35410. a.readVarint64 = function(e) {
  35411. var t = void 0 === e;
  35412. if (t && (e = this.offset),
  35413. !this.noAssert) {
  35414. if ("number" != typeof e || e % 1 != 0)
  35415. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35416. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35417. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35418. }
  35419. var i = e
  35420. , n = 0
  35421. , r = 0
  35422. , o = 0
  35423. , a = 0;
  35424. if (n = 127 & (a = this.view[e++]),
  35425. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35426. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35427. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35428. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35429. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35430. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35431. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35432. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35433. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35434. 128 & a || this.noAssert && void 0 === a))))))))))
  35435. throw Error("Buffer overrun");
  35436. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35437. return t ? (this.offset = e,
  35438. s) : {
  35439. value: s,
  35440. length: e - i
  35441. }
  35442. }
  35443. ,
  35444. a.readVarint64ZigZag = function(e) {
  35445. var t = this.readVarint64(e);
  35446. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35447. t
  35448. }
  35449. ),
  35450. a.writeCString = function(e, t) {
  35451. var i = void 0 === t;
  35452. i && (t = this.offset);
  35453. var n, r = e.length;
  35454. if (!this.noAssert) {
  35455. if ("string" != typeof e)
  35456. throw TypeError("Illegal str: Not a string");
  35457. for (n = 0; n < r; ++n)
  35458. if (0 === e.charCodeAt(n))
  35459. throw RangeError("Illegal str: Contains NULL-characters");
  35460. if ("number" != typeof t || t % 1 != 0)
  35461. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35462. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35463. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35464. }
  35465. r = d.calculateUTF16asUTF8(s(e))[1],
  35466. t += r + 1;
  35467. var o = this.buffer.byteLength;
  35468. return o < t && this.resize((o *= 2) > t ? o : t),
  35469. t -= r + 1,
  35470. d.encodeUTF16toUTF8(s(e), function(e) {
  35471. this.view[t++] = e
  35472. }
  35473. .bind(this)),
  35474. this.view[t++] = 0,
  35475. i ? (this.offset = t,
  35476. this) : r
  35477. }
  35478. ,
  35479. a.readCString = function(e) {
  35480. var t = void 0 === e;
  35481. if (t && (e = this.offset),
  35482. !this.noAssert) {
  35483. if ("number" != typeof e || e % 1 != 0)
  35484. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35485. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35486. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35487. }
  35488. var i, n = e, r = -1;
  35489. return d.decodeUTF8toUTF16(function() {
  35490. if (0 === r)
  35491. return null;
  35492. if (e >= this.limit)
  35493. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35494. return 0 === (r = this.view[e++]) ? null : r
  35495. }
  35496. .bind(this), i = c(), !0),
  35497. t ? (this.offset = e,
  35498. i()) : {
  35499. string: i(),
  35500. length: e - n
  35501. }
  35502. }
  35503. ,
  35504. a.writeIString = function(e, t) {
  35505. var i = void 0 === t;
  35506. if (i && (t = this.offset),
  35507. !this.noAssert) {
  35508. if ("string" != typeof e)
  35509. throw TypeError("Illegal str: Not a string");
  35510. if ("number" != typeof t || t % 1 != 0)
  35511. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35512. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35513. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35514. }
  35515. var n, r = t;
  35516. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35517. t += 4 + n;
  35518. var o = this.buffer.byteLength;
  35519. if (o < t && this.resize((o *= 2) > t ? o : t),
  35520. t -= 4 + n,
  35521. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35522. this.view[t + 2] = n >>> 16 & 255,
  35523. this.view[t + 1] = n >>> 8 & 255,
  35524. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35525. this.view[t + 1] = n >>> 16 & 255,
  35526. this.view[t + 2] = n >>> 8 & 255,
  35527. this.view[t + 3] = 255 & n),
  35528. t += 4,
  35529. d.encodeUTF16toUTF8(s(e), function(e) {
  35530. this.view[t++] = e
  35531. }
  35532. .bind(this)),
  35533. t !== r + 4 + n)
  35534. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35535. return i ? (this.offset = t,
  35536. this) : t - r
  35537. }
  35538. ,
  35539. a.readIString = function(e) {
  35540. var t = void 0 === e;
  35541. if (t && (e = this.offset),
  35542. !this.noAssert) {
  35543. if ("number" != typeof e || e % 1 != 0)
  35544. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35545. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35546. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35547. }
  35548. var i = e
  35549. , n = this.readUint32(e)
  35550. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35551. return e += r.length,
  35552. t ? (this.offset = e,
  35553. r.string) : {
  35554. string: r.string,
  35555. length: e - i
  35556. }
  35557. }
  35558. ,
  35559. f.METRICS_CHARS = "c",
  35560. f.METRICS_BYTES = "b",
  35561. a.writeUTF8String = function(e, t) {
  35562. var i = void 0 === t;
  35563. if (i && (t = this.offset),
  35564. !this.noAssert) {
  35565. if ("number" != typeof t || t % 1 != 0)
  35566. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35567. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35568. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35569. }
  35570. var n, r = t;
  35571. n = d.calculateUTF16asUTF8(s(e))[1],
  35572. t += n;
  35573. var o = this.buffer.byteLength;
  35574. return o < t && this.resize((o *= 2) > t ? o : t),
  35575. t -= n,
  35576. d.encodeUTF16toUTF8(s(e), function(e) {
  35577. this.view[t++] = e
  35578. }
  35579. .bind(this)),
  35580. i ? (this.offset = t,
  35581. this) : t - r
  35582. }
  35583. ,
  35584. a.writeString = a.writeUTF8String,
  35585. f.calculateUTF8Chars = function(e) {
  35586. return d.calculateUTF16asUTF8(s(e))[0]
  35587. }
  35588. ,
  35589. f.calculateUTF8Bytes = function(e) {
  35590. return d.calculateUTF16asUTF8(s(e))[1]
  35591. }
  35592. ,
  35593. f.calculateString = f.calculateUTF8Bytes,
  35594. a.readUTF8String = function(e, t, i) {
  35595. "number" == typeof t && (i = t,
  35596. t = void 0);
  35597. var n = void 0 === i;
  35598. if (n && (i = this.offset),
  35599. void 0 === t && (t = f.METRICS_CHARS),
  35600. !this.noAssert) {
  35601. if ("number" != typeof e || e % 1 != 0)
  35602. throw TypeError("Illegal length: " + e + " (not an integer)");
  35603. if (e |= 0,
  35604. "number" != typeof i || i % 1 != 0)
  35605. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35606. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35607. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35608. }
  35609. var r, o = 0, a = i;
  35610. if (t === f.METRICS_CHARS) {
  35611. if (r = c(),
  35612. d.decodeUTF8(function() {
  35613. return o < e && i < this.limit ? this.view[i++] : null
  35614. }
  35615. .bind(this), function(e) {
  35616. ++o,
  35617. d.UTF8toUTF16(e, r)
  35618. }),
  35619. o !== e)
  35620. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35621. return n ? (this.offset = i,
  35622. r()) : {
  35623. string: r(),
  35624. length: i - a
  35625. }
  35626. }
  35627. if (t !== f.METRICS_BYTES)
  35628. throw TypeError("Unsupported metrics: " + t);
  35629. if (!this.noAssert) {
  35630. if ("number" != typeof i || i % 1 != 0)
  35631. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35632. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35633. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35634. }
  35635. var s = i + e;
  35636. if (d.decodeUTF8toUTF16(function() {
  35637. return i < s ? this.view[i++] : null
  35638. }
  35639. .bind(this), r = c(), this.noAssert),
  35640. i !== s)
  35641. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35642. return n ? (this.offset = i,
  35643. r()) : {
  35644. string: r(),
  35645. length: i - a
  35646. }
  35647. }
  35648. ,
  35649. a.readString = a.readUTF8String,
  35650. a.writeVString = function(e, t) {
  35651. var i = void 0 === t;
  35652. if (i && (t = this.offset),
  35653. !this.noAssert) {
  35654. if ("string" != typeof e)
  35655. throw TypeError("Illegal str: Not a string");
  35656. if ("number" != typeof t || t % 1 != 0)
  35657. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35658. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35659. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35660. }
  35661. var n, r, o = t;
  35662. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35663. r = f.calculateVarint32(n),
  35664. t += r + n;
  35665. var a = this.buffer.byteLength;
  35666. if (a < t && this.resize((a *= 2) > t ? a : t),
  35667. t -= r + n,
  35668. t += this.writeVarint32(n, t),
  35669. d.encodeUTF16toUTF8(s(e), function(e) {
  35670. this.view[t++] = e
  35671. }
  35672. .bind(this)),
  35673. t !== o + n + r)
  35674. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35675. return i ? (this.offset = t,
  35676. this) : t - o
  35677. }
  35678. ,
  35679. a.readVString = function(e) {
  35680. var t = void 0 === e;
  35681. if (t && (e = this.offset),
  35682. !this.noAssert) {
  35683. if ("number" != typeof e || e % 1 != 0)
  35684. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35685. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35686. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35687. }
  35688. var i = e
  35689. , n = this.readVarint32(e)
  35690. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35691. return e += r.length,
  35692. t ? (this.offset = e,
  35693. r.string) : {
  35694. string: r.string,
  35695. length: e - i
  35696. }
  35697. }
  35698. ,
  35699. a.append = function(e, t, i) {
  35700. "number" != typeof t && "string" == typeof t || (i = t,
  35701. t = void 0);
  35702. var n = void 0 === i;
  35703. if (n && (i = this.offset),
  35704. !this.noAssert) {
  35705. if ("number" != typeof i || i % 1 != 0)
  35706. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35707. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35708. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35709. }
  35710. e instanceof f || (e = f.wrap(e, t));
  35711. var r = e.limit - e.offset;
  35712. if (r <= 0)
  35713. return this;
  35714. i += r;
  35715. var o = this.buffer.byteLength;
  35716. return o < i && this.resize((o *= 2) > i ? o : i),
  35717. i -= r,
  35718. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35719. e.offset += r,
  35720. n && (this.offset += r),
  35721. this
  35722. }
  35723. ,
  35724. a.appendTo = function(e, t) {
  35725. return e.append(this, t),
  35726. this
  35727. }
  35728. ,
  35729. a.assert = function(e) {
  35730. return this.noAssert = !e,
  35731. this
  35732. }
  35733. ,
  35734. a.capacity = function() {
  35735. return this.buffer.byteLength
  35736. }
  35737. ,
  35738. a.clear = function() {
  35739. return this.offset = 0,
  35740. this.limit = this.buffer.byteLength,
  35741. this.markedOffset = -1,
  35742. this
  35743. }
  35744. ,
  35745. a.clone = function(e) {
  35746. var t = new f(0,this.littleEndian,this.noAssert);
  35747. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35748. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35749. t.view = this.view),
  35750. t.offset = this.offset,
  35751. t.markedOffset = this.markedOffset,
  35752. t.limit = this.limit,
  35753. t
  35754. }
  35755. ,
  35756. a.compact = function(e, t) {
  35757. if (void 0 === e && (e = this.offset),
  35758. void 0 === t && (t = this.limit),
  35759. !this.noAssert) {
  35760. if ("number" != typeof e || e % 1 != 0)
  35761. throw TypeError("Illegal begin: Not an integer");
  35762. if (e >>>= 0,
  35763. "number" != typeof t || t % 1 != 0)
  35764. throw TypeError("Illegal end: Not an integer");
  35765. if (t >>>= 0,
  35766. e < 0 || t < e || t > this.buffer.byteLength)
  35767. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35768. }
  35769. if (0 === e && t === this.buffer.byteLength)
  35770. return this;
  35771. var i = t - e;
  35772. if (0 == i)
  35773. return this.buffer = o,
  35774. this.view = null,
  35775. 0 <= this.markedOffset && (this.markedOffset -= e),
  35776. this.offset = 0,
  35777. this.limit = 0,
  35778. this;
  35779. var n = new ArrayBuffer(i)
  35780. , r = new Uint8Array(n);
  35781. return r.set(this.view.subarray(e, t)),
  35782. this.buffer = n,
  35783. this.view = r,
  35784. 0 <= this.markedOffset && (this.markedOffset -= e),
  35785. this.offset = 0,
  35786. this.limit = i,
  35787. this
  35788. }
  35789. ,
  35790. a.copy = function(e, t) {
  35791. if (void 0 === e && (e = this.offset),
  35792. void 0 === t && (t = this.limit),
  35793. !this.noAssert) {
  35794. if ("number" != typeof e || e % 1 != 0)
  35795. throw TypeError("Illegal begin: Not an integer");
  35796. if (e >>>= 0,
  35797. "number" != typeof t || t % 1 != 0)
  35798. throw TypeError("Illegal end: Not an integer");
  35799. if (t >>>= 0,
  35800. e < 0 || t < e || t > this.buffer.byteLength)
  35801. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35802. }
  35803. if (e === t)
  35804. return new f(0,this.littleEndian,this.noAssert);
  35805. var i = t - e
  35806. , n = new f(i,this.littleEndian,this.noAssert);
  35807. return n.offset = 0,
  35808. n.limit = i,
  35809. 0 <= n.markedOffset && (n.markedOffset -= e),
  35810. this.copyTo(n, 0, e, t),
  35811. n
  35812. }
  35813. ,
  35814. a.copyTo = function(e, t, i, n) {
  35815. var r, o;
  35816. if (!this.noAssert && !f.isByteBuffer(e))
  35817. throw TypeError("Illegal target: Not a ByteBuffer");
  35818. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35819. i = (r = void 0 === i) ? this.offset : 0 | i,
  35820. n = void 0 === n ? this.limit : 0 | n,
  35821. t < 0 || t > e.buffer.byteLength)
  35822. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35823. if (i < 0 || n > this.buffer.byteLength)
  35824. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35825. var a = n - i;
  35826. return 0 == a ? e : (e.ensureCapacity(t + a),
  35827. e.view.set(this.view.subarray(i, n), t),
  35828. r && (this.offset += a),
  35829. o && (e.offset += a),
  35830. this)
  35831. }
  35832. ,
  35833. a.ensureCapacity = function(e) {
  35834. var t = this.buffer.byteLength;
  35835. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35836. }
  35837. ,
  35838. a.fill = function(e, t, i) {
  35839. var n = void 0 === t;
  35840. if (n && (t = this.offset),
  35841. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35842. void 0 === t && (t = this.offset),
  35843. void 0 === i && (i = this.limit),
  35844. !this.noAssert) {
  35845. if ("number" != typeof e || e % 1 != 0)
  35846. throw TypeError("Illegal value: " + e + " (not an integer)");
  35847. if (e |= 0,
  35848. "number" != typeof t || t % 1 != 0)
  35849. throw TypeError("Illegal begin: Not an integer");
  35850. if (t >>>= 0,
  35851. "number" != typeof i || i % 1 != 0)
  35852. throw TypeError("Illegal end: Not an integer");
  35853. if (i >>>= 0,
  35854. t < 0 || i < t || i > this.buffer.byteLength)
  35855. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35856. }
  35857. if (i <= t)
  35858. return this;
  35859. for (; t < i; )
  35860. this.view[t++] = e;
  35861. return n && (this.offset = t),
  35862. this
  35863. }
  35864. ,
  35865. a.flip = function() {
  35866. return this.limit = this.offset,
  35867. this.offset = 0,
  35868. this
  35869. }
  35870. ,
  35871. a.mark = function(e) {
  35872. if (e = void 0 === e ? this.offset : e,
  35873. !this.noAssert) {
  35874. if ("number" != typeof e || e % 1 != 0)
  35875. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35876. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35877. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35878. }
  35879. return this.markedOffset = e,
  35880. this
  35881. }
  35882. ,
  35883. a.order = function(e) {
  35884. if (!this.noAssert && "boolean" != typeof e)
  35885. throw TypeError("Illegal littleEndian: Not a boolean");
  35886. return this.littleEndian = !!e,
  35887. this
  35888. }
  35889. ,
  35890. a.LE = function(e) {
  35891. return this.littleEndian = void 0 === e || !!e,
  35892. this
  35893. }
  35894. ,
  35895. a.BE = function(e) {
  35896. return this.littleEndian = void 0 !== e && !e,
  35897. this
  35898. }
  35899. ,
  35900. a.prepend = function(e, t, i) {
  35901. "number" != typeof t && "string" == typeof t || (i = t,
  35902. t = void 0);
  35903. var n = void 0 === i;
  35904. if (n && (i = this.offset),
  35905. !this.noAssert) {
  35906. if ("number" != typeof i || i % 1 != 0)
  35907. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35908. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35909. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35910. }
  35911. e instanceof f || (e = f.wrap(e, t));
  35912. var r = e.limit - e.offset;
  35913. if (r <= 0)
  35914. return this;
  35915. var o = r - i;
  35916. if (0 < o) {
  35917. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35918. , s = new Uint8Array(a);
  35919. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35920. this.buffer = a,
  35921. this.view = s,
  35922. this.offset += o,
  35923. 0 <= this.markedOffset && (this.markedOffset += o),
  35924. this.limit += o,
  35925. i += o
  35926. } else
  35927. new Uint8Array(this.buffer);
  35928. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35929. e.offset = e.limit,
  35930. n && (this.offset -= r),
  35931. this
  35932. }
  35933. ,
  35934. a.prependTo = function(e, t) {
  35935. return e.prepend(this, t),
  35936. this
  35937. }
  35938. ,
  35939. a.printDebug = function(e) {
  35940. "function" != typeof e && (e = console.log.bind(console)),
  35941. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35942. }
  35943. ,
  35944. a.remaining = function() {
  35945. return this.limit - this.offset
  35946. }
  35947. ,
  35948. a.reset = function() {
  35949. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35950. this.markedOffset = -1) : this.offset = 0,
  35951. this
  35952. }
  35953. ,
  35954. a.resize = function(e) {
  35955. if (!this.noAssert) {
  35956. if ("number" != typeof e || e % 1 != 0)
  35957. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35958. if ((e |= 0) < 0)
  35959. throw RangeError("Illegal capacity: 0 <= " + e)
  35960. }
  35961. if (this.buffer.byteLength < e) {
  35962. var t = new ArrayBuffer(e)
  35963. , i = new Uint8Array(t);
  35964. i.set(this.view),
  35965. this.buffer = t,
  35966. this.view = i
  35967. }
  35968. return this
  35969. }
  35970. ,
  35971. a.reverse = function(e, t) {
  35972. if (void 0 === e && (e = this.offset),
  35973. void 0 === t && (t = this.limit),
  35974. !this.noAssert) {
  35975. if ("number" != typeof e || e % 1 != 0)
  35976. throw TypeError("Illegal begin: Not an integer");
  35977. if (e >>>= 0,
  35978. "number" != typeof t || t % 1 != 0)
  35979. throw TypeError("Illegal end: Not an integer");
  35980. if (t >>>= 0,
  35981. e < 0 || t < e || t > this.buffer.byteLength)
  35982. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35983. }
  35984. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35985. this
  35986. }
  35987. ,
  35988. a.skip = function(e) {
  35989. if (!this.noAssert) {
  35990. if ("number" != typeof e || e % 1 != 0)
  35991. throw TypeError("Illegal length: " + e + " (not an integer)");
  35992. e |= 0
  35993. }
  35994. var t = this.offset + e;
  35995. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35996. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35997. return this.offset = t,
  35998. this
  35999. }
  36000. ,
  36001. a.slice = function(e, t) {
  36002. if (void 0 === e && (e = this.offset),
  36003. void 0 === t && (t = this.limit),
  36004. !this.noAssert) {
  36005. if ("number" != typeof e || e % 1 != 0)
  36006. throw TypeError("Illegal begin: Not an integer");
  36007. if (e >>>= 0,
  36008. "number" != typeof t || t % 1 != 0)
  36009. throw TypeError("Illegal end: Not an integer");
  36010. if (t >>>= 0,
  36011. e < 0 || t < e || t > this.buffer.byteLength)
  36012. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36013. }
  36014. var i = this.clone();
  36015. return i.offset = e,
  36016. i.limit = t,
  36017. i
  36018. }
  36019. ,
  36020. a.toBuffer = function(e) {
  36021. var t = this.offset
  36022. , i = this.limit;
  36023. if (!this.noAssert) {
  36024. if ("number" != typeof t || t % 1 != 0)
  36025. throw TypeError("Illegal offset: Not an integer");
  36026. if (t >>>= 0,
  36027. "number" != typeof i || i % 1 != 0)
  36028. throw TypeError("Illegal limit: Not an integer");
  36029. if (i >>>= 0,
  36030. t < 0 || i < t || i > this.buffer.byteLength)
  36031. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36032. }
  36033. if (!e && 0 === t && i === this.buffer.byteLength)
  36034. return this.buffer;
  36035. if (t === i)
  36036. return o;
  36037. var n = new ArrayBuffer(i - t);
  36038. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36039. n
  36040. }
  36041. ,
  36042. a.toArrayBuffer = a.toBuffer,
  36043. a.toString = function(e, t, i) {
  36044. if (void 0 === e)
  36045. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36046. switch ("number" == typeof e && (i = t = e = "utf8"),
  36047. e) {
  36048. case "utf8":
  36049. return this.toUTF8(t, i);
  36050. case "base64":
  36051. return this.toBase64(t, i);
  36052. case "hex":
  36053. return this.toHex(t, i);
  36054. case "binary":
  36055. return this.toBinary(t, i);
  36056. case "debug":
  36057. return this.toDebug();
  36058. case "columns":
  36059. return this.toColumns();
  36060. default:
  36061. throw Error("Unsupported encoding: " + e)
  36062. }
  36063. }
  36064. ;
  36065. var h = function() {
  36066. for (var e = {}, r = [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], a = [], t = 0, i = r.length; t < i; ++t)
  36067. a[r[t]] = t;
  36068. return e.encode = function(e, t) {
  36069. for (var i, n; null !== (i = e()); )
  36070. t(r[i >> 2 & 63]),
  36071. n = (3 & i) << 4,
  36072. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36073. n = (15 & i) << 2,
  36074. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36075. t(r[63 & i])) : (t(r[63 & n]),
  36076. t(61))) : (t(r[63 & n]),
  36077. t(61),
  36078. t(61))
  36079. }
  36080. ,
  36081. e.decode = function(e, t) {
  36082. function i(e) {
  36083. throw Error("Illegal character code: " + e)
  36084. }
  36085. for (var n, r, o; null !== (n = e()); )
  36086. if (void 0 === (r = a[n]) && i(n),
  36087. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36088. t(r << 2 >>> 0 | (48 & o) >> 4),
  36089. null !== (n = e()))) {
  36090. if (void 0 === (r = a[n])) {
  36091. if (61 === n)
  36092. break;
  36093. i(n)
  36094. }
  36095. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36096. null !== (n = e())) {
  36097. if (void 0 === (o = a[n])) {
  36098. if (61 === n)
  36099. break;
  36100. i(n)
  36101. }
  36102. t((3 & r) << 6 >>> 0 | o)
  36103. }
  36104. }
  36105. }
  36106. ,
  36107. e.test = function(e) {
  36108. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36109. }
  36110. ,
  36111. e
  36112. }();
  36113. a.toBase64 = function(e, t) {
  36114. if (void 0 === e && (e = this.offset),
  36115. void 0 === t && (t = this.limit),
  36116. t |= 0,
  36117. (e |= 0) < 0 || t > this.capacity || t < e)
  36118. throw RangeError("begin, end");
  36119. var i;
  36120. return h.encode(function() {
  36121. return e < t ? this.view[e++] : null
  36122. }
  36123. .bind(this), i = c()),
  36124. i()
  36125. }
  36126. ,
  36127. f.fromBase64 = function(e, t) {
  36128. if ("string" != typeof e)
  36129. throw TypeError("str");
  36130. var i = new f(e.length / 4 * 3,t)
  36131. , n = 0;
  36132. return h.decode(s(e), function(e) {
  36133. i.view[n++] = e
  36134. }),
  36135. i.limit = n,
  36136. i
  36137. }
  36138. ,
  36139. f.btoa = function(e) {
  36140. return f.fromBinary(e).toBase64()
  36141. }
  36142. ,
  36143. f.atob = function(e) {
  36144. return f.fromBase64(e).toBinary()
  36145. }
  36146. ,
  36147. a.toBinary = function(e, t) {
  36148. if (void 0 === e && (e = this.offset),
  36149. void 0 === t && (t = this.limit),
  36150. t |= 0,
  36151. (e |= 0) < 0 || t > this.capacity() || t < e)
  36152. throw RangeError("begin, end");
  36153. if (e === t)
  36154. return "";
  36155. for (var i = [], n = []; e < t; )
  36156. i.push(this.view[e++]),
  36157. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36158. i = []);
  36159. return n.join("") + String.fromCharCode.apply(String, i)
  36160. }
  36161. ,
  36162. f.fromBinary = function(e, t) {
  36163. if ("string" != typeof e)
  36164. throw TypeError("str");
  36165. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36166. if (255 < (i = e.charCodeAt(n)))
  36167. throw RangeError("illegal char code: " + i);
  36168. o.view[n++] = i
  36169. }
  36170. return o.limit = r,
  36171. o
  36172. }
  36173. ,
  36174. a.toDebug = function(e) {
  36175. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36176. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36177. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36178. ++i,
  36179. e && 0 < i && i % 16 == 0 && i !== n) {
  36180. for (; r.length < 51; )
  36181. r += " ";
  36182. a += r + o + "\n",
  36183. r = o = ""
  36184. }
  36185. 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 ? " " : ""
  36186. }
  36187. if (e && " " !== r) {
  36188. for (; r.length < 51; )
  36189. r += " ";
  36190. a += r + o + "\n"
  36191. }
  36192. return e ? a : r
  36193. }
  36194. ,
  36195. f.fromDebug = function(e, t, i) {
  36196. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  36197. switch (n = e.charAt(s++)) {
  36198. case "!":
  36199. if (!i) {
  36200. if (h || u || d) {
  36201. p = !0;
  36202. break
  36203. }
  36204. h = u = d = !0
  36205. }
  36206. a.offset = a.markedOffset = a.limit = l,
  36207. c = !1;
  36208. break;
  36209. case "|":
  36210. if (!i) {
  36211. if (h || d) {
  36212. p = !0;
  36213. break
  36214. }
  36215. h = d = !0
  36216. }
  36217. a.offset = a.limit = l,
  36218. c = !1;
  36219. break;
  36220. case "[":
  36221. if (!i) {
  36222. if (h || u) {
  36223. p = !0;
  36224. break
  36225. }
  36226. h = u = !0
  36227. }
  36228. a.offset = a.markedOffset = l,
  36229. c = !1;
  36230. break;
  36231. case "<":
  36232. if (!i) {
  36233. if (h) {
  36234. p = !0;
  36235. break
  36236. }
  36237. h = !0
  36238. }
  36239. a.offset = l,
  36240. c = !1;
  36241. break;
  36242. case "]":
  36243. if (!i) {
  36244. if (d || u) {
  36245. p = !0;
  36246. break
  36247. }
  36248. d = u = !0
  36249. }
  36250. a.limit = a.markedOffset = l,
  36251. c = !1;
  36252. break;
  36253. case ">":
  36254. if (!i) {
  36255. if (d) {
  36256. p = !0;
  36257. break
  36258. }
  36259. d = !0
  36260. }
  36261. a.limit = l,
  36262. c = !1;
  36263. break;
  36264. case "'":
  36265. if (!i) {
  36266. if (u) {
  36267. p = !0;
  36268. break
  36269. }
  36270. u = !0
  36271. }
  36272. a.markedOffset = l,
  36273. c = !1;
  36274. break;
  36275. case " ":
  36276. c = !1;
  36277. break;
  36278. default:
  36279. if (!i && c) {
  36280. p = !0;
  36281. break
  36282. }
  36283. if (r = parseInt(n + e.charAt(s++), 16),
  36284. !i && (isNaN(r) || r < 0 || 255 < r))
  36285. throw TypeError("Illegal str: Not a debug encoded string");
  36286. a.view[l++] = r,
  36287. c = !0
  36288. }
  36289. if (p)
  36290. throw TypeError("Illegal str: Invalid symbol at " + s)
  36291. }
  36292. if (!i) {
  36293. if (!h || !d)
  36294. throw TypeError("Illegal str: Missing offset or limit");
  36295. if (l < a.buffer.byteLength)
  36296. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36297. }
  36298. return a
  36299. }
  36300. ,
  36301. a.toHex = function(e, t) {
  36302. if (e = void 0 === e ? this.offset : e,
  36303. t = void 0 === t ? this.limit : t,
  36304. !this.noAssert) {
  36305. if ("number" != typeof e || e % 1 != 0)
  36306. throw TypeError("Illegal begin: Not an integer");
  36307. if (e >>>= 0,
  36308. "number" != typeof t || t % 1 != 0)
  36309. throw TypeError("Illegal end: Not an integer");
  36310. if (t >>>= 0,
  36311. e < 0 || t < e || t > this.buffer.byteLength)
  36312. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36313. }
  36314. for (var i, n = new Array(t - e); e < t; )
  36315. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36316. return n.join("")
  36317. }
  36318. ,
  36319. f.fromHex = function(e, t, i) {
  36320. if (!i) {
  36321. if ("string" != typeof e)
  36322. throw TypeError("Illegal str: Not a string");
  36323. if (e.length % 2 != 0)
  36324. throw TypeError("Illegal str: Length not a multiple of 2")
  36325. }
  36326. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36327. if (n = parseInt(e.substring(a, a + 2), 16),
  36328. !i && (!isFinite(n) || n < 0 || 255 < n))
  36329. throw TypeError("Illegal str: Contains non-hex characters");
  36330. o.view[s++] = n
  36331. }
  36332. return o.limit = s,
  36333. o
  36334. }
  36335. ;
  36336. var u, d = u = {
  36337. MAX_CODEPOINT: 1114111,
  36338. encodeUTF8: function(e, t) {
  36339. var i = null;
  36340. for ("number" == typeof e && (i = e,
  36341. e = function() {
  36342. return null
  36343. }
  36344. ); null !== i || null !== (i = e()); )
  36345. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36346. t(i >> 12 & 63 | 128)),
  36347. t(i >> 6 & 63 | 128)),
  36348. t(63 & i | 128)),
  36349. i = null
  36350. },
  36351. decodeUTF8: function(e, t) {
  36352. for (var i, n, r, o, a = function(e) {
  36353. e = e.slice(0, e.indexOf(null));
  36354. var t = Error(e.toString());
  36355. throw t.name = "TruncatedError",
  36356. t.bytes = e,
  36357. t
  36358. }; null !== (i = e()); )
  36359. if (0 == (128 & i))
  36360. t(i);
  36361. else if (192 == (224 & i))
  36362. null === (n = e()) && a([i, n]),
  36363. t((31 & i) << 6 | 63 & n);
  36364. else if (224 == (240 & i))
  36365. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36366. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36367. else {
  36368. if (240 != (248 & i))
  36369. throw RangeError("Illegal starting byte: " + i);
  36370. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36371. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36372. }
  36373. },
  36374. UTF16toUTF8: function(e, t) {
  36375. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36376. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36377. n = null) : t(i);
  36378. null !== n && t(n)
  36379. },
  36380. UTF8toUTF16: function(e, t) {
  36381. var i = null;
  36382. for ("number" == typeof e && (i = e,
  36383. e = function() {
  36384. return null
  36385. }
  36386. ); null !== i || null !== (i = e()); )
  36387. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36388. t(i % 1024 + 56320)),
  36389. i = null
  36390. },
  36391. encodeUTF16toUTF8: function(e, t) {
  36392. u.UTF16toUTF8(e, function(e) {
  36393. u.encodeUTF8(e, t)
  36394. })
  36395. },
  36396. decodeUTF8toUTF16: function(e, t) {
  36397. u.decodeUTF8(e, function(e) {
  36398. u.UTF8toUTF16(e, t)
  36399. })
  36400. },
  36401. calculateCodePoint: function(e) {
  36402. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36403. },
  36404. calculateUTF8: function(e) {
  36405. for (var t, i = 0; null !== (t = e()); )
  36406. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36407. return i
  36408. },
  36409. calculateUTF16asUTF8: function(e) {
  36410. var t = 0
  36411. , i = 0;
  36412. return u.UTF16toUTF8(e, function(e) {
  36413. ++t,
  36414. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36415. }),
  36416. [t, i]
  36417. }
  36418. };
  36419. return a.toUTF8 = function(t, i) {
  36420. if (void 0 === t && (t = this.offset),
  36421. void 0 === i && (i = this.limit),
  36422. !this.noAssert) {
  36423. if ("number" != typeof t || t % 1 != 0)
  36424. throw TypeError("Illegal begin: Not an integer");
  36425. if (t >>>= 0,
  36426. "number" != typeof i || i % 1 != 0)
  36427. throw TypeError("Illegal end: Not an integer");
  36428. if (i >>>= 0,
  36429. t < 0 || i < t || i > this.buffer.byteLength)
  36430. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36431. }
  36432. var e;
  36433. try {
  36434. d.decodeUTF8toUTF16(function() {
  36435. return t < i ? this.view[t++] : null
  36436. }
  36437. .bind(this), e = c())
  36438. } catch (e) {
  36439. if (t !== i)
  36440. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36441. }
  36442. return e()
  36443. }
  36444. ,
  36445. f.fromUTF8 = function(e, t, i) {
  36446. if (!i && "string" != typeof e)
  36447. throw TypeError("Illegal str: Not a string");
  36448. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36449. , r = 0;
  36450. return d.encodeUTF16toUTF8(s(e), function(e) {
  36451. n.view[r++] = e
  36452. }),
  36453. n.limit = r,
  36454. n
  36455. }
  36456. ,
  36457. f
  36458. }
  36459. ,
  36460. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36461. var e;
  36462. try {
  36463. e = t("long")
  36464. } catch (e) {}
  36465. return r(e)
  36466. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36467. }
  36468. , {
  36469. long: 216
  36470. }],
  36471. 216: [function(e, t, i) {
  36472. var n, r;
  36473. n = this,
  36474. r = function() {
  36475. "use strict";
  36476. function n(e, t, i) {
  36477. this.low = 0 | e,
  36478. this.high = 0 | t,
  36479. this.unsigned = !!i
  36480. }
  36481. function p(e) {
  36482. return !0 === (e && e.__isLong__)
  36483. }
  36484. function e(e, t) {
  36485. var i, n, r;
  36486. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36487. r && (a[e] = i),
  36488. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36489. r && (o[e] = i),
  36490. i)
  36491. }
  36492. function f(e, t) {
  36493. if (isNaN(e) || !isFinite(e))
  36494. return t ? l : y;
  36495. if (t) {
  36496. if (e < 0)
  36497. return l;
  36498. if (r <= e)
  36499. return I
  36500. } else {
  36501. if (e <= -s)
  36502. return E;
  36503. if (s <= e + 1)
  36504. return C
  36505. }
  36506. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36507. }
  36508. function g(e, t, i) {
  36509. return new n(e,t,i)
  36510. }
  36511. function h(e, t, i) {
  36512. if (0 === e.length)
  36513. throw Error("empty string");
  36514. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36515. return y;
  36516. if (t = "number" == typeof t ? (i = t,
  36517. !1) : !!t,
  36518. (i = i || 10) < 2 || 36 < i)
  36519. throw RangeError("radix");
  36520. var n;
  36521. if (0 < (n = e.indexOf("-")))
  36522. throw Error("interior hyphen");
  36523. if (0 === n)
  36524. return h(e.substring(1), t, i).neg();
  36525. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36526. var s = Math.min(8, e.length - a)
  36527. , l = parseInt(e.substring(a, a + s), i);
  36528. if (s < 8) {
  36529. var c = f(u(i, s));
  36530. o = o.mul(c).add(f(l))
  36531. } else
  36532. o = (o = o.mul(r)).add(f(l))
  36533. }
  36534. return o.unsigned = t,
  36535. o
  36536. }
  36537. function m(e) {
  36538. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36539. }
  36540. Object.defineProperty(n.prototype, "__isLong__", {
  36541. value: !0,
  36542. enumerable: !1,
  36543. configurable: !1
  36544. }),
  36545. n.isLong = p;
  36546. var o = {}
  36547. , a = {};
  36548. n.fromInt = e,
  36549. n.fromNumber = f,
  36550. n.fromBits = g;
  36551. var u = Math.pow;
  36552. n.fromString = h,
  36553. n.fromValue = m;
  36554. var i = 4294967296
  36555. , r = 0x10000000000000000
  36556. , s = r / 2
  36557. , v = e(1 << 24)
  36558. , y = e(0);
  36559. n.ZERO = y;
  36560. var l = e(0, !0);
  36561. n.UZERO = l;
  36562. var c = e(1);
  36563. n.ONE = c;
  36564. var d = e(1, !0);
  36565. n.UONE = d;
  36566. var A = e(-1);
  36567. n.NEG_ONE = A;
  36568. var C = g(-1, 2147483647, !1);
  36569. n.MAX_VALUE = C;
  36570. var I = g(-1, -1, !0);
  36571. n.MAX_UNSIGNED_VALUE = I;
  36572. var E = g(0, -2147483648, !1);
  36573. n.MIN_VALUE = E;
  36574. var t = n.prototype;
  36575. return t.toInt = function() {
  36576. return this.unsigned ? this.low >>> 0 : this.low
  36577. }
  36578. ,
  36579. t.toNumber = function() {
  36580. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36581. }
  36582. ,
  36583. t.toString = function(e) {
  36584. if ((e = e || 10) < 2 || 36 < e)
  36585. throw RangeError("radix");
  36586. if (this.isZero())
  36587. return "0";
  36588. if (this.isNegative()) {
  36589. if (this.eq(E)) {
  36590. var t = f(e)
  36591. , i = this.div(t)
  36592. , n = i.mul(t).sub(this);
  36593. return i.toString(e) + n.toInt().toString(e)
  36594. }
  36595. return "-" + this.neg().toString(e)
  36596. }
  36597. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36598. var s = o.div(r)
  36599. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36600. if ((o = s).isZero())
  36601. return l + a;
  36602. for (; l.length < 6; )
  36603. l = "0" + l;
  36604. a = "" + l + a
  36605. }
  36606. }
  36607. ,
  36608. t.getHighBits = function() {
  36609. return this.high
  36610. }
  36611. ,
  36612. t.getHighBitsUnsigned = function() {
  36613. return this.high >>> 0
  36614. }
  36615. ,
  36616. t.getLowBits = function() {
  36617. return this.low
  36618. }
  36619. ,
  36620. t.getLowBitsUnsigned = function() {
  36621. return this.low >>> 0
  36622. }
  36623. ,
  36624. t.getNumBitsAbs = function() {
  36625. if (this.isNegative())
  36626. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36627. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36628. ;
  36629. return 0 != this.high ? t + 33 : t + 1
  36630. }
  36631. ,
  36632. t.isZero = function() {
  36633. return 0 === this.high && 0 === this.low
  36634. }
  36635. ,
  36636. t.isNegative = function() {
  36637. return !this.unsigned && this.high < 0
  36638. }
  36639. ,
  36640. t.isPositive = function() {
  36641. return this.unsigned || 0 <= this.high
  36642. }
  36643. ,
  36644. t.isOdd = function() {
  36645. return 1 == (1 & this.low)
  36646. }
  36647. ,
  36648. t.isEven = function() {
  36649. return 0 == (1 & this.low)
  36650. }
  36651. ,
  36652. t.equals = function(e) {
  36653. return p(e) || (e = m(e)),
  36654. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36655. }
  36656. ,
  36657. t.eq = t.equals,
  36658. t.notEquals = function(e) {
  36659. return !this.eq(e)
  36660. }
  36661. ,
  36662. t.neq = t.notEquals,
  36663. t.lessThan = function(e) {
  36664. return this.comp(e) < 0
  36665. }
  36666. ,
  36667. t.lt = t.lessThan,
  36668. t.lessThanOrEqual = function(e) {
  36669. return this.comp(e) <= 0
  36670. }
  36671. ,
  36672. t.lte = t.lessThanOrEqual,
  36673. t.greaterThan = function(e) {
  36674. return 0 < this.comp(e)
  36675. }
  36676. ,
  36677. t.gt = t.greaterThan,
  36678. t.greaterThanOrEqual = function(e) {
  36679. return 0 <= this.comp(e)
  36680. }
  36681. ,
  36682. t.gte = t.greaterThanOrEqual,
  36683. t.compare = function(e) {
  36684. if (p(e) || (e = m(e)),
  36685. this.eq(e))
  36686. return 0;
  36687. var t = this.isNegative()
  36688. , i = e.isNegative();
  36689. return t && !i ? -1 : !t && i ? 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
  36690. }
  36691. ,
  36692. t.comp = t.compare,
  36693. t.negate = function() {
  36694. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36695. }
  36696. ,
  36697. t.neg = t.negate,
  36698. t.add = function(e) {
  36699. p(e) || (e = m(e));
  36700. var t = this.high >>> 16
  36701. , i = 65535 & this.high
  36702. , n = this.low >>> 16
  36703. , r = 65535 & this.low
  36704. , o = e.high >>> 16
  36705. , a = 65535 & e.high
  36706. , s = e.low >>> 16
  36707. , l = 0
  36708. , c = 0
  36709. , h = 0
  36710. , u = 0;
  36711. return h += (u += r + (65535 & e.low)) >>> 16,
  36712. c += (h += n + s) >>> 16,
  36713. l += (c += i + a) >>> 16,
  36714. l += t + o,
  36715. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36716. }
  36717. ,
  36718. t.subtract = function(e) {
  36719. return p(e) || (e = m(e)),
  36720. this.add(e.neg())
  36721. }
  36722. ,
  36723. t.sub = t.subtract,
  36724. t.multiply = function(e) {
  36725. if (this.isZero())
  36726. return y;
  36727. if (p(e) || (e = m(e)),
  36728. e.isZero())
  36729. return y;
  36730. if (this.eq(E))
  36731. return e.isOdd() ? E : y;
  36732. if (e.eq(E))
  36733. return this.isOdd() ? E : y;
  36734. if (this.isNegative())
  36735. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36736. if (e.isNegative())
  36737. return this.mul(e.neg()).neg();
  36738. if (this.lt(v) && e.lt(v))
  36739. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36740. var t = this.high >>> 16
  36741. , i = 65535 & this.high
  36742. , n = this.low >>> 16
  36743. , r = 65535 & this.low
  36744. , o = e.high >>> 16
  36745. , a = 65535 & e.high
  36746. , s = e.low >>> 16
  36747. , l = 65535 & e.low
  36748. , c = 0
  36749. , h = 0
  36750. , u = 0
  36751. , d = 0;
  36752. return u += (d += r * l) >>> 16,
  36753. h += (u += n * l) >>> 16,
  36754. u &= 65535,
  36755. h += (u += r * s) >>> 16,
  36756. c += (h += i * l) >>> 16,
  36757. h &= 65535,
  36758. c += (h += n * s) >>> 16,
  36759. h &= 65535,
  36760. c += (h += r * a) >>> 16,
  36761. c += t * l + i * s + n * a + r * o,
  36762. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36763. }
  36764. ,
  36765. t.mul = t.multiply,
  36766. t.divide = function(e) {
  36767. if (p(e) || (e = m(e)),
  36768. e.isZero())
  36769. throw Error("division by zero");
  36770. if (this.isZero())
  36771. return this.unsigned ? l : y;
  36772. var t, i, n;
  36773. if (this.unsigned) {
  36774. if (e.unsigned || (e = e.toUnsigned()),
  36775. e.gt(this))
  36776. return l;
  36777. if (e.gt(this.shru(1)))
  36778. return d;
  36779. n = l
  36780. } else {
  36781. if (this.eq(E))
  36782. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  36783. n = t.add(i.div(e)));
  36784. if (e.eq(E))
  36785. return this.unsigned ? l : y;
  36786. if (this.isNegative())
  36787. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36788. if (e.isNegative())
  36789. return this.div(e.neg()).neg();
  36790. n = y
  36791. }
  36792. for (i = this; i.gte(e); ) {
  36793. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36794. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  36795. s = (a = f(t -= o, this.unsigned)).mul(e);
  36796. a.isZero() && (a = c),
  36797. n = n.add(a),
  36798. i = i.sub(s)
  36799. }
  36800. return n
  36801. }
  36802. ,
  36803. t.div = t.divide,
  36804. t.modulo = function(e) {
  36805. return p(e) || (e = m(e)),
  36806. this.sub(this.div(e).mul(e))
  36807. }
  36808. ,
  36809. t.mod = t.modulo,
  36810. t.not = function() {
  36811. return g(~this.low, ~this.high, this.unsigned)
  36812. }
  36813. ,
  36814. t.and = function(e) {
  36815. return p(e) || (e = m(e)),
  36816. g(this.low & e.low, this.high & e.high, this.unsigned)
  36817. }
  36818. ,
  36819. t.or = function(e) {
  36820. return p(e) || (e = m(e)),
  36821. g(this.low | e.low, this.high | e.high, this.unsigned)
  36822. }
  36823. ,
  36824. t.xor = function(e) {
  36825. return p(e) || (e = m(e)),
  36826. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36827. }
  36828. ,
  36829. t.shiftLeft = function(e) {
  36830. return p(e) && (e = e.toInt()),
  36831. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  36832. }
  36833. ,
  36834. t.shl = t.shiftLeft,
  36835. t.shiftRight = function(e) {
  36836. return p(e) && (e = e.toInt()),
  36837. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  36838. }
  36839. ,
  36840. t.shr = t.shiftRight,
  36841. t.shiftRightUnsigned = function(e) {
  36842. if (p(e) && (e = e.toInt()),
  36843. 0 === (e &= 63))
  36844. return this;
  36845. var t = this.high;
  36846. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36847. }
  36848. ,
  36849. t.shru = t.shiftRightUnsigned,
  36850. t.toSigned = function() {
  36851. return this.unsigned ? g(this.low, this.high, !1) : this
  36852. }
  36853. ,
  36854. t.toUnsigned = function() {
  36855. return this.unsigned ? this : g(this.low, this.high, !0)
  36856. }
  36857. ,
  36858. t.toBytes = function(e) {
  36859. return e ? this.toBytesLE() : this.toBytesBE()
  36860. }
  36861. ,
  36862. t.toBytesLE = function() {
  36863. var e = this.high
  36864. , t = this.low;
  36865. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36866. }
  36867. ,
  36868. t.toBytesBE = function() {
  36869. var e = this.high
  36870. , t = this.low;
  36871. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36872. }
  36873. ,
  36874. n
  36875. }
  36876. ,
  36877. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  36878. }
  36879. , {}],
  36880. 217: [function(e, t, i) {
  36881. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  36882. REVISION: "75"
  36883. };
  36884. function Ii(e, t) {
  36885. return e.distance - t.distance
  36886. }
  36887. function Ei(e, t, i, n) {
  36888. if (!1 !== e.visible && (e.raycast(t, i),
  36889. !0 === n))
  36890. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36891. Ei(r[o], t, i, !0)
  36892. }
  36893. function _i(e, t, i) {
  36894. return i < 0 && (i += 1),
  36895. 1 < i && (i -= 1),
  36896. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36897. }
  36898. function bi(e, t, i, n, r, o, a) {
  36899. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36900. r.multiplyScalar(Vt.x),
  36901. o.multiplyScalar(Vt.y),
  36902. a.multiplyScalar(Vt.z),
  36903. r.add(o).add(a),
  36904. r.clone()
  36905. }
  36906. function wi(e, t, i, n, r, o, a) {
  36907. var s = e.material;
  36908. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36909. return null;
  36910. Ut.copy(a),
  36911. Ut.applyMatrix4(e.matrixWorld);
  36912. var l = t.ray.origin.distanceTo(Ut);
  36913. return l < t.near || l > t.far ? null : {
  36914. distance: l,
  36915. point: Ut.clone(),
  36916. object: e
  36917. }
  36918. }
  36919. function Ti(e, t, i, n, r, o, a, s) {
  36920. Mt.fromArray(n, 3 * o),
  36921. Rt.fromArray(n, 3 * a),
  36922. Pt.fromArray(n, 3 * s);
  36923. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36924. return l && (r && (Nt.fromArray(r, 2 * o),
  36925. Ft.fromArray(r, 2 * a),
  36926. Bt.fromArray(r, 2 * s),
  36927. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36928. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36929. l.faceIndex = o),
  36930. l
  36931. }
  36932. function xi() {}
  36933. function Si(e, t, i, n, r, o) {
  36934. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36935. if (s = e[o[t]].x,
  36936. l = e[o[t]].y,
  36937. c = e[o[i]].x,
  36938. h = e[o[i]].y,
  36939. u = e[o[n]].x,
  36940. d = e[o[n]].y,
  36941. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36942. return !1;
  36943. for (g = u - c,
  36944. m = d - h,
  36945. v = s - u,
  36946. y = l - d,
  36947. A = c - s,
  36948. C = h - l,
  36949. a = 0; a < r; a++)
  36950. if (p = e[o[a]].x,
  36951. f = e[o[a]].y,
  36952. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36953. E = v * (f - d) - y * (p - u),
  36954. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36955. return !1;
  36956. return !0
  36957. }
  36958. function Mi(e) {
  36959. switch (e) {
  36960. case Ci.LinearEncoding:
  36961. return ["Linear", "( value )"];
  36962. case Ci.sRGBEncoding:
  36963. return ["sRGB", "( value )"];
  36964. case Ci.RGBEEncoding:
  36965. return ["RGBE", "( value )"];
  36966. case Ci.RGBM7Encoding:
  36967. return ["RGBM", "( value, 7.0 )"];
  36968. case Ci.RGBM16Encoding:
  36969. return ["RGBM", "( value, 16.0 )"];
  36970. case Ci.RGBDEncoding:
  36971. return ["RGBD", "( value, 256.0 )"];
  36972. case Ci.GammaEncoding:
  36973. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36974. default:
  36975. throw new Error("unsupported encoding: " + e)
  36976. }
  36977. }
  36978. function Ri(e, t) {
  36979. var i = Mi(t);
  36980. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36981. }
  36982. function Pi(e) {
  36983. return "" !== e
  36984. }
  36985. function Oi(e, t) {
  36986. 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)
  36987. }
  36988. function Li(e) {
  36989. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36990. var i = Ci.ShaderChunk[t];
  36991. if (void 0 === i)
  36992. throw new Error("Can not resolve #include <" + t + ">");
  36993. return Li(i)
  36994. })
  36995. }
  36996. function Di(e) {
  36997. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36998. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36999. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37000. return r
  37001. })
  37002. }
  37003. function Ni(e, t, i, n) {
  37004. gi.set(t, i, n).unproject(mi);
  37005. var r = fi[e];
  37006. if (void 0 !== r)
  37007. for (var o = 0, a = r.length; o < a; o++)
  37008. pi.vertices[r[o]].copy(gi)
  37009. }
  37010. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37011. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37012. void 0 === Math.sign && (Math.sign = function(e) {
  37013. return e < 0 ? -1 : 0 < e ? 1 : +e
  37014. }
  37015. ),
  37016. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37017. get: function() {
  37018. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37019. }
  37020. }),
  37021. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37022. writable: !0,
  37023. configurable: !0,
  37024. value: function(e) {
  37025. "use strict";
  37026. if (null == e)
  37027. throw new TypeError("Cannot convert first argument to object");
  37028. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37029. var r = arguments[i];
  37030. if (null != r) {
  37031. r = Object(r);
  37032. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37033. var l = o[a]
  37034. , c = Object.getOwnPropertyDescriptor(r, l);
  37035. void 0 !== c && c.enumerable && (t[l] = r[l])
  37036. }
  37037. }
  37038. }
  37039. return t
  37040. }
  37041. }),
  37042. Ci.MOUSE = {
  37043. LEFT: 0,
  37044. MIDDLE: 1,
  37045. RIGHT: 2
  37046. },
  37047. Ci.CullFaceNone = 0,
  37048. Ci.CullFaceBack = 1,
  37049. Ci.CullFaceFront = 2,
  37050. Ci.CullFaceFrontBack = 3,
  37051. Ci.FrontFaceDirectionCW = 0,
  37052. Ci.FrontFaceDirectionCCW = 1,
  37053. Ci.BasicShadowMap = 0,
  37054. Ci.PCFShadowMap = 1,
  37055. Ci.PCFSoftShadowMap = 2,
  37056. Ci.FrontSide = 0,
  37057. Ci.BackSide = 1,
  37058. Ci.DoubleSide = 2,
  37059. Ci.FlatShading = 1,
  37060. Ci.SmoothShading = 2,
  37061. Ci.NoColors = 0,
  37062. Ci.FaceColors = 1,
  37063. Ci.VertexColors = 2,
  37064. Ci.NoBlending = 0,
  37065. Ci.NormalBlending = 1,
  37066. Ci.AdditiveBlending = 2,
  37067. Ci.SubtractiveBlending = 3,
  37068. Ci.MultiplyBlending = 4,
  37069. Ci.CustomBlending = 5,
  37070. Ci.AddEquation = 100,
  37071. Ci.SubtractEquation = 101,
  37072. Ci.ReverseSubtractEquation = 102,
  37073. Ci.MinEquation = 103,
  37074. Ci.MaxEquation = 104,
  37075. Ci.ZeroFactor = 200,
  37076. Ci.OneFactor = 201,
  37077. Ci.SrcColorFactor = 202,
  37078. Ci.OneMinusSrcColorFactor = 203,
  37079. Ci.SrcAlphaFactor = 204,
  37080. Ci.OneMinusSrcAlphaFactor = 205,
  37081. Ci.DstAlphaFactor = 206,
  37082. Ci.OneMinusDstAlphaFactor = 207,
  37083. Ci.DstColorFactor = 208,
  37084. Ci.OneMinusDstColorFactor = 209,
  37085. Ci.SrcAlphaSaturateFactor = 210,
  37086. Ci.NeverDepth = 0,
  37087. Ci.AlwaysDepth = 1,
  37088. Ci.LessDepth = 2,
  37089. Ci.LessEqualDepth = 3,
  37090. Ci.EqualDepth = 4,
  37091. Ci.GreaterEqualDepth = 5,
  37092. Ci.GreaterDepth = 6,
  37093. Ci.NotEqualDepth = 7,
  37094. Ci.MultiplyOperation = 0,
  37095. Ci.MixOperation = 1,
  37096. Ci.AddOperation = 2,
  37097. Ci.NoToneMapping = 0,
  37098. Ci.LinearToneMapping = 1,
  37099. Ci.ReinhardToneMapping = 2,
  37100. Ci.Uncharted2ToneMapping = 3,
  37101. Ci.CineonToneMapping = 4,
  37102. Ci.UVMapping = 300,
  37103. Ci.CubeReflectionMapping = 301,
  37104. Ci.CubeRefractionMapping = 302,
  37105. Ci.EquirectangularReflectionMapping = 303,
  37106. Ci.EquirectangularRefractionMapping = 304,
  37107. Ci.SphericalReflectionMapping = 305,
  37108. Ci.CubeUVReflectionMapping = 306,
  37109. Ci.CubeUVRefractionMapping = 307,
  37110. Ci.RepeatWrapping = 1e3,
  37111. Ci.ClampToEdgeWrapping = 1001,
  37112. Ci.MirroredRepeatWrapping = 1002,
  37113. Ci.NearestFilter = 1003,
  37114. Ci.NearestMipMapNearestFilter = 1004,
  37115. Ci.NearestMipMapLinearFilter = 1005,
  37116. Ci.LinearFilter = 1006,
  37117. Ci.LinearMipMapNearestFilter = 1007,
  37118. Ci.LinearMipMapLinearFilter = 1008,
  37119. Ci.UnsignedByteType = 1009,
  37120. Ci.ByteType = 1010,
  37121. Ci.ShortType = 1011,
  37122. Ci.UnsignedShortType = 1012,
  37123. Ci.IntType = 1013,
  37124. Ci.UnsignedIntType = 1014,
  37125. Ci.FloatType = 1015,
  37126. Ci.HalfFloatType = 1025,
  37127. Ci.UnsignedShort4444Type = 1016,
  37128. Ci.UnsignedShort5551Type = 1017,
  37129. Ci.UnsignedShort565Type = 1018,
  37130. Ci.AlphaFormat = 1019,
  37131. Ci.RGBFormat = 1020,
  37132. Ci.RGBAFormat = 1021,
  37133. Ci.LuminanceFormat = 1022,
  37134. Ci.LuminanceAlphaFormat = 1023,
  37135. Ci.RGBEFormat = Ci.RGBAFormat,
  37136. Ci.RGB_S3TC_DXT1_Format = 2001,
  37137. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37138. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37139. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37140. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37141. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37142. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37143. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37144. Ci.RGB_ETC1_Format = 2151,
  37145. Ci.LoopOnce = 2200,
  37146. Ci.LoopRepeat = 2201,
  37147. Ci.LoopPingPong = 2202,
  37148. Ci.InterpolateDiscrete = 2300,
  37149. Ci.InterpolateLinear = 2301,
  37150. Ci.InterpolateSmooth = 2302,
  37151. Ci.ZeroCurvatureEnding = 2400,
  37152. Ci.ZeroSlopeEnding = 2401,
  37153. Ci.WrapAroundEnding = 2402,
  37154. Ci.TrianglesDrawMode = 0,
  37155. Ci.TriangleStripDrawMode = 1,
  37156. Ci.TriangleFanDrawMode = 2,
  37157. Ci.LinearEncoding = 3e3,
  37158. Ci.sRGBEncoding = 3001,
  37159. Ci.GammaEncoding = 3007,
  37160. Ci.RGBEEncoding = 3002,
  37161. Ci.LogLuvEncoding = 3003,
  37162. Ci.RGBM7Encoding = 3004,
  37163. Ci.RGBM16Encoding = 3005,
  37164. Ci.RGBDEncoding = 3006,
  37165. Ci.Color = function(e) {
  37166. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37167. }
  37168. ,
  37169. Ci.Color.prototype = {
  37170. constructor: Ci.Color,
  37171. r: 1,
  37172. g: 1,
  37173. b: 1,
  37174. set: function(e) {
  37175. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37176. this
  37177. },
  37178. setScalar: function(e) {
  37179. this.r = e,
  37180. this.g = e,
  37181. this.b = e
  37182. },
  37183. setHex: function(e) {
  37184. return e = Math.floor(e),
  37185. this.r = (e >> 16 & 255) / 255,
  37186. this.g = (e >> 8 & 255) / 255,
  37187. this.b = (255 & e) / 255,
  37188. this
  37189. },
  37190. setRGB: function(e, t, i) {
  37191. return this.r = e,
  37192. this.g = t,
  37193. this.b = i,
  37194. this
  37195. },
  37196. setHSL: function(e, t, i) {
  37197. if (e = Ci.Math.euclideanModulo(e, 1),
  37198. t = Ci.Math.clamp(t, 0, 1),
  37199. i = Ci.Math.clamp(i, 0, 1),
  37200. 0 === t)
  37201. this.r = this.g = this.b = i;
  37202. else {
  37203. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37204. , r = 2 * i - n;
  37205. this.r = _i(r, n, e + 1 / 3),
  37206. this.g = _i(r, n, e),
  37207. this.b = _i(r, n, e - 1 / 3)
  37208. }
  37209. return this
  37210. },
  37211. setStyle: function(t) {
  37212. function e(e) {
  37213. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37214. }
  37215. var i;
  37216. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37217. var n, r = i[1], o = i[2];
  37218. switch (r) {
  37219. case "rgb":
  37220. case "rgba":
  37221. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37222. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37223. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37224. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37225. e(n[5]),
  37226. this;
  37227. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37228. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37229. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37230. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37231. e(n[5]),
  37232. this;
  37233. break;
  37234. case "hsl":
  37235. case "hsla":
  37236. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37237. var a = parseFloat(n[1]) / 360
  37238. , s = parseInt(n[2], 10) / 100
  37239. , l = parseInt(n[3], 10) / 100;
  37240. return e(n[5]),
  37241. this.setHSL(a, s, l)
  37242. }
  37243. }
  37244. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37245. var c, h = (c = i[1]).length;
  37246. if (3 === h)
  37247. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37248. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37249. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37250. this;
  37251. if (6 === h)
  37252. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37253. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37254. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37255. this
  37256. }
  37257. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37258. return this
  37259. },
  37260. clone: function() {
  37261. return new this.constructor(this.r,this.g,this.b)
  37262. },
  37263. copy: function(e) {
  37264. return this.r = e.r,
  37265. this.g = e.g,
  37266. this.b = e.b,
  37267. this
  37268. },
  37269. copyGammaToLinear: function(e, t) {
  37270. return void 0 === t && (t = 2),
  37271. this.r = Math.pow(e.r, t),
  37272. this.g = Math.pow(e.g, t),
  37273. this.b = Math.pow(e.b, t),
  37274. this
  37275. },
  37276. copyLinearToGamma: function(e, t) {
  37277. void 0 === t && (t = 2);
  37278. var i = 0 < t ? 1 / t : 1;
  37279. return this.r = Math.pow(e.r, i),
  37280. this.g = Math.pow(e.g, i),
  37281. this.b = Math.pow(e.b, i),
  37282. this
  37283. },
  37284. convertGammaToLinear: function() {
  37285. var e = this.r
  37286. , t = this.g
  37287. , i = this.b;
  37288. return this.r = e * e,
  37289. this.g = t * t,
  37290. this.b = i * i,
  37291. this
  37292. },
  37293. convertLinearToGamma: function() {
  37294. return this.r = Math.sqrt(this.r),
  37295. this.g = Math.sqrt(this.g),
  37296. this.b = Math.sqrt(this.b),
  37297. this
  37298. },
  37299. getHex: function() {
  37300. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37301. },
  37302. getHexString: function() {
  37303. return ("000000" + this.getHex().toString(16)).slice(-6)
  37304. },
  37305. getHSL: function(e) {
  37306. var t, i, n = e || {
  37307. h: 0,
  37308. s: 0,
  37309. l: 0
  37310. }, 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;
  37311. if (l === s)
  37312. i = t = 0;
  37313. else {
  37314. var h = s - l;
  37315. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37316. s) {
  37317. case r:
  37318. t = (o - a) / h + (o < a ? 6 : 0);
  37319. break;
  37320. case o:
  37321. t = (a - r) / h + 2;
  37322. break;
  37323. case a:
  37324. t = (r - o) / h + 4
  37325. }
  37326. t /= 6
  37327. }
  37328. return n.h = t,
  37329. n.s = i,
  37330. n.l = c,
  37331. n
  37332. },
  37333. getStyle: function() {
  37334. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37335. },
  37336. offsetHSL: function(e, t, i) {
  37337. var n = this.getHSL();
  37338. return n.h += e,
  37339. n.s += t,
  37340. n.l += i,
  37341. this.setHSL(n.h, n.s, n.l),
  37342. this
  37343. },
  37344. add: function(e) {
  37345. return this.r += e.r,
  37346. this.g += e.g,
  37347. this.b += e.b,
  37348. this
  37349. },
  37350. addColors: function(e, t) {
  37351. return this.r = e.r + t.r,
  37352. this.g = e.g + t.g,
  37353. this.b = e.b + t.b,
  37354. this
  37355. },
  37356. addScalar: function(e) {
  37357. return this.r += e,
  37358. this.g += e,
  37359. this.b += e,
  37360. this
  37361. },
  37362. multiply: function(e) {
  37363. return this.r *= e.r,
  37364. this.g *= e.g,
  37365. this.b *= e.b,
  37366. this
  37367. },
  37368. multiplyScalar: function(e) {
  37369. return this.r *= e,
  37370. this.g *= e,
  37371. this.b *= e,
  37372. this
  37373. },
  37374. lerp: function(e, t) {
  37375. return this.r += (e.r - this.r) * t,
  37376. this.g += (e.g - this.g) * t,
  37377. this.b += (e.b - this.b) * t,
  37378. this
  37379. },
  37380. equals: function(e) {
  37381. return e.r === this.r && e.g === this.g && e.b === this.b
  37382. },
  37383. fromArray: function(e, t) {
  37384. return void 0 === t && (t = 0),
  37385. this.r = e[t],
  37386. this.g = e[t + 1],
  37387. this.b = e[t + 2],
  37388. this
  37389. },
  37390. toArray: function(e, t) {
  37391. return void 0 === e && (e = []),
  37392. void 0 === t && (t = 0),
  37393. e[t] = this.r,
  37394. e[t + 1] = this.g,
  37395. e[t + 2] = this.b,
  37396. e
  37397. }
  37398. },
  37399. Ci.ColorKeywords = {
  37400. aliceblue: 15792383,
  37401. antiquewhite: 16444375,
  37402. aqua: 65535,
  37403. aquamarine: 8388564,
  37404. azure: 15794175,
  37405. beige: 16119260,
  37406. bisque: 16770244,
  37407. black: 0,
  37408. blanchedalmond: 16772045,
  37409. blue: 255,
  37410. blueviolet: 9055202,
  37411. brown: 10824234,
  37412. burlywood: 14596231,
  37413. cadetblue: 6266528,
  37414. chartreuse: 8388352,
  37415. chocolate: 13789470,
  37416. coral: 16744272,
  37417. cornflowerblue: 6591981,
  37418. cornsilk: 16775388,
  37419. crimson: 14423100,
  37420. cyan: 65535,
  37421. darkblue: 139,
  37422. darkcyan: 35723,
  37423. darkgoldenrod: 12092939,
  37424. darkgray: 11119017,
  37425. darkgreen: 25600,
  37426. darkgrey: 11119017,
  37427. darkkhaki: 12433259,
  37428. darkmagenta: 9109643,
  37429. darkolivegreen: 5597999,
  37430. darkorange: 16747520,
  37431. darkorchid: 10040012,
  37432. darkred: 9109504,
  37433. darksalmon: 15308410,
  37434. darkseagreen: 9419919,
  37435. darkslateblue: 4734347,
  37436. darkslategray: 3100495,
  37437. darkslategrey: 3100495,
  37438. darkturquoise: 52945,
  37439. darkviolet: 9699539,
  37440. deeppink: 16716947,
  37441. deepskyblue: 49151,
  37442. dimgray: 6908265,
  37443. dimgrey: 6908265,
  37444. dodgerblue: 2003199,
  37445. firebrick: 11674146,
  37446. floralwhite: 16775920,
  37447. forestgreen: 2263842,
  37448. fuchsia: 16711935,
  37449. gainsboro: 14474460,
  37450. ghostwhite: 16316671,
  37451. gold: 16766720,
  37452. goldenrod: 14329120,
  37453. gray: 8421504,
  37454. green: 32768,
  37455. greenyellow: 11403055,
  37456. grey: 8421504,
  37457. honeydew: 15794160,
  37458. hotpink: 16738740,
  37459. indianred: 13458524,
  37460. indigo: 4915330,
  37461. ivory: 16777200,
  37462. khaki: 15787660,
  37463. lavender: 15132410,
  37464. lavenderblush: 16773365,
  37465. lawngreen: 8190976,
  37466. lemonchiffon: 16775885,
  37467. lightblue: 11393254,
  37468. lightcoral: 15761536,
  37469. lightcyan: 14745599,
  37470. lightgoldenrodyellow: 16448210,
  37471. lightgray: 13882323,
  37472. lightgreen: 9498256,
  37473. lightgrey: 13882323,
  37474. lightpink: 16758465,
  37475. lightsalmon: 16752762,
  37476. lightseagreen: 2142890,
  37477. lightskyblue: 8900346,
  37478. lightslategray: 7833753,
  37479. lightslategrey: 7833753,
  37480. lightsteelblue: 11584734,
  37481. lightyellow: 16777184,
  37482. lime: 65280,
  37483. limegreen: 3329330,
  37484. linen: 16445670,
  37485. magenta: 16711935,
  37486. maroon: 8388608,
  37487. mediumaquamarine: 6737322,
  37488. mediumblue: 205,
  37489. mediumorchid: 12211667,
  37490. mediumpurple: 9662683,
  37491. mediumseagreen: 3978097,
  37492. mediumslateblue: 8087790,
  37493. mediumspringgreen: 64154,
  37494. mediumturquoise: 4772300,
  37495. mediumvioletred: 13047173,
  37496. midnightblue: 1644912,
  37497. mintcream: 16121850,
  37498. mistyrose: 16770273,
  37499. moccasin: 16770229,
  37500. navajowhite: 16768685,
  37501. navy: 128,
  37502. oldlace: 16643558,
  37503. olive: 8421376,
  37504. olivedrab: 7048739,
  37505. orange: 16753920,
  37506. orangered: 16729344,
  37507. orchid: 14315734,
  37508. palegoldenrod: 15657130,
  37509. palegreen: 10025880,
  37510. paleturquoise: 11529966,
  37511. palevioletred: 14381203,
  37512. papayawhip: 16773077,
  37513. peachpuff: 16767673,
  37514. peru: 13468991,
  37515. pink: 16761035,
  37516. plum: 14524637,
  37517. powderblue: 11591910,
  37518. purple: 8388736,
  37519. red: 16711680,
  37520. rosybrown: 12357519,
  37521. royalblue: 4286945,
  37522. saddlebrown: 9127187,
  37523. salmon: 16416882,
  37524. sandybrown: 16032864,
  37525. seagreen: 3050327,
  37526. seashell: 16774638,
  37527. sienna: 10506797,
  37528. silver: 12632256,
  37529. skyblue: 8900331,
  37530. slateblue: 6970061,
  37531. slategray: 7372944,
  37532. slategrey: 7372944,
  37533. snow: 16775930,
  37534. springgreen: 65407,
  37535. steelblue: 4620980,
  37536. tan: 13808780,
  37537. teal: 32896,
  37538. thistle: 14204888,
  37539. tomato: 16737095,
  37540. turquoise: 4251856,
  37541. violet: 15631086,
  37542. wheat: 16113331,
  37543. white: 16777215,
  37544. whitesmoke: 16119285,
  37545. yellow: 16776960,
  37546. yellowgreen: 10145074
  37547. },
  37548. Ci.Quaternion = function(e, t, i, n) {
  37549. this._x = e || 0,
  37550. this._y = t || 0,
  37551. this._z = i || 0,
  37552. this._w = void 0 !== n ? n : 1
  37553. }
  37554. ,
  37555. Ci.Quaternion.prototype = {
  37556. constructor: Ci.Quaternion,
  37557. get x() {
  37558. return this._x
  37559. },
  37560. set x(e) {
  37561. this._x = e,
  37562. this.onChangeCallback()
  37563. },
  37564. get y() {
  37565. return this._y
  37566. },
  37567. set y(e) {
  37568. this._y = e,
  37569. this.onChangeCallback()
  37570. },
  37571. get z() {
  37572. return this._z
  37573. },
  37574. set z(e) {
  37575. this._z = e,
  37576. this.onChangeCallback()
  37577. },
  37578. get w() {
  37579. return this._w
  37580. },
  37581. set w(e) {
  37582. this._w = e,
  37583. this.onChangeCallback()
  37584. },
  37585. set: function(e, t, i, n) {
  37586. return this._x = e,
  37587. this._y = t,
  37588. this._z = i,
  37589. this._w = n,
  37590. this.onChangeCallback(),
  37591. this
  37592. },
  37593. clone: function() {
  37594. return new this.constructor(this._x,this._y,this._z,this._w)
  37595. },
  37596. toObject:function(){//add
  37597. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37598. },
  37599. copy: function(e) {
  37600. return this._x = e.x,
  37601. this._y = e.y,
  37602. this._z = e.z,
  37603. this._w = e.w,
  37604. this.onChangeCallback(),
  37605. this
  37606. },
  37607. setFromEuler: function(e, t) {
  37608. if (e instanceof Ci.Euler == 0)
  37609. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37610. var i = Math.cos(e._x / 2)
  37611. , n = Math.cos(e._y / 2)
  37612. , r = Math.cos(e._z / 2)
  37613. , o = Math.sin(e._x / 2)
  37614. , a = Math.sin(e._y / 2)
  37615. , s = Math.sin(e._z / 2)
  37616. , l = e.order;
  37617. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37618. this._y = i * a * r - o * n * s,
  37619. this._z = i * n * s + o * a * r,
  37620. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37621. this._y = i * a * r - o * n * s,
  37622. this._z = i * n * s - o * a * r,
  37623. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37624. this._y = i * a * r + o * n * s,
  37625. this._z = i * n * s + o * a * r,
  37626. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37627. this._y = i * a * r + o * n * s,
  37628. this._z = i * n * s - o * a * r,
  37629. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37630. this._y = i * a * r + o * n * s,
  37631. this._z = i * n * s - o * a * r,
  37632. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37633. this._y = i * a * r - o * n * s,
  37634. this._z = i * n * s + o * a * r,
  37635. this._w = i * n * r + o * a * s),
  37636. !1 !== t && this.onChangeCallback(),
  37637. this
  37638. },
  37639. setFromAxisAngle: function(e, t) {
  37640. var i = t / 2
  37641. , n = Math.sin(i);
  37642. return this._x = e.x * n,
  37643. this._y = e.y * n,
  37644. this._z = e.z * n,
  37645. this._w = Math.cos(i),
  37646. this.onChangeCallback(),
  37647. this
  37648. },
  37649. setFromRotationMatrix: function(e) {
  37650. 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;
  37651. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37652. this._w = .25 / t,
  37653. this._x = (h - l) * t,
  37654. this._y = (o - c) * t,
  37655. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37656. this._w = (h - l) / t,
  37657. this._x = .25 * t,
  37658. this._y = (r + a) / t,
  37659. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37660. this._w = (o - c) / t,
  37661. this._x = (r + a) / t,
  37662. this._y = .25 * t,
  37663. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37664. this._w = (a - r) / t,
  37665. this._x = (o + c) / t,
  37666. this._y = (l + h) / t,
  37667. this._z = .25 * t),
  37668. this.onChangeCallback(),
  37669. this
  37670. },
  37671. setFromUnitVectors: function(e, t) {
  37672. return void 0 === Be && (Be = new Ci.Vector3),
  37673. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37674. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  37675. this._x = Be.x,
  37676. this._y = Be.y,
  37677. this._z = Be.z,
  37678. this._w = Ve,
  37679. this.normalize(),
  37680. this
  37681. },
  37682. inverse: function() {
  37683. return this.conjugate().normalize(),
  37684. this
  37685. },
  37686. conjugate: function() {
  37687. return this._x *= -1,
  37688. this._y *= -1,
  37689. this._z *= -1,
  37690. this.onChangeCallback(),
  37691. this
  37692. },
  37693. dot: function(e) {
  37694. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37695. },
  37696. lengthSq: function() {
  37697. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37698. },
  37699. length: function() {
  37700. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37701. },
  37702. normalize: function() {
  37703. var e = this.length();
  37704. return 0 === e ? (this._x = 0,
  37705. this._y = 0,
  37706. this._z = 0,
  37707. this._w = 1) : (e = 1 / e,
  37708. this._x = this._x * e,
  37709. this._y = this._y * e,
  37710. this._z = this._z * e,
  37711. this._w = this._w * e),
  37712. this.onChangeCallback(),
  37713. this
  37714. },
  37715. multiply: function(e, t) {
  37716. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37717. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37718. },
  37719. multiplyQuaternions: function(e, t) {
  37720. var i = e._x
  37721. , n = e._y
  37722. , r = e._z
  37723. , o = e._w
  37724. , a = t._x
  37725. , s = t._y
  37726. , l = t._z
  37727. , c = t._w;
  37728. return this._x = i * c + o * a + n * l - r * s,
  37729. this._y = n * c + o * s + r * a - i * l,
  37730. this._z = r * c + o * l + i * s - n * a,
  37731. this._w = o * c - i * a - n * s - r * l,
  37732. this.onChangeCallback(),
  37733. this
  37734. },
  37735. slerp: function(e, t) {
  37736. if (0 === t)
  37737. return this;
  37738. if (1 === t)
  37739. return this.copy(e);
  37740. var i = this._x
  37741. , n = this._y
  37742. , r = this._z
  37743. , o = this._w
  37744. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37745. if (a < 0 ? (this._w = -e._w,
  37746. this._x = -e._x,
  37747. this._y = -e._y,
  37748. this._z = -e._z,
  37749. a = -a) : this.copy(e),
  37750. 1 <= a)
  37751. return this._w = o,
  37752. this._x = i,
  37753. this._y = n,
  37754. this._z = r,
  37755. this;
  37756. var s = Math.sqrt(1 - a * a);
  37757. if (Math.abs(s) < .001)
  37758. return this._w = .5 * (o + this._w),
  37759. this._x = .5 * (i + this._x),
  37760. this._y = .5 * (n + this._y),
  37761. this._z = .5 * (r + this._z),
  37762. this;
  37763. var l = Math.atan2(s, a)
  37764. , c = Math.sin((1 - t) * l) / s
  37765. , h = Math.sin(t * l) / s;
  37766. return this._w = o * c + this._w * h,
  37767. this._x = i * c + this._x * h,
  37768. this._y = n * c + this._y * h,
  37769. this._z = r * c + this._z * h,
  37770. this.onChangeCallback(),
  37771. this
  37772. },
  37773. equals: function(e) {
  37774. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37775. },
  37776. fromArray: function(e, t) {
  37777. return void 0 === t && (t = 0),
  37778. this._x = e[t],
  37779. this._y = e[t + 1],
  37780. this._z = e[t + 2],
  37781. this._w = e[t + 3],
  37782. this.onChangeCallback(),
  37783. this
  37784. },
  37785. toArray: function(e, t) {
  37786. return void 0 === e && (e = []),
  37787. void 0 === t && (t = 0),
  37788. e[t] = this._x,
  37789. e[t + 1] = this._y,
  37790. e[t + 2] = this._z,
  37791. e[t + 3] = this._w,
  37792. e
  37793. },
  37794. onChange: function(e) {
  37795. return this.onChangeCallback = e,
  37796. this
  37797. },
  37798. onChangeCallback: function() {}
  37799. },
  37800. Object.assign(Ci.Quaternion, {
  37801. slerp: function(e, t, i, n) {
  37802. return i.copy(e).slerp(t, n)
  37803. },
  37804. slerpFlat: function(e, t, i, n, r, o, a) {
  37805. var s = i[n + 0]
  37806. , l = i[n + 1]
  37807. , c = i[n + 2]
  37808. , h = i[n + 3]
  37809. , u = r[o + 0]
  37810. , d = r[o + 1]
  37811. , p = r[o + 2]
  37812. , f = r[o + 3];
  37813. if (h !== f || s !== u || l !== d || c !== p) {
  37814. var g = 1 - a
  37815. , m = s * u + l * d + c * p + h * f
  37816. , v = 0 <= m ? 1 : -1
  37817. , y = 1 - m * m;
  37818. if (y > Number.EPSILON) {
  37819. var A = Math.sqrt(y)
  37820. , C = Math.atan2(A, m * v);
  37821. g = Math.sin(g * C) / A,
  37822. a = Math.sin(a * C) / A
  37823. }
  37824. var I = a * v;
  37825. if (s = s * g + u * I,
  37826. l = l * g + d * I,
  37827. c = c * g + p * I,
  37828. h = h * g + f * I,
  37829. g === 1 - a) {
  37830. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37831. s *= E,
  37832. l *= E,
  37833. c *= E,
  37834. h *= E
  37835. }
  37836. }
  37837. e[t] = s,
  37838. e[t + 1] = l,
  37839. e[t + 2] = c,
  37840. e[t + 3] = h
  37841. }
  37842. }),
  37843. Ci.Vector2 = function(e, t) {
  37844. this.x = e || 0,
  37845. this.y = t || 0
  37846. }
  37847. ,
  37848. Ci.Vector2.prototype = {
  37849. constructor: Ci.Vector2,
  37850. get width() {
  37851. return this.x
  37852. },
  37853. set width(e) {
  37854. this.x = e
  37855. },
  37856. get height() {
  37857. return this.y
  37858. },
  37859. set height(e) {
  37860. this.y = e
  37861. },
  37862. set: function(e, t) {
  37863. return this.x = e,
  37864. this.y = t,
  37865. this
  37866. },
  37867. setScalar: function(e) {
  37868. return this.x = e,
  37869. this.y = e,
  37870. this
  37871. },
  37872. setX: function(e) {
  37873. return this.x = e,
  37874. this
  37875. },
  37876. setY: function(e) {
  37877. return this.y = e,
  37878. this
  37879. },
  37880. setComponent: function(e, t) {
  37881. switch (e) {
  37882. case 0:
  37883. this.x = t;
  37884. break;
  37885. case 1:
  37886. this.y = t;
  37887. break;
  37888. default:
  37889. throw new Error("index is out of range: " + e)
  37890. }
  37891. },
  37892. getComponent: function(e) {
  37893. switch (e) {
  37894. case 0:
  37895. return this.x;
  37896. case 1:
  37897. return this.y;
  37898. default:
  37899. throw new Error("index is out of range: " + e)
  37900. }
  37901. },
  37902. clone: function() {
  37903. return new this.constructor(this.x,this.y)
  37904. },
  37905. copy: function(e) {
  37906. return this.x = e.x,
  37907. this.y = e.y,
  37908. this
  37909. },
  37910. add: function(e, t) {
  37911. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37912. this.addVectors(e, t)) : (this.x += e.x,
  37913. this.y += e.y,
  37914. this)
  37915. },
  37916. addScalar: function(e) {
  37917. return this.x += e,
  37918. this.y += e,
  37919. this
  37920. },
  37921. addVectors: function(e, t) {
  37922. return this.x = e.x + t.x,
  37923. this.y = e.y + t.y,
  37924. this
  37925. },
  37926. addScaledVector: function(e, t) {
  37927. return this.x += e.x * t,
  37928. this.y += e.y * t,
  37929. this
  37930. },
  37931. sub: function(e, t) {
  37932. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37933. this.subVectors(e, t)) : (this.x -= e.x,
  37934. this.y -= e.y,
  37935. this)
  37936. },
  37937. subScalar: function(e) {
  37938. return this.x -= e,
  37939. this.y -= e,
  37940. this
  37941. },
  37942. subVectors: function(e, t) {
  37943. return this.x = e.x - t.x,
  37944. this.y = e.y - t.y,
  37945. this
  37946. },
  37947. multiply: function(e) {
  37948. return this.x *= e.x,
  37949. this.y *= e.y,
  37950. this
  37951. },
  37952. multiplyScalar: function(e) {
  37953. return isFinite(e) ? (this.x *= e,
  37954. this.y *= e) : (this.x = 0,
  37955. this.y = 0),
  37956. this
  37957. },
  37958. divide: function(e) {
  37959. return this.x /= e.x,
  37960. this.y /= e.y,
  37961. this
  37962. },
  37963. divideScalar: function(e) {
  37964. return this.multiplyScalar(1 / e)
  37965. },
  37966. min: function(e) {
  37967. return this.x = Math.min(this.x, e.x),
  37968. this.y = Math.min(this.y, e.y),
  37969. this
  37970. },
  37971. max: function(e) {
  37972. return this.x = Math.max(this.x, e.x),
  37973. this.y = Math.max(this.y, e.y),
  37974. this
  37975. },
  37976. clamp: function(e, t) {
  37977. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37978. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37979. this
  37980. },
  37981. clampScalar: function(e, t) {
  37982. return void 0 === Ne && (Ne = new Ci.Vector2,
  37983. Fe = new Ci.Vector2),
  37984. Ne.set(e, e),
  37985. Fe.set(t, t),
  37986. this.clamp(Ne, Fe)
  37987. },
  37988. clampLength: function(e, t) {
  37989. var i = this.length();
  37990. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37991. this
  37992. },
  37993. floor: function() {
  37994. return this.x = Math.floor(this.x),
  37995. this.y = Math.floor(this.y),
  37996. this
  37997. },
  37998. ceil: function() {
  37999. return this.x = Math.ceil(this.x),
  38000. this.y = Math.ceil(this.y),
  38001. this
  38002. },
  38003. round: function() {
  38004. return this.x = Math.round(this.x),
  38005. this.y = Math.round(this.y),
  38006. this
  38007. },
  38008. roundToZero: function() {
  38009. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38010. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38011. this
  38012. },
  38013. negate: function() {
  38014. return this.x = -this.x,
  38015. this.y = -this.y,
  38016. this
  38017. },
  38018. dot: function(e) {
  38019. return this.x * e.x + this.y * e.y
  38020. },
  38021. lengthSq: function() {
  38022. return this.x * this.x + this.y * this.y
  38023. },
  38024. length: function() {
  38025. return Math.sqrt(this.x * this.x + this.y * this.y)
  38026. },
  38027. lengthManhattan: function() {
  38028. return Math.abs(this.x) + Math.abs(this.y)
  38029. },
  38030. normalize: function() {
  38031. return this.divideScalar(this.length())
  38032. },
  38033. angle: function() {
  38034. var e = Math.atan2(this.y, this.x);
  38035. return e < 0 && (e += 2 * Math.PI),
  38036. e
  38037. },
  38038. distanceTo: function(e) {
  38039. return Math.sqrt(this.distanceToSquared(e))
  38040. },
  38041. distanceToSquared: function(e) {
  38042. var t = this.x - e.x
  38043. , i = this.y - e.y;
  38044. return t * t + i * i
  38045. },
  38046. setLength: function(e) {
  38047. return this.multiplyScalar(e / this.length())
  38048. },
  38049. lerp: function(e, t) {
  38050. return this.x += (e.x - this.x) * t,
  38051. this.y += (e.y - this.y) * t,
  38052. this
  38053. },
  38054. lerpVectors: function(e, t, i) {
  38055. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38056. this
  38057. },
  38058. equals: function(e) {
  38059. return e.x === this.x && e.y === this.y
  38060. },
  38061. fromArray: function(e, t) {
  38062. return void 0 === t && (t = 0),
  38063. this.x = e[t],
  38064. this.y = e[t + 1],
  38065. this
  38066. },
  38067. toArray: function(e, t) {
  38068. return void 0 === e && (e = []),
  38069. void 0 === t && (t = 0),
  38070. e[t] = this.x,
  38071. e[t + 1] = this.y,
  38072. e
  38073. },
  38074. fromAttribute: function(e, t, i) {
  38075. return void 0 === i && (i = 0),
  38076. t = t * e.itemSize + i,
  38077. this.x = e.array[t],
  38078. this.y = e.array[t + 1],
  38079. this
  38080. },
  38081. rotateAround: function(e, t) {
  38082. var i = Math.cos(t)
  38083. , n = Math.sin(t)
  38084. , r = this.x - e.x
  38085. , o = this.y - e.y;
  38086. return this.x = r * i - o * n + e.x,
  38087. this.y = r * n + o * i + e.y,
  38088. this
  38089. }
  38090. },
  38091. Ci.Vector3 = function(e, t, i) {
  38092. this.x = e || 0,
  38093. this.y = t || 0,
  38094. this.z = i || 0
  38095. }
  38096. ,
  38097. Ci.Vector3.prototype = {
  38098. constructor: Ci.Vector3,
  38099. set: function(e, t, i) {
  38100. return this.x = e,
  38101. this.y = t,
  38102. this.z = i,
  38103. this
  38104. },
  38105. setScalar: function(e) {
  38106. return this.x = e,
  38107. this.y = e,
  38108. this.z = e,
  38109. this
  38110. },
  38111. setX: function(e) {
  38112. return this.x = e,
  38113. this
  38114. },
  38115. setY: function(e) {
  38116. return this.y = e,
  38117. this
  38118. },
  38119. setZ: function(e) {
  38120. return this.z = e,
  38121. this
  38122. },
  38123. setComponent: function(e, t) {
  38124. switch (e) {
  38125. case 0:
  38126. this.x = t;
  38127. break;
  38128. case 1:
  38129. this.y = t;
  38130. break;
  38131. case 2:
  38132. this.z = t;
  38133. break;
  38134. default:
  38135. throw new Error("index is out of range: " + e)
  38136. }
  38137. },
  38138. getComponent: function(e) {
  38139. switch (e) {
  38140. case 0:
  38141. return this.x;
  38142. case 1:
  38143. return this.y;
  38144. case 2:
  38145. return this.z;
  38146. default:
  38147. throw new Error("index is out of range: " + e)
  38148. }
  38149. },
  38150. clone: function() {
  38151. return new this.constructor(this.x,this.y,this.z)
  38152. },
  38153. copy: function(e) {
  38154. return this.x = e.x,
  38155. this.y = e.y,
  38156. this.z = e.z,
  38157. this
  38158. },
  38159. add: function(e, t) {
  38160. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38161. this.addVectors(e, t)) : (this.x += e.x,
  38162. this.y += e.y,
  38163. this.z += e.z,
  38164. this)
  38165. },
  38166. addScalar: function(e) {
  38167. return this.x += e,
  38168. this.y += e,
  38169. this.z += e,
  38170. this
  38171. },
  38172. addVectors: function(e, t) {
  38173. return this.x = e.x + t.x,
  38174. this.y = e.y + t.y,
  38175. this.z = e.z + t.z,
  38176. this
  38177. },
  38178. addScaledVector: function(e, t) {
  38179. return this.x += e.x * t,
  38180. this.y += e.y * t,
  38181. this.z += e.z * t,
  38182. this
  38183. },
  38184. sub: function(e, t) {
  38185. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38186. this.subVectors(e, t)) : (this.x -= e.x,
  38187. this.y -= e.y,
  38188. this.z -= e.z,
  38189. this)
  38190. },
  38191. subScalar: function(e) {
  38192. return this.x -= e,
  38193. this.y -= e,
  38194. this.z -= e,
  38195. this
  38196. },
  38197. subVectors: function(e, t) {
  38198. return this.x = e.x - t.x,
  38199. this.y = e.y - t.y,
  38200. this.z = e.z - t.z,
  38201. this
  38202. },
  38203. multiply: function(e, t) {
  38204. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38205. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38206. this.y *= e.y,
  38207. this.z *= e.z,
  38208. this)
  38209. },
  38210. multiplyScalar: function(e) {
  38211. return isFinite(e) ? (this.x *= e,
  38212. this.y *= e,
  38213. this.z *= e) : (this.x = 0,
  38214. this.y = 0,
  38215. this.z = 0),
  38216. this
  38217. },
  38218. multiplyVectors: function(e, t) {
  38219. return this.x = e.x * t.x,
  38220. this.y = e.y * t.y,
  38221. this.z = e.z * t.z,
  38222. this
  38223. },
  38224. applyEuler: function(e) {
  38225. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38226. void 0 === De && (De = new Ci.Quaternion),
  38227. this.applyQuaternion(De.setFromEuler(e)),
  38228. this
  38229. },
  38230. applyAxisAngle: function(e, t) {
  38231. return void 0 === Le && (Le = new Ci.Quaternion),
  38232. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38233. this
  38234. },
  38235. applyMatrix3: function(e) {
  38236. var t = this.x
  38237. , i = this.y
  38238. , n = this.z
  38239. , r = e.elements;
  38240. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38241. this.y = r[1] * t + r[4] * i + r[7] * n,
  38242. this.z = r[2] * t + r[5] * i + r[8] * n,
  38243. this
  38244. },
  38245. applyMatrix4: function(e) {
  38246. var t = this.x
  38247. , i = this.y
  38248. , n = this.z
  38249. , r = e.elements;
  38250. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38251. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38252. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38253. this
  38254. },
  38255. applyProjection: function(e) {
  38256. var t = this.x
  38257. , i = this.y
  38258. , n = this.z
  38259. , r = e.elements
  38260. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38261. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38262. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38263. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38264. this
  38265. },
  38266. applyQuaternion: function(e) {
  38267. var t = this.x
  38268. , i = this.y
  38269. , n = this.z
  38270. , r = e.x
  38271. , o = e.y
  38272. , a = e.z
  38273. , s = e.w
  38274. , l = s * t + o * n - a * i
  38275. , c = s * i + a * t - r * n
  38276. , h = s * n + r * i - o * t
  38277. , u = -r * t - o * i - a * n;
  38278. return this.x = l * s + u * -r + c * -a - h * -o,
  38279. this.y = c * s + u * -o + h * -r - l * -a,
  38280. this.z = h * s + u * -a + l * -o - c * -r,
  38281. this
  38282. },
  38283. project: function(e) {
  38284. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38285. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38286. this.applyProjection(Oe)
  38287. },
  38288. unproject: function(e) {
  38289. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38290. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38291. this.applyProjection(Pe)
  38292. },
  38293. transformDirection: function(e) {
  38294. var t = this.x
  38295. , i = this.y
  38296. , n = this.z
  38297. , r = e.elements;
  38298. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38299. this.y = r[1] * t + r[5] * i + r[9] * n,
  38300. this.z = r[2] * t + r[6] * i + r[10] * n,
  38301. this.normalize(),
  38302. this
  38303. },
  38304. divide: function(e) {
  38305. return this.x /= e.x,
  38306. this.y /= e.y,
  38307. this.z /= e.z,
  38308. this
  38309. },
  38310. divideScalar: function(e) {
  38311. return this.multiplyScalar(1 / e)
  38312. },
  38313. min: function(e) {
  38314. return this.x = Math.min(this.x, e.x),
  38315. this.y = Math.min(this.y, e.y),
  38316. this.z = Math.min(this.z, e.z),
  38317. this
  38318. },
  38319. max: function(e) {
  38320. return this.x = Math.max(this.x, e.x),
  38321. this.y = Math.max(this.y, e.y),
  38322. this.z = Math.max(this.z, e.z),
  38323. this
  38324. },
  38325. clamp: function(e, t) {
  38326. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38327. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38328. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38329. this
  38330. },
  38331. clampScalar: function(e, t) {
  38332. return void 0 === Me && (Me = new Ci.Vector3,
  38333. Re = new Ci.Vector3),
  38334. Me.set(e, e, e),
  38335. Re.set(t, t, t),
  38336. this.clamp(Me, Re)
  38337. },
  38338. clampLength: function(e, t) {
  38339. var i = this.length();
  38340. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38341. this
  38342. },
  38343. floor: function() {
  38344. return this.x = Math.floor(this.x),
  38345. this.y = Math.floor(this.y),
  38346. this.z = Math.floor(this.z),
  38347. this
  38348. },
  38349. ceil: function() {
  38350. return this.x = Math.ceil(this.x),
  38351. this.y = Math.ceil(this.y),
  38352. this.z = Math.ceil(this.z),
  38353. this
  38354. },
  38355. round: function() {
  38356. return this.x = Math.round(this.x),
  38357. this.y = Math.round(this.y),
  38358. this.z = Math.round(this.z),
  38359. this
  38360. },
  38361. roundToZero: function() {
  38362. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38363. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38364. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38365. this
  38366. },
  38367. negate: function() {
  38368. return this.x = -this.x,
  38369. this.y = -this.y,
  38370. this.z = -this.z,
  38371. this
  38372. },
  38373. dot: function(e) {
  38374. return this.x * e.x + this.y * e.y + this.z * e.z
  38375. },
  38376. lengthSq: function() {
  38377. return this.x * this.x + this.y * this.y + this.z * this.z
  38378. },
  38379. length: function() {
  38380. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38381. },
  38382. lengthManhattan: function() {
  38383. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38384. },
  38385. normalize: function() {
  38386. return this.divideScalar(this.length())
  38387. },
  38388. setLength: function(e) {
  38389. return this.multiplyScalar(e / this.length())
  38390. },
  38391. lerp: function(e, t) {
  38392. return this.x += (e.x - this.x) * t,
  38393. this.y += (e.y - this.y) * t,
  38394. this.z += (e.z - this.z) * t,
  38395. this
  38396. },
  38397. lerpVectors: function(e, t, i) {
  38398. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38399. this
  38400. },
  38401. cross: function(e, t) {
  38402. if (void 0 !== t)
  38403. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38404. this.crossVectors(e, t);
  38405. var i = this.x
  38406. , n = this.y
  38407. , r = this.z;
  38408. return this.x = n * e.z - r * e.y,
  38409. this.y = r * e.x - i * e.z,
  38410. this.z = i * e.y - n * e.x,
  38411. this
  38412. },
  38413. crossVectors: function(e, t) {
  38414. var i = e.x
  38415. , n = e.y
  38416. , r = e.z
  38417. , o = t.x
  38418. , a = t.y
  38419. , s = t.z;
  38420. return this.x = n * s - r * a,
  38421. this.y = r * o - i * s,
  38422. this.z = i * a - n * o,
  38423. this
  38424. },
  38425. projectOnVector: function(e) {
  38426. return void 0 === xe && (xe = new Ci.Vector3),
  38427. xe.copy(e).normalize(),
  38428. Se = this.dot(xe),
  38429. this.copy(xe).multiplyScalar(Se)
  38430. },
  38431. projectOnPlane: function(e) {
  38432. return void 0 === Te && (Te = new Ci.Vector3),
  38433. Te.copy(this).projectOnVector(e),
  38434. this.sub(Te)
  38435. },
  38436. reflect: function(e) {
  38437. return void 0 === we && (we = new Ci.Vector3),
  38438. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38439. },
  38440. angleTo: function(e) {
  38441. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38442. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38443. },
  38444. distanceTo: function(e) {
  38445. return Math.sqrt(this.distanceToSquared(e))
  38446. },
  38447. distanceToSquared: function(e) {
  38448. var t = this.x - e.x
  38449. , i = this.y - e.y
  38450. , n = this.z - e.z;
  38451. return t * t + i * i + n * n
  38452. },
  38453. setFromSpherical: function(e) {
  38454. var t = Math.sin(e.phi) * e.radius;
  38455. return this.x = t * Math.sin(e.theta),
  38456. this.y = Math.cos(e.phi) * e.radius,
  38457. this.z = t * Math.cos(e.theta),
  38458. this
  38459. },
  38460. setFromMatrixPosition: function(e) {
  38461. return this.setFromMatrixColumn(e, 3)
  38462. },
  38463. setFromMatrixScale: function(e) {
  38464. var t = this.setFromMatrixColumn(e, 0).length()
  38465. , i = this.setFromMatrixColumn(e, 1).length()
  38466. , n = this.setFromMatrixColumn(e, 2).length();
  38467. return this.x = t,
  38468. this.y = i,
  38469. this.z = n,
  38470. this
  38471. },
  38472. setFromMatrixColumn: function(e, t) {
  38473. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38474. t = e = t),
  38475. this.fromArray(e.elements, 4 * t)
  38476. },
  38477. equals: function(e) {
  38478. return e.x === this.x && e.y === this.y && e.z === this.z
  38479. },
  38480. fromArray: function(e, t) {
  38481. return void 0 === t && (t = 0),
  38482. this.x = e[t],
  38483. this.y = e[t + 1],
  38484. this.z = e[t + 2],
  38485. this
  38486. },
  38487. toArray: function(e, t) {
  38488. return void 0 === e && (e = []),
  38489. void 0 === t && (t = 0),
  38490. e[t] = this.x,
  38491. e[t + 1] = this.y,
  38492. e[t + 2] = this.z,
  38493. e
  38494. },
  38495. fromAttribute: function(e, t, i) {
  38496. return void 0 === i && (i = 0),
  38497. t = t * e.itemSize + i,
  38498. this.x = e.array[t],
  38499. this.y = e.array[t + 1],
  38500. this.z = e.array[t + 2],
  38501. this
  38502. }
  38503. },
  38504. Ci.Vector4 = function(e, t, i, n) {
  38505. this.x = e || 0,
  38506. this.y = t || 0,
  38507. this.z = i || 0,
  38508. this.w = void 0 !== n ? n : 1
  38509. }
  38510. ,
  38511. Ci.Vector4.prototype = {
  38512. constructor: Ci.Vector4,
  38513. set: function(e, t, i, n) {
  38514. return this.x = e,
  38515. this.y = t,
  38516. this.z = i,
  38517. this.w = n,
  38518. this
  38519. },
  38520. setScalar: function(e) {
  38521. return this.x = e,
  38522. this.y = e,
  38523. this.z = e,
  38524. this.w = e,
  38525. this
  38526. },
  38527. setX: function(e) {
  38528. return this.x = e,
  38529. this
  38530. },
  38531. setY: function(e) {
  38532. return this.y = e,
  38533. this
  38534. },
  38535. setZ: function(e) {
  38536. return this.z = e,
  38537. this
  38538. },
  38539. setW: function(e) {
  38540. return this.w = e,
  38541. this
  38542. },
  38543. setComponent: function(e, t) {
  38544. switch (e) {
  38545. case 0:
  38546. this.x = t;
  38547. break;
  38548. case 1:
  38549. this.y = t;
  38550. break;
  38551. case 2:
  38552. this.z = t;
  38553. break;
  38554. case 3:
  38555. this.w = t;
  38556. break;
  38557. default:
  38558. throw new Error("index is out of range: " + e)
  38559. }
  38560. },
  38561. getComponent: function(e) {
  38562. switch (e) {
  38563. case 0:
  38564. return this.x;
  38565. case 1:
  38566. return this.y;
  38567. case 2:
  38568. return this.z;
  38569. case 3:
  38570. return this.w;
  38571. default:
  38572. throw new Error("index is out of range: " + e)
  38573. }
  38574. },
  38575. clone: function() {
  38576. return new this.constructor(this.x,this.y,this.z,this.w)
  38577. },
  38578. copy: function(e) {
  38579. return this.x = e.x,
  38580. this.y = e.y,
  38581. this.z = e.z,
  38582. this.w = void 0 !== e.w ? e.w : 1,
  38583. this
  38584. },
  38585. add: function(e, t) {
  38586. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38587. this.addVectors(e, t)) : (this.x += e.x,
  38588. this.y += e.y,
  38589. this.z += e.z,
  38590. this.w += e.w,
  38591. this)
  38592. },
  38593. addScalar: function(e) {
  38594. return this.x += e,
  38595. this.y += e,
  38596. this.z += e,
  38597. this.w += e,
  38598. this
  38599. },
  38600. addVectors: function(e, t) {
  38601. return this.x = e.x + t.x,
  38602. this.y = e.y + t.y,
  38603. this.z = e.z + t.z,
  38604. this.w = e.w + t.w,
  38605. this
  38606. },
  38607. addScaledVector: function(e, t) {
  38608. return this.x += e.x * t,
  38609. this.y += e.y * t,
  38610. this.z += e.z * t,
  38611. this.w += e.w * t,
  38612. this
  38613. },
  38614. sub: function(e, t) {
  38615. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38616. this.subVectors(e, t)) : (this.x -= e.x,
  38617. this.y -= e.y,
  38618. this.z -= e.z,
  38619. this.w -= e.w,
  38620. this)
  38621. },
  38622. subScalar: function(e) {
  38623. return this.x -= e,
  38624. this.y -= e,
  38625. this.z -= e,
  38626. this.w -= e,
  38627. this
  38628. },
  38629. subVectors: function(e, t) {
  38630. return this.x = e.x - t.x,
  38631. this.y = e.y - t.y,
  38632. this.z = e.z - t.z,
  38633. this.w = e.w - t.w,
  38634. this
  38635. },
  38636. multiplyScalar: function(e) {
  38637. return isFinite(e) ? (this.x *= e,
  38638. this.y *= e,
  38639. this.z *= e,
  38640. this.w *= e) : (this.x = 0,
  38641. this.y = 0,
  38642. this.z = 0,
  38643. this.w = 0),
  38644. this
  38645. },
  38646. applyMatrix4: function(e) {
  38647. var t = this.x
  38648. , i = this.y
  38649. , n = this.z
  38650. , r = this.w
  38651. , o = e.elements;
  38652. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38653. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38654. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38655. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38656. this
  38657. },
  38658. divideScalar: function(e) {
  38659. return this.multiplyScalar(1 / e)
  38660. },
  38661. setAxisAngleFromQuaternion: function(e) {
  38662. this.w = 2 * Math.acos(e.w);
  38663. var t = Math.sqrt(1 - e.w * e.w);
  38664. return t < 1e-4 ? (this.x = 1,
  38665. this.y = 0,
  38666. this.z = 0) : (this.x = e.x / t,
  38667. this.y = e.y / t,
  38668. this.z = e.z / t),
  38669. this
  38670. },
  38671. setAxisAngleFromRotationMatrix: function(e) {
  38672. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  38673. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38674. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38675. return this.set(1, 0, 0, 0),
  38676. this;
  38677. t = Math.PI;
  38678. var g = (a + 1) / 2
  38679. , m = (h + 1) / 2
  38680. , v = (f + 1) / 2
  38681. , y = (s + c) / 4
  38682. , A = (l + d) / 4
  38683. , C = (u + p) / 4;
  38684. return m < g && v < g ? r = g < .01 ? (i = 0,
  38685. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38686. A / i) : v < m ? r = m < .01 ? (n = 0,
  38687. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38688. C / n) : v < .01 ? (n = i = .707106781,
  38689. r = 0) : (i = A / (r = Math.sqrt(v)),
  38690. n = C / r),
  38691. this.set(i, n, r, t),
  38692. this
  38693. }
  38694. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38695. return Math.abs(I) < .001 && (I = 1),
  38696. this.x = (p - u) / I,
  38697. this.y = (l - d) / I,
  38698. this.z = (c - s) / I,
  38699. this.w = Math.acos((a + h + f - 1) / 2),
  38700. this
  38701. },
  38702. min: function(e) {
  38703. return this.x = Math.min(this.x, e.x),
  38704. this.y = Math.min(this.y, e.y),
  38705. this.z = Math.min(this.z, e.z),
  38706. this.w = Math.min(this.w, e.w),
  38707. this
  38708. },
  38709. max: function(e) {
  38710. return this.x = Math.max(this.x, e.x),
  38711. this.y = Math.max(this.y, e.y),
  38712. this.z = Math.max(this.z, e.z),
  38713. this.w = Math.max(this.w, e.w),
  38714. this
  38715. },
  38716. clamp: function(e, t) {
  38717. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38718. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38719. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38720. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38721. this
  38722. },
  38723. clampScalar: function(e, t) {
  38724. return void 0 === _e && (_e = new Ci.Vector4,
  38725. be = new Ci.Vector4),
  38726. _e.set(e, e, e, e),
  38727. be.set(t, t, t, t),
  38728. this.clamp(_e, be)
  38729. },
  38730. floor: function() {
  38731. return this.x = Math.floor(this.x),
  38732. this.y = Math.floor(this.y),
  38733. this.z = Math.floor(this.z),
  38734. this.w = Math.floor(this.w),
  38735. this
  38736. },
  38737. ceil: function() {
  38738. return this.x = Math.ceil(this.x),
  38739. this.y = Math.ceil(this.y),
  38740. this.z = Math.ceil(this.z),
  38741. this.w = Math.ceil(this.w),
  38742. this
  38743. },
  38744. round: function() {
  38745. return this.x = Math.round(this.x),
  38746. this.y = Math.round(this.y),
  38747. this.z = Math.round(this.z),
  38748. this.w = Math.round(this.w),
  38749. this
  38750. },
  38751. roundToZero: function() {
  38752. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38753. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38754. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38755. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38756. this
  38757. },
  38758. negate: function() {
  38759. return this.x = -this.x,
  38760. this.y = -this.y,
  38761. this.z = -this.z,
  38762. this.w = -this.w,
  38763. this
  38764. },
  38765. dot: function(e) {
  38766. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38767. },
  38768. lengthSq: function() {
  38769. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38770. },
  38771. length: function() {
  38772. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38773. },
  38774. lengthManhattan: function() {
  38775. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38776. },
  38777. normalize: function() {
  38778. return this.divideScalar(this.length())
  38779. },
  38780. setLength: function(e) {
  38781. return this.multiplyScalar(e / this.length())
  38782. },
  38783. lerp: function(e, t) {
  38784. return this.x += (e.x - this.x) * t,
  38785. this.y += (e.y - this.y) * t,
  38786. this.z += (e.z - this.z) * t,
  38787. this.w += (e.w - this.w) * t,
  38788. this
  38789. },
  38790. lerpVectors: function(e, t, i) {
  38791. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38792. this
  38793. },
  38794. equals: function(e) {
  38795. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38796. },
  38797. fromArray: function(e, t) {
  38798. return void 0 === t && (t = 0),
  38799. this.x = e[t],
  38800. this.y = e[t + 1],
  38801. this.z = e[t + 2],
  38802. this.w = e[t + 3],
  38803. this
  38804. },
  38805. toArray: function(e, t) {
  38806. return void 0 === e && (e = []),
  38807. void 0 === t && (t = 0),
  38808. e[t] = this.x,
  38809. e[t + 1] = this.y,
  38810. e[t + 2] = this.z,
  38811. e[t + 3] = this.w,
  38812. e
  38813. },
  38814. fromAttribute: function(e, t, i) {
  38815. return void 0 === i && (i = 0),
  38816. t = t * e.itemSize + i,
  38817. this.x = e.array[t],
  38818. this.y = e.array[t + 1],
  38819. this.z = e.array[t + 2],
  38820. this.w = e.array[t + 3],
  38821. this
  38822. }
  38823. },
  38824. Ci.Euler = function(e, t, i, n) {
  38825. this._x = e || 0,
  38826. this._y = t || 0,
  38827. this._z = i || 0,
  38828. this._order = n || Ci.Euler.DefaultOrder
  38829. }
  38830. ,
  38831. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38832. Ci.Euler.DefaultOrder = "XYZ",
  38833. Ci.Euler.prototype = {
  38834. constructor: Ci.Euler,
  38835. get x() {
  38836. return this._x
  38837. },
  38838. set x(e) {
  38839. this._x = e,
  38840. this.onChangeCallback()
  38841. },
  38842. get y() {
  38843. return this._y
  38844. },
  38845. set y(e) {
  38846. this._y = e,
  38847. this.onChangeCallback()
  38848. },
  38849. get z() {
  38850. return this._z
  38851. },
  38852. set z(e) {
  38853. this._z = e,
  38854. this.onChangeCallback()
  38855. },
  38856. get order() {
  38857. return this._order
  38858. },
  38859. set order(e) {
  38860. this._order = e,
  38861. this.onChangeCallback()
  38862. },
  38863. set: function(e, t, i, n) {
  38864. return this._x = e,
  38865. this._y = t,
  38866. this._z = i,
  38867. this._order = n || this._order,
  38868. this.onChangeCallback(),
  38869. this
  38870. },
  38871. clone: function() {
  38872. return new this.constructor(this._x,this._y,this._z,this._order)
  38873. },
  38874. copy: function(e) {
  38875. return this._x = e._x,
  38876. this._y = e._y,
  38877. this._z = e._z,
  38878. this._order = e._order,
  38879. this.onChangeCallback(),
  38880. this
  38881. },
  38882. toObject: function() {//xzw
  38883. return {x:this.x,y:this.y,z:this.z}
  38884. },
  38885. setFromRotationMatrix: function(e, t, i) {
  38886. var n = Ci.Math.clamp
  38887. , r = e.elements
  38888. , o = r[0]
  38889. , a = r[4]
  38890. , s = r[8]
  38891. , l = r[1]
  38892. , c = r[5]
  38893. , h = r[9]
  38894. , u = r[2]
  38895. , d = r[6]
  38896. , p = r[10];
  38897. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38898. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38899. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38900. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38901. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38902. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38903. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38904. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38905. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38906. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38907. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38908. this._z = Math.atan2(l, o)) : (this._x = 0,
  38909. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38910. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38911. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38912. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38913. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38914. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38915. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38916. this._order = t,
  38917. !1 !== i && this.onChangeCallback(),
  38918. this
  38919. },
  38920. setFromQuaternion: function(e, t, i) {
  38921. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38922. Ee.makeRotationFromQuaternion(e),
  38923. this.setFromRotationMatrix(Ee, t, i),
  38924. this
  38925. },
  38926. setFromVector3: function(e, t) {
  38927. return this.set(e.x, e.y, e.z, t || this._order)
  38928. },
  38929. reorder: (Ie = new Ci.Quaternion,
  38930. function(e) {
  38931. Ie.setFromEuler(this),
  38932. this.setFromQuaternion(Ie, e)
  38933. }
  38934. ),
  38935. equals: function(e) {
  38936. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38937. },
  38938. fromArray: function(e) {
  38939. return this._x = e[0],
  38940. this._y = e[1],
  38941. this._z = e[2],
  38942. void 0 !== e[3] && (this._order = e[3]),
  38943. this.onChangeCallback(),
  38944. this
  38945. },
  38946. toArray: function(e, t) {
  38947. return void 0 === e && (e = []),
  38948. void 0 === t && (t = 0),
  38949. e[t] = this._x,
  38950. e[t + 1] = this._y,
  38951. e[t + 2] = this._z,
  38952. e[t + 3] = this._order,
  38953. e
  38954. },
  38955. toVector3: function(e) {
  38956. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38957. },
  38958. onChange: function(e) {
  38959. return this.onChangeCallback = e,
  38960. this
  38961. },
  38962. onChangeCallback: function() {}
  38963. },
  38964. Ci.Line3 = function(e, t) {
  38965. this.start = void 0 !== e ? e : new Ci.Vector3,
  38966. this.end = void 0 !== t ? t : new Ci.Vector3
  38967. }
  38968. ,
  38969. Ci.Line3.prototype = {
  38970. constructor: Ci.Line3,
  38971. set: function(e, t) {
  38972. return this.start.copy(e),
  38973. this.end.copy(t),
  38974. this
  38975. },
  38976. clone: function() {
  38977. return (new this.constructor).copy(this)
  38978. },
  38979. copy: function(e) {
  38980. return this.start.copy(e.start),
  38981. this.end.copy(e.end),
  38982. this
  38983. },
  38984. center: function(e) {
  38985. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38986. },
  38987. delta: function(e) {
  38988. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38989. },
  38990. distanceSq: function() {
  38991. return this.start.distanceToSquared(this.end)
  38992. },
  38993. distance: function() {
  38994. return this.start.distanceTo(this.end)
  38995. },
  38996. at: function(e, t) {
  38997. var i = t || new Ci.Vector3;
  38998. return this.delta(i).multiplyScalar(e).add(this.start)
  38999. },
  39000. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39001. Ce = new Ci.Vector3,
  39002. function(e, t) {
  39003. Ae.subVectors(e, this.start),
  39004. Ce.subVectors(this.end, this.start);
  39005. var i = Ce.dot(Ce)
  39006. , n = Ce.dot(Ae) / i;
  39007. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39008. n
  39009. }
  39010. ),
  39011. closestPointToPoint: function(e, t, i) {
  39012. var n = this.closestPointToPointParameter(e, t)
  39013. , r = i || new Ci.Vector3;
  39014. return this.delta(r).multiplyScalar(n).add(this.start)
  39015. },
  39016. applyMatrix4: function(e) {
  39017. return this.start.applyMatrix4(e),
  39018. this.end.applyMatrix4(e),
  39019. this
  39020. },
  39021. equals: function(e) {
  39022. return e.start.equals(this.start) && e.end.equals(this.end)
  39023. }
  39024. },
  39025. Ci.Box2 = function(e, t) {
  39026. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39027. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39028. }
  39029. ,
  39030. Ci.Box2.prototype = {
  39031. constructor: Ci.Box2,
  39032. set: function(e, t) {
  39033. return this.min.copy(e),
  39034. this.max.copy(t),
  39035. this
  39036. },
  39037. setFromPoints: function(e) {
  39038. this.makeEmpty();
  39039. for (var t = 0, i = e.length; t < i; t++)
  39040. this.expandByPoint(e[t]);
  39041. return this
  39042. },
  39043. setFromCenterAndSize: (ye = new Ci.Vector2,
  39044. function(e, t) {
  39045. var i = ye.copy(t).multiplyScalar(.5);
  39046. return this.min.copy(e).sub(i),
  39047. this.max.copy(e).add(i),
  39048. this
  39049. }
  39050. ),
  39051. clone: function() {
  39052. return (new this.constructor).copy(this)
  39053. },
  39054. copy: function(e) {
  39055. return this.min.copy(e.min),
  39056. this.max.copy(e.max),
  39057. this
  39058. },
  39059. makeEmpty: function() {
  39060. return this.min.x = this.min.y = 1 / 0,
  39061. this.max.x = this.max.y = -1 / 0,
  39062. this
  39063. },
  39064. isEmpty: function() {
  39065. return this.max.x < this.min.x || this.max.y < this.min.y
  39066. },
  39067. center: function(e) {
  39068. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39069. },
  39070. size: function(e) {
  39071. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39072. },
  39073. expandByPoint: function(e) {
  39074. return this.min.min(e),
  39075. this.max.max(e),
  39076. this
  39077. },
  39078. expandByVector: function(e) {
  39079. return this.min.sub(e),
  39080. this.max.add(e),
  39081. this
  39082. },
  39083. expandByScalar: function(e) {
  39084. return this.min.addScalar(-e),
  39085. this.max.addScalar(e),
  39086. this
  39087. },
  39088. containsPoint: function(e) {
  39089. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39090. },
  39091. containsBox: function(e) {
  39092. 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
  39093. },
  39094. getParameter: function(e, t) {
  39095. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39096. },
  39097. intersectsBox: function(e) {
  39098. 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)
  39099. },
  39100. clampPoint: function(e, t) {
  39101. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39102. },
  39103. distanceToPoint: (ve = new Ci.Vector2,
  39104. function(e) {
  39105. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39106. }
  39107. ),
  39108. intersect: function(e) {
  39109. return this.min.max(e.min),
  39110. this.max.min(e.max),
  39111. this
  39112. },
  39113. union: function(e) {
  39114. return this.min.min(e.min),
  39115. this.max.max(e.max),
  39116. this
  39117. },
  39118. translate: function(e) {
  39119. return this.min.add(e),
  39120. this.max.add(e),
  39121. this
  39122. },
  39123. equals: function(e) {
  39124. return e.min.equals(this.min) && e.max.equals(this.max)
  39125. }
  39126. },
  39127. Ci.Box3 = function(e, t) {
  39128. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39129. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39130. }
  39131. ,
  39132. Ci.Box3.prototype = {
  39133. constructor: Ci.Box3,
  39134. set: function(e, t) {
  39135. return this.min.copy(e),
  39136. this.max.copy(t),
  39137. this
  39138. },
  39139. setFromArray: function(e) {
  39140. this.makeEmpty();
  39141. 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) {
  39142. var c = e[s]
  39143. , h = e[s + 1]
  39144. , u = e[s + 2];
  39145. c < t && (t = c),
  39146. h < i && (i = h),
  39147. u < n && (n = u),
  39148. r < c && (r = c),
  39149. o < h && (o = h),
  39150. a < u && (a = u)
  39151. }
  39152. this.min.set(t, i, n),
  39153. this.max.set(r, o, a)
  39154. },
  39155. setFromPoints: function(e) {
  39156. this.makeEmpty();
  39157. for (var t = 0, i = e.length; t < i; t++)
  39158. this.expandByPoint(e[t]);
  39159. return this
  39160. },
  39161. setFromCenterAndSize: (me = new Ci.Vector3,
  39162. function(e, t) {
  39163. var i = me.copy(t).multiplyScalar(.5);
  39164. return this.min.copy(e).sub(i),
  39165. this.max.copy(e).add(i),
  39166. this
  39167. }
  39168. ),
  39169. setFromObject: function(e) {
  39170. void 0 === ge && (ge = new Ci.Box3);
  39171. var i = this;
  39172. return this.makeEmpty(),
  39173. e.updateMatrixWorld(!0),
  39174. e.traverse(function(e) {
  39175. var t = e.geometry;
  39176. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39177. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39178. ge.applyMatrix4(e.matrixWorld),
  39179. i.union(ge)))
  39180. }),
  39181. this
  39182. },
  39183. clone: function() {
  39184. return (new this.constructor).copy(this)
  39185. },
  39186. copy: function(e) {
  39187. return this.min.copy(e.min),
  39188. this.max.copy(e.max),
  39189. this
  39190. },
  39191. makeEmpty: function() {
  39192. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39193. this.max.x = this.max.y = this.max.z = -1 / 0,
  39194. this
  39195. },
  39196. isEmpty: function() {
  39197. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39198. },
  39199. center: function(e) {
  39200. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39201. },
  39202. size: function(e) {
  39203. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39204. },
  39205. expandByPoint: function(e) {
  39206. return this.min.min(e),
  39207. this.max.max(e),
  39208. this
  39209. },
  39210. expandByVector: function(e) {
  39211. return this.min.sub(e),
  39212. this.max.add(e),
  39213. this
  39214. },
  39215. expandByScalar: function(e) {
  39216. return this.min.addScalar(-e),
  39217. this.max.addScalar(e),
  39218. this
  39219. },
  39220. containsPoint: function(e) {
  39221. 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)
  39222. },
  39223. containsBox: function(e) {
  39224. 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
  39225. },
  39226. getParameter: function(e, t) {
  39227. return (t || new Ci.Vector3).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))
  39228. },
  39229. intersectsBox: function(e) {
  39230. 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)
  39231. },
  39232. intersectsSphere: function(e) {
  39233. return void 0 === fe && (fe = new Ci.Vector3),
  39234. this.clampPoint(e.center, fe),
  39235. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39236. },
  39237. intersectsPlane: function(e) {
  39238. var t, i;
  39239. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39240. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39241. e.normal.x * this.min.x),
  39242. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39243. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39244. i += e.normal.y * this.min.y),
  39245. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39246. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39247. i += e.normal.z * this.min.z),
  39248. t <= e.constant && i >= e.constant
  39249. },
  39250. clampPoint: function(e, t) {
  39251. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39252. },
  39253. distanceToPoint: (pe = new Ci.Vector3,
  39254. function(e) {
  39255. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39256. }
  39257. ),
  39258. getBoundingSphere: (de = new Ci.Vector3,
  39259. function(e) {
  39260. var t = e || new Ci.Sphere;
  39261. return t.center = this.center(),
  39262. t.radius = .5 * this.size(de).length(),
  39263. t
  39264. }
  39265. ),
  39266. intersect: function(e) {
  39267. return this.min.max(e.min),
  39268. this.max.min(e.max),
  39269. this
  39270. },
  39271. union: function(e) {
  39272. return this.min.min(e.min),
  39273. this.max.max(e.max),
  39274. this
  39275. },
  39276. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  39277. function(e) {
  39278. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39279. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39280. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39281. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39282. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39283. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39284. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39285. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39286. this.makeEmpty(),
  39287. this.setFromPoints(ue),
  39288. this
  39289. }
  39290. ),
  39291. translate: function(e) {
  39292. return this.min.add(e),
  39293. this.max.add(e),
  39294. this
  39295. },
  39296. equals: function(e) {
  39297. return e.min.equals(this.min) && e.max.equals(this.max)
  39298. }
  39299. },
  39300. Ci.Matrix3 = function() {
  39301. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39302. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39303. }
  39304. ,
  39305. Ci.Matrix3.prototype = {
  39306. constructor: Ci.Matrix3,
  39307. set: function(e, t, i, n, r, o, a, s, l) {
  39308. var c = this.elements;
  39309. return c[0] = e,
  39310. c[1] = n,
  39311. c[2] = a,
  39312. c[3] = t,
  39313. c[4] = r,
  39314. c[5] = s,
  39315. c[6] = i,
  39316. c[7] = o,
  39317. c[8] = l,
  39318. this
  39319. },
  39320. identity: function() {
  39321. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39322. this
  39323. },
  39324. clone: function() {
  39325. return (new this.constructor).fromArray(this.elements)
  39326. },
  39327. copy: function(e) {
  39328. var t = e.elements;
  39329. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39330. this
  39331. },
  39332. setFromMatrix4: function(e) {
  39333. var t = e.elements;
  39334. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39335. this
  39336. },
  39337. applyToVector3Array: function(e, t, i) {
  39338. void 0 === he && (he = new Ci.Vector3),
  39339. void 0 === t && (t = 0),
  39340. void 0 === i && (i = e.length);
  39341. for (var n = 0, r = t; n < i; n += 3,
  39342. r += 3)
  39343. he.fromArray(e, r),
  39344. he.applyMatrix3(this),
  39345. he.toArray(e, r);
  39346. return e
  39347. },
  39348. applyToBuffer: function(e, t, i) {
  39349. void 0 === ce && (ce = new Ci.Vector3),
  39350. void 0 === t && (t = 0),
  39351. void 0 === i && (i = e.length / e.itemSize);
  39352. for (var n = 0, r = t; n < i; n++,
  39353. r++)
  39354. ce.x = e.getX(r),
  39355. ce.y = e.getY(r),
  39356. ce.z = e.getZ(r),
  39357. ce.applyMatrix3(this),
  39358. e.setXYZ(ce.x, ce.y, ce.z);
  39359. return e
  39360. },
  39361. multiplyScalar: function(e) {
  39362. var t = this.elements;
  39363. return t[0] *= e,
  39364. t[3] *= e,
  39365. t[6] *= e,
  39366. t[1] *= e,
  39367. t[4] *= e,
  39368. t[7] *= e,
  39369. t[2] *= e,
  39370. t[5] *= e,
  39371. t[8] *= e,
  39372. this
  39373. },
  39374. determinant: function() {
  39375. var e = this.elements
  39376. , t = e[0]
  39377. , i = e[1]
  39378. , n = e[2]
  39379. , r = e[3]
  39380. , o = e[4]
  39381. , a = e[5]
  39382. , s = e[6]
  39383. , l = e[7]
  39384. , c = e[8];
  39385. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39386. },
  39387. getInverse: function(e, t) {
  39388. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39389. var i = e.elements
  39390. , n = this.elements
  39391. , r = i[0]
  39392. , o = i[1]
  39393. , a = i[2]
  39394. , s = i[3]
  39395. , l = i[4]
  39396. , c = i[5]
  39397. , h = i[6]
  39398. , u = i[7]
  39399. , d = i[8]
  39400. , p = d * l - c * u
  39401. , f = c * h - d * s
  39402. , g = u * s - l * h
  39403. , m = r * p + o * f + a * g;
  39404. if (0 != m)
  39405. return n[0] = p,
  39406. n[1] = a * u - d * o,
  39407. n[2] = c * o - a * l,
  39408. n[3] = f,
  39409. n[4] = d * r - a * h,
  39410. n[5] = a * s - c * r,
  39411. n[6] = g,
  39412. n[7] = o * h - u * r,
  39413. n[8] = l * r - o * s,
  39414. this.multiplyScalar(1 / m);
  39415. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39416. if (t)
  39417. throw new Error(v);
  39418. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39419. },
  39420. transpose: function() {
  39421. var e, t = this.elements;
  39422. return e = t[1],
  39423. t[1] = t[3],
  39424. t[3] = e,
  39425. e = t[2],
  39426. t[2] = t[6],
  39427. t[6] = e,
  39428. e = t[5],
  39429. t[5] = t[7],
  39430. t[7] = e,
  39431. this
  39432. },
  39433. flattenToArrayOffset: function(e, t) {
  39434. var i = this.elements;
  39435. return e[t] = i[0],
  39436. e[t + 1] = i[1],
  39437. e[t + 2] = i[2],
  39438. e[t + 3] = i[3],
  39439. e[t + 4] = i[4],
  39440. e[t + 5] = i[5],
  39441. e[t + 6] = i[6],
  39442. e[t + 7] = i[7],
  39443. e[t + 8] = i[8],
  39444. e
  39445. },
  39446. getNormalMatrix: function(e) {
  39447. return this.setFromMatrix4(e).getInverse(this).transpose()
  39448. },
  39449. transposeIntoArray: function(e) {
  39450. var t = this.elements;
  39451. return e[0] = t[0],
  39452. e[1] = t[3],
  39453. e[2] = t[6],
  39454. e[3] = t[1],
  39455. e[4] = t[4],
  39456. e[5] = t[7],
  39457. e[6] = t[2],
  39458. e[7] = t[5],
  39459. e[8] = t[8],
  39460. this
  39461. },
  39462. fromArray: function(e) {
  39463. return this.elements.set(e),
  39464. this
  39465. },
  39466. toArray: function() {
  39467. var e = this.elements;
  39468. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39469. }
  39470. },
  39471. Ci.Matrix4 = function() {
  39472. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39473. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39474. }
  39475. ,
  39476. Ci.Matrix4.prototype = {
  39477. constructor: Ci.Matrix4,
  39478. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39479. var m = this.elements;
  39480. return m[0] = e,
  39481. m[4] = t,
  39482. m[8] = i,
  39483. m[12] = n,
  39484. m[1] = r,
  39485. m[5] = o,
  39486. m[9] = a,
  39487. m[13] = s,
  39488. m[2] = l,
  39489. m[6] = c,
  39490. m[10] = h,
  39491. m[14] = u,
  39492. m[3] = d,
  39493. m[7] = p,
  39494. m[11] = f,
  39495. m[15] = g,
  39496. this
  39497. },
  39498. identity: function() {
  39499. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39500. this
  39501. },
  39502. clone: function() {
  39503. return (new Ci.Matrix4).fromArray(this.elements)
  39504. },
  39505. copy: function(e) {
  39506. return this.elements.set(e.elements),
  39507. this
  39508. },
  39509. copyPosition: function(e) {
  39510. var t = this.elements
  39511. , i = e.elements;
  39512. return t[12] = i[12],
  39513. t[13] = i[13],
  39514. t[14] = i[14],
  39515. this
  39516. },
  39517. extractBasis: function(e, t, i) {
  39518. return e.setFromMatrixColumn(this, 0),
  39519. t.setFromMatrixColumn(this, 1),
  39520. i.setFromMatrixColumn(this, 2),
  39521. this
  39522. },
  39523. makeBasis: function(e, t, i) {
  39524. 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),
  39525. this
  39526. },
  39527. extractRotation: function(e) {
  39528. void 0 === le && (le = new Ci.Vector3);
  39529. var t = this.elements
  39530. , i = e.elements
  39531. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39532. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39533. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39534. return t[0] = i[0] * n,
  39535. t[1] = i[1] * n,
  39536. t[2] = i[2] * n,
  39537. t[4] = i[4] * r,
  39538. t[5] = i[5] * r,
  39539. t[6] = i[6] * r,
  39540. t[8] = i[8] * o,
  39541. t[9] = i[9] * o,
  39542. t[10] = i[10] * o,
  39543. this
  39544. },
  39545. makeRotationFromEuler: function(e) {
  39546. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39547. var t = this.elements
  39548. , i = e.x
  39549. , n = e.y
  39550. , r = e.z
  39551. , o = Math.cos(i)
  39552. , a = Math.sin(i)
  39553. , s = Math.cos(n)
  39554. , l = Math.sin(n)
  39555. , c = Math.cos(r)
  39556. , h = Math.sin(r);
  39557. if ("XYZ" === e.order) {
  39558. var u = o * c
  39559. , d = o * h
  39560. , p = a * c
  39561. , f = a * h;
  39562. t[0] = s * c,
  39563. t[4] = -s * h,
  39564. t[8] = l,
  39565. t[1] = d + p * l,
  39566. t[5] = u - f * l,
  39567. t[9] = -a * s,
  39568. t[2] = f - u * l,
  39569. t[6] = p + d * l,
  39570. t[10] = o * s
  39571. } else if ("YXZ" === e.order) {
  39572. var g = s * c
  39573. , m = s * h
  39574. , v = l * c
  39575. , y = l * h;
  39576. t[0] = g + y * a,
  39577. t[4] = v * a - m,
  39578. t[8] = o * l,
  39579. t[1] = o * h,
  39580. t[5] = o * c,
  39581. t[9] = -a,
  39582. t[2] = m * a - v,
  39583. t[6] = y + g * a,
  39584. t[10] = o * s
  39585. } else if ("ZXY" === e.order) {
  39586. g = s * c,
  39587. m = s * h,
  39588. v = l * c,
  39589. y = l * h;
  39590. t[0] = g - y * a,
  39591. t[4] = -o * h,
  39592. t[8] = v + m * a,
  39593. t[1] = m + v * a,
  39594. t[5] = o * c,
  39595. t[9] = y - g * a,
  39596. t[2] = -o * l,
  39597. t[6] = a,
  39598. t[10] = o * s
  39599. } else if ("ZYX" === e.order) {
  39600. u = o * c,
  39601. d = o * h,
  39602. p = a * c,
  39603. f = a * h;
  39604. t[0] = s * c,
  39605. t[4] = p * l - d,
  39606. t[8] = u * l + f,
  39607. t[1] = s * h,
  39608. t[5] = f * l + u,
  39609. t[9] = d * l - p,
  39610. t[2] = -l,
  39611. t[6] = a * s,
  39612. t[10] = o * s
  39613. } else if ("YZX" === e.order) {
  39614. var A = o * s
  39615. , C = o * l
  39616. , I = a * s
  39617. , E = a * l;
  39618. t[0] = s * c,
  39619. t[4] = E - A * h,
  39620. t[8] = I * h + C,
  39621. t[1] = h,
  39622. t[5] = o * c,
  39623. t[9] = -a * c,
  39624. t[2] = -l * c,
  39625. t[6] = C * h + I,
  39626. t[10] = A - E * h
  39627. } else if ("XZY" === e.order) {
  39628. A = o * s,
  39629. C = o * l,
  39630. I = a * s,
  39631. E = a * l;
  39632. t[0] = s * c,
  39633. t[4] = -h,
  39634. t[8] = l * c,
  39635. t[1] = A * h + E,
  39636. t[5] = o * c,
  39637. t[9] = C * h - I,
  39638. t[2] = I * h - C,
  39639. t[6] = a * c,
  39640. t[10] = E * h + A
  39641. }
  39642. return t[3] = 0,
  39643. t[7] = 0,
  39644. t[11] = 0,
  39645. t[12] = 0,
  39646. t[13] = 0,
  39647. t[14] = 0,
  39648. t[15] = 1,
  39649. this
  39650. },
  39651. makeRotationFromQuaternion: function(e) {
  39652. var t = this.elements
  39653. , i = e.x
  39654. , n = e.y
  39655. , r = e.z
  39656. , o = e.w
  39657. , a = i + i
  39658. , s = n + n
  39659. , l = r + r
  39660. , c = i * a
  39661. , h = i * s
  39662. , u = i * l
  39663. , d = n * s
  39664. , p = n * l
  39665. , f = r * l
  39666. , g = o * a
  39667. , m = o * s
  39668. , v = o * l;
  39669. return t[0] = 1 - (d + f),
  39670. t[4] = h - v,
  39671. t[8] = u + m,
  39672. t[1] = h + v,
  39673. t[5] = 1 - (c + f),
  39674. t[9] = p - g,
  39675. t[2] = u - m,
  39676. t[6] = p + g,
  39677. t[10] = 1 - (c + d),
  39678. t[3] = 0,
  39679. t[7] = 0,
  39680. t[11] = 0,
  39681. t[12] = 0,
  39682. t[13] = 0,
  39683. t[14] = 0,
  39684. t[15] = 1,
  39685. this
  39686. },
  39687. lookAt: function(e, t, i) {
  39688. void 0 === oe && (oe = new Ci.Vector3),
  39689. void 0 === ae && (ae = new Ci.Vector3),
  39690. void 0 === se && (se = new Ci.Vector3);
  39691. var n = this.elements;
  39692. return se.subVectors(e, t).normalize(),
  39693. 0 === se.lengthSq() && (se.z = 1),
  39694. oe.crossVectors(i, se).normalize(),
  39695. 0 === oe.lengthSq() && (se.x += 1e-4,
  39696. oe.crossVectors(i, se).normalize()),
  39697. ae.crossVectors(se, oe),
  39698. n[0] = oe.x,
  39699. n[4] = ae.x,
  39700. n[8] = se.x,
  39701. n[1] = oe.y,
  39702. n[5] = ae.y,
  39703. n[9] = se.y,
  39704. n[2] = oe.z,
  39705. n[6] = ae.z,
  39706. n[10] = se.z,
  39707. this
  39708. },
  39709. multiply: function(e, t) {
  39710. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39711. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39712. },
  39713. multiplyMatrices: function(e, t) {
  39714. var i = e.elements
  39715. , n = t.elements
  39716. , r = this.elements
  39717. , o = i[0]
  39718. , a = i[4]
  39719. , s = i[8]
  39720. , l = i[12]
  39721. , c = i[1]
  39722. , h = i[5]
  39723. , u = i[9]
  39724. , d = i[13]
  39725. , p = i[2]
  39726. , f = i[6]
  39727. , g = i[10]
  39728. , m = i[14]
  39729. , v = i[3]
  39730. , y = i[7]
  39731. , A = i[11]
  39732. , C = i[15]
  39733. , I = n[0]
  39734. , E = n[4]
  39735. , _ = n[8]
  39736. , b = n[12]
  39737. , w = n[1]
  39738. , T = n[5]
  39739. , x = n[9]
  39740. , S = n[13]
  39741. , M = n[2]
  39742. , R = n[6]
  39743. , P = n[10]
  39744. , O = n[14]
  39745. , L = n[3]
  39746. , D = n[7]
  39747. , N = n[11]
  39748. , F = n[15];
  39749. return r[0] = o * I + a * w + s * M + l * L,
  39750. r[4] = o * E + a * T + s * R + l * D,
  39751. r[8] = o * _ + a * x + s * P + l * N,
  39752. r[12] = o * b + a * S + s * O + l * F,
  39753. r[1] = c * I + h * w + u * M + d * L,
  39754. r[5] = c * E + h * T + u * R + d * D,
  39755. r[9] = c * _ + h * x + u * P + d * N,
  39756. r[13] = c * b + h * S + u * O + d * F,
  39757. r[2] = p * I + f * w + g * M + m * L,
  39758. r[6] = p * E + f * T + g * R + m * D,
  39759. r[10] = p * _ + f * x + g * P + m * N,
  39760. r[14] = p * b + f * S + g * O + m * F,
  39761. r[3] = v * I + y * w + A * M + C * L,
  39762. r[7] = v * E + y * T + A * R + C * D,
  39763. r[11] = v * _ + y * x + A * P + C * N,
  39764. r[15] = v * b + y * S + A * O + C * F,
  39765. this
  39766. },
  39767. multiplyToArray: function(e, t, i) {
  39768. var n = this.elements;
  39769. return this.multiplyMatrices(e, t),
  39770. i[0] = n[0],
  39771. i[1] = n[1],
  39772. i[2] = n[2],
  39773. i[3] = n[3],
  39774. i[4] = n[4],
  39775. i[5] = n[5],
  39776. i[6] = n[6],
  39777. i[7] = n[7],
  39778. i[8] = n[8],
  39779. i[9] = n[9],
  39780. i[10] = n[10],
  39781. i[11] = n[11],
  39782. i[12] = n[12],
  39783. i[13] = n[13],
  39784. i[14] = n[14],
  39785. i[15] = n[15],
  39786. this
  39787. },
  39788. multiplyScalar: function(e) {
  39789. var t = this.elements;
  39790. return t[0] *= e,
  39791. t[4] *= e,
  39792. t[8] *= e,
  39793. t[12] *= e,
  39794. t[1] *= e,
  39795. t[5] *= e,
  39796. t[9] *= e,
  39797. t[13] *= e,
  39798. t[2] *= e,
  39799. t[6] *= e,
  39800. t[10] *= e,
  39801. t[14] *= e,
  39802. t[3] *= e,
  39803. t[7] *= e,
  39804. t[11] *= e,
  39805. t[15] *= e,
  39806. this
  39807. },
  39808. applyToVector3Array: function(e, t, i) {
  39809. void 0 === re && (re = new Ci.Vector3),
  39810. void 0 === t && (t = 0),
  39811. void 0 === i && (i = e.length);
  39812. for (var n = 0, r = t; n < i; n += 3,
  39813. r += 3)
  39814. re.fromArray(e, r),
  39815. re.applyMatrix4(this),
  39816. re.toArray(e, r);
  39817. return e
  39818. },
  39819. applyToBuffer: function(e, t, i) {
  39820. void 0 === ne && (ne = new Ci.Vector3),
  39821. void 0 === t && (t = 0),
  39822. void 0 === i && (i = e.length / e.itemSize);
  39823. for (var n = 0, r = t; n < i; n++,
  39824. r++)
  39825. ne.x = e.getX(r),
  39826. ne.y = e.getY(r),
  39827. ne.z = e.getZ(r),
  39828. ne.applyMatrix4(this),
  39829. e.setXYZ(ne.x, ne.y, ne.z);
  39830. return e
  39831. },
  39832. determinant: function() {
  39833. var e = this.elements
  39834. , t = e[0]
  39835. , i = e[4]
  39836. , n = e[8]
  39837. , r = e[12]
  39838. , o = e[1]
  39839. , a = e[5]
  39840. , s = e[9]
  39841. , l = e[13]
  39842. , c = e[2]
  39843. , h = e[6]
  39844. , u = e[10]
  39845. , d = e[14];
  39846. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39847. },
  39848. transpose: function() {
  39849. var e, t = this.elements;
  39850. return e = t[1],
  39851. t[1] = t[4],
  39852. t[4] = e,
  39853. e = t[2],
  39854. t[2] = t[8],
  39855. t[8] = e,
  39856. e = t[6],
  39857. t[6] = t[9],
  39858. t[9] = e,
  39859. e = t[3],
  39860. t[3] = t[12],
  39861. t[12] = e,
  39862. e = t[7],
  39863. t[7] = t[13],
  39864. t[13] = e,
  39865. e = t[11],
  39866. t[11] = t[14],
  39867. t[14] = e,
  39868. this
  39869. },
  39870. flattenToArrayOffset: function(e, t) {
  39871. var i = this.elements;
  39872. return e[t] = i[0],
  39873. e[t + 1] = i[1],
  39874. e[t + 2] = i[2],
  39875. e[t + 3] = i[3],
  39876. e[t + 4] = i[4],
  39877. e[t + 5] = i[5],
  39878. e[t + 6] = i[6],
  39879. e[t + 7] = i[7],
  39880. e[t + 8] = i[8],
  39881. e[t + 9] = i[9],
  39882. e[t + 10] = i[10],
  39883. e[t + 11] = i[11],
  39884. e[t + 12] = i[12],
  39885. e[t + 13] = i[13],
  39886. e[t + 14] = i[14],
  39887. e[t + 15] = i[15],
  39888. e
  39889. },
  39890. getPosition: function() {
  39891. return void 0 === ie && (ie = new Ci.Vector3),
  39892. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39893. ie.setFromMatrixColumn(this, 3)
  39894. },
  39895. setPosition: function(e) {
  39896. var t = this.elements;
  39897. return t[12] = e.x,
  39898. t[13] = e.y,
  39899. t[14] = e.z,
  39900. this
  39901. },
  39902. getInverse: function(e, t) {
  39903. var i = this.elements
  39904. , n = e.elements
  39905. , r = n[0]
  39906. , o = n[1]
  39907. , a = n[2]
  39908. , s = n[3]
  39909. , l = n[4]
  39910. , c = n[5]
  39911. , h = n[6]
  39912. , u = n[7]
  39913. , d = n[8]
  39914. , p = n[9]
  39915. , f = n[10]
  39916. , g = n[11]
  39917. , m = n[12]
  39918. , v = n[13]
  39919. , y = n[14]
  39920. , A = n[15]
  39921. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39922. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39923. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39924. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39925. , b = r * C + o * I + a * E + s * _;
  39926. if (0 != b)
  39927. return i[0] = C,
  39928. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39929. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39930. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39931. i[4] = I,
  39932. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39933. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39934. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39935. i[8] = E,
  39936. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39937. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39938. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39939. i[12] = _,
  39940. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39941. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39942. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39943. this.multiplyScalar(1 / b);
  39944. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39945. if (t)
  39946. throw new Error(w);
  39947. return console.warn(w),
  39948. this.identity()
  39949. },
  39950. scale: function(e) {
  39951. var t = this.elements
  39952. , i = e.x
  39953. , n = e.y
  39954. , r = e.z;
  39955. return t[0] *= i,
  39956. t[4] *= n,
  39957. t[8] *= r,
  39958. t[1] *= i,
  39959. t[5] *= n,
  39960. t[9] *= r,
  39961. t[2] *= i,
  39962. t[6] *= n,
  39963. t[10] *= r,
  39964. t[3] *= i,
  39965. t[7] *= n,
  39966. t[11] *= r,
  39967. this
  39968. },
  39969. getMaxScaleOnAxis: function() {
  39970. var e = this.elements
  39971. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39972. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39973. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39974. return Math.sqrt(Math.max(t, i, n))
  39975. },
  39976. makeTranslation: function(e, t, i) {
  39977. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39978. this
  39979. },
  39980. makeRotationX: function(e) {
  39981. var t = Math.cos(e)
  39982. , i = Math.sin(e);
  39983. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39984. this
  39985. },
  39986. makeRotationY: function(e) {
  39987. var t = Math.cos(e)
  39988. , i = Math.sin(e);
  39989. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39990. this
  39991. },
  39992. makeRotationZ: function(e) {
  39993. var t = Math.cos(e)
  39994. , i = Math.sin(e);
  39995. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39996. this
  39997. },
  39998. makeRotationAxis: function(e, t) {
  39999. var i = Math.cos(t)
  40000. , n = Math.sin(t)
  40001. , r = 1 - i
  40002. , o = e.x
  40003. , a = e.y
  40004. , s = e.z
  40005. , l = r * o
  40006. , c = r * a;
  40007. 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),
  40008. this
  40009. },
  40010. makeScale: function(e, t, i) {
  40011. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40012. this
  40013. },
  40014. compose: function(e, t, i) {
  40015. return this.makeRotationFromQuaternion(t),
  40016. this.scale(i),
  40017. this.setPosition(e),
  40018. this
  40019. },
  40020. decompose: function(e, t, i) {
  40021. void 0 === ee && (ee = new Ci.Vector3),
  40022. void 0 === te && (te = new Ci.Matrix4);
  40023. var n = this.elements
  40024. , r = ee.set(n[0], n[1], n[2]).length()
  40025. , o = ee.set(n[4], n[5], n[6]).length()
  40026. , a = ee.set(n[8], n[9], n[10]).length();
  40027. this.determinant() < 0 && (r = -r),
  40028. e.x = n[12],
  40029. e.y = n[13],
  40030. e.z = n[14],
  40031. te.elements.set(this.elements);
  40032. var s = 1 / r
  40033. , l = 1 / o
  40034. , c = 1 / a;
  40035. return te.elements[0] *= s,
  40036. te.elements[1] *= s,
  40037. te.elements[2] *= s,
  40038. te.elements[4] *= l,
  40039. te.elements[5] *= l,
  40040. te.elements[6] *= l,
  40041. te.elements[8] *= c,
  40042. te.elements[9] *= c,
  40043. te.elements[10] *= c,
  40044. t.setFromRotationMatrix(te),
  40045. i.x = r,
  40046. i.y = o,
  40047. i.z = a,
  40048. this
  40049. },
  40050. makeFrustum: function(e, t, i, n, r, o) {
  40051. var a = this.elements
  40052. , s = 2 * r / (t - e)
  40053. , l = 2 * r / (n - i)
  40054. , c = (t + e) / (t - e)
  40055. , h = (n + i) / (n - i)
  40056. , u = -(o + r) / (o - r)
  40057. , d = -2 * o * r / (o - r);
  40058. return a[0] = s,
  40059. a[4] = 0,
  40060. a[8] = c,
  40061. a[12] = 0,
  40062. a[1] = 0,
  40063. a[5] = l,
  40064. a[9] = h,
  40065. a[13] = 0,
  40066. a[2] = 0,
  40067. a[6] = 0,
  40068. a[10] = u,
  40069. a[14] = d,
  40070. a[3] = 0,
  40071. a[7] = 0,
  40072. a[11] = -1,
  40073. a[15] = 0,
  40074. this
  40075. },
  40076. makePerspective: function(e, t, i, n) {
  40077. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40078. , o = -r
  40079. , a = o * t
  40080. , s = r * t;
  40081. return this.makeFrustum(a, s, o, r, i, n)
  40082. },
  40083. makeOrthographic: function(e, t, i, n, r, o) {
  40084. var a = this.elements
  40085. , s = 1 / (t - e)
  40086. , l = 1 / (i - n)
  40087. , c = 1 / (o - r)
  40088. , h = (t + e) * s
  40089. , u = (i + n) * l
  40090. , d = (o + r) * c;
  40091. return a[0] = 2 * s,
  40092. a[4] = 0,
  40093. a[8] = 0,
  40094. a[12] = -h,
  40095. a[1] = 0,
  40096. a[5] = 2 * l,
  40097. a[9] = 0,
  40098. a[13] = -u,
  40099. a[2] = 0,
  40100. a[6] = 0,
  40101. a[10] = -2 * c,
  40102. a[14] = -d,
  40103. a[3] = 0,
  40104. a[7] = 0,
  40105. a[11] = 0,
  40106. a[15] = 1,
  40107. this
  40108. },
  40109. equals: function(e) {
  40110. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40111. if (t[n] !== i[n])
  40112. return !1;
  40113. return !0
  40114. },
  40115. fromArray: function(e) {
  40116. return this.elements.set(e),
  40117. this
  40118. },
  40119. toArray: function() {
  40120. var e = this.elements;
  40121. 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]]
  40122. }
  40123. },
  40124. Ci.Ray = function(e, t) {
  40125. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40126. this.direction = void 0 !== t ? t : new Ci.Vector3
  40127. }
  40128. ,
  40129. Ci.Ray.prototype = {
  40130. constructor: Ci.Ray,
  40131. set: function(e, t) {
  40132. return this.origin.copy(e),
  40133. this.direction.copy(t),
  40134. this
  40135. },
  40136. clone: function() {
  40137. return (new this.constructor).copy(this)
  40138. },
  40139. copy: function(e) {
  40140. return this.origin.copy(e.origin),
  40141. this.direction.copy(e.direction),
  40142. this
  40143. },
  40144. at: function(e, t) {
  40145. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40146. },
  40147. lookAt: function(e) {
  40148. this.direction.copy(e).sub(this.origin).normalize()
  40149. },
  40150. recast: ($ = new Ci.Vector3,
  40151. function(e) {
  40152. return this.origin.copy(this.at(e, $)),
  40153. this
  40154. }
  40155. ),
  40156. closestPointToPoint: function(e, t) {
  40157. var i = t || new Ci.Vector3;
  40158. i.subVectors(e, this.origin);
  40159. var n = i.dot(this.direction);
  40160. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40161. },
  40162. distanceToPoint: function(e) {
  40163. return Math.sqrt(this.distanceSqToPoint(e))
  40164. },
  40165. distanceSqToPoint: (J = new Ci.Vector3,
  40166. function(e) {
  40167. var t = J.subVectors(e, this.origin).dot(this.direction);
  40168. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40169. J.distanceToSquared(e))
  40170. }
  40171. ),
  40172. distanceSqToSegment: (Z = new Ci.Vector3,
  40173. K = new Ci.Vector3,
  40174. Q = new Ci.Vector3,
  40175. function(e, t, i, n) {
  40176. Z.copy(e).add(t).multiplyScalar(.5),
  40177. K.copy(t).sub(e).normalize(),
  40178. Q.copy(this.origin).sub(Z);
  40179. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  40180. if (0 < p)
  40181. if (o = c * h - u,
  40182. s = l * p,
  40183. 0 <= (r = c * u - h))
  40184. if (-s <= o)
  40185. if (o <= s) {
  40186. var f = 1 / p;
  40187. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40188. } else
  40189. o = l,
  40190. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40191. else
  40192. o = -l,
  40193. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40194. else
  40195. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  40196. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  40197. else
  40198. o = 0 < c ? -l : l,
  40199. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40200. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40201. n && n.copy(K).multiplyScalar(o).add(Z),
  40202. a
  40203. }
  40204. ),
  40205. intersectSphere: (X = new Ci.Vector3,
  40206. function(e, t) {
  40207. X.subVectors(e.center, this.origin);
  40208. var i = X.dot(this.direction)
  40209. , n = X.dot(X) - i * i
  40210. , r = e.radius * e.radius;
  40211. if (r < n)
  40212. return null;
  40213. var o = Math.sqrt(r - n)
  40214. , a = i - o
  40215. , s = i + o;
  40216. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40217. }
  40218. ),
  40219. intersectsSphere: function(e) {
  40220. return this.distanceToPoint(e.center) <= e.radius
  40221. },
  40222. distanceToPlane: function(e) {
  40223. var t = e.normal.dot(this.direction);
  40224. if (0 === t)
  40225. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40226. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40227. return 0 <= i ? i : null
  40228. },
  40229. intersectPlane: function(e, t) {
  40230. var i = this.distanceToPlane(e);
  40231. return null === i ? null : this.at(i, t)
  40232. },
  40233. intersectsPlane: function(e) {
  40234. var t = e.distanceToPoint(this.origin);
  40235. return 0 === t || e.normal.dot(this.direction) * t < 0
  40236. },
  40237. intersectBox: function(e, t) {
  40238. 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;
  40239. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40240. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40241. (e.min.x - u.x) * l),
  40242. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40243. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40244. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40245. (o < n || n != n) && (n = o),
  40246. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40247. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40248. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40249. (s < n || n != n) && (n = s),
  40250. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40251. },
  40252. intersectsBox: (q = new Ci.Vector3,
  40253. function(e) {
  40254. return null !== this.intersectBox(e, q)
  40255. }
  40256. ),
  40257. intersectTriangle: (G = new Ci.Vector3,
  40258. W = new Ci.Vector3,
  40259. j = new Ci.Vector3,
  40260. Y = new Ci.Vector3,
  40261. function(e, t, i, n, r) {
  40262. W.subVectors(t, e),
  40263. j.subVectors(i, e),
  40264. Y.crossVectors(W, j);
  40265. var o, a = this.direction.dot(Y);
  40266. if (0 < a) {
  40267. if (n)
  40268. return null;
  40269. o = 1
  40270. } else {
  40271. if (!(a < 0))
  40272. return null;
  40273. o = -1,
  40274. a = -a
  40275. }
  40276. G.subVectors(this.origin, e);
  40277. var s = o * this.direction.dot(j.crossVectors(G, j));
  40278. if (s < 0)
  40279. return null;
  40280. var l = o * this.direction.dot(W.cross(G));
  40281. if (l < 0)
  40282. return null;
  40283. if (a < s + l)
  40284. return null;
  40285. var c = -o * G.dot(Y);
  40286. return c < 0 ? null : this.at(c / a, r)
  40287. }
  40288. ),
  40289. applyMatrix4: function(e) {
  40290. return this.direction.add(this.origin).applyMatrix4(e),
  40291. this.origin.applyMatrix4(e),
  40292. this.direction.sub(this.origin),
  40293. this.direction.normalize(),
  40294. this
  40295. },
  40296. equals: function(e) {
  40297. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40298. }
  40299. },
  40300. Ci.Sphere = function(e, t) {
  40301. this.center = void 0 !== e ? e : new Ci.Vector3,
  40302. this.radius = void 0 !== t ? t : 0
  40303. }
  40304. ,
  40305. Ci.Sphere.prototype = {
  40306. constructor: Ci.Sphere,
  40307. set: function(e, t) {
  40308. return this.center.copy(e),
  40309. this.radius = t,
  40310. this
  40311. },
  40312. setFromPoints: (z = new Ci.Box3,
  40313. function(e, t) {
  40314. var i = this.center;
  40315. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40316. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40317. n = Math.max(n, i.distanceToSquared(e[r]));
  40318. return this.radius = Math.sqrt(n),
  40319. this
  40320. }
  40321. ),
  40322. clone: function() {
  40323. return (new this.constructor).copy(this)
  40324. },
  40325. copy: function(e) {
  40326. return this.center.copy(e.center),
  40327. this.radius = e.radius,
  40328. this
  40329. },
  40330. empty: function() {
  40331. return this.radius <= 0
  40332. },
  40333. containsPoint: function(e) {
  40334. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40335. },
  40336. distanceToPoint: function(e) {
  40337. return e.distanceTo(this.center) - this.radius
  40338. },
  40339. intersectsSphere: function(e) {
  40340. var t = this.radius + e.radius;
  40341. return e.center.distanceToSquared(this.center) <= t * t
  40342. },
  40343. intersectsBox: function(e) {
  40344. return e.intersectsSphere(this)
  40345. },
  40346. intersectsPlane: function(e) {
  40347. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40348. },
  40349. clampPoint: function(e, t) {
  40350. var i = this.center.distanceToSquared(e)
  40351. , n = t || new Ci.Vector3;
  40352. return n.copy(e),
  40353. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40354. n.multiplyScalar(this.radius).add(this.center)),
  40355. n
  40356. },
  40357. getBoundingBox: function(e) {
  40358. var t = e || new Ci.Box3;
  40359. return t.set(this.center, this.center),
  40360. t.expandByScalar(this.radius),
  40361. t
  40362. },
  40363. applyMatrix4: function(e) {
  40364. return this.center.applyMatrix4(e),
  40365. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40366. this
  40367. },
  40368. translate: function(e) {
  40369. return this.center.add(e),
  40370. this
  40371. },
  40372. equals: function(e) {
  40373. return e.center.equals(this.center) && e.radius === this.radius
  40374. }
  40375. },
  40376. Ci.Frustum = function(e, t, i, n, r, o) {
  40377. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  40378. }
  40379. ,
  40380. Ci.Frustum.prototype = {
  40381. constructor: Ci.Frustum,
  40382. set: function(e, t, i, n, r, o) {
  40383. var a = this.planes;
  40384. return a[0].copy(e),
  40385. a[1].copy(t),
  40386. a[2].copy(i),
  40387. a[3].copy(n),
  40388. a[4].copy(r),
  40389. a[5].copy(o),
  40390. this
  40391. },
  40392. clone: function() {
  40393. return (new this.constructor).copy(this)
  40394. },
  40395. copy: function(e) {
  40396. for (var t = this.planes, i = 0; i < 6; i++)
  40397. t[i].copy(e.planes[i]);
  40398. return this
  40399. },
  40400. setFromMatrix: function(e) {
  40401. var t = this.planes
  40402. , i = e.elements
  40403. , n = i[0]
  40404. , r = i[1]
  40405. , o = i[2]
  40406. , a = i[3]
  40407. , s = i[4]
  40408. , l = i[5]
  40409. , c = i[6]
  40410. , h = i[7]
  40411. , u = i[8]
  40412. , d = i[9]
  40413. , p = i[10]
  40414. , f = i[11]
  40415. , g = i[12]
  40416. , m = i[13]
  40417. , v = i[14]
  40418. , y = i[15];
  40419. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40420. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40421. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40422. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40423. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40424. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40425. this
  40426. },
  40427. intersectsObject: (H = new Ci.Sphere,
  40428. function(e) {
  40429. var t = e.geometry;
  40430. return null === t.boundingSphere && t.computeBoundingSphere(),
  40431. H.copy(t.boundingSphere),
  40432. H.applyMatrix4(e.matrixWorld),
  40433. this.intersectsSphere(H)
  40434. }
  40435. ),
  40436. intersectsSphere: function(e) {
  40437. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40438. if (t[r].distanceToPoint(i) < n)
  40439. return !1
  40440. }
  40441. return !0
  40442. },
  40443. intersectsBox: (k = new Ci.Vector3,
  40444. U = new Ci.Vector3,
  40445. function(e) {
  40446. for (var t = this.planes, i = 0; i < 6; i++) {
  40447. var n = t[i];
  40448. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40449. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40450. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40451. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40452. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40453. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40454. var r = n.distanceToPoint(k)
  40455. , o = n.distanceToPoint(U);
  40456. if (r < 0 && o < 0)
  40457. return !1
  40458. }
  40459. return !0
  40460. }
  40461. ),
  40462. containsPoint: function(e) {
  40463. for (var t = this.planes, i = 0; i < 6; i++)
  40464. if (t[i].distanceToPoint(e) < 0)
  40465. return !1;
  40466. return !0
  40467. }
  40468. },
  40469. Ci.Plane = function(e, t) {
  40470. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40471. this.constant = void 0 !== t ? t : 0
  40472. }
  40473. ,
  40474. Ci.Plane.prototype = {
  40475. constructor: Ci.Plane,
  40476. set: function(e, t) {
  40477. return this.normal.copy(e),
  40478. this.constant = t,
  40479. this
  40480. },
  40481. setComponents: function(e, t, i, n) {
  40482. return this.normal.set(e, t, i),
  40483. this.constant = n,
  40484. this
  40485. },
  40486. setFromNormalAndCoplanarPoint: function(e, t) {
  40487. return this.normal.copy(e),
  40488. this.constant = -t.dot(this.normal),
  40489. this
  40490. },
  40491. setFromCoplanarPoints: (B = new Ci.Vector3,
  40492. V = new Ci.Vector3,
  40493. function(e, t, i) {
  40494. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40495. return this.setFromNormalAndCoplanarPoint(n, e),
  40496. this
  40497. }
  40498. ),
  40499. clone: function() {
  40500. return (new this.constructor).copy(this)
  40501. },
  40502. copy: function(e) {
  40503. return this.normal.copy(e.normal),
  40504. this.constant = e.constant,
  40505. this
  40506. },
  40507. normalize: function() {
  40508. var e = 1 / this.normal.length();
  40509. return this.normal.multiplyScalar(e),
  40510. this.constant *= e,
  40511. this
  40512. },
  40513. negate: function() {
  40514. return this.constant *= -1,
  40515. this.normal.negate(),
  40516. this
  40517. },
  40518. distanceToPoint: function(e) {
  40519. return this.normal.dot(e) + this.constant
  40520. },
  40521. distanceToSphere: function(e) {
  40522. return this.distanceToPoint(e.center) - e.radius
  40523. },
  40524. projectPoint: function(e, t) {
  40525. return this.orthoPoint(e, t).sub(e).negate()
  40526. },
  40527. orthoPoint: function(e, t) {
  40528. var i = this.distanceToPoint(e);
  40529. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40530. },
  40531. intersectLine: (F = new Ci.Vector3,
  40532. function(e, t) {
  40533. var i = t || new Ci.Vector3
  40534. , n = e.delta(F)
  40535. , r = this.normal.dot(n);
  40536. if (0 !== r) {
  40537. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40538. if (!(o < 0 || 1 < o))
  40539. return i.copy(n).multiplyScalar(o).add(e.start)
  40540. } else if (0 === this.distanceToPoint(e.start))
  40541. return i.copy(e.start)
  40542. }
  40543. ),
  40544. intersectsLine: function(e) {
  40545. var t = this.distanceToPoint(e.start)
  40546. , i = this.distanceToPoint(e.end);
  40547. return t < 0 && 0 < i || i < 0 && 0 < t
  40548. },
  40549. intersectsBox: function(e) {
  40550. return e.intersectsPlane(this)
  40551. },
  40552. intersectsSphere: function(e) {
  40553. return e.intersectsPlane(this)
  40554. },
  40555. coplanarPoint: function(e) {
  40556. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40557. },
  40558. applyMatrix4: (L = new Ci.Vector3,
  40559. D = new Ci.Vector3,
  40560. N = new Ci.Matrix3,
  40561. function(e, t) {
  40562. var i = t || N.getNormalMatrix(e)
  40563. , n = L.copy(this.normal).applyMatrix3(i)
  40564. , r = this.coplanarPoint(D);
  40565. return r.applyMatrix4(e),
  40566. this.setFromNormalAndCoplanarPoint(n, r),
  40567. this
  40568. }
  40569. ),
  40570. translate: function(e) {
  40571. return this.constant = this.constant - e.dot(this.normal),
  40572. this
  40573. },
  40574. equals: function(e) {
  40575. return e.normal.equals(this.normal) && e.constant === this.constant
  40576. }
  40577. },
  40578. Ci.Spherical = function(e, t, i) {
  40579. return this.radius = void 0 !== e ? e : 1,
  40580. this.phi = void 0 !== t ? t : 0,
  40581. this.theta = void 0 !== i ? i : 0,
  40582. this
  40583. }
  40584. ,
  40585. Ci.Spherical.prototype = {
  40586. constructor: Ci.Spherical,
  40587. set: function(e, t, i) {
  40588. this.radius = e,
  40589. this.phi = t,
  40590. this.theta = i
  40591. },
  40592. clone: function() {
  40593. return (new this.constructor).copy(this)
  40594. },
  40595. copy: function(e) {
  40596. return this.radius.copy(e.radius),
  40597. this.phi.copy(e.phi),
  40598. this.theta.copy(e.theta),
  40599. this
  40600. },
  40601. makeSafe: function() {
  40602. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40603. },
  40604. setFromVector3: function(e) {
  40605. return this.radius = e.length(),
  40606. 0 === this.radius ? (this.theta = 0,
  40607. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40608. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40609. this
  40610. }
  40611. },
  40612. Ci.Math = {
  40613. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40614. P = new Array(36),
  40615. O = 0,
  40616. function() {
  40617. for (var e = 0; e < 36; e++)
  40618. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40619. M = 15 & O,
  40620. O >>= 4,
  40621. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40622. return P.join("")
  40623. }
  40624. ),
  40625. clamp: function(e, t, i) {
  40626. return Math.max(t, Math.min(i, e))
  40627. },
  40628. euclideanModulo: function(e, t) {
  40629. return (e % t + t) % t
  40630. },
  40631. mapLinear: function(e, t, i, n, r) {
  40632. return n + (e - t) * (r - n) / (i - t)
  40633. },
  40634. smoothstep: function(e, t, i) {
  40635. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40636. },
  40637. smootherstep: function(e, t, i) {
  40638. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40639. },
  40640. random16: function() {
  40641. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40642. Math.random()
  40643. },
  40644. randInt: function(e, t) {
  40645. return e + Math.floor(Math.random() * (t - e + 1))
  40646. },
  40647. randFloat: function(e, t) {
  40648. return e + Math.random() * (t - e)
  40649. },
  40650. randFloatSpread: function(e) {
  40651. return e * (.5 - Math.random())
  40652. },
  40653. degToRad: (S = Math.PI / 180,
  40654. function(e) {
  40655. return e * S
  40656. }
  40657. ),
  40658. radToDeg: (x = 180 / Math.PI,
  40659. function(e) {
  40660. return e * x
  40661. }
  40662. ),
  40663. isPowerOfTwo: function(e) {
  40664. return 0 == (e & e - 1) && 0 !== e
  40665. },
  40666. nearestPowerOfTwo: function(e) {
  40667. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40668. },
  40669. nextPowerOfTwo: function(e) {
  40670. return e--,
  40671. e |= e >> 1,
  40672. e |= e >> 2,
  40673. e |= e >> 4,
  40674. e |= e >> 8,
  40675. e |= e >> 16,
  40676. ++e
  40677. }
  40678. },
  40679. Ci.Spline = function(e) {
  40680. function t(e, t, i, n, r, o, a) {
  40681. var s = .5 * (i - e)
  40682. , l = .5 * (n - t);
  40683. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40684. }
  40685. this.points = e;
  40686. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40687. x: 0,
  40688. y: 0,
  40689. z: 0
  40690. };
  40691. this.initFromArray = function(e) {
  40692. this.points = [];
  40693. for (var t = 0; t < e.length; t++)
  40694. this.points[t] = {
  40695. x: e[t][0],
  40696. y: e[t][1],
  40697. z: e[t][2]
  40698. }
  40699. }
  40700. ,
  40701. this.getPoint = function(e) {
  40702. return i = (this.points.length - 1) * e,
  40703. n = Math.floor(i),
  40704. r = i - n,
  40705. u[0] = 0 === n ? n : n - 1,
  40706. u[1] = n,
  40707. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40708. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40709. s = this.points[u[0]],
  40710. l = this.points[u[1]],
  40711. c = this.points[u[2]],
  40712. h = this.points[u[3]],
  40713. a = r * (o = r * r),
  40714. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40715. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40716. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40717. d
  40718. }
  40719. ,
  40720. this.getControlPointsArray = function() {
  40721. var e, t, i = this.points.length, n = [];
  40722. for (e = 0; e < i; e++)
  40723. t = this.points[e],
  40724. n[e] = [t.x, t.y, t.z];
  40725. return n
  40726. }
  40727. ,
  40728. this.getLength = function(e) {
  40729. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40730. for (h[0] = 0,
  40731. e = e || 100,
  40732. n = this.points.length * e,
  40733. l.copy(this.points[0]),
  40734. t = 1; t < n; t++)
  40735. i = t / n,
  40736. r = this.getPoint(i),
  40737. c.copy(r),
  40738. u += c.distanceTo(l),
  40739. l.copy(r),
  40740. o = (this.points.length - 1) * i,
  40741. (a = Math.floor(o)) !== s && (h[a] = u,
  40742. s = a);
  40743. return h[h.length] = u,
  40744. {
  40745. chunks: h,
  40746. total: u
  40747. }
  40748. }
  40749. ,
  40750. this.reparametrizeByArcLength = function(e) {
  40751. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40752. for (c.push(h.copy(this.points[0]).clone()),
  40753. t = 1; t < this.points.length; t++) {
  40754. for (a = u.chunks[t] - u.chunks[t - 1],
  40755. s = Math.ceil(e * a / u.total),
  40756. r = (t - 1) / (this.points.length - 1),
  40757. o = t / (this.points.length - 1),
  40758. i = 1; i < s - 1; i++)
  40759. n = r + i * (1 / s) * (o - r),
  40760. l = this.getPoint(n),
  40761. c.push(h.copy(l).clone());
  40762. c.push(h.copy(this.points[t]).clone())
  40763. }
  40764. this.points = c
  40765. }
  40766. }
  40767. ,
  40768. Ci.Triangle = function(e, t, i) {
  40769. this.a = void 0 !== e ? e : new Ci.Vector3,
  40770. this.b = void 0 !== t ? t : new Ci.Vector3,
  40771. this.c = void 0 !== i ? i : new Ci.Vector3
  40772. }
  40773. ,
  40774. Ci.Triangle.normal = (T = new Ci.Vector3,
  40775. function(e, t, i, n) {
  40776. var r = n || new Ci.Vector3;
  40777. r.subVectors(i, t),
  40778. T.subVectors(e, t),
  40779. r.cross(T);
  40780. var o = r.lengthSq();
  40781. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40782. }
  40783. ),
  40784. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40785. b = new Ci.Vector3,
  40786. w = new Ci.Vector3,
  40787. function(e, t, i, n, r) {
  40788. _.subVectors(n, t),
  40789. b.subVectors(i, t),
  40790. w.subVectors(e, t);
  40791. var o = _.dot(_)
  40792. , a = _.dot(b)
  40793. , s = _.dot(w)
  40794. , l = b.dot(b)
  40795. , c = b.dot(w)
  40796. , h = o * l - a * a
  40797. , u = r || new Ci.Vector3;
  40798. if (0 == h)
  40799. return u.set(-2, -1, -1);
  40800. var d = 1 / h
  40801. , p = (l * s - a * c) * d
  40802. , f = (o * c - a * s) * d;
  40803. return u.set(1 - p - f, f, p)
  40804. }
  40805. ),
  40806. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40807. function(e, t, i, n) {
  40808. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40809. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40810. }
  40811. ),
  40812. Ci.Triangle.prototype = {
  40813. constructor: Ci.Triangle,
  40814. set: function(e, t, i) {
  40815. return this.a.copy(e),
  40816. this.b.copy(t),
  40817. this.c.copy(i),
  40818. this
  40819. },
  40820. setFromPointsAndIndices: function(e, t, i, n) {
  40821. return this.a.copy(e[t]),
  40822. this.b.copy(e[i]),
  40823. this.c.copy(e[n]),
  40824. this
  40825. },
  40826. clone: function() {
  40827. return (new this.constructor).copy(this)
  40828. },
  40829. copy: function(e) {
  40830. return this.a.copy(e.a),
  40831. this.b.copy(e.b),
  40832. this.c.copy(e.c),
  40833. this
  40834. },
  40835. area: (C = new Ci.Vector3,
  40836. I = new Ci.Vector3,
  40837. function() {
  40838. return C.subVectors(this.c, this.b),
  40839. I.subVectors(this.a, this.b),
  40840. .5 * C.cross(I).length()
  40841. }
  40842. ),
  40843. midpoint: function(e) {
  40844. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40845. },
  40846. normal: function(e) {
  40847. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40848. },
  40849. plane: function(e) {
  40850. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40851. },
  40852. barycoordFromPoint: function(e, t) {
  40853. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40854. },
  40855. containsPoint: function(e) {
  40856. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40857. },
  40858. equals: function(e) {
  40859. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40860. }
  40861. },
  40862. Ci.Interpolant = function(e, t, i, n) {
  40863. this.parameterPositions = e,
  40864. this._cachedIndex = 0,
  40865. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40866. this.sampleValues = t,
  40867. this.valueSize = i
  40868. }
  40869. ,
  40870. Ci.Interpolant.prototype = {
  40871. constructor: Ci.Interpolant,
  40872. evaluate: function(e) {
  40873. var t = this.parameterPositions
  40874. , i = this._cachedIndex
  40875. , n = t[i]
  40876. , r = t[i - 1];
  40877. e: {
  40878. t: {
  40879. var o;
  40880. i: {
  40881. n: if (!(e < n)) {
  40882. for (var a = i + 2; ; ) {
  40883. if (void 0 === n) {
  40884. if (e < r)
  40885. break n;
  40886. return i = t.length,
  40887. this._cachedIndex = i,
  40888. this.afterEnd_(i - 1, e, r)
  40889. }
  40890. if (i === a)
  40891. break;
  40892. if (r = n,
  40893. e < (n = t[++i]))
  40894. break t
  40895. }
  40896. o = t.length;
  40897. break i
  40898. }
  40899. if (r <= e)
  40900. break e;
  40901. var s = t[1];
  40902. e < s && (i = 2,
  40903. r = s);
  40904. for (a = i - 2; ; ) {
  40905. if (void 0 === r)
  40906. return this._cachedIndex = 0,
  40907. this.beforeStart_(0, e, n);
  40908. if (i === a)
  40909. break;
  40910. if (n = r,
  40911. (r = t[--i - 1]) <= e)
  40912. break t
  40913. }
  40914. o = i,
  40915. i = 0
  40916. }
  40917. for (; i < o; ) {
  40918. var l = i + o >>> 1;
  40919. e < t[l] ? o = l : i = 1 + l
  40920. }
  40921. if (n = t[i],
  40922. void 0 === (r = t[i - 1]))
  40923. return this._cachedIndex = 0,
  40924. this.beforeStart_(0, e, n);
  40925. if (void 0 === n)
  40926. return i = t.length,
  40927. this._cachedIndex = i,
  40928. this.afterEnd_(i - 1, r, e)
  40929. }
  40930. this._cachedIndex = i,
  40931. this.intervalChanged_(i, r, n)
  40932. }
  40933. return this.interpolate_(i, r, e, n)
  40934. },
  40935. settings: null,
  40936. DefaultSettings_: {},
  40937. getSettings_: function() {
  40938. return this.settings || this.DefaultSettings_
  40939. },
  40940. copySampleValue_: function(e) {
  40941. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40942. t[o] = i[r + o];
  40943. return t
  40944. },
  40945. interpolate_: function(e, t, i, n) {
  40946. throw new Error("call to abstract method")
  40947. },
  40948. intervalChanged_: function(e, t, i) {}
  40949. },
  40950. Object.assign(Ci.Interpolant.prototype, {
  40951. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40952. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40953. }),
  40954. Ci.CubicInterpolant = function(e, t, i, n) {
  40955. Ci.Interpolant.call(this, e, t, i, n),
  40956. this._weightPrev = -0,
  40957. this._offsetPrev = -0,
  40958. this._weightNext = -0,
  40959. this._offsetNext = -0
  40960. }
  40961. ,
  40962. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40963. constructor: Ci.CubicInterpolant,
  40964. DefaultSettings_: {
  40965. endingStart: Ci.ZeroCurvatureEnding,
  40966. endingEnd: Ci.ZeroCurvatureEnding
  40967. },
  40968. intervalChanged_: function(e, t, i) {
  40969. var n = this.parameterPositions
  40970. , r = e - 2
  40971. , o = e + 1
  40972. , a = n[r]
  40973. , s = n[o];
  40974. if (void 0 === a)
  40975. switch (this.getSettings_().endingStart) {
  40976. case Ci.ZeroSlopeEnding:
  40977. r = e,
  40978. a = 2 * t - i;
  40979. break;
  40980. case Ci.WrapAroundEnding:
  40981. a = t + n[r = n.length - 2] - n[r + 1];
  40982. break;
  40983. default:
  40984. r = e,
  40985. a = i
  40986. }
  40987. if (void 0 === s)
  40988. switch (this.getSettings_().endingEnd) {
  40989. case Ci.ZeroSlopeEnding:
  40990. o = e,
  40991. s = 2 * i - t;
  40992. break;
  40993. case Ci.WrapAroundEnding:
  40994. s = i + n[o = 1] - n[0];
  40995. break;
  40996. default:
  40997. o = e - 1,
  40998. s = t
  40999. }
  41000. var l = .5 * (i - t)
  41001. , c = this.valueSize;
  41002. this._weightPrev = l / (t - a),
  41003. this._weightNext = l / (s - i),
  41004. this._offsetPrev = r * c,
  41005. this._offsetNext = o * c
  41006. },
  41007. interpolate_: function(e, t, i, n) {
  41008. 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, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  41009. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41010. return r
  41011. }
  41012. }),
  41013. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41014. Ci.Interpolant.call(this, e, t, i, n)
  41015. }
  41016. ,
  41017. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41018. constructor: Ci.DiscreteInterpolant,
  41019. interpolate_: function(e, t, i, n) {
  41020. return this.copySampleValue_(e - 1)
  41021. }
  41022. }),
  41023. Ci.LinearInterpolant = function(e, t, i, n) {
  41024. Ci.Interpolant.call(this, e, t, i, n)
  41025. }
  41026. ,
  41027. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41028. constructor: Ci.LinearInterpolant,
  41029. interpolate_: function(e, t, i, n) {
  41030. 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)
  41031. r[u] = o[l + u] * h + o[s + u] * c;
  41032. return r
  41033. }
  41034. }),
  41035. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41036. Ci.Interpolant.call(this, e, t, i, n)
  41037. }
  41038. ,
  41039. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41040. constructor: Ci.QuaternionLinearInterpolant,
  41041. interpolate_: function(e, t, i, n) {
  41042. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  41043. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41044. return r
  41045. }
  41046. }),
  41047. Ci.Clock = function(e) {
  41048. this.autoStart = void 0 === e || e,
  41049. this.startTime = 0,
  41050. this.oldTime = 0,
  41051. this.elapsedTime = 0,
  41052. this.running = !1
  41053. }
  41054. ,
  41055. Ci.Clock.prototype = {
  41056. constructor: Ci.Clock,
  41057. start: function() {
  41058. this.startTime = performance.now(),
  41059. this.oldTime = this.startTime,
  41060. this.running = !0
  41061. },
  41062. stop: function() {
  41063. this.getElapsedTime(),
  41064. this.running = !1
  41065. },
  41066. getElapsedTime: function() {
  41067. return this.getDelta(),
  41068. this.elapsedTime
  41069. },
  41070. getDelta: function() {
  41071. var e = 0;
  41072. if (this.autoStart && !this.running && this.start(),
  41073. this.running) {
  41074. var t = performance.now();
  41075. e = .001 * (t - this.oldTime),
  41076. this.oldTime = t,
  41077. this.elapsedTime += e
  41078. }
  41079. return e
  41080. }
  41081. },
  41082. Ci.EventDispatcher = function() {}
  41083. ,
  41084. Ci.EventDispatcher.prototype = {
  41085. constructor: Ci.EventDispatcher,
  41086. apply: function(e) {
  41087. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41088. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41089. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41090. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41091. },
  41092. addEventListener: function(e, t) {
  41093. void 0 === this._listeners && (this._listeners = {});
  41094. var i = this._listeners;
  41095. void 0 === i[e] && (i[e] = []),
  41096. -1 === i[e].indexOf(t) && i[e].push(t)
  41097. },
  41098. hasEventListener: function(e, t) {
  41099. if (void 0 === this._listeners)
  41100. return !1;
  41101. var i = this._listeners;
  41102. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41103. },
  41104. removeEventListener: function(e, t) {
  41105. if (void 0 !== this._listeners) {
  41106. var i = this._listeners[e];
  41107. if (void 0 !== i) {
  41108. var n = i.indexOf(t);
  41109. -1 !== n && i.splice(n, 1)
  41110. }
  41111. }
  41112. },
  41113. dispatchEvent: function(e) {
  41114. if (void 0 !== this._listeners) {
  41115. var t = this._listeners[e.type];
  41116. if (void 0 !== t) {
  41117. e.target = this;
  41118. for (var i = [], n = t.length, r = 0; r < n; r++)
  41119. i[r] = t[r];
  41120. for (r = 0; r < n; r++)
  41121. i[r].call(this, e)
  41122. }
  41123. }
  41124. }
  41125. },
  41126. Ci.Layers = function() {
  41127. this.mask = 1
  41128. }
  41129. ,
  41130. Ci.Layers.prototype = {
  41131. constructor: Ci.Layers,
  41132. set: function(e) {
  41133. this.mask = 1 << e
  41134. },
  41135. enable: function(e) {
  41136. this.mask |= 1 << e
  41137. },
  41138. toggle: function(e) {
  41139. this.mask ^= 1 << e
  41140. },
  41141. disable: function(e) {
  41142. this.mask &= ~(1 << e)
  41143. },
  41144. test: function(e) {
  41145. return 0 != (this.mask & e.mask)
  41146. }
  41147. },
  41148. (A = Ci).Raycaster = function(e, t, i, n) {
  41149. this.ray = new A.Ray(e,t),
  41150. this.near = i || 0,
  41151. this.far = n || 1 / 0,
  41152. this.params = {
  41153. Mesh: {},
  41154. Line: {},
  41155. LOD: {},
  41156. Points: {
  41157. threshold: 1
  41158. },
  41159. Sprite: {}
  41160. },
  41161. Object.defineProperties(this.params, {
  41162. PointCloud: {
  41163. get: function() {
  41164. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41165. this.Points
  41166. }
  41167. }
  41168. })
  41169. }
  41170. ,
  41171. A.Raycaster.prototype = {
  41172. constructor: A.Raycaster,
  41173. linePrecision: 1,
  41174. set: function(e, t) {
  41175. this.ray.set(e, t)
  41176. },
  41177. setFromCamera: function(e, t) {
  41178. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41179. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  41180. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41181. },
  41182. intersectObject: function(e, t) {
  41183. var i = [];
  41184. return Ei(e, this, i, t),
  41185. i.sort(Ii),
  41186. i
  41187. },
  41188. intersectObjects: function(e, t) {
  41189. var i = [];
  41190. if (!1 === Array.isArray(e))
  41191. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41192. i;
  41193. for (var n = 0, r = e.length; n < r; n++)
  41194. Ei(e[n], this, i, t);
  41195. return i.sort(Ii),
  41196. i
  41197. }
  41198. },
  41199. Ci.Object3D = function() {
  41200. Object.defineProperty(this, "id", {
  41201. value: Ci.Object3DIdCount++
  41202. }),
  41203. this.uuid = Ci.Math.generateUUID(),
  41204. this.name = "",
  41205. this.type = "Object3D",
  41206. this.parent = null,
  41207. this.children = [],
  41208. this.up = Ci.Object3D.DefaultUp.clone();
  41209. var e = new Ci.Vector3
  41210. , t = new Ci.Euler
  41211. , i = new Ci.Quaternion
  41212. , n = new Ci.Vector3(1,1,1);
  41213. t.onChange(function() {
  41214. i.setFromEuler(t, !1)
  41215. }),
  41216. i.onChange(function() {
  41217. t.setFromQuaternion(i, void 0, !1)
  41218. }),
  41219. Object.defineProperties(this, {
  41220. position: {
  41221. enumerable: !0,
  41222. value: e
  41223. },
  41224. rotation: {
  41225. enumerable: !0,
  41226. value: t
  41227. },
  41228. quaternion: {
  41229. enumerable: !0,
  41230. value: i
  41231. },
  41232. scale: {
  41233. enumerable: !0,
  41234. value: n
  41235. },
  41236. modelViewMatrix: {
  41237. value: new Ci.Matrix4
  41238. },
  41239. normalMatrix: {
  41240. value: new Ci.Matrix3
  41241. }
  41242. }),
  41243. this.rotationAutoUpdate = !0,
  41244. this.matrix = new Ci.Matrix4,
  41245. this.matrixWorld = new Ci.Matrix4,
  41246. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41247. this.matrixWorldNeedsUpdate = !1,
  41248. this.layers = new Ci.Layers,
  41249. this.visible = !0,
  41250. this.castShadow = !1,
  41251. this.receiveShadow = !1,
  41252. this.frustumCulled = !0,
  41253. this.renderOrder = 0,
  41254. this.userData = {}
  41255. }
  41256. ,
  41257. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41258. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41259. Ci.Object3D.prototype = {
  41260. constructor: Ci.Object3D,
  41261. applyMatrix: function(e) {
  41262. this.matrix.multiplyMatrices(e, this.matrix),
  41263. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41264. },
  41265. setRotationFromAxisAngle: function(e, t) {
  41266. this.quaternion.setFromAxisAngle(e, t)
  41267. },
  41268. setRotationFromEuler: function(e) {
  41269. this.quaternion.setFromEuler(e, !0)
  41270. },
  41271. setRotationFromMatrix: function(e) {
  41272. this.quaternion.setFromRotationMatrix(e)
  41273. },
  41274. setRotationFromQuaternion: function(e) {
  41275. this.quaternion.copy(e)
  41276. },
  41277. rotateOnAxis: (y = new Ci.Quaternion,
  41278. function(e, t) {
  41279. return y.setFromAxisAngle(e, t),
  41280. this.quaternion.multiply(y),
  41281. this
  41282. }
  41283. ),
  41284. rotateX: (v = new Ci.Vector3(1,0,0),
  41285. function(e) {
  41286. return this.rotateOnAxis(v, e)
  41287. }
  41288. ),
  41289. rotateY: (m = new Ci.Vector3(0,1,0),
  41290. function(e) {
  41291. return this.rotateOnAxis(m, e)
  41292. }
  41293. ),
  41294. rotateZ: (g = new Ci.Vector3(0,0,1),
  41295. function(e) {
  41296. return this.rotateOnAxis(g, e)
  41297. }
  41298. ),
  41299. translateOnAxis: (f = new Ci.Vector3,
  41300. function(e, t) {
  41301. return f.copy(e).applyQuaternion(this.quaternion),
  41302. this.position.add(f.multiplyScalar(t)),
  41303. this
  41304. }
  41305. ),
  41306. translateX: (p = new Ci.Vector3(1,0,0),
  41307. function(e) {
  41308. return this.translateOnAxis(p, e)
  41309. }
  41310. ),
  41311. translateY: (d = new Ci.Vector3(0,1,0),
  41312. function(e) {
  41313. return this.translateOnAxis(d, e)
  41314. }
  41315. ),
  41316. translateZ: (u = new Ci.Vector3(0,0,1),
  41317. function(e) {
  41318. return this.translateOnAxis(u, e)
  41319. }
  41320. ),
  41321. localToWorld: function(e) {
  41322. return e.applyMatrix4(this.matrixWorld)
  41323. },
  41324. worldToLocal: (h = new Ci.Matrix4,
  41325. function(e) {
  41326. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41327. }
  41328. ),
  41329. lookAt: (c = new Ci.Matrix4,
  41330. function(e) {
  41331. c.lookAt(e, this.position, this.up),
  41332. this.quaternion.setFromRotationMatrix(c)
  41333. }
  41334. ),
  41335. add: function(e) {
  41336. if (1 < arguments.length) {
  41337. for (var t = 0; t < arguments.length; t++)
  41338. this.add(arguments[t]);
  41339. return this
  41340. }
  41341. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  41342. e.parent = this,
  41343. e.dispatchEvent({
  41344. type: "added"
  41345. }),
  41346. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41347. this
  41348. },
  41349. remove: function(e) {
  41350. if (1 < arguments.length)
  41351. for (var t = 0; t < arguments.length; t++)
  41352. this.remove(arguments[t]);
  41353. var i = this.children.indexOf(e);
  41354. -1 !== i && (e.parent = null,
  41355. e.dispatchEvent({
  41356. type: "removed"
  41357. }),
  41358. this.children.splice(i, 1))
  41359. },
  41360. getObjectById: function(e) {
  41361. return this.getObjectByProperty("id", e)
  41362. },
  41363. getObjectByName: function(e) {
  41364. return this.getObjectByProperty("name", e)
  41365. },
  41366. getObjectByProperty: function(e, t) {
  41367. if (this[e] === t)
  41368. return this;
  41369. for (var i = 0, n = this.children.length; i < n; i++) {
  41370. var r = this.children[i].getObjectByProperty(e, t);
  41371. if (void 0 !== r)
  41372. return r
  41373. }
  41374. },
  41375. getWorldPosition: function(e) {
  41376. var t = e || new Ci.Vector3;
  41377. return this.updateMatrixWorld(!0),
  41378. t.setFromMatrixPosition(this.matrixWorld)
  41379. },
  41380. getWorldQuaternion: (s = new Ci.Vector3,
  41381. l = new Ci.Vector3,
  41382. function(e) {
  41383. var t = e || new Ci.Quaternion;
  41384. return this.updateMatrixWorld(!0),
  41385. this.matrixWorld.decompose(s, t, l),
  41386. t
  41387. }
  41388. ),
  41389. getWorldRotation: (a = new Ci.Quaternion,
  41390. function(e) {
  41391. var t = e || new Ci.Euler;
  41392. return this.getWorldQuaternion(a),
  41393. t.setFromQuaternion(a, this.rotation.order, !1)
  41394. }
  41395. ),
  41396. getWorldScale: (r = new Ci.Vector3,
  41397. o = new Ci.Quaternion,
  41398. function(e) {
  41399. var t = e || new Ci.Vector3;
  41400. return this.updateMatrixWorld(!0),
  41401. this.matrixWorld.decompose(r, o, t),
  41402. t
  41403. }
  41404. ),
  41405. getWorldDirection: (n = new Ci.Quaternion,
  41406. function(e) {
  41407. var t = e || new Ci.Vector3;
  41408. return this.getWorldQuaternion(n),
  41409. t.set(0, 0, 1).applyQuaternion(n)
  41410. }
  41411. ),
  41412. raycast: function() {},
  41413. traverse: function(e) {
  41414. e(this);
  41415. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41416. t[i].traverse(e)
  41417. },
  41418. traverseVisible: function(e) {
  41419. if (!1 !== this.visible) {
  41420. e(this);
  41421. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41422. t[i].traverseVisible(e)
  41423. }
  41424. },
  41425. traverseAncestors: function(e) {
  41426. var t = this.parent;
  41427. null !== t && (e(t),
  41428. t.traverseAncestors(e))
  41429. },
  41430. updateMatrix: function() {
  41431. this.matrix.compose(this.position, this.quaternion, this.scale),
  41432. this.matrixWorldNeedsUpdate = !0
  41433. },
  41434. updateMatrixWorld: function(e) {
  41435. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41436. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41437. e = !(this.matrixWorldNeedsUpdate = !1));
  41438. for (var t = 0, i = this.children.length; t < i; t++)
  41439. this.children[t].updateMatrixWorld(e)
  41440. },
  41441. toJSON: function(e) {
  41442. function t(e) {
  41443. var t = [];
  41444. for (var i in e) {
  41445. var n = e[i];
  41446. delete n.metadata,
  41447. t.push(n)
  41448. }
  41449. return t
  41450. }
  41451. var i = void 0 === e
  41452. , n = {};
  41453. i && (e = {
  41454. geometries: {},
  41455. materials: {},
  41456. textures: {},
  41457. images: {}
  41458. },
  41459. n.metadata = {
  41460. version: 4.4,
  41461. type: "Object",
  41462. generator: "Object3D.toJSON"
  41463. });
  41464. var r = {};
  41465. if (r.uuid = this.uuid,
  41466. r.type = this.type,
  41467. "" !== this.name && (r.name = this.name),
  41468. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41469. !0 === this.castShadow && (r.castShadow = !0),
  41470. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41471. !1 === this.visible && (r.visible = !1),
  41472. r.matrix = this.matrix.toArray(),
  41473. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41474. r.geometry = this.geometry.uuid),
  41475. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41476. r.material = this.material.uuid),
  41477. 0 < this.children.length) {
  41478. r.children = [];
  41479. for (var o = 0; o < this.children.length; o++)
  41480. r.children.push(this.children[o].toJSON(e).object)
  41481. }
  41482. if (i) {
  41483. var a = t(e.geometries)
  41484. , s = t(e.materials)
  41485. , l = t(e.textures)
  41486. , c = t(e.images);
  41487. 0 < a.length && (n.geometries = a),
  41488. 0 < s.length && (n.materials = s),
  41489. 0 < l.length && (n.textures = l),
  41490. 0 < c.length && (n.images = c)
  41491. }
  41492. return n.object = r,
  41493. n
  41494. },
  41495. clone: function(e) {
  41496. return (new this.constructor).copy(this, e)
  41497. },
  41498. copy: function(e, t) {
  41499. if (void 0 === t && (t = !0),
  41500. this.name = e.name,
  41501. this.up.copy(e.up),
  41502. this.position.copy(e.position),
  41503. this.quaternion.copy(e.quaternion),
  41504. this.scale.copy(e.scale),
  41505. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41506. this.matrix.copy(e.matrix),
  41507. this.matrixWorld.copy(e.matrixWorld),
  41508. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41509. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41510. this.visible = e.visible,
  41511. this.castShadow = e.castShadow,
  41512. this.receiveShadow = e.receiveShadow,
  41513. this.frustumCulled = e.frustumCulled,
  41514. this.renderOrder = e.renderOrder,
  41515. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41516. !0 === t)
  41517. for (var i = 0; i < e.children.length; i++) {
  41518. var n = e.children[i];
  41519. this.add(n.clone())
  41520. }
  41521. return this
  41522. }
  41523. },
  41524. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41525. Ci.Object3DIdCount = 0,
  41526. Ci.Face3 = function(e, t, i, n, r, o) {
  41527. this.a = e,
  41528. this.b = t,
  41529. this.c = i,
  41530. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41531. this.vertexNormals = Array.isArray(n) ? n : [],
  41532. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41533. this.vertexColors = Array.isArray(r) ? r : [],
  41534. this.materialIndex = void 0 !== o ? o : 0
  41535. }
  41536. ,
  41537. Ci.Face3.prototype = {
  41538. constructor: Ci.Face3,
  41539. clone: function() {
  41540. return (new this.constructor).copy(this)
  41541. },
  41542. copy: function(e) {
  41543. this.a = e.a,
  41544. this.b = e.b,
  41545. this.c = e.c,
  41546. this.normal.copy(e.normal),
  41547. this.color.copy(e.color),
  41548. this.materialIndex = e.materialIndex;
  41549. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41550. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41551. for (t = 0,
  41552. i = e.vertexColors.length; t < i; t++)
  41553. this.vertexColors[t] = e.vertexColors[t].clone();
  41554. return this
  41555. }
  41556. },
  41557. Ci.BufferAttribute = function(e, t) {
  41558. this.uuid = Ci.Math.generateUUID(),
  41559. this.array = e,
  41560. this.itemSize = t,
  41561. this.dynamic = !1,
  41562. this.updateRange = {
  41563. offset: 0,
  41564. count: -1
  41565. },
  41566. this.version = 0
  41567. }
  41568. ,
  41569. Ci.BufferAttribute.prototype = {
  41570. constructor: Ci.BufferAttribute,
  41571. get count() {
  41572. return this.array.length / this.itemSize
  41573. },
  41574. set needsUpdate(e) {
  41575. !0 === e && this.version++
  41576. },
  41577. setDynamic: function(e) {
  41578. return this.dynamic = e,
  41579. this
  41580. },
  41581. copy: function(e) {
  41582. return this.array = new e.array.constructor(e.array),
  41583. this.itemSize = e.itemSize,
  41584. this.dynamic = e.dynamic,
  41585. this
  41586. },
  41587. copyAt: function(e, t, i) {
  41588. e *= this.itemSize,
  41589. i *= t.itemSize;
  41590. for (var n = 0, r = this.itemSize; n < r; n++)
  41591. this.array[e + n] = t.array[i + n];
  41592. return this
  41593. },
  41594. copyArray: function(e) {
  41595. return this.array.set(e),
  41596. this
  41597. },
  41598. copyColorsArray: function(e) {
  41599. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41600. var o = e[n];
  41601. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41602. o = new Ci.Color),
  41603. t[i++] = o.r,
  41604. t[i++] = o.g,
  41605. t[i++] = o.b
  41606. }
  41607. return this
  41608. },
  41609. copyIndicesArray: function(e) {
  41610. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41611. var o = e[n];
  41612. t[i++] = o.a,
  41613. t[i++] = o.b,
  41614. t[i++] = o.c
  41615. }
  41616. return this
  41617. },
  41618. copyVector2sArray: function(e) {
  41619. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41620. var o = e[n];
  41621. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41622. o = new Ci.Vector2),
  41623. t[i++] = o.x,
  41624. t[i++] = o.y
  41625. }
  41626. return this
  41627. },
  41628. copyVector3sArray: function(e) {
  41629. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41630. var o = e[n];
  41631. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41632. o = new Ci.Vector3),
  41633. t[i++] = o.x,
  41634. t[i++] = o.y,
  41635. t[i++] = o.z
  41636. }
  41637. return this
  41638. },
  41639. copyVector4sArray: function(e) {
  41640. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41641. var o = e[n];
  41642. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41643. o = new Ci.Vector4),
  41644. t[i++] = o.x,
  41645. t[i++] = o.y,
  41646. t[i++] = o.z,
  41647. t[i++] = o.w
  41648. }
  41649. return this
  41650. },
  41651. set: function(e, t) {
  41652. return void 0 === t && (t = 0),
  41653. this.array.set(e, t),
  41654. this
  41655. },
  41656. getX: function(e) {
  41657. return this.array[e * this.itemSize]
  41658. },
  41659. setX: function(e, t) {
  41660. return this.array[e * this.itemSize] = t,
  41661. this
  41662. },
  41663. getY: function(e) {
  41664. return this.array[e * this.itemSize + 1]
  41665. },
  41666. setY: function(e, t) {
  41667. return this.array[e * this.itemSize + 1] = t,
  41668. this
  41669. },
  41670. getZ: function(e) {
  41671. return this.array[e * this.itemSize + 2]
  41672. },
  41673. setZ: function(e, t) {
  41674. return this.array[e * this.itemSize + 2] = t,
  41675. this
  41676. },
  41677. getW: function(e) {
  41678. return this.array[e * this.itemSize + 3]
  41679. },
  41680. setW: function(e, t) {
  41681. return this.array[e * this.itemSize + 3] = t,
  41682. this
  41683. },
  41684. setXY: function(e, t, i) {
  41685. return e *= this.itemSize,
  41686. this.array[e + 0] = t,
  41687. this.array[e + 1] = i,
  41688. this
  41689. },
  41690. setXYZ: function(e, t, i, n) {
  41691. return e *= this.itemSize,
  41692. this.array[e + 0] = t,
  41693. this.array[e + 1] = i,
  41694. this.array[e + 2] = n,
  41695. this
  41696. },
  41697. setXYZW: function(e, t, i, n, r) {
  41698. return e *= this.itemSize,
  41699. this.array[e + 0] = t,
  41700. this.array[e + 1] = i,
  41701. this.array[e + 2] = n,
  41702. this.array[e + 3] = r,
  41703. this
  41704. },
  41705. clone: function() {
  41706. return (new this.constructor).copy(this)
  41707. }
  41708. },
  41709. Ci.Int8Attribute = function(e, t) {
  41710. return new Ci.BufferAttribute(new Int8Array(e),t)
  41711. }
  41712. ,
  41713. Ci.Uint8Attribute = function(e, t) {
  41714. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41715. }
  41716. ,
  41717. Ci.Uint8ClampedAttribute = function(e, t) {
  41718. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41719. }
  41720. ,
  41721. Ci.Int16Attribute = function(e, t) {
  41722. return new Ci.BufferAttribute(new Int16Array(e),t)
  41723. }
  41724. ,
  41725. Ci.Uint16Attribute = function(e, t) {
  41726. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41727. }
  41728. ,
  41729. Ci.Int32Attribute = function(e, t) {
  41730. return new Ci.BufferAttribute(new Int32Array(e),t)
  41731. }
  41732. ,
  41733. Ci.Uint32Attribute = function(e, t) {
  41734. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41735. }
  41736. ,
  41737. Ci.Float32Attribute = function(e, t) {
  41738. return new Ci.BufferAttribute(new Float32Array(e),t)
  41739. }
  41740. ,
  41741. Ci.Float64Attribute = function(e, t) {
  41742. return new Ci.BufferAttribute(new Float64Array(e),t)
  41743. }
  41744. ,
  41745. Ci.DynamicBufferAttribute = function(e, t) {
  41746. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41747. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41748. }
  41749. ,
  41750. Ci.InstancedBufferAttribute = function(e, t, i) {
  41751. Ci.BufferAttribute.call(this, e, t),
  41752. this.meshPerAttribute = i || 1
  41753. }
  41754. ,
  41755. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41756. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41757. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41758. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41759. this.meshPerAttribute = e.meshPerAttribute,
  41760. this
  41761. }
  41762. ,
  41763. Ci.InterleavedBuffer = function(e, t) {
  41764. this.uuid = Ci.Math.generateUUID(),
  41765. this.array = e,
  41766. this.stride = t,
  41767. this.dynamic = !1,
  41768. this.updateRange = {
  41769. offset: 0,
  41770. count: -1
  41771. },
  41772. this.version = 0
  41773. }
  41774. ,
  41775. Ci.InterleavedBuffer.prototype = {
  41776. constructor: Ci.InterleavedBuffer,
  41777. get length() {
  41778. return this.array.length
  41779. },
  41780. get count() {
  41781. return this.array.length / this.stride
  41782. },
  41783. set needsUpdate(e) {
  41784. !0 === e && this.version++
  41785. },
  41786. setDynamic: function(e) {
  41787. return this.dynamic = e,
  41788. this
  41789. },
  41790. copy: function(e) {
  41791. return this.array = new e.array.constructor(e.array),
  41792. this.stride = e.stride,
  41793. this.dynamic = e.dynamic,
  41794. this
  41795. },
  41796. copyAt: function(e, t, i) {
  41797. e *= this.stride,
  41798. i *= t.stride;
  41799. for (var n = 0, r = this.stride; n < r; n++)
  41800. this.array[e + n] = t.array[i + n];
  41801. return this
  41802. },
  41803. set: function(e, t) {
  41804. return void 0 === t && (t = 0),
  41805. this.array.set(e, t),
  41806. this
  41807. },
  41808. clone: function() {
  41809. return (new this.constructor).copy(this)
  41810. }
  41811. },
  41812. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41813. Ci.InterleavedBuffer.call(this, e, t),
  41814. this.meshPerAttribute = i || 1
  41815. }
  41816. ,
  41817. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41818. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41819. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41820. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41821. this.meshPerAttribute = e.meshPerAttribute,
  41822. this
  41823. }
  41824. ,
  41825. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41826. this.uuid = Ci.Math.generateUUID(),
  41827. this.data = e,
  41828. this.itemSize = t,
  41829. this.offset = i
  41830. }
  41831. ,
  41832. Ci.InterleavedBufferAttribute.prototype = {
  41833. constructor: Ci.InterleavedBufferAttribute,
  41834. get length() {
  41835. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41836. this.array.length
  41837. },
  41838. get count() {
  41839. return this.data.count
  41840. },
  41841. setX: function(e, t) {
  41842. return this.data.array[e * this.data.stride + this.offset] = t,
  41843. this
  41844. },
  41845. setY: function(e, t) {
  41846. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41847. this
  41848. },
  41849. setZ: function(e, t) {
  41850. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41851. this
  41852. },
  41853. setW: function(e, t) {
  41854. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41855. this
  41856. },
  41857. getX: function(e) {
  41858. return this.data.array[e * this.data.stride + this.offset]
  41859. },
  41860. getY: function(e) {
  41861. return this.data.array[e * this.data.stride + this.offset + 1]
  41862. },
  41863. getZ: function(e) {
  41864. return this.data.array[e * this.data.stride + this.offset + 2]
  41865. },
  41866. getW: function(e) {
  41867. return this.data.array[e * this.data.stride + this.offset + 3]
  41868. },
  41869. setXY: function(e, t, i) {
  41870. return e = e * this.data.stride + this.offset,
  41871. this.data.array[e + 0] = t,
  41872. this.data.array[e + 1] = i,
  41873. this
  41874. },
  41875. setXYZ: function(e, t, i, n) {
  41876. return e = e * this.data.stride + this.offset,
  41877. this.data.array[e + 0] = t,
  41878. this.data.array[e + 1] = i,
  41879. this.data.array[e + 2] = n,
  41880. this
  41881. },
  41882. setXYZW: function(e, t, i, n, r) {
  41883. return e = e * this.data.stride + this.offset,
  41884. this.data.array[e + 0] = t,
  41885. this.data.array[e + 1] = i,
  41886. this.data.array[e + 2] = n,
  41887. this.data.array[e + 3] = r,
  41888. this
  41889. }
  41890. },
  41891. Ci.Geometry = function() {
  41892. Object.defineProperty(this, "id", {
  41893. value: Ci.GeometryIdCount++
  41894. }),
  41895. this.uuid = Ci.Math.generateUUID(),
  41896. this.name = "",
  41897. this.type = "Geometry",
  41898. this.vertices = [],
  41899. this.colors = [],
  41900. this.faces = [],
  41901. this.faceVertexUvs = [[]],
  41902. this.morphTargets = [],
  41903. this.morphNormals = [],
  41904. this.skinWeights = [],
  41905. this.skinIndices = [],
  41906. this.lineDistances = [],
  41907. this.boundingBox = null,
  41908. this.boundingSphere = null,
  41909. this.verticesNeedUpdate = !1,
  41910. this.elementsNeedUpdate = !1,
  41911. this.uvsNeedUpdate = !1,
  41912. this.normalsNeedUpdate = !1,
  41913. this.colorsNeedUpdate = !1,
  41914. this.lineDistancesNeedUpdate = !1,
  41915. this.groupsNeedUpdate = !1
  41916. }
  41917. ,
  41918. Ci.Geometry.prototype = {
  41919. constructor: Ci.Geometry,
  41920. applyMatrix: function(e) {
  41921. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41922. this.vertices[i].applyMatrix4(e)
  41923. }
  41924. for (i = 0,
  41925. n = this.faces.length; i < n; i++) {
  41926. var r = this.faces[i];
  41927. r.normal.applyMatrix3(t).normalize();
  41928. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41929. r.vertexNormals[o].applyMatrix3(t).normalize()
  41930. }
  41931. return null !== this.boundingBox && this.computeBoundingBox(),
  41932. null !== this.boundingSphere && this.computeBoundingSphere(),
  41933. this.verticesNeedUpdate = !0,
  41934. this.normalsNeedUpdate = !0,
  41935. this
  41936. },
  41937. rotateX: function(e) {
  41938. return void 0 === mt && (mt = new Ci.Matrix4),
  41939. mt.makeRotationX(e),
  41940. this.applyMatrix(mt),
  41941. this
  41942. },
  41943. rotateY: function(e) {
  41944. return void 0 === gt && (gt = new Ci.Matrix4),
  41945. gt.makeRotationY(e),
  41946. this.applyMatrix(gt),
  41947. this
  41948. },
  41949. rotateZ: function(e) {
  41950. return void 0 === ft && (ft = new Ci.Matrix4),
  41951. ft.makeRotationZ(e),
  41952. this.applyMatrix(ft),
  41953. this
  41954. },
  41955. translate: function(e, t, i) {
  41956. return void 0 === pt && (pt = new Ci.Matrix4),
  41957. pt.makeTranslation(e, t, i),
  41958. this.applyMatrix(pt),
  41959. this
  41960. },
  41961. scale: function(e, t, i) {
  41962. return void 0 === dt && (dt = new Ci.Matrix4),
  41963. dt.makeScale(e, t, i),
  41964. this.applyMatrix(dt),
  41965. this
  41966. },
  41967. lookAt: function(e) {
  41968. void 0 === ut && (ut = new Ci.Object3D),
  41969. ut.lookAt(e),
  41970. ut.updateMatrix(),
  41971. this.applyMatrix(ut.matrix)
  41972. },
  41973. fromBufferGeometry: function(e) {
  41974. function t(e, t, i, n) {
  41975. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41976. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41977. , a = new Ci.Face3(e,t,i,r,o,n);
  41978. s.faces.push(a),
  41979. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41980. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41981. }
  41982. var s = this
  41983. , i = null !== e.index ? e.index.array : void 0
  41984. , n = e.attributes
  41985. , r = n.position.array
  41986. , l = void 0 !== n.normal ? n.normal.array : void 0
  41987. , c = void 0 !== n.color ? n.color.array : void 0
  41988. , h = void 0 !== n.uv ? n.uv.array : void 0
  41989. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41990. void 0 !== u && (this.faceVertexUvs[1] = []);
  41991. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41992. a += 2)
  41993. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41994. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41995. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41996. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41997. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41998. if (void 0 !== i) {
  41999. var g = e.groups;
  42000. if (0 < g.length)
  42001. for (o = 0; o < g.length; o++)
  42002. for (var m = g[o], v = m.start, y = (a = v,
  42003. v + m.count); a < y; a += 3)
  42004. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42005. else
  42006. for (o = 0; o < i.length; o += 3)
  42007. t(i[o], i[o + 1], i[o + 2])
  42008. } else
  42009. for (o = 0; o < r.length / 3; o += 3)
  42010. t(o, o + 1, o + 2);
  42011. return this.computeFaceNormals(),
  42012. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42013. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42014. this
  42015. },
  42016. center: function() {
  42017. this.computeBoundingBox();
  42018. var e = this.boundingBox.center().negate();
  42019. return this.translate(e.x, e.y, e.z),
  42020. e
  42021. },
  42022. normalize: function() {
  42023. this.computeBoundingSphere();
  42024. var e = this.boundingSphere.center
  42025. , t = this.boundingSphere.radius
  42026. , i = 0 === t ? 1 : 1 / t
  42027. , n = new Ci.Matrix4;
  42028. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  42029. this.applyMatrix(n),
  42030. this
  42031. },
  42032. computeFaceNormals: function() {
  42033. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42034. var r = this.faces[i]
  42035. , o = this.vertices[r.a]
  42036. , a = this.vertices[r.b]
  42037. , s = this.vertices[r.c];
  42038. e.subVectors(s, a),
  42039. t.subVectors(o, a),
  42040. e.cross(t),
  42041. e.normalize(),
  42042. r.normal.copy(e)
  42043. }
  42044. },
  42045. computeVertexNormals: function(e) {
  42046. var t, i, n, r, o, a;
  42047. for (void 0 === e && (e = !0),
  42048. a = new Array(this.vertices.length),
  42049. t = 0,
  42050. i = this.vertices.length; t < i; t++)
  42051. a[t] = new Ci.Vector3;
  42052. if (e) {
  42053. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42054. for (n = 0,
  42055. r = this.faces.length; n < r; n++)
  42056. o = this.faces[n],
  42057. s = this.vertices[o.a],
  42058. l = this.vertices[o.b],
  42059. c = this.vertices[o.c],
  42060. h.subVectors(c, l),
  42061. u.subVectors(s, l),
  42062. h.cross(u),
  42063. a[o.a].add(h),
  42064. a[o.b].add(h),
  42065. a[o.c].add(h)
  42066. } else
  42067. for (n = 0,
  42068. r = this.faces.length; n < r; n++)
  42069. a[(o = this.faces[n]).a].add(o.normal),
  42070. a[o.b].add(o.normal),
  42071. a[o.c].add(o.normal);
  42072. for (t = 0,
  42073. i = this.vertices.length; t < i; t++)
  42074. a[t].normalize();
  42075. for (n = 0,
  42076. r = this.faces.length; n < r; n++) {
  42077. var d = (o = this.faces[n]).vertexNormals;
  42078. 3 === d.length ? (d[0].copy(a[o.a]),
  42079. d[1].copy(a[o.b]),
  42080. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42081. d[1] = a[o.b].clone(),
  42082. d[2] = a[o.c].clone())
  42083. }
  42084. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42085. },
  42086. computeMorphNormals: function() {
  42087. var e, t, i, n, r;
  42088. for (i = 0,
  42089. n = this.faces.length; i < n; i++)
  42090. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42091. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42092. e = 0,
  42093. t = r.vertexNormals.length; e < t; e++)
  42094. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42095. var o = new Ci.Geometry;
  42096. for (o.faces = this.faces,
  42097. e = 0,
  42098. t = this.morphTargets.length; e < t; e++) {
  42099. if (!this.morphNormals[e]) {
  42100. this.morphNormals[e] = {},
  42101. this.morphNormals[e].faceNormals = [],
  42102. this.morphNormals[e].vertexNormals = [];
  42103. var a = this.morphNormals[e].faceNormals
  42104. , s = this.morphNormals[e].vertexNormals;
  42105. for (i = 0,
  42106. n = this.faces.length; i < n; i++)
  42107. l = new Ci.Vector3,
  42108. c = {
  42109. a: new Ci.Vector3,
  42110. b: new Ci.Vector3,
  42111. c: new Ci.Vector3
  42112. },
  42113. a.push(l),
  42114. s.push(c)
  42115. }
  42116. var l, c, h = this.morphNormals[e];
  42117. for (o.vertices = this.morphTargets[e].vertices,
  42118. o.computeFaceNormals(),
  42119. o.computeVertexNormals(),
  42120. i = 0,
  42121. n = this.faces.length; i < n; i++)
  42122. r = this.faces[i],
  42123. l = h.faceNormals[i],
  42124. c = h.vertexNormals[i],
  42125. l.copy(r.normal),
  42126. c.a.copy(r.vertexNormals[0]),
  42127. c.b.copy(r.vertexNormals[1]),
  42128. c.c.copy(r.vertexNormals[2])
  42129. }
  42130. for (i = 0,
  42131. n = this.faces.length; i < n; i++)
  42132. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42133. r.vertexNormals = r.__originalVertexNormals
  42134. },
  42135. computeTangents: function() {
  42136. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42137. },
  42138. computeLineDistances: function() {
  42139. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42140. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42141. this.lineDistances[i] = e
  42142. },
  42143. computeBoundingBox: function() {
  42144. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42145. this.boundingBox.setFromPoints(this.vertices)
  42146. },
  42147. computeBoundingSphere: function() {
  42148. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42149. this.boundingSphere.setFromPoints(this.vertices)
  42150. },
  42151. merge: function(e, t, i) {
  42152. if (e instanceof Ci.Geometry != 0) {
  42153. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  42154. void 0 === i && (i = 0),
  42155. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42156. for (var u = 0, d = a.length; u < d; u++) {
  42157. var p = a[u].clone();
  42158. void 0 !== t && p.applyMatrix4(t),
  42159. o.push(p)
  42160. }
  42161. for (u = 0,
  42162. d = l.length; u < d; u++) {
  42163. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42164. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42165. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42166. for (var C = 0, I = y.length; C < I; C++)
  42167. g = y[C].clone(),
  42168. void 0 !== n && g.applyMatrix3(n).normalize(),
  42169. f.vertexNormals.push(g);
  42170. f.color.copy(v.color);
  42171. for (C = 0,
  42172. I = A.length; C < I; C++)
  42173. m = A[C],
  42174. f.vertexColors.push(m.clone());
  42175. f.materialIndex = v.materialIndex + i,
  42176. s.push(f)
  42177. }
  42178. for (u = 0,
  42179. d = h.length; u < d; u++) {
  42180. var E = h[u]
  42181. , _ = [];
  42182. if (void 0 !== E) {
  42183. for (C = 0,
  42184. I = E.length; C < I; C++)
  42185. _.push(E[C].clone());
  42186. c.push(_)
  42187. }
  42188. }
  42189. } else
  42190. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42191. },
  42192. mergeMesh: function(e) {
  42193. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42194. void this.merge(e.geometry, e.matrix))
  42195. },
  42196. mergeVertices: function() {
  42197. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42198. for (i = 0,
  42199. n = this.vertices.length; i < n; i++)
  42200. e = this.vertices[i],
  42201. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42202. c.push(this.vertices[i]),
  42203. h[i] = c.length - 1) : h[i] = h[l[t]];
  42204. var d = [];
  42205. for (i = 0,
  42206. n = this.faces.length; i < n; i++) {
  42207. (r = this.faces[i]).a = h[r.a],
  42208. r.b = h[r.b],
  42209. r.c = h[r.c],
  42210. o = [r.a, r.b, r.c];
  42211. for (var p = 0; p < 3; p++)
  42212. if (o[p] === o[(p + 1) % 3]) {
  42213. p,
  42214. d.push(i);
  42215. break
  42216. }
  42217. }
  42218. for (i = d.length - 1; 0 <= i; i--) {
  42219. var f = d[i];
  42220. for (this.faces.splice(f, 1),
  42221. a = 0,
  42222. s = this.faceVertexUvs.length; a < s; a++)
  42223. this.faceVertexUvs[a].splice(f, 1)
  42224. }
  42225. var g = this.vertices.length - c.length;
  42226. return this.vertices = c,
  42227. g
  42228. },
  42229. sortFacesByMaterialIndex: function() {
  42230. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42231. e[i]._id = i;
  42232. e.sort(function(e, t) {
  42233. return e.materialIndex - t.materialIndex
  42234. });
  42235. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42236. o && o.length === t && (n = []),
  42237. a && a.length === t && (r = []);
  42238. for (i = 0; i < t; i++) {
  42239. var s = e[i]._id;
  42240. n && n.push(o[s]),
  42241. r && r.push(a[s])
  42242. }
  42243. n && (this.faceVertexUvs[0] = n),
  42244. r && (this.faceVertexUvs[1] = r)
  42245. },
  42246. toJSON: function() {
  42247. function e(e, t, i) {
  42248. return i ? e | 1 << t : e & ~(1 << t)
  42249. }
  42250. function t(e) {
  42251. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42252. return void 0 !== d[t] || (d[t] = u.length / 3,
  42253. u.push(e.x, e.y, e.z)),
  42254. d[t]
  42255. }
  42256. function i(e) {
  42257. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42258. return void 0 !== f[t] || (f[t] = p.length,
  42259. p.push(e.getHex())),
  42260. f[t]
  42261. }
  42262. function n(e) {
  42263. var t = e.x.toString() + e.y.toString();
  42264. return void 0 !== m[t] || (m[t] = g.length / 2,
  42265. g.push(e.x, e.y)),
  42266. m[t]
  42267. }
  42268. var r = {
  42269. metadata: {
  42270. version: 4.4,
  42271. type: "Geometry",
  42272. generator: "Geometry.toJSON"
  42273. }
  42274. };
  42275. if (r.uuid = this.uuid,
  42276. r.type = this.type,
  42277. "" !== this.name && (r.name = this.name),
  42278. void 0 !== this.parameters) {
  42279. var o = this.parameters;
  42280. for (var a in o)
  42281. void 0 !== o[a] && (r[a] = o[a]);
  42282. return r
  42283. }
  42284. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42285. var c = this.vertices[l];
  42286. s.push(c.x, c.y, c.z)
  42287. }
  42288. var h = []
  42289. , u = []
  42290. , d = {}
  42291. , p = []
  42292. , f = {}
  42293. , g = []
  42294. , m = {};
  42295. for (l = 0; l < this.faces.length; l++) {
  42296. var v = this.faces[l]
  42297. , y = void 0 !== this.faceVertexUvs[0][l]
  42298. , A = 0 < v.normal.length()
  42299. , C = 0 < v.vertexNormals.length
  42300. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42301. , E = 0 < v.vertexColors.length
  42302. , _ = 0;
  42303. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  42304. h.push(_),
  42305. h.push(v.a, v.b, v.c),
  42306. h.push(v.materialIndex),
  42307. y) {
  42308. var b = this.faceVertexUvs[0][l];
  42309. h.push(n(b[0]), n(b[1]), n(b[2]))
  42310. }
  42311. if (A && h.push(t(v.normal)),
  42312. C) {
  42313. var w = v.vertexNormals;
  42314. h.push(t(w[0]), t(w[1]), t(w[2]))
  42315. }
  42316. if (I && h.push(i(v.color)),
  42317. E) {
  42318. var T = v.vertexColors;
  42319. h.push(i(T[0]), i(T[1]), i(T[2]))
  42320. }
  42321. }
  42322. return r.data = {},
  42323. r.data.vertices = s,
  42324. r.data.normals = u,
  42325. 0 < p.length && (r.data.colors = p),
  42326. 0 < g.length && (r.data.uvs = [g]),
  42327. r.data.faces = h,
  42328. r
  42329. },
  42330. clone: function() {
  42331. return (new Ci.Geometry).copy(this)
  42332. },
  42333. copy: function(e) {
  42334. this.vertices = [],
  42335. this.faces = [],
  42336. this.faceVertexUvs = [[]];
  42337. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42338. this.vertices.push(t[i].clone());
  42339. var r = e.faces;
  42340. for (i = 0,
  42341. n = r.length; i < n; i++)
  42342. this.faces.push(r[i].clone());
  42343. for (i = 0,
  42344. n = e.faceVertexUvs.length; i < n; i++) {
  42345. var o = e.faceVertexUvs[i];
  42346. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42347. for (var a = 0, s = o.length; a < s; a++) {
  42348. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42349. var d = l[h];
  42350. c.push(d.clone())
  42351. }
  42352. this.faceVertexUvs[i].push(c)
  42353. }
  42354. }
  42355. return this
  42356. },
  42357. dispose: function() {
  42358. this.dispatchEvent({
  42359. type: "dispose"
  42360. })
  42361. }
  42362. },
  42363. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42364. Ci.GeometryIdCount = 0,
  42365. Ci.DirectGeometry = function() {
  42366. Object.defineProperty(this, "id", {
  42367. value: Ci.GeometryIdCount++
  42368. }),
  42369. this.uuid = Ci.Math.generateUUID(),
  42370. this.name = "",
  42371. this.type = "DirectGeometry",
  42372. this.indices = [],
  42373. this.vertices = [],
  42374. this.normals = [],
  42375. this.colors = [],
  42376. this.uvs = [],
  42377. this.uvs2 = [],
  42378. this.groups = [],
  42379. this.morphTargets = {},
  42380. this.skinWeights = [],
  42381. this.skinIndices = [],
  42382. this.boundingBox = null,
  42383. this.boundingSphere = null,
  42384. this.verticesNeedUpdate = !1,
  42385. this.normalsNeedUpdate = !1,
  42386. this.colorsNeedUpdate = !1,
  42387. this.uvsNeedUpdate = !1,
  42388. this.groupsNeedUpdate = !1
  42389. }
  42390. ,
  42391. Ci.DirectGeometry.prototype = {
  42392. constructor: Ci.DirectGeometry,
  42393. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42394. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42395. computeFaceNormals: function() {
  42396. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42397. },
  42398. computeVertexNormals: function() {
  42399. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42400. },
  42401. computeGroups: function(e) {
  42402. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42403. var a = r[o];
  42404. a.materialIndex !== i && (i = a.materialIndex,
  42405. void 0 !== t && (t.count = 3 * o - t.start,
  42406. n.push(t)),
  42407. t = {
  42408. start: 3 * o,
  42409. materialIndex: i
  42410. })
  42411. }
  42412. void 0 !== t && (t.count = 3 * o - t.start,
  42413. n.push(t)),
  42414. this.groups = n
  42415. },
  42416. fromGeometry: function(e) {
  42417. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  42418. if (0 < l) {
  42419. t = [];
  42420. for (var c = 0; c < l; c++)
  42421. t[c] = [];
  42422. this.morphTargets.position = t
  42423. }
  42424. var h, u = e.morphNormals, d = u.length;
  42425. if (0 < d) {
  42426. h = [];
  42427. for (c = 0; c < d; c++)
  42428. h[c] = [];
  42429. this.morphTargets.normal = h
  42430. }
  42431. var p = e.skinIndices
  42432. , f = e.skinWeights
  42433. , g = p.length === n.length
  42434. , m = f.length === n.length;
  42435. for (c = 0; c < i.length; c++) {
  42436. var v = i[c];
  42437. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42438. var y = v.vertexNormals;
  42439. if (3 === y.length)
  42440. this.normals.push(y[0], y[1], y[2]);
  42441. else {
  42442. var A = v.normal;
  42443. this.normals.push(A, A, A)
  42444. }
  42445. var C, I = v.vertexColors;
  42446. if (3 === I.length)
  42447. this.colors.push(I[0], I[1], I[2]);
  42448. else {
  42449. var E = v.color;
  42450. this.colors.push(E, E, E)
  42451. }
  42452. if (!0 === o)
  42453. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42454. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42455. if (!0 === a)
  42456. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42457. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42458. for (var _ = 0; _ < l; _++) {
  42459. var b = s[_].vertices;
  42460. t[_].push(b[v.a], b[v.b], b[v.c])
  42461. }
  42462. for (_ = 0; _ < d; _++) {
  42463. var w = u[_].vertexNormals[c];
  42464. h[_].push(w.a, w.b, w.c)
  42465. }
  42466. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42467. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42468. }
  42469. return this.computeGroups(e),
  42470. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42471. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42472. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42473. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42474. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42475. this
  42476. },
  42477. dispose: function() {
  42478. this.dispatchEvent({
  42479. type: "dispose"
  42480. })
  42481. }
  42482. },
  42483. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42484. Ci.BufferGeometry = function() {
  42485. Object.defineProperty(this, "id", {
  42486. value: Ci.GeometryIdCount++
  42487. }),
  42488. this.uuid = Ci.Math.generateUUID(),
  42489. this.name = "",
  42490. this.type = "BufferGeometry",
  42491. this.index = null,
  42492. this.attributes = {},
  42493. this.morphAttributes = {},
  42494. this.groups = [],
  42495. this.boundingBox = null,
  42496. this.boundingSphere = null,
  42497. this.drawRange = {
  42498. start: 0,
  42499. count: 1 / 0
  42500. }
  42501. }
  42502. ,
  42503. Ci.BufferGeometry.prototype = {
  42504. constructor: Ci.BufferGeometry,
  42505. getIndex: function() {
  42506. return this.index
  42507. },
  42508. setIndex: function(e) {
  42509. this.index = e
  42510. },
  42511. addAttribute: function(e, t) {
  42512. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42513. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42514. void this.setIndex(t)) : (this.attributes[e] = t,
  42515. this)
  42516. },
  42517. getAttribute: function(e) {
  42518. return this.attributes[e]
  42519. },
  42520. removeAttribute: function(e) {
  42521. return delete this.attributes[e],
  42522. this
  42523. },
  42524. addGroup: function(e, t, i) {
  42525. this.groups.push({
  42526. start: e,
  42527. count: t,
  42528. materialIndex: void 0 !== i ? i : 0
  42529. })
  42530. },
  42531. clearGroups: function() {
  42532. this.groups = []
  42533. },
  42534. setDrawRange: function(e, t) {
  42535. this.drawRange.start = e,
  42536. this.drawRange.count = t
  42537. },
  42538. applyMatrix: function(e) {
  42539. var t = this.attributes.position;
  42540. void 0 !== t && (e.applyToVector3Array(t.array),
  42541. t.needsUpdate = !0);
  42542. var i = this.attributes.normal;
  42543. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42544. i.needsUpdate = !0);
  42545. return null !== this.boundingBox && this.computeBoundingBox(),
  42546. null !== this.boundingSphere && this.computeBoundingSphere(),
  42547. this
  42548. },
  42549. rotateX: function(e) {
  42550. return void 0 === ht && (ht = new Ci.Matrix4),
  42551. ht.makeRotationX(e),
  42552. this.applyMatrix(ht),
  42553. this
  42554. },
  42555. rotateY: function(e) {
  42556. return void 0 === ct && (ct = new Ci.Matrix4),
  42557. ct.makeRotationY(e),
  42558. this.applyMatrix(ct),
  42559. this
  42560. },
  42561. rotateZ: function(e) {
  42562. return void 0 === lt && (lt = new Ci.Matrix4),
  42563. lt.makeRotationZ(e),
  42564. this.applyMatrix(lt),
  42565. this
  42566. },
  42567. translate: function(e, t, i) {
  42568. return void 0 === st && (st = new Ci.Matrix4),
  42569. st.makeTranslation(e, t, i),
  42570. this.applyMatrix(st),
  42571. this
  42572. },
  42573. scale: function(e, t, i) {
  42574. return void 0 === at && (at = new Ci.Matrix4),
  42575. at.makeScale(e, t, i),
  42576. this.applyMatrix(at),
  42577. this
  42578. },
  42579. lookAt: function(e) {
  42580. void 0 === ot && (ot = new Ci.Object3D),
  42581. ot.lookAt(e),
  42582. ot.updateMatrix(),
  42583. this.applyMatrix(ot.matrix)
  42584. },
  42585. center: function() {
  42586. this.computeBoundingBox();
  42587. var e = this.boundingBox.center().negate();
  42588. return this.translate(e.x, e.y, e.z),
  42589. e
  42590. },
  42591. setFromObject: function(e) {
  42592. var t = e.geometry;
  42593. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42594. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42595. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42596. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42597. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42598. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42599. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42600. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42601. }
  42602. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42603. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42604. } else
  42605. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42606. return this
  42607. },
  42608. updateFromObject: function(e) {
  42609. var t, i = e.geometry;
  42610. if (e instanceof Ci.Mesh) {
  42611. var n = i.__directGeometry;
  42612. if (void 0 === n)
  42613. return this.fromGeometry(i);
  42614. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42615. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42616. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42617. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42618. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42619. i.verticesNeedUpdate = !1,
  42620. i.normalsNeedUpdate = !1,
  42621. i.colorsNeedUpdate = !1,
  42622. i.uvsNeedUpdate = !1,
  42623. i.groupsNeedUpdate = !1,
  42624. i = n
  42625. }
  42626. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42627. t.needsUpdate = !0),
  42628. i.verticesNeedUpdate = !1);
  42629. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42630. t.needsUpdate = !0),
  42631. i.normalsNeedUpdate = !1);
  42632. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42633. t.needsUpdate = !0),
  42634. i.colorsNeedUpdate = !1);
  42635. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42636. t.needsUpdate = !0),
  42637. i.uvsNeedUpdate = !1);
  42638. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42639. t.needsUpdate = !0),
  42640. i.lineDistancesNeedUpdate = !1);
  42641. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42642. this.groups = i.groups,
  42643. i.groupsNeedUpdate = !1),
  42644. this
  42645. },
  42646. fromGeometry: function(e) {
  42647. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42648. this.fromDirectGeometry(e.__directGeometry)
  42649. },
  42650. fromDirectGeometry: function(e) {
  42651. var t = new Float32Array(3 * e.vertices.length);
  42652. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42653. 0 < e.normals.length) {
  42654. var i = new Float32Array(3 * e.normals.length);
  42655. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42656. }
  42657. if (0 < e.colors.length) {
  42658. var n = new Float32Array(3 * e.colors.length);
  42659. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42660. }
  42661. if (0 < e.uvs.length) {
  42662. var r = new Float32Array(2 * e.uvs.length);
  42663. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42664. }
  42665. if (0 < e.uvs2.length) {
  42666. var o = new Float32Array(2 * e.uvs2.length);
  42667. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42668. }
  42669. if (0 < e.indices.length) {
  42670. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42671. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42672. }
  42673. for (var s in this.groups = e.groups,
  42674. e.morphTargets) {
  42675. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42676. var d = c[h]
  42677. , p = new Ci.Float32Attribute(3 * d.length,3);
  42678. l.push(p.copyVector3sArray(d))
  42679. }
  42680. this.morphAttributes[s] = l
  42681. }
  42682. if (0 < e.skinIndices.length) {
  42683. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42684. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42685. }
  42686. if (0 < e.skinWeights.length) {
  42687. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42688. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42689. }
  42690. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42691. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42692. this
  42693. },
  42694. computeBoundingBox: (new Ci.Vector3,
  42695. function() {
  42696. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42697. var e = this.attributes.position.array;
  42698. e && this.boundingBox.setFromArray(e),
  42699. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42700. this.boundingBox.max.set(0, 0, 0)),
  42701. (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)
  42702. }
  42703. ),
  42704. computeBoundingSphere: (nt = new Ci.Box3,
  42705. rt = new Ci.Vector3,
  42706. function() {
  42707. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42708. var e = this.attributes.position.array;
  42709. if (e) {
  42710. var t = this.boundingSphere.center;
  42711. nt.setFromArray(e),
  42712. nt.center(t);
  42713. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42714. rt.fromArray(e, n),
  42715. i = Math.max(i, t.distanceToSquared(rt));
  42716. this.boundingSphere.radius = Math.sqrt(i),
  42717. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42718. }
  42719. }
  42720. ),
  42721. computeFaceNormals: function() {},
  42722. computeVertexNormals: function() {
  42723. var e = this.index
  42724. , t = this.attributes
  42725. , i = this.groups;
  42726. if (t.position) {
  42727. var n = t.position.array;
  42728. if (void 0 === t.normal)
  42729. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42730. else
  42731. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42732. r[o] = 0;
  42733. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  42734. if (e) {
  42735. var m = e.array;
  42736. 0 === i.length && this.addGroup(0, m.length);
  42737. for (var v = 0, y = i.length; v < y; ++v) {
  42738. var A = i[v]
  42739. , C = A.start;
  42740. for (o = C,
  42741. a = C + A.count; o < a; o += 3)
  42742. s = 3 * m[o + 0],
  42743. l = 3 * m[o + 1],
  42744. c = 3 * m[o + 2],
  42745. u.fromArray(n, s),
  42746. d.fromArray(n, l),
  42747. p.fromArray(n, c),
  42748. f.subVectors(p, d),
  42749. g.subVectors(u, d),
  42750. f.cross(g),
  42751. h[s] += f.x,
  42752. h[1 + s] += f.y,
  42753. h[2 + s] += f.z,
  42754. h[l] += f.x,
  42755. h[1 + l] += f.y,
  42756. h[2 + l] += f.z,
  42757. h[c] += f.x,
  42758. h[1 + c] += f.y,
  42759. h[2 + c] += f.z
  42760. }
  42761. } else
  42762. for (o = 0,
  42763. a = n.length; o < a; o += 9)
  42764. u.fromArray(n, o),
  42765. d.fromArray(n, o + 3),
  42766. p.fromArray(n, o + 6),
  42767. f.subVectors(p, d),
  42768. g.subVectors(u, d),
  42769. f.cross(g),
  42770. h[o] = f.x,
  42771. h[o + 1] = f.y,
  42772. h[o + 2] = f.z,
  42773. h[o + 3] = f.x,
  42774. h[o + 4] = f.y,
  42775. h[o + 5] = f.z,
  42776. h[o + 6] = f.x,
  42777. h[o + 7] = f.y,
  42778. h[o + 8] = f.z;
  42779. this.normalizeNormals(),
  42780. t.normal.needsUpdate = !0
  42781. }
  42782. },
  42783. merge: function(e, t) {
  42784. if (e instanceof Ci.BufferGeometry != 0) {
  42785. void 0 === t && (t = 0);
  42786. var i = this.attributes;
  42787. for (var n in i)
  42788. if (void 0 !== e.attributes[n])
  42789. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42790. l++)
  42791. r[l] = a[s];
  42792. return this
  42793. }
  42794. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42795. },
  42796. normalizeNormals: function() {
  42797. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42798. e = r[o],
  42799. t = r[o + 1],
  42800. i = r[o + 2],
  42801. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42802. r[o] *= n,
  42803. r[o + 1] *= n,
  42804. r[o + 2] *= n
  42805. },
  42806. toNonIndexed: function() {
  42807. if (null === this.index)
  42808. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42809. this;
  42810. var e = new Ci.BufferGeometry
  42811. , t = this.index.array
  42812. , i = this.attributes;
  42813. for (var n in i) {
  42814. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  42815. l = t[h] * a;
  42816. for (var d = 0; d < a; d++)
  42817. s[c++] = o[l++]
  42818. }
  42819. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42820. }
  42821. return e
  42822. },
  42823. toJSON: function() {
  42824. var e = {
  42825. metadata: {
  42826. version: 4.4,
  42827. type: "BufferGeometry",
  42828. generator: "BufferGeometry.toJSON"
  42829. }
  42830. };
  42831. if (e.uuid = this.uuid,
  42832. e.type = this.type,
  42833. "" !== this.name && (e.name = this.name),
  42834. void 0 !== this.parameters) {
  42835. var t = this.parameters;
  42836. for (var i in t)
  42837. void 0 !== t[i] && (e[i] = t[i]);
  42838. return e
  42839. }
  42840. e.data = {
  42841. attributes: {}
  42842. };
  42843. var n = this.index;
  42844. if (null !== n) {
  42845. var r = Array.prototype.slice.call(n.array);
  42846. e.data.index = {
  42847. type: n.array.constructor.name,
  42848. array: r
  42849. }
  42850. }
  42851. var o = this.attributes;
  42852. for (var i in o) {
  42853. var a = o[i];
  42854. r = Array.prototype.slice.call(a.array);
  42855. e.data.attributes[i] = {
  42856. itemSize: a.itemSize,
  42857. type: a.array.constructor.name,
  42858. array: r
  42859. }
  42860. }
  42861. var s = this.groups;
  42862. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42863. var l = this.boundingSphere;
  42864. return null !== l && (e.data.boundingSphere = {
  42865. center: l.center.toArray(),
  42866. radius: l.radius
  42867. }),
  42868. e
  42869. },
  42870. clone: function() {
  42871. return (new Ci.BufferGeometry).copy(this)
  42872. },
  42873. copy: function(e) {
  42874. var t = e.index;
  42875. null !== t && this.setIndex(t.clone());
  42876. var i = e.attributes;
  42877. for (var n in i) {
  42878. var r = i[n];
  42879. this.addAttribute(n, r.clone())
  42880. }
  42881. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42882. var l = o[a];
  42883. this.addGroup(l.start, l.count)
  42884. }
  42885. return this
  42886. },
  42887. dispose: function() {
  42888. this.dispatchEvent({
  42889. type: "dispose"
  42890. })
  42891. }
  42892. },
  42893. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42894. Ci.BufferGeometry.MaxIndex = 65535,
  42895. Ci.InstancedBufferGeometry = function() {
  42896. Ci.BufferGeometry.call(this),
  42897. this.type = "InstancedBufferGeometry",
  42898. this.maxInstancedCount = void 0
  42899. }
  42900. ,
  42901. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42902. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42903. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42904. this.groups.push({
  42905. start: e,
  42906. count: t,
  42907. instances: i
  42908. })
  42909. }
  42910. ,
  42911. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42912. var t = e.index;
  42913. null !== t && this.setIndex(t.clone());
  42914. var i = e.attributes;
  42915. for (var n in i) {
  42916. var r = i[n];
  42917. this.addAttribute(n, r.clone())
  42918. }
  42919. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42920. var l = o[a];
  42921. this.addGroup(l.start, l.count, l.instances)
  42922. }
  42923. return this
  42924. }
  42925. ,
  42926. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42927. Ci.Uniform = function(e, t) {
  42928. this.type = e,
  42929. this.value = t,
  42930. this.dynamic = !1
  42931. }
  42932. ,
  42933. Ci.Uniform.prototype = {
  42934. constructor: Ci.Uniform,
  42935. onUpdate: function(e) {
  42936. return this.dynamic = !0,
  42937. this.onUpdateCallback = e,
  42938. this
  42939. }
  42940. },
  42941. Ci.AnimationClip = function(e, t, i) {
  42942. this.name = e || Ci.Math.generateUUID(),
  42943. this.tracks = i,
  42944. this.duration = void 0 !== t ? t : -1,
  42945. this.duration < 0 && this.resetDuration(),
  42946. this.trim(),
  42947. this.optimize()
  42948. }
  42949. ,
  42950. Ci.AnimationClip.prototype = {
  42951. constructor: Ci.AnimationClip,
  42952. resetDuration: function() {
  42953. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42954. var n = this.tracks[t];
  42955. e = Math.max(e, n.times[n.times.length - 1])
  42956. }
  42957. this.duration = e
  42958. },
  42959. trim: function() {
  42960. for (var e = 0; e < this.tracks.length; e++)
  42961. this.tracks[e].trim(0, this.duration);
  42962. return this
  42963. },
  42964. optimize: function() {
  42965. for (var e = 0; e < this.tracks.length; e++)
  42966. this.tracks[e].optimize();
  42967. return this
  42968. }
  42969. },
  42970. Object.assign(Ci.AnimationClip, {
  42971. parse: function(e) {
  42972. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42973. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42974. return new Ci.AnimationClip(e.name,e.duration,t)
  42975. },
  42976. toJSON: function(e) {
  42977. for (var t = [], i = e.tracks, n = {
  42978. name: e.name,
  42979. duration: e.duration,
  42980. tracks: t
  42981. }, r = 0, o = i.length; r !== o; ++r)
  42982. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42983. return n
  42984. },
  42985. CreateFromMorphTargetSequence: function(e, t, i) {
  42986. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42987. var a = []
  42988. , s = [];
  42989. a.push((o + n - 1) % n, o, (o + 1) % n),
  42990. s.push(0, 1, 0);
  42991. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42992. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42993. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42994. 0 === a[0] && (a.push(n),
  42995. s.push(s[0])),
  42996. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42997. }
  42998. return new Ci.AnimationClip(e,-1,r)
  42999. },
  43000. findByName: function(e, t) {
  43001. for (var i = 0; i < e.length; i++)
  43002. if (e[i].name === t)
  43003. return e[i];
  43004. return null
  43005. },
  43006. CreateClipsFromMorphTargetSequences: function(e, t) {
  43007. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43008. var a = e[r]
  43009. , s = a.name.match(n);
  43010. if (s && 1 < s.length) {
  43011. var l = i[h = s[1]];
  43012. l || (i[h] = l = []),
  43013. l.push(a)
  43014. }
  43015. }
  43016. var c = [];
  43017. for (var h in i)
  43018. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43019. return c
  43020. },
  43021. parseAnimation: function(e, t, i) {
  43022. if (!e)
  43023. return console.error(" no animation in JSONLoader data"),
  43024. null;
  43025. function n(e, t, i, n, r) {
  43026. if (0 !== i.length) {
  43027. var o = []
  43028. , a = [];
  43029. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43030. 0 !== o.length && r.push(new e(t,o,a))
  43031. }
  43032. }
  43033. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43034. var h = l[c].keys;
  43035. if (h && 0 != h.length)
  43036. if (h[0].morphTargets) {
  43037. for (var u = {}, d = 0; d < h.length; d++)
  43038. if (h[d].morphTargets)
  43039. for (var p = 0; p < h[d].morphTargets.length; p++)
  43040. u[h[d].morphTargets[p]] = -1;
  43041. for (var f in u) {
  43042. var g = []
  43043. , m = [];
  43044. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43045. var v = h[d];
  43046. g.push(v.time),
  43047. m.push(v.morphTarget === f ? 1 : 0)
  43048. }
  43049. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43050. }
  43051. a = u.length * (s || 1)
  43052. } else {
  43053. var y = ".bones[" + t[c].name + "]";
  43054. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43055. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43056. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43057. }
  43058. }
  43059. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43060. }
  43061. }),
  43062. Ci.AnimationMixer = function(e) {
  43063. this._root = e,
  43064. this._initMemoryManager(),
  43065. this._accuIndex = 0,
  43066. this.time = 0,
  43067. this.timeScale = 1
  43068. }
  43069. ,
  43070. Ci.AnimationMixer.prototype = {
  43071. constructor: Ci.AnimationMixer,
  43072. clipAction: function(e, t) {
  43073. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43074. if (void 0 !== a) {
  43075. var s = a.actionByRoot[n];
  43076. if (void 0 !== s)
  43077. return s;
  43078. if (o = (i = a.knownActions[0])._clip,
  43079. e !== r && e !== o)
  43080. throw new Error("Different clips with the same name detected!")
  43081. }
  43082. if (null === o)
  43083. return null;
  43084. var l = new Ci.AnimationMixer._Action(this,o,t);
  43085. return this._bindAction(l, i),
  43086. this._addInactiveAction(l, r, n),
  43087. l
  43088. },
  43089. existingAction: function(e, t) {
  43090. var i = (t || this._root).uuid
  43091. , n = "string" == typeof e ? e : e.name
  43092. , r = this._actionsByClip[n];
  43093. return void 0 !== r && r.actionByRoot[i] || null
  43094. },
  43095. stopAllAction: function() {
  43096. var e = this._actions
  43097. , t = this._nActiveActions
  43098. , i = this._bindings
  43099. , n = this._nActiveBindings;
  43100. this._nActiveActions = 0;
  43101. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43102. e[r].reset();
  43103. for (r = 0; r !== n; ++r)
  43104. i[r].useCount = 0;
  43105. return this
  43106. },
  43107. update: function(e) {
  43108. e *= this.timeScale;
  43109. 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) {
  43110. var s = t[a];
  43111. s.enabled && s._update(n, e, r, o)
  43112. }
  43113. var l = this._bindings
  43114. , c = this._nActiveBindings;
  43115. for (a = 0; a !== c; ++a)
  43116. l[a].apply(o);
  43117. return this
  43118. },
  43119. getRoot: function() {
  43120. return this._root
  43121. },
  43122. uncacheClip: function(e) {
  43123. var t = this._actions
  43124. , i = e.name
  43125. , n = this._actionsByClip
  43126. , r = n[i];
  43127. if (void 0 !== r) {
  43128. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43129. var l = o[a];
  43130. this._deactivateAction(l);
  43131. var c = l._cacheIndex
  43132. , h = t[t.length - 1];
  43133. l._cacheIndex = null,
  43134. l._byClipCacheIndex = null,
  43135. t[h._cacheIndex = c] = h,
  43136. t.pop(),
  43137. this._removeInactiveBindingsForAction(l)
  43138. }
  43139. delete n[i]
  43140. }
  43141. },
  43142. uncacheRoot: function(e) {
  43143. var t = e.uuid
  43144. , i = this._actionsByClip;
  43145. for (var n in i) {
  43146. var r = i[n].actionByRoot[t];
  43147. void 0 !== r && (this._deactivateAction(r),
  43148. this._removeInactiveAction(r))
  43149. }
  43150. var o = this._bindingsByRootAndName[t];
  43151. if (void 0 !== o)
  43152. for (var a in o) {
  43153. var s = o[a];
  43154. s.restoreOriginalState(),
  43155. this._removeInactiveBinding(s)
  43156. }
  43157. },
  43158. uncacheAction: function(e, t) {
  43159. var i = this.existingAction(e, t);
  43160. null !== i && (this._deactivateAction(i),
  43161. this._removeInactiveAction(i))
  43162. }
  43163. },
  43164. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43165. Ci.AnimationMixer._Action = function(e, t, i) {
  43166. this._mixer = e,
  43167. this._clip = t,
  43168. this._localRoot = i || null;
  43169. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43170. endingStart: Ci.ZeroCurvatureEnding,
  43171. endingEnd: Ci.ZeroCurvatureEnding
  43172. }, s = 0; s !== r; ++s) {
  43173. var l = n[s].createInterpolant(null);
  43174. (o[s] = l).settings = a
  43175. }
  43176. this._interpolantSettings = a,
  43177. this._interpolants = o,
  43178. this._propertyBindings = new Array(r),
  43179. this._cacheIndex = null,
  43180. this._byClipCacheIndex = null,
  43181. this._timeScaleInterpolant = null,
  43182. this._weightInterpolant = null,
  43183. this.loop = Ci.LoopRepeat,
  43184. this._loopCount = -1,
  43185. this._startTime = null,
  43186. this.time = 0,
  43187. this.timeScale = 1,
  43188. this._effectiveTimeScale = 1,
  43189. this.weight = 1,
  43190. this._effectiveWeight = 1,
  43191. this.repetitions = 1 / 0,
  43192. this.paused = !1,
  43193. this.enabled = !0,
  43194. this.clampWhenFinished = !1,
  43195. this.zeroSlopeAtStart = !0,
  43196. this.zeroSlopeAtEnd = !0
  43197. }
  43198. ,
  43199. Ci.AnimationMixer._Action.prototype = {
  43200. constructor: Ci.AnimationMixer._Action,
  43201. play: function() {
  43202. return this._mixer._activateAction(this),
  43203. this
  43204. },
  43205. stop: function() {
  43206. return this._mixer._deactivateAction(this),
  43207. this.reset()
  43208. },
  43209. reset: function() {
  43210. return this.paused = !1,
  43211. this.enabled = !0,
  43212. this.time = 0,
  43213. this._loopCount = -1,
  43214. this._startTime = null,
  43215. this.stopFading().stopWarping()
  43216. },
  43217. isRunning: function() {
  43218. return this._startTime,
  43219. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43220. },
  43221. isScheduled: function() {
  43222. return this._mixer._isActiveAction(this)
  43223. },
  43224. startAt: function(e) {
  43225. return this._startTime = e,
  43226. this
  43227. },
  43228. setLoop: function(e, t) {
  43229. return this.loop = e,
  43230. this.repetitions = t,
  43231. this
  43232. },
  43233. setEffectiveWeight: function(e) {
  43234. return this.weight = e,
  43235. this._effectiveWeight = this.enabled ? e : 0,
  43236. this.stopFading()
  43237. },
  43238. getEffectiveWeight: function() {
  43239. return this._effectiveWeight
  43240. },
  43241. fadeIn: function(e) {
  43242. return this._scheduleFading(e, 0, 1)
  43243. },
  43244. fadeOut: function(e) {
  43245. return this._scheduleFading(e, 1, 0)
  43246. },
  43247. crossFadeFrom: function(e, t, i) {
  43248. if (this._mixer,
  43249. e.fadeOut(t),
  43250. this.fadeIn(t),
  43251. i) {
  43252. var n = this._clip.duration
  43253. , r = e._clip.duration
  43254. , o = r / n
  43255. , a = n / r;
  43256. e.warp(1, o, t),
  43257. this.warp(a, 1, t)
  43258. }
  43259. return this
  43260. },
  43261. crossFadeTo: function(e, t, i) {
  43262. return e.crossFadeFrom(this, t, i)
  43263. },
  43264. stopFading: function() {
  43265. var e = this._weightInterpolant;
  43266. return null !== e && (this._weightInterpolant = null,
  43267. this._mixer._takeBackControlInterpolant(e)),
  43268. this
  43269. },
  43270. setEffectiveTimeScale: function(e) {
  43271. return this.timeScale = e,
  43272. this._effectiveTimeScale = this.paused ? 0 : e,
  43273. this.stopWarping()
  43274. },
  43275. getEffectiveTimeScale: function() {
  43276. return this._effectiveTimeScale
  43277. },
  43278. setDuration: function(e) {
  43279. return this.timeScale = this._clip.duration / e,
  43280. this.stopWarping()
  43281. },
  43282. syncWith: function(e) {
  43283. return this.time = e.time,
  43284. this.timeScale = e.timeScale,
  43285. this.stopWarping()
  43286. },
  43287. halt: function(e) {
  43288. return this.warp(this._currentTimeScale, 0, e)
  43289. },
  43290. warp: function(e, t, i) {
  43291. var n = this._mixer
  43292. , r = n.time
  43293. , o = this._timeScaleInterpolant
  43294. , a = this.timeScale;
  43295. null === o && (o = n._lendControlInterpolant(),
  43296. this._timeScaleInterpolant = o);
  43297. var s = o.parameterPositions
  43298. , l = o.sampleValues;
  43299. return s[0] = r,
  43300. s[1] = r + i,
  43301. l[0] = e / a,
  43302. l[1] = t / a,
  43303. this
  43304. },
  43305. stopWarping: function() {
  43306. var e = this._timeScaleInterpolant;
  43307. return null !== e && (this._timeScaleInterpolant = null,
  43308. this._mixer._takeBackControlInterpolant(e)),
  43309. this
  43310. },
  43311. getMixer: function() {
  43312. return this._mixer
  43313. },
  43314. getClip: function() {
  43315. return this._clip
  43316. },
  43317. getRoot: function() {
  43318. return this._localRoot || this._mixer._root
  43319. },
  43320. _update: function(e, t, i, n) {
  43321. var r = this._startTime;
  43322. if (null !== r) {
  43323. var o = (e - r) * i;
  43324. if (o < 0 || 0 === i)
  43325. return;
  43326. this._startTime = null,
  43327. t = i * o
  43328. }
  43329. t *= this._updateTimeScale(e);
  43330. var a = this._updateTime(t)
  43331. , s = this._updateWeight(e);
  43332. if (0 < s)
  43333. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43334. l[h].evaluate(a),
  43335. c[h].accumulate(n, s)
  43336. },
  43337. _updateWeight: function(e) {
  43338. var t = 0;
  43339. if (this.enabled) {
  43340. t = this.weight;
  43341. var i = this._weightInterpolant;
  43342. if (null !== i) {
  43343. var n = i.evaluate(e)[0];
  43344. t *= n,
  43345. e > i.parameterPositions[1] && (this.stopFading(),
  43346. 0 === n && (this.enabled = !1))
  43347. }
  43348. }
  43349. return this._effectiveWeight = t
  43350. },
  43351. _updateTimeScale: function(e) {
  43352. var t = 0;
  43353. if (!this.paused) {
  43354. t = this.timeScale;
  43355. var i = this._timeScaleInterpolant;
  43356. if (null !== i)
  43357. t *= i.evaluate(e)[0],
  43358. e > i.parameterPositions[1] && (this.stopWarping(),
  43359. 0 === t ? this.pause = !0 : this.timeScale = t)
  43360. }
  43361. return this._effectiveTimeScale = t
  43362. },
  43363. _updateTime: function(e) {
  43364. var t = this.time + e;
  43365. if (0 === e)
  43366. return t;
  43367. var i = this._clip.duration
  43368. , n = this.loop
  43369. , r = this._loopCount
  43370. , o = !1;
  43371. switch (n) {
  43372. case Ci.LoopOnce:
  43373. if (-1 === r && (this.loopCount = 0,
  43374. this._setEndings(!0, !0, !1)),
  43375. i <= t)
  43376. t = i;
  43377. else {
  43378. if (!(t < 0))
  43379. break;
  43380. t = 0
  43381. }
  43382. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43383. this._mixer.dispatchEvent({
  43384. type: "finished",
  43385. action: this,
  43386. direction: e < 0 ? -1 : 1
  43387. });
  43388. break;
  43389. case Ci.LoopPingPong:
  43390. o = !0;
  43391. case Ci.LoopRepeat:
  43392. if (-1 === r && (0 < e ? (r = 0,
  43393. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43394. i <= t || t < 0) {
  43395. var a = Math.floor(t / i);
  43396. t -= i * a,
  43397. r += Math.abs(a);
  43398. var s = this.repetitions - r;
  43399. if (s < 0) {
  43400. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43401. t = 0 < e ? i : 0,
  43402. this._mixer.dispatchEvent({
  43403. type: "finished",
  43404. action: this,
  43405. direction: 0 < e ? 1 : -1
  43406. });
  43407. break
  43408. }
  43409. if (0 == s) {
  43410. var l = e < 0;
  43411. this._setEndings(l, !l, o)
  43412. } else
  43413. this._setEndings(!1, !1, o);
  43414. this._loopCount = r,
  43415. this._mixer.dispatchEvent({
  43416. type: "loop",
  43417. action: this,
  43418. loopDelta: a
  43419. })
  43420. }
  43421. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43422. return i - (this.time = t)
  43423. }
  43424. return this.time = t
  43425. },
  43426. _setEndings: function(e, t, i) {
  43427. var n = this._interpolantSettings;
  43428. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43429. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43430. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43431. },
  43432. _scheduleFading: function(e, t, i) {
  43433. var n = this._mixer
  43434. , r = n.time
  43435. , o = this._weightInterpolant;
  43436. null === o && (o = n._lendControlInterpolant(),
  43437. this._weightInterpolant = o);
  43438. var a = o.parameterPositions
  43439. , s = o.sampleValues;
  43440. return a[0] = r,
  43441. s[0] = t,
  43442. a[1] = r + e,
  43443. s[1] = i,
  43444. this
  43445. }
  43446. },
  43447. Object.assign(Ci.AnimationMixer.prototype, {
  43448. _bindAction: function(e, t) {
  43449. var i = e._localRoot || this._root
  43450. , n = e._clip.tracks
  43451. , r = n.length
  43452. , o = e._propertyBindings
  43453. , a = e._interpolants
  43454. , s = i.uuid
  43455. , l = this._bindingsByRootAndName
  43456. , c = l[s];
  43457. void 0 === c && (c = {},
  43458. l[s] = c);
  43459. for (var h = 0; h !== r; ++h) {
  43460. var u = n[h]
  43461. , d = u.name
  43462. , p = c[d];
  43463. if (void 0 !== p)
  43464. o[h] = p;
  43465. else {
  43466. if (void 0 !== (p = o[h])) {
  43467. null === p._cacheIndex && (++p.referenceCount,
  43468. this._addInactiveBinding(p, s, d));
  43469. continue
  43470. }
  43471. var f = t && t._propertyBindings[h].binding.parsedPath;
  43472. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43473. this._addInactiveBinding(p, s, d),
  43474. o[h] = p
  43475. }
  43476. a[h].resultBuffer = p.buffer
  43477. }
  43478. },
  43479. _activateAction: function(e) {
  43480. if (!this._isActiveAction(e)) {
  43481. if (null === e._cacheIndex) {
  43482. var t = (e._localRoot || this._root).uuid
  43483. , i = e._clip.name
  43484. , n = this._actionsByClip[i];
  43485. this._bindAction(e, n && n.knownActions[0]),
  43486. this._addInactiveAction(e, i, t)
  43487. }
  43488. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43489. var s = r[o];
  43490. 0 == s.useCount++ && (this._lendBinding(s),
  43491. s.saveOriginalState())
  43492. }
  43493. this._lendAction(e)
  43494. }
  43495. },
  43496. _deactivateAction: function(e) {
  43497. if (this._isActiveAction(e)) {
  43498. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43499. var r = t[i];
  43500. 0 == --r.useCount && (r.restoreOriginalState(),
  43501. this._takeBackBinding(r))
  43502. }
  43503. this._takeBackAction(e)
  43504. }
  43505. },
  43506. _initMemoryManager: function() {
  43507. this._actions = [],
  43508. this._nActiveActions = 0,
  43509. this._actionsByClip = {},
  43510. this._bindings = [],
  43511. this._nActiveBindings = 0,
  43512. this._bindingsByRootAndName = {},
  43513. this._controlInterpolants = [],
  43514. this._nActiveControlInterpolants = 0;
  43515. var e = this;
  43516. this.stats = {
  43517. actions: {
  43518. get total() {
  43519. return e._actions.length
  43520. },
  43521. get inUse() {
  43522. return e._nActiveActions
  43523. }
  43524. },
  43525. bindings: {
  43526. get total() {
  43527. return e._bindings.length
  43528. },
  43529. get inUse() {
  43530. return e._nActiveBindings
  43531. }
  43532. },
  43533. controlInterpolants: {
  43534. get total() {
  43535. return e._controlInterpolants.length
  43536. },
  43537. get inUse() {
  43538. return e._nActiveControlInterpolants
  43539. }
  43540. }
  43541. }
  43542. },
  43543. _isActiveAction: function(e) {
  43544. var t = e._cacheIndex;
  43545. return null !== t && t < this._nActiveActions
  43546. },
  43547. _addInactiveAction: function(e, t, i) {
  43548. var n = this._actions
  43549. , r = this._actionsByClip
  43550. , o = r[t];
  43551. if (void 0 === o)
  43552. o = {
  43553. knownActions: [e],
  43554. actionByRoot: {}
  43555. },
  43556. e._byClipCacheIndex = 0,
  43557. r[t] = o;
  43558. else {
  43559. var a = o.knownActions;
  43560. e._byClipCacheIndex = a.length,
  43561. a.push(e)
  43562. }
  43563. e._cacheIndex = n.length,
  43564. n.push(e),
  43565. o.actionByRoot[i] = e
  43566. },
  43567. _removeInactiveAction: function(e) {
  43568. var t = this._actions
  43569. , i = t[t.length - 1]
  43570. , n = e._cacheIndex;
  43571. t[i._cacheIndex = n] = i,
  43572. t.pop(),
  43573. e._cacheIndex = null;
  43574. var r = e._clip.name
  43575. , o = this._actionsByClip
  43576. , a = o[r]
  43577. , s = a.knownActions
  43578. , l = s[s.length - 1]
  43579. , c = e._byClipCacheIndex;
  43580. s[l._byClipCacheIndex = c] = l,
  43581. s.pop(),
  43582. e._byClipCacheIndex = null,
  43583. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43584. 0 === s.length && delete o[r],
  43585. this._removeInactiveBindingsForAction(e)
  43586. },
  43587. _removeInactiveBindingsForAction: function(e) {
  43588. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43589. var r = t[i];
  43590. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43591. }
  43592. },
  43593. _lendAction: function(e) {
  43594. var t = this._actions
  43595. , i = e._cacheIndex
  43596. , n = this._nActiveActions++
  43597. , r = t[n];
  43598. t[e._cacheIndex = n] = e,
  43599. t[r._cacheIndex = i] = r
  43600. },
  43601. _takeBackAction: function(e) {
  43602. var t = this._actions
  43603. , i = e._cacheIndex
  43604. , n = --this._nActiveActions
  43605. , r = t[n];
  43606. t[e._cacheIndex = n] = e,
  43607. t[r._cacheIndex = i] = r
  43608. },
  43609. _addInactiveBinding: function(e, t, i) {
  43610. var n = this._bindingsByRootAndName
  43611. , r = n[t]
  43612. , o = this._bindings;
  43613. void 0 === r && (r = {},
  43614. n[t] = r),
  43615. (r[i] = e)._cacheIndex = o.length,
  43616. o.push(e)
  43617. },
  43618. _removeInactiveBinding: function(e) {
  43619. var t = this._bindings
  43620. , i = e.binding
  43621. , n = i.rootNode.uuid
  43622. , r = i.path
  43623. , o = this._bindingsByRootAndName
  43624. , a = o[n]
  43625. , s = t[t.length - 1]
  43626. , l = e._cacheIndex;
  43627. t[s._cacheIndex = l] = s,
  43628. t.pop(),
  43629. delete a[r];
  43630. e: {
  43631. for (var c in a)
  43632. break e;
  43633. delete o[n]
  43634. }
  43635. },
  43636. _lendBinding: function(e) {
  43637. var t = this._bindings
  43638. , i = e._cacheIndex
  43639. , n = this._nActiveBindings++
  43640. , r = t[n];
  43641. t[e._cacheIndex = n] = e,
  43642. t[r._cacheIndex = i] = r
  43643. },
  43644. _takeBackBinding: function(e) {
  43645. var t = this._bindings
  43646. , i = e._cacheIndex
  43647. , n = --this._nActiveBindings
  43648. , r = t[n];
  43649. t[e._cacheIndex = n] = e,
  43650. t[r._cacheIndex = i] = r
  43651. },
  43652. _lendControlInterpolant: function() {
  43653. var e = this._controlInterpolants
  43654. , t = this._nActiveControlInterpolants++
  43655. , i = e[t];
  43656. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43657. i
  43658. },
  43659. _takeBackControlInterpolant: function(e) {
  43660. var t = this._controlInterpolants
  43661. , i = e.__cacheIndex
  43662. , n = --this._nActiveControlInterpolants
  43663. , r = t[n];
  43664. t[e.__cacheIndex = n] = e,
  43665. t[r.__cacheIndex = i] = r
  43666. },
  43667. _controlInterpolantsResultBuffer: new Float32Array(1)
  43668. }),
  43669. Ci.AnimationObjectGroup = function(e) {
  43670. this.uuid = Ci.Math.generateUUID(),
  43671. this._objects = Array.prototype.slice.call(arguments),
  43672. this.nCachedObjects_ = 0;
  43673. var t = {};
  43674. this._indicesByUUID = t;
  43675. for (var i = 0, n = arguments.length; i !== n; ++i)
  43676. t[arguments[i].uuid] = i;
  43677. this._paths = [],
  43678. this._parsedPaths = [],
  43679. this._bindings = [],
  43680. this._bindingsIndicesByPath = {};
  43681. var r = this;
  43682. this.stats = {
  43683. objects: {
  43684. get total() {
  43685. return r._objects.length
  43686. },
  43687. get inUse() {
  43688. return this.total - r.nCachedObjects_
  43689. }
  43690. },
  43691. get bindingsPerObject() {
  43692. return r._bindings.length
  43693. }
  43694. }
  43695. }
  43696. ,
  43697. Ci.AnimationObjectGroup.prototype = {
  43698. constructor: Ci.AnimationObjectGroup,
  43699. add: function(e) {
  43700. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  43701. var u = arguments[c]
  43702. , d = u.uuid
  43703. , p = r[d];
  43704. if (void 0 === p) {
  43705. p = i++,
  43706. r[d] = p,
  43707. t.push(u);
  43708. for (var f = 0, g = l; f !== g; ++f)
  43709. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43710. } else if (p < n) {
  43711. var m = t[p]
  43712. , v = --n
  43713. , y = t[v];
  43714. t[r[y.uuid] = p] = y,
  43715. t[r[d] = v] = u;
  43716. for (f = 0,
  43717. g = l; f !== g; ++f) {
  43718. var A = s[f]
  43719. , C = A[v]
  43720. , I = A[p];
  43721. A[p] = C,
  43722. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43723. A[v] = I
  43724. }
  43725. } else
  43726. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43727. }
  43728. this.nCachedObjects_ = n
  43729. },
  43730. remove: function(e) {
  43731. for (var t = this._objects, i = (t.length,
  43732. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43733. var l = arguments[a]
  43734. , c = l.uuid
  43735. , h = n[c];
  43736. if (void 0 !== h && i <= h) {
  43737. var u = i++
  43738. , d = t[u];
  43739. t[n[d.uuid] = h] = d,
  43740. t[n[c] = u] = l;
  43741. for (var p = 0, f = o; p !== f; ++p) {
  43742. var g = r[p]
  43743. , m = g[u]
  43744. , v = g[h];
  43745. g[h] = m,
  43746. g[u] = v
  43747. }
  43748. }
  43749. }
  43750. this.nCachedObjects_ = i
  43751. },
  43752. uncache: function(e) {
  43753. 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) {
  43754. var c = arguments[s].uuid
  43755. , h = r[c];
  43756. if (void 0 !== h)
  43757. if (delete r[c],
  43758. h < n) {
  43759. var u = --n
  43760. , d = t[u]
  43761. , p = t[y = --i];
  43762. t[r[d.uuid] = h] = d,
  43763. t[r[p.uuid] = u] = p,
  43764. t.pop();
  43765. for (var f = 0, g = a; f !== g; ++f) {
  43766. var m = (A = o[f])[u]
  43767. , v = A[y];
  43768. A[h] = m,
  43769. A[u] = v,
  43770. A.pop()
  43771. }
  43772. } else {
  43773. var y;
  43774. t[r[(p = t[y = --i]).uuid] = h] = p,
  43775. t.pop();
  43776. for (f = 0,
  43777. g = a; f !== g; ++f) {
  43778. var A;
  43779. (A = o[f])[h] = A[y],
  43780. A.pop()
  43781. }
  43782. }
  43783. }
  43784. this.nCachedObjects_ = n
  43785. },
  43786. subscribe_: function(e, t) {
  43787. var i = this._bindingsIndicesByPath
  43788. , n = i[e]
  43789. , r = this._bindings;
  43790. if (void 0 !== n)
  43791. return r[n];
  43792. var o = this._paths
  43793. , a = this._parsedPaths
  43794. , s = this._objects
  43795. , l = s.length
  43796. , c = this.nCachedObjects_
  43797. , h = new Array(l);
  43798. n = r.length,
  43799. i[e] = n,
  43800. o.push(e),
  43801. a.push(t),
  43802. r.push(h);
  43803. for (var u = c, d = s.length; u !== d; ++u) {
  43804. var p = s[u];
  43805. h[u] = new Ci.PropertyBinding(p,e,t)
  43806. }
  43807. return h
  43808. },
  43809. unsubscribe_: function(e) {
  43810. var t = this._bindingsIndicesByPath
  43811. , i = t[e];
  43812. if (void 0 !== i) {
  43813. var n = this._paths
  43814. , r = this._parsedPaths
  43815. , o = this._bindings
  43816. , a = o.length - 1
  43817. , s = o[a];
  43818. o[t[e[a]] = i] = s,
  43819. o.pop(),
  43820. r[i] = r[a],
  43821. r.pop(),
  43822. n[i] = n[a],
  43823. n.pop()
  43824. }
  43825. }
  43826. },
  43827. Ci.AnimationUtils = {
  43828. arraySlice: function(e, t, i) {
  43829. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43830. },
  43831. convertArray: function(e, t, i) {
  43832. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43833. },
  43834. isTypedArray: function(e) {
  43835. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43836. },
  43837. getKeyframeOrder: function(i) {
  43838. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43839. t[n] = n;
  43840. return t.sort(function(e, t) {
  43841. return i[e] - i[t]
  43842. }),
  43843. t
  43844. },
  43845. sortedArray: function(e, t, i) {
  43846. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43847. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43848. r[a++] = e[s + l];
  43849. return r
  43850. },
  43851. flattenJSON: function(e, t, i, n) {
  43852. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43853. o = e[r++];
  43854. if (void 0 !== o) {
  43855. var a = o[n];
  43856. if (void 0 !== a)
  43857. if (Array.isArray(a))
  43858. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43859. i.push.apply(i, a)),
  43860. void 0 !== (o = e[r++]); )
  43861. ;
  43862. else if (void 0 !== a.toArray)
  43863. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43864. a.toArray(i, i.length)),
  43865. void 0 !== (o = e[r++]); )
  43866. ;
  43867. else
  43868. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43869. i.push(a)),
  43870. void 0 !== (o = e[r++]); )
  43871. ;
  43872. }
  43873. }
  43874. },
  43875. Ci.KeyframeTrack = function(e, t, i, n) {
  43876. if (void 0 === e)
  43877. throw new Error("track name is undefined");
  43878. if (void 0 === t || 0 === t.length)
  43879. throw new Error("no keyframes in track named " + e);
  43880. this.name = e,
  43881. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43882. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43883. this.setInterpolation(n || this.DefaultInterpolation),
  43884. this.validate(),
  43885. this.optimize()
  43886. }
  43887. ,
  43888. Ci.KeyframeTrack.prototype = {
  43889. constructor: Ci.KeyframeTrack,
  43890. TimeBufferType: Float32Array,
  43891. ValueBufferType: Float32Array,
  43892. DefaultInterpolation: Ci.InterpolateLinear,
  43893. InterpolantFactoryMethodDiscrete: function(e) {
  43894. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43895. },
  43896. InterpolantFactoryMethodLinear: function(e) {
  43897. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43898. },
  43899. InterpolantFactoryMethodSmooth: function(e) {
  43900. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43901. },
  43902. setInterpolation: function(e) {
  43903. var t = void 0;
  43904. switch (e) {
  43905. case Ci.InterpolateDiscrete:
  43906. t = this.InterpolantFactoryMethodDiscrete;
  43907. break;
  43908. case Ci.InterpolateLinear:
  43909. t = this.InterpolantFactoryMethodLinear;
  43910. break;
  43911. case Ci.InterpolateSmooth:
  43912. t = this.InterpolantFactoryMethodSmooth
  43913. }
  43914. if (void 0 !== t)
  43915. this.createInterpolant = t;
  43916. else {
  43917. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43918. if (void 0 === this.createInterpolant) {
  43919. if (e === this.DefaultInterpolation)
  43920. throw new Error(i);
  43921. this.setInterpolation(this.DefaultInterpolation)
  43922. }
  43923. console.warn(i)
  43924. }
  43925. },
  43926. getInterpolation: function() {
  43927. switch (this.createInterpolant) {
  43928. case this.InterpolantFactoryMethodDiscrete:
  43929. return Ci.InterpolateDiscrete;
  43930. case this.InterpolantFactoryMethodLinear:
  43931. return Ci.InterpolateLinear;
  43932. case this.InterpolantFactoryMethodSmooth:
  43933. return Ci.InterpolateSmooth
  43934. }
  43935. },
  43936. getValueSize: function() {
  43937. return this.values.length / this.times.length
  43938. },
  43939. shift: function(e) {
  43940. if (0 !== e)
  43941. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43942. t[i] += e;
  43943. return this
  43944. },
  43945. scale: function(e) {
  43946. if (1 !== e)
  43947. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43948. t[i] *= e;
  43949. return this
  43950. },
  43951. trim: function(e, t) {
  43952. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43953. ++r;
  43954. for (; -1 !== o && i[o] > t; )
  43955. --o;
  43956. if (++o,
  43957. 0 !== r || o !== n) {
  43958. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43959. var a = this.getValueSize();
  43960. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43961. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43962. }
  43963. return this
  43964. },
  43965. validate: function() {
  43966. var e = !0
  43967. , t = this.getValueSize();
  43968. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43969. e = !1);
  43970. var i = this.times
  43971. , n = this.values
  43972. , r = i.length;
  43973. 0 === r && (console.error("track is empty", this),
  43974. e = !1);
  43975. for (var o = null, a = 0; a !== r; a++) {
  43976. var s = i[a];
  43977. if ("number" == typeof s && isNaN(s)) {
  43978. console.error("time is not a valid number", this, a, s),
  43979. e = !1;
  43980. break
  43981. }
  43982. if (null !== o && s < o) {
  43983. console.error("out of order keys", this, a, s, o),
  43984. e = !1;
  43985. break
  43986. }
  43987. o = s
  43988. }
  43989. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43990. a = 0;
  43991. for (var l = n.length; a !== l; ++a) {
  43992. var c = n[a];
  43993. if (isNaN(c)) {
  43994. console.error("value is not a valid number", this, a, c),
  43995. e = !1;
  43996. break
  43997. }
  43998. }
  43999. }
  44000. return e
  44001. },
  44002. optimize: function() {
  44003. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44004. var a = !1
  44005. , s = e[r];
  44006. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44007. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44008. var d = t[l + u];
  44009. if (d !== t[c + u] || d !== t[h + u]) {
  44010. a = !0;
  44011. break
  44012. }
  44013. }
  44014. if (a) {
  44015. if (r !== n) {
  44016. e[n] = e[r];
  44017. var p = r * i
  44018. , f = n * i;
  44019. for (u = 0; u !== i; ++u)
  44020. t[f + u] = t[p + u]
  44021. }
  44022. ++n
  44023. }
  44024. }
  44025. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44026. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44027. this
  44028. }
  44029. },
  44030. Object.assign(Ci.KeyframeTrack, {
  44031. parse: function(e) {
  44032. if (void 0 === e.type)
  44033. throw new Error("track type undefined, can not parse");
  44034. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44035. if (void 0 === e.times) {
  44036. console.warn("legacy JSON format detected, converting");
  44037. var i = []
  44038. , n = [];
  44039. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44040. e.times = i,
  44041. e.values = n
  44042. }
  44043. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44044. },
  44045. toJSON: function(e) {
  44046. var t, i = e.constructor;
  44047. if (void 0 !== i.toJSON)
  44048. t = i.toJSON(e);
  44049. else {
  44050. t = {
  44051. name: e.name,
  44052. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44053. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44054. };
  44055. var n = e.getInterpolation();
  44056. n !== e.DefaultInterpolation && (t.interpolation = n)
  44057. }
  44058. return t.type = e.ValueTypeName,
  44059. t
  44060. },
  44061. _getTrackTypeForValueTypeName: function(e) {
  44062. switch (e.toLowerCase()) {
  44063. case "scalar":
  44064. case "double":
  44065. case "float":
  44066. case "number":
  44067. case "integer":
  44068. return Ci.NumberKeyframeTrack;
  44069. case "vector":
  44070. case "vector2":
  44071. case "vector3":
  44072. case "vector4":
  44073. return Ci.VectorKeyframeTrack;
  44074. case "color":
  44075. return Ci.ColorKeyframeTrack;
  44076. case "quaternion":
  44077. return Ci.QuaternionKeyframeTrack;
  44078. case "bool":
  44079. case "boolean":
  44080. return Ci.BooleanKeyframeTrack;
  44081. case "string":
  44082. return Ci.StringKeyframeTrack
  44083. }
  44084. throw new Error("Unsupported typeName: " + e)
  44085. }
  44086. }),
  44087. Ci.PropertyBinding = function(e, t, i) {
  44088. this.path = t,
  44089. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44090. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44091. this.rootNode = e
  44092. }
  44093. ,
  44094. Ci.PropertyBinding.prototype = {
  44095. constructor: Ci.PropertyBinding,
  44096. getValue: function(e, t) {
  44097. this.bind(),
  44098. this.getValue(e, t)
  44099. },
  44100. setValue: function(e, t) {
  44101. this.bind(),
  44102. this.setValue(e, t)
  44103. },
  44104. bind: function() {
  44105. var e = this.node
  44106. , t = this.parsedPath
  44107. , i = t.objectName
  44108. , n = t.propertyName
  44109. , r = t.propertyIndex;
  44110. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44111. this.node = e),
  44112. this.getValue = this._getValue_unavailable,
  44113. this.setValue = this._setValue_unavailable,
  44114. e) {
  44115. if (i) {
  44116. var o = t.objectIndex;
  44117. switch (i) {
  44118. case "materials":
  44119. if (!e.material)
  44120. return void console.error(" can not bind to material as node does not have a material", this);
  44121. if (!e.material.materials)
  44122. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44123. e = e.material.materials;
  44124. break;
  44125. case "bones":
  44126. if (!e.skeleton)
  44127. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44128. e = e.skeleton.bones;
  44129. for (var a = 0; a < e.length; a++)
  44130. if (e[a].name === o) {
  44131. o = a;
  44132. break
  44133. }
  44134. break;
  44135. default:
  44136. if (void 0 === e[i])
  44137. return void console.error(" can not bind to objectName of node, undefined", this);
  44138. e = e[i]
  44139. }
  44140. if (void 0 !== o) {
  44141. if (void 0 === e[o])
  44142. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44143. e = e[o]
  44144. }
  44145. }
  44146. var s = e[n];
  44147. if (s) {
  44148. var l = this.Versioning.None;
  44149. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44150. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44151. this.targetObject = e);
  44152. var c = this.BindingType.Direct;
  44153. if (void 0 !== r) {
  44154. if ("morphTargetInfluences" === n) {
  44155. if (!e.geometry)
  44156. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44157. if (!e.geometry.morphTargets)
  44158. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44159. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44160. if (e.geometry.morphTargets[a].name === r) {
  44161. r = a;
  44162. break
  44163. }
  44164. }
  44165. c = this.BindingType.ArrayElement,
  44166. this.resolvedProperty = s,
  44167. this.propertyIndex = r
  44168. } else
  44169. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44170. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44171. this.resolvedProperty = s) : this.propertyName = n;
  44172. this.getValue = this.GetterByBindingType[c],
  44173. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44174. } else {
  44175. var h = t.nodeName;
  44176. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44177. }
  44178. } else
  44179. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44180. },
  44181. unbind: function() {
  44182. this.node = null,
  44183. this.getValue = this._getValue_unbound,
  44184. this.setValue = this._setValue_unbound
  44185. }
  44186. },
  44187. Object.assign(Ci.PropertyBinding.prototype, {
  44188. _getValue_unavailable: function() {},
  44189. _setValue_unavailable: function() {},
  44190. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44191. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44192. BindingType: {
  44193. Direct: 0,
  44194. EntireArray: 1,
  44195. ArrayElement: 2,
  44196. HasFromToArray: 3
  44197. },
  44198. Versioning: {
  44199. None: 0,
  44200. NeedsUpdate: 1,
  44201. MatrixWorldNeedsUpdate: 2
  44202. },
  44203. GetterByBindingType: [function(e, t) {
  44204. e[t] = this.node[this.propertyName]
  44205. }
  44206. , function(e, t) {
  44207. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44208. e[t++] = i[n]
  44209. }
  44210. , function(e, t) {
  44211. e[t] = this.resolvedProperty[this.propertyIndex]
  44212. }
  44213. , function(e, t) {
  44214. this.resolvedProperty.toArray(e, t)
  44215. }
  44216. ],
  44217. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44218. this.node[this.propertyName] = e[t]
  44219. }
  44220. , function(e, t) {
  44221. this.node[this.propertyName] = e[t],
  44222. this.targetObject.needsUpdate = !0
  44223. }
  44224. , function(e, t) {
  44225. this.node[this.propertyName] = e[t],
  44226. this.targetObject.matrixWorldNeedsUpdate = !0
  44227. }
  44228. ], [function(e, t) {
  44229. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44230. i[n] = e[t++]
  44231. }
  44232. , function(e, t) {
  44233. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44234. i[n] = e[t++];
  44235. this.targetObject.needsUpdate = !0
  44236. }
  44237. , function(e, t) {
  44238. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44239. i[n] = e[t++];
  44240. this.targetObject.matrixWorldNeedsUpdate = !0
  44241. }
  44242. ], [function(e, t) {
  44243. this.resolvedProperty[this.propertyIndex] = e[t]
  44244. }
  44245. , function(e, t) {
  44246. this.resolvedProperty[this.propertyIndex] = e[t],
  44247. this.targetObject.needsUpdate = !0
  44248. }
  44249. , function(e, t) {
  44250. this.resolvedProperty[this.propertyIndex] = e[t],
  44251. this.targetObject.matrixWorldNeedsUpdate = !0
  44252. }
  44253. ], [function(e, t) {
  44254. this.resolvedProperty.fromArray(e, t)
  44255. }
  44256. , function(e, t) {
  44257. this.resolvedProperty.fromArray(e, t),
  44258. this.targetObject.needsUpdate = !0
  44259. }
  44260. , function(e, t) {
  44261. this.resolvedProperty.fromArray(e, t),
  44262. this.targetObject.matrixWorldNeedsUpdate = !0
  44263. }
  44264. ]]
  44265. }),
  44266. Ci.PropertyBinding.Composite = function(e, t, i) {
  44267. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44268. this._targetGroup = e,
  44269. this._bindings = e.subscribe_(t, n)
  44270. }
  44271. ,
  44272. Ci.PropertyBinding.Composite.prototype = {
  44273. constructor: Ci.PropertyBinding.Composite,
  44274. getValue: function(e, t) {
  44275. this.bind();
  44276. var i = this._targetGroup.nCachedObjects_
  44277. , n = this._bindings[i];
  44278. void 0 !== n && n.getValue(e, t)
  44279. },
  44280. setValue: function(e, t) {
  44281. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44282. i[n].setValue(e, t)
  44283. },
  44284. bind: function() {
  44285. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44286. e[t].bind()
  44287. },
  44288. unbind: function() {
  44289. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44290. e[t].unbind()
  44291. }
  44292. },
  44293. Ci.PropertyBinding.create = function(e, t, i) {
  44294. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44295. }
  44296. ,
  44297. Ci.PropertyBinding.parseTrackName = function(e) {
  44298. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44299. , i = t.exec(e);
  44300. if (!i)
  44301. throw new Error("cannot parse trackName at all: " + e);
  44302. i.index === t.lastIndex && t.lastIndex++;
  44303. var n = {
  44304. nodeName: i[3],
  44305. objectName: i[5],
  44306. objectIndex: i[7],
  44307. propertyName: i[9],
  44308. propertyIndex: i[11]
  44309. };
  44310. if (null === n.propertyName || 0 === n.propertyName.length)
  44311. throw new Error("can not parse propertyName from trackName: " + e);
  44312. return n
  44313. }
  44314. ,
  44315. Ci.PropertyBinding.findNode = function(e, r) {
  44316. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44317. return e;
  44318. if (e.skeleton) {
  44319. var t = function(e) {
  44320. for (var t = 0; t < e.bones.length; t++) {
  44321. var i = e.bones[t];
  44322. if (i.name === r)
  44323. return i
  44324. }
  44325. return null
  44326. }(e.skeleton);
  44327. if (t)
  44328. return t
  44329. }
  44330. if (e.children) {
  44331. var o = function(e) {
  44332. for (var t = 0; t < e.length; t++) {
  44333. var i = e[t];
  44334. if (i.name === r || i.uuid === r)
  44335. return i;
  44336. var n = o(i.children);
  44337. if (n)
  44338. return n
  44339. }
  44340. return null
  44341. }
  44342. , i = o(e.children);
  44343. if (i)
  44344. return i
  44345. }
  44346. return null
  44347. }
  44348. ,
  44349. Ci.PropertyMixer = function(e, t, i) {
  44350. this.binding = e,
  44351. this.valueSize = i;
  44352. var n, r = Float64Array;
  44353. switch (t) {
  44354. case "quaternion":
  44355. n = this._slerp;
  44356. break;
  44357. case "string":
  44358. case "bool":
  44359. r = Array,
  44360. n = this._select;
  44361. break;
  44362. default:
  44363. n = this._lerp
  44364. }
  44365. this.buffer = new r(4 * i),
  44366. this._mixBufferRegion = n,
  44367. this.cumulativeWeight = 0,
  44368. this.useCount = 0,
  44369. this.referenceCount = 0
  44370. }
  44371. ,
  44372. Ci.PropertyMixer.prototype = {
  44373. constructor: Ci.PropertyMixer,
  44374. accumulate: function(e, t) {
  44375. var i = this.buffer
  44376. , n = this.valueSize
  44377. , r = e * n + n
  44378. , o = this.cumulativeWeight;
  44379. if (0 === o) {
  44380. for (var a = 0; a !== n; ++a)
  44381. i[r + a] = i[a];
  44382. o = t
  44383. } else {
  44384. var s = t / (o += t);
  44385. this._mixBufferRegion(i, r, 0, s, n)
  44386. }
  44387. this.cumulativeWeight = o
  44388. },
  44389. apply: function(e) {
  44390. var t = this.valueSize
  44391. , i = this.buffer
  44392. , n = e * t + t
  44393. , r = this.cumulativeWeight
  44394. , o = this.binding;
  44395. if (this.cumulativeWeight = 0,
  44396. r < 1) {
  44397. var a = 3 * t;
  44398. this._mixBufferRegion(i, n, a, 1 - r, t)
  44399. }
  44400. for (var s = t, l = t + t; s !== l; ++s)
  44401. if (i[s] !== i[s + t]) {
  44402. o.setValue(i, n);
  44403. break
  44404. }
  44405. },
  44406. saveOriginalState: function() {
  44407. var e = this.binding
  44408. , t = this.buffer
  44409. , i = this.valueSize
  44410. , n = 3 * i;
  44411. e.getValue(t, n);
  44412. for (var r = i, o = n; r !== o; ++r)
  44413. t[r] = t[n + r % i];
  44414. this.cumulativeWeight = 0
  44415. },
  44416. restoreOriginalState: function() {
  44417. var e = 3 * this.valueSize;
  44418. this.binding.setValue(this.buffer, e)
  44419. },
  44420. _select: function(e, t, i, n, r) {
  44421. if (.5 <= n)
  44422. for (var o = 0; o !== r; ++o)
  44423. e[t + o] = e[i + o]
  44424. },
  44425. _slerp: function(e, t, i, n, r) {
  44426. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44427. },
  44428. _lerp: function(e, t, i, n, r) {
  44429. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44430. var s = t + a;
  44431. e[s] = e[s] * o + e[i + a] * n
  44432. }
  44433. }
  44434. },
  44435. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44436. Ci.KeyframeTrack.call(this, e, t, i)
  44437. }
  44438. ,
  44439. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44440. constructor: Ci.BooleanKeyframeTrack,
  44441. ValueTypeName: "bool",
  44442. ValueBufferType: Array,
  44443. DefaultInterpolation: Ci.IntepolateDiscrete,
  44444. InterpolantFactoryMethodLinear: void 0,
  44445. InterpolantFactoryMethodSmooth: void 0
  44446. }),
  44447. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44448. Ci.KeyframeTrack.call(this, e, t, i, n)
  44449. }
  44450. ,
  44451. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44452. constructor: Ci.NumberKeyframeTrack,
  44453. ValueTypeName: "number"
  44454. }),
  44455. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44456. Ci.KeyframeTrack.call(this, e, t, i, n)
  44457. }
  44458. ,
  44459. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44460. constructor: Ci.QuaternionKeyframeTrack,
  44461. ValueTypeName: "quaternion",
  44462. DefaultInterpolation: Ci.InterpolateLinear,
  44463. InterpolantFactoryMethodLinear: function(e) {
  44464. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44465. },
  44466. InterpolantFactoryMethodSmooth: void 0
  44467. }),
  44468. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44469. Ci.KeyframeTrack.call(this, e, t, i, n)
  44470. }
  44471. ,
  44472. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44473. constructor: Ci.StringKeyframeTrack,
  44474. ValueTypeName: "string",
  44475. ValueBufferType: Array,
  44476. DefaultInterpolation: Ci.IntepolateDiscrete,
  44477. InterpolantFactoryMethodLinear: void 0,
  44478. InterpolantFactoryMethodSmooth: void 0
  44479. }),
  44480. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44481. Ci.KeyframeTrack.call(this, e, t, i, n)
  44482. }
  44483. ,
  44484. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44485. constructor: Ci.VectorKeyframeTrack,
  44486. ValueTypeName: "vector"
  44487. }),
  44488. Ci.Audio = function(e) {
  44489. Ci.Object3D.call(this),
  44490. this.type = "Audio",
  44491. this.context = e.context,
  44492. this.source = this.context.createBufferSource(),
  44493. this.source.onended = this.onEnded.bind(this),
  44494. this.gain = this.context.createGain(),
  44495. this.gain.connect(e.getInput()),
  44496. this.autoplay = !1,
  44497. this.startTime = 0,
  44498. this.playbackRate = 1,
  44499. this.isPlaying = !1,
  44500. this.hasPlaybackControl = !0,
  44501. this.sourceType = "empty",
  44502. this.filter = null
  44503. }
  44504. ,
  44505. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44506. Ci.Audio.prototype.constructor = Ci.Audio,
  44507. Ci.Audio.prototype.getOutput = function() {
  44508. return this.gain
  44509. }
  44510. ,
  44511. Ci.Audio.prototype.load = function(e) {
  44512. var t = new Ci.AudioBuffer(this.context);
  44513. return t.load(e),
  44514. this.setBuffer(t),
  44515. this
  44516. }
  44517. ,
  44518. Ci.Audio.prototype.setNodeSource = function(e) {
  44519. return this.hasPlaybackControl = !1,
  44520. this.sourceType = "audioNode",
  44521. this.source = e,
  44522. this.connect(),
  44523. this
  44524. }
  44525. ,
  44526. Ci.Audio.prototype.setBuffer = function(e) {
  44527. var t = this;
  44528. return e.onReady(function(e) {
  44529. t.source.buffer = e,
  44530. t.sourceType = "buffer",
  44531. t.autoplay && t.play()
  44532. }),
  44533. this
  44534. }
  44535. ,
  44536. Ci.Audio.prototype.play = function() {
  44537. if (!0 !== this.isPlaying)
  44538. if (!1 !== this.hasPlaybackControl) {
  44539. var e = this.context.createBufferSource();
  44540. e.buffer = this.source.buffer,
  44541. e.loop = this.source.loop,
  44542. e.onended = this.source.onended,
  44543. e.start(0, this.startTime),
  44544. e.playbackRate.value = this.playbackRate,
  44545. this.isPlaying = !0,
  44546. this.source = e,
  44547. this.connect()
  44548. } else
  44549. console.warn("THREE.Audio: this Audio has no playback control.");
  44550. else
  44551. console.warn("THREE.Audio: Audio is already playing.")
  44552. }
  44553. ,
  44554. Ci.Audio.prototype.pause = function() {
  44555. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44556. void (this.startTime = this.context.currentTime))
  44557. }
  44558. ,
  44559. Ci.Audio.prototype.stop = function() {
  44560. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44561. void (this.startTime = 0))
  44562. }
  44563. ,
  44564. Ci.Audio.prototype.connect = function() {
  44565. null !== this.filter ? (this.source.connect(this.filter),
  44566. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44567. }
  44568. ,
  44569. Ci.Audio.prototype.disconnect = function() {
  44570. null !== this.filter ? (this.source.disconnect(this.filter),
  44571. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44572. }
  44573. ,
  44574. Ci.Audio.prototype.getFilter = function() {
  44575. return this.filter
  44576. }
  44577. ,
  44578. Ci.Audio.prototype.setFilter = function(e) {
  44579. void 0 === e && (e = null),
  44580. !0 === this.isPlaying ? (this.disconnect(),
  44581. this.filter = e,
  44582. this.connect()) : this.filter = e
  44583. }
  44584. ,
  44585. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44586. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44587. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44588. }
  44589. ,
  44590. Ci.Audio.prototype.getPlaybackRate = function() {
  44591. return this.playbackRate
  44592. }
  44593. ,
  44594. Ci.Audio.prototype.onEnded = function() {
  44595. this.isPlaying = !1
  44596. }
  44597. ,
  44598. Ci.Audio.prototype.setLoop = function(e) {
  44599. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44600. }
  44601. ,
  44602. Ci.Audio.prototype.getLoop = function() {
  44603. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44604. !1) : this.source.loop
  44605. }
  44606. ,
  44607. Ci.Audio.prototype.setVolume = function(e) {
  44608. this.gain.gain.value = e
  44609. }
  44610. ,
  44611. Ci.Audio.prototype.getVolume = function() {
  44612. return this.gain.gain.value
  44613. }
  44614. ,
  44615. Ci.AudioAnalyser = function(e, t) {
  44616. this.analyser = e.context.createAnalyser(),
  44617. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44618. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44619. e.getOutput().connect(this.analyser)
  44620. }
  44621. ,
  44622. Ci.AudioAnalyser.prototype = {
  44623. constructor: Ci.AudioAnalyser,
  44624. getData: function() {
  44625. return this.analyser.getByteFrequencyData(this.data),
  44626. this.data
  44627. }
  44628. },
  44629. Ci.AudioBuffer = function(e) {
  44630. this.context = e,
  44631. this.ready = !1,
  44632. this.readyCallbacks = []
  44633. }
  44634. ,
  44635. Ci.AudioBuffer.prototype.load = function(e) {
  44636. var i = this
  44637. , t = new XMLHttpRequest;
  44638. return t.open("GET", e, !0),
  44639. t.responseType = "arraybuffer",
  44640. t.onload = function(e) {
  44641. i.context.decodeAudioData(this.response, function(e) {
  44642. i.buffer = e,
  44643. i.ready = !0;
  44644. for (var t = 0; t < i.readyCallbacks.length; t++)
  44645. i.readyCallbacks[t](i.buffer);
  44646. i.readyCallbacks = []
  44647. })
  44648. }
  44649. ,
  44650. t.send(),
  44651. this
  44652. }
  44653. ,
  44654. Ci.AudioBuffer.prototype.onReady = function(e) {
  44655. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44656. }
  44657. ,
  44658. Ci.PositionalAudio = function(e) {
  44659. Ci.Audio.call(this, e),
  44660. this.panner = this.context.createPanner(),
  44661. this.panner.connect(this.gain)
  44662. }
  44663. ,
  44664. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44665. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44666. Ci.PositionalAudio.prototype.getOutput = function() {
  44667. return this.panner
  44668. }
  44669. ,
  44670. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44671. this.panner.refDistance = e
  44672. }
  44673. ,
  44674. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44675. return this.panner.refDistance
  44676. }
  44677. ,
  44678. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44679. this.panner.rolloffFactor = e
  44680. }
  44681. ,
  44682. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44683. return this.panner.rolloffFactor
  44684. }
  44685. ,
  44686. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44687. this.panner.distanceModel = e
  44688. }
  44689. ,
  44690. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44691. return this.panner.distanceModel
  44692. }
  44693. ,
  44694. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44695. this.panner.maxDistance = e
  44696. }
  44697. ,
  44698. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44699. return this.panner.maxDistance
  44700. }
  44701. ,
  44702. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44703. function(e) {
  44704. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44705. it.setFromMatrixPosition(this.matrixWorld),
  44706. this.panner.setPosition(it.x, it.y, it.z)
  44707. }
  44708. ),
  44709. Ci.AudioListener = function() {
  44710. Ci.Object3D.call(this),
  44711. this.type = "AudioListener",
  44712. this.context = new (window.AudioContext || window.webkitAudioContext),
  44713. this.gain = this.context.createGain(),
  44714. this.gain.connect(this.context.destination),
  44715. this.filter = null
  44716. }
  44717. ,
  44718. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44719. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44720. Ci.AudioListener.prototype.getInput = function() {
  44721. return this.gain
  44722. }
  44723. ,
  44724. Ci.AudioListener.prototype.removeFilter = function() {
  44725. null !== this.filter && (this.gain.disconnect(this.filter),
  44726. this.filter.disconnect(this.context.destination),
  44727. this.gain.connect(this.context.destination),
  44728. this.filter = null)
  44729. }
  44730. ,
  44731. Ci.AudioListener.prototype.setFilter = function(e) {
  44732. null !== this.filter ? (this.gain.disconnect(this.filter),
  44733. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44734. this.filter = e,
  44735. this.gain.connect(this.filter),
  44736. this.filter.connect(this.context.destination)
  44737. }
  44738. ,
  44739. Ci.AudioListener.prototype.getFilter = function() {
  44740. return this.filter
  44741. }
  44742. ,
  44743. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44744. this.gain.gain.value = e
  44745. }
  44746. ,
  44747. Ci.AudioListener.prototype.getMasterVolume = function() {
  44748. return this.gain.gain.value
  44749. }
  44750. ,
  44751. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44752. $e = new Ci.Quaternion,
  44753. et = new Ci.Vector3,
  44754. tt = new Ci.Vector3,
  44755. function(e) {
  44756. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44757. var t = this.context.listener
  44758. , i = this.up;
  44759. this.matrixWorld.decompose(Je, $e, et),
  44760. tt.set(0, 0, -1).applyQuaternion($e),
  44761. t.setPosition(Je.x, Je.y, Je.z),
  44762. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44763. }
  44764. ),
  44765. Ci.Camera = function() {
  44766. Ci.Object3D.call(this),
  44767. this.type = "Camera",
  44768. this.matrixWorldInverse = new Ci.Matrix4,
  44769. this.projectionMatrix = new Ci.Matrix4
  44770. }
  44771. ,
  44772. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44773. Ci.Camera.prototype.constructor = Ci.Camera,
  44774. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44775. function(e) {
  44776. var t = e || new Ci.Vector3;
  44777. return this.getWorldQuaternion(Qe),
  44778. t.set(0, 0, -1).applyQuaternion(Qe)
  44779. }
  44780. ),
  44781. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44782. function(e) {
  44783. Ke.lookAt(this.position, e, this.up),
  44784. this.quaternion.setFromRotationMatrix(Ke)
  44785. }
  44786. ),
  44787. Ci.Camera.prototype.clone = function() {
  44788. return (new this.constructor).copy(this)
  44789. }
  44790. ,
  44791. Ci.Camera.prototype.copy = function(e) {
  44792. return Ci.Object3D.prototype.copy.call(this, e),
  44793. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44794. this.projectionMatrix.copy(e.projectionMatrix),
  44795. this
  44796. }
  44797. ,
  44798. Ci.CubeCamera = function(e, t, i) {
  44799. Ci.Object3D.call(this),
  44800. this.type = "CubeCamera";
  44801. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44802. r.up.set(0, -1, 0),
  44803. r.lookAt(new Ci.Vector3(1,0,0)),
  44804. this.add(r);
  44805. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44806. o.up.set(0, -1, 0),
  44807. o.lookAt(new Ci.Vector3(-1,0,0)),
  44808. this.add(o);
  44809. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44810. a.up.set(0, 0, 1),
  44811. a.lookAt(new Ci.Vector3(0,1,0)),
  44812. this.add(a);
  44813. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44814. s.up.set(0, 0, -1),
  44815. s.lookAt(new Ci.Vector3(0,-1,0)),
  44816. this.add(s);
  44817. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44818. l.up.set(0, -1, 0),
  44819. l.lookAt(new Ci.Vector3(0,0,1)),
  44820. this.add(l);
  44821. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44822. c.up.set(0, -1, 0),
  44823. c.lookAt(new Ci.Vector3(0,0,-1)),
  44824. this.add(c);
  44825. var n = {
  44826. format: Ci.RGBFormat,
  44827. magFilter: Ci.LinearFilter,
  44828. minFilter: Ci.LinearFilter
  44829. };
  44830. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44831. this.updateCubeMap = function(e, t) {
  44832. null === this.parent && this.updateMatrixWorld();
  44833. var i = this.renderTarget
  44834. , n = i.texture.generateMipmaps;
  44835. i.texture.generateMipmaps = !1,
  44836. i.activeCubeFace = 0,
  44837. e.render(t, r, i),
  44838. i.activeCubeFace = 1,
  44839. e.render(t, o, i),
  44840. i.activeCubeFace = 2,
  44841. e.render(t, a, i),
  44842. i.activeCubeFace = 3,
  44843. e.render(t, s, i),
  44844. i.activeCubeFace = 4,
  44845. e.render(t, l, i),
  44846. i.texture.generateMipmaps = n,
  44847. i.activeCubeFace = 5,
  44848. e.render(t, c, i),
  44849. e.setRenderTarget(null)
  44850. }
  44851. }
  44852. ,
  44853. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44854. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44855. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44856. Ci.Camera.call(this),
  44857. this.type = "OrthographicCamera",
  44858. this.zoom = 1,
  44859. this.left = e,
  44860. this.right = t,
  44861. this.top = i,
  44862. this.bottom = n,
  44863. this.near = void 0 !== r ? r : .1,
  44864. this.far = void 0 !== o ? o : 2e3,
  44865. this.updateProjectionMatrix()
  44866. }
  44867. ,
  44868. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44869. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44870. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44871. var e = (this.right - this.left) / (2 * this.zoom)
  44872. , t = (this.top - this.bottom) / (2 * this.zoom)
  44873. , i = (this.right + this.left) / 2
  44874. , n = (this.top + this.bottom) / 2;
  44875. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44876. }
  44877. ,
  44878. Ci.OrthographicCamera.prototype.copy = function(e) {
  44879. return Ci.Camera.prototype.copy.call(this, e),
  44880. this.left = e.left,
  44881. this.right = e.right,
  44882. this.top = e.top,
  44883. this.bottom = e.bottom,
  44884. this.near = e.near,
  44885. this.far = e.far,
  44886. this.zoom = e.zoom,
  44887. this
  44888. }
  44889. ,
  44890. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44891. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44892. return t.object.zoom = this.zoom,
  44893. t.object.left = this.left,
  44894. t.object.right = this.right,
  44895. t.object.top = this.top,
  44896. t.object.bottom = this.bottom,
  44897. t.object.near = this.near,
  44898. t.object.far = this.far,
  44899. t
  44900. }
  44901. ,
  44902. Ci.PerspectiveCamera = function(e, t, i, n) {
  44903. Ci.Camera.call(this),
  44904. this.type = "PerspectiveCamera",
  44905. this.focalLength = 10,
  44906. this.zoom = 1,
  44907. this.fov = void 0 !== e ? e : 50,
  44908. this.aspect = void 0 !== t ? t : 1,
  44909. this.near = void 0 !== i ? i : .1,
  44910. this.far = void 0 !== n ? n : 2e3,
  44911. this.updateProjectionMatrix()
  44912. }
  44913. ,
  44914. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44915. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44916. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44917. void 0 === t && (t = 24),
  44918. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44919. this.updateProjectionMatrix()
  44920. }
  44921. ,
  44922. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44923. this.fullWidth = e,
  44924. this.fullHeight = t,
  44925. this.x = i,
  44926. this.y = n,
  44927. this.width = r,
  44928. this.height = o,
  44929. this.updateProjectionMatrix()
  44930. }
  44931. ,
  44932. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44933. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44934. if (this.fullWidth) {
  44935. var t = this.fullWidth / this.fullHeight
  44936. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44937. , n = -i
  44938. , r = t * n
  44939. , o = t * i
  44940. , a = Math.abs(o - r)
  44941. , s = Math.abs(i - n);
  44942. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  44943. } else
  44944. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44945. }
  44946. ,
  44947. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44948. return Ci.Camera.prototype.copy.call(this, e),
  44949. this.focalLength = e.focalLength,
  44950. this.zoom = e.zoom,
  44951. this.fov = e.fov,
  44952. this.aspect = e.aspect,
  44953. this.near = e.near,
  44954. this.far = e.far,
  44955. this
  44956. }
  44957. ,
  44958. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44959. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44960. return t.object.focalLength = this.focalLength,
  44961. t.object.zoom = this.zoom,
  44962. t.object.fov = this.fov,
  44963. t.object.aspect = this.aspect,
  44964. t.object.near = this.near,
  44965. t.object.far = this.far,
  44966. t
  44967. }
  44968. ,
  44969. Ci.StereoCamera = function() {
  44970. this.type = "StereoCamera",
  44971. this.aspect = 1,
  44972. this.cameraL = new Ci.PerspectiveCamera,
  44973. this.cameraL.layers.enable(1),
  44974. this.cameraL.matrixAutoUpdate = !1,
  44975. this.cameraR = new Ci.PerspectiveCamera,
  44976. this.cameraR.layers.enable(2),
  44977. this.cameraR.matrixAutoUpdate = !1
  44978. }
  44979. ,
  44980. Ci.StereoCamera.prototype = {
  44981. constructor: Ci.StereoCamera,
  44982. update: (Xe = new Ci.Matrix4,
  44983. Ze = new Ci.Matrix4,
  44984. function(e) {
  44985. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44986. Ge = e.focalLength,
  44987. We = e.fov,
  44988. je = e.aspect * this.aspect,
  44989. Ye = e.near,
  44990. qe = e.far;
  44991. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44992. Ze.elements[12] = -.032,
  44993. Xe.elements[12] = .032,
  44994. t = -o * je + r,
  44995. i = o * je + r,
  44996. n.elements[0] = 2 * Ye / (i - t),
  44997. n.elements[8] = (i + t) / (i - t),
  44998. this.cameraL.projectionMatrix.copy(n),
  44999. t = -o * je - r,
  45000. i = o * je - r,
  45001. n.elements[0] = 2 * Ye / (i - t),
  45002. n.elements[8] = (i + t) / (i - t),
  45003. this.cameraR.projectionMatrix.copy(n)
  45004. }
  45005. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45006. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45007. }
  45008. )
  45009. },
  45010. Ci.Light = function(e, t) {
  45011. Ci.Object3D.call(this),
  45012. this.type = "Light",
  45013. this.color = new Ci.Color(e),
  45014. this.intensity = void 0 !== t ? t : 1,
  45015. this.receiveShadow = void 0
  45016. }
  45017. ,
  45018. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45019. Ci.Light.prototype.constructor = Ci.Light,
  45020. Ci.Light.prototype.copy = function(e) {
  45021. return Ci.Object3D.prototype.copy.call(this, e),
  45022. this.color.copy(e.color),
  45023. this.intensity = e.intensity,
  45024. this
  45025. }
  45026. ,
  45027. Ci.Light.prototype.toJSON = function(e) {
  45028. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45029. return t.object.color = this.color.getHex(),
  45030. t.object.intensity = this.intensity,
  45031. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45032. void 0 !== this.distance && (t.object.distance = this.distance),
  45033. void 0 !== this.angle && (t.object.angle = this.angle),
  45034. void 0 !== this.decay && (t.object.decay = this.decay),
  45035. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45036. t
  45037. }
  45038. ,
  45039. Ci.LightShadow = function(e) {
  45040. this.camera = e,
  45041. this.bias = 0,
  45042. this.radius = 1,
  45043. this.mapSize = new Ci.Vector2(512,512),
  45044. this.map = null,
  45045. this.matrix = new Ci.Matrix4
  45046. }
  45047. ,
  45048. Ci.LightShadow.prototype = {
  45049. constructor: Ci.LightShadow,
  45050. copy: function(e) {
  45051. return this.camera = e.camera.clone(),
  45052. this.bias = e.bias,
  45053. this.radius = e.radius,
  45054. this.mapSize.copy(e.mapSize),
  45055. this
  45056. },
  45057. clone: function() {
  45058. return (new this.constructor).copy(this)
  45059. }
  45060. },
  45061. Ci.AmbientLight = function(e, t) {
  45062. Ci.Light.call(this, e, t),
  45063. this.type = "AmbientLight",
  45064. this.castShadow = void 0
  45065. }
  45066. ,
  45067. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45068. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45069. Ci.DirectionalLight = function(e, t) {
  45070. Ci.Light.call(this, e, t),
  45071. this.type = "DirectionalLight",
  45072. this.position.set(0, 1, 0),
  45073. this.updateMatrix(),
  45074. this.target = new Ci.Object3D,
  45075. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45076. }
  45077. ,
  45078. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45079. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45080. Ci.DirectionalLight.prototype.copy = function(e) {
  45081. return Ci.Light.prototype.copy.call(this, e),
  45082. this.target = e.target.clone(),
  45083. this.shadow = e.shadow.clone(),
  45084. this
  45085. }
  45086. ,
  45087. Ci.HemisphereLight = function(e, t, i) {
  45088. Ci.Light.call(this, e, i),
  45089. this.type = "HemisphereLight",
  45090. this.castShadow = void 0,
  45091. this.position.set(0, 1, 0),
  45092. this.updateMatrix(),
  45093. this.groundColor = new Ci.Color(t)
  45094. }
  45095. ,
  45096. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45097. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45098. Ci.HemisphereLight.prototype.copy = function(e) {
  45099. return Ci.Light.prototype.copy.call(this, e),
  45100. this.groundColor.copy(e.groundColor),
  45101. this
  45102. }
  45103. ,
  45104. Ci.PointLight = function(e, t, i, n) {
  45105. Ci.Light.call(this, e, t),
  45106. this.type = "PointLight",
  45107. this.distance = void 0 !== i ? i : 0,
  45108. this.decay = void 0 !== n ? n : 1,
  45109. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45110. }
  45111. ,
  45112. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45113. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45114. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45115. get: function() {
  45116. return 4 * this.intensity * Math.PI
  45117. },
  45118. set: function(e) {
  45119. this.intensity = e / (4 * Math.PI)
  45120. }
  45121. }),
  45122. Ci.PointLight.prototype.copy = function(e) {
  45123. return Ci.Light.prototype.copy.call(this, e),
  45124. this.distance = e.distance,
  45125. this.decay = e.decay,
  45126. this.shadow = e.shadow.clone(),
  45127. this
  45128. }
  45129. ,
  45130. Ci.SpotLight = function(e, t, i, n, r, o) {
  45131. Ci.Light.call(this, e, t),
  45132. this.type = "SpotLight",
  45133. this.position.set(0, 1, 0),
  45134. this.updateMatrix(),
  45135. this.target = new Ci.Object3D,
  45136. this.distance = void 0 !== i ? i : 0,
  45137. this.angle = void 0 !== n ? n : Math.PI / 3,
  45138. this.penumbra = void 0 !== r ? r : 0,
  45139. this.decay = void 0 !== o ? o : 1,
  45140. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45141. }
  45142. ,
  45143. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45144. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45145. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45146. get: function() {
  45147. return this.intensity * Math.PI
  45148. },
  45149. set: function(e) {
  45150. this.intensity = e / Math.PI
  45151. }
  45152. }),
  45153. Ci.SpotLight.prototype.copy = function(e) {
  45154. return Ci.Light.prototype.copy.call(this, e),
  45155. this.distance = e.distance,
  45156. this.angle = e.angle,
  45157. this.penumbra = e.penumbra,
  45158. this.decay = e.decay,
  45159. this.target = e.target.clone(),
  45160. this.shadow = e.shadow.clone(),
  45161. this
  45162. }
  45163. ,
  45164. Ci.Cache = {
  45165. enabled: !1,
  45166. files: {},
  45167. add: function(e, t) {
  45168. !1 !== this.enabled && (this.files[e] = t)
  45169. },
  45170. get: function(e) {
  45171. if (!1 !== this.enabled)
  45172. return this.files[e]
  45173. },
  45174. remove: function(e) {
  45175. delete this.files[e]
  45176. },
  45177. clear: function() {
  45178. this.files = {}
  45179. }
  45180. },
  45181. Ci.Loader = function() {
  45182. this.onLoadStart = function() {}
  45183. ,
  45184. this.onLoadProgress = function() {}
  45185. ,
  45186. this.onLoadComplete = function() {}
  45187. }
  45188. ,
  45189. Ci.Loader.prototype = {
  45190. constructor: Ci.Loader,
  45191. crossOrigin: void 0,
  45192. extractUrlBase: function(e) {
  45193. var t = e.split("/");
  45194. return 1 === t.length ? "./" : (t.pop(),
  45195. t.join("/") + "/")
  45196. },
  45197. initMaterials: function(e, t, i) {
  45198. for (var n = [], r = 0; r < e.length; ++r)
  45199. n[r] = this.createMaterial(e[r], t, i);
  45200. return n
  45201. },
  45202. createMaterial: function(e, c, h) {
  45203. function t(e, t, i, n, r) {
  45204. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45205. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45206. He.load(a)),
  45207. void 0 !== t && (o.repeat.fromArray(t),
  45208. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45209. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45210. void 0 !== i && o.offset.fromArray(i),
  45211. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45212. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45213. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45214. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45215. void 0 !== r && (o.anisotropy = r);
  45216. var l = Ci.Math.generateUUID();
  45217. return u[l] = o,
  45218. l
  45219. }
  45220. void 0 === Ue && (Ue = new Ci.Color),
  45221. void 0 === He && (He = new Ci.TextureLoader),
  45222. void 0 === ze && (ze = new Ci.MaterialLoader);
  45223. var u = {}
  45224. , i = {
  45225. uuid: Ci.Math.generateUUID(),
  45226. type: "MeshLambertMaterial"
  45227. };
  45228. for (var n in e) {
  45229. var r = e[n];
  45230. switch (n) {
  45231. case "DbgColor":
  45232. case "DbgIndex":
  45233. case "opticalDensity":
  45234. case "illumination":
  45235. break;
  45236. case "DbgName":
  45237. i.name = r;
  45238. break;
  45239. case "blending":
  45240. i.blending = Ci[r];
  45241. break;
  45242. case "colorAmbient":
  45243. case "mapAmbient":
  45244. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45245. break;
  45246. case "colorDiffuse":
  45247. i.color = Ue.fromArray(r).getHex();
  45248. break;
  45249. case "colorSpecular":
  45250. i.specular = Ue.fromArray(r).getHex();
  45251. break;
  45252. case "colorEmissive":
  45253. i.emissive = Ue.fromArray(r).getHex();
  45254. break;
  45255. case "specularCoef":
  45256. i.shininess = r;
  45257. break;
  45258. case "shading":
  45259. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45260. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45261. break;
  45262. case "mapDiffuse":
  45263. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45264. break;
  45265. case "mapDiffuseRepeat":
  45266. case "mapDiffuseOffset":
  45267. case "mapDiffuseWrap":
  45268. case "mapDiffuseAnisotropy":
  45269. break;
  45270. case "mapLight":
  45271. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45272. break;
  45273. case "mapLightRepeat":
  45274. case "mapLightOffset":
  45275. case "mapLightWrap":
  45276. case "mapLightAnisotropy":
  45277. break;
  45278. case "mapAO":
  45279. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45280. break;
  45281. case "mapAORepeat":
  45282. case "mapAOOffset":
  45283. case "mapAOWrap":
  45284. case "mapAOAnisotropy":
  45285. break;
  45286. case "mapBump":
  45287. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45288. break;
  45289. case "mapBumpScale":
  45290. i.bumpScale = r;
  45291. break;
  45292. case "mapBumpRepeat":
  45293. case "mapBumpOffset":
  45294. case "mapBumpWrap":
  45295. case "mapBumpAnisotropy":
  45296. break;
  45297. case "mapNormal":
  45298. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45299. break;
  45300. case "mapNormalFactor":
  45301. i.normalScale = [r, r];
  45302. break;
  45303. case "mapNormalRepeat":
  45304. case "mapNormalOffset":
  45305. case "mapNormalWrap":
  45306. case "mapNormalAnisotropy":
  45307. break;
  45308. case "mapSpecular":
  45309. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45310. break;
  45311. case "mapSpecularRepeat":
  45312. case "mapSpecularOffset":
  45313. case "mapSpecularWrap":
  45314. case "mapSpecularAnisotropy":
  45315. break;
  45316. case "mapAlpha":
  45317. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45318. break;
  45319. case "mapAlphaRepeat":
  45320. case "mapAlphaOffset":
  45321. case "mapAlphaWrap":
  45322. case "mapAlphaAnisotropy":
  45323. break;
  45324. case "flipSided":
  45325. i.side = Ci.BackSide;
  45326. break;
  45327. case "doubleSided":
  45328. i.side = Ci.DoubleSide;
  45329. break;
  45330. case "transparency":
  45331. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45332. i.opacity = r;
  45333. break;
  45334. case "depthTest":
  45335. case "depthWrite":
  45336. case "colorWrite":
  45337. case "opacity":
  45338. case "reflectivity":
  45339. case "transparent":
  45340. case "visible":
  45341. case "wireframe":
  45342. i[n] = r;
  45343. break;
  45344. case "vertexColors":
  45345. !0 === r && (i.vertexColors = Ci.VertexColors),
  45346. "face" === r && (i.vertexColors = Ci.FaceColors);
  45347. break;
  45348. default:
  45349. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45350. }
  45351. }
  45352. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45353. "MeshPhongMaterial" !== i.type && delete i.specular,
  45354. i.opacity < 1 && (i.transparent = !0),
  45355. ze.setTextures(u),
  45356. ze.parse(i)
  45357. }
  45358. },
  45359. Ci.Loader.Handlers = {
  45360. handlers: [],
  45361. add: function(e, t) {
  45362. this.handlers.push(e, t)
  45363. },
  45364. get: function(e) {
  45365. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45366. var r = t[i]
  45367. , o = t[i + 1];
  45368. if (r.test(e))
  45369. return o
  45370. }
  45371. return null
  45372. }
  45373. },
  45374. Ci.XHRLoader = function(e) {
  45375. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45376. }
  45377. ,
  45378. Ci.XHRLoader.prototype = {
  45379. constructor: Ci.XHRLoader,
  45380. load: function(i, n, t, r) {
  45381. void 0 !== this.path && (i = this.path + i);
  45382. var o = this
  45383. , e = Ci.Cache.get(i);
  45384. if (void 0 !== e)
  45385. return n && setTimeout(function() {
  45386. n(e)
  45387. }, 0),
  45388. e;
  45389. var a = new XMLHttpRequest;
  45390. return a.overrideMimeType("text/plain"),
  45391. a.open("GET", i, !0),
  45392. a.addEventListener("load", function(e) {
  45393. var t = e.target.response;
  45394. Ci.Cache.add(i, t),
  45395. 200 === this.status ? (n && n(t),
  45396. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45397. n && n(t),
  45398. o.manager.itemEnd(i)) : (r && r(e),
  45399. o.manager.itemError(i))
  45400. }, !1),
  45401. void 0 !== t && a.addEventListener("progress", function(e) {
  45402. t(e)
  45403. }, !1),
  45404. a.addEventListener("error", function(e) {
  45405. r && r(e),
  45406. o.manager.itemError(i)
  45407. }, !1),
  45408. void 0 !== this.responseType && (a.responseType = this.responseType),
  45409. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45410. a.send(null),
  45411. o.manager.itemStart(i),
  45412. a
  45413. },
  45414. setPath: function(e) {
  45415. this.path = e
  45416. },
  45417. setResponseType: function(e) {
  45418. this.responseType = e
  45419. },
  45420. setWithCredentials: function(e) {
  45421. this.withCredentials = e
  45422. }
  45423. },
  45424. Ci.FontLoader = function(e) {
  45425. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45426. }
  45427. ,
  45428. Ci.FontLoader.prototype = {
  45429. constructor: Ci.FontLoader,
  45430. load: function(e, t, i, n) {
  45431. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45432. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45433. }, i, n)
  45434. }
  45435. },
  45436. Ci.ImageLoader = function(e) {
  45437. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45438. }
  45439. ,
  45440. Ci.ImageLoader.prototype = {
  45441. constructor: Ci.ImageLoader,
  45442. load: function(t, i, n, r) {
  45443. void 0 !== this.path && (t = this.path + t);
  45444. var o = this
  45445. , e = Ci.Cache.get(t);
  45446. if (void 0 !== e)
  45447. return o.manager.itemStart(t),
  45448. i ? setTimeout(function() {
  45449. i(e),
  45450. o.manager.itemEnd(t)
  45451. }, 0) : o.manager.itemEnd(t),
  45452. e;
  45453. var a = document.createElement("img");
  45454. return a.addEventListener("load", function(e) {
  45455. Ci.Cache.add(t, this),
  45456. i && i(this),
  45457. o.manager.itemEnd(t)
  45458. }, !1),
  45459. void 0 !== n && a.addEventListener("progress", function(e) {
  45460. n(e)
  45461. }, !1),
  45462. a.addEventListener("error", function(e) {
  45463. r && r(e),
  45464. o.manager.itemError(t)
  45465. }, !1),
  45466. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45467. o.manager.itemStart(t),
  45468. a.src = t,
  45469. a
  45470. },
  45471. setCrossOrigin: function(e) {
  45472. this.crossOrigin = e
  45473. },
  45474. setPath: function(e) {
  45475. this.path = e
  45476. }
  45477. },
  45478. Ci.JSONLoader = function(e) {
  45479. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45480. e = void 0),
  45481. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45482. this.withCredentials = !1
  45483. }
  45484. ,
  45485. Ci.JSONLoader.prototype = {
  45486. constructor: Ci.JSONLoader,
  45487. get statusDomElement() {
  45488. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45489. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45490. this._statusDomElement
  45491. },
  45492. load: function(o, a, e, t) {
  45493. var s = this
  45494. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45495. , i = new Ci.XHRLoader(this.manager);
  45496. i.setWithCredentials(this.withCredentials),
  45497. i.load(o, function(e) {
  45498. var t = JSON.parse(e)
  45499. , i = t.metadata;
  45500. if (void 0 !== i) {
  45501. var n = i.type;
  45502. if (void 0 !== n) {
  45503. if ("object" === n.toLowerCase())
  45504. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45505. if ("scene" === n.toLowerCase())
  45506. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45507. }
  45508. }
  45509. var r = s.parse(t, l);
  45510. a(r.geometry, r.materials)
  45511. }, e, t)
  45512. },
  45513. setTexturePath: function(e) {
  45514. this.texturePath = e
  45515. },
  45516. parse: function(D, e) {
  45517. var N = new Ci.Geometry
  45518. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45519. if (function(e) {
  45520. function t(e, t) {
  45521. return e & 1 << t
  45522. }
  45523. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  45524. if (void 0 !== D.uvs) {
  45525. for (i = 0; i < D.uvs.length; i++)
  45526. D.uvs[i].length && L++;
  45527. for (i = 0; i < L; i++)
  45528. N.faceVertexUvs[i] = []
  45529. }
  45530. for (o = 0,
  45531. a = R.length; o < a; )
  45532. (A = new Ci.Vector3).x = R[o++] * e,
  45533. A.y = R[o++] * e,
  45534. A.z = R[o++] * e,
  45535. N.vertices.push(A);
  45536. for (o = 0,
  45537. a = M.length; o < a; )
  45538. if (d = t(u = M[o++], 0),
  45539. p = t(u, 1),
  45540. f = t(u, 3),
  45541. g = t(u, 4),
  45542. m = t(u, 5),
  45543. v = t(u, 6),
  45544. y = t(u, 7),
  45545. d) {
  45546. if ((I = new Ci.Face3).a = M[o],
  45547. I.b = M[o + 1],
  45548. I.c = M[o + 3],
  45549. (E = new Ci.Face3).a = M[o + 1],
  45550. E.b = M[o + 2],
  45551. E.c = M[o + 3],
  45552. o += 4,
  45553. p && (h = M[o++],
  45554. I.materialIndex = h,
  45555. E.materialIndex = h),
  45556. r = N.faces.length,
  45557. f)
  45558. for (i = 0; i < L; i++)
  45559. for (w = D.uvs[i],
  45560. N.faceVertexUvs[i][r] = [],
  45561. N.faceVertexUvs[i][r + 1] = [],
  45562. n = 0; n < 4; n++)
  45563. x = w[2 * (c = M[o++])],
  45564. S = w[2 * c + 1],
  45565. T = new Ci.Vector2(x,S),
  45566. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45567. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45568. if (g && (l = 3 * M[o++],
  45569. I.normal.set(P[l++], P[l++], P[l]),
  45570. E.normal.copy(I.normal)),
  45571. m)
  45572. for (i = 0; i < 4; i++)
  45573. l = 3 * M[o++],
  45574. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45575. 2 !== i && I.vertexNormals.push(b),
  45576. 0 !== i && E.vertexNormals.push(b);
  45577. if (v && (_ = O[s = M[o++]],
  45578. I.color.setHex(_),
  45579. E.color.setHex(_)),
  45580. y)
  45581. for (i = 0; i < 4; i++)
  45582. _ = O[s = M[o++]],
  45583. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45584. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45585. N.faces.push(I),
  45586. N.faces.push(E)
  45587. } else {
  45588. if ((C = new Ci.Face3).a = M[o++],
  45589. C.b = M[o++],
  45590. C.c = M[o++],
  45591. p && (h = M[o++],
  45592. C.materialIndex = h),
  45593. r = N.faces.length,
  45594. f)
  45595. for (i = 0; i < L; i++)
  45596. for (w = D.uvs[i],
  45597. N.faceVertexUvs[i][r] = [],
  45598. n = 0; n < 3; n++)
  45599. x = w[2 * (c = M[o++])],
  45600. S = w[2 * c + 1],
  45601. T = new Ci.Vector2(x,S),
  45602. N.faceVertexUvs[i][r].push(T);
  45603. if (g && (l = 3 * M[o++],
  45604. C.normal.set(P[l++], P[l++], P[l])),
  45605. m)
  45606. for (i = 0; i < 3; i++)
  45607. l = 3 * M[o++],
  45608. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45609. C.vertexNormals.push(b);
  45610. if (v && (s = M[o++],
  45611. C.color.setHex(O[s])),
  45612. y)
  45613. for (i = 0; i < 3; i++)
  45614. s = M[o++],
  45615. C.vertexColors.push(new Ci.Color(O[s]));
  45616. N.faces.push(C)
  45617. }
  45618. }(t),
  45619. function() {
  45620. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45621. if (D.skinWeights)
  45622. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45623. var n = D.skinWeights[t]
  45624. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45625. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45626. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45627. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45628. }
  45629. if (D.skinIndices)
  45630. for (t = 0,
  45631. i = D.skinIndices.length; t < i; t += e) {
  45632. var s = D.skinIndices[t]
  45633. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45634. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45635. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45636. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45637. }
  45638. N.bones = D.bones,
  45639. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  45640. }(),
  45641. function(e) {
  45642. if (void 0 !== D.morphTargets)
  45643. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45644. N.morphTargets[t] = {},
  45645. N.morphTargets[t].name = D.morphTargets[t].name,
  45646. N.morphTargets[t].vertices = [];
  45647. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45648. var s = new Ci.Vector3;
  45649. s.x = r[o] * e,
  45650. s.y = r[o + 1] * e,
  45651. s.z = r[o + 2] * e,
  45652. n.push(s)
  45653. }
  45654. }
  45655. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45656. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45657. var l = N.faces
  45658. , c = D.morphColors[0].colors;
  45659. for (t = 0,
  45660. i = l.length; t < i; t++)
  45661. l[t].color.fromArray(c, 3 * t)
  45662. }
  45663. }(t),
  45664. function() {
  45665. var e = []
  45666. , t = [];
  45667. void 0 !== D.animation && t.push(D.animation),
  45668. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45669. for (var i = 0; i < t.length; i++) {
  45670. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45671. n && e.push(n)
  45672. }
  45673. if (N.morphTargets) {
  45674. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45675. e = e.concat(r)
  45676. }
  45677. 0 < e.length && (N.animations = e)
  45678. }(),
  45679. N.computeFaceNormals(),
  45680. N.computeBoundingSphere(),
  45681. void 0 === D.materials || 0 === D.materials.length)
  45682. return {
  45683. geometry: N
  45684. };
  45685. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45686. return {
  45687. geometry: N,
  45688. materials: i
  45689. }
  45690. }
  45691. },
  45692. Ci.LoadingManager = function(e, t, i) {
  45693. var n = this
  45694. , r = !1
  45695. , o = 0
  45696. , a = 0;
  45697. this.onStart = void 0,
  45698. this.onLoad = e,
  45699. this.onProgress = t,
  45700. this.onError = i,
  45701. this.itemStart = function(e) {
  45702. a++,
  45703. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45704. r = !0
  45705. }
  45706. ,
  45707. this.itemEnd = function(e) {
  45708. o++,
  45709. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45710. o === a && (r = !1,
  45711. void 0 !== n.onLoad && n.onLoad())
  45712. }
  45713. ,
  45714. this.itemError = function(e) {
  45715. void 0 !== n.onError && n.onError(e)
  45716. }
  45717. }
  45718. ,
  45719. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45720. Ci.BufferGeometryLoader = function(e) {
  45721. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45722. }
  45723. ,
  45724. Ci.BufferGeometryLoader.prototype = {
  45725. constructor: Ci.BufferGeometryLoader,
  45726. load: function(e, t, i, n) {
  45727. var r = this;
  45728. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45729. t(r.parse(JSON.parse(e)))
  45730. }, i, n)
  45731. },
  45732. parse: function(e) {
  45733. var t = new Ci.BufferGeometry
  45734. , i = e.data.index
  45735. , n = {
  45736. Int8Array: Int8Array,
  45737. Uint8Array: Uint8Array,
  45738. Uint8ClampedArray: Uint8ClampedArray,
  45739. Int16Array: Int16Array,
  45740. Uint16Array: Uint16Array,
  45741. Int32Array: Int32Array,
  45742. Uint32Array: Uint32Array,
  45743. Float32Array: Float32Array,
  45744. Float64Array: Float64Array
  45745. };
  45746. if (void 0 !== i) {
  45747. var r = new n[i.type](i.array);
  45748. t.setIndex(new Ci.BufferAttribute(r,1))
  45749. }
  45750. var o = e.data.attributes;
  45751. for (var a in o) {
  45752. var s = o[a];
  45753. r = new n[s.type](s.array);
  45754. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45755. }
  45756. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45757. if (void 0 !== l)
  45758. for (var c = 0, h = l.length; c !== h; ++c) {
  45759. var u = l[c];
  45760. t.addGroup(u.start, u.count, u.materialIndex)
  45761. }
  45762. var d = e.data.boundingSphere;
  45763. if (void 0 !== d) {
  45764. var p = new Ci.Vector3;
  45765. void 0 !== d.center && p.fromArray(d.center),
  45766. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45767. }
  45768. return t
  45769. }
  45770. },
  45771. Ci.MaterialLoader = function(e) {
  45772. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45773. this.textures = {}
  45774. }
  45775. ,
  45776. Ci.MaterialLoader.prototype = {
  45777. constructor: Ci.MaterialLoader,
  45778. load: function(e, t, i, n) {
  45779. var r = this;
  45780. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45781. t(r.parse(JSON.parse(e)))
  45782. }, i, n)
  45783. },
  45784. setTextures: function(e) {
  45785. this.textures = e
  45786. },
  45787. getTexture: function(e) {
  45788. var t = this.textures;
  45789. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45790. t[e]
  45791. },
  45792. parse: function(e) {
  45793. var t = new Ci[e.type];
  45794. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45795. void 0 !== e.name && (t.name = e.name),
  45796. void 0 !== e.color && t.color.setHex(e.color),
  45797. void 0 !== e.roughness && (t.roughness = e.roughness),
  45798. void 0 !== e.metalness && (t.metalness = e.metalness),
  45799. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45800. void 0 !== e.specular && t.specular.setHex(e.specular),
  45801. void 0 !== e.shininess && (t.shininess = e.shininess),
  45802. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45803. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45804. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45805. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45806. void 0 !== e.shading && (t.shading = e.shading),
  45807. void 0 !== e.blending && (t.blending = e.blending),
  45808. void 0 !== e.side && (t.side = e.side),
  45809. void 0 !== e.opacity && (t.opacity = e.opacity),
  45810. void 0 !== e.transparent && (t.transparent = e.transparent),
  45811. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45812. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45813. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45814. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45815. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45816. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45817. void 0 !== e.size && (t.size = e.size),
  45818. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45819. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45820. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45821. t.transparent = !0),
  45822. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45823. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45824. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45825. void 0 !== e.normalScale) {
  45826. var i = e.normalScale;
  45827. !1 === Array.isArray(i) && (i = [i, i]),
  45828. t.normalScale = (new Ci.Vector2).fromArray(i)
  45829. }
  45830. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45831. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45832. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45833. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45834. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45835. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45836. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45837. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45838. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45839. t.combine = Ci.MultiplyOperation),
  45840. e.reflectivity && (t.reflectivity = e.reflectivity),
  45841. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45842. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45843. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45844. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45845. void 0 !== e.materials)
  45846. for (var n = 0, r = e.materials.length; n < r; n++)
  45847. t.materials.push(this.parse(e.materials[n]));
  45848. return t
  45849. }
  45850. },
  45851. Ci.ObjectLoader = function(e) {
  45852. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45853. this.texturePath = ""
  45854. }
  45855. ,
  45856. Ci.ObjectLoader.prototype = {
  45857. constructor: Ci.ObjectLoader,
  45858. load: function(e, t, i, n) {
  45859. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45860. var r = this;
  45861. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45862. r.parse(JSON.parse(e), t)
  45863. }, i, n)
  45864. },
  45865. setTexturePath: function(e) {
  45866. this.texturePath = e
  45867. },
  45868. setCrossOrigin: function(e) {
  45869. this.crossOrigin = e
  45870. },
  45871. parse: function(e, t) {
  45872. var i = this.parseGeometries(e.geometries)
  45873. , n = this.parseImages(e.images, function() {
  45874. void 0 !== t && t(a)
  45875. })
  45876. , r = this.parseTextures(e.textures, n)
  45877. , o = this.parseMaterials(e.materials, r)
  45878. , a = this.parseObject(e.object, i, o);
  45879. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45880. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45881. a
  45882. },
  45883. parseGeometries: function(e) {
  45884. var t = {};
  45885. if (void 0 !== e)
  45886. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45887. var a, s = e[r];
  45888. switch (s.type) {
  45889. case "PlaneGeometry":
  45890. case "PlaneBufferGeometry":
  45891. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45892. break;
  45893. case "BoxGeometry":
  45894. case "BoxBufferGeometry":
  45895. case "CubeGeometry":
  45896. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45897. break;
  45898. case "CircleGeometry":
  45899. case "CircleBufferGeometry":
  45900. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45901. break;
  45902. case "CylinderGeometry":
  45903. case "CylinderBufferGeometry":
  45904. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45905. break;
  45906. case "SphereGeometry":
  45907. case "SphereBufferGeometry":
  45908. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45909. break;
  45910. case "DodecahedronGeometry":
  45911. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45912. break;
  45913. case "IcosahedronGeometry":
  45914. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45915. break;
  45916. case "OctahedronGeometry":
  45917. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45918. break;
  45919. case "TetrahedronGeometry":
  45920. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45921. break;
  45922. case "RingGeometry":
  45923. case "RingBufferGeometry":
  45924. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45925. break;
  45926. case "TorusGeometry":
  45927. case "TorusBufferGeometry":
  45928. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45929. break;
  45930. case "TorusKnotGeometry":
  45931. case "TorusKnotBufferGeometry":
  45932. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45933. break;
  45934. case "LatheGeometry":
  45935. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45936. break;
  45937. case "BufferGeometry":
  45938. a = n.parse(s);
  45939. break;
  45940. case "Geometry":
  45941. a = i.parse(s.data, this.texturePath).geometry;
  45942. break;
  45943. default:
  45944. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45945. continue
  45946. }
  45947. a.uuid = s.uuid,
  45948. void 0 !== s.name && (a.name = s.name),
  45949. t[s.uuid] = a
  45950. }
  45951. return t
  45952. },
  45953. parseMaterials: function(e, t) {
  45954. var i = {};
  45955. if (void 0 !== e) {
  45956. var n = new Ci.MaterialLoader;
  45957. n.setTextures(t);
  45958. for (var r = 0, o = e.length; r < o; r++) {
  45959. var a = n.parse(e[r]);
  45960. i[a.uuid] = a
  45961. }
  45962. }
  45963. return i
  45964. },
  45965. parseAnimations: function(e) {
  45966. for (var t = [], i = 0; i < e.length; i++) {
  45967. var n = Ci.AnimationClip.parse(e[i]);
  45968. t.push(n)
  45969. }
  45970. return t
  45971. },
  45972. parseImages: function(e, t) {
  45973. function i(e) {
  45974. return n.manager.itemStart(e),
  45975. a.load(e, function() {
  45976. n.manager.itemEnd(e)
  45977. })
  45978. }
  45979. var n = this
  45980. , r = {};
  45981. if (void 0 !== e && 0 < e.length) {
  45982. var o = new Ci.LoadingManager(t)
  45983. , a = new Ci.ImageLoader(o);
  45984. a.setCrossOrigin(this.crossOrigin);
  45985. for (var s = 0, l = e.length; s < l; s++) {
  45986. var c = e[s]
  45987. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45988. r[c.uuid] = i(h)
  45989. }
  45990. }
  45991. return r
  45992. },
  45993. parseTextures: function(e, t) {
  45994. function i(e) {
  45995. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45996. Ci[e])
  45997. }
  45998. var n = {};
  45999. if (void 0 !== e)
  46000. for (var r = 0, o = e.length; r < o; r++) {
  46001. var a = e[r];
  46002. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46003. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46004. var s = new Ci.Texture(t[a.image]);
  46005. s.needsUpdate = !0,
  46006. s.uuid = a.uuid,
  46007. void 0 !== a.name && (s.name = a.name),
  46008. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46009. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46010. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46011. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46012. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46013. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46014. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46015. s.wrapT = i(a.wrap[1])),
  46016. n[a.uuid] = s
  46017. }
  46018. return n
  46019. },
  46020. parseObject: (ke = new Ci.Matrix4,
  46021. function(e, t, i) {
  46022. function n(e) {
  46023. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46024. t[e]
  46025. }
  46026. function r(e) {
  46027. if (void 0 !== e)
  46028. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46029. i[e]
  46030. }
  46031. var o;
  46032. switch (e.type) {
  46033. case "Scene":
  46034. o = new Ci.Scene;
  46035. break;
  46036. case "PerspectiveCamera":
  46037. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46038. break;
  46039. case "OrthographicCamera":
  46040. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46041. break;
  46042. case "AmbientLight":
  46043. o = new Ci.AmbientLight(e.color,e.intensity);
  46044. break;
  46045. case "DirectionalLight":
  46046. o = new Ci.DirectionalLight(e.color,e.intensity);
  46047. break;
  46048. case "PointLight":
  46049. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46050. break;
  46051. case "SpotLight":
  46052. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46053. break;
  46054. case "HemisphereLight":
  46055. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46056. break;
  46057. case "Mesh":
  46058. var a = n(e.geometry)
  46059. , s = r(e.material);
  46060. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46061. break;
  46062. case "LOD":
  46063. o = new Ci.LOD;
  46064. break;
  46065. case "Line":
  46066. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46067. break;
  46068. case "PointCloud":
  46069. case "Points":
  46070. o = new Ci.Points(n(e.geometry),r(e.material));
  46071. break;
  46072. case "Sprite":
  46073. o = new Ci.Sprite(r(e.material));
  46074. break;
  46075. case "Group":
  46076. o = new Ci.Group;
  46077. break;
  46078. default:
  46079. o = new Ci.Object3D
  46080. }
  46081. if (o.uuid = e.uuid,
  46082. void 0 !== e.name && (o.name = e.name),
  46083. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46084. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46085. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46086. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46087. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46088. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46089. void 0 !== e.visible && (o.visible = e.visible),
  46090. void 0 !== e.userData && (o.userData = e.userData),
  46091. void 0 !== e.children)
  46092. for (var l in e.children)
  46093. o.add(this.parseObject(e.children[l], t, i));
  46094. if ("LOD" === e.type)
  46095. for (var c = e.levels, h = 0; h < c.length; h++) {
  46096. var u = c[h];
  46097. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46098. }
  46099. return o
  46100. }
  46101. )
  46102. },
  46103. Ci.TextureLoader = function(e) {
  46104. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46105. }
  46106. ,
  46107. Ci.TextureLoader.prototype = {
  46108. constructor: Ci.TextureLoader,
  46109. load: function(e, t, i, n) {
  46110. var r = new Ci.Texture
  46111. , o = new Ci.ImageLoader(this.manager);
  46112. return o.setCrossOrigin(this.crossOrigin),
  46113. o.setPath(this.path),
  46114. o.load(e, function(e) {
  46115. r.image = e,
  46116. r.needsUpdate = !0,
  46117. void 0 !== t && t(r)
  46118. }, i, n),
  46119. r
  46120. },
  46121. setCrossOrigin: function(e) {
  46122. this.crossOrigin = e
  46123. },
  46124. setPath: function(e) {
  46125. this.path = e
  46126. }
  46127. },
  46128. Ci.CubeTextureLoader = function(e) {
  46129. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46130. }
  46131. ,
  46132. Ci.CubeTextureLoader.prototype = {
  46133. constructor: Ci.CubeTextureLoader,
  46134. load: function(e, i, t, n) {
  46135. function r(t) {
  46136. a.load(e[t], function(e) {
  46137. o.images[t] = e,
  46138. 6 === ++s && (o.needsUpdate = !0,
  46139. i && i(o))
  46140. }, void 0, n)
  46141. }
  46142. var o = new Ci.CubeTexture
  46143. , a = new Ci.ImageLoader(this.manager);
  46144. a.setCrossOrigin(this.crossOrigin),
  46145. a.setPath(this.path);
  46146. for (var s = 0, l = 0; l < e.length; ++l)
  46147. r(l);
  46148. return o
  46149. },
  46150. setCrossOrigin: function(e) {
  46151. this.crossOrigin = e
  46152. },
  46153. setPath: function(e) {
  46154. this.path = e
  46155. }
  46156. },
  46157. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46158. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46159. this._parser = null
  46160. }
  46161. ,
  46162. Ci.BinaryTextureLoader.prototype = {
  46163. constructor: Ci.BinaryTextureLoader,
  46164. load: function(e, i, t, n) {
  46165. var r = this
  46166. , o = new Ci.DataTexture
  46167. , a = new Ci.XHRLoader(this.manager);
  46168. return a.setResponseType("arraybuffer"),
  46169. a.load(e, function(e) {
  46170. var t = r._parser(e);
  46171. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46172. o.image.height = t.height,
  46173. o.image.data = t.data),
  46174. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46175. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46176. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46177. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46178. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46179. void 0 !== t.format && (o.format = t.format),
  46180. void 0 !== t.type && (o.type = t.type),
  46181. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46182. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46183. o.needsUpdate = !0,
  46184. i && i(o, t))
  46185. }, t, n),
  46186. o
  46187. }
  46188. },
  46189. Ci.CompressedTextureLoader = function(e) {
  46190. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46191. this._parser = null
  46192. }
  46193. ,
  46194. Ci.CompressedTextureLoader.prototype = {
  46195. constructor: Ci.CompressedTextureLoader,
  46196. load: function(e, o, t, n) {
  46197. function i(i) {
  46198. r.load(e[i], function(e) {
  46199. var t = a._parser(e, !0);
  46200. s[i] = {
  46201. width: t.width,
  46202. height: t.height,
  46203. format: t.format,
  46204. mipmaps: t.mipmaps
  46205. },
  46206. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46207. l.format = t.format,
  46208. l.needsUpdate = !0,
  46209. o && o(l))
  46210. }, t, n)
  46211. }
  46212. var a = this
  46213. , s = []
  46214. , l = new Ci.CompressedTexture;
  46215. l.image = s;
  46216. var r = new Ci.XHRLoader(this.manager);
  46217. if (r.setPath(this.path),
  46218. r.setResponseType("arraybuffer"),
  46219. Array.isArray(e))
  46220. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46221. i(h);
  46222. else
  46223. r.load(e, function(e) {
  46224. var t = a._parser(e, !0);
  46225. if (t.isCubemap)
  46226. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46227. s[n] = {
  46228. mipmaps: []
  46229. };
  46230. for (var r = 0; r < t.mipmapCount; r++)
  46231. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46232. s[n].format = t.format,
  46233. s[n].width = t.width,
  46234. s[n].height = t.height
  46235. }
  46236. else
  46237. l.image.width = t.width,
  46238. l.image.height = t.height,
  46239. l.mipmaps = t.mipmaps;
  46240. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46241. l.format = t.format,
  46242. l.needsUpdate = !0,
  46243. o && o(l)
  46244. }, t, n);
  46245. return l
  46246. },
  46247. setPath: function(e) {
  46248. this.path = e
  46249. }
  46250. },
  46251. Ci.Material = function() {
  46252. Object.defineProperty(this, "id", {
  46253. value: Ci.MaterialIdCount++
  46254. }),
  46255. this.uuid = Ci.Math.generateUUID(),
  46256. this.name = "",
  46257. this.type = "Material",
  46258. this.side = Ci.FrontSide,
  46259. this.opacity = 1,
  46260. this.transparent = !1,
  46261. this.blending = Ci.NormalBlending,
  46262. this.blendSrc = Ci.SrcAlphaFactor,
  46263. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46264. this.blendEquation = Ci.AddEquation,
  46265. this.blendSrcAlpha = null,
  46266. this.blendDstAlpha = null,
  46267. this.blendEquationAlpha = null,
  46268. this.depthFunc = Ci.LessEqualDepth,
  46269. this.depthTest = !0,
  46270. this.depthWrite = !0,
  46271. this.colorWrite = !0,
  46272. this.precision = null,
  46273. this.polygonOffset = !1,
  46274. this.polygonOffsetFactor = 0,
  46275. this.polygonOffsetUnits = 0,
  46276. this.alphaTest = 0,
  46277. this.premultipliedAlpha = !1,
  46278. this.overdraw = 0,
  46279. this.visible = !0,
  46280. this._needsUpdate = !0
  46281. }
  46282. ,
  46283. Ci.Material.prototype = {
  46284. constructor: Ci.Material,
  46285. get needsUpdate() {
  46286. return this._needsUpdate
  46287. },
  46288. set needsUpdate(e) {
  46289. !0 === e && this.update(),
  46290. this._needsUpdate = e
  46291. },
  46292. setValues: function(e) {
  46293. if (void 0 !== e)
  46294. for (var t in e) {
  46295. var i = e[t];
  46296. if (void 0 !== i) {
  46297. var n = this[t];
  46298. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46299. } else
  46300. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46301. }
  46302. },
  46303. toJSON: function(e) {
  46304. function t(e) {
  46305. var t = [];
  46306. for (var i in e) {
  46307. var n = e[i];
  46308. delete n.metadata,
  46309. t.push(n)
  46310. }
  46311. return t
  46312. }
  46313. var i = void 0 === e;
  46314. i && (e = {
  46315. textures: {},
  46316. images: {}
  46317. });
  46318. var n = {
  46319. metadata: {
  46320. version: 4.4,
  46321. type: "Material",
  46322. generator: "Material.toJSON"
  46323. }
  46324. };
  46325. if (n.uuid = this.uuid,
  46326. n.type = this.type,
  46327. "" !== this.name && (n.name = this.name),
  46328. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46329. .5 !== this.roughness && (n.roughness = this.roughness),
  46330. .5 !== this.metalness && (n.metalness = this.metalness),
  46331. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46332. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46333. void 0 !== this.shininess && (n.shininess = this.shininess),
  46334. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46335. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46336. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46337. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46338. n.bumpScale = this.bumpScale),
  46339. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46340. n.normalScale = this.normalScale.toArray()),
  46341. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46342. n.displacementScale = this.displacementScale,
  46343. n.displacementBias = this.displacementBias),
  46344. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46345. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46346. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46347. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46348. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46349. n.reflectivity = this.reflectivity),
  46350. void 0 !== this.size && (n.size = this.size),
  46351. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46352. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46353. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46354. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46355. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46356. this.opacity < 1 && (n.opacity = this.opacity),
  46357. !0 === this.transparent && (n.transparent = this.transparent),
  46358. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46359. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46360. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46361. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46362. i) {
  46363. var r = t(e.textures)
  46364. , o = t(e.images);
  46365. 0 < r.length && (n.textures = r),
  46366. 0 < o.length && (n.images = o)
  46367. }
  46368. return n
  46369. },
  46370. clone: function() {
  46371. return (new this.constructor).copy(this)
  46372. },
  46373. copy: function(e) {
  46374. return this.name = e.name,
  46375. this.side = e.side,
  46376. this.opacity = e.opacity,
  46377. this.transparent = e.transparent,
  46378. this.blending = e.blending,
  46379. this.blendSrc = e.blendSrc,
  46380. this.blendDst = e.blendDst,
  46381. this.blendEquation = e.blendEquation,
  46382. this.blendSrcAlpha = e.blendSrcAlpha,
  46383. this.blendDstAlpha = e.blendDstAlpha,
  46384. this.blendEquationAlpha = e.blendEquationAlpha,
  46385. this.depthFunc = e.depthFunc,
  46386. this.depthTest = e.depthTest,
  46387. this.depthWrite = e.depthWrite,
  46388. this.colorWrite = e.colorWrite,
  46389. this.precision = e.precision,
  46390. this.polygonOffset = e.polygonOffset,
  46391. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46392. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46393. this.alphaTest = e.alphaTest,
  46394. this.premultipliedAlpha = e.premultipliedAlpha,
  46395. this.overdraw = e.overdraw,
  46396. this.visible = e.visible,
  46397. this
  46398. },
  46399. update: function() {
  46400. this.dispatchEvent({
  46401. type: "update"
  46402. })
  46403. },
  46404. dispose: function() {
  46405. this.dispatchEvent({
  46406. type: "dispose"
  46407. })
  46408. }
  46409. },
  46410. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46411. Ci.MaterialIdCount = 0,
  46412. Ci.LineBasicMaterial = function(e) {
  46413. Ci.Material.call(this),
  46414. this.type = "LineBasicMaterial",
  46415. this.color = new Ci.Color(16777215),
  46416. this.linewidth = 1,
  46417. this.linecap = "round",
  46418. this.linejoin = "round",
  46419. this.blending = Ci.NormalBlending,
  46420. this.vertexColors = Ci.NoColors,
  46421. this.fog = !0,
  46422. this.setValues(e)
  46423. }
  46424. ,
  46425. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46426. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46427. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46428. return Ci.Material.prototype.copy.call(this, e),
  46429. this.color.copy(e.color),
  46430. this.linewidth = e.linewidth,
  46431. this.linecap = e.linecap,
  46432. this.linejoin = e.linejoin,
  46433. this.vertexColors = e.vertexColors,
  46434. this.fog = e.fog,
  46435. this
  46436. }
  46437. ,
  46438. Ci.LineDashedMaterial = function(e) {
  46439. Ci.Material.call(this),
  46440. this.type = "LineDashedMaterial",
  46441. this.color = new Ci.Color(16777215),
  46442. this.linewidth = 1,
  46443. this.scale = 1,
  46444. this.dashSize = 3,
  46445. this.gapSize = 1,
  46446. this.blending = Ci.NormalBlending,
  46447. this.vertexColors = Ci.NoColors,
  46448. this.fog = !0,
  46449. this.setValues(e)
  46450. }
  46451. ,
  46452. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46453. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46454. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46455. return Ci.Material.prototype.copy.call(this, e),
  46456. this.color.copy(e.color),
  46457. this.linewidth = e.linewidth,
  46458. this.scale = e.scale,
  46459. this.dashSize = e.dashSize,
  46460. this.gapSize = e.gapSize,
  46461. this.vertexColors = e.vertexColors,
  46462. this.fog = e.fog,
  46463. this
  46464. }
  46465. ,
  46466. Ci.MeshBasicMaterial = function(e) {
  46467. Ci.Material.call(this),
  46468. this.type = "MeshBasicMaterial",
  46469. this.color = new Ci.Color(16777215),
  46470. this.map = null,
  46471. this.aoMap = null,
  46472. this.aoMapIntensity = 1,
  46473. this.specularMap = null,
  46474. this.alphaMap = null,
  46475. this.envMap = null,
  46476. this.combine = Ci.MultiplyOperation,
  46477. this.reflectivity = 1,
  46478. this.refractionRatio = .98,
  46479. this.fog = !0,
  46480. this.shading = Ci.SmoothShading,
  46481. this.blending = Ci.NormalBlending,
  46482. this.wireframe = !1,
  46483. this.wireframeLinewidth = 1,
  46484. this.wireframeLinecap = "round",
  46485. this.wireframeLinejoin = "round",
  46486. this.vertexColors = Ci.NoColors,
  46487. this.skinning = !1,
  46488. this.morphTargets = !1,
  46489. this.setValues(e)
  46490. }
  46491. ,
  46492. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46493. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46494. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46495. return Ci.Material.prototype.copy.call(this, e),
  46496. this.color.copy(e.color),
  46497. this.map = e.map,
  46498. this.aoMap = e.aoMap,
  46499. this.aoMapIntensity = e.aoMapIntensity,
  46500. this.specularMap = e.specularMap,
  46501. this.alphaMap = e.alphaMap,
  46502. this.envMap = e.envMap,
  46503. this.combine = e.combine,
  46504. this.reflectivity = e.reflectivity,
  46505. this.refractionRatio = e.refractionRatio,
  46506. this.fog = e.fog,
  46507. this.shading = e.shading,
  46508. this.wireframe = e.wireframe,
  46509. this.wireframeLinewidth = e.wireframeLinewidth,
  46510. this.wireframeLinecap = e.wireframeLinecap,
  46511. this.wireframeLinejoin = e.wireframeLinejoin,
  46512. this.vertexColors = e.vertexColors,
  46513. this.skinning = e.skinning,
  46514. this.morphTargets = e.morphTargets,
  46515. this
  46516. }
  46517. ,
  46518. Ci.MeshLambertMaterial = function(e) {
  46519. Ci.Material.call(this),
  46520. this.type = "MeshLambertMaterial",
  46521. this.color = new Ci.Color(16777215),
  46522. this.map = null,
  46523. this.lightMap = null,
  46524. this.lightMapIntensity = 1,
  46525. this.aoMap = null,
  46526. this.aoMapIntensity = 1,
  46527. this.emissive = new Ci.Color(0),
  46528. this.emissiveIntensity = 1,
  46529. this.emissiveMap = null,
  46530. this.specularMap = null,
  46531. this.alphaMap = null,
  46532. this.envMap = null,
  46533. this.combine = Ci.MultiplyOperation,
  46534. this.reflectivity = 1,
  46535. this.refractionRatio = .98,
  46536. this.fog = !0,
  46537. this.blending = Ci.NormalBlending,
  46538. this.wireframe = !1,
  46539. this.wireframeLinewidth = 1,
  46540. this.wireframeLinecap = "round",
  46541. this.wireframeLinejoin = "round",
  46542. this.vertexColors = Ci.NoColors,
  46543. this.skinning = !1,
  46544. this.morphTargets = !1,
  46545. this.morphNormals = !1,
  46546. this.setValues(e)
  46547. }
  46548. ,
  46549. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46550. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46551. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46552. return Ci.Material.prototype.copy.call(this, e),
  46553. this.color.copy(e.color),
  46554. this.map = e.map,
  46555. this.lightMap = e.lightMap,
  46556. this.lightMapIntensity = e.lightMapIntensity,
  46557. this.aoMap = e.aoMap,
  46558. this.aoMapIntensity = e.aoMapIntensity,
  46559. this.emissive.copy(e.emissive),
  46560. this.emissiveMap = e.emissiveMap,
  46561. this.emissiveIntensity = e.emissiveIntensity,
  46562. this.specularMap = e.specularMap,
  46563. this.alphaMap = e.alphaMap,
  46564. this.envMap = e.envMap,
  46565. this.combine = e.combine,
  46566. this.reflectivity = e.reflectivity,
  46567. this.refractionRatio = e.refractionRatio,
  46568. this.fog = e.fog,
  46569. this.wireframe = e.wireframe,
  46570. this.wireframeLinewidth = e.wireframeLinewidth,
  46571. this.wireframeLinecap = e.wireframeLinecap,
  46572. this.wireframeLinejoin = e.wireframeLinejoin,
  46573. this.vertexColors = e.vertexColors,
  46574. this.skinning = e.skinning,
  46575. this.morphTargets = e.morphTargets,
  46576. this.morphNormals = e.morphNormals,
  46577. this
  46578. }
  46579. ,
  46580. Ci.MeshPhongMaterial = function(e) {
  46581. Ci.Material.call(this),
  46582. this.type = "MeshPhongMaterial",
  46583. this.color = new Ci.Color(16777215),
  46584. this.specular = new Ci.Color(1118481),
  46585. this.shininess = 30,
  46586. this.map = null,
  46587. this.lightMap = null,
  46588. this.lightMapIntensity = 1,
  46589. this.aoMap = null,
  46590. this.aoMapIntensity = 1,
  46591. this.emissive = new Ci.Color(0),
  46592. this.emissiveIntensity = 1,
  46593. this.emissiveMap = null,
  46594. this.bumpMap = null,
  46595. this.bumpScale = 1,
  46596. this.normalMap = null,
  46597. this.normalScale = new Ci.Vector2(1,1),
  46598. this.displacementMap = null,
  46599. this.displacementScale = 1,
  46600. this.displacementBias = 0,
  46601. this.specularMap = null,
  46602. this.alphaMap = null,
  46603. this.envMap = null,
  46604. this.combine = Ci.MultiplyOperation,
  46605. this.reflectivity = 1,
  46606. this.refractionRatio = .98,
  46607. this.fog = !0,
  46608. this.shading = Ci.SmoothShading,
  46609. this.blending = Ci.NormalBlending,
  46610. this.wireframe = !1,
  46611. this.wireframeLinewidth = 1,
  46612. this.wireframeLinecap = "round",
  46613. this.wireframeLinejoin = "round",
  46614. this.vertexColors = Ci.NoColors,
  46615. this.skinning = !1,
  46616. this.morphTargets = !1,
  46617. this.morphNormals = !1,
  46618. this.setValues(e)
  46619. }
  46620. ,
  46621. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46622. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46623. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46624. return Ci.Material.prototype.copy.call(this, e),
  46625. this.color.copy(e.color),
  46626. this.specular.copy(e.specular),
  46627. this.shininess = e.shininess,
  46628. this.map = e.map,
  46629. this.lightMap = e.lightMap,
  46630. this.lightMapIntensity = e.lightMapIntensity,
  46631. this.aoMap = e.aoMap,
  46632. this.aoMapIntensity = e.aoMapIntensity,
  46633. this.emissive.copy(e.emissive),
  46634. this.emissiveMap = e.emissiveMap,
  46635. this.emissiveIntensity = e.emissiveIntensity,
  46636. this.bumpMap = e.bumpMap,
  46637. this.bumpScale = e.bumpScale,
  46638. this.normalMap = e.normalMap,
  46639. this.normalScale.copy(e.normalScale),
  46640. this.displacementMap = e.displacementMap,
  46641. this.displacementScale = e.displacementScale,
  46642. this.displacementBias = e.displacementBias,
  46643. this.specularMap = e.specularMap,
  46644. this.alphaMap = e.alphaMap,
  46645. this.envMap = e.envMap,
  46646. this.combine = e.combine,
  46647. this.reflectivity = e.reflectivity,
  46648. this.refractionRatio = e.refractionRatio,
  46649. this.fog = e.fog,
  46650. this.shading = e.shading,
  46651. this.wireframe = e.wireframe,
  46652. this.wireframeLinewidth = e.wireframeLinewidth,
  46653. this.wireframeLinecap = e.wireframeLinecap,
  46654. this.wireframeLinejoin = e.wireframeLinejoin,
  46655. this.vertexColors = e.vertexColors,
  46656. this.skinning = e.skinning,
  46657. this.morphTargets = e.morphTargets,
  46658. this.morphNormals = e.morphNormals,
  46659. this
  46660. }
  46661. ,
  46662. Ci.MeshStandardMaterial = function(e) {
  46663. Ci.Material.call(this),
  46664. this.type = "MeshStandardMaterial",
  46665. this.color = new Ci.Color(16777215),
  46666. this.roughness = .5,
  46667. this.metalness = .5,
  46668. this.map = null,
  46669. this.lightMap = null,
  46670. this.lightMapIntensity = 1,
  46671. this.aoMap = null,
  46672. this.aoMapIntensity = 1,
  46673. this.emissive = new Ci.Color(0),
  46674. this.emissiveIntensity = 1,
  46675. this.emissiveMap = null,
  46676. this.bumpMap = null,
  46677. this.bumpScale = 1,
  46678. this.normalMap = null,
  46679. this.normalScale = new Ci.Vector2(1,1),
  46680. this.displacementMap = null,
  46681. this.displacementScale = 1,
  46682. this.displacementBias = 0,
  46683. this.roughnessMap = null,
  46684. this.metalnessMap = null,
  46685. this.alphaMap = null,
  46686. this.envMap = null,
  46687. this.envMapIntensity = 1,
  46688. this.refractionRatio = .98,
  46689. this.fog = !0,
  46690. this.shading = Ci.SmoothShading,
  46691. this.blending = Ci.NormalBlending,
  46692. this.wireframe = !1,
  46693. this.wireframeLinewidth = 1,
  46694. this.wireframeLinecap = "round",
  46695. this.wireframeLinejoin = "round",
  46696. this.vertexColors = Ci.NoColors,
  46697. this.skinning = !1,
  46698. this.morphTargets = !1,
  46699. this.morphNormals = !1,
  46700. this.setValues(e)
  46701. }
  46702. ,
  46703. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46704. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46705. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46706. return Ci.Material.prototype.copy.call(this, e),
  46707. this.color.copy(e.color),
  46708. this.roughness = e.roughness,
  46709. this.metalness = e.metalness,
  46710. this.map = e.map,
  46711. this.lightMap = e.lightMap,
  46712. this.lightMapIntensity = e.lightMapIntensity,
  46713. this.aoMap = e.aoMap,
  46714. this.aoMapIntensity = e.aoMapIntensity,
  46715. this.emissive.copy(e.emissive),
  46716. this.emissiveMap = e.emissiveMap,
  46717. this.emissiveIntensity = e.emissiveIntensity,
  46718. this.bumpMap = e.bumpMap,
  46719. this.bumpScale = e.bumpScale,
  46720. this.normalMap = e.normalMap,
  46721. this.normalScale.copy(e.normalScale),
  46722. this.displacementMap = e.displacementMap,
  46723. this.displacementScale = e.displacementScale,
  46724. this.displacementBias = e.displacementBias,
  46725. this.roughnessMap = e.roughnessMap,
  46726. this.metalnessMap = e.metalnessMap,
  46727. this.alphaMap = e.alphaMap,
  46728. this.envMap = e.envMap,
  46729. this.envMapIntensity = e.envMapIntensity,
  46730. this.refractionRatio = e.refractionRatio,
  46731. this.fog = e.fog,
  46732. this.shading = e.shading,
  46733. this.wireframe = e.wireframe,
  46734. this.wireframeLinewidth = e.wireframeLinewidth,
  46735. this.wireframeLinecap = e.wireframeLinecap,
  46736. this.wireframeLinejoin = e.wireframeLinejoin,
  46737. this.vertexColors = e.vertexColors,
  46738. this.skinning = e.skinning,
  46739. this.morphTargets = e.morphTargets,
  46740. this.morphNormals = e.morphNormals,
  46741. this
  46742. }
  46743. ,
  46744. Ci.MeshDepthMaterial = function(e) {
  46745. Ci.Material.call(this),
  46746. this.type = "MeshDepthMaterial",
  46747. this.morphTargets = !1,
  46748. this.wireframe = !1,
  46749. this.wireframeLinewidth = 1,
  46750. this.setValues(e)
  46751. }
  46752. ,
  46753. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46754. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46755. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46756. return Ci.Material.prototype.copy.call(this, e),
  46757. this.wireframe = e.wireframe,
  46758. this.wireframeLinewidth = e.wireframeLinewidth,
  46759. this
  46760. }
  46761. ,
  46762. Ci.MeshNormalMaterial = function(e) {
  46763. Ci.Material.call(this, e),
  46764. this.type = "MeshNormalMaterial",
  46765. this.wireframe = !1,
  46766. this.wireframeLinewidth = 1,
  46767. this.morphTargets = !1,
  46768. this.setValues(e)
  46769. }
  46770. ,
  46771. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46772. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46773. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46774. return Ci.Material.prototype.copy.call(this, e),
  46775. this.wireframe = e.wireframe,
  46776. this.wireframeLinewidth = e.wireframeLinewidth,
  46777. this
  46778. }
  46779. ,
  46780. Ci.MultiMaterial = function(e) {
  46781. this.uuid = Ci.Math.generateUUID(),
  46782. this.type = "MultiMaterial",
  46783. this.materials = e instanceof Array ? e : [],
  46784. this.visible = !0
  46785. }
  46786. ,
  46787. Ci.MultiMaterial.prototype = {
  46788. constructor: Ci.MultiMaterial,
  46789. toJSON: function(e) {
  46790. for (var t = {
  46791. metadata: {
  46792. version: 4.2,
  46793. type: "material",
  46794. generator: "MaterialExporter"
  46795. },
  46796. uuid: this.uuid,
  46797. type: this.type,
  46798. materials: []
  46799. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46800. var o = i[n].toJSON(e);
  46801. delete o.metadata,
  46802. t.materials.push(o)
  46803. }
  46804. return t.visible = this.visible,
  46805. t
  46806. },
  46807. clone: function() {
  46808. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46809. e.materials.push(this.materials[t].clone());
  46810. return e.visible = this.visible,
  46811. e
  46812. }
  46813. },
  46814. Ci.PointsMaterial = function(e) {
  46815. Ci.Material.call(this),
  46816. this.type = "PointsMaterial",
  46817. this.color = new Ci.Color(16777215),
  46818. this.map = null,
  46819. this.size = 1,
  46820. this.sizeAttenuation = !0,
  46821. this.blending = Ci.NormalBlending,
  46822. this.vertexColors = Ci.NoColors,
  46823. this.fog = !0,
  46824. this.setValues(e)
  46825. }
  46826. ,
  46827. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46828. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46829. Ci.PointsMaterial.prototype.copy = function(e) {
  46830. return Ci.Material.prototype.copy.call(this, e),
  46831. this.color.copy(e.color),
  46832. this.map = e.map,
  46833. this.size = e.size,
  46834. this.sizeAttenuation = e.sizeAttenuation,
  46835. this.vertexColors = e.vertexColors,
  46836. this.fog = e.fog,
  46837. this
  46838. }
  46839. ,
  46840. Ci.ShaderMaterial = function(e) {
  46841. Ci.Material.call(this),
  46842. this.type = "ShaderMaterial",
  46843. this.defines = {},
  46844. this.uniforms = {},
  46845. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46846. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46847. this.shading = Ci.SmoothShading,
  46848. this.linewidth = 1,
  46849. this.wireframe = !1,
  46850. this.wireframeLinewidth = 1,
  46851. this.fog = !1,
  46852. this.lights = !1,
  46853. this.vertexColors = Ci.NoColors,
  46854. this.skinning = !1,
  46855. this.morphTargets = !1,
  46856. this.morphNormals = !1,
  46857. this.extensions = {
  46858. derivatives: !1,
  46859. fragDepth: !1,
  46860. drawBuffers: !1,
  46861. shaderTextureLOD: !1
  46862. },
  46863. this.defaultAttributeValues = {
  46864. color: [1, 1, 1],
  46865. uv: [0, 0],
  46866. uv2: [0, 0]
  46867. },
  46868. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46869. this.setValues(e))
  46870. }
  46871. ,
  46872. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46873. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46874. Ci.ShaderMaterial.prototype.copy = function(e) {
  46875. return Ci.Material.prototype.copy.call(this, e),
  46876. this.fragmentShader = e.fragmentShader,
  46877. this.vertexShader = e.vertexShader,
  46878. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46879. this.defines = e.defines,
  46880. this.shading = e.shading,
  46881. this.wireframe = e.wireframe,
  46882. this.wireframeLinewidth = e.wireframeLinewidth,
  46883. this.fog = e.fog,
  46884. this.lights = e.lights,
  46885. this.vertexColors = e.vertexColors,
  46886. this.skinning = e.skinning,
  46887. this.morphTargets = e.morphTargets,
  46888. this.morphNormals = e.morphNormals,
  46889. this.extensions = e.extensions,
  46890. this
  46891. }
  46892. ,
  46893. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46894. var t = Ci.Material.prototype.toJSON.call(this, e);
  46895. return t.uniforms = this.uniforms,
  46896. t.vertexShader = this.vertexShader,
  46897. t.fragmentShader = this.fragmentShader,
  46898. t
  46899. }
  46900. ,
  46901. Ci.RawShaderMaterial = function(e) {
  46902. Ci.ShaderMaterial.call(this, e),
  46903. this.type = "RawShaderMaterial"
  46904. }
  46905. ,
  46906. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46907. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46908. Ci.SpriteMaterial = function(e) {
  46909. Ci.Material.call(this),
  46910. this.type = "SpriteMaterial",
  46911. this.color = new Ci.Color(16777215),
  46912. this.map = null,
  46913. this.rotation = 0,
  46914. this.fog = !1,
  46915. this.setValues(e)
  46916. }
  46917. ,
  46918. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46919. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46920. Ci.SpriteMaterial.prototype.copy = function(e) {
  46921. return Ci.Material.prototype.copy.call(this, e),
  46922. this.color.copy(e.color),
  46923. this.map = e.map,
  46924. this.rotation = e.rotation,
  46925. this.fog = e.fog,
  46926. this
  46927. }
  46928. ,
  46929. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46930. Object.defineProperty(this, "id", {
  46931. value: Ci.TextureIdCount++
  46932. }),
  46933. this.uuid = Ci.Math.generateUUID(),
  46934. this.name = "",
  46935. this.sourceFile = "",
  46936. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46937. this.mipmaps = [],
  46938. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46939. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46940. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46941. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46942. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46943. this.anisotropy = void 0 !== l ? l : 1,
  46944. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46945. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46946. this.offset = new Ci.Vector2(0,0),
  46947. this.repeat = new Ci.Vector2(1,1),
  46948. this.generateMipmaps = !0,
  46949. this.premultiplyAlpha = !1,
  46950. this.flipY = !0,
  46951. this.unpackAlignment = 4,
  46952. this.encoding = Ci.LinearEncoding,
  46953. this.version = 0,
  46954. this.onUpdate = null
  46955. }
  46956. ,
  46957. Ci.Texture.DEFAULT_IMAGE = void 0,
  46958. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46959. Ci.Texture.prototype = {
  46960. constructor: Ci.Texture,
  46961. set needsUpdate(e) {
  46962. !0 === e && this.version++
  46963. },
  46964. clone: function() {
  46965. return (new this.constructor).copy(this)
  46966. },
  46967. copy: function(e) {
  46968. return this.image = e.image,
  46969. this.mipmaps = e.mipmaps.slice(0),
  46970. this.mapping = e.mapping,
  46971. this.wrapS = e.wrapS,
  46972. this.wrapT = e.wrapT,
  46973. this.magFilter = e.magFilter,
  46974. this.minFilter = e.minFilter,
  46975. this.anisotropy = e.anisotropy,
  46976. this.format = e.format,
  46977. this.type = e.type,
  46978. this.offset.copy(e.offset),
  46979. this.repeat.copy(e.repeat),
  46980. this.generateMipmaps = e.generateMipmaps,
  46981. this.premultiplyAlpha = e.premultiplyAlpha,
  46982. this.flipY = e.flipY,
  46983. this.unpackAlignment = e.unpackAlignment,
  46984. this.encoding = e.encoding,
  46985. this
  46986. },
  46987. toJSON: function(e) {
  46988. if (void 0 !== e.textures[this.uuid])
  46989. return e.textures[this.uuid];
  46990. var t, i, n = {
  46991. metadata: {
  46992. version: 4.4,
  46993. type: "Texture",
  46994. generator: "Texture.toJSON"
  46995. },
  46996. uuid: this.uuid,
  46997. name: this.name,
  46998. mapping: this.mapping,
  46999. repeat: [this.repeat.x, this.repeat.y],
  47000. offset: [this.offset.x, this.offset.y],
  47001. wrap: [this.wrapS, this.wrapT],
  47002. minFilter: this.minFilter,
  47003. magFilter: this.magFilter,
  47004. anisotropy: this.anisotropy
  47005. };
  47006. if (void 0 !== this.image) {
  47007. var r = this.image;
  47008. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47009. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47010. uuid: r.uuid,
  47011. url: (t = r,
  47012. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47013. i.height = t.height,
  47014. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47015. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47016. }),
  47017. n.image = r.uuid
  47018. }
  47019. return e.textures[this.uuid] = n
  47020. },
  47021. dispose: function() {
  47022. this.dispatchEvent({
  47023. type: "dispose"
  47024. })
  47025. },
  47026. transformUv: function(e) {
  47027. if (this.mapping === Ci.UVMapping) {
  47028. if (e.multiply(this.repeat),
  47029. e.add(this.offset),
  47030. e.x < 0 || 1 < e.x)
  47031. switch (this.wrapS) {
  47032. case Ci.RepeatWrapping:
  47033. e.x = e.x - Math.floor(e.x);
  47034. break;
  47035. case Ci.ClampToEdgeWrapping:
  47036. e.x = e.x < 0 ? 0 : 1;
  47037. break;
  47038. case Ci.MirroredRepeatWrapping:
  47039. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47040. }
  47041. if (e.y < 0 || 1 < e.y)
  47042. switch (this.wrapT) {
  47043. case Ci.RepeatWrapping:
  47044. e.y = e.y - Math.floor(e.y);
  47045. break;
  47046. case Ci.ClampToEdgeWrapping:
  47047. e.y = e.y < 0 ? 0 : 1;
  47048. break;
  47049. case Ci.MirroredRepeatWrapping:
  47050. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47051. }
  47052. this.flipY && (e.y = 1 - e.y)
  47053. }
  47054. }
  47055. },
  47056. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47057. Ci.TextureIdCount = 0,
  47058. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47059. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47060. this.needsUpdate = !0
  47061. }
  47062. ,
  47063. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47064. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47065. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47066. e = void 0 !== e ? e : [],
  47067. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47068. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47069. this.flipY = !1
  47070. }
  47071. ,
  47072. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47073. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47074. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47075. get: function() {
  47076. return this.image
  47077. },
  47078. set: function(e) {
  47079. this.image = e
  47080. }
  47081. }),
  47082. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47083. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47084. this.image = {
  47085. width: t,
  47086. height: i
  47087. },
  47088. this.mipmaps = e,
  47089. this.flipY = !1,
  47090. this.generateMipmaps = !1
  47091. }
  47092. ,
  47093. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47094. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47095. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47096. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47097. this.image = {
  47098. data: e,
  47099. width: t,
  47100. height: i
  47101. },
  47102. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47103. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47104. this.flipY = !1,
  47105. this.generateMipmaps = !1
  47106. }
  47107. ,
  47108. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47109. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47110. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47111. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47112. this.generateMipmaps = !1;
  47113. var c = this;
  47114. !function e() {
  47115. requestAnimationFrame(e),
  47116. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47117. }()
  47118. }
  47119. ,
  47120. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47121. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47122. Ci.Group = function() {
  47123. Ci.Object3D.call(this),
  47124. this.type = "Group"
  47125. }
  47126. ,
  47127. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47128. Ci.Group.prototype.constructor = Ci.Group,
  47129. Ci.Points = function(e, t) {
  47130. Ci.Object3D.call(this),
  47131. this.type = "Points",
  47132. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47133. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47134. color: 16777215 * Math.random()
  47135. })
  47136. }
  47137. ,
  47138. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47139. Ci.Points.prototype.constructor = Ci.Points,
  47140. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47141. jt = new Ci.Ray,
  47142. Yt = new Ci.Sphere,
  47143. function(o, a) {
  47144. function e(e, t) {
  47145. var i = jt.distanceSqToPoint(e);
  47146. if (i < c) {
  47147. var n = jt.closestPointToPoint(e);
  47148. n.applyMatrix4(l);
  47149. var r = o.ray.origin.distanceTo(n);
  47150. if (r < o.near || r > o.far)
  47151. return;
  47152. a.push({
  47153. distance: r,
  47154. distanceToRay: Math.sqrt(i),
  47155. point: n.clone(),
  47156. index: t,
  47157. face: null,
  47158. object: s
  47159. })
  47160. }
  47161. }
  47162. var s = this
  47163. , t = this.geometry
  47164. , l = this.matrixWorld
  47165. , i = o.params.Points.threshold;
  47166. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47167. Yt.copy(t.boundingSphere),
  47168. Yt.applyMatrix4(l),
  47169. !1 !== o.ray.intersectsSphere(Yt)) {
  47170. Wt.getInverse(l),
  47171. jt.copy(o.ray).applyMatrix4(Wt);
  47172. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47173. , c = n * n
  47174. , r = new Ci.Vector3;
  47175. if (t instanceof Ci.BufferGeometry) {
  47176. var h = t.index
  47177. , u = t.attributes.position.array;
  47178. if (null !== h)
  47179. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47180. var g = d[p];
  47181. r.fromArray(u, 3 * g),
  47182. e(r, g)
  47183. }
  47184. else {
  47185. p = 0;
  47186. for (var m = u.length / 3; p < m; p++)
  47187. r.fromArray(u, 3 * p),
  47188. e(r, p)
  47189. }
  47190. } else {
  47191. var v = t.vertices;
  47192. for (p = 0,
  47193. m = v.length; p < m; p++)
  47194. e(v[p], p)
  47195. }
  47196. }
  47197. }
  47198. ),
  47199. Ci.Points.prototype.clone = function() {
  47200. return new this.constructor(this.geometry,this.material).copy(this)
  47201. }
  47202. ,
  47203. Ci.Line = function(e, t, i) {
  47204. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47205. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47206. this.type = "Line",
  47207. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47208. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47209. color: 16777215 * Math.random()
  47210. })))
  47211. }
  47212. ,
  47213. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47214. Ci.Line.prototype.constructor = Ci.Line,
  47215. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47216. zt = new Ci.Ray,
  47217. Gt = new Ci.Sphere,
  47218. function(e, t) {
  47219. var i = e.linePrecision
  47220. , n = i * i
  47221. , r = this.geometry
  47222. , o = this.matrixWorld;
  47223. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47224. Gt.copy(r.boundingSphere),
  47225. Gt.applyMatrix4(o),
  47226. !1 !== e.ray.intersectsSphere(Gt)) {
  47227. Ht.getInverse(o),
  47228. zt.copy(e.ray).applyMatrix4(Ht);
  47229. var a = new Ci.Vector3
  47230. , s = new Ci.Vector3
  47231. , l = new Ci.Vector3
  47232. , c = new Ci.Vector3
  47233. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47234. if (r instanceof Ci.BufferGeometry) {
  47235. var u = r.index
  47236. , d = r.attributes.position.array;
  47237. if (null !== u)
  47238. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47239. var m = p[f]
  47240. , v = p[f + 1];
  47241. a.fromArray(d, 3 * m),
  47242. s.fromArray(d, 3 * v),
  47243. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47244. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47245. distance: C,
  47246. point: l.clone().applyMatrix4(this.matrixWorld),
  47247. index: f,
  47248. face: null,
  47249. faceIndex: null,
  47250. object: this
  47251. }))
  47252. }
  47253. else
  47254. for (f = 0,
  47255. g = d.length / 3 - 1; f < g; f += h)
  47256. a.fromArray(d, 3 * f),
  47257. s.fromArray(d, 3 * f + 3),
  47258. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47259. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47260. distance: C,
  47261. point: l.clone().applyMatrix4(this.matrixWorld),
  47262. index: f,
  47263. face: null,
  47264. faceIndex: null,
  47265. object: this
  47266. }))
  47267. } else if (r instanceof Ci.Geometry) {
  47268. var y = r.vertices
  47269. , A = y.length;
  47270. for (f = 0; f < A - 1; f += h) {
  47271. var C;
  47272. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47273. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47274. distance: C,
  47275. point: l.clone().applyMatrix4(this.matrixWorld),
  47276. index: f,
  47277. face: null,
  47278. faceIndex: null,
  47279. object: this
  47280. }))
  47281. }
  47282. }
  47283. }
  47284. }
  47285. ),
  47286. Ci.Line.prototype.clone = function() {
  47287. return new this.constructor(this.geometry,this.material).copy(this)
  47288. }
  47289. ,
  47290. Ci.LineStrip = 0,
  47291. Ci.LinePieces = 1,
  47292. Ci.LineSegments = function(e, t) {
  47293. Ci.Line.call(this, e, t),
  47294. this.type = "LineSegments"
  47295. }
  47296. ,
  47297. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47298. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47299. Ci.Mesh = function(e, t) {
  47300. Ci.Object3D.call(this),
  47301. this.type = "Mesh",
  47302. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47303. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47304. color: 16777215 * Math.random()
  47305. }),
  47306. this.drawMode = Ci.TrianglesDrawMode,
  47307. this.updateMorphTargets()
  47308. }
  47309. ,
  47310. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47311. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47312. Ci.Mesh.prototype.setDrawMode = function(e) {
  47313. this.drawMode = e
  47314. }
  47315. ,
  47316. Ci.Mesh.prototype.updateMorphTargets = function() {
  47317. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47318. this.morphTargetBase = -1,
  47319. this.morphTargetInfluences = [],
  47320. this.morphTargetDictionary = {};
  47321. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47322. this.morphTargetInfluences.push(0),
  47323. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47324. }
  47325. }
  47326. ,
  47327. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47328. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47329. 0)
  47330. }
  47331. ,
  47332. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47333. xt = new Ci.Ray,
  47334. St = new Ci.Sphere,
  47335. Mt = new Ci.Vector3,
  47336. Rt = new Ci.Vector3,
  47337. Pt = new Ci.Vector3,
  47338. Ot = new Ci.Vector3,
  47339. Lt = new Ci.Vector3,
  47340. Dt = new Ci.Vector3,
  47341. Nt = new Ci.Vector2,
  47342. Ft = new Ci.Vector2,
  47343. Bt = new Ci.Vector2,
  47344. Vt = new Ci.Vector3,
  47345. kt = new Ci.Vector3,
  47346. Ut = new Ci.Vector3,
  47347. function(e, t) {
  47348. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47349. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47350. St.copy(r.boundingSphere),
  47351. St.applyMatrix4(a),
  47352. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47353. xt.copy(e.ray).applyMatrix4(Tt),
  47354. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47355. if (r instanceof Ci.BufferGeometry) {
  47356. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47357. if (void 0 !== u.uv && (i = u.uv.array),
  47358. null !== h)
  47359. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47360. s = p[f],
  47361. l = p[f + 1],
  47362. c = p[f + 2],
  47363. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47364. t.push(n));
  47365. else
  47366. for (f = 0,
  47367. g = d.length; f < g; f += 9)
  47368. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47369. t.push(n))
  47370. } else if (r instanceof Ci.Geometry) {
  47371. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47372. 0 < _.length && (i = _);
  47373. for (var b = 0, w = E.length; b < w; b++) {
  47374. var T = E[b]
  47375. , x = 1 == A ? C[T.materialIndex] : o;
  47376. if (void 0 !== x) {
  47377. if (m = I[T.a],
  47378. v = I[T.b],
  47379. y = I[T.c],
  47380. !0 === x.morphTargets) {
  47381. var S = r.morphTargets
  47382. , M = this.morphTargetInfluences;
  47383. Mt.set(0, 0, 0),
  47384. Rt.set(0, 0, 0),
  47385. Pt.set(0, 0, 0);
  47386. for (var R = 0, P = S.length; R < P; R++) {
  47387. var O = M[R];
  47388. if (0 !== O) {
  47389. var L = S[R].vertices;
  47390. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47391. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47392. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47393. }
  47394. }
  47395. Mt.add(m),
  47396. Rt.add(v),
  47397. Pt.add(y),
  47398. m = Mt,
  47399. v = Rt,
  47400. y = Pt
  47401. }
  47402. if (n = wi(this, e, xt, m, v, y, kt)) {
  47403. if (i) {
  47404. var D = i[b];
  47405. Nt.copy(D[0]),
  47406. Ft.copy(D[1]),
  47407. Bt.copy(D[2]),
  47408. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47409. }
  47410. n.face = T,
  47411. n.faceIndex = b,
  47412. t.push(n)
  47413. }
  47414. }
  47415. }
  47416. }
  47417. }
  47418. ),
  47419. Ci.Mesh.prototype.clone = function() {
  47420. return new this.constructor(this.geometry,this.material).copy(this)
  47421. }
  47422. ,
  47423. Ci.Bone = function(e) {
  47424. Ci.Object3D.call(this),
  47425. this.type = "Bone",
  47426. this.skin = e
  47427. }
  47428. ,
  47429. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47430. Ci.Bone.prototype.constructor = Ci.Bone,
  47431. Ci.Bone.prototype.copy = function(e) {
  47432. return Ci.Object3D.prototype.copy.call(this, e),
  47433. this.skin = e.skin,
  47434. this
  47435. }
  47436. ,
  47437. Ci.Skeleton = function(e, t, i) {
  47438. if (this.useVertexTexture = void 0 === i || i,
  47439. this.identityMatrix = new Ci.Matrix4,
  47440. e = e || [],
  47441. this.bones = e.slice(0),
  47442. this.useVertexTexture) {
  47443. var n = Math.sqrt(4 * this.bones.length);
  47444. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47445. n = Math.max(n, 4),
  47446. this.boneTextureWidth = n,
  47447. this.boneTextureHeight = n,
  47448. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47449. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47450. } else
  47451. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47452. if (void 0 === t)
  47453. this.calculateInverses();
  47454. else if (this.bones.length === t.length)
  47455. this.boneInverses = t.slice(0);
  47456. else {
  47457. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47458. this.boneInverses = [];
  47459. for (var r = 0, o = this.bones.length; r < o; r++)
  47460. this.boneInverses.push(new Ci.Matrix4)
  47461. }
  47462. }
  47463. ,
  47464. Ci.Skeleton.prototype.calculateInverses = function() {
  47465. this.boneInverses = [];
  47466. for (var e = 0, t = this.bones.length; e < t; e++) {
  47467. var i = new Ci.Matrix4;
  47468. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47469. this.boneInverses.push(i)
  47470. }
  47471. }
  47472. ,
  47473. Ci.Skeleton.prototype.pose = function() {
  47474. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47475. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47476. for (t = 0,
  47477. i = this.bones.length; t < i; t++)
  47478. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47479. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47480. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47481. }
  47482. ,
  47483. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47484. function() {
  47485. for (var e = 0, t = this.bones.length; e < t; e++) {
  47486. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47487. wt.multiplyMatrices(i, this.boneInverses[e]),
  47488. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47489. }
  47490. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47491. }
  47492. ),
  47493. Ci.Skeleton.prototype.clone = function() {
  47494. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47495. }
  47496. ,
  47497. Ci.SkinnedMesh = function(e, t, i) {
  47498. Ci.Mesh.call(this, e, t),
  47499. this.type = "SkinnedMesh",
  47500. this.bindMode = "attached",
  47501. this.bindMatrix = new Ci.Matrix4,
  47502. this.bindMatrixInverse = new Ci.Matrix4;
  47503. var n = [];
  47504. if (this.geometry && void 0 !== this.geometry.bones) {
  47505. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47506. o = this.geometry.bones[a],
  47507. r = new Ci.Bone(this),
  47508. n.push(r),
  47509. r.name = o.name,
  47510. r.position.fromArray(o.pos),
  47511. r.quaternion.fromArray(o.rotq),
  47512. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47513. for (a = 0,
  47514. s = this.geometry.bones.length; a < s; ++a)
  47515. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47516. }
  47517. this.normalizeSkinWeights(),
  47518. this.updateMatrixWorld(!0),
  47519. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47520. }
  47521. ,
  47522. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47523. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47524. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47525. this.skeleton = e,
  47526. void 0 === t && (this.updateMatrixWorld(!0),
  47527. this.skeleton.calculateInverses(),
  47528. t = this.matrixWorld),
  47529. this.bindMatrix.copy(t),
  47530. this.bindMatrixInverse.getInverse(t)
  47531. }
  47532. ,
  47533. Ci.SkinnedMesh.prototype.pose = function() {
  47534. this.skeleton.pose()
  47535. }
  47536. ,
  47537. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47538. if (this.geometry instanceof Ci.Geometry)
  47539. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47540. var t = this.geometry.skinWeights[e];
  47541. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47542. }
  47543. else if (this.geometry instanceof Ci.BufferGeometry) {
  47544. var i = new Ci.Vector4
  47545. , n = this.geometry.attributes.skinWeight;
  47546. for (e = 0; e < n.count; e++) {
  47547. var r;
  47548. i.x = n.getX(e),
  47549. i.y = n.getY(e),
  47550. i.z = n.getZ(e),
  47551. i.w = n.getW(e),
  47552. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47553. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47554. }
  47555. }
  47556. }
  47557. ,
  47558. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47559. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47560. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47561. }
  47562. ,
  47563. Ci.SkinnedMesh.prototype.clone = function() {
  47564. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47565. }
  47566. ,
  47567. Ci.LOD = function() {
  47568. Ci.Object3D.call(this),
  47569. this.type = "LOD",
  47570. Object.defineProperties(this, {
  47571. levels: {
  47572. enumerable: !0,
  47573. value: []
  47574. },
  47575. objects: {
  47576. get: function() {
  47577. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47578. this.levels
  47579. }
  47580. }
  47581. })
  47582. }
  47583. ,
  47584. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47585. Ci.LOD.prototype.constructor = Ci.LOD,
  47586. Ci.LOD.prototype.addLevel = function(e, t) {
  47587. void 0 === t && (t = 0),
  47588. t = Math.abs(t);
  47589. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47590. ;
  47591. i.splice(n, 0, {
  47592. distance: t,
  47593. object: e
  47594. }),
  47595. this.add(e)
  47596. }
  47597. ,
  47598. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47599. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47600. ;
  47601. return t[i - 1].object
  47602. }
  47603. ,
  47604. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47605. function(e, t) {
  47606. bt.setFromMatrixPosition(this.matrixWorld);
  47607. var i = e.ray.origin.distanceTo(bt);
  47608. this.getObjectForDistance(i).raycast(e, t)
  47609. }
  47610. ),
  47611. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47612. _t = new Ci.Vector3,
  47613. function(e) {
  47614. var t = this.levels;
  47615. if (1 < t.length) {
  47616. Et.setFromMatrixPosition(e.matrixWorld),
  47617. _t.setFromMatrixPosition(this.matrixWorld);
  47618. var i = Et.distanceTo(_t);
  47619. t[0].object.visible = !0;
  47620. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47621. t[n - 1].object.visible = !1,
  47622. t[n].object.visible = !0;
  47623. for (; n < r; n++)
  47624. t[n].object.visible = !1
  47625. }
  47626. }
  47627. ),
  47628. Ci.LOD.prototype.copy = function(e) {
  47629. Ci.Object3D.prototype.copy.call(this, e, !1);
  47630. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47631. var r = t[i];
  47632. this.addLevel(r.object.clone(), r.distance)
  47633. }
  47634. return this
  47635. }
  47636. ,
  47637. Ci.LOD.prototype.toJSON = function(e) {
  47638. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47639. t.object.levels = [];
  47640. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47641. var o = i[n];
  47642. t.object.levels.push({
  47643. object: o.object.uuid,
  47644. distance: o.distance
  47645. })
  47646. }
  47647. return t
  47648. }
  47649. ,
  47650. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47651. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47652. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47653. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47654. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47655. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47656. function(e) {
  47657. Ci.Object3D.call(this),
  47658. this.type = "Sprite",
  47659. this.geometry = It,
  47660. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47661. }
  47662. ),
  47663. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47664. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47665. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47666. function(e, t) {
  47667. vt.setFromMatrixPosition(this.matrixWorld);
  47668. var i = e.ray.distanceSqToPoint(vt);
  47669. this.scale.x * this.scale.y < i || t.push({
  47670. distance: Math.sqrt(i),
  47671. point: this.position,
  47672. face: null,
  47673. object: this
  47674. })
  47675. }
  47676. ),
  47677. Ci.Sprite.prototype.clone = function() {
  47678. return new this.constructor(this.material).copy(this)
  47679. }
  47680. ,
  47681. Ci.Particle = Ci.Sprite,
  47682. Ci.LensFlare = function(e, t, i, n, r) {
  47683. Ci.Object3D.call(this),
  47684. this.lensFlares = [],
  47685. this.positionScreen = new Ci.Vector3,
  47686. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47687. }
  47688. ,
  47689. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47690. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47691. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47692. void 0 === t && (t = -1),
  47693. void 0 === i && (i = 0),
  47694. void 0 === o && (o = 1),
  47695. void 0 === r && (r = new Ci.Color(16777215)),
  47696. void 0 === n && (n = Ci.NormalBlending),
  47697. i = Math.min(i, Math.max(0, i)),
  47698. this.lensFlares.push({
  47699. texture: e,
  47700. size: t,
  47701. distance: i,
  47702. x: 0,
  47703. y: 0,
  47704. z: 0,
  47705. scale: 1,
  47706. rotation: 0,
  47707. opacity: o,
  47708. color: r,
  47709. blending: n
  47710. })
  47711. }
  47712. ,
  47713. Ci.LensFlare.prototype.updateLensFlares = function() {
  47714. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47715. for (e = 0; e < i; e++)
  47716. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47717. t.y = this.positionScreen.y + r * t.distance,
  47718. t.wantedRotation = t.x * Math.PI * .25,
  47719. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47720. }
  47721. ,
  47722. Ci.LensFlare.prototype.copy = function(e) {
  47723. Ci.Object3D.prototype.copy.call(this, e),
  47724. this.positionScreen.copy(e.positionScreen),
  47725. this.customUpdateCallback = e.customUpdateCallback;
  47726. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47727. this.lensFlares.push(e.lensFlares[t]);
  47728. return this
  47729. }
  47730. ,
  47731. Ci.Scene = function() {
  47732. Ci.Object3D.call(this),
  47733. this.type = "Scene",
  47734. this.fog = null,
  47735. this.overrideMaterial = null,
  47736. this.autoUpdate = !0
  47737. }
  47738. ,
  47739. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47740. Ci.Scene.prototype.constructor = Ci.Scene,
  47741. Ci.Scene.prototype.copy = function(e, t) {
  47742. return Ci.Object3D.prototype.copy.call(this, e, t),
  47743. null !== e.fog && (this.fog = e.fog.clone()),
  47744. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47745. this.autoUpdate = e.autoUpdate,
  47746. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47747. this
  47748. }
  47749. ,
  47750. Ci.Fog = function(e, t, i) {
  47751. this.name = "",
  47752. this.color = new Ci.Color(e),
  47753. this.near = void 0 !== t ? t : 1,
  47754. this.far = void 0 !== i ? i : 1e3
  47755. }
  47756. ,
  47757. Ci.Fog.prototype.clone = function() {
  47758. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47759. }
  47760. ,
  47761. Ci.FogExp2 = function(e, t) {
  47762. this.name = "",
  47763. this.color = new Ci.Color(e),
  47764. this.density = void 0 !== t ? t : 25e-5
  47765. }
  47766. ,
  47767. Ci.FogExp2.prototype.clone = function() {
  47768. return new Ci.FogExp2(this.color.getHex(),this.density)
  47769. }
  47770. ,
  47771. Ci.ShaderChunk = {},
  47772. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47773. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47774. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47775. Ci.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",
  47776. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47777. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47778. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47779. Ci.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",
  47780. Ci.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",
  47781. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47782. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47783. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47784. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47785. Ci.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",
  47786. Ci.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",
  47787. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47788. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47789. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47790. Ci.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",
  47791. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47792. Ci.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",
  47793. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47794. Ci.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",
  47795. Ci.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",
  47796. Ci.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",
  47797. Ci.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",
  47798. Ci.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",
  47799. Ci.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",
  47800. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47801. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47802. Ci.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",
  47803. Ci.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",
  47804. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47805. Ci.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",
  47806. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47807. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47808. Ci.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",
  47809. Ci.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",
  47810. Ci.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",
  47811. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47812. Ci.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",
  47813. Ci.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",
  47814. Ci.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",
  47815. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47816. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47817. Ci.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",
  47818. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47819. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47820. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47821. Ci.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",
  47822. Ci.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",
  47823. Ci.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",
  47824. Ci.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",
  47825. Ci.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",
  47826. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47827. Ci.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",
  47828. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47829. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47830. Ci.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",
  47831. Ci.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",
  47832. Ci.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",
  47833. Ci.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",
  47834. Ci.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",
  47835. Ci.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",
  47836. Ci.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",
  47837. Ci.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",
  47838. Ci.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",
  47839. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47840. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47841. Ci.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",
  47842. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47843. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47844. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47845. Ci.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",
  47846. Ci.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",
  47847. Ci.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",
  47848. Ci.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",
  47849. Ci.UniformsUtils = {
  47850. merge: function(e) {
  47851. for (var t = {}, i = 0; i < e.length; i++) {
  47852. var n = this.clone(e[i]);
  47853. for (var r in n)
  47854. t[r] = n[r]
  47855. }
  47856. return t
  47857. },
  47858. clone: function(e) {
  47859. var t = {};
  47860. for (var i in e)
  47861. for (var n in t[i] = {},
  47862. e[i]) {
  47863. var r = e[i][n];
  47864. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  47865. }
  47866. return t
  47867. }
  47868. },
  47869. Ci.UniformsLib = {
  47870. common: {
  47871. diffuse: {
  47872. type: "c",
  47873. value: new Ci.Color(15658734)
  47874. },
  47875. opacity: {
  47876. type: "f",
  47877. value: 1
  47878. },
  47879. map: {
  47880. type: "t",
  47881. value: null
  47882. },
  47883. offsetRepeat: {
  47884. type: "v4",
  47885. value: new Ci.Vector4(0,0,1,1)
  47886. },
  47887. specularMap: {
  47888. type: "t",
  47889. value: null
  47890. },
  47891. alphaMap: {
  47892. type: "t",
  47893. value: null
  47894. },
  47895. envMap: {
  47896. type: "t",
  47897. value: null
  47898. },
  47899. flipEnvMap: {
  47900. type: "f",
  47901. value: -1
  47902. },
  47903. reflectivity: {
  47904. type: "f",
  47905. value: 1
  47906. },
  47907. refractionRatio: {
  47908. type: "f",
  47909. value: .98
  47910. }
  47911. },
  47912. aomap: {
  47913. aoMap: {
  47914. type: "t",
  47915. value: null
  47916. },
  47917. aoMapIntensity: {
  47918. type: "f",
  47919. value: 1
  47920. }
  47921. },
  47922. lightmap: {
  47923. lightMap: {
  47924. type: "t",
  47925. value: null
  47926. },
  47927. lightMapIntensity: {
  47928. type: "f",
  47929. value: 1
  47930. }
  47931. },
  47932. emissivemap: {
  47933. emissiveMap: {
  47934. type: "t",
  47935. value: null
  47936. }
  47937. },
  47938. bumpmap: {
  47939. bumpMap: {
  47940. type: "t",
  47941. value: null
  47942. },
  47943. bumpScale: {
  47944. type: "f",
  47945. value: 1
  47946. }
  47947. },
  47948. normalmap: {
  47949. normalMap: {
  47950. type: "t",
  47951. value: null
  47952. },
  47953. normalScale: {
  47954. type: "v2",
  47955. value: new Ci.Vector2(1,1)
  47956. }
  47957. },
  47958. displacementmap: {
  47959. displacementMap: {
  47960. type: "t",
  47961. value: null
  47962. },
  47963. displacementScale: {
  47964. type: "f",
  47965. value: 1
  47966. },
  47967. displacementBias: {
  47968. type: "f",
  47969. value: 0
  47970. }
  47971. },
  47972. roughnessmap: {
  47973. roughnessMap: {
  47974. type: "t",
  47975. value: null
  47976. }
  47977. },
  47978. metalnessmap: {
  47979. metalnessMap: {
  47980. type: "t",
  47981. value: null
  47982. }
  47983. },
  47984. fog: {
  47985. fogDensity: {
  47986. type: "f",
  47987. value: 25e-5
  47988. },
  47989. fogNear: {
  47990. type: "f",
  47991. value: 1
  47992. },
  47993. fogFar: {
  47994. type: "f",
  47995. value: 2e3
  47996. },
  47997. fogColor: {
  47998. type: "c",
  47999. value: new Ci.Color(16777215)
  48000. }
  48001. },
  48002. lights: {
  48003. ambientLightColor: {
  48004. type: "fv",
  48005. value: []
  48006. },
  48007. directionalLights: {
  48008. type: "sa",
  48009. value: [],
  48010. properties: {
  48011. direction: {
  48012. type: "v3"
  48013. },
  48014. color: {
  48015. type: "c"
  48016. },
  48017. shadow: {
  48018. type: "i"
  48019. },
  48020. shadowBias: {
  48021. type: "f"
  48022. },
  48023. shadowRadius: {
  48024. type: "f"
  48025. },
  48026. shadowMapSize: {
  48027. type: "v2"
  48028. }
  48029. }
  48030. },
  48031. directionalShadowMap: {
  48032. type: "tv",
  48033. value: []
  48034. },
  48035. directionalShadowMatrix: {
  48036. type: "m4v",
  48037. value: []
  48038. },
  48039. spotLights: {
  48040. type: "sa",
  48041. value: [],
  48042. properties: {
  48043. color: {
  48044. type: "c"
  48045. },
  48046. position: {
  48047. type: "v3"
  48048. },
  48049. direction: {
  48050. type: "v3"
  48051. },
  48052. distance: {
  48053. type: "f"
  48054. },
  48055. coneCos: {
  48056. type: "f"
  48057. },
  48058. penumbraCos: {
  48059. type: "f"
  48060. },
  48061. decay: {
  48062. type: "f"
  48063. },
  48064. shadow: {
  48065. type: "i"
  48066. },
  48067. shadowBias: {
  48068. type: "f"
  48069. },
  48070. shadowRadius: {
  48071. type: "f"
  48072. },
  48073. shadowMapSize: {
  48074. type: "v2"
  48075. }
  48076. }
  48077. },
  48078. spotShadowMap: {
  48079. type: "tv",
  48080. value: []
  48081. },
  48082. spotShadowMatrix: {
  48083. type: "m4v",
  48084. value: []
  48085. },
  48086. pointLights: {
  48087. type: "sa",
  48088. value: [],
  48089. properties: {
  48090. color: {
  48091. type: "c"
  48092. },
  48093. position: {
  48094. type: "v3"
  48095. },
  48096. decay: {
  48097. type: "f"
  48098. },
  48099. distance: {
  48100. type: "f"
  48101. },
  48102. shadow: {
  48103. type: "i"
  48104. },
  48105. shadowBias: {
  48106. type: "f"
  48107. },
  48108. shadowRadius: {
  48109. type: "f"
  48110. },
  48111. shadowMapSize: {
  48112. type: "v2"
  48113. }
  48114. }
  48115. },
  48116. pointShadowMap: {
  48117. type: "tv",
  48118. value: []
  48119. },
  48120. pointShadowMatrix: {
  48121. type: "m4v",
  48122. value: []
  48123. },
  48124. hemisphereLights: {
  48125. type: "sa",
  48126. value: [],
  48127. properties: {
  48128. direction: {
  48129. type: "v3"
  48130. },
  48131. skyColor: {
  48132. type: "c"
  48133. },
  48134. groundColor: {
  48135. type: "c"
  48136. }
  48137. }
  48138. }
  48139. },
  48140. points: {
  48141. diffuse: {
  48142. type: "c",
  48143. value: new Ci.Color(15658734)
  48144. },
  48145. opacity: {
  48146. type: "f",
  48147. value: 1
  48148. },
  48149. size: {
  48150. type: "f",
  48151. value: 1
  48152. },
  48153. scale: {
  48154. type: "f",
  48155. value: 1
  48156. },
  48157. map: {
  48158. type: "t",
  48159. value: null
  48160. },
  48161. offsetRepeat: {
  48162. type: "v4",
  48163. value: new Ci.Vector4(0,0,1,1)
  48164. }
  48165. }
  48166. },
  48167. Ci.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",
  48168. Ci.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",
  48169. Ci.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",
  48170. Ci.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",
  48171. Ci.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",
  48172. Ci.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",
  48173. Ci.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",
  48174. Ci.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",
  48175. Ci.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",
  48176. Ci.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",
  48177. Ci.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",
  48178. Ci.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",
  48179. Ci.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",
  48180. Ci.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",
  48181. Ci.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",
  48182. Ci.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",
  48183. Ci.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",
  48184. Ci.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",
  48185. Ci.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",
  48186. Ci.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",
  48187. Ci.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",
  48188. Ci.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",
  48189. Ci.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",
  48190. Ci.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",
  48191. Ci.ShaderLib = {
  48192. basic: {
  48193. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48194. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48195. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48196. },
  48197. lambert: {
  48198. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48199. emissive: {
  48200. type: "c",
  48201. value: new Ci.Color(0)
  48202. }
  48203. }]),
  48204. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48205. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48206. },
  48207. phong: {
  48208. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48209. emissive: {
  48210. type: "c",
  48211. value: new Ci.Color(0)
  48212. },
  48213. specular: {
  48214. type: "c",
  48215. value: new Ci.Color(1118481)
  48216. },
  48217. shininess: {
  48218. type: "f",
  48219. value: 30
  48220. }
  48221. }]),
  48222. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48223. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48224. },
  48225. standard: {
  48226. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48227. emissive: {
  48228. type: "c",
  48229. value: new Ci.Color(0)
  48230. },
  48231. roughness: {
  48232. type: "f",
  48233. value: .5
  48234. },
  48235. metalness: {
  48236. type: "f",
  48237. value: 0
  48238. },
  48239. envMapIntensity: {
  48240. type: "f",
  48241. value: 1
  48242. }
  48243. }]),
  48244. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48245. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48246. },
  48247. points: {
  48248. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48249. vertexShader: Ci.ShaderChunk.points_vert,
  48250. fragmentShader: Ci.ShaderChunk.points_frag
  48251. },
  48252. dashed: {
  48253. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48254. scale: {
  48255. type: "f",
  48256. value: 1
  48257. },
  48258. dashSize: {
  48259. type: "f",
  48260. value: 1
  48261. },
  48262. totalSize: {
  48263. type: "f",
  48264. value: 2
  48265. }
  48266. }]),
  48267. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48268. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48269. },
  48270. depth: {
  48271. uniforms: {
  48272. mNear: {
  48273. type: "f",
  48274. value: 1
  48275. },
  48276. mFar: {
  48277. type: "f",
  48278. value: 2e3
  48279. },
  48280. opacity: {
  48281. type: "f",
  48282. value: 1
  48283. }
  48284. },
  48285. vertexShader: Ci.ShaderChunk.depth_vert,
  48286. fragmentShader: Ci.ShaderChunk.depth_frag
  48287. },
  48288. normal: {
  48289. uniforms: {
  48290. opacity: {
  48291. type: "f",
  48292. value: 1
  48293. }
  48294. },
  48295. vertexShader: Ci.ShaderChunk.normal_vert,
  48296. fragmentShader: Ci.ShaderChunk.normal_frag
  48297. },
  48298. cube: {
  48299. uniforms: {
  48300. tCube: {
  48301. type: "t",
  48302. value: null
  48303. },
  48304. tFlip: {
  48305. type: "f",
  48306. value: -1
  48307. }
  48308. },
  48309. vertexShader: Ci.ShaderChunk.cube_vert,
  48310. fragmentShader: Ci.ShaderChunk.cube_frag
  48311. },
  48312. equirect: {
  48313. uniforms: {
  48314. tEquirect: {
  48315. type: "t",
  48316. value: null
  48317. },
  48318. tFlip: {
  48319. type: "f",
  48320. value: -1
  48321. }
  48322. },
  48323. vertexShader: Ci.ShaderChunk.equirect_vert,
  48324. fragmentShader: Ci.ShaderChunk.equirect_frag
  48325. },
  48326. depthRGBA: {
  48327. uniforms: {},
  48328. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48329. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48330. },
  48331. distanceRGBA: {
  48332. uniforms: {
  48333. lightPos: {
  48334. type: "v3",
  48335. value: new Ci.Vector3(0,0,0)
  48336. }
  48337. },
  48338. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48339. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48340. }
  48341. },
  48342. Ci.WebGLRenderer = function(e) {
  48343. function S() {
  48344. return null === Q ? he : 1
  48345. }
  48346. function i(e, t, i, n) {
  48347. !0 === V && (e *= n,
  48348. t *= n,
  48349. i *= n),
  48350. _e.clearColor(e, t, i, n)
  48351. }
  48352. function t() {
  48353. _e.init(),
  48354. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48355. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48356. i(ae.r, ae.g, ae.b, se)
  48357. }
  48358. function n() {
  48359. te = K = null,
  48360. ee = "",
  48361. $ = -1,
  48362. _e.reset()
  48363. }
  48364. function r(e) {
  48365. e.preventDefault(),
  48366. n(),
  48367. t(),
  48368. be.clear()
  48369. }
  48370. function f(e) {
  48371. var t = e.target;
  48372. t.removeEventListener("dispose", f),
  48373. function(e) {
  48374. var t = be.get(e);
  48375. if (e.image && t.__image__webglTextureCube)
  48376. X.deleteTexture(t.__image__webglTextureCube);
  48377. else {
  48378. if (void 0 === t.__webglInit)
  48379. return;
  48380. X.deleteTexture(t.__webglTexture)
  48381. }
  48382. be.delete(e)
  48383. }(t),
  48384. ye.textures--
  48385. }
  48386. function a(e) {
  48387. var t = e.target;
  48388. t.removeEventListener("dispose", a),
  48389. function(e) {
  48390. var t = be.get(e)
  48391. , i = be.get(e.texture);
  48392. if (e && void 0 !== i.__webglTexture) {
  48393. if (X.deleteTexture(i.__webglTexture),
  48394. e instanceof Ci.WebGLRenderTargetCube)
  48395. for (var n = 0; n < 6; n++)
  48396. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48397. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48398. else
  48399. X.deleteFramebuffer(t.__webglFramebuffer),
  48400. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48401. be.delete(e.texture),
  48402. be.delete(e)
  48403. }
  48404. }(t),
  48405. ye.textures--
  48406. }
  48407. function v(e) {
  48408. var t = e.target;
  48409. t.removeEventListener("dispose", v),
  48410. function(e) {
  48411. y(e),
  48412. be.delete(e)
  48413. }(t)
  48414. }
  48415. function y(e) {
  48416. var t = be.get(e).program;
  48417. (e.program = void 0) !== t && Te.releaseProgram(t)
  48418. }
  48419. function M(e, t) {
  48420. return Math.abs(t[0]) - Math.abs(e[0])
  48421. }
  48422. function s(e, t) {
  48423. 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
  48424. }
  48425. function l(e, t) {
  48426. 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
  48427. }
  48428. function d(e, t, i, n, r) {
  48429. var o, a;
  48430. a = i.transparent ? (o = G,
  48431. ++W) : (o = H,
  48432. ++z);
  48433. var s = o[a];
  48434. void 0 !== s ? (s.id = e.id,
  48435. s.object = e,
  48436. s.geometry = t,
  48437. s.material = i,
  48438. s.z = me.z,
  48439. s.group = r) : (s = {
  48440. id: e.id,
  48441. object: e,
  48442. geometry: t,
  48443. material: i,
  48444. z: me.z,
  48445. group: r
  48446. },
  48447. o.push(s))
  48448. }
  48449. function c(e, t, i, n) {
  48450. for (var r = 0, o = e.length; r < o; r++) {
  48451. var a = e[r]
  48452. , s = a.object
  48453. , l = a.geometry
  48454. , c = void 0 === n ? a.material : n
  48455. , h = a.group;
  48456. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48457. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48458. s instanceof Ci.ImmediateRenderObject) {
  48459. R(c);
  48460. var u = P(t, i, c, s);
  48461. ee = "",
  48462. s.render(function(e) {
  48463. Z.renderBufferImmediate(e, u, c)
  48464. })
  48465. } else
  48466. Z.renderBufferDirect(t, i, l, c, s, h)
  48467. }
  48468. }
  48469. function R(e) {
  48470. (function(e) {
  48471. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48472. _e.setFlipSided(e.side === Ci.BackSide)
  48473. }
  48474. )(e),
  48475. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  48476. _e.setDepthFunc(e.depthFunc),
  48477. _e.setDepthTest(e.depthTest),
  48478. _e.setDepthWrite(e.depthWrite),
  48479. _e.setColorWrite(e.colorWrite),
  48480. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48481. }
  48482. function P(e, t, i, n) {
  48483. oe = 0;
  48484. var r = be.get(i);
  48485. void 0 === r.program && (i.needsUpdate = !0),
  48486. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48487. i.needsUpdate && (function(e, t, i) {
  48488. var n = be.get(e)
  48489. , r = Te.getParameters(e, ve, t, i)
  48490. , o = Te.getProgramCode(e, r)
  48491. , a = n.program
  48492. , s = !0;
  48493. if (void 0 === a)
  48494. e.addEventListener("dispose", v);
  48495. else if (a.code !== o)
  48496. y(e);
  48497. else {
  48498. if (void 0 !== r.shaderID)
  48499. return;
  48500. s = !1
  48501. }
  48502. if (s) {
  48503. if (r.shaderID) {
  48504. var l = Ci.ShaderLib[r.shaderID];
  48505. n.__webglShader = {
  48506. name: e.type,
  48507. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48508. vertexShader: l.vertexShader,
  48509. fragmentShader: l.fragmentShader
  48510. }
  48511. } else
  48512. n.__webglShader = {
  48513. name: e.type,
  48514. uniforms: e.uniforms,
  48515. vertexShader: e.vertexShader,
  48516. fragmentShader: e.fragmentShader
  48517. };
  48518. e.__webglShader = n.__webglShader,
  48519. a = Te.acquireProgram(e, r, o),
  48520. n.program = a,
  48521. e.program = a
  48522. }
  48523. var c = a.getAttributes();
  48524. if (e.morphTargets)
  48525. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48526. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48527. if (e.morphNormals)
  48528. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48529. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48530. n.uniformsList = [];
  48531. var u = n.__webglShader.uniforms
  48532. , d = n.program.getUniforms();
  48533. for (var p in u) {
  48534. var f = d[p];
  48535. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48536. }
  48537. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48538. u.ambientLightColor.value = ve.ambient,
  48539. u.directionalLights.value = ve.directional,
  48540. u.spotLights.value = ve.spot,
  48541. u.pointLights.value = ve.point,
  48542. u.hemisphereLights.value = ve.hemi,
  48543. u.directionalShadowMap.value = ve.directionalShadowMap,
  48544. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48545. u.spotShadowMap.value = ve.spotShadowMap,
  48546. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48547. u.pointShadowMap.value = ve.pointShadowMap,
  48548. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48549. n.hasDynamicUniforms = !1;
  48550. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48551. if (!0 === n.uniformsList[g][0].dynamic) {
  48552. n.hasDynamicUniforms = !0;
  48553. break
  48554. }
  48555. }
  48556. }(i, t, n),
  48557. i.needsUpdate = !1);
  48558. var o = !1
  48559. , a = !1
  48560. , s = !1
  48561. , l = r.program
  48562. , c = l.getUniforms()
  48563. , h = r.__webglShader.uniforms;
  48564. if (l.id !== K && (X.useProgram(l.program),
  48565. K = l.id,
  48566. s = a = o = !0),
  48567. i.id !== $ && ($ = i.id,
  48568. a = !0),
  48569. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48570. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48571. e !== te && (te = e,
  48572. s = a = !0),
  48573. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48574. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48575. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48576. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48577. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48578. i.skinning)
  48579. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48580. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48581. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48582. if (void 0 !== c.boneTexture) {
  48583. var u = A();
  48584. X.uniform1i(c.boneTexture, u),
  48585. Z.setTexture(n.skeleton.boneTexture, u)
  48586. }
  48587. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48588. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48589. } else
  48590. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48591. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48592. e.ambientLightColor.needsUpdate = t,
  48593. e.directionalLights.needsUpdate = t,
  48594. e.pointLights.needsUpdate = t,
  48595. e.spotLights.needsUpdate = t,
  48596. e.hemisphereLights.needsUpdate = t
  48597. }(h, s),
  48598. t && i.fog && function(e, t) {
  48599. e.fogColor.value = t.color,
  48600. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48601. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48602. }(h, t),
  48603. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48604. var i;
  48605. if (e.opacity.value = t.opacity,
  48606. e.diffuse.value = t.color,
  48607. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48608. e.map.value = t.map,
  48609. e.specularMap.value = t.specularMap,
  48610. e.alphaMap.value = t.alphaMap,
  48611. t.aoMap && (e.aoMap.value = t.aoMap,
  48612. e.aoMapIntensity.value = t.aoMapIntensity),
  48613. 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),
  48614. void 0 !== i) {
  48615. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48616. var n = i.offset
  48617. , r = i.repeat;
  48618. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48619. }
  48620. e.envMap.value = t.envMap,
  48621. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48622. e.reflectivity.value = t.reflectivity,
  48623. e.refractionRatio.value = t.refractionRatio
  48624. }(h, i),
  48625. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48626. function(e, t) {
  48627. e.dashSize.value = t.dashSize,
  48628. e.totalSize.value = t.dashSize + t.gapSize,
  48629. e.scale.value = t.scale
  48630. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48631. if (e.diffuse.value = t.color,
  48632. e.opacity.value = t.opacity,
  48633. e.size.value = t.size * he,
  48634. e.scale.value = O.clientHeight / 2,
  48635. e.map.value = t.map,
  48636. null !== t.map) {
  48637. var i = t.map.offset
  48638. , n = t.map.repeat;
  48639. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48640. }
  48641. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48642. t.lightMap && (e.lightMap.value = t.lightMap,
  48643. e.lightMapIntensity.value = t.lightMapIntensity),
  48644. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48645. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48646. e.specular.value = t.specular,
  48647. e.shininess.value = Math.max(t.shininess, 1e-4),
  48648. t.lightMap && (e.lightMap.value = t.lightMap,
  48649. e.lightMapIntensity.value = t.lightMapIntensity),
  48650. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48651. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48652. e.bumpScale.value = t.bumpScale),
  48653. t.normalMap && (e.normalMap.value = t.normalMap,
  48654. e.normalScale.value.copy(t.normalScale)),
  48655. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48656. e.displacementScale.value = t.displacementScale,
  48657. e.displacementBias.value = t.displacementBias)
  48658. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48659. e.roughness.value = t.roughness,
  48660. e.metalness.value = t.metalness,
  48661. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48662. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48663. t.lightMap && (e.lightMap.value = t.lightMap,
  48664. e.lightMapIntensity.value = t.lightMapIntensity),
  48665. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48666. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48667. e.bumpScale.value = t.bumpScale),
  48668. t.normalMap && (e.normalMap.value = t.normalMap,
  48669. e.normalScale.value.copy(t.normalScale)),
  48670. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48671. e.displacementScale.value = t.displacementScale,
  48672. e.displacementBias.value = t.displacementBias),
  48673. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48674. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48675. h.mFar.value = e.far,
  48676. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48677. g(r.uniformsList)),
  48678. function(e, t) {
  48679. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48680. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48681. }(c, n),
  48682. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48683. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48684. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48685. var a = e[r][0]
  48686. , s = a.onUpdateCallback;
  48687. void 0 !== s && (s.bind(a)(t, i),
  48688. n.push(e[r]))
  48689. }
  48690. g(n)
  48691. }(r.uniformsList, n, e),
  48692. l
  48693. }
  48694. function p(e, t) {
  48695. e.diffuse.value = t.color,
  48696. e.opacity.value = t.opacity
  48697. }
  48698. function A() {
  48699. var e = oe;
  48700. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48701. oe += 1,
  48702. e
  48703. }
  48704. function C(e, t, i, n) {
  48705. var r, o;
  48706. if ("1i" === t)
  48707. X.uniform1i(i, n);
  48708. else if ("1f" === t)
  48709. X.uniform1f(i, n);
  48710. else if ("2f" === t)
  48711. X.uniform2f(i, n[0], n[1]);
  48712. else if ("3f" === t)
  48713. X.uniform3f(i, n[0], n[1], n[2]);
  48714. else if ("4f" === t)
  48715. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48716. else if ("1iv" === t)
  48717. X.uniform1iv(i, n);
  48718. else if ("3iv" === t)
  48719. X.uniform3iv(i, n);
  48720. else if ("1fv" === t)
  48721. X.uniform1fv(i, n);
  48722. else if ("2fv" === t)
  48723. X.uniform2fv(i, n);
  48724. else if ("3fv" === t)
  48725. X.uniform3fv(i, n);
  48726. else if ("4fv" === t)
  48727. X.uniform4fv(i, n);
  48728. else if ("Matrix2fv" === t)
  48729. X.uniformMatrix2fv(i, !1, n);
  48730. else if ("Matrix3fv" === t)
  48731. X.uniformMatrix3fv(i, !1, n);
  48732. else if ("Matrix4fv" === t)
  48733. X.uniformMatrix4fv(i, !1, n);
  48734. else if ("i" === t)
  48735. X.uniform1i(i, n);
  48736. else if ("f" === t)
  48737. X.uniform1f(i, n);
  48738. else if ("v2" === t)
  48739. X.uniform2f(i, n.x, n.y);
  48740. else if ("v3" === t)
  48741. X.uniform3f(i, n.x, n.y, n.z);
  48742. else if ("v4" === t)
  48743. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48744. else if ("c" === t)
  48745. X.uniform3f(i, n.r, n.g, n.b);
  48746. else if ("s" === t) {
  48747. var a = e.properties;
  48748. for (var s in a) {
  48749. var l = a[s]
  48750. , c = i[s]
  48751. , h = n[s];
  48752. C(l, l.type, c, h)
  48753. }
  48754. } else if ("sa" === t) {
  48755. a = e.properties;
  48756. for (var u = 0, d = n.length; u < d; u++)
  48757. for (var s in a) {
  48758. l = a[s],
  48759. c = i[u][s],
  48760. h = n[u][s];
  48761. C(l, l.type, c, h)
  48762. }
  48763. } else if ("iv1" === t)
  48764. X.uniform1iv(i, n);
  48765. else if ("iv" === t)
  48766. X.uniform3iv(i, n);
  48767. else if ("fv1" === t)
  48768. X.uniform1fv(i, n);
  48769. else if ("fv" === t)
  48770. X.uniform3fv(i, n);
  48771. else if ("v2v" === t) {
  48772. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48773. u = 0;
  48774. for (var p = 0, f = n.length; u < f; u++,
  48775. p += 2)
  48776. e._array[p + 0] = n[u].x,
  48777. e._array[p + 1] = n[u].y;
  48778. X.uniform2fv(i, e._array)
  48779. } else if ("v3v" === t) {
  48780. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48781. u = 0;
  48782. var g = 0;
  48783. for (f = n.length; u < f; u++,
  48784. g += 3)
  48785. e._array[g + 0] = n[u].x,
  48786. e._array[g + 1] = n[u].y,
  48787. e._array[g + 2] = n[u].z;
  48788. X.uniform3fv(i, e._array)
  48789. } else if ("v4v" === t) {
  48790. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48791. u = 0;
  48792. var m = 0;
  48793. for (f = n.length; u < f; u++,
  48794. m += 4)
  48795. e._array[m + 0] = n[u].x,
  48796. e._array[m + 1] = n[u].y,
  48797. e._array[m + 2] = n[u].z,
  48798. e._array[m + 3] = n[u].w;
  48799. X.uniform4fv(i, e._array)
  48800. } else if ("m2" === t)
  48801. X.uniformMatrix2fv(i, !1, n.elements);
  48802. else if ("m3" === t)
  48803. X.uniformMatrix3fv(i, !1, n.elements);
  48804. else if ("m3v" === t) {
  48805. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48806. for (u = 0,
  48807. f = n.length; u < f; u++)
  48808. n[u].flattenToArrayOffset(e._array, 9 * u);
  48809. X.uniformMatrix3fv(i, !1, e._array)
  48810. } else if ("m4" === t)
  48811. X.uniformMatrix4fv(i, !1, n.elements);
  48812. else if ("m4v" === t) {
  48813. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48814. for (u = 0,
  48815. f = n.length; u < f; u++)
  48816. n[u].flattenToArrayOffset(e._array, 16 * u);
  48817. X.uniformMatrix4fv(i, !1, e._array)
  48818. } else if ("t" === t) {
  48819. if (r = n,
  48820. o = A(),
  48821. X.uniform1i(i, o),
  48822. !r)
  48823. return;
  48824. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  48825. } else if ("tv" === t) {
  48826. void 0 === e._array && (e._array = []);
  48827. for (u = 0,
  48828. f = e.value.length; u < f; u++)
  48829. e._array[u] = A();
  48830. X.uniform1iv(i, e._array);
  48831. for (u = 0,
  48832. f = e.value.length; u < f; u++)
  48833. r = e.value[u],
  48834. o = e._array[u],
  48835. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  48836. } else
  48837. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48838. }
  48839. function g(e) {
  48840. for (var t = 0, i = e.length; t < i; t++) {
  48841. var n = e[t][0];
  48842. if (!1 !== n.needsUpdate)
  48843. C(n, n.type, e[t][1], n.value)
  48844. }
  48845. }
  48846. function m(e, t, i) {
  48847. var n;
  48848. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48849. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48850. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48851. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48852. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48853. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  48854. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48855. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48856. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  48857. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48858. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48859. return;
  48860. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48861. return;
  48862. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48863. be.get(t).__currentAnisotropy = t.anisotropy)
  48864. }
  48865. }
  48866. function o(e, t, i) {
  48867. void 0 === e.__webglInit && (e.__webglInit = !0,
  48868. t.addEventListener("dispose", f),
  48869. e.__webglTexture = X.createTexture(),
  48870. ye.textures++),
  48871. _e.activeTexture(X.TEXTURE0 + i),
  48872. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48873. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48874. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48875. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48876. var n = I(t.image, Ee.maxTextureSize);
  48877. !function(e) {
  48878. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48879. }(t) || !1 !== E(n) || (n = function(e) {
  48880. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48881. var t = document.createElement("canvas");
  48882. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48883. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48884. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48885. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48886. t
  48887. }
  48888. return e
  48889. }(n));
  48890. var r = E(n)
  48891. , o = x(t.format)
  48892. , a = x(t.type);
  48893. m(X.TEXTURE_2D, t, r);
  48894. var s, l = t.mipmaps;
  48895. if (t instanceof Ci.DataTexture)
  48896. if (0 < l.length && r) {
  48897. for (var c = 0, h = l.length; c < h; c++)
  48898. s = l[c],
  48899. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48900. t.generateMipmaps = !1
  48901. } else
  48902. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48903. else if (t instanceof Ci.CompressedTexture)
  48904. for (c = 0,
  48905. h = l.length; c < h; c++)
  48906. s = l[c],
  48907. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48908. else if (0 < l.length && r) {
  48909. for (c = 0,
  48910. h = l.length; c < h; c++)
  48911. s = l[c],
  48912. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48913. t.generateMipmaps = !1
  48914. } else
  48915. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48916. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48917. e.__version = t.version,
  48918. t.onUpdate && t.onUpdate(t)
  48919. }
  48920. function I(e, t) {
  48921. if (e.width > t || e.height > t) {
  48922. var i = t / Math.max(e.width, e.height)
  48923. , n = document.createElement("canvas");
  48924. return n.width = Math.floor(e.width * i),
  48925. n.height = Math.floor(e.height * i),
  48926. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48927. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48928. n
  48929. }
  48930. return e
  48931. }
  48932. function E(e) {
  48933. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48934. }
  48935. function _(e, t) {
  48936. var i = be.get(e);
  48937. if (6 === e.image.length)
  48938. if (0 < e.version && i.__version !== e.version) {
  48939. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48940. i.__image__webglTextureCube = X.createTexture(),
  48941. ye.textures++),
  48942. _e.activeTexture(X.TEXTURE0 + t),
  48943. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48944. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48945. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48946. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48947. var s = E(o[0])
  48948. , l = x(e.format)
  48949. , c = x(e.type);
  48950. m(X.TEXTURE_CUBE_MAP, e, s);
  48951. for (a = 0; a < 6; a++)
  48952. if (n)
  48953. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48954. h = u[d],
  48955. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  48956. else
  48957. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  48958. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48959. i.__version = e.version,
  48960. e.onUpdate && e.onUpdate(e)
  48961. } else
  48962. _e.activeTexture(X.TEXTURE0 + t),
  48963. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48964. }
  48965. function b(e, t) {
  48966. _e.activeTexture(X.TEXTURE0 + t),
  48967. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48968. }
  48969. function h(e, t, i, n) {
  48970. var r = x(t.texture.format)
  48971. , o = x(t.texture.type);
  48972. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48973. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48974. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48975. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48976. }
  48977. function u(e, t) {
  48978. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48979. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48980. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  48981. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48982. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48983. }
  48984. function w(e) {
  48985. var t = be.get(e)
  48986. , i = be.get(e.texture);
  48987. e.addEventListener("dispose", a),
  48988. i.__webglTexture = X.createTexture(),
  48989. ye.textures++;
  48990. var n = e instanceof Ci.WebGLRenderTargetCube
  48991. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48992. if (n) {
  48993. t.__webglFramebuffer = [];
  48994. for (var o = 0; o < 6; o++)
  48995. t.__webglFramebuffer[o] = X.createFramebuffer()
  48996. } else
  48997. t.__webglFramebuffer = X.createFramebuffer();
  48998. if (n) {
  48999. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49000. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49001. for (o = 0; o < 6; o++)
  49002. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49003. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49004. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49005. } else
  49006. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49007. m(X.TEXTURE_2D, e.texture, r),
  49008. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49009. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49010. _e.bindTexture(X.TEXTURE_2D, null);
  49011. e.depthBuffer && function(e) {
  49012. var t = be.get(e);
  49013. if (e instanceof Ci.WebGLRenderTargetCube) {
  49014. t.__webglDepthbuffer = [];
  49015. for (var i = 0; i < 6; i++)
  49016. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49017. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49018. u(t.__webglDepthbuffer[i], e)
  49019. } else
  49020. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49021. t.__webglDepthbuffer = X.createRenderbuffer(),
  49022. u(t.__webglDepthbuffer, e);
  49023. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49024. }(e)
  49025. }
  49026. function T(e) {
  49027. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49028. }
  49029. function x(e) {
  49030. var t;
  49031. if (e === Ci.RepeatWrapping)
  49032. return X.REPEAT;
  49033. if (e === Ci.ClampToEdgeWrapping)
  49034. return X.CLAMP_TO_EDGE;
  49035. if (e === Ci.MirroredRepeatWrapping)
  49036. return X.MIRRORED_REPEAT;
  49037. if (e === Ci.NearestFilter)
  49038. return X.NEAREST;
  49039. if (e === Ci.NearestMipMapNearestFilter)
  49040. return X.NEAREST_MIPMAP_NEAREST;
  49041. if (e === Ci.NearestMipMapLinearFilter)
  49042. return X.NEAREST_MIPMAP_LINEAR;
  49043. if (e === Ci.LinearFilter)
  49044. return X.LINEAR;
  49045. if (e === Ci.LinearMipMapNearestFilter)
  49046. return X.LINEAR_MIPMAP_NEAREST;
  49047. if (e === Ci.LinearMipMapLinearFilter)
  49048. return X.LINEAR_MIPMAP_LINEAR;
  49049. if (e === Ci.UnsignedByteType)
  49050. return X.UNSIGNED_BYTE;
  49051. if (e === Ci.UnsignedShort4444Type)
  49052. return X.UNSIGNED_SHORT_4_4_4_4;
  49053. if (e === Ci.UnsignedShort5551Type)
  49054. return X.UNSIGNED_SHORT_5_5_5_1;
  49055. if (e === Ci.UnsignedShort565Type)
  49056. return X.UNSIGNED_SHORT_5_6_5;
  49057. if (e === Ci.ByteType)
  49058. return X.BYTE;
  49059. if (e === Ci.ShortType)
  49060. return X.SHORT;
  49061. if (e === Ci.UnsignedShortType)
  49062. return X.UNSIGNED_SHORT;
  49063. if (e === Ci.IntType)
  49064. return X.INT;
  49065. if (e === Ci.UnsignedIntType)
  49066. return X.UNSIGNED_INT;
  49067. if (e === Ci.FloatType)
  49068. return X.FLOAT;
  49069. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49070. return t.HALF_FLOAT_OES;
  49071. if (e === Ci.AlphaFormat)
  49072. return X.ALPHA;
  49073. if (e === Ci.RGBFormat)
  49074. return X.RGB;
  49075. if (e === Ci.RGBAFormat)
  49076. return X.RGBA;
  49077. if (e === Ci.LuminanceFormat)
  49078. return X.LUMINANCE;
  49079. if (e === Ci.LuminanceAlphaFormat)
  49080. return X.LUMINANCE_ALPHA;
  49081. if (e === Ci.AddEquation)
  49082. return X.FUNC_ADD;
  49083. if (e === Ci.SubtractEquation)
  49084. return X.FUNC_SUBTRACT;
  49085. if (e === Ci.ReverseSubtractEquation)
  49086. return X.FUNC_REVERSE_SUBTRACT;
  49087. if (e === Ci.ZeroFactor)
  49088. return X.ZERO;
  49089. if (e === Ci.OneFactor)
  49090. return X.ONE;
  49091. if (e === Ci.SrcColorFactor)
  49092. return X.SRC_COLOR;
  49093. if (e === Ci.OneMinusSrcColorFactor)
  49094. return X.ONE_MINUS_SRC_COLOR;
  49095. if (e === Ci.SrcAlphaFactor)
  49096. return X.SRC_ALPHA;
  49097. if (e === Ci.OneMinusSrcAlphaFactor)
  49098. return X.ONE_MINUS_SRC_ALPHA;
  49099. if (e === Ci.DstAlphaFactor)
  49100. return X.DST_ALPHA;
  49101. if (e === Ci.OneMinusDstAlphaFactor)
  49102. return X.ONE_MINUS_DST_ALPHA;
  49103. if (e === Ci.DstColorFactor)
  49104. return X.DST_COLOR;
  49105. if (e === Ci.OneMinusDstColorFactor)
  49106. return X.ONE_MINUS_DST_COLOR;
  49107. if (e === Ci.SrcAlphaSaturateFactor)
  49108. return X.SRC_ALPHA_SATURATE;
  49109. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49110. if (e === Ci.RGB_S3TC_DXT1_Format)
  49111. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49112. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49113. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49114. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49115. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49116. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49117. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49118. }
  49119. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49120. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49121. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49122. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49123. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49124. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49125. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49126. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49127. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49128. }
  49129. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49130. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49131. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49132. if (e === Ci.MinEquation)
  49133. return t.MIN_EXT;
  49134. if (e === Ci.MaxEquation)
  49135. return t.MAX_EXT
  49136. }
  49137. return 0
  49138. }
  49139. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49140. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49141. , L = void 0 !== e.context ? e.context : null
  49142. , D = void 0 !== e.alpha && e.alpha
  49143. , N = void 0 === e.depth || e.depth
  49144. , F = void 0 === e.stencil || e.stencil
  49145. , B = void 0 !== e.antialias && e.antialias
  49146. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49147. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49148. , U = []
  49149. , H = []
  49150. , z = -1
  49151. , G = []
  49152. , W = -1
  49153. , j = new Float32Array(8)
  49154. , Y = []
  49155. , q = [];
  49156. this.domElement = O,
  49157. this.context = null,
  49158. this.autoClear = !0,
  49159. this.autoClearColor = !0,
  49160. this.autoClearDepth = !0,
  49161. this.autoClearStencil = !0,
  49162. this.sortObjects = !0,
  49163. this.gammaFactor = 2,
  49164. this.gammaInput = !1,
  49165. this.gammaOutput = !1,
  49166. this.physicallyCorrectLights = !1,
  49167. this.toneMapping = Ci.LinearToneMapping,
  49168. this.toneMappingExposure = 1,
  49169. this.toneMappingWhitePoint = 1,
  49170. this.maxMorphTargets = 8,
  49171. this.maxMorphNormals = 4,
  49172. this.autoScaleCubemaps = !0;
  49173. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  49174. hash: "",
  49175. ambient: [0, 0, 0],
  49176. directional: [],
  49177. directionalShadowMap: [],
  49178. directionalShadowMatrix: [],
  49179. spot: [],
  49180. spotShadowMap: [],
  49181. spotShadowMatrix: [],
  49182. point: [],
  49183. pointShadowMap: [],
  49184. pointShadowMatrix: [],
  49185. hemi: [],
  49186. shadows: [],
  49187. shadowsPointLight: 0
  49188. }, ye = {
  49189. geometries: 0,
  49190. textures: 0
  49191. }, Ae = {
  49192. calls: 0,
  49193. vertices: 0,
  49194. faces: 0,
  49195. points: 0
  49196. };
  49197. this.info = {
  49198. render: Ae,
  49199. memory: ye,
  49200. programs: null
  49201. };
  49202. try {
  49203. var Ce = {
  49204. alpha: D,
  49205. depth: N,
  49206. stencil: F,
  49207. antialias: B,
  49208. premultipliedAlpha: V,
  49209. preserveDrawingBuffer: k
  49210. };
  49211. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49212. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49213. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49214. return {
  49215. rangeMin: 1,
  49216. rangeMax: 1,
  49217. precision: 1
  49218. }
  49219. }
  49220. ),
  49221. O.addEventListener("webglcontextlost", r, !1)
  49222. } catch (e) {
  49223. console.error("THREE.WebGLRenderer: " + e)
  49224. }
  49225. var Ie = new Ci.WebGLExtensions(X);
  49226. Ie.get("OES_texture_float"),
  49227. Ie.get("OES_texture_float_linear"),
  49228. Ie.get("OES_texture_half_float"),
  49229. Ie.get("OES_texture_half_float_linear"),
  49230. Ie.get("OES_standard_derivatives"),
  49231. Ie.get("ANGLE_instanced_arrays"),
  49232. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49233. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49234. , _e = new Ci.WebGLState(X,Ie,x)
  49235. , be = new Ci.WebGLProperties
  49236. , we = new Ci.WebGLObjects(X,be,this.info)
  49237. , Te = new Ci.WebGLPrograms(this,Ee)
  49238. , xe = new Ci.WebGLLights;
  49239. this.info.programs = Te.programs;
  49240. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49241. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49242. t(),
  49243. this.context = X,
  49244. this.capabilities = Ee,
  49245. this.extensions = Ie,
  49246. this.properties = be,
  49247. this.state = _e;
  49248. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49249. this.shadowMap = Re;
  49250. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49251. this.getContext = function() {
  49252. return X
  49253. }
  49254. ,
  49255. this.getContextAttributes = function() {
  49256. return X.getContextAttributes()
  49257. }
  49258. ,
  49259. this.forceContextLoss = function() {
  49260. Ie.get("WEBGL_lose_context").loseContext()
  49261. }
  49262. ,
  49263. this.getMaxAnisotropy = function() {
  49264. if (void 0 !== Pe)
  49265. return Pe;
  49266. var e = Ie.get("EXT_texture_filter_anisotropic");
  49267. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49268. }
  49269. ,
  49270. this.getPrecision = function() {
  49271. return Ee.precision
  49272. }
  49273. ,
  49274. this.getPixelRatio = function() {
  49275. return he
  49276. }
  49277. ,
  49278. this.setPixelRatio = function(e) {
  49279. void 0 !== e && (he = e,
  49280. this.setSize(pe.z, pe.w, !1))
  49281. }
  49282. ,
  49283. this.getSize = function() {
  49284. return {
  49285. width: le,
  49286. height: ce
  49287. }
  49288. }
  49289. ,
  49290. this.setSize = function(e, t, i, n) {
  49291. null != n && (he = n),
  49292. le = e,
  49293. ce = t,
  49294. O.width = e * he,
  49295. O.height = t * he,
  49296. !1 !== i && (O.style.width = e + "px",
  49297. O.style.height = t + "px"),
  49298. this.setViewport(0, 0, e, t)
  49299. }
  49300. ,
  49301. this.setViewport = function(e, t, i, n) {
  49302. _e.viewport(pe.set(e, t, i, n))
  49303. }
  49304. ,
  49305. this.setScissor = function(e, t, i, n) {
  49306. _e.scissor(ue.set(e, t, i, n))
  49307. }
  49308. ,
  49309. this.setScissorTest = function(e) {
  49310. _e.setScissorTest(de = e)
  49311. }
  49312. ,
  49313. this.getClearColor = function() {
  49314. return ae
  49315. }
  49316. ,
  49317. this.setClearColor = function(e, t) {
  49318. ae.set(e),
  49319. se = void 0 !== t ? t : 1,
  49320. i(ae.r, ae.g, ae.b, se)
  49321. }
  49322. ,
  49323. this.getClearAlpha = function() {
  49324. return se
  49325. }
  49326. ,
  49327. this.setClearAlpha = function(e) {
  49328. se = e,
  49329. i(ae.r, ae.g, ae.b, se)
  49330. }
  49331. ,
  49332. this.clear = function(e, t, i) {
  49333. var n = 0;
  49334. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49335. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49336. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49337. X.clear(n)
  49338. }
  49339. ,
  49340. this.clearColor = function() {
  49341. this.clear(!0, !1, !1)
  49342. }
  49343. ,
  49344. this.clearDepth = function() {
  49345. this.clear(!1, !0, !1)
  49346. }
  49347. ,
  49348. this.clearStencil = function() {
  49349. this.clear(!1, !1, !0)
  49350. }
  49351. ,
  49352. this.clearTarget = function(e, t, i, n) {
  49353. this.setRenderTarget(e),
  49354. this.clear(t, i, n)
  49355. }
  49356. ,
  49357. this.resetGLState = n,
  49358. this.dispose = function() {
  49359. O.removeEventListener("webglcontextlost", r, !1)
  49360. }
  49361. ,
  49362. this.renderBufferImmediate = function(e, t, i) {
  49363. _e.initAttributes();
  49364. var n = be.get(e);
  49365. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49366. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49367. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49368. e.hasColors && !n.color && (n.color = X.createBuffer());
  49369. var r = t.getAttributes();
  49370. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49371. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49372. _e.enableAttribute(r.position),
  49373. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49374. e.hasNormals) {
  49375. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49376. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49377. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49378. var s = e.normalArray
  49379. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49380. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49381. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49382. s[o + 0] = l,
  49383. s[o + 1] = c,
  49384. s[o + 2] = h,
  49385. s[o + 3] = l,
  49386. s[o + 4] = c,
  49387. s[o + 5] = h,
  49388. s[o + 6] = l,
  49389. s[o + 7] = c,
  49390. s[o + 8] = h
  49391. }
  49392. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49393. _e.enableAttribute(r.normal),
  49394. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49395. }
  49396. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49397. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49398. _e.enableAttribute(r.uv),
  49399. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49400. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49401. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49402. _e.enableAttribute(r.color),
  49403. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49404. _e.disableUnusedAttributes(),
  49405. X.drawArrays(X.TRIANGLES, 0, e.count),
  49406. e.count = 0
  49407. }
  49408. ,
  49409. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49410. R(n);
  49411. var a = P(e, t, n, r)
  49412. , s = !1
  49413. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49414. l !== ee && (ee = l,
  49415. s = !0);
  49416. var c = r.morphTargetInfluences;
  49417. if (void 0 !== c) {
  49418. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49419. var p = c[u];
  49420. h.push([p, u])
  49421. }
  49422. h.sort(M),
  49423. 8 < h.length && (h.length = 8);
  49424. var f = i.morphAttributes;
  49425. for (u = 0,
  49426. d = h.length; u < d; u++) {
  49427. p = h[u];
  49428. if (j[u] = p[0],
  49429. 0 !== p[0]) {
  49430. var g = p[1];
  49431. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49432. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49433. } else
  49434. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49435. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49436. }
  49437. var m = a.getUniforms();
  49438. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49439. s = !0
  49440. }
  49441. g = i.index;
  49442. var v, y = i.attributes.position;
  49443. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49444. null !== g ? (v = Me).setIndex(g) : v = Se,
  49445. s && (function(e, t, i, n) {
  49446. var r;
  49447. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49448. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49449. else {
  49450. void 0 === n && (n = 0),
  49451. _e.initAttributes();
  49452. var o = i.attributes
  49453. , a = t.getAttributes()
  49454. , s = e.defaultAttributeValues;
  49455. for (var l in a) {
  49456. var c = a[l];
  49457. if (0 <= c) {
  49458. var h = o[l];
  49459. if (void 0 !== h) {
  49460. var u = h.itemSize
  49461. , d = we.getAttributeBuffer(h);
  49462. if (h instanceof Ci.InterleavedBufferAttribute) {
  49463. var p = h.data
  49464. , f = p.stride
  49465. , g = h.offset;
  49466. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49467. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49468. X.bindBuffer(X.ARRAY_BUFFER, d),
  49469. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49470. } else
  49471. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49472. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49473. X.bindBuffer(X.ARRAY_BUFFER, d),
  49474. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49475. } else if (void 0 !== s) {
  49476. var m = s[l];
  49477. if (void 0 !== m)
  49478. switch (m.length) {
  49479. case 2:
  49480. X.vertexAttrib2fv(c, m);
  49481. break;
  49482. case 3:
  49483. X.vertexAttrib3fv(c, m);
  49484. break;
  49485. case 4:
  49486. X.vertexAttrib4fv(c, m);
  49487. break;
  49488. default:
  49489. X.vertexAttrib1fv(c, m)
  49490. }
  49491. }
  49492. }
  49493. }
  49494. _e.disableUnusedAttributes()
  49495. }
  49496. }(n, a, i),
  49497. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49498. var A = 1 / 0;
  49499. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49500. var C = i.drawRange.start
  49501. , I = i.drawRange.count
  49502. , E = null !== o ? o.start : 0
  49503. , _ = null !== o ? o.count : 1 / 0
  49504. , b = Math.max(0, C, E)
  49505. , w = Math.min(0 + A, C + I, E + _) - 1
  49506. , T = Math.max(0, w - b + 1);
  49507. if (r instanceof Ci.Mesh)
  49508. if (!0 === n.wireframe)
  49509. _e.setLineWidth(n.wireframeLinewidth * S()),
  49510. v.setMode(X.LINES);
  49511. else
  49512. switch (r.drawMode) {
  49513. case Ci.TrianglesDrawMode:
  49514. v.setMode(X.TRIANGLES);
  49515. break;
  49516. case Ci.TriangleStripDrawMode:
  49517. v.setMode(X.TRIANGLE_STRIP);
  49518. break;
  49519. case Ci.TriangleFanDrawMode:
  49520. v.setMode(X.TRIANGLE_FAN)
  49521. }
  49522. else if (r instanceof Ci.Line) {
  49523. var x = n.linewidth;
  49524. void 0 === x && (x = 1),
  49525. _e.setLineWidth(x * S()),
  49526. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49527. } else
  49528. r instanceof Ci.Points && v.setMode(X.POINTS);
  49529. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49530. }
  49531. ,
  49532. this.render = function(e, t, i, n) {
  49533. if (t instanceof Ci.Camera != 0) {
  49534. var r = e.fog;
  49535. if (ee = "",
  49536. $ = -1,
  49537. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49538. null === t.parent && t.updateMatrixWorld(),
  49539. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49540. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49541. fe.setFromMatrix(ge),
  49542. U.length = 0,
  49543. W = z = -1,
  49544. Y.length = 0,
  49545. q.length = 0,
  49546. function e(t, i) {
  49547. if (!1 !== t.visible) {
  49548. if (t.layers.test(i.layers))
  49549. if (t instanceof Ci.Light)
  49550. U.push(t);
  49551. else if (t instanceof Ci.Sprite)
  49552. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49553. else if (t instanceof Ci.LensFlare)
  49554. q.push(t);
  49555. else if (t instanceof Ci.ImmediateRenderObject)
  49556. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49557. me.applyProjection(ge)),
  49558. d(t, null, t.material, me.z, null);
  49559. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49560. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49561. var n = t.material;
  49562. if (!0 === n.visible) {
  49563. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49564. me.applyProjection(ge));
  49565. var r = we.update(t);
  49566. if (n instanceof Ci.MultiMaterial)
  49567. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49568. var c = o[s]
  49569. , h = a[c.materialIndex];
  49570. !0 === h.visible && d(t, r, h, me.z, c)
  49571. }
  49572. else
  49573. d(t, r, n, me.z, null)
  49574. }
  49575. }
  49576. var u = t.children;
  49577. for (s = 0,
  49578. l = u.length; s < l; s++)
  49579. e(u[s], i)
  49580. }
  49581. }(e, t),
  49582. H.length = z + 1,
  49583. G.length = W + 1,
  49584. !0 === Z.sortObjects && (H.sort(s),
  49585. G.sort(l)),
  49586. function(e, t) {
  49587. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49588. for (i = ve.shadowsPointLight = 0,
  49589. n = e.length; i < n; i++)
  49590. if (o = (r = e[i]).color,
  49591. a = r.intensity,
  49592. s = r.distance,
  49593. r instanceof Ci.AmbientLight)
  49594. l += o.r * a,
  49595. c += o.g * a,
  49596. h += o.b * a;
  49597. else if (r instanceof Ci.DirectionalLight) {
  49598. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49599. v.direction.setFromMatrixPosition(r.matrixWorld),
  49600. me.setFromMatrixPosition(r.target.matrixWorld),
  49601. v.direction.sub(me),
  49602. v.direction.transformDirection(u),
  49603. v.shadow = r.castShadow,
  49604. r.castShadow && (v.shadowBias = r.shadow.bias,
  49605. v.shadowRadius = r.shadow.radius,
  49606. v.shadowMapSize = r.shadow.mapSize,
  49607. ve.shadows[m++] = r),
  49608. ve.directionalShadowMap[d] = r.shadow.map,
  49609. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49610. ve.directional[d++] = v
  49611. } else if (r instanceof Ci.SpotLight) {
  49612. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49613. v.position.applyMatrix4(u),
  49614. v.color.copy(o).multiplyScalar(a),
  49615. v.distance = s,
  49616. v.direction.setFromMatrixPosition(r.matrixWorld),
  49617. me.setFromMatrixPosition(r.target.matrixWorld),
  49618. v.direction.sub(me),
  49619. v.direction.transformDirection(u),
  49620. v.coneCos = Math.cos(r.angle),
  49621. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49622. v.decay = 0 === r.distance ? 0 : r.decay,
  49623. v.shadow = r.castShadow,
  49624. r.castShadow && (v.shadowBias = r.shadow.bias,
  49625. v.shadowRadius = r.shadow.radius,
  49626. v.shadowMapSize = r.shadow.mapSize,
  49627. ve.shadows[m++] = r),
  49628. ve.spotShadowMap[f] = r.shadow.map,
  49629. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49630. ve.spot[f++] = v
  49631. } else if (r instanceof Ci.PointLight) {
  49632. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49633. v.position.applyMatrix4(u),
  49634. v.color.copy(r.color).multiplyScalar(r.intensity),
  49635. v.distance = r.distance,
  49636. v.decay = 0 === r.distance ? 0 : r.decay,
  49637. v.shadow = r.castShadow,
  49638. r.castShadow && (v.shadowBias = r.shadow.bias,
  49639. v.shadowRadius = r.shadow.radius,
  49640. v.shadowMapSize = r.shadow.mapSize,
  49641. ve.shadows[m++] = r),
  49642. ve.pointShadowMap[p] = r.shadow.map,
  49643. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49644. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49645. ve.pointShadowMatrix[p].identity().setPosition(me),
  49646. ve.point[p++] = v
  49647. } else if (r instanceof Ci.HemisphereLight) {
  49648. var v;
  49649. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49650. v.direction.transformDirection(u),
  49651. v.direction.normalize(),
  49652. v.skyColor.copy(r.color).multiplyScalar(a),
  49653. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49654. ve.hemi[g++] = v
  49655. }
  49656. ve.ambient[0] = l,
  49657. ve.ambient[1] = c,
  49658. ve.ambient[2] = h,
  49659. ve.directional.length = d,
  49660. ve.spot.length = f,
  49661. ve.point.length = p,
  49662. ve.hemi.length = g,
  49663. ve.shadows.length = m,
  49664. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49665. }(U, t),
  49666. Re.render(e, t),
  49667. Ae.calls = 0,
  49668. Ae.vertices = 0,
  49669. Ae.faces = 0,
  49670. void (Ae.points = 0) === i && (i = null),
  49671. this.setRenderTarget(i),
  49672. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49673. e.overrideMaterial) {
  49674. var o = e.overrideMaterial;
  49675. c(H, t, r, o),
  49676. c(G, t, r, o)
  49677. } else
  49678. _e.setBlending(Ci.NoBlending),
  49679. c(H, t, r),
  49680. c(G, t, r);
  49681. if (Oe.render(e, t),
  49682. Le.render(e, t, re),
  49683. i) {
  49684. var a = i.texture;
  49685. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49686. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49687. , i = be.get(e.texture).__webglTexture;
  49688. _e.bindTexture(t, i),
  49689. X.generateMipmap(t),
  49690. _e.bindTexture(t, null)
  49691. }(i)
  49692. }
  49693. _e.setDepthTest(!0),
  49694. _e.setDepthWrite(!0),
  49695. _e.setColorWrite(!0)
  49696. } else
  49697. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49698. }
  49699. ,
  49700. this.setFaceCulling = function(e, t) {
  49701. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49702. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49703. _e.enable(X.CULL_FACE))
  49704. }
  49705. ,
  49706. this.setTexture = function(e, t) {
  49707. var i = be.get(e);
  49708. if (0 < e.version && i.__version !== e.version) {
  49709. var n = e.image;
  49710. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  49711. }
  49712. _e.activeTexture(X.TEXTURE0 + t),
  49713. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49714. }
  49715. ,
  49716. this.getCurrentRenderTarget = function() {
  49717. return Q
  49718. }
  49719. ,
  49720. this.setRenderTarget = function(e) {
  49721. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49722. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49723. if (e) {
  49724. var n = be.get(e);
  49725. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49726. ie.copy(e.scissor),
  49727. ne = e.scissorTest,
  49728. re.copy(e.viewport)
  49729. } else
  49730. t = null,
  49731. ie.copy(ue).multiplyScalar(he),
  49732. ne = de,
  49733. re.copy(pe).multiplyScalar(he);
  49734. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49735. J = t),
  49736. _e.scissor(ie),
  49737. _e.setScissorTest(ne),
  49738. _e.viewport(re),
  49739. i) {
  49740. var r = be.get(e.texture);
  49741. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49742. }
  49743. }
  49744. ,
  49745. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49746. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49747. var a = be.get(e).__webglFramebuffer;
  49748. if (a) {
  49749. var s = !1;
  49750. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49751. s = !0);
  49752. try {
  49753. var l = e.texture;
  49754. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49755. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49756. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  49757. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49758. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49759. } finally {
  49760. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49761. }
  49762. }
  49763. } else
  49764. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49765. }
  49766. }
  49767. ,
  49768. Ci.WebGLRenderTarget = function(e, t, i) {
  49769. this.uuid = Ci.Math.generateUUID(),
  49770. this.width = e,
  49771. this.height = t,
  49772. this.scissor = new Ci.Vector4(0,0,e,t),
  49773. this.scissorTest = !1,
  49774. this.viewport = new Ci.Vector4(0,0,e,t),
  49775. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49776. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49777. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49778. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49779. }
  49780. ,
  49781. Ci.WebGLRenderTarget.prototype = {
  49782. constructor: Ci.WebGLRenderTarget,
  49783. setSize: function(e, t) {
  49784. this.width === e && this.height === t || (this.width = e,
  49785. this.height = t,
  49786. this.dispose()),
  49787. this.viewport.set(0, 0, e, t),
  49788. this.scissor.set(0, 0, e, t)
  49789. },
  49790. clone: function() {
  49791. return (new this.constructor).copy(this)
  49792. },
  49793. copy: function(e) {
  49794. return this.width = e.width,
  49795. this.height = e.height,
  49796. this.viewport.copy(e.viewport),
  49797. this.texture = e.texture.clone(),
  49798. this.depthBuffer = e.depthBuffer,
  49799. this.stencilBuffer = e.stencilBuffer,
  49800. this
  49801. },
  49802. dispose: function() {
  49803. this.dispatchEvent({
  49804. type: "dispose"
  49805. })
  49806. }
  49807. },
  49808. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49809. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49810. Ci.WebGLRenderTarget.call(this, e, t, i),
  49811. this.activeCubeFace = 0,
  49812. this.activeMipMapLevel = 0
  49813. }
  49814. ,
  49815. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49816. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49817. Ci.WebGLBufferRenderer = function(r, o, a) {
  49818. var s;
  49819. this.setMode = function(e) {
  49820. s = e
  49821. }
  49822. ,
  49823. this.render = function(e, t) {
  49824. r.drawArrays(s, e, t),
  49825. a.calls++,
  49826. a.vertices += t,
  49827. s === r.TRIANGLES && (a.faces += t / 3)
  49828. }
  49829. ,
  49830. this.renderInstances = function(e) {
  49831. var t = o.get("ANGLE_instanced_arrays");
  49832. if (null !== t) {
  49833. var i = e.attributes.position
  49834. , n = 0;
  49835. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49836. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49837. a.calls++,
  49838. a.vertices += n * e.maxInstancedCount,
  49839. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49840. } else
  49841. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49842. }
  49843. }
  49844. ,
  49845. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49846. var s, l, c;
  49847. this.setMode = function(e) {
  49848. s = e
  49849. }
  49850. ,
  49851. this.setIndex = function(e) {
  49852. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49853. 4) : (l = r.UNSIGNED_SHORT,
  49854. 2)
  49855. }
  49856. ,
  49857. this.render = function(e, t) {
  49858. r.drawElements(s, t, l, e * c),
  49859. a.calls++,
  49860. a.vertices += t,
  49861. s === r.TRIANGLES && (a.faces += t / 3)
  49862. }
  49863. ,
  49864. this.renderInstances = function(e, t, i) {
  49865. var n = o.get("ANGLE_instanced_arrays");
  49866. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  49867. a.calls++,
  49868. a.vertices += i * e.maxInstancedCount,
  49869. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49870. }
  49871. }
  49872. ,
  49873. Ci.WebGLExtensions = function(i) {
  49874. var n = {};
  49875. this.get = function(e) {
  49876. if (void 0 !== n[e])
  49877. return n[e];
  49878. var t;
  49879. switch (e) {
  49880. case "EXT_texture_filter_anisotropic":
  49881. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49882. break;
  49883. case "WEBGL_compressed_texture_s3tc":
  49884. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49885. break;
  49886. case "WEBGL_compressed_texture_pvrtc":
  49887. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49888. break;
  49889. case "WEBGL_compressed_texture_etc1":
  49890. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49891. break;
  49892. default:
  49893. t = i.getExtension(e)
  49894. }
  49895. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49896. n[e] = t
  49897. }
  49898. }
  49899. ,
  49900. Ci.WebGLCapabilities = function(t, e, i) {
  49901. function n(e) {
  49902. if ("highp" === e) {
  49903. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49904. return "highp";
  49905. e = "mediump"
  49906. }
  49907. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  49908. }
  49909. this.getMaxPrecision = n,
  49910. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49911. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49912. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49913. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49914. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49915. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49916. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49917. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49918. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49919. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49920. this.vertexTextures = 0 < this.maxVertexTextures,
  49921. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49922. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49923. var r = n(this.precision);
  49924. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49925. this.precision = r),
  49926. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49927. }
  49928. ,
  49929. Ci.WebGLGeometries = function(i, o, a) {
  49930. function s(e) {
  49931. var t = e.target
  49932. , i = c[t.id];
  49933. null !== i.index && l(i.index),
  49934. function(e) {
  49935. for (var t in e)
  49936. l(e[t])
  49937. }(i.attributes),
  49938. t.removeEventListener("dispose", s),
  49939. delete c[t.id];
  49940. var n = o.get(t);
  49941. n.wireframe && l(n.wireframe),
  49942. o.delete(t);
  49943. var r = o.get(i);
  49944. r.wireframe && l(r.wireframe),
  49945. o.delete(i),
  49946. a.memory.geometries--
  49947. }
  49948. function l(e) {
  49949. var t = function(e) {
  49950. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49951. }(e);
  49952. void 0 !== t && (i.deleteBuffer(t),
  49953. function(e) {
  49954. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49955. }(e))
  49956. }
  49957. var c = {};
  49958. this.get = function(e) {
  49959. var t, i = e.geometry;
  49960. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49961. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49962. t = i._bufferGeometry),
  49963. c[i.id] = t,
  49964. a.memory.geometries++,
  49965. t)
  49966. }
  49967. }
  49968. ,
  49969. Ci.WebGLLights = function() {
  49970. var i = {};
  49971. this.get = function(e) {
  49972. if (void 0 !== i[e.id])
  49973. return i[e.id];
  49974. var t;
  49975. switch (e.type) {
  49976. case "DirectionalLight":
  49977. t = {
  49978. direction: new Ci.Vector3,
  49979. color: new Ci.Color,
  49980. shadow: !1,
  49981. shadowBias: 0,
  49982. shadowRadius: 1,
  49983. shadowMapSize: new Ci.Vector2
  49984. };
  49985. break;
  49986. case "SpotLight":
  49987. t = {
  49988. position: new Ci.Vector3,
  49989. direction: new Ci.Vector3,
  49990. color: new Ci.Color,
  49991. distance: 0,
  49992. coneCos: 0,
  49993. penumbraCos: 0,
  49994. decay: 0,
  49995. shadow: !1,
  49996. shadowBias: 0,
  49997. shadowRadius: 1,
  49998. shadowMapSize: new Ci.Vector2
  49999. };
  50000. break;
  50001. case "PointLight":
  50002. t = {
  50003. position: new Ci.Vector3,
  50004. color: new Ci.Color,
  50005. distance: 0,
  50006. decay: 0,
  50007. shadow: !1,
  50008. shadowBias: 0,
  50009. shadowRadius: 1,
  50010. shadowMapSize: new Ci.Vector2
  50011. };
  50012. break;
  50013. case "HemisphereLight":
  50014. t = {
  50015. direction: new Ci.Vector3,
  50016. skyColor: new Ci.Color,
  50017. groundColor: new Ci.Color
  50018. }
  50019. }
  50020. return i[e.id] = t
  50021. }
  50022. }
  50023. ,
  50024. Ci.WebGLObjects = function(g, m, e) {
  50025. function v(e, t) {
  50026. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50027. , n = m.get(i);
  50028. void 0 === n.__webglBuffer ? function(e, t, i) {
  50029. e.__webglBuffer = g.createBuffer(),
  50030. g.bindBuffer(i, e.__webglBuffer);
  50031. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50032. g.bufferData(i, t.array, n),
  50033. e.version = t.version
  50034. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50035. g.bindBuffer(i, e.__webglBuffer),
  50036. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.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.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  50037. t.updateRange.count = 0),
  50038. e.version = t.version
  50039. }(n, i, t)
  50040. }
  50041. function y(e, t, i) {
  50042. if (i < t) {
  50043. var n = t;
  50044. t = i,
  50045. i = n
  50046. }
  50047. var r = e[t];
  50048. return void 0 === r ? (e[t] = [i],
  50049. !0) : -1 === r.indexOf(i) && (r.push(i),
  50050. !0)
  50051. }
  50052. var c = new Ci.WebGLGeometries(g,m,e);
  50053. this.getAttributeBuffer = function(e) {
  50054. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50055. }
  50056. ,
  50057. this.getWireframeAttribute = function(e) {
  50058. var t = m.get(e);
  50059. if (void 0 !== t.wireframe)
  50060. return t.wireframe;
  50061. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50062. if (null !== r)
  50063. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50064. var h = i[l + 0]
  50065. , u = i[l + 1]
  50066. , d = i[l + 2];
  50067. y(s, h, u) && n.push(h, u),
  50068. y(s, u, d) && n.push(u, d),
  50069. y(s, d, h) && n.push(d, h)
  50070. }
  50071. else
  50072. for (l = 0,
  50073. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50074. h = l + 0,
  50075. u = l + 1,
  50076. d = l + 2;
  50077. n.push(h, u, u, d, d, h)
  50078. }
  50079. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50080. , f = new Ci.BufferAttribute(new p(n),1);
  50081. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50082. t.wireframe = f
  50083. }
  50084. ,
  50085. this.update = function(e) {
  50086. var t = c.get(e);
  50087. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50088. var i = t.index
  50089. , n = t.attributes;
  50090. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50091. n)
  50092. v(n[r], g.ARRAY_BUFFER);
  50093. var o = t.morphAttributes;
  50094. for (var r in o)
  50095. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50096. v(a[s], g.ARRAY_BUFFER);
  50097. return t
  50098. }
  50099. }
  50100. ,
  50101. Ci.WebGLProgram = (Qt = 0,
  50102. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50103. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50104. ei = /^([\w\d_]+)\[0\]$/,
  50105. function(e, t, i, n) {
  50106. var r = e.context
  50107. , o = i.extensions
  50108. , a = i.defines
  50109. , s = i.__webglShader.vertexShader
  50110. , l = i.__webglShader.fragmentShader
  50111. , c = "SHADOWMAP_TYPE_BASIC";
  50112. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50113. var h = "ENVMAP_TYPE_CUBE"
  50114. , u = "ENVMAP_MODE_REFLECTION"
  50115. , d = "ENVMAP_BLENDING_MULTIPLY";
  50116. if (n.envMap) {
  50117. switch (i.envMap.mapping) {
  50118. case Ci.CubeReflectionMapping:
  50119. case Ci.CubeRefractionMapping:
  50120. h = "ENVMAP_TYPE_CUBE";
  50121. break;
  50122. case Ci.CubeUVReflectionMapping:
  50123. case Ci.CubeUVRefractionMapping:
  50124. h = "ENVMAP_TYPE_CUBE_UV";
  50125. break;
  50126. case Ci.EquirectangularReflectionMapping:
  50127. case Ci.EquirectangularRefractionMapping:
  50128. h = "ENVMAP_TYPE_EQUIREC";
  50129. break;
  50130. case Ci.SphericalReflectionMapping:
  50131. h = "ENVMAP_TYPE_SPHERE"
  50132. }
  50133. switch (i.envMap.mapping) {
  50134. case Ci.CubeRefractionMapping:
  50135. case Ci.EquirectangularRefractionMapping:
  50136. u = "ENVMAP_MODE_REFRACTION"
  50137. }
  50138. switch (i.combine) {
  50139. case Ci.MultiplyOperation:
  50140. d = "ENVMAP_BLENDING_MULTIPLY";
  50141. break;
  50142. case Ci.MixOperation:
  50143. d = "ENVMAP_BLENDING_MIX";
  50144. break;
  50145. case Ci.AddOperation:
  50146. d = "ENVMAP_BLENDING_ADD"
  50147. }
  50148. }
  50149. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50150. return [(e = 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" : ""].filter(Pi).join("\n")
  50151. }(o, n, e.extensions), v = function(e) {
  50152. var t = [];
  50153. for (var i in e) {
  50154. var n = e[i];
  50155. !1 !== n && t.push("#define " + i + " " + n)
  50156. }
  50157. return t.join("\n")
  50158. }(a), y = r.createProgram();
  50159. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.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(Pi).join("\n"),
  50160. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  50161. var i;
  50162. switch (t) {
  50163. case Ci.LinearToneMapping:
  50164. i = "Linear";
  50165. break;
  50166. case Ci.ReinhardToneMapping:
  50167. i = "Reinhard";
  50168. break;
  50169. case Ci.Uncharted2ToneMapping:
  50170. i = "Uncharted2";
  50171. break;
  50172. case Ci.CineonToneMapping:
  50173. i = "OptimizedCineon";
  50174. break;
  50175. default:
  50176. throw new Error("unsupported toneMapping: " + t)
  50177. }
  50178. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50179. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  50180. var i = Mi(t);
  50181. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50182. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50183. s = Oi(s = Li(s), n),
  50184. l = Oi(l = Li(l), n),
  50185. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50186. l = Di(l));
  50187. var A = p + s
  50188. , C = f + l
  50189. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50190. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50191. r.attachShader(y, I),
  50192. r.attachShader(y, E),
  50193. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50194. r.linkProgram(y);
  50195. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50196. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50197. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  50198. M && (this.diagnostics = {
  50199. runnable: S,
  50200. material: i,
  50201. programLog: w,
  50202. vertexShader: {
  50203. log: T,
  50204. prefix: p
  50205. },
  50206. fragmentShader: {
  50207. log: x,
  50208. prefix: f
  50209. }
  50210. }),
  50211. r.deleteShader(I),
  50212. r.deleteShader(E),
  50213. this.getUniforms = function() {
  50214. return void 0 === _ && (_ = function(e, t) {
  50215. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50216. var o = e.getActiveUniform(t, r).name
  50217. , a = e.getUniformLocation(t, o)
  50218. , s = Jt.exec(o);
  50219. if (s) {
  50220. var l = s[1]
  50221. , c = s[2]
  50222. , h = i[l];
  50223. (h = h || (i[l] = {}))[c] = a
  50224. } else if (s = $t.exec(o)) {
  50225. var u = s[1]
  50226. , d = s[2]
  50227. , p = s[3]
  50228. , f = i[u]
  50229. , g = (f = f || (i[u] = []))[d];
  50230. (g = g || (f[d] = {}))[p] = a
  50231. } else
  50232. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50233. }
  50234. return i
  50235. }(r, y)),
  50236. _
  50237. }
  50238. ,
  50239. this.getAttributes = function() {
  50240. return void 0 === b && (b = function(e, t) {
  50241. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50242. var o = e.getActiveAttrib(t, r).name;
  50243. i[o] = e.getAttribLocation(t, o)
  50244. }
  50245. return i
  50246. }(r, y)),
  50247. b
  50248. }
  50249. ,
  50250. this.destroy = function() {
  50251. r.deleteProgram(y),
  50252. this.program = void 0
  50253. }
  50254. ,
  50255. Object.defineProperties(this, {
  50256. uniforms: {
  50257. get: function() {
  50258. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50259. this.getUniforms()
  50260. }
  50261. },
  50262. attributes: {
  50263. get: function() {
  50264. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50265. this.getAttributes()
  50266. }
  50267. }
  50268. }),
  50269. this.id = Qt++,
  50270. this.code = t,
  50271. this.usedTimes = 1,
  50272. this.program = y,
  50273. this.vertexShader = I,
  50274. this.fragmentShader = E,
  50275. this
  50276. }
  50277. ),
  50278. Ci.WebGLPrograms = function(s, l) {
  50279. function c(e, t) {
  50280. var i;
  50281. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50282. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50283. i
  50284. }
  50285. var h = []
  50286. , u = {
  50287. MeshDepthMaterial: "depth",
  50288. MeshNormalMaterial: "normal",
  50289. MeshBasicMaterial: "basic",
  50290. MeshLambertMaterial: "lambert",
  50291. MeshPhongMaterial: "phong",
  50292. MeshStandardMaterial: "standard",
  50293. LineBasicMaterial: "basic",
  50294. LineDashedMaterial: "dashed",
  50295. PointsMaterial: "points"
  50296. }
  50297. , a = ["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"];
  50298. this.getParameters = function(e, t, i, n) {
  50299. var r = u[e.type]
  50300. , o = function(e) {
  50301. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50302. return 1024;
  50303. var t = l.maxVertexUniforms
  50304. , i = Math.floor((t - 20) / 4);
  50305. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  50306. i
  50307. }(n)
  50308. , a = s.getPrecision();
  50309. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50310. {
  50311. shaderID: r,
  50312. precision: a,
  50313. supportsVertexTextures: l.vertexTextures,
  50314. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50315. map: !!e.map,
  50316. mapEncoding: c(e.map, s.gammaInput),
  50317. envMap: !!e.envMap,
  50318. envMapMode: e.envMap && e.envMap.mapping,
  50319. envMapEncoding: c(e.envMap, s.gammaInput),
  50320. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50321. lightMap: !!e.lightMap,
  50322. aoMap: !!e.aoMap,
  50323. emissiveMap: !!e.emissiveMap,
  50324. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50325. bumpMap: !!e.bumpMap,
  50326. normalMap: !!e.normalMap,
  50327. displacementMap: !!e.displacementMap,
  50328. roughnessMap: !!e.roughnessMap,
  50329. metalnessMap: !!e.metalnessMap,
  50330. specularMap: !!e.specularMap,
  50331. alphaMap: !!e.alphaMap,
  50332. combine: e.combine,
  50333. vertexColors: e.vertexColors,
  50334. fog: i,
  50335. useFog: e.fog,
  50336. fogExp: i instanceof Ci.FogExp2,
  50337. flatShading: e.shading === Ci.FlatShading,
  50338. sizeAttenuation: e.sizeAttenuation,
  50339. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50340. skinning: e.skinning,
  50341. maxBones: o,
  50342. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50343. morphTargets: e.morphTargets,
  50344. morphNormals: e.morphNormals,
  50345. maxMorphTargets: s.maxMorphTargets,
  50346. maxMorphNormals: s.maxMorphNormals,
  50347. numDirLights: t.directional.length,
  50348. numPointLights: t.point.length,
  50349. numSpotLights: t.spot.length,
  50350. numHemiLights: t.hemi.length,
  50351. pointLightShadows: t.shadowsPointLight,
  50352. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50353. shadowMapType: s.shadowMap.type,
  50354. toneMapping: s.toneMapping,
  50355. physicallyCorrectLights: s.physicallyCorrectLights,
  50356. premultipliedAlpha: e.premultipliedAlpha,
  50357. alphaTest: e.alphaTest,
  50358. doubleSided: e.side === Ci.DoubleSide,
  50359. flipSided: e.side === Ci.BackSide
  50360. }
  50361. }
  50362. ,
  50363. this.getProgramCode = function(e, t) {
  50364. var i = [];
  50365. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50366. i.push(e.vertexShader)),
  50367. void 0 !== e.defines)
  50368. for (var n in e.defines)
  50369. i.push(n),
  50370. i.push(e.defines[n]);
  50371. for (var r = 0; r < a.length; r++) {
  50372. var o = a[r];
  50373. i.push(o),
  50374. i.push(t[o])
  50375. }
  50376. return i.join()
  50377. }
  50378. ,
  50379. this.acquireProgram = function(e, t, i) {
  50380. for (var n, r = 0, o = h.length; r < o; r++) {
  50381. var a = h[r];
  50382. if (a.code === i) {
  50383. ++(n = a).usedTimes;
  50384. break
  50385. }
  50386. }
  50387. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50388. h.push(n)),
  50389. n
  50390. }
  50391. ,
  50392. this.releaseProgram = function(e) {
  50393. if (0 == --e.usedTimes) {
  50394. var t = h.indexOf(e);
  50395. h[t] = h[h.length - 1],
  50396. h.pop(),
  50397. e.destroy()
  50398. }
  50399. }
  50400. ,
  50401. this.programs = h
  50402. }
  50403. ,
  50404. Ci.WebGLProperties = function() {
  50405. var n = {};
  50406. this.get = function(e) {
  50407. var t = e.uuid
  50408. , i = n[t];
  50409. return void 0 === i && (i = {},
  50410. n[t] = i),
  50411. i
  50412. }
  50413. ,
  50414. this.delete = function(e) {
  50415. delete n[e.uuid]
  50416. }
  50417. ,
  50418. this.clear = function() {
  50419. n = {}
  50420. }
  50421. }
  50422. ,
  50423. Ci.WebGLShader = function(e, t, i) {
  50424. var n = e.createShader(t);
  50425. return e.shaderSource(n, i),
  50426. e.compileShader(n),
  50427. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50428. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50429. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50430. t[i] = i + 1 + ": " + t[i];
  50431. return t.join("\n")
  50432. }(i)),
  50433. n
  50434. }
  50435. ,
  50436. Ci.WebGLShadowMap = function(P, O, L) {
  50437. function D(e, t, i, n) {
  50438. var r = e.geometry
  50439. , o = null
  50440. , a = p
  50441. , s = e.customDepthMaterial;
  50442. if (i && (a = f,
  50443. s = e.customDistanceMaterial),
  50444. s)
  50445. o = s;
  50446. else {
  50447. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50448. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50449. , h = 0;
  50450. l && (h |= u),
  50451. c && (h |= d),
  50452. o = a[h]
  50453. }
  50454. return o.visible = t.visible,
  50455. o.wireframe = t.wireframe,
  50456. o.wireframeLinewidth = t.wireframeLinewidth,
  50457. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50458. o
  50459. }
  50460. function N(e, t, i) {
  50461. if (!1 !== e.visible) {
  50462. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  50463. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50464. G.push(e));
  50465. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50466. N(n[r], t, i)
  50467. }
  50468. }
  50469. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  50470. var a = 0 != (o & u)
  50471. , s = 0 != (o & d)
  50472. , l = new Ci.ShaderMaterial({
  50473. uniforms: i,
  50474. vertexShader: t.vertexShader,
  50475. fragmentShader: t.fragmentShader,
  50476. morphTargets: a,
  50477. skinning: s
  50478. });
  50479. p[o] = l;
  50480. var c = new Ci.ShaderMaterial({
  50481. defines: {
  50482. USE_SHADOWMAP: ""
  50483. },
  50484. uniforms: r,
  50485. vertexShader: n.vertexShader,
  50486. fragmentShader: n.fragmentShader,
  50487. morphTargets: a,
  50488. skinning: s
  50489. });
  50490. f[o] = c
  50491. }
  50492. var q = this;
  50493. this.enabled = !1,
  50494. this.autoUpdate = !0,
  50495. this.needsUpdate = !1,
  50496. this.type = Ci.PCFShadowMap,
  50497. this.cullFace = Ci.CullFaceFront,
  50498. this.render = function(e, t) {
  50499. var i, n, r = O.shadows;
  50500. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50501. B.clearColor(1, 1, 1, 1),
  50502. B.disable(F.BLEND),
  50503. B.enable(F.CULL_FACE),
  50504. F.frontFace(F.CCW),
  50505. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50506. B.setDepthTest(!0),
  50507. B.setScissorTest(!1);
  50508. for (var o = 0, a = r.length; o < a; o++) {
  50509. var s = r[o]
  50510. , l = s.shadow
  50511. , c = l.camera;
  50512. if (U.copy(l.mapSize),
  50513. s instanceof Ci.PointLight) {
  50514. i = 6,
  50515. n = !0;
  50516. var h = U.x
  50517. , u = U.y;
  50518. Y[0].set(2 * h, u, h, u),
  50519. Y[1].set(0, u, h, u),
  50520. Y[2].set(3 * h, u, h, u),
  50521. Y[3].set(h, u, h, u),
  50522. Y[4].set(3 * h, 0, h, u),
  50523. Y[5].set(h, 0, h, u),
  50524. U.x *= 4,
  50525. U.y *= 2
  50526. } else
  50527. n = !(i = 1);
  50528. if (null === l.map) {
  50529. var d = {
  50530. minFilter: Ci.NearestFilter,
  50531. magFilter: Ci.NearestFilter,
  50532. format: Ci.RGBAFormat
  50533. };
  50534. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50535. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50536. c.updateProjectionMatrix()
  50537. }
  50538. var p = l.map
  50539. , f = l.matrix;
  50540. z.setFromMatrixPosition(s.matrixWorld),
  50541. c.position.copy(z),
  50542. P.setRenderTarget(p),
  50543. P.clear();
  50544. for (var g = 0; g < i; g++) {
  50545. if (n) {
  50546. H.copy(c.position),
  50547. H.add(W[g]),
  50548. c.up.copy(j[g]),
  50549. c.lookAt(H);
  50550. var m = Y[g];
  50551. B.viewport(m)
  50552. } else
  50553. H.setFromMatrixPosition(s.target.matrixWorld),
  50554. c.lookAt(H);
  50555. c.updateMatrixWorld(),
  50556. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50557. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50558. f.multiply(c.projectionMatrix),
  50559. f.multiply(c.matrixWorldInverse),
  50560. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50561. V.setFromMatrix(k),
  50562. G.length = 0,
  50563. N(e, t, c);
  50564. for (var v = 0, y = G.length; v < y; v++) {
  50565. var A = G[v]
  50566. , C = L.update(A)
  50567. , I = A.material;
  50568. if (I instanceof Ci.MultiMaterial)
  50569. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50570. var T = E[b]
  50571. , x = _[T.materialIndex];
  50572. if (!0 === x.visible) {
  50573. var S = D(A, x, n, z);
  50574. P.renderBufferDirect(c, null, C, S, A, T)
  50575. }
  50576. }
  50577. else {
  50578. S = D(A, I, n, z);
  50579. P.renderBufferDirect(c, null, C, S, A, null)
  50580. }
  50581. }
  50582. }
  50583. }
  50584. var M = P.getClearColor()
  50585. , R = P.getClearAlpha();
  50586. P.setClearColor(M, R),
  50587. B.enable(F.BLEND),
  50588. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50589. q.needsUpdate = !1
  50590. }
  50591. }
  50592. }
  50593. ,
  50594. Ci.WebGLState = function(l, i, c) {
  50595. var n = this
  50596. , r = new Ci.Vector4
  50597. , o = new Uint8Array(16)
  50598. , a = new Uint8Array(16)
  50599. , s = new Uint8Array(16)
  50600. , t = {}
  50601. , h = null
  50602. , u = null
  50603. , d = null
  50604. , p = null
  50605. , f = null
  50606. , g = null
  50607. , m = null
  50608. , v = null
  50609. , y = !1
  50610. , A = null
  50611. , C = null
  50612. , I = null
  50613. , E = null
  50614. , _ = null
  50615. , b = null
  50616. , w = null
  50617. , T = null
  50618. , x = null
  50619. , S = null
  50620. , M = null
  50621. , R = null
  50622. , P = null
  50623. , O = null
  50624. , L = null
  50625. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50626. , N = void 0
  50627. , F = {}
  50628. , B = new Ci.Vector4
  50629. , V = null
  50630. , k = null
  50631. , U = new Ci.Vector4
  50632. , H = new Ci.Vector4
  50633. , z = l.createTexture();
  50634. l.bindTexture(l.TEXTURE_2D, z),
  50635. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50636. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50637. this.init = function() {
  50638. this.clearColor(0, 0, 0, 1),
  50639. this.clearDepth(1),
  50640. this.clearStencil(0),
  50641. this.enable(l.DEPTH_TEST),
  50642. l.depthFunc(l.LEQUAL),
  50643. l.frontFace(l.CCW),
  50644. l.cullFace(l.BACK),
  50645. this.enable(l.CULL_FACE),
  50646. this.enable(l.BLEND),
  50647. l.blendEquation(l.FUNC_ADD),
  50648. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50649. }
  50650. ,
  50651. this.initAttributes = function() {
  50652. for (var e = 0, t = o.length; e < t; e++)
  50653. o[e] = 0
  50654. }
  50655. ,
  50656. this.enableAttribute = function(e) {
  50657. o[e] = 1,
  50658. 0 === a[e] && (l.enableVertexAttribArray(e),
  50659. a[e] = 1),
  50660. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50661. s[e] = 0)
  50662. }
  50663. ,
  50664. this.enableAttributeAndDivisor = function(e, t, i) {
  50665. o[e] = 1,
  50666. 0 === a[e] && (l.enableVertexAttribArray(e),
  50667. a[e] = 1),
  50668. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50669. s[e] = t)
  50670. }
  50671. ,
  50672. this.disableUnusedAttributes = function() {
  50673. for (var e = 0, t = a.length; e < t; e++)
  50674. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50675. a[e] = 0)
  50676. }
  50677. ,
  50678. this.enable = function(e) {
  50679. !0 !== t[e] && (l.enable(e),
  50680. t[e] = !0)
  50681. }
  50682. ,
  50683. this.disable = function(e) {
  50684. !1 !== t[e] && (l.disable(e),
  50685. t[e] = !1)
  50686. }
  50687. ,
  50688. this.getCompressedTextureFormats = function() {
  50689. if (null === h && (h = [],
  50690. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50691. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50692. h.push(e[t]);
  50693. return h
  50694. }
  50695. ,
  50696. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50697. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50698. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50699. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50700. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50701. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50702. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50703. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50704. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50705. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50706. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50707. u = e,
  50708. y = s),
  50709. e === Ci.CustomBlending ? (r = r || t,
  50710. o = o || i,
  50711. a = a || n,
  50712. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50713. d = t,
  50714. g = r),
  50715. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50716. p = i,
  50717. f = n,
  50718. m = o,
  50719. v = a)) : v = m = g = f = p = d = null
  50720. }
  50721. ,
  50722. this.setDepthFunc = function(e) {
  50723. if (A !== e) {
  50724. if (e)
  50725. switch (e) {
  50726. case Ci.NeverDepth:
  50727. l.depthFunc(l.NEVER);
  50728. break;
  50729. case Ci.AlwaysDepth:
  50730. l.depthFunc(l.ALWAYS);
  50731. break;
  50732. case Ci.LessDepth:
  50733. l.depthFunc(l.LESS);
  50734. break;
  50735. case Ci.LessEqualDepth:
  50736. l.depthFunc(l.LEQUAL);
  50737. break;
  50738. case Ci.EqualDepth:
  50739. l.depthFunc(l.EQUAL);
  50740. break;
  50741. case Ci.GreaterEqualDepth:
  50742. l.depthFunc(l.GEQUAL);
  50743. break;
  50744. case Ci.GreaterDepth:
  50745. l.depthFunc(l.GREATER);
  50746. break;
  50747. case Ci.NotEqualDepth:
  50748. l.depthFunc(l.NOTEQUAL);
  50749. break;
  50750. default:
  50751. l.depthFunc(l.LEQUAL)
  50752. }
  50753. else
  50754. l.depthFunc(l.LEQUAL);
  50755. A = e
  50756. }
  50757. }
  50758. ,
  50759. this.setDepthTest = function(e) {
  50760. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50761. }
  50762. ,
  50763. this.setDepthWrite = function(e) {
  50764. C !== e && (l.depthMask(e),
  50765. C = e)
  50766. }
  50767. ,
  50768. this.setColorWrite = function(e) {
  50769. I !== e && (l.colorMask(e, e, e, e),
  50770. I = e)
  50771. }
  50772. ,
  50773. this.setStencilFunc = function(e, t, i) {
  50774. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50775. _ = e,
  50776. b = t,
  50777. w = i)
  50778. }
  50779. ,
  50780. this.setStencilOp = function(e, t, i) {
  50781. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50782. T = e,
  50783. x = t,
  50784. S = i)
  50785. }
  50786. ,
  50787. this.setStencilTest = function(e) {
  50788. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50789. }
  50790. ,
  50791. this.setStencilWrite = function(e) {
  50792. E !== e && (l.stencilMask(e),
  50793. E = e)
  50794. }
  50795. ,
  50796. this.setFlipSided = function(e) {
  50797. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50798. M = e)
  50799. }
  50800. ,
  50801. this.setLineWidth = function(e) {
  50802. e !== R && (l.lineWidth(e),
  50803. R = e)
  50804. }
  50805. ,
  50806. this.setPolygonOffset = function(e, t, i) {
  50807. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50808. !e || P === t && O === i || (l.polygonOffset(t, i),
  50809. P = t,
  50810. O = i)
  50811. }
  50812. ,
  50813. this.getScissorTest = function() {
  50814. return L
  50815. }
  50816. ,
  50817. this.setScissorTest = function(e) {
  50818. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50819. }
  50820. ,
  50821. this.activeTexture = function(e) {
  50822. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50823. N !== e && (l.activeTexture(e),
  50824. N = e)
  50825. }
  50826. ,
  50827. this.bindTexture = function(e, t) {
  50828. void 0 === N && n.activeTexture();
  50829. var i = F[N];
  50830. void 0 === i && (i = {
  50831. type: void 0,
  50832. texture: void 0
  50833. },
  50834. F[N] = i),
  50835. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50836. i.type = e,
  50837. i.texture = t)
  50838. }
  50839. ,
  50840. this.compressedTexImage2D = function() {
  50841. try {
  50842. l.compressedTexImage2D.apply(l, arguments)
  50843. } catch (e) {
  50844. console.error(e)
  50845. }
  50846. }
  50847. ,
  50848. this.texImage2D = function() {
  50849. try {
  50850. l.texImage2D.apply(l, arguments)
  50851. } catch (e) {
  50852. console.error(e)
  50853. }
  50854. }
  50855. ,
  50856. this.clearColor = function(e, t, i, n) {
  50857. r.set(e, t, i, n),
  50858. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50859. B.copy(r))
  50860. }
  50861. ,
  50862. this.clearDepth = function(e) {
  50863. V !== e && (l.clearDepth(e),
  50864. V = e)
  50865. }
  50866. ,
  50867. this.clearStencil = function(e) {
  50868. k !== e && (l.clearStencil(e),
  50869. k = e)
  50870. }
  50871. ,
  50872. this.scissor = function(e) {
  50873. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50874. U.copy(e))
  50875. }
  50876. ,
  50877. this.viewport = function(e) {
  50878. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50879. H.copy(e))
  50880. }
  50881. ,
  50882. this.reset = function() {
  50883. for (var e = 0; e < a.length; e++)
  50884. 1 === a[e] && (l.disableVertexAttribArray(e),
  50885. a[e] = 0);
  50886. t = {},
  50887. N = void 0,
  50888. F = {},
  50889. M = E = C = I = u = h = null
  50890. }
  50891. }
  50892. ,
  50893. Ci.LensFlarePlugin = function(v, y) {
  50894. function A() {
  50895. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50896. C = S.createBuffer(),
  50897. I = S.createBuffer(),
  50898. S.bindBuffer(S.ARRAY_BUFFER, C),
  50899. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50900. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50901. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50902. T = S.createTexture(),
  50903. x = S.createTexture(),
  50904. M.bindTexture(S.TEXTURE_2D, T),
  50905. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50906. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50907. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50908. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50909. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50910. M.bindTexture(S.TEXTURE_2D, x),
  50911. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50912. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50913. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50914. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50915. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50916. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50917. 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"),
  50918. 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")
  50919. } : {
  50920. 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"),
  50921. 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")
  50922. },
  50923. E = function(e) {
  50924. var t = S.createProgram()
  50925. , i = S.createShader(S.FRAGMENT_SHADER)
  50926. , n = S.createShader(S.VERTEX_SHADER)
  50927. , r = "precision " + v.getPrecision() + " float;\n";
  50928. return S.shaderSource(i, r + e.fragmentShader),
  50929. S.shaderSource(n, r + e.vertexShader),
  50930. S.compileShader(i),
  50931. S.compileShader(n),
  50932. S.attachShader(t, i),
  50933. S.attachShader(t, n),
  50934. S.linkProgram(t),
  50935. t
  50936. }(e),
  50937. _ = {
  50938. vertex: S.getAttribLocation(E, "position"),
  50939. uv: S.getAttribLocation(E, "uv")
  50940. },
  50941. b = {
  50942. renderType: S.getUniformLocation(E, "renderType"),
  50943. map: S.getUniformLocation(E, "map"),
  50944. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50945. opacity: S.getUniformLocation(E, "opacity"),
  50946. color: S.getUniformLocation(E, "color"),
  50947. scale: S.getUniformLocation(E, "scale"),
  50948. rotation: S.getUniformLocation(E, "rotation"),
  50949. screenPosition: S.getUniformLocation(E, "screenPosition")
  50950. }
  50951. }
  50952. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50953. this.render = function(e, t, i) {
  50954. if (0 !== y.length) {
  50955. var n = new Ci.Vector3
  50956. , r = i.w / i.z
  50957. , o = .5 * i.z
  50958. , a = .5 * i.w
  50959. , s = 16 / i.w
  50960. , l = new Ci.Vector2(s * r,s)
  50961. , c = new Ci.Vector3(1,1,0)
  50962. , h = new Ci.Vector2(1,1);
  50963. void 0 === E && A(),
  50964. S.useProgram(E),
  50965. M.initAttributes(),
  50966. M.enableAttribute(_.vertex),
  50967. M.enableAttribute(_.uv),
  50968. M.disableUnusedAttributes(),
  50969. S.uniform1i(b.occlusionMap, 0),
  50970. S.uniform1i(b.map, 1),
  50971. S.bindBuffer(S.ARRAY_BUFFER, C),
  50972. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50973. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50974. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50975. M.disable(S.CULL_FACE),
  50976. M.setDepthWrite(!1);
  50977. for (var u = 0, d = y.length; u < d; u++) {
  50978. s = 16 / i.w,
  50979. l.set(s * r, s);
  50980. var p = y[u];
  50981. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50982. n.applyMatrix4(t.matrixWorldInverse),
  50983. n.applyProjection(t.projectionMatrix),
  50984. c.copy(n),
  50985. h.x = c.x * o + o,
  50986. h.y = c.y * a + a,
  50987. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50988. M.activeTexture(S.TEXTURE0),
  50989. M.bindTexture(S.TEXTURE_2D, null),
  50990. M.activeTexture(S.TEXTURE1),
  50991. M.bindTexture(S.TEXTURE_2D, T),
  50992. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50993. S.uniform1i(b.renderType, 0),
  50994. S.uniform2f(b.scale, l.x, l.y),
  50995. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50996. M.disable(S.BLEND),
  50997. M.enable(S.DEPTH_TEST),
  50998. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50999. M.activeTexture(S.TEXTURE0),
  51000. M.bindTexture(S.TEXTURE_2D, x),
  51001. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51002. S.uniform1i(b.renderType, 1),
  51003. M.disable(S.DEPTH_TEST),
  51004. M.activeTexture(S.TEXTURE1),
  51005. M.bindTexture(S.TEXTURE_2D, T),
  51006. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51007. p.positionScreen.copy(c),
  51008. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51009. S.uniform1i(b.renderType, 2),
  51010. M.enable(S.BLEND);
  51011. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51012. var m = p.lensFlares[f];
  51013. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51014. c.y = m.y,
  51015. c.z = m.z,
  51016. s = m.size * m.scale / i.w,
  51017. l.x = s * r,
  51018. l.y = s,
  51019. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51020. S.uniform2f(b.scale, l.x, l.y),
  51021. S.uniform1f(b.rotation, m.rotation),
  51022. S.uniform1f(b.opacity, m.opacity),
  51023. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51024. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51025. v.setTexture(m.texture, 1),
  51026. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51027. }
  51028. }
  51029. }
  51030. M.enable(S.CULL_FACE),
  51031. M.enable(S.DEPTH_TEST),
  51032. M.setDepthWrite(!0),
  51033. v.resetGLState()
  51034. }
  51035. }
  51036. }
  51037. ,
  51038. Ci.SpritePlugin = function(u, d) {
  51039. function p() {
  51040. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51041. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51042. g = I.createBuffer(),
  51043. m = I.createBuffer(),
  51044. I.bindBuffer(I.ARRAY_BUFFER, g),
  51045. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51046. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51047. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51048. v = function() {
  51049. var e = I.createProgram()
  51050. , t = I.createShader(I.VERTEX_SHADER)
  51051. , i = I.createShader(I.FRAGMENT_SHADER);
  51052. return I.shaderSource(t, ["precision " + u.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")),
  51053. I.shaderSource(i, ["precision " + u.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")),
  51054. I.compileShader(t),
  51055. I.compileShader(i),
  51056. I.attachShader(e, t),
  51057. I.attachShader(e, i),
  51058. I.linkProgram(e),
  51059. e
  51060. }(),
  51061. y = {
  51062. position: I.getAttribLocation(v, "position"),
  51063. uv: I.getAttribLocation(v, "uv")
  51064. },
  51065. A = {
  51066. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51067. uvScale: I.getUniformLocation(v, "uvScale"),
  51068. rotation: I.getUniformLocation(v, "rotation"),
  51069. scale: I.getUniformLocation(v, "scale"),
  51070. color: I.getUniformLocation(v, "color"),
  51071. map: I.getUniformLocation(v, "map"),
  51072. opacity: I.getUniformLocation(v, "opacity"),
  51073. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51074. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51075. fogType: I.getUniformLocation(v, "fogType"),
  51076. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51077. fogNear: I.getUniformLocation(v, "fogNear"),
  51078. fogFar: I.getUniformLocation(v, "fogFar"),
  51079. fogColor: I.getUniformLocation(v, "fogColor"),
  51080. alphaTest: I.getUniformLocation(v, "alphaTest")
  51081. };
  51082. var i = document.createElement("canvas");
  51083. i.width = 8,
  51084. i.height = 8;
  51085. var n = i.getContext("2d");
  51086. n.fillStyle = "white",
  51087. n.fillRect(0, 0, 8, 8),
  51088. (C = new Ci.Texture(i)).needsUpdate = !0
  51089. }
  51090. function f(e, t) {
  51091. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51092. }
  51093. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51094. this.render = function(e, t) {
  51095. if (0 !== d.length) {
  51096. void 0 === v && p(),
  51097. I.useProgram(v),
  51098. E.initAttributes(),
  51099. E.enableAttribute(y.position),
  51100. E.enableAttribute(y.uv),
  51101. E.disableUnusedAttributes(),
  51102. E.disable(I.CULL_FACE),
  51103. E.enable(I.BLEND),
  51104. I.bindBuffer(I.ARRAY_BUFFER, g),
  51105. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51106. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51107. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51108. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51109. E.activeTexture(I.TEXTURE0),
  51110. I.uniform1i(A.map, 0);
  51111. var i = 0
  51112. , n = 0
  51113. , r = e.fog;
  51114. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51115. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51116. I.uniform1f(A.fogFar, r.far),
  51117. I.uniform1i(A.fogType, 1),
  51118. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51119. I.uniform1i(A.fogType, 2),
  51120. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51121. n = i = 0);
  51122. for (var o = 0, a = d.length; o < a; o++) {
  51123. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51124. l.z = -l.modelViewMatrix.elements[14]
  51125. }
  51126. d.sort(f);
  51127. var s = [];
  51128. for (o = 0,
  51129. a = d.length; o < a; o++) {
  51130. var l, c = (l = d[o]).material;
  51131. I.uniform1f(A.alphaTest, c.alphaTest),
  51132. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51133. l.matrixWorld.decompose(_, b, w),
  51134. s[0] = w.x,
  51135. s[1] = w.y;
  51136. var h = 0;
  51137. e.fog && c.fog && (h = n),
  51138. i !== h && (I.uniform1i(A.fogType, h),
  51139. i = h),
  51140. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51141. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51142. I.uniform2f(A.uvScale, 1, 1)),
  51143. I.uniform1f(A.opacity, c.opacity),
  51144. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51145. I.uniform1f(A.rotation, c.rotation),
  51146. I.uniform2fv(A.scale, s),
  51147. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51148. E.setDepthTest(c.depthTest),
  51149. E.setDepthWrite(c.depthWrite),
  51150. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51151. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51152. }
  51153. E.enable(I.CULL_FACE),
  51154. u.resetGLState()
  51155. }
  51156. }
  51157. }
  51158. ,
  51159. Object.defineProperties(Ci.Box2.prototype, {
  51160. empty: {
  51161. value: function() {
  51162. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51163. this.isEmpty()
  51164. }
  51165. },
  51166. isIntersectionBox: {
  51167. value: function(e) {
  51168. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51169. this.intersectsBox(e)
  51170. }
  51171. }
  51172. }),
  51173. Object.defineProperties(Ci.Box3.prototype, {
  51174. empty: {
  51175. value: function() {
  51176. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51177. this.isEmpty()
  51178. }
  51179. },
  51180. isIntersectionBox: {
  51181. value: function(e) {
  51182. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51183. this.intersectsBox(e)
  51184. }
  51185. },
  51186. isIntersectionSphere: {
  51187. value: function(e) {
  51188. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51189. this.intersectsSphere(e)
  51190. }
  51191. }
  51192. }),
  51193. Object.defineProperties(Ci.Matrix3.prototype, {
  51194. multiplyVector3: {
  51195. value: function(e) {
  51196. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51197. e.applyMatrix3(this)
  51198. }
  51199. },
  51200. multiplyVector3Array: {
  51201. value: function(e) {
  51202. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51203. this.applyToVector3Array(e)
  51204. }
  51205. }
  51206. }),
  51207. Object.defineProperties(Ci.Matrix4.prototype, {
  51208. extractPosition: {
  51209. value: function(e) {
  51210. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51211. this.copyPosition(e)
  51212. }
  51213. },
  51214. setRotationFromQuaternion: {
  51215. value: function(e) {
  51216. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51217. this.makeRotationFromQuaternion(e)
  51218. }
  51219. },
  51220. multiplyVector3: {
  51221. value: function(e) {
  51222. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51223. e.applyProjection(this)
  51224. }
  51225. },
  51226. multiplyVector4: {
  51227. value: function(e) {
  51228. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51229. e.applyMatrix4(this)
  51230. }
  51231. },
  51232. multiplyVector3Array: {
  51233. value: function(e) {
  51234. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51235. this.applyToVector3Array(e)
  51236. }
  51237. },
  51238. rotateAxis: {
  51239. value: function(e) {
  51240. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51241. e.transformDirection(this)
  51242. }
  51243. },
  51244. crossVector: {
  51245. value: function(e) {
  51246. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51247. e.applyMatrix4(this)
  51248. }
  51249. },
  51250. translate: {
  51251. value: function(e) {
  51252. console.error("THREE.Matrix4: .translate() has been removed.")
  51253. }
  51254. },
  51255. rotateX: {
  51256. value: function(e) {
  51257. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51258. }
  51259. },
  51260. rotateY: {
  51261. value: function(e) {
  51262. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51263. }
  51264. },
  51265. rotateZ: {
  51266. value: function(e) {
  51267. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51268. }
  51269. },
  51270. rotateByAxis: {
  51271. value: function(e, t) {
  51272. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51273. }
  51274. }
  51275. }),
  51276. Object.defineProperties(Ci.Plane.prototype, {
  51277. isIntersectionLine: {
  51278. value: function(e) {
  51279. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51280. this.intersectsLine(e)
  51281. }
  51282. }
  51283. }),
  51284. Object.defineProperties(Ci.Quaternion.prototype, {
  51285. multiplyVector3: {
  51286. value: function(e) {
  51287. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51288. e.applyQuaternion(this)
  51289. }
  51290. }
  51291. }),
  51292. Object.defineProperties(Ci.Ray.prototype, {
  51293. isIntersectionBox: {
  51294. value: function(e) {
  51295. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51296. this.intersectsBox(e)
  51297. }
  51298. },
  51299. isIntersectionPlane: {
  51300. value: function(e) {
  51301. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51302. this.intersectsPlane(e)
  51303. }
  51304. },
  51305. isIntersectionSphere: {
  51306. value: function(e) {
  51307. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51308. this.intersectsSphere(e)
  51309. }
  51310. }
  51311. }),
  51312. Object.defineProperties(Ci.Vector3.prototype, {
  51313. setEulerFromRotationMatrix: {
  51314. value: function() {
  51315. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51316. }
  51317. },
  51318. setEulerFromQuaternion: {
  51319. value: function() {
  51320. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51321. }
  51322. },
  51323. getPositionFromMatrix: {
  51324. value: function(e) {
  51325. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51326. this.setFromMatrixPosition(e)
  51327. }
  51328. },
  51329. getScaleFromMatrix: {
  51330. value: function(e) {
  51331. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51332. this.setFromMatrixScale(e)
  51333. }
  51334. },
  51335. getColumnFromMatrix: {
  51336. value: function(e, t) {
  51337. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51338. this.setFromMatrixColumn(e, t)
  51339. }
  51340. }
  51341. }),
  51342. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51343. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51344. new Ci.Face3(e,t,i,r,o,a)
  51345. }
  51346. ,
  51347. Ci.Vertex = function(e, t, i) {
  51348. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51349. new Ci.Vector3(e,t,i)
  51350. }
  51351. ,
  51352. Object.defineProperties(Ci.Object3D.prototype, {
  51353. eulerOrder: {
  51354. get: function() {
  51355. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51356. this.rotation.order
  51357. },
  51358. set: function(e) {
  51359. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51360. this.rotation.order = e
  51361. }
  51362. },
  51363. getChildByName: {
  51364. value: function(e) {
  51365. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51366. this.getObjectByName(e)
  51367. }
  51368. },
  51369. renderDepth: {
  51370. set: function(e) {
  51371. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51372. }
  51373. },
  51374. translate: {
  51375. value: function(e, t) {
  51376. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51377. this.translateOnAxis(t, e)
  51378. }
  51379. },
  51380. useQuaternion: {
  51381. get: function() {
  51382. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51383. },
  51384. set: function(e) {
  51385. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51386. }
  51387. }
  51388. }),
  51389. Object.defineProperties(Ci, {
  51390. PointCloud: {
  51391. value: function(e, t) {
  51392. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51393. new Ci.Points(e,t)
  51394. }
  51395. },
  51396. ParticleSystem: {
  51397. value: function(e, t) {
  51398. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51399. new Ci.Points(e,t)
  51400. }
  51401. }
  51402. }),
  51403. Object.defineProperties(Ci.Light.prototype, {
  51404. onlyShadow: {
  51405. set: function(e) {
  51406. console.warn("THREE.Light: .onlyShadow has been removed.")
  51407. }
  51408. },
  51409. shadowCameraFov: {
  51410. set: function(e) {
  51411. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51412. this.shadow.camera.fov = e
  51413. }
  51414. },
  51415. shadowCameraLeft: {
  51416. set: function(e) {
  51417. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51418. this.shadow.camera.left = e
  51419. }
  51420. },
  51421. shadowCameraRight: {
  51422. set: function(e) {
  51423. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51424. this.shadow.camera.right = e
  51425. }
  51426. },
  51427. shadowCameraTop: {
  51428. set: function(e) {
  51429. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51430. this.shadow.camera.top = e
  51431. }
  51432. },
  51433. shadowCameraBottom: {
  51434. set: function(e) {
  51435. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51436. this.shadow.camera.bottom = e
  51437. }
  51438. },
  51439. shadowCameraNear: {
  51440. set: function(e) {
  51441. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51442. this.shadow.camera.near = e
  51443. }
  51444. },
  51445. shadowCameraFar: {
  51446. set: function(e) {
  51447. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51448. this.shadow.camera.far = e
  51449. }
  51450. },
  51451. shadowCameraVisible: {
  51452. set: function(e) {
  51453. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51454. }
  51455. },
  51456. shadowBias: {
  51457. set: function(e) {
  51458. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51459. this.shadow.bias = e
  51460. }
  51461. },
  51462. shadowDarkness: {
  51463. set: function(e) {
  51464. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51465. }
  51466. },
  51467. shadowMapWidth: {
  51468. set: function(e) {
  51469. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51470. this.shadow.mapSize.width = e
  51471. }
  51472. },
  51473. shadowMapHeight: {
  51474. set: function(e) {
  51475. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51476. this.shadow.mapSize.height = e
  51477. }
  51478. }
  51479. }),
  51480. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51481. length: {
  51482. get: function() {
  51483. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51484. this.array.length
  51485. }
  51486. }
  51487. }),
  51488. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51489. drawcalls: {
  51490. get: function() {
  51491. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51492. this.groups
  51493. }
  51494. },
  51495. offsets: {
  51496. get: function() {
  51497. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51498. this.groups
  51499. }
  51500. },
  51501. addIndex: {
  51502. value: function(e) {
  51503. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51504. this.setIndex(e)
  51505. }
  51506. },
  51507. addDrawCall: {
  51508. value: function(e, t, i) {
  51509. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51510. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51511. this.addGroup(e, t)
  51512. }
  51513. },
  51514. clearDrawCalls: {
  51515. value: function() {
  51516. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51517. this.clearGroups()
  51518. }
  51519. },
  51520. computeTangents: {
  51521. value: function() {
  51522. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51523. }
  51524. },
  51525. computeOffsets: {
  51526. value: function() {
  51527. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51528. }
  51529. }
  51530. }),
  51531. Object.defineProperties(Ci.Material.prototype, {
  51532. wrapAround: {
  51533. get: function() {
  51534. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51535. },
  51536. set: function(e) {
  51537. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51538. }
  51539. },
  51540. wrapRGB: {
  51541. get: function() {
  51542. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51543. new Ci.Color
  51544. }
  51545. }
  51546. }),
  51547. Object.defineProperties(Ci, {
  51548. PointCloudMaterial: {
  51549. value: function(e) {
  51550. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51551. new Ci.PointsMaterial(e)
  51552. }
  51553. },
  51554. ParticleBasicMaterial: {
  51555. value: function(e) {
  51556. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51557. new Ci.PointsMaterial(e)
  51558. }
  51559. },
  51560. ParticleSystemMaterial: {
  51561. value: function(e) {
  51562. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51563. new Ci.PointsMaterial(e)
  51564. }
  51565. }
  51566. }),
  51567. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51568. metal: {
  51569. get: function() {
  51570. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51571. !1
  51572. },
  51573. set: function(e) {
  51574. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51575. }
  51576. }
  51577. }),
  51578. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51579. derivatives: {
  51580. get: function() {
  51581. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51582. this.extensions.derivatives
  51583. },
  51584. set: function(e) {
  51585. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51586. this.extensions.derivatives = e
  51587. }
  51588. }
  51589. }),
  51590. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51591. supportsFloatTextures: {
  51592. value: function() {
  51593. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51594. this.extensions.get("OES_texture_float")
  51595. }
  51596. },
  51597. supportsHalfFloatTextures: {
  51598. value: function() {
  51599. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51600. this.extensions.get("OES_texture_half_float")
  51601. }
  51602. },
  51603. supportsStandardDerivatives: {
  51604. value: function() {
  51605. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51606. this.extensions.get("OES_standard_derivatives")
  51607. }
  51608. },
  51609. supportsCompressedTextureS3TC: {
  51610. value: function() {
  51611. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51612. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51613. }
  51614. },
  51615. supportsCompressedTexturePVRTC: {
  51616. value: function() {
  51617. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51618. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51619. }
  51620. },
  51621. supportsBlendMinMax: {
  51622. value: function() {
  51623. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51624. this.extensions.get("EXT_blend_minmax")
  51625. }
  51626. },
  51627. supportsVertexTextures: {
  51628. value: function() {
  51629. return this.capabilities.vertexTextures
  51630. }
  51631. },
  51632. supportsInstancedArrays: {
  51633. value: function() {
  51634. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51635. this.extensions.get("ANGLE_instanced_arrays")
  51636. }
  51637. },
  51638. enableScissorTest: {
  51639. value: function(e) {
  51640. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51641. this.setScissorTest(e)
  51642. }
  51643. },
  51644. initMaterial: {
  51645. value: function() {
  51646. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51647. }
  51648. },
  51649. addPrePlugin: {
  51650. value: function() {
  51651. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51652. }
  51653. },
  51654. addPostPlugin: {
  51655. value: function() {
  51656. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51657. }
  51658. },
  51659. updateShadowMap: {
  51660. value: function() {
  51661. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51662. }
  51663. },
  51664. shadowMapEnabled: {
  51665. get: function() {
  51666. return this.shadowMap.enabled
  51667. },
  51668. set: function(e) {
  51669. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51670. this.shadowMap.enabled = e
  51671. }
  51672. },
  51673. shadowMapType: {
  51674. get: function() {
  51675. return this.shadowMap.type
  51676. },
  51677. set: function(e) {
  51678. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51679. this.shadowMap.type = e
  51680. }
  51681. },
  51682. shadowMapCullFace: {
  51683. get: function() {
  51684. return this.shadowMap.cullFace
  51685. },
  51686. set: function(e) {
  51687. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51688. this.shadowMap.cullFace = e
  51689. }
  51690. }
  51691. }),
  51692. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51693. wrapS: {
  51694. get: function() {
  51695. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51696. this.texture.wrapS
  51697. },
  51698. set: function(e) {
  51699. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51700. this.texture.wrapS = e
  51701. }
  51702. },
  51703. wrapT: {
  51704. get: function() {
  51705. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51706. this.texture.wrapT
  51707. },
  51708. set: function(e) {
  51709. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51710. this.texture.wrapT = e
  51711. }
  51712. },
  51713. magFilter: {
  51714. get: function() {
  51715. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51716. this.texture.magFilter
  51717. },
  51718. set: function(e) {
  51719. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51720. this.texture.magFilter = e
  51721. }
  51722. },
  51723. minFilter: {
  51724. get: function() {
  51725. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51726. this.texture.minFilter
  51727. },
  51728. set: function(e) {
  51729. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51730. this.texture.minFilter = e
  51731. }
  51732. },
  51733. anisotropy: {
  51734. get: function() {
  51735. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51736. this.texture.anisotropy
  51737. },
  51738. set: function(e) {
  51739. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51740. this.texture.anisotropy = e
  51741. }
  51742. },
  51743. offset: {
  51744. get: function() {
  51745. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51746. this.texture.offset
  51747. },
  51748. set: function(e) {
  51749. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51750. this.texture.offset = e
  51751. }
  51752. },
  51753. repeat: {
  51754. get: function() {
  51755. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51756. this.texture.repeat
  51757. },
  51758. set: function(e) {
  51759. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51760. this.texture.repeat = e
  51761. }
  51762. },
  51763. format: {
  51764. get: function() {
  51765. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51766. this.texture.format
  51767. },
  51768. set: function(e) {
  51769. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51770. this.texture.format = e
  51771. }
  51772. },
  51773. type: {
  51774. get: function() {
  51775. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51776. this.texture.type
  51777. },
  51778. set: function(e) {
  51779. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51780. this.texture.type = e
  51781. }
  51782. },
  51783. generateMipmaps: {
  51784. get: function() {
  51785. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51786. this.texture.generateMipmaps
  51787. },
  51788. set: function(e) {
  51789. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51790. this.texture.generateMipmaps = e
  51791. }
  51792. }
  51793. }),
  51794. Ci.GeometryUtils = {
  51795. merge: function(e, t, i) {
  51796. var n;
  51797. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51798. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51799. n = t.matrix,
  51800. t = t.geometry),
  51801. e.merge(t, n, i)
  51802. },
  51803. center: function(e) {
  51804. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51805. e.center()
  51806. }
  51807. },
  51808. Ci.ImageUtils = {
  51809. crossOrigin: void 0,
  51810. loadTexture: function(e, t, i, n) {
  51811. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51812. var r = new Ci.TextureLoader;
  51813. r.setCrossOrigin(this.crossOrigin);
  51814. var o = r.load(e, i, void 0, n);
  51815. return t && (o.mapping = t),
  51816. o
  51817. },
  51818. loadTextureCube: function(e, t, i, n) {
  51819. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51820. var r = new Ci.CubeTextureLoader;
  51821. r.setCrossOrigin(this.crossOrigin);
  51822. var o = r.load(e, i, void 0, n);
  51823. return t && (o.mapping = t),
  51824. o
  51825. },
  51826. loadCompressedTexture: function() {
  51827. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51828. },
  51829. loadCompressedTextureCube: function() {
  51830. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51831. }
  51832. },
  51833. Ci.Projector = function() {
  51834. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51835. this.projectVector = function(e, t) {
  51836. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51837. e.project(t)
  51838. }
  51839. ,
  51840. this.unprojectVector = function(e, t) {
  51841. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51842. e.unproject(t)
  51843. }
  51844. ,
  51845. this.pickingRay = function(e, t) {
  51846. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51847. }
  51848. }
  51849. ,
  51850. Ci.CanvasRenderer = function() {
  51851. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51852. this.domElement = document.createElement("canvas"),
  51853. this.clear = function() {}
  51854. ,
  51855. this.render = function() {}
  51856. ,
  51857. this.setClearColor = function() {}
  51858. ,
  51859. this.setSize = function() {}
  51860. }
  51861. ,
  51862. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51863. Ci.CurveUtils = {
  51864. tangentQuadraticBezier: function(e, t, i, n) {
  51865. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51866. },
  51867. tangentCubicBezier: function(e, t, i, n, r) {
  51868. 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
  51869. },
  51870. tangentSpline: function(e, t, i, n, r) {
  51871. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51872. },
  51873. interpolate: function(e, t, i, n, r) {
  51874. var o = .5 * (i - e)
  51875. , a = .5 * (n - t)
  51876. , s = r * r;
  51877. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51878. }
  51879. },
  51880. Ci.SceneUtils = {
  51881. createMultiMaterialObject: function(e, t) {
  51882. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51883. i.add(new Ci.Mesh(e,t[n]));
  51884. return i
  51885. },
  51886. detach: function(e, t, i) {
  51887. e.applyMatrix(t.matrixWorld),
  51888. t.remove(e),
  51889. i.add(e)
  51890. },
  51891. attach: function(e, t, i) {
  51892. var n = new Ci.Matrix4;
  51893. n.getInverse(i.matrixWorld),
  51894. e.applyMatrix(n),
  51895. t.remove(e),
  51896. i.add(e)
  51897. }
  51898. },
  51899. Ci.ShapeUtils = {
  51900. area: function(e) {
  51901. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51902. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51903. return .5 * i
  51904. },
  51905. triangulate: function(e, t) {
  51906. var i = e.length;
  51907. if (i < 3)
  51908. return null;
  51909. var n, r, o, a = [], s = [], l = [];
  51910. if (0 < Ci.ShapeUtils.area(e))
  51911. for (r = 0; r < i; r++)
  51912. s[r] = r;
  51913. else
  51914. for (r = 0; r < i; r++)
  51915. s[r] = i - 1 - r;
  51916. var c = i
  51917. , h = 2 * c;
  51918. for (r = c - 1; 2 < c; ) {
  51919. if (h-- <= 0)
  51920. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51921. t ? l : a;
  51922. if (c <= (n = r) && (n = 0),
  51923. c <= (r = n + 1) && (r = 0),
  51924. c <= (o = r + 1) && (o = 0),
  51925. Si(e, n, r, o, c, s)) {
  51926. var u, d, p, f, g;
  51927. for (u = s[n],
  51928. d = s[r],
  51929. p = s[o],
  51930. a.push([e[u], e[d], e[p]]),
  51931. l.push([s[n], s[r], s[o]]),
  51932. g = (f = r) + 1; g < c; f++,
  51933. g++)
  51934. s[f] = s[g];
  51935. h = 2 * --c
  51936. }
  51937. }
  51938. return t ? l : a
  51939. },
  51940. triangulateShape: function(e, t) {
  51941. function w(e, t, i) {
  51942. 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
  51943. }
  51944. function b(e, t, i, n, r) {
  51945. var o = t.x - e.x
  51946. , a = t.y - e.y
  51947. , s = n.x - i.x
  51948. , l = n.y - i.y
  51949. , c = e.x - i.x
  51950. , h = e.y - i.y
  51951. , u = a * s - o * l
  51952. , d = a * c - o * h;
  51953. if (Math.abs(u) > Number.EPSILON) {
  51954. var p;
  51955. if (0 < u) {
  51956. if (d < 0 || u < d)
  51957. return [];
  51958. if ((p = l * c - s * h) < 0 || u < p)
  51959. return []
  51960. } else {
  51961. if (0 < d || d < u)
  51962. return [];
  51963. if (0 < (p = l * c - s * h) || p < u)
  51964. return []
  51965. }
  51966. if (0 === p)
  51967. return !r || 0 != d && d != u ? [e] : [];
  51968. if (p === u)
  51969. return !r || 0 != d && d != u ? [t] : [];
  51970. if (0 == d)
  51971. return [i];
  51972. if (d == u)
  51973. return [n];
  51974. var f = p / u;
  51975. return [{
  51976. x: e.x + f * o,
  51977. y: e.y + f * a
  51978. }]
  51979. }
  51980. if (0 != d || l * c != s * h)
  51981. return [];
  51982. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51983. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  51984. (m = t).x) : (v = (g = t).x,
  51985. (m = e).x),
  51986. i.x < n.x ? (I = (A = i).x,
  51987. (C = n).x) : (I = (A = n).x,
  51988. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51989. (m = t).y) : (v = (g = t).y,
  51990. (m = e).y),
  51991. i.y < n.y ? (I = (A = i).y,
  51992. (C = n).y) : (I = (A = n).y,
  51993. (C = i).y)),
  51994. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  51995. }
  51996. function T(e, t, i, n) {
  51997. var r = t.x - e.x
  51998. , o = t.y - e.y
  51999. , a = i.x - e.x
  52000. , s = i.y - e.y
  52001. , l = n.x - e.x
  52002. , c = n.y - e.y
  52003. , h = r * s - o * a
  52004. , u = r * c - o * l;
  52005. if (Math.abs(h) > Number.EPSILON) {
  52006. var d = l * s - c * a;
  52007. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52008. }
  52009. return 0 < u
  52010. }
  52011. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52012. Array.prototype.push.apply(c, t[h]);
  52013. for (i = 0,
  52014. n = c.length; i < n; i++)
  52015. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52016. l[a] = i;
  52017. var d = function(e, a) {
  52018. function t(e, t) {
  52019. var i = m.length - 1
  52020. , n = e - 1;
  52021. n < 0 && (n = i);
  52022. var r = e + 1;
  52023. i < r && (r = 0);
  52024. var o = T(m[e], m[n], m[r], c[t]);
  52025. if (!o)
  52026. return !1;
  52027. var a = c.length - 1
  52028. , s = t - 1;
  52029. s < 0 && (s = a);
  52030. var l = t + 1;
  52031. return a < l && (l = 0),
  52032. !!(o = T(c[t], c[s], c[l], m[e]))
  52033. }
  52034. function i(e, t) {
  52035. var i, n;
  52036. for (i = 0; i < m.length; i++)
  52037. if (n = i + 1,
  52038. n %= m.length,
  52039. 0 < b(e, t, m[i], m[n], !0).length)
  52040. return !0;
  52041. return !1
  52042. }
  52043. function n(e, t) {
  52044. var i, n, r, o;
  52045. for (i = 0; i < v.length; i++)
  52046. for (n = a[v[i]],
  52047. r = 0; r < n.length; r++)
  52048. if (o = r + 1,
  52049. o %= n.length,
  52050. 0 < b(e, t, n[r], n[o], !0).length)
  52051. return !0;
  52052. return !1
  52053. }
  52054. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  52055. v.push(A);
  52056. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52057. if (--E < 0) {
  52058. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52059. break
  52060. }
  52061. for (o = I; o < m.length; o++) {
  52062. s = m[o],
  52063. r = -1;
  52064. for (A = 0; A < v.length; A++)
  52065. if (h = v[A],
  52066. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52067. c = a[h];
  52068. for (var _ = 0; _ < c.length; _++)
  52069. if (l = c[_],
  52070. t(o, _) && !i(s, l) && !n(s, l)) {
  52071. r = _,
  52072. v.splice(A, 1),
  52073. d = m.slice(0, o + 1),
  52074. p = m.slice(o),
  52075. f = c.slice(r),
  52076. g = c.slice(0, r + 1),
  52077. m = d.concat(f).concat(g).concat(p),
  52078. I = o;
  52079. break
  52080. }
  52081. if (0 <= r)
  52082. break;
  52083. y[u] = !0
  52084. }
  52085. if (0 <= r)
  52086. break
  52087. }
  52088. }
  52089. return m
  52090. }(e, t)
  52091. , p = Ci.ShapeUtils.triangulate(d, !1);
  52092. for (i = 0,
  52093. n = p.length; i < n; i++)
  52094. for (o = p[i],
  52095. r = 0; r < 3; r++)
  52096. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52097. return p.concat()
  52098. },
  52099. isClockWise: function(e) {
  52100. return Ci.ShapeUtils.area(e) < 0
  52101. },
  52102. b2: function(e, t, i, n) {
  52103. return function(e, t) {
  52104. var i = 1 - e;
  52105. return i * i * t
  52106. }(e, t) + function(e, t) {
  52107. return 2 * (1 - e) * e * t
  52108. }(e, i) + function(e, t) {
  52109. return e * e * t
  52110. }(e, n)
  52111. },
  52112. b3: function(e, t, i, n, r) {
  52113. return function(e, t) {
  52114. var i = 1 - e;
  52115. return i * i * i * t
  52116. }(e, t) + function(e, t) {
  52117. var i = 1 - e;
  52118. return 3 * i * i * e * t
  52119. }(e, i) + function(e, t) {
  52120. return 3 * (1 - e) * e * e * t
  52121. }(e, n) + function(e, t) {
  52122. return e * e * e * t
  52123. }(e, r)
  52124. }
  52125. },
  52126. Ci.Curve = function() {}
  52127. ,
  52128. Ci.Curve.prototype = {
  52129. constructor: Ci.Curve,
  52130. getPoint: function(e) {
  52131. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52132. null
  52133. },
  52134. getPointAt: function(e) {
  52135. var t = this.getUtoTmapping(e);
  52136. return this.getPoint(t)
  52137. },
  52138. getPoints: function(e) {
  52139. e = e || 5;
  52140. var t, i = [];
  52141. for (t = 0; t <= e; t++)
  52142. i.push(this.getPoint(t / e));
  52143. return i
  52144. },
  52145. getSpacedPoints: function(e) {
  52146. e = e || 5;
  52147. var t, i = [];
  52148. for (t = 0; t <= e; t++)
  52149. i.push(this.getPointAt(t / e));
  52150. return i
  52151. },
  52152. getLength: function() {
  52153. var e = this.getLengths();
  52154. return e[e.length - 1]
  52155. },
  52156. getLengths: function(e) {
  52157. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52158. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52159. return this.cacheArcLengths;
  52160. this.needsUpdate = !1;
  52161. var t, i, n = [], r = this.getPoint(0), o = 0;
  52162. for (n.push(0),
  52163. i = 1; i <= e; i++)
  52164. o += (t = this.getPoint(i / e)).distanceTo(r),
  52165. n.push(o),
  52166. r = t;
  52167. return this.cacheArcLengths = n
  52168. },
  52169. updateArcLengths: function() {
  52170. this.needsUpdate = !0,
  52171. this.getLengths()
  52172. },
  52173. getUtoTmapping: function(e, t) {
  52174. var i, n = this.getLengths(), r = 0, o = n.length;
  52175. i = t || e * n[o - 1];
  52176. for (var a, s = 0, l = o - 1; s <= l; )
  52177. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52178. s = r + 1;
  52179. else {
  52180. if (!(0 < a)) {
  52181. l = r;
  52182. break
  52183. }
  52184. l = r - 1
  52185. }
  52186. if (n[r = l] === i)
  52187. return r / (o - 1);
  52188. var c = n[r];
  52189. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52190. },
  52191. getTangent: function(e) {
  52192. var t = e - 1e-4
  52193. , i = e + 1e-4;
  52194. t < 0 && (t = 0),
  52195. 1 < i && (i = 1);
  52196. var n = this.getPoint(t);
  52197. return this.getPoint(i).clone().sub(n).normalize()
  52198. },
  52199. getTangentAt: function(e) {
  52200. var t = this.getUtoTmapping(e);
  52201. return this.getTangent(t)
  52202. }
  52203. },
  52204. Ci.Curve.create = function(e, t) {
  52205. return e.prototype = Object.create(Ci.Curve.prototype),
  52206. (e.prototype.constructor = e).prototype.getPoint = t,
  52207. e
  52208. }
  52209. ,
  52210. Ci.CurvePath = function() {
  52211. this.curves = [],
  52212. this.autoClose = !1
  52213. }
  52214. ,
  52215. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52216. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52217. Ci.CurvePath.prototype.add = function(e) {
  52218. this.curves.push(e)
  52219. }
  52220. ,
  52221. Ci.CurvePath.prototype.closePath = function() {
  52222. var e = this.curves[0].getPoint(0)
  52223. , t = this.curves[this.curves.length - 1].getPoint(1);
  52224. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52225. }
  52226. ,
  52227. Ci.CurvePath.prototype.getPoint = function(e) {
  52228. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52229. if (i[n] >= t) {
  52230. var r = i[n] - t
  52231. , o = this.curves[n]
  52232. , a = 1 - r / o.getLength();
  52233. return o.getPointAt(a)
  52234. }
  52235. n++
  52236. }
  52237. return null
  52238. }
  52239. ,
  52240. Ci.CurvePath.prototype.getLength = function() {
  52241. var e = this.getCurveLengths();
  52242. return e[e.length - 1]
  52243. }
  52244. ,
  52245. Ci.CurvePath.prototype.getCurveLengths = function() {
  52246. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52247. return this.cacheLengths;
  52248. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52249. t += this.curves[i].getLength(),
  52250. e.push(t);
  52251. return this.cacheLengths = e
  52252. }
  52253. ,
  52254. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52255. var t = this.getPoints(e);
  52256. return this.createGeometry(t)
  52257. }
  52258. ,
  52259. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52260. var t = this.getSpacedPoints(e);
  52261. return this.createGeometry(t)
  52262. }
  52263. ,
  52264. Ci.CurvePath.prototype.createGeometry = function(e) {
  52265. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52266. var r = e[i];
  52267. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52268. }
  52269. return t
  52270. }
  52271. ,
  52272. Ci.Font = function(e) {
  52273. this.data = e
  52274. }
  52275. ,
  52276. Ci.Font.prototype = {
  52277. constructor: Ci.Font,
  52278. generateShapes: function(e, s, b) {
  52279. function l(e, t, i) {
  52280. var n = w.glyphs[e] || w.glyphs["?"];
  52281. if (n) {
  52282. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  52283. if (n.o)
  52284. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52285. switch (A[C++]) {
  52286. case "m":
  52287. r = A[C++] * t + i,
  52288. o = A[C++] * t,
  52289. g.moveTo(r, o);
  52290. break;
  52291. case "l":
  52292. r = A[C++] * t + i,
  52293. o = A[C++] * t,
  52294. g.lineTo(r, o);
  52295. break;
  52296. case "q":
  52297. if (a = A[C++] * t + i,
  52298. s = A[C++] * t,
  52299. h = A[C++] * t + i,
  52300. u = A[C++] * t,
  52301. g.quadraticCurveTo(h, u, a, s),
  52302. f = m[m.length - 1]) {
  52303. l = f.x,
  52304. c = f.y;
  52305. for (var E = 1; E <= b; E++) {
  52306. v(_ = E / b, l, h, a),
  52307. v(_, c, u, s)
  52308. }
  52309. }
  52310. break;
  52311. case "b":
  52312. if (a = A[C++] * t + i,
  52313. s = A[C++] * t,
  52314. h = A[C++] * t + i,
  52315. u = A[C++] * t,
  52316. d = A[C++] * t + i,
  52317. p = A[C++] * t,
  52318. g.bezierCurveTo(h, u, d, p, a, s),
  52319. f = m[m.length - 1]) {
  52320. l = f.x,
  52321. c = f.y;
  52322. for (E = 1; E <= b; E++) {
  52323. var _;
  52324. y(_ = E / b, l, h, d, a),
  52325. y(_, c, u, p, s)
  52326. }
  52327. }
  52328. }
  52329. }
  52330. return {
  52331. offset: n.ha * t,
  52332. path: g
  52333. }
  52334. }
  52335. }
  52336. void 0 === s && (s = 100),
  52337. void 0 === b && (b = 4);
  52338. for (var w = this.data, t = function(e) {
  52339. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52340. var a = l(t[o], i, n);
  52341. n += a.offset,
  52342. r.push(a.path)
  52343. }
  52344. return r
  52345. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52346. Array.prototype.push.apply(i, t[n].toShapes());
  52347. return i
  52348. }
  52349. },
  52350. Ci.Path = function(e) {
  52351. Ci.CurvePath.call(this),
  52352. this.actions = [],
  52353. e && this.fromPoints(e)
  52354. }
  52355. ,
  52356. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52357. Ci.Path.prototype.constructor = Ci.Path,
  52358. Ci.Path.prototype.fromPoints = function(e) {
  52359. this.moveTo(e[0].x, e[0].y);
  52360. for (var t = 1, i = e.length; t < i; t++)
  52361. this.lineTo(e[t].x, e[t].y)
  52362. }
  52363. ,
  52364. Ci.Path.prototype.moveTo = function(e, t) {
  52365. this.actions.push({
  52366. action: "moveTo",
  52367. args: [e, t]
  52368. })
  52369. }
  52370. ,
  52371. Ci.Path.prototype.lineTo = function(e, t) {
  52372. var i = this.actions[this.actions.length - 1].args
  52373. , n = i[i.length - 2]
  52374. , r = i[i.length - 1]
  52375. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52376. this.curves.push(o),
  52377. this.actions.push({
  52378. action: "lineTo",
  52379. args: [e, t]
  52380. })
  52381. }
  52382. ,
  52383. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52384. var r = this.actions[this.actions.length - 1].args
  52385. , o = r[r.length - 2]
  52386. , a = r[r.length - 1]
  52387. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52388. this.curves.push(s),
  52389. this.actions.push({
  52390. action: "quadraticCurveTo",
  52391. args: [e, t, i, n]
  52392. })
  52393. }
  52394. ,
  52395. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52396. var a = this.actions[this.actions.length - 1].args
  52397. , s = a[a.length - 2]
  52398. , l = a[a.length - 1]
  52399. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52400. this.curves.push(c),
  52401. this.actions.push({
  52402. action: "bezierCurveTo",
  52403. args: [e, t, i, n, r, o]
  52404. })
  52405. }
  52406. ,
  52407. Ci.Path.prototype.splineThru = function(e) {
  52408. var t = Array.prototype.slice.call(arguments)
  52409. , i = this.actions[this.actions.length - 1].args
  52410. , n = i[i.length - 2]
  52411. , r = i[i.length - 1]
  52412. , o = [new Ci.Vector2(n,r)];
  52413. Array.prototype.push.apply(o, e);
  52414. var a = new Ci.SplineCurve(o);
  52415. this.curves.push(a),
  52416. this.actions.push({
  52417. action: "splineThru",
  52418. args: t
  52419. })
  52420. }
  52421. ,
  52422. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52423. var a = this.actions[this.actions.length - 1].args
  52424. , s = a[a.length - 2]
  52425. , l = a[a.length - 1];
  52426. this.absarc(e + s, t + l, i, n, r, o)
  52427. }
  52428. ,
  52429. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52430. this.absellipse(e, t, i, i, n, r, o)
  52431. }
  52432. ,
  52433. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52434. var l = this.actions[this.actions.length - 1].args
  52435. , c = l[l.length - 2]
  52436. , h = l[l.length - 1];
  52437. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52438. }
  52439. ,
  52440. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52441. var l = [e, t, i, n, r, o, a, s || 0]
  52442. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52443. this.curves.push(c);
  52444. var h = c.getPoint(1);
  52445. l.push(h.x),
  52446. l.push(h.y),
  52447. this.actions.push({
  52448. action: "ellipse",
  52449. args: l
  52450. })
  52451. }
  52452. ,
  52453. Ci.Path.prototype.getSpacedPoints = function(e) {
  52454. e = e || 40;
  52455. for (var t = [], i = 0; i < e; i++)
  52456. t.push(this.getPoint(i / e));
  52457. return this.autoClose && t.push(t[0]),
  52458. t
  52459. }
  52460. ,
  52461. Ci.Path.prototype.getPoints = function(e) {
  52462. e = e || 12;
  52463. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  52464. var v = this.actions[g]
  52465. , y = v.action
  52466. , A = v.args;
  52467. switch (y) {
  52468. case "moveTo":
  52469. case "lineTo":
  52470. f.push(new Ci.Vector2(A[0],A[1]));
  52471. break;
  52472. case "quadraticCurveTo":
  52473. t = A[2],
  52474. i = A[3],
  52475. o = A[0],
  52476. a = A[1],
  52477. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52478. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52479. c[c.length - 1]);
  52480. for (var C = 1; C <= e; C++) {
  52481. h = d(O = C / e, s, o, t),
  52482. u = d(O, l, a, i),
  52483. f.push(new Ci.Vector2(h,u))
  52484. }
  52485. break;
  52486. case "bezierCurveTo":
  52487. t = A[4],
  52488. i = A[5],
  52489. o = A[0],
  52490. a = A[1],
  52491. n = A[2],
  52492. r = A[3],
  52493. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52494. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52495. c[c.length - 1]);
  52496. for (C = 1; C <= e; C++) {
  52497. h = p(O = C / e, s, o, n, t),
  52498. u = p(O, l, a, r, i),
  52499. f.push(new Ci.Vector2(h,u))
  52500. }
  52501. break;
  52502. case "splineThru":
  52503. c = this.actions[g - 1].args;
  52504. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52505. , E = e * A[0].length;
  52506. I = I.concat(A[0]);
  52507. var _ = new Ci.SplineCurve(I);
  52508. for (C = 1; C <= E; C++)
  52509. f.push(_.getPointAt(C / E));
  52510. break;
  52511. case "arc":
  52512. var b = A[0]
  52513. , w = A[1]
  52514. , T = A[2]
  52515. , x = A[3]
  52516. , S = A[4]
  52517. , M = !!A[5]
  52518. , R = S - x
  52519. , P = 2 * e;
  52520. for (C = 1; C <= P; C++) {
  52521. var O = C / P;
  52522. M || (O = 1 - O),
  52523. L = x + O * R,
  52524. h = b + T * Math.cos(L),
  52525. u = w + T * Math.sin(L),
  52526. f.push(new Ci.Vector2(h,u))
  52527. }
  52528. break;
  52529. case "ellipse":
  52530. b = A[0],
  52531. w = A[1];
  52532. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52533. S = A[5],
  52534. M = !!A[6],
  52535. A[7]);
  52536. R = S - x,
  52537. P = 2 * e;
  52538. 0 !== V && (D = Math.cos(V),
  52539. N = Math.sin(V));
  52540. for (C = 1; C <= P; C++) {
  52541. O = C / P;
  52542. if (M || (O = 1 - O),
  52543. L = x + O * R,
  52544. h = b + F * Math.cos(L),
  52545. u = w + B * Math.sin(L),
  52546. 0 !== V) {
  52547. var k = h;
  52548. h = (k - b) * D - (u - w) * N + b,
  52549. u = (k - b) * N + (u - w) * D + w
  52550. }
  52551. f.push(new Ci.Vector2(h,u))
  52552. }
  52553. }
  52554. }
  52555. var U = f[f.length - 1];
  52556. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52557. this.autoClose && f.push(f[0]),
  52558. f
  52559. }
  52560. ,
  52561. Ci.Path.prototype.toShapes = function(e, t) {
  52562. function i(e) {
  52563. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52564. var r = e[i]
  52565. , o = new Ci.Shape;
  52566. o.actions = r.actions,
  52567. o.curves = r.curves,
  52568. t.push(o)
  52569. }
  52570. return t
  52571. }
  52572. function n(e, t) {
  52573. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52574. var a = t[r]
  52575. , s = t[o]
  52576. , l = s.x - a.x
  52577. , c = s.y - a.y;
  52578. if (Math.abs(c) > Number.EPSILON) {
  52579. if (c < 0 && (a = t[o],
  52580. l = -l,
  52581. s = t[r],
  52582. c = -c),
  52583. e.y < a.y || e.y > s.y)
  52584. continue;
  52585. if (e.y === a.y) {
  52586. if (e.x === a.x)
  52587. return !0
  52588. } else {
  52589. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52590. if (0 == h)
  52591. return !0;
  52592. if (h < 0)
  52593. continue;
  52594. n = !n
  52595. }
  52596. } else {
  52597. if (e.y !== a.y)
  52598. continue;
  52599. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52600. return !0
  52601. }
  52602. }
  52603. return n
  52604. }
  52605. var r = Ci.ShapeUtils.isClockWise
  52606. , o = function(e) {
  52607. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52608. var o = e[n]
  52609. , a = o.args
  52610. , s = o.action;
  52611. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52612. i = new Ci.Path),
  52613. i[s].apply(i, a)
  52614. }
  52615. return 0 !== i.actions.length && t.push(i),
  52616. t
  52617. }(this.actions);
  52618. if (0 === o.length)
  52619. return [];
  52620. if (!0 === t)
  52621. return i(o);
  52622. var a, s, l, c = [];
  52623. if (1 === o.length)
  52624. return s = o[0],
  52625. (l = new Ci.Shape).actions = s.actions,
  52626. l.curves = s.curves,
  52627. c.push(l),
  52628. c;
  52629. var h = !r(o[0].getPoints());
  52630. h = e ? !h : h;
  52631. var u, d = [], p = [], f = [], g = 0;
  52632. p[g] = void 0,
  52633. f[g] = [];
  52634. for (var m = 0, v = o.length; m < v; m++)
  52635. a = r(u = (s = o[m]).getPoints()),
  52636. (a = e ? !a : a) ? (!h && p[g] && g++,
  52637. p[g] = {
  52638. s: new Ci.Shape,
  52639. p: u
  52640. },
  52641. p[g].s.actions = s.actions,
  52642. p[g].s.curves = s.curves,
  52643. h && g++,
  52644. f[g] = []) : f[g].push({
  52645. h: s,
  52646. p: u[0]
  52647. });
  52648. if (!p[0])
  52649. return i(o);
  52650. if (1 < p.length) {
  52651. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52652. d[C] = [];
  52653. for (C = 0,
  52654. I = p.length; C < I; C++)
  52655. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52656. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52657. n(b.p, p[T].p) && (C !== T && A.push({
  52658. froms: C,
  52659. tos: T,
  52660. hole: _
  52661. }),
  52662. w ? (w = !1,
  52663. d[T].push(b)) : y = !0);
  52664. w && d[C].push(b)
  52665. }
  52666. 0 < A.length && (y || (f = d))
  52667. }
  52668. m = 0;
  52669. for (var x, S = p.length; m < S; m++) {
  52670. l = p[m].s,
  52671. c.push(l);
  52672. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52673. l.holes.push(x[M].h)
  52674. }
  52675. return c
  52676. }
  52677. ,
  52678. Ci.Shape = function() {
  52679. Ci.Path.apply(this, arguments),
  52680. this.holes = []
  52681. }
  52682. ,
  52683. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52684. Ci.Shape.prototype.constructor = Ci.Shape,
  52685. Ci.Shape.prototype.extrude = function(e) {
  52686. return new Ci.ExtrudeGeometry(this,e)
  52687. }
  52688. ,
  52689. Ci.Shape.prototype.makeGeometry = function(e) {
  52690. return new Ci.ShapeGeometry(this,e)
  52691. }
  52692. ,
  52693. Ci.Shape.prototype.getPointsHoles = function(e) {
  52694. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52695. t[i] = this.holes[i].getPoints(e);
  52696. return t
  52697. }
  52698. ,
  52699. Ci.Shape.prototype.extractAllPoints = function(e) {
  52700. return {
  52701. shape: this.getPoints(e),
  52702. holes: this.getPointsHoles(e)
  52703. }
  52704. }
  52705. ,
  52706. Ci.Shape.prototype.extractPoints = function(e) {
  52707. return this.extractAllPoints(e)
  52708. }
  52709. ,
  52710. Ci.LineCurve = function(e, t) {
  52711. this.v1 = e,
  52712. this.v2 = t
  52713. }
  52714. ,
  52715. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52716. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52717. Ci.LineCurve.prototype.getPoint = function(e) {
  52718. var t = this.v2.clone().sub(this.v1);
  52719. return t.multiplyScalar(e).add(this.v1),
  52720. t
  52721. }
  52722. ,
  52723. Ci.LineCurve.prototype.getPointAt = function(e) {
  52724. return this.getPoint(e)
  52725. }
  52726. ,
  52727. Ci.LineCurve.prototype.getTangent = function(e) {
  52728. return this.v2.clone().sub(this.v1).normalize()
  52729. }
  52730. ,
  52731. Ci.QuadraticBezierCurve = function(e, t, i) {
  52732. this.v0 = e,
  52733. this.v1 = t,
  52734. this.v2 = i
  52735. }
  52736. ,
  52737. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52738. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52739. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52740. var t = Ci.ShapeUtils.b2;
  52741. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52742. }
  52743. ,
  52744. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52745. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52746. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52747. }
  52748. ,
  52749. Ci.CubicBezierCurve = function(e, t, i, n) {
  52750. this.v0 = e,
  52751. this.v1 = t,
  52752. this.v2 = i,
  52753. this.v3 = n
  52754. }
  52755. ,
  52756. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52757. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52758. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52759. var t = Ci.ShapeUtils.b3;
  52760. return new Ci.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))
  52761. }
  52762. ,
  52763. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52764. var t = Ci.CurveUtils.tangentCubicBezier;
  52765. return new Ci.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()
  52766. }
  52767. ,
  52768. Ci.SplineCurve = function(e) {
  52769. this.points = null == e ? [] : e
  52770. }
  52771. ,
  52772. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52773. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52774. Ci.SplineCurve.prototype.getPoint = function(e) {
  52775. var t = this.points
  52776. , i = (t.length - 1) * e
  52777. , n = Math.floor(i)
  52778. , r = i - n
  52779. , o = t[0 === n ? n : n - 1]
  52780. , a = t[n]
  52781. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52782. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52783. , c = Ci.CurveUtils.interpolate;
  52784. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52785. }
  52786. ,
  52787. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52788. this.aX = e,
  52789. this.aY = t,
  52790. this.xRadius = i,
  52791. this.yRadius = n,
  52792. this.aStartAngle = r,
  52793. this.aEndAngle = o,
  52794. this.aClockwise = a,
  52795. this.aRotation = s || 0
  52796. }
  52797. ,
  52798. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52799. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52800. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52801. var t, i = this.aEndAngle - this.aStartAngle;
  52802. i < 0 && (i += 2 * Math.PI),
  52803. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52804. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52805. var n = this.aX + this.xRadius * Math.cos(t)
  52806. , r = this.aY + this.yRadius * Math.sin(t);
  52807. if (0 !== this.aRotation) {
  52808. var o = Math.cos(this.aRotation)
  52809. , a = Math.sin(this.aRotation)
  52810. , s = n
  52811. , l = r;
  52812. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52813. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52814. }
  52815. return new Ci.Vector2(n,r)
  52816. }
  52817. ,
  52818. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52819. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52820. }
  52821. ,
  52822. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52823. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52824. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52825. this.v1 = e,
  52826. this.v2 = t
  52827. }, function(e) {
  52828. var t = new Ci.Vector3;
  52829. return t.subVectors(this.v2, this.v1),
  52830. t.multiplyScalar(e),
  52831. t.add(this.v1),
  52832. t
  52833. }),
  52834. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52835. this.v0 = e,
  52836. this.v1 = t,
  52837. this.v2 = i
  52838. }, function(e) {
  52839. var t = Ci.ShapeUtils.b2;
  52840. return new Ci.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))
  52841. }),
  52842. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52843. this.v0 = e,
  52844. this.v1 = t,
  52845. this.v2 = i,
  52846. this.v3 = n
  52847. }, function(e) {
  52848. var t = Ci.ShapeUtils.b3;
  52849. return new Ci.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))
  52850. }),
  52851. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52852. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52853. this.points = null == e ? [] : e
  52854. }, function(e) {
  52855. var t = this.points
  52856. , i = (t.length - 1) * e
  52857. , n = Math.floor(i)
  52858. , r = i - n
  52859. , o = t[0 == n ? n : n - 1]
  52860. , a = t[n]
  52861. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52862. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52863. , c = Ci.CurveUtils.interpolate;
  52864. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  52865. }),
  52866. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52867. Xt = new xi,
  52868. Zt = new xi,
  52869. Kt = new xi,
  52870. xi.prototype.init = function(e, t, i, n) {
  52871. this.c0 = e,
  52872. this.c1 = i,
  52873. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52874. this.c3 = 2 * e - 2 * t + i + n
  52875. }
  52876. ,
  52877. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52878. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52879. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52880. s *= o,
  52881. l *= o,
  52882. this.init(t, i, s, l)
  52883. }
  52884. ,
  52885. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52886. this.init(t, i, r * (i - e), r * (n - t))
  52887. }
  52888. ,
  52889. xi.prototype.calc = function(e) {
  52890. var t = e * e
  52891. , i = t * e;
  52892. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52893. }
  52894. ,
  52895. Ci.Curve.create(function(e) {
  52896. this.points = e || [],
  52897. this.closed = !1
  52898. }, function(e) {
  52899. var t, i, n, r, o, a, s, l, c = this.points;
  52900. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52901. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52902. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52903. n = 1),
  52904. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52905. qt),
  52906. a = c[i % r],
  52907. s = c[(i + 1) % r],
  52908. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52909. qt),
  52910. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52911. var h = "chordal" === this.type ? .5 : .25
  52912. , u = Math.pow(o.distanceToSquared(a), h)
  52913. , d = Math.pow(a.distanceToSquared(s), h)
  52914. , p = Math.pow(s.distanceToSquared(l), h);
  52915. d < 1e-4 && (d = 1),
  52916. u < 1e-4 && (u = d),
  52917. p < 1e-4 && (p = d),
  52918. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52919. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52920. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52921. } else if ("catmullrom" === this.type) {
  52922. var f = void 0 !== this.tension ? this.tension : .5;
  52923. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52924. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52925. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52926. }
  52927. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52928. })),
  52929. Ci.ClosedSplineCurve3 = function(e) {
  52930. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52931. Ci.CatmullRomCurve3.call(this, e),
  52932. this.type = "catmullrom",
  52933. this.closed = !0
  52934. }
  52935. ,
  52936. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52937. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52938. Ci.Geometry.call(this),
  52939. this.type = "BoxGeometry",
  52940. this.parameters = {
  52941. width: e,
  52942. height: t,
  52943. depth: i,
  52944. widthSegments: n,
  52945. heightSegments: r,
  52946. depthSegments: o
  52947. },
  52948. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52949. this.mergeVertices()
  52950. }
  52951. ,
  52952. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52953. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52954. Ci.CubeGeometry = Ci.BoxGeometry,
  52955. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52956. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52957. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  52958. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52959. var b = _ * u - p;
  52960. C[e] = b * n,
  52961. C[t] = E * r,
  52962. C[i] = g,
  52963. P[D] = C.x,
  52964. P[D + 1] = C.y,
  52965. P[D + 2] = C.z,
  52966. C[e] = 0,
  52967. C[t] = 0,
  52968. C[i] = 0 < s ? 1 : -1,
  52969. O[D] = C.x,
  52970. O[D + 1] = C.y,
  52971. O[D + 2] = C.z,
  52972. L[N] = _ / l,
  52973. L[N + 1] = 1 - I / c,
  52974. D += 3,
  52975. N += 2,
  52976. y += 1
  52977. }
  52978. for (I = 0; I < c; I++)
  52979. for (_ = 0; _ < l; _++) {
  52980. var w = B + _ + m * I
  52981. , T = B + _ + m * (I + 1)
  52982. , x = B + (_ + 1) + m * (I + 1)
  52983. , S = B + (_ + 1) + m * I;
  52984. R[F] = w,
  52985. R[F + 1] = T,
  52986. R[F + 2] = S,
  52987. R[F + 3] = T,
  52988. R[F + 4] = x,
  52989. R[F + 5] = S,
  52990. F += 6,
  52991. A += 6
  52992. }
  52993. M.addGroup(V, A, h),
  52994. V += A,
  52995. B += y
  52996. }
  52997. Ci.BufferGeometry.call(this),
  52998. this.type = "BoxBufferGeometry",
  52999. this.parameters = {
  53000. width: e,
  53001. height: t,
  53002. depth: i,
  53003. widthSegments: n,
  53004. heightSegments: r,
  53005. depthSegments: o
  53006. };
  53007. var M = this;
  53008. n = Math.floor(n) || 1,
  53009. r = Math.floor(r) || 1,
  53010. o = Math.floor(o) || 1;
  53011. var s, l, c, h, u = (h = 0,
  53012. h += (s = n) * (l = r) * 2,
  53013. h += s * (c = o) * 2,
  53014. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  53015. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53016. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53017. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53018. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53019. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53020. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53021. this.setIndex(new Ci.BufferAttribute(R,1)),
  53022. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53023. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53024. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53025. }
  53026. ,
  53027. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53028. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53029. Ci.CircleGeometry = function(e, t, i, n) {
  53030. Ci.Geometry.call(this),
  53031. this.type = "CircleGeometry",
  53032. this.parameters = {
  53033. radius: e,
  53034. segments: t,
  53035. thetaStart: i,
  53036. thetaLength: n
  53037. },
  53038. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53039. }
  53040. ,
  53041. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53042. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53043. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53044. Ci.BufferGeometry.call(this),
  53045. this.type = "CircleBufferGeometry",
  53046. this.parameters = {
  53047. radius: e,
  53048. segments: t,
  53049. thetaStart: i,
  53050. thetaLength: n
  53051. },
  53052. e = e || 50,
  53053. t = void 0 !== t ? Math.max(3, t) : 8,
  53054. i = void 0 !== i ? i : 0,
  53055. n = void 0 !== n ? n : 2 * Math.PI;
  53056. var r = t + 2
  53057. , o = new Float32Array(3 * r)
  53058. , a = new Float32Array(3 * r)
  53059. , s = new Float32Array(2 * r);
  53060. a[2] = 1,
  53061. s[0] = .5,
  53062. s[1] = .5;
  53063. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53064. c += 3,
  53065. h += 2) {
  53066. var u = i + l / t * n;
  53067. o[c] = e * Math.cos(u),
  53068. o[c + 1] = e * Math.sin(u),
  53069. a[c + 2] = 1,
  53070. s[h] = (o[c] / e + 1) / 2,
  53071. s[h + 1] = (o[c + 1] / e + 1) / 2
  53072. }
  53073. var d = [];
  53074. for (c = 1; c <= t; c++)
  53075. d.push(c, c + 1, 0);
  53076. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53077. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53078. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53079. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53080. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53081. }
  53082. ,
  53083. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53084. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53085. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53086. function t(e) {
  53087. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53088. for (i = b,
  53089. t = 1; t <= m; t++)
  53090. I.setXYZ(b, 0, x * s, 0),
  53091. E.setXYZ(b, 0, s, 0),
  53092. !0 === e ? (r.x = t / m,
  53093. r.y = 0) : (r.x = (t - 1) / m,
  53094. r.y = 1),
  53095. _.setXY(b, r.x, r.y),
  53096. b++;
  53097. for (n = b,
  53098. t = 0; t <= m; t++) {
  53099. var l = t / m;
  53100. o.x = a * Math.sin(l * A + y),
  53101. o.y = x * s,
  53102. o.z = a * Math.cos(l * A + y),
  53103. I.setXYZ(b, o.x, o.y, o.z),
  53104. E.setXYZ(b, 0, s, 0),
  53105. _.setXY(b, l, !0 === e ? 1 : 0),
  53106. b++
  53107. }
  53108. for (t = 0; t < m; t++) {
  53109. var c = i + t
  53110. , h = n + t;
  53111. !0 === e ? (C.setX(w, h),
  53112. w++,
  53113. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53114. w++,
  53115. C.setX(w, h)),
  53116. w++,
  53117. C.setX(w, c),
  53118. w++
  53119. }
  53120. }
  53121. Ci.BufferGeometry.call(this),
  53122. this.type = "CylinderBufferGeometry",
  53123. this.parameters = {
  53124. radiusTop: p,
  53125. radiusBottom: f,
  53126. height: g,
  53127. radialSegments: m,
  53128. heightSegments: v,
  53129. openEnded: e,
  53130. thetaStart: y,
  53131. thetaLength: A
  53132. },
  53133. p = void 0 !== p ? p : 20,
  53134. f = void 0 !== f ? f : 20,
  53135. g = void 0 !== g ? g : 100,
  53136. m = Math.floor(m) || 8,
  53137. v = Math.floor(v) || 1,
  53138. e = void 0 !== e && e,
  53139. y = void 0 !== y ? y : 0,
  53140. A = void 0 !== A ? A : 2 * Math.PI;
  53141. var i, n, r = (n = (m + 1) * (v + 1),
  53142. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53143. n), o = (i = m * v * 2 * 3,
  53144. !1 === e && (i += 2 * m * 3),
  53145. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  53146. (function() {
  53147. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53148. for (t = 0; t <= v; t++) {
  53149. var o = []
  53150. , a = t / v
  53151. , s = a * (f - p) + p;
  53152. for (e = 0; e <= m; e++) {
  53153. var l = e / m;
  53154. n.x = s * Math.sin(l * A + y),
  53155. n.y = -a * g + x,
  53156. n.z = s * Math.cos(l * A + y),
  53157. I.setXYZ(b, n.x, n.y, n.z),
  53158. i.copy(n),
  53159. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53160. i.z = Math.cos(l * A + y)),
  53161. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53162. E.setXYZ(b, i.x, i.y, i.z),
  53163. _.setXY(b, l, 1 - a),
  53164. o.push(b),
  53165. b++
  53166. }
  53167. T.push(o)
  53168. }
  53169. for (e = 0; e < m; e++)
  53170. for (t = 0; t < v; t++) {
  53171. var c = T[t][e]
  53172. , h = T[t + 1][e]
  53173. , u = T[t + 1][e + 1]
  53174. , d = T[t][e + 1];
  53175. C.setX(w, c),
  53176. w++,
  53177. C.setX(w, h),
  53178. w++,
  53179. C.setX(w, d),
  53180. w++,
  53181. C.setX(w, h),
  53182. w++,
  53183. C.setX(w, u),
  53184. w++,
  53185. C.setX(w, d),
  53186. w++
  53187. }
  53188. }
  53189. )(),
  53190. !1 === e && (0 < p && t(!0),
  53191. 0 < f && t(!1)),
  53192. this.setIndex(C),
  53193. this.addAttribute("position", I),
  53194. this.addAttribute("normal", E),
  53195. this.addAttribute("uv", _)
  53196. }
  53197. ,
  53198. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53199. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53200. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53201. Ci.Geometry.call(this),
  53202. this.type = "CylinderGeometry",
  53203. this.parameters = {
  53204. radiusTop: e,
  53205. radiusBottom: t,
  53206. height: i,
  53207. radialSegments: n,
  53208. heightSegments: r,
  53209. openEnded: o,
  53210. thetaStart: a,
  53211. thetaLength: s
  53212. },
  53213. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53214. this.mergeVertices()
  53215. }
  53216. ,
  53217. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53218. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53219. Ci.EdgesGeometry = function(e, t) {
  53220. function i(e, t) {
  53221. return e - t
  53222. }
  53223. Ci.BufferGeometry.call(this),
  53224. t = void 0 !== t ? t : 1;
  53225. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53226. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53227. n.mergeVertices(),
  53228. n.computeFaceNormals();
  53229. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53230. for (var d = c[h], p = 0; p < 3; p++) {
  53231. o[0] = d[s[p]],
  53232. o[1] = d[s[(p + 1) % 3]],
  53233. o.sort(i),
  53234. void 0 === a[g = o.toString()] ? a[g] = {
  53235. vert1: o[0],
  53236. vert2: o[1],
  53237. face1: h,
  53238. face2: void 0
  53239. } : a[g].face2 = h
  53240. }
  53241. var f = [];
  53242. for (var g in a) {
  53243. var m = a[g];
  53244. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53245. var v = l[m.vert1];
  53246. f.push(v.x),
  53247. f.push(v.y),
  53248. f.push(v.z),
  53249. v = l[m.vert2],
  53250. f.push(v.x),
  53251. f.push(v.y),
  53252. f.push(v.z)
  53253. }
  53254. }
  53255. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53256. }
  53257. ,
  53258. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53259. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53260. Ci.ExtrudeGeometry = function(e, t) {
  53261. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53262. this.type = "ExtrudeGeometry",
  53263. e = Array.isArray(e) ? e : [e],
  53264. this.addShapeList(e, t),
  53265. void this.computeFaceNormals())
  53266. }
  53267. ;
  53268. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53269. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53270. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53271. for (var i = e.length, n = 0; n < i; n++) {
  53272. var r = e[n];
  53273. this.addShape(r, t)
  53274. }
  53275. }
  53276. ,
  53277. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53278. function i(e, t, i) {
  53279. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53280. t.clone().multiplyScalar(i).add(e)
  53281. }
  53282. function n(e, t, i) {
  53283. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  53284. if (Math.abs(u) > Number.EPSILON) {
  53285. var d = Math.sqrt(h)
  53286. , p = Math.sqrt(l * l + c * c)
  53287. , f = t.x - s / d
  53288. , g = t.y + a / d
  53289. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53290. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53291. if (v <= 2)
  53292. return new Ci.Vector2(n,r);
  53293. o = Math.sqrt(v / 2)
  53294. } else {
  53295. var y = !1;
  53296. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53297. o = y ? (n = -s,
  53298. r = a,
  53299. Math.sqrt(h)) : (n = a,
  53300. r = s,
  53301. Math.sqrt(h / 2))
  53302. }
  53303. return new Ci.Vector2(n / o,r / o)
  53304. }
  53305. function r(e, t) {
  53306. var i, n;
  53307. for (G = e.length; 0 <= --G; ) {
  53308. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53309. var r = 0
  53310. , o = A + 2 * m;
  53311. for (r = 0; r < o; r++) {
  53312. var a = U * r
  53313. , s = U * (r + 1);
  53314. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53315. }
  53316. }
  53317. }
  53318. function o(e, t, i) {
  53319. T.vertices.push(new Ci.Vector3(e,t,i))
  53320. }
  53321. function a(e, t, i) {
  53322. e += x,
  53323. t += x,
  53324. i += x,
  53325. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53326. var n = E.generateTopUV(T, e, t, i);
  53327. T.faceVertexUvs[0].push(n)
  53328. }
  53329. function l(e, t, i, n) {
  53330. e += x,
  53331. t += x,
  53332. i += x,
  53333. n += x,
  53334. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53335. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53336. var r = E.generateSideWallUV(T, e, t, i, n);
  53337. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53338. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53339. }
  53340. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  53341. C && (s = C.getSpacedPoints(A),
  53342. v = !(I = !0),
  53343. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53344. h = new Ci.Vector3,
  53345. u = new Ci.Vector3,
  53346. d = new Ci.Vector3),
  53347. v || (g = f = m = 0);
  53348. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53349. if (P) {
  53350. for (M = M.reverse(),
  53351. b = 0,
  53352. w = R.length; b < w; b++)
  53353. _ = R[b],
  53354. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53355. P = !1
  53356. }
  53357. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53358. , L = M;
  53359. for (b = 0,
  53360. w = R.length; b < w; b++)
  53361. _ = R[b],
  53362. M = M.concat(_);
  53363. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  53364. j++,
  53365. Y++)
  53366. j === W && (j = 0),
  53367. Y === W && (Y = 0),
  53368. z[G] = n(L[G], L[j], L[Y]);
  53369. var q, X, Z = [], K = z.concat();
  53370. for (b = 0,
  53371. w = R.length; b < w; b++) {
  53372. for (_ = R[b],
  53373. q = [],
  53374. G = 0,
  53375. j = (W = _.length) - 1,
  53376. Y = G + 1; G < W; G++,
  53377. j++,
  53378. Y++)
  53379. j === W && (j = 0),
  53380. Y === W && (Y = 0),
  53381. q[G] = n(_[G], _[j], _[Y]);
  53382. Z.push(q),
  53383. K = K.concat(q)
  53384. }
  53385. for (D = 0; D < m; D++) {
  53386. for (B = f * (1 - (F = D / m)),
  53387. N = g * Math.sin(F * Math.PI / 2),
  53388. G = 0,
  53389. W = L.length; G < W; G++)
  53390. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53391. for (b = 0,
  53392. w = R.length; b < w; b++)
  53393. for (_ = R[b],
  53394. q = Z[b],
  53395. G = 0,
  53396. W = _.length; G < W; G++)
  53397. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53398. }
  53399. for (N = g,
  53400. G = 0; G < U; G++)
  53401. V = v ? i(M[G], K[G], N) : M[G],
  53402. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53403. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53404. d.copy(s[0]).add(u).add(h),
  53405. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53406. for (X = 1; X <= A; X++)
  53407. for (G = 0; G < U; G++)
  53408. V = v ? i(M[G], K[G], N) : M[G],
  53409. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53410. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53411. d.copy(s[X]).add(u).add(h),
  53412. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53413. for (D = m - 1; 0 <= D; D--) {
  53414. for (B = f * (1 - (F = D / m)),
  53415. N = g * Math.sin(F * Math.PI / 2),
  53416. G = 0,
  53417. W = L.length; G < W; G++)
  53418. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53419. for (b = 0,
  53420. w = R.length; b < w; b++)
  53421. for (_ = R[b],
  53422. q = Z[b],
  53423. G = 0,
  53424. W = _.length; G < W; G++)
  53425. V = i(_[G], q[G], N),
  53426. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53427. }
  53428. (function() {
  53429. if (v) {
  53430. var e = 0
  53431. , t = U * e;
  53432. for (G = 0; G < H; G++)
  53433. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53434. for (t = U * (e = A + 2 * m),
  53435. G = 0; G < H; G++)
  53436. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53437. } else {
  53438. for (G = 0; G < H; G++)
  53439. a((k = O[G])[2], k[1], k[0]);
  53440. for (G = 0; G < H; G++)
  53441. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53442. }
  53443. }
  53444. )(),
  53445. function() {
  53446. var e = 0;
  53447. for (r(L, e),
  53448. e += L.length,
  53449. b = 0,
  53450. w = R.length; b < w; b++)
  53451. r(_ = R[b], e),
  53452. e += _.length
  53453. }()
  53454. }
  53455. ,
  53456. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53457. generateTopUV: function(e, t, i, n) {
  53458. var r = e.vertices
  53459. , o = r[t]
  53460. , a = r[i]
  53461. , s = r[n];
  53462. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53463. },
  53464. generateSideWallUV: function(e, t, i, n, r) {
  53465. var o = e.vertices
  53466. , a = o[t]
  53467. , s = o[i]
  53468. , l = o[n]
  53469. , c = o[r];
  53470. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  53471. }
  53472. },
  53473. Ci.ShapeGeometry = function(e, t) {
  53474. Ci.Geometry.call(this),
  53475. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53476. this.addShapeList(e, t),
  53477. this.computeFaceNormals()
  53478. }
  53479. ,
  53480. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53481. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53482. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53483. for (var i = 0, n = e.length; i < n; i++)
  53484. this.addShape(e[i], t);
  53485. return this
  53486. }
  53487. ,
  53488. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53489. void 0 === t && (t = {});
  53490. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  53491. if (d) {
  53492. for (h = h.reverse(),
  53493. i = 0,
  53494. n = u.length; i < n; i++)
  53495. r = u[i],
  53496. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53497. d = !1
  53498. }
  53499. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53500. for (i = 0,
  53501. n = u.length; i < n; i++)
  53502. r = u[i],
  53503. h = h.concat(r);
  53504. var f, g, m = h.length, v = p.length;
  53505. for (i = 0; i < m; i++)
  53506. f = h[i],
  53507. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53508. for (i = 0; i < v; i++) {
  53509. var y = (g = p[i])[0] + l
  53510. , A = g[1] + l
  53511. , C = g[2] + l;
  53512. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53513. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53514. }
  53515. }
  53516. ,
  53517. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53518. Ci.BufferGeometry.call(this),
  53519. this.type = "LatheBufferGeometry",
  53520. this.parameters = {
  53521. points: e,
  53522. segments: t,
  53523. phiStart: i,
  53524. phiLength: n
  53525. },
  53526. t = Math.floor(t) || 12,
  53527. i = i || 0,
  53528. n = n || 2 * Math.PI,
  53529. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53530. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  53531. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53532. for (o = 0; o <= t; o++) {
  53533. var v = i + o * f * n
  53534. , y = Math.sin(v)
  53535. , A = Math.cos(v);
  53536. for (a = 0; a <= e.length - 1; a++)
  53537. g.x = e[a].x * y,
  53538. g.y = e[a].y,
  53539. g.z = e[a].x * A,
  53540. h.setXYZ(d, g.x, g.y, g.z),
  53541. m.x = o / t,
  53542. m.y = a / (e.length - 1),
  53543. u.setXY(d, m.x, m.y),
  53544. d++
  53545. }
  53546. for (o = 0; o < t; o++)
  53547. for (a = 0; a < e.length - 1; a++) {
  53548. var C = r = a + o * e.length
  53549. , I = r + e.length
  53550. , E = r + e.length + 1
  53551. , _ = r + 1;
  53552. c.setX(p, C),
  53553. p++,
  53554. c.setX(p, I),
  53555. p++,
  53556. c.setX(p, _),
  53557. p++,
  53558. c.setX(p, I),
  53559. p++,
  53560. c.setX(p, E),
  53561. p++,
  53562. c.setX(p, _),
  53563. p++
  53564. }
  53565. if (this.setIndex(c),
  53566. this.addAttribute("position", h),
  53567. this.addAttribute("uv", u),
  53568. this.computeVertexNormals(),
  53569. n === 2 * Math.PI) {
  53570. var b = this.attributes.normal.array
  53571. , w = new Ci.Vector3
  53572. , T = new Ci.Vector3
  53573. , x = new Ci.Vector3;
  53574. for (r = t * e.length * 3,
  53575. a = o = 0; o < e.length; o++,
  53576. a += 3)
  53577. w.x = b[a + 0],
  53578. w.y = b[a + 1],
  53579. w.z = b[a + 2],
  53580. T.x = b[r + a + 0],
  53581. T.y = b[r + a + 1],
  53582. T.z = b[r + a + 2],
  53583. x.addVectors(w, T).normalize(),
  53584. b[a + 0] = b[r + a + 0] = x.x,
  53585. b[a + 1] = b[r + a + 1] = x.y,
  53586. b[a + 2] = b[r + a + 2] = x.z
  53587. }
  53588. }
  53589. ,
  53590. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53591. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53592. Ci.LatheGeometry = function(e, t, i, n) {
  53593. Ci.Geometry.call(this),
  53594. this.type = "LatheGeometry",
  53595. this.parameters = {
  53596. points: e,
  53597. segments: t,
  53598. phiStart: i,
  53599. phiLength: n
  53600. },
  53601. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53602. this.mergeVertices()
  53603. }
  53604. ,
  53605. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53606. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53607. Ci.PlaneGeometry = function(e, t, i, n) {
  53608. Ci.Geometry.call(this),
  53609. this.type = "PlaneGeometry",
  53610. this.parameters = {
  53611. width: e,
  53612. height: t,
  53613. widthSegments: i,
  53614. heightSegments: n
  53615. },
  53616. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53617. }
  53618. ,
  53619. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53620. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53621. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53622. Ci.BufferGeometry.call(this),
  53623. this.type = "PlaneBufferGeometry",
  53624. this.parameters = {
  53625. width: e,
  53626. height: t,
  53627. widthSegments: i,
  53628. heightSegments: n
  53629. };
  53630. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53631. for (var y = v * u - o, A = 0; A < l; A++) {
  53632. var C = A * h - r;
  53633. d[g] = C,
  53634. d[g + 1] = -y,
  53635. p[g + 2] = 1,
  53636. f[m] = A / a,
  53637. f[m + 1] = 1 - v / s,
  53638. g += 3,
  53639. m += 2
  53640. }
  53641. g = 0;
  53642. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53643. for (v = 0; v < s; v++)
  53644. for (A = 0; A < a; A++) {
  53645. var E = A + l * v
  53646. , _ = A + l * (v + 1)
  53647. , b = A + 1 + l * (v + 1)
  53648. , w = A + 1 + l * v;
  53649. I[g] = E,
  53650. I[g + 1] = _,
  53651. I[g + 2] = w,
  53652. I[g + 3] = _,
  53653. I[g + 4] = b,
  53654. I[g + 5] = w,
  53655. g += 6
  53656. }
  53657. this.setIndex(new Ci.BufferAttribute(I,1)),
  53658. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53659. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53660. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53661. }
  53662. ,
  53663. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53664. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53665. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53666. Ci.BufferGeometry.call(this),
  53667. this.type = "RingBufferGeometry",
  53668. this.parameters = {
  53669. innerRadius: e,
  53670. outerRadius: t,
  53671. thetaSegments: i,
  53672. phiSegments: n,
  53673. thetaStart: r,
  53674. thetaLength: o
  53675. },
  53676. e = e || 20,
  53677. t = t || 50,
  53678. r = void 0 !== r ? r : 0,
  53679. o = void 0 !== o ? o : 2 * Math.PI;
  53680. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  53681. for (s = 0; s <= n; s++) {
  53682. for (l = 0; l <= i; l++)
  53683. a = r + l / i * o,
  53684. A.x = v * Math.cos(a),
  53685. A.y = v * Math.sin(a),
  53686. d.setXYZ(g, A.x, A.y, A.z),
  53687. p.setXYZ(g, 0, 0, 1),
  53688. C.x = (A.x / t + 1) / 2,
  53689. C.y = (A.y / t + 1) / 2,
  53690. f.setXY(g, C.x, C.y),
  53691. g++;
  53692. v += y
  53693. }
  53694. for (s = 0; s < n; s++) {
  53695. var I = s * (i + 1);
  53696. for (l = 0; l < i; l++) {
  53697. var E = a = l + I
  53698. , _ = a + i + 1
  53699. , b = a + i + 2
  53700. , w = a + 1;
  53701. u.setX(m, E),
  53702. m++,
  53703. u.setX(m, _),
  53704. m++,
  53705. u.setX(m, b),
  53706. m++,
  53707. u.setX(m, E),
  53708. m++,
  53709. u.setX(m, b),
  53710. m++,
  53711. u.setX(m, w),
  53712. m++
  53713. }
  53714. }
  53715. this.setIndex(u),
  53716. this.addAttribute("position", d),
  53717. this.addAttribute("normal", p),
  53718. this.addAttribute("uv", f)
  53719. }
  53720. ,
  53721. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53722. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53723. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53724. Ci.Geometry.call(this),
  53725. this.type = "RingGeometry",
  53726. this.parameters = {
  53727. innerRadius: e,
  53728. outerRadius: t,
  53729. thetaSegments: i,
  53730. phiSegments: n,
  53731. thetaStart: r,
  53732. thetaLength: o
  53733. },
  53734. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53735. }
  53736. ,
  53737. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53738. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53739. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53740. Ci.Geometry.call(this),
  53741. this.type = "SphereGeometry",
  53742. this.parameters = {
  53743. radius: e,
  53744. widthSegments: t,
  53745. heightSegments: i,
  53746. phiStart: n,
  53747. phiLength: r,
  53748. thetaStart: o,
  53749. thetaLength: a
  53750. },
  53751. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53752. }
  53753. ,
  53754. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53755. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53756. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53757. Ci.BufferGeometry.call(this),
  53758. this.type = "SphereBufferGeometry",
  53759. this.parameters = {
  53760. radius: e,
  53761. widthSegments: t,
  53762. heightSegments: i,
  53763. phiStart: n,
  53764. phiLength: r,
  53765. thetaStart: o,
  53766. thetaLength: a
  53767. },
  53768. e = e || 50,
  53769. t = Math.max(3, Math.floor(t) || 8),
  53770. i = Math.max(2, Math.floor(i) || 6),
  53771. n = void 0 !== n ? n : 0,
  53772. r = void 0 !== r ? r : 2 * Math.PI;
  53773. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  53774. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53775. var A = y / t
  53776. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53777. , I = e * Math.cos(o + v * a)
  53778. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53779. f.set(C, I, E).normalize(),
  53780. c.setXYZ(d, C, I, E),
  53781. h.setXYZ(d, f.x, f.y, f.z),
  53782. u.setXY(d, A, 1 - v),
  53783. m.push(d),
  53784. d++
  53785. }
  53786. p.push(m)
  53787. }
  53788. var _ = [];
  53789. for (g = 0; g < i; g++)
  53790. for (y = 0; y < t; y++) {
  53791. var b = p[g][y + 1]
  53792. , w = p[g][y]
  53793. , T = p[g + 1][y]
  53794. , x = p[g + 1][y + 1];
  53795. (0 !== g || 0 < o) && _.push(b, w, x),
  53796. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53797. }
  53798. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53799. this.addAttribute("position", c),
  53800. this.addAttribute("normal", h),
  53801. this.addAttribute("uv", u),
  53802. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53803. }
  53804. ,
  53805. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53806. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53807. Ci.TextGeometry = function(e, t) {
  53808. var i = (t = t || {}).font;
  53809. if (i instanceof Ci.Font == 0)
  53810. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53811. new Ci.Geometry;
  53812. var n = i.generateShapes(e, t.size, t.curveSegments);
  53813. t.amount = void 0 !== t.height ? t.height : 50,
  53814. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53815. void 0 === t.bevelSize && (t.bevelSize = 8),
  53816. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53817. Ci.ExtrudeGeometry.call(this, n, t),
  53818. this.type = "TextGeometry"
  53819. }
  53820. ,
  53821. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53822. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53823. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53824. Ci.BufferGeometry.call(this),
  53825. this.type = "TorusBufferGeometry",
  53826. this.parameters = {
  53827. radius: e,
  53828. tube: t,
  53829. radialSegments: i,
  53830. tubularSegments: n,
  53831. arc: r
  53832. },
  53833. e = e || 100,
  53834. t = t || 40,
  53835. i = Math.floor(i) || 8,
  53836. n = Math.floor(n) || 6,
  53837. r = r || 2 * Math.PI;
  53838. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  53839. for (o = 0; o <= i; o++)
  53840. for (a = 0; a <= n; a++) {
  53841. var A = a / n * r
  53842. , C = o / i * Math.PI * 2;
  53843. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53844. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53845. v.z = t * Math.sin(C),
  53846. h[p] = v.x,
  53847. h[p + 1] = v.y,
  53848. h[p + 2] = v.z,
  53849. m.x = e * Math.cos(A),
  53850. m.y = e * Math.sin(A),
  53851. y.subVectors(v, m).normalize(),
  53852. u[p] = y.x,
  53853. u[p + 1] = y.y,
  53854. u[p + 2] = y.z,
  53855. d[f] = a / n,
  53856. d[f + 1] = o / i,
  53857. p += 3,
  53858. f += 2
  53859. }
  53860. for (o = 1; o <= i; o++)
  53861. for (a = 1; a <= n; a++) {
  53862. var I = (n + 1) * o + a - 1
  53863. , E = (n + 1) * (o - 1) + a - 1
  53864. , _ = (n + 1) * (o - 1) + a
  53865. , b = (n + 1) * o + a;
  53866. c[g] = I,
  53867. c[g + 1] = E,
  53868. c[g + 2] = b,
  53869. c[g + 3] = E,
  53870. c[g + 4] = _,
  53871. c[g + 5] = b,
  53872. g += 6
  53873. }
  53874. this.setIndex(new Ci.BufferAttribute(c,1)),
  53875. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53876. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53877. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53878. }
  53879. ,
  53880. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53881. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53882. Ci.TorusGeometry = function(e, t, i, n, r) {
  53883. Ci.Geometry.call(this),
  53884. this.type = "TorusGeometry",
  53885. this.parameters = {
  53886. radius: e,
  53887. tube: t,
  53888. radialSegments: i,
  53889. tubularSegments: n,
  53890. arc: r
  53891. },
  53892. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53893. }
  53894. ,
  53895. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53896. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53897. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53898. function a(e, t, i, n, r) {
  53899. var o = Math.cos(e)
  53900. , a = Math.sin(e)
  53901. , s = i / t * e
  53902. , l = Math.cos(s);
  53903. r.x = n * (2 + l) * .5 * o,
  53904. r.y = n * (2 + l) * a * .5,
  53905. r.z = n * Math.sin(s) * .5
  53906. }
  53907. Ci.BufferGeometry.call(this),
  53908. this.type = "TorusKnotBufferGeometry",
  53909. this.parameters = {
  53910. radius: e,
  53911. tube: t,
  53912. tubularSegments: i,
  53913. radialSegments: n,
  53914. p: r,
  53915. q: o
  53916. },
  53917. e = e || 100,
  53918. t = t || 40,
  53919. i = Math.floor(i) || 64,
  53920. r = r || 2,
  53921. o = o || 3;
  53922. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  53923. for (s = 0; s <= i; ++s) {
  53924. var w = s / i * r * Math.PI * 2;
  53925. for (a(w, r, o, e, C),
  53926. a(.01 + w, r, o, e, I),
  53927. _.subVectors(I, C),
  53928. b.addVectors(I, C),
  53929. E.crossVectors(_, b),
  53930. b.crossVectors(E, _),
  53931. E.normalize(),
  53932. b.normalize(),
  53933. l = 0; l <= n; ++l) {
  53934. var T = l / n * Math.PI * 2
  53935. , x = -t * Math.cos(T)
  53936. , S = t * Math.sin(T);
  53937. v.x = C.x + (x * b.x + S * E.x),
  53938. v.y = C.y + (x * b.y + S * E.y),
  53939. v.z = C.z + (x * b.z + S * E.z),
  53940. d.setXYZ(g, v.x, v.y, v.z),
  53941. y.subVectors(v, C).normalize(),
  53942. p.setXYZ(g, y.x, y.y, y.z),
  53943. A.x = s / i,
  53944. A.y = l / n,
  53945. f.setXY(g, A.x, A.y),
  53946. g++
  53947. }
  53948. }
  53949. for (l = 1; l <= i; l++)
  53950. for (s = 1; s <= n; s++) {
  53951. var M = (n + 1) * (l - 1) + (s - 1)
  53952. , R = (n + 1) * l + (s - 1)
  53953. , P = (n + 1) * l + s
  53954. , O = (n + 1) * (l - 1) + s;
  53955. u.setX(m, M),
  53956. m++,
  53957. u.setX(m, R),
  53958. m++,
  53959. u.setX(m, O),
  53960. m++,
  53961. u.setX(m, R),
  53962. m++,
  53963. u.setX(m, P),
  53964. m++,
  53965. u.setX(m, O),
  53966. m++
  53967. }
  53968. this.setIndex(u),
  53969. this.addAttribute("position", d),
  53970. this.addAttribute("normal", p),
  53971. this.addAttribute("uv", f)
  53972. }
  53973. ,
  53974. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53975. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53976. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53977. Ci.Geometry.call(this),
  53978. this.type = "TorusKnotGeometry",
  53979. this.parameters = {
  53980. radius: e,
  53981. tube: t,
  53982. tubularSegments: i,
  53983. radialSegments: n,
  53984. p: r,
  53985. q: o
  53986. },
  53987. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53988. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53989. this.mergeVertices()
  53990. }
  53991. ,
  53992. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53993. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53994. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53995. Ci.Geometry.call(this),
  53996. this.type = "TubeGeometry",
  53997. this.parameters = {
  53998. path: e,
  53999. segments: t,
  54000. radius: i,
  54001. radialSegments: n,
  54002. closed: r,
  54003. taper: o
  54004. },
  54005. t = t || 64,
  54006. i = i || 1,
  54007. n = n || 8,
  54008. r = r || !1,
  54009. o = o || Ci.TubeGeometry.NoTaper;
  54010. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  54011. for (this.tangents = D,
  54012. this.normals = N,
  54013. this.binormals = F,
  54014. f = 0; f < P; f++)
  54015. for (M[f] = [],
  54016. l = f / (P - 1),
  54017. p = e.getPointAt(l),
  54018. D[f],
  54019. a = N[f],
  54020. s = F[f],
  54021. h = i * o(l),
  54022. g = 0; g < n; g++)
  54023. c = g / n * 2 * Math.PI,
  54024. u = -h * Math.cos(c),
  54025. d = h * Math.sin(c),
  54026. O.copy(p),
  54027. O.x += u * a.x + d * s.x,
  54028. O.y += u * a.y + d * s.y,
  54029. O.z += u * a.z + d * s.z,
  54030. M[f][g] = (T = O.x,
  54031. x = O.y,
  54032. S = O.z,
  54033. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54034. for (f = 0; f < t; f++)
  54035. for (g = 0; g < n; g++)
  54036. m = r ? (f + 1) % t : f + 1,
  54037. v = (g + 1) % n,
  54038. y = M[f][g],
  54039. A = M[m][g],
  54040. C = M[m][v],
  54041. I = M[f][v],
  54042. E = new Ci.Vector2(f / t,g / n),
  54043. _ = new Ci.Vector2((f + 1) / t,g / n),
  54044. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54045. w = new Ci.Vector2(f / t,(g + 1) / n),
  54046. this.faces.push(new Ci.Face3(y,A,I)),
  54047. this.faceVertexUvs[0].push([E, _, w]),
  54048. this.faces.push(new Ci.Face3(A,C,I)),
  54049. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54050. this.computeFaceNormals(),
  54051. this.computeVertexNormals()
  54052. }
  54053. ,
  54054. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54055. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54056. Ci.TubeGeometry.NoTaper = function(e) {
  54057. return 1
  54058. }
  54059. ,
  54060. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54061. return Math.sin(Math.PI * e)
  54062. }
  54063. ,
  54064. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54065. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  54066. for (this.tangents = u,
  54067. this.normals = d,
  54068. this.binormals = p,
  54069. l = 0; l < m; l++)
  54070. c = l / (m - 1),
  54071. u[l] = e.getTangentAt(c),
  54072. u[l].normalize();
  54073. for (d[0] = new Ci.Vector3,
  54074. p[0] = new Ci.Vector3,
  54075. r = Number.MAX_VALUE,
  54076. o = Math.abs(u[0].x),
  54077. a = Math.abs(u[0].y),
  54078. s = Math.abs(u[0].z),
  54079. o <= r && (r = o,
  54080. h.set(1, 0, 0)),
  54081. a <= r && (r = a,
  54082. h.set(0, 1, 0)),
  54083. s <= r && h.set(0, 0, 1),
  54084. f.crossVectors(u[0], h).normalize(),
  54085. d[0].crossVectors(u[0], f),
  54086. p[0].crossVectors(u[0], d[0]),
  54087. l = 1; l < m; l++)
  54088. d[l] = d[l - 1].clone(),
  54089. p[l] = p[l - 1].clone(),
  54090. f.crossVectors(u[l - 1], u[l]),
  54091. f.length() > Number.EPSILON && (f.normalize(),
  54092. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54093. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54094. p[l].crossVectors(u[l], d[l]);
  54095. if (i)
  54096. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54097. n /= m - 1,
  54098. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54099. l = 1; l < m; l++)
  54100. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54101. p[l].crossVectors(u[l], d[l])
  54102. }
  54103. ,
  54104. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54105. function f(e) {
  54106. var t = e.normalize().clone();
  54107. t.index = m.vertices.push(t) - 1;
  54108. var i = a(e) / 2 / Math.PI + .5
  54109. , n = function(e) {
  54110. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54111. }(e) / Math.PI + .5;
  54112. return t.uv = new Ci.Vector2(i,1 - n),
  54113. t
  54114. }
  54115. function g(e, t, i, n) {
  54116. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54117. m.faces.push(r),
  54118. y.copy(e).add(t).add(i).divideScalar(3);
  54119. var o = a(y);
  54120. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54121. }
  54122. function r(e, t) {
  54123. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  54124. a[l] = [];
  54125. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  54126. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54127. }
  54128. for (l = 0; l < i; l++)
  54129. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54130. var p = Math.floor(d / 2);
  54131. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  54132. }
  54133. }
  54134. function a(e) {
  54135. return Math.atan2(e.z, -e.x)
  54136. }
  54137. function s(e, t, i) {
  54138. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54139. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54140. e.clone()
  54141. }
  54142. Ci.Geometry.call(this),
  54143. this.type = "PolyhedronGeometry",
  54144. this.parameters = {
  54145. vertices: e,
  54146. indices: t,
  54147. radius: i,
  54148. detail: n
  54149. },
  54150. i = i || 1,
  54151. n = n || 0;
  54152. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54153. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54154. var c = this.vertices
  54155. , h = []
  54156. , u = (o = 0,
  54157. 0);
  54158. for (l = t.length; o < l; o += 3,
  54159. u++) {
  54160. var d = c[t[o]]
  54161. , p = c[t[o + 1]]
  54162. , v = c[t[o + 2]];
  54163. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54164. }
  54165. var y = new Ci.Vector3;
  54166. for (o = 0,
  54167. l = h.length; o < l; o++)
  54168. r(h[o], n);
  54169. for (o = 0,
  54170. l = this.faceVertexUvs[0].length; o < l; o++) {
  54171. var A = this.faceVertexUvs[0][o]
  54172. , C = A[0].x
  54173. , I = A[1].x
  54174. , E = A[2].x
  54175. , _ = Math.max(C, I, E)
  54176. , b = Math.min(C, I, E);
  54177. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54178. I < .2 && (A[1].x += 1),
  54179. E < .2 && (A[2].x += 1))
  54180. }
  54181. for (o = 0,
  54182. l = this.vertices.length; o < l; o++)
  54183. this.vertices[o].multiplyScalar(i);
  54184. this.mergeVertices(),
  54185. this.computeFaceNormals(),
  54186. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54187. }
  54188. ,
  54189. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54190. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54191. Ci.DodecahedronGeometry = function(e, t) {
  54192. var i = (1 + Math.sqrt(5)) / 2
  54193. , n = 1 / i
  54194. , r = [-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, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  54195. Ci.PolyhedronGeometry.call(this, r, [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], e, t),
  54196. this.type = "DodecahedronGeometry",
  54197. this.parameters = {
  54198. radius: e,
  54199. detail: t
  54200. }
  54201. }
  54202. ,
  54203. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54204. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54205. Ci.IcosahedronGeometry = function(e, t) {
  54206. var i = (1 + Math.sqrt(5)) / 2
  54207. , n = [-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];
  54208. Ci.PolyhedronGeometry.call(this, n, [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], e, t),
  54209. this.type = "IcosahedronGeometry",
  54210. this.parameters = {
  54211. radius: e,
  54212. detail: t
  54213. }
  54214. }
  54215. ,
  54216. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54217. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54218. Ci.OctahedronGeometry = function(e, t) {
  54219. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  54220. this.type = "OctahedronGeometry",
  54221. this.parameters = {
  54222. radius: e,
  54223. detail: t
  54224. }
  54225. }
  54226. ,
  54227. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54228. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54229. Ci.TetrahedronGeometry = function(e, t) {
  54230. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  54231. this.type = "TetrahedronGeometry",
  54232. this.parameters = {
  54233. radius: e,
  54234. detail: t
  54235. }
  54236. }
  54237. ,
  54238. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54239. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54240. Ci.ParametricGeometry = function(e, t, i) {
  54241. Ci.Geometry.call(this),
  54242. this.type = "ParametricGeometry",
  54243. this.parameters = {
  54244. func: e,
  54245. slices: t,
  54246. stacks: i
  54247. };
  54248. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  54249. for (n = 0; n <= i; n++)
  54250. for (a = n / i,
  54251. r = 0; r <= t; r++)
  54252. o = e(r / t, a),
  54253. g.push(o);
  54254. for (n = 0; n < i; n++)
  54255. for (r = 0; r < t; r++)
  54256. l = (s = n * y + r) + 1,
  54257. c = (n + 1) * y + r + 1,
  54258. h = (n + 1) * y + r,
  54259. u = new Ci.Vector2(r / t,n / i),
  54260. d = new Ci.Vector2((r + 1) / t,n / i),
  54261. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54262. f = new Ci.Vector2(r / t,(n + 1) / i),
  54263. m.push(new Ci.Face3(s,l,h)),
  54264. v.push([u, d, f]),
  54265. m.push(new Ci.Face3(l,c,h)),
  54266. v.push([d.clone(), p, f.clone()]);
  54267. this.computeFaceNormals(),
  54268. this.computeVertexNormals()
  54269. }
  54270. ,
  54271. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54272. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54273. Ci.WireframeGeometry = function(e) {
  54274. function t(e, t) {
  54275. return e - t
  54276. }
  54277. Ci.BufferGeometry.call(this);
  54278. var i = [0, 0]
  54279. , n = {}
  54280. , r = ["a", "b", "c"];
  54281. if (e instanceof Ci.Geometry) {
  54282. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54283. for (var u = a[c], d = 0; d < 3; d++) {
  54284. i[0] = u[r[d]],
  54285. i[1] = u[r[(d + 1) % 3]],
  54286. i.sort(t),
  54287. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54288. l[2 * s + 1] = i[1],
  54289. n[E] = !0,
  54290. s++)
  54291. }
  54292. var p = new Float32Array(2 * s * 3);
  54293. for (c = 0,
  54294. h = s; c < h; c++)
  54295. for (d = 0; d < 2; d++) {
  54296. var f = o[l[2 * c + d]];
  54297. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54298. p[_ + 1] = f.y,
  54299. p[_ + 2] = f.z
  54300. }
  54301. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54302. } else if (e instanceof Ci.BufferGeometry)
  54303. if (null !== e.index) {
  54304. var g = e.index.array
  54305. , m = (o = e.attributes.position,
  54306. e.groups);
  54307. s = 0;
  54308. 0 === m.length && e.addGroup(0, g.length);
  54309. l = new Uint32Array(2 * g.length);
  54310. for (var v = 0, y = m.length; v < y; ++v)
  54311. for (var A = m[v], C = A.start, I = (c = C,
  54312. C + A.count); c < I; c += 3)
  54313. for (d = 0; d < 3; d++) {
  54314. var E;
  54315. i[0] = g[c + d],
  54316. i[1] = g[c + (d + 1) % 3],
  54317. i.sort(t),
  54318. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54319. l[2 * s + 1] = i[1],
  54320. n[E] = !0,
  54321. s++)
  54322. }
  54323. for (p = new Float32Array(2 * s * 3),
  54324. c = 0,
  54325. h = s; c < h; c++)
  54326. for (d = 0; d < 2; d++) {
  54327. var _ = 6 * c + 3 * d
  54328. , b = l[2 * c + d];
  54329. p[_ + 0] = o.getX(b),
  54330. p[_ + 1] = o.getY(b),
  54331. p[_ + 2] = o.getZ(b)
  54332. }
  54333. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54334. } else {
  54335. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54336. for (p = new Float32Array(2 * s * 3),
  54337. c = 0,
  54338. h = w; c < h; c++)
  54339. for (d = 0; d < 3; d++) {
  54340. var T = 9 * c + 3 * d;
  54341. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54342. p[_ + 1] = o[1 + T],
  54343. p[_ + 2] = o[2 + T];
  54344. b = 9 * c + (d + 1) % 3 * 3;
  54345. p[_ + 3] = o[b],
  54346. p[_ + 4] = o[b + 1],
  54347. p[_ + 5] = o[b + 2]
  54348. }
  54349. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54350. }
  54351. }
  54352. ,
  54353. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54354. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54355. Ci.AxisHelper = function(e) {
  54356. e = e || 1;
  54357. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54358. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54359. , n = new Ci.BufferGeometry;
  54360. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54361. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54362. var r = new Ci.LineBasicMaterial({
  54363. vertexColors: Ci.VertexColors
  54364. });
  54365. Ci.LineSegments.call(this, n, r)
  54366. }
  54367. ,
  54368. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54369. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54370. Ci.ArrowHelper = function() {
  54371. var a = new Ci.Geometry;
  54372. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54373. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54374. return s.translate(0, -.5, 0),
  54375. function(e, t, i, n, r, o) {
  54376. Ci.Object3D.call(this),
  54377. void 0 === n && (n = 16776960),
  54378. void 0 === i && (i = 1),
  54379. void 0 === r && (r = .2 * i),
  54380. void 0 === o && (o = .2 * r),
  54381. this.position.copy(t),
  54382. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54383. color: n
  54384. })),
  54385. this.line.matrixAutoUpdate = !1,
  54386. this.add(this.line),
  54387. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54388. color: n
  54389. })),
  54390. this.cone.matrixAutoUpdate = !1,
  54391. this.add(this.cone),
  54392. this.setDirection(e),
  54393. this.setLength(i, r, o)
  54394. }
  54395. }(),
  54396. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54397. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54398. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54399. function(e) {
  54400. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  54401. yi = Math.acos(e.y),
  54402. this.quaternion.setFromAxisAngle(Ai, yi))
  54403. }
  54404. ),
  54405. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54406. void 0 === t && (t = .2 * e),
  54407. void 0 === i && (i = .2 * t),
  54408. this.line.scale.set(1, Math.max(0, e - t), 1),
  54409. this.line.updateMatrix(),
  54410. this.cone.scale.set(i, t, i),
  54411. this.cone.position.y = e,
  54412. this.cone.updateMatrix()
  54413. }
  54414. ,
  54415. Ci.ArrowHelper.prototype.setColor = function(e) {
  54416. this.line.material.color.set(e),
  54417. this.cone.material.color.set(e)
  54418. }
  54419. ,
  54420. Ci.BoxHelper = function(e) {
  54421. 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])
  54422. , i = new Float32Array(24)
  54423. , n = new Ci.BufferGeometry;
  54424. n.setIndex(new Ci.BufferAttribute(t,1)),
  54425. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54426. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54427. color: 16776960
  54428. })),
  54429. void 0 !== e && this.update(e)
  54430. }
  54431. ,
  54432. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54433. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54434. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54435. function(e) {
  54436. if (vi.setFromObject(e),
  54437. !vi.isEmpty()) {
  54438. var t = vi.min
  54439. , i = vi.max
  54440. , n = this.geometry.attributes.position
  54441. , r = n.array;
  54442. r[0] = i.x,
  54443. r[1] = i.y,
  54444. r[2] = i.z,
  54445. r[3] = t.x,
  54446. r[4] = i.y,
  54447. r[5] = i.z,
  54448. r[6] = t.x,
  54449. r[7] = t.y,
  54450. r[8] = i.z,
  54451. r[9] = i.x,
  54452. r[10] = t.y,
  54453. r[11] = i.z,
  54454. r[12] = i.x,
  54455. r[13] = i.y,
  54456. r[14] = t.z,
  54457. r[15] = t.x,
  54458. r[16] = i.y,
  54459. r[17] = t.z,
  54460. r[18] = t.x,
  54461. r[19] = t.y,
  54462. r[20] = t.z,
  54463. r[21] = i.x,
  54464. r[22] = t.y,
  54465. r[23] = t.z,
  54466. n.needsUpdate = !0,
  54467. this.geometry.computeBoundingSphere()
  54468. }
  54469. }
  54470. ),
  54471. Ci.BoundingBoxHelper = function(e, t) {
  54472. var i = void 0 !== t ? t : 8947848;
  54473. this.object = e,
  54474. this.box = new Ci.Box3,
  54475. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54476. color: i,
  54477. wireframe: !0
  54478. }))
  54479. }
  54480. ,
  54481. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54482. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54483. Ci.BoundingBoxHelper.prototype.update = function() {
  54484. this.box.setFromObject(this.object),
  54485. this.box.size(this.scale),
  54486. this.box.center(this.position)
  54487. }
  54488. ,
  54489. Ci.CameraHelper = function(e) {
  54490. function t(e, t, i) {
  54491. n(e, i),
  54492. n(t, i)
  54493. }
  54494. function n(e, t) {
  54495. i.vertices.push(new Ci.Vector3),
  54496. i.colors.push(new Ci.Color(t)),
  54497. void 0 === o[e] && (o[e] = []),
  54498. o[e].push(i.vertices.length - 1)
  54499. }
  54500. var i = new Ci.Geometry
  54501. , r = new Ci.LineBasicMaterial({
  54502. color: 16777215,
  54503. vertexColors: Ci.FaceColors
  54504. })
  54505. , o = {}
  54506. , a = 16755200
  54507. , s = 16711680
  54508. , l = 3355443;
  54509. t("n1", "n2", a),
  54510. t("n2", "n4", a),
  54511. t("n4", "n3", a),
  54512. t("n3", "n1", a),
  54513. t("f1", "f2", a),
  54514. t("f2", "f4", a),
  54515. t("f4", "f3", a),
  54516. t("f3", "f1", a),
  54517. t("n1", "f1", a),
  54518. t("n2", "f2", a),
  54519. t("n3", "f3", a),
  54520. t("n4", "f4", a),
  54521. t("p", "n1", s),
  54522. t("p", "n2", s),
  54523. t("p", "n3", s),
  54524. t("p", "n4", s),
  54525. t("u1", "u2", 43775),
  54526. t("u2", "u3", 43775),
  54527. t("u3", "u1", 43775),
  54528. t("c", "t", 16777215),
  54529. t("p", "c", l),
  54530. t("cn1", "cn2", l),
  54531. t("cn3", "cn4", l),
  54532. t("cf1", "cf2", l),
  54533. t("cf3", "cf4", l),
  54534. Ci.LineSegments.call(this, i, r),
  54535. this.camera = e,
  54536. this.camera.updateProjectionMatrix(),
  54537. this.matrix = e.matrixWorld,
  54538. this.matrixAutoUpdate = !1,
  54539. this.pointMap = o,
  54540. this.update()
  54541. }
  54542. ,
  54543. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54544. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54545. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54546. mi = new Ci.Camera,
  54547. function() {
  54548. pi = this.geometry,
  54549. fi = this.pointMap,
  54550. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54551. Ni("c", 0, 0, -1),
  54552. Ni("t", 0, 0, 1),
  54553. Ni("n1", -1, -1, -1),
  54554. Ni("n2", 1, -1, -1),
  54555. Ni("n3", -1, 1, -1),
  54556. Ni("n4", 1, 1, -1),
  54557. Ni("f1", -1, -1, 1),
  54558. Ni("f2", 1, -1, 1),
  54559. Ni("f3", -1, 1, 1),
  54560. Ni("f4", 1, 1, 1),
  54561. Ni("u1", .7, 1.1, -1),
  54562. Ni("u2", -.7, 1.1, -1),
  54563. Ni("u3", 0, 2, -1),
  54564. Ni("cf1", -1, 0, 1),
  54565. Ni("cf2", 1, 0, 1),
  54566. Ni("cf3", 0, -1, 1),
  54567. Ni("cf4", 0, 1, 1),
  54568. Ni("cn1", -1, 0, -1),
  54569. Ni("cn2", 1, 0, -1),
  54570. Ni("cn3", 0, -1, -1),
  54571. Ni("cn4", 0, 1, -1),
  54572. pi.verticesNeedUpdate = !0
  54573. }
  54574. ),
  54575. Ci.DirectionalLightHelper = function(e, t) {
  54576. Ci.Object3D.call(this),
  54577. this.light = e,
  54578. this.light.updateMatrixWorld(),
  54579. this.matrix = e.matrixWorld,
  54580. this.matrixAutoUpdate = !1,
  54581. t = t || 1;
  54582. var i = new Ci.Geometry;
  54583. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54584. var n = new Ci.LineBasicMaterial({
  54585. fog: !1
  54586. });
  54587. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54588. this.lightPlane = new Ci.Line(i,n),
  54589. this.add(this.lightPlane),
  54590. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54591. (n = new Ci.LineBasicMaterial({
  54592. fog: !1
  54593. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54594. this.targetLine = new Ci.Line(i,n),
  54595. this.add(this.targetLine),
  54596. this.update()
  54597. }
  54598. ,
  54599. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54600. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54601. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54602. this.lightPlane.geometry.dispose(),
  54603. this.lightPlane.material.dispose(),
  54604. this.targetLine.geometry.dispose(),
  54605. this.targetLine.material.dispose()
  54606. }
  54607. ,
  54608. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54609. ui = new Ci.Vector3,
  54610. di = new Ci.Vector3,
  54611. function() {
  54612. hi.setFromMatrixPosition(this.light.matrixWorld),
  54613. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54614. di.subVectors(ui, hi),
  54615. this.lightPlane.lookAt(di),
  54616. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54617. this.targetLine.geometry.vertices[1].copy(di),
  54618. this.targetLine.geometry.verticesNeedUpdate = !0,
  54619. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54620. }
  54621. ),
  54622. Ci.EdgesHelper = function(e, t, i) {
  54623. var n = void 0 !== t ? t : 16777215;
  54624. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54625. color: n
  54626. })),
  54627. this.matrix = e.matrixWorld,
  54628. this.matrixAutoUpdate = !1
  54629. }
  54630. ,
  54631. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54632. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54633. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54634. this.object = e,
  54635. this.size = void 0 !== t ? t : 1;
  54636. var r = void 0 !== i ? i : 16776960
  54637. , o = void 0 !== n ? n : 1
  54638. , a = 0
  54639. , s = this.object.geometry;
  54640. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54641. var l = new Ci.BufferGeometry
  54642. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54643. l.addAttribute("position", c),
  54644. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54645. color: r,
  54646. linewidth: o
  54647. })),
  54648. this.matrixAutoUpdate = !1,
  54649. this.update()
  54650. }
  54651. ,
  54652. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54653. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54654. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54655. li = new Ci.Vector3,
  54656. ci = new Ci.Matrix3,
  54657. function() {
  54658. this.object.updateMatrixWorld(!0),
  54659. ci.getNormalMatrix(this.object.matrixWorld);
  54660. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  54661. var l = r[a]
  54662. , c = l.normal;
  54663. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54664. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54665. t.setXYZ(o, si.x, si.y, si.z),
  54666. o += 1,
  54667. t.setXYZ(o, li.x, li.y, li.z),
  54668. o += 1
  54669. }
  54670. return t.needsUpdate = !0,
  54671. this
  54672. }
  54673. ),
  54674. Ci.GridHelper = function(e, t) {
  54675. var i = new Ci.Geometry
  54676. , n = new Ci.LineBasicMaterial({
  54677. vertexColors: Ci.VertexColors
  54678. });
  54679. this.color1 = new Ci.Color(4473924),
  54680. this.color2 = new Ci.Color(8947848);
  54681. for (var r = -e; r <= e; r += t) {
  54682. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  54683. var o = 0 === r ? this.color1 : this.color2;
  54684. i.colors.push(o, o, o, o)
  54685. }
  54686. Ci.LineSegments.call(this, i, n)
  54687. }
  54688. ,
  54689. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54690. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54691. Ci.GridHelper.prototype.setColors = function(e, t) {
  54692. this.color1.set(e),
  54693. this.color2.set(t),
  54694. this.geometry.colorsNeedUpdate = !0
  54695. }
  54696. ,
  54697. Ci.HemisphereLightHelper = function(e, t) {
  54698. Ci.Object3D.call(this),
  54699. this.light = e,
  54700. this.light.updateMatrixWorld(),
  54701. this.matrix = e.matrixWorld,
  54702. this.matrixAutoUpdate = !1,
  54703. this.colors = [new Ci.Color, new Ci.Color];
  54704. var i = new Ci.SphereGeometry(t,4,2);
  54705. i.rotateX(-Math.PI / 2);
  54706. for (var n = 0; n < 8; n++)
  54707. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54708. var r = new Ci.MeshBasicMaterial({
  54709. vertexColors: Ci.FaceColors,
  54710. wireframe: !0
  54711. });
  54712. this.lightSphere = new Ci.Mesh(i,r),
  54713. this.add(this.lightSphere),
  54714. this.update()
  54715. }
  54716. ,
  54717. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54718. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54719. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54720. this.lightSphere.geometry.dispose(),
  54721. this.lightSphere.material.dispose()
  54722. }
  54723. ,
  54724. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54725. function() {
  54726. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54727. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54728. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54729. this.lightSphere.geometry.colorsNeedUpdate = !0
  54730. }
  54731. ),
  54732. Ci.PointLightHelper = function(e, t) {
  54733. this.light = e,
  54734. this.light.updateMatrixWorld();
  54735. var i = new Ci.SphereGeometry(t,4,2)
  54736. , n = new Ci.MeshBasicMaterial({
  54737. wireframe: !0,
  54738. fog: !1
  54739. });
  54740. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54741. Ci.Mesh.call(this, i, n),
  54742. this.matrix = this.light.matrixWorld,
  54743. this.matrixAutoUpdate = !1
  54744. }
  54745. ,
  54746. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54747. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54748. Ci.PointLightHelper.prototype.dispose = function() {
  54749. this.geometry.dispose(),
  54750. this.material.dispose()
  54751. }
  54752. ,
  54753. Ci.PointLightHelper.prototype.update = function() {
  54754. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54755. }
  54756. ,
  54757. Ci.SkeletonHelper = function(e) {
  54758. this.bones = this.getBoneList(e);
  54759. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54760. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54761. t.vertices.push(new Ci.Vector3),
  54762. t.colors.push(new Ci.Color(0,0,1)),
  54763. t.colors.push(new Ci.Color(0,1,0)))
  54764. }
  54765. t.dynamic = !0;
  54766. var n = new Ci.LineBasicMaterial({
  54767. vertexColors: Ci.VertexColors,
  54768. depthTest: !1,
  54769. depthWrite: !1,
  54770. transparent: !0
  54771. });
  54772. Ci.LineSegments.call(this, t, n),
  54773. this.root = e,
  54774. this.matrix = e.matrixWorld,
  54775. this.matrixAutoUpdate = !1,
  54776. this.update()
  54777. }
  54778. ,
  54779. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54780. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54781. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54782. var t = [];
  54783. e instanceof Ci.Bone && t.push(e);
  54784. for (var i = 0; i < e.children.length; i++)
  54785. t.push.apply(t, this.getBoneList(e.children[i]));
  54786. return t
  54787. }
  54788. ,
  54789. Ci.SkeletonHelper.prototype.update = function() {
  54790. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  54791. var o = this.bones[r];
  54792. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54793. e.vertices[n].setFromMatrixPosition(i),
  54794. i.multiplyMatrices(t, o.parent.matrixWorld),
  54795. e.vertices[n + 1].setFromMatrixPosition(i),
  54796. n += 2)
  54797. }
  54798. e.verticesNeedUpdate = !0,
  54799. e.computeBoundingSphere()
  54800. }
  54801. ,
  54802. Ci.SpotLightHelper = function(e) {
  54803. Ci.Object3D.call(this),
  54804. this.light = e,
  54805. this.light.updateMatrixWorld(),
  54806. this.matrix = e.matrixWorld,
  54807. this.matrixAutoUpdate = !1;
  54808. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54809. t.translate(0, -.5, 0),
  54810. t.rotateX(-Math.PI / 2);
  54811. var i = new Ci.MeshBasicMaterial({
  54812. wireframe: !0,
  54813. fog: !1
  54814. });
  54815. this.cone = new Ci.Mesh(t,i),
  54816. this.add(this.cone),
  54817. this.update()
  54818. }
  54819. ,
  54820. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54821. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54822. Ci.SpotLightHelper.prototype.dispose = function() {
  54823. this.cone.geometry.dispose(),
  54824. this.cone.material.dispose()
  54825. }
  54826. ,
  54827. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54828. oi = new Ci.Vector3,
  54829. function() {
  54830. var e = this.light.distance ? this.light.distance : 1e4
  54831. , t = e * Math.tan(this.light.angle);
  54832. this.cone.scale.set(t, t, e),
  54833. ri.setFromMatrixPosition(this.light.matrixWorld),
  54834. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54835. this.cone.lookAt(oi.sub(ri)),
  54836. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54837. }
  54838. ),
  54839. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54840. this.object = e,
  54841. this.size = void 0 !== t ? t : 1;
  54842. var r = void 0 !== i ? i : 16711680
  54843. , o = void 0 !== n ? n : 1
  54844. , a = 0
  54845. , s = this.object.geometry;
  54846. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54847. var l = new Ci.BufferGeometry
  54848. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54849. l.addAttribute("position", c),
  54850. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54851. color: r,
  54852. linewidth: o
  54853. })),
  54854. this.matrixAutoUpdate = !1,
  54855. this.update()
  54856. }
  54857. ,
  54858. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54859. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54860. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54861. ii = new Ci.Vector3,
  54862. ni = new Ci.Matrix3,
  54863. function() {
  54864. var e = ["a", "b", "c"];
  54865. this.object.updateMatrixWorld(!0),
  54866. ni.getNormalMatrix(this.object.matrixWorld);
  54867. var t = this.object.matrixWorld
  54868. , i = this.geometry.attributes.position
  54869. , n = this.object.geometry;
  54870. if (n instanceof Ci.Geometry)
  54871. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54872. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54873. var d = r[c[e[h]]]
  54874. , p = c.vertexNormals[h];
  54875. ti.copy(d).applyMatrix4(t),
  54876. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54877. i.setXYZ(a, ti.x, ti.y, ti.z),
  54878. a += 1,
  54879. i.setXYZ(a, ii.x, ii.y, ii.z),
  54880. a += 1
  54881. }
  54882. else if (n instanceof Ci.BufferGeometry) {
  54883. var f = n.attributes.position
  54884. , g = n.attributes.normal;
  54885. for (h = a = 0,
  54886. u = f.count; h < u; h++)
  54887. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54888. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54889. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54890. i.setXYZ(a, ti.x, ti.y, ti.z),
  54891. a += 1,
  54892. i.setXYZ(a, ii.x, ii.y, ii.z),
  54893. a += 1
  54894. }
  54895. return i.needsUpdate = !0,
  54896. this
  54897. }
  54898. ),
  54899. Ci.WireframeHelper = function(e, t) {
  54900. var i = void 0 !== t ? t : 16777215;
  54901. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54902. color: i
  54903. })),
  54904. this.matrix = e.matrixWorld,
  54905. this.matrixAutoUpdate = !1
  54906. }
  54907. ,
  54908. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54909. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54910. Ci.ImmediateRenderObject = function(e) {
  54911. Ci.Object3D.call(this),
  54912. this.material = e,
  54913. this.render = function(e) {}
  54914. }
  54915. ,
  54916. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54917. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54918. Ci.MorphBlendMesh = function(e, t) {
  54919. Ci.Mesh.call(this, e, t),
  54920. this.animationsMap = {},
  54921. this.animationsList = [];
  54922. var i = this.geometry.morphTargets.length
  54923. , n = i - 1
  54924. , r = i / 1;
  54925. this.createAnimation("__default", 0, n, r),
  54926. this.setAnimationWeight("__default", 1)
  54927. }
  54928. ,
  54929. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54930. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54931. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54932. var r = {
  54933. start: t,
  54934. end: i,
  54935. length: i - t + 1,
  54936. fps: n,
  54937. duration: (i - t) / n,
  54938. lastFrame: 0,
  54939. currentFrame: 0,
  54940. active: !1,
  54941. time: 0,
  54942. direction: 1,
  54943. weight: 1,
  54944. directionBackwards: !1,
  54945. mirroredLoop: !1
  54946. };
  54947. this.animationsMap[e] = r,
  54948. this.animationsList.push(r)
  54949. }
  54950. ,
  54951. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54952. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54953. var s = r.morphTargets[o].name.match(i);
  54954. if (s && 1 < s.length)
  54955. n[l = s[1]] || (n[l] = {
  54956. start: 1 / 0,
  54957. end: -1 / 0
  54958. }),
  54959. o < (c = n[l]).start && (c.start = o),
  54960. o > c.end && (c.end = o),
  54961. t = t || l
  54962. }
  54963. for (var l in n) {
  54964. var c = n[l];
  54965. this.createAnimation(l, c.start, c.end, e)
  54966. }
  54967. this.firstAnimation = t
  54968. }
  54969. ,
  54970. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54971. var t = this.animationsMap[e];
  54972. t && (t.direction = 1,
  54973. t.directionBackwards = !1)
  54974. }
  54975. ,
  54976. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54977. var t = this.animationsMap[e];
  54978. t && (t.direction = -1,
  54979. t.directionBackwards = !0)
  54980. }
  54981. ,
  54982. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54983. var i = this.animationsMap[e];
  54984. i && (i.fps = t,
  54985. i.duration = (i.end - i.start) / i.fps)
  54986. }
  54987. ,
  54988. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54989. var i = this.animationsMap[e];
  54990. i && (i.duration = t,
  54991. i.fps = (i.end - i.start) / i.duration)
  54992. }
  54993. ,
  54994. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54995. var i = this.animationsMap[e];
  54996. i && (i.weight = t)
  54997. }
  54998. ,
  54999. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55000. var i = this.animationsMap[e];
  55001. i && (i.time = t)
  55002. }
  55003. ,
  55004. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55005. var t = 0
  55006. , i = this.animationsMap[e];
  55007. return i && (t = i.time),
  55008. t
  55009. }
  55010. ,
  55011. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55012. var t = -1
  55013. , i = this.animationsMap[e];
  55014. return i && (t = i.duration),
  55015. t
  55016. }
  55017. ,
  55018. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55019. var t = this.animationsMap[e];
  55020. t ? (t.time = 0,
  55021. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55022. }
  55023. ,
  55024. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55025. var t = this.animationsMap[e];
  55026. t && (t.active = !1)
  55027. }
  55028. ,
  55029. Ci.MorphBlendMesh.prototype.update = function(e) {
  55030. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55031. var n = this.animationsList[t];
  55032. if (n.active) {
  55033. var r = n.duration / n.length;
  55034. n.time += n.direction * e,
  55035. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55036. n.time > n.duration && (n.time = n.duration,
  55037. n.directionBackwards = !0),
  55038. n.time < 0 && (n.time = 0,
  55039. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55040. n.time < 0 && (n.time += n.duration));
  55041. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55042. , a = n.weight;
  55043. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55044. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55045. this.morphTargetInfluences[o] = 0,
  55046. n.lastFrame = n.currentFrame,
  55047. n.currentFrame = o);
  55048. var s = n.time % r / r;
  55049. n.directionBackwards && (s = 1 - s),
  55050. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55051. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55052. }
  55053. }
  55054. }
  55055. ,
  55056. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55057. i.THREE = Ci) : this.THREE = Ci
  55058. window.THREE = Ci
  55059. getObjLoader()
  55060. }
  55061. , {}]
  55062. }, {}, [116]);